compiler/libec; ide/debugger: Fixed potentially uninitialized Operands
[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 if(exp->type == 3 && op.kind == 13)
10651 {
10652 op.ui64 = (uint64)exp->string;
10653 op.kind = 13;
10654 op.ops = uint64Ops;
10655 }
10656 else if(exp->isConstant && exp->type == 2)
10657 {
10658 op.kind = type->kind;
10659 op.type = exp->expType;
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->type && op2->type && 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 = (char)0;
12216
12217 if(GetChar(e, &value))
12218 {
12219 FreeExpContents(exp);
12220 exp->constant = PrintChar(value);
12221 exp->type = 2;
12222 }
12223 }
12224 else
12225 {
12226 unsigned char value = (unsigned char)0;
12227
12228 if(GetUChar(e, &value))
12229 {
12230 FreeExpContents(exp);
12231 exp->constant = PrintUChar(value);
12232 exp->type = 2;
12233 }
12234 }
12235 break;
12236 case 2:
12237 if(type->isSigned)
12238 {
12239 short value = (short)0;
12240
12241 if(GetShort(e, &value))
12242 {
12243 FreeExpContents(exp);
12244 exp->constant = PrintShort(value);
12245 exp->type = 2;
12246 }
12247 }
12248 else
12249 {
12250 unsigned short value = (unsigned short)0;
12251
12252 if(GetUShort(e, &value))
12253 {
12254 FreeExpContents(exp);
12255 exp->constant = PrintUShort(value);
12256 exp->type = 2;
12257 }
12258 }
12259 break;
12260 case 3:
12261 if(type->isSigned)
12262 {
12263 int value = 0;
12264
12265 if(GetInt(e, &value))
12266 {
12267 FreeExpContents(exp);
12268 exp->constant = PrintInt(value);
12269 exp->type = 2;
12270 }
12271 }
12272 else
12273 {
12274 unsigned int value = 0;
12275
12276 if(GetUInt(e, &value))
12277 {
12278 FreeExpContents(exp);
12279 exp->constant = PrintUInt(value);
12280 exp->type = 2;
12281 }
12282 }
12283 break;
12284 case 4:
12285 if(type->isSigned)
12286 {
12287 long long value = 0;
12288
12289 if(GetInt64(e, &value))
12290 {
12291 FreeExpContents(exp);
12292 exp->constant = PrintInt64(value);
12293 exp->type = 2;
12294 }
12295 }
12296 else
12297 {
12298 uint64 value = 0;
12299
12300 if(GetUInt64(e, &value))
12301 {
12302 FreeExpContents(exp);
12303 exp->constant = PrintUInt64(value);
12304 exp->type = 2;
12305 }
12306 }
12307 break;
12308 case 22:
12309 if(type->isSigned)
12310 {
12311 intptr_t value = 0;
12312
12313 if(GetIntPtr(e, &value))
12314 {
12315 FreeExpContents(exp);
12316 exp->constant = PrintInt64((long long)value);
12317 exp->type = 2;
12318 }
12319 }
12320 else
12321 {
12322 uintptr_t value = 0;
12323
12324 if(GetUIntPtr(e, &value))
12325 {
12326 FreeExpContents(exp);
12327 exp->constant = PrintUInt64((uint64)value);
12328 exp->type = 2;
12329 }
12330 }
12331 break;
12332 case 23:
12333 if(type->isSigned)
12334 {
12335 ssize_t value = 0;
12336
12337 if(GetIntSize(e, &value))
12338 {
12339 FreeExpContents(exp);
12340 exp->constant = PrintInt64((long long)value);
12341 exp->type = 2;
12342 }
12343 }
12344 else
12345 {
12346 size_t value = 0;
12347
12348 if(GetUIntSize(e, &value))
12349 {
12350 FreeExpContents(exp);
12351 exp->constant = PrintUInt64((uint64)value);
12352 exp->type = 2;
12353 }
12354 }
12355 break;
12356 case 6:
12357 {
12358 float value = 0;
12359
12360 if(GetFloat(e, &value))
12361 {
12362 FreeExpContents(exp);
12363 exp->constant = PrintFloat(value);
12364 exp->type = 2;
12365 }
12366 break;
12367 }
12368 case 7:
12369 {
12370 double value = 0;
12371
12372 if(GetDouble(e, &value))
12373 {
12374 FreeExpContents(exp);
12375 exp->constant = PrintDouble(value);
12376 exp->type = 2;
12377 }
12378 break;
12379 }
12380 }
12381 }
12382 break;
12383 }
12384 case 12:
12385 {
12386 struct Operand op1 = 
12387 {
12388 0, 0, 0, 0, 
12389 {
12390 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
12391 }
12392 };
12393 struct Operand op2 = 
12394 {
12395 0, 0, 0, 0, 
12396 {
12397 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
12398 }
12399 };
12400 struct Operand op3 = 
12401 {
12402 0, 0, 0, 0, 
12403 {
12404 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
12405 }
12406 };
12407
12408 if(exp->cond.exp)
12409 ComputeExpression((*exp->cond.exp).last);
12410 if(exp->cond.elseExp)
12411 ComputeExpression(exp->cond.elseExp);
12412 if(exp->cond.cond)
12413 ComputeExpression(exp->cond.cond);
12414 op1 = GetOperand(exp->cond.cond);
12415 if(op1.type)
12416 op1.type->refCount++;
12417 op2 = GetOperand((*exp->cond.exp).last);
12418 if(op2.type)
12419 op2.type->refCount++;
12420 op3 = GetOperand(exp->cond.elseExp);
12421 if(op3.type)
12422 op3.type->refCount++;
12423 if(op1.ops.Cond)
12424 {
12425 FreeExpContents(exp);
12426 op1.ops.Cond(exp, &op1, &op2, &op3);
12427 }
12428 if(op1.type)
12429 FreeType(op1.type);
12430 if(op2.type)
12431 FreeType(op2.type);
12432 if(op3.type)
12433 FreeType(op3.type);
12434 break;
12435 }
12436 }
12437 }
12438
12439 void ApplyAnyObjectLogic(struct Expression * e);
12440
12441 extern void CopyTypeInto(struct Type * type, struct Type * src);
12442
12443 static unsigned int CheckExpressionType(struct Expression * exp, struct Type * destType, unsigned int skipUnitBla)
12444 {
12445 unsigned int result = 0x1;
12446
12447 if(destType)
12448 {
12449 struct __ecereNameSpace__ecere__sys__OldList converts = 
12450 {
12451 0, 0, 0, 0, 0
12452 };
12453 struct Conversion * convert;
12454
12455 if(destType->kind == 0)
12456 return 0x0;
12457 if(!MatchTypeExpression(exp, destType, &converts, skipUnitBla))
12458 result = 0x0;
12459 if(converts.count)
12460 {
12461 for(convert = converts.first; convert; convert = convert->next)
12462 {
12463 unsigned int empty = !(convert->isGet ? (void *)convert->convert->Get : (void *)convert->convert->Set);
12464
12465 if(!empty)
12466 {
12467 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12468 int objectType = exp->expType ? exp->expType->classObjectType : 0;
12469
12470 *newExp = *exp;
12471 newExp->destType = (((void *)0));
12472 if(convert->isGet)
12473 {
12474 exp->type = 8;
12475 exp->addedThis = 0x1;
12476 exp->member.exp = newExp;
12477 FreeType(exp->member.exp->expType);
12478 exp->member.exp->expType = MkClassType(convert->convert->_class->fullName);
12479 exp->member.exp->expType->classObjectType = objectType;
12480 exp->member.member = MkIdentifier(convert->convert->dataTypeString);
12481 exp->member.memberType = 1;
12482 exp->expType = convert->resultType ? convert->resultType : convert->convert->dataType;
12483 exp->needCast = 0x1;
12484 if(exp->expType)
12485 exp->expType->refCount++;
12486 ApplyAnyObjectLogic(exp->member.exp);
12487 }
12488 else
12489 {
12490 {
12491 exp->type = 8;
12492 exp->addedThis = 0x1;
12493 exp->member.exp = newExp;
12494 if(newExp->expType && newExp->expType->kind == 8 && newExp->expType->_class && newExp->expType->_class->registered && newExp->expType->_class->registered->type == 5)
12495 {
12496 newExp->byReference = 0x1;
12497 }
12498 FreeType(exp->member.exp->expType);
12499 exp->member.exp->expType = (((void *)0));
12500 if(convert->convert->dataType)
12501 {
12502 exp->member.exp->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
12503 CopyTypeInto(exp->member.exp->expType, convert->convert->dataType);
12504 exp->member.exp->expType->refCount = 1;
12505 exp->member.exp->expType->classObjectType = objectType;
12506 ApplyAnyObjectLogic(exp->member.exp);
12507 }
12508 exp->member.member = MkIdentifier(convert->convert->_class->fullName);
12509 exp->member.memberType = 4;
12510 exp->expType = convert->resultType ? convert->resultType : MkClassType(convert->convert->_class->fullName);
12511 exp->needCast = 0x1;
12512 if(convert->resultType)
12513 convert->resultType->refCount++;
12514 }
12515 }
12516 }
12517 else
12518 {
12519 FreeType(exp->expType);
12520 if(convert->isGet)
12521 {
12522 exp->expType = convert->resultType ? convert->resultType : convert->convert->dataType;
12523 exp->needCast = 0x1;
12524 if(exp->expType)
12525 exp->expType->refCount++;
12526 }
12527 else
12528 {
12529 exp->expType = convert->resultType ? convert->resultType : MkClassType(convert->convert->_class->fullName);
12530 exp->needCast = 0x1;
12531 if(convert->resultType)
12532 convert->resultType->refCount++;
12533 }
12534 }
12535 }
12536 if(exp->isConstant && inCompiler)
12537 ComputeExpression(exp);
12538 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(&converts, FreeConvert);
12539 }
12540 if(!result && exp->expType && converts.count)
12541 {
12542 result = MatchTypes(exp->expType, exp->destType, (((void *)0)), (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0);
12543 }
12544 if(!result && exp->expType && exp->destType)
12545 {
12546 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))
12547 result = 0x1;
12548 }
12549 }
12550 return result;
12551 }
12552
12553 extern struct Statement * MkCompoundStmt(struct __ecereNameSpace__ecere__sys__OldList * declarations, struct __ecereNameSpace__ecere__sys__OldList * statements);
12554
12555 extern struct Statement * MkExpressionStmt(struct __ecereNameSpace__ecere__sys__OldList * expressions);
12556
12557 extern struct Expression * MkExpMember(struct Expression * expression, struct Identifier * member);
12558
12559 void CheckTemplateTypes(struct Expression * exp)
12560 {
12561 if(exp->destType && exp->destType->passAsTemplate && exp->expType && exp->expType->kind != 20 && !exp->expType->passAsTemplate)
12562 {
12563 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12564 struct Statement * compound;
12565 struct Context * context;
12566
12567 *newExp = *exp;
12568 if(exp->destType)
12569 exp->destType->refCount++;
12570 if(exp->expType)
12571 exp->expType->refCount++;
12572 newExp->prev = (((void *)0));
12573 newExp->next = (((void *)0));
12574 switch(exp->expType->kind)
12575 {
12576 case 7:
12577 if(exp->destType->classObjectType)
12578 {
12579 if(exp->destType)
12580 exp->destType->refCount--;
12581 if(exp->expType)
12582 exp->expType->refCount--;
12583 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
12584 }
12585 else
12586 {
12587 struct __ecereNameSpace__ecere__sys__OldList * specs;
12588 struct __ecereNameSpace__ecere__sys__OldList * unionDefs = MkList();
12589 struct __ecereNameSpace__ecere__sys__OldList * statements = MkList();
12590
12591 context = PushContext();
12592 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(DOUBLE)), MkListOne(MkDeclaratorIdentifier(MkIdentifier("d"))), (((void *)0)))));
12593 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifierName("uint64")), MkListOne(MkDeclaratorIdentifier(MkIdentifier("i"))), (((void *)0)))));
12594 specs = MkListOne(MkStructOrUnion(4, (((void *)0)), unionDefs));
12595 exp->type = 23;
12596 exp->compound = MkCompoundStmt(MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internal_union")), (((void *)0)))))), statements);
12597 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("d")), '=', newExp))));
12598 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("i")))));
12599 exp->compound->compound.context = context;
12600 PopContext(context);
12601 }
12602 break;
12603 default:
12604 exp->type = 11;
12605 exp->cast.typeName = MkTypeName(MkListOne(MkSpecifierName("uint64")), (((void *)0)));
12606 exp->cast.exp = MkExpBrackets(MkListOne(newExp));
12607 break;
12608 }
12609 }
12610 else if(exp->expType && exp->expType->passAsTemplate && exp->destType && ((unsigned int)((exp->usage & 0x1) >> 0)) && exp->destType->kind != 20 && !exp->destType->passAsTemplate)
12611 {
12612 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12613 struct Statement * compound;
12614 struct Context * context;
12615
12616 *newExp = *exp;
12617 if(exp->destType)
12618 exp->destType->refCount++;
12619 if(exp->expType)
12620 exp->expType->refCount++;
12621 newExp->prev = (((void *)0));
12622 newExp->next = (((void *)0));
12623 switch(exp->expType->kind)
12624 {
12625 case 7:
12626 if(exp->destType->classObjectType)
12627 {
12628 if(exp->destType)
12629 exp->destType->refCount--;
12630 if(exp->expType)
12631 exp->expType->refCount--;
12632 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
12633 }
12634 else
12635 {
12636 struct __ecereNameSpace__ecere__sys__OldList * specs;
12637 struct __ecereNameSpace__ecere__sys__OldList * unionDefs = MkList();
12638 struct __ecereNameSpace__ecere__sys__OldList * statements = MkList();
12639
12640 context = PushContext();
12641 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(DOUBLE)), MkListOne(MkDeclaratorIdentifier(MkIdentifier("d"))), (((void *)0)))));
12642 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifierName("uint64")), MkListOne(MkDeclaratorIdentifier(MkIdentifier("i"))), (((void *)0)))));
12643 specs = MkListOne(MkStructOrUnion(4, (((void *)0)), unionDefs));
12644 exp->type = 23;
12645 exp->compound = MkCompoundStmt(MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internal_union")), (((void *)0)))))), statements);
12646 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("i")), '=', newExp))));
12647 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("d")))));
12648 exp->compound->compound.context = context;
12649 PopContext(context);
12650 }
12651 break;
12652 case 8:
12653 {
12654 if(exp->expType->_class && exp->expType->_class->registered && exp->expType->_class->registered->type == 1)
12655 {
12656 exp->type = 5;
12657 exp->list = MkListOne(MkExpOp((((void *)0)), '*', MkExpCast(MkTypeName(MkListOne(MkSpecifierName(exp->expType->_class->string)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), newExp)));
12658 ProcessExpressionType((*exp->list).first);
12659 break;
12660 }
12661 else
12662 {
12663 exp->type = 5;
12664 exp->list = MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName(exp->expType->_class->string)), (((void *)0))), newExp));
12665 newExp->needCast = 0x1;
12666 ProcessExpressionType((*exp->list).first);
12667 break;
12668 }
12669 }
12670 default:
12671 {
12672 if(exp->expType->kind == 20)
12673 {
12674 struct Type * type = ProcessTemplateParameterType(exp->expType->templateParameter);
12675
12676 if(type)
12677 {
12678 FreeType(exp->destType);
12679 FreeType(exp->expType);
12680 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
12681 break;
12682 }
12683 }
12684 if(newExp->type == 8 && newExp->member.memberType == 3)
12685 {
12686 exp->type = 4;
12687 exp->op.op = '*';
12688 exp->op.exp1 = (((void *)0));
12689 exp->op.exp2 = MkExpCast(MkTypeName(MkListOne(MkSpecifierName("uint64")), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), MkExpBrackets(MkListOne(MkExpOp((((void *)0)), '&', newExp))));
12690 }
12691 else
12692 {
12693 char typeString[1024];
12694 struct Declarator * decl;
12695 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
12696
12697 typeString[0] = '\0';
12698 PrintType(exp->expType, typeString, 0x0, 0x0);
12699 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
12700 exp->type = 11;
12701 exp->cast.typeName = MkTypeName(specs, decl);
12702 exp->cast.exp = MkExpBrackets(MkListOne(newExp));
12703 exp->cast.exp->needCast = 0x1;
12704 }
12705 break;
12706 }
12707 }
12708 }
12709 }
12710
12711 extern int strncmp(const char * , const char * , size_t n);
12712
12713 struct __ecereNameSpace__ecere__sys__BTNode * __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindPrefix(struct __ecereNameSpace__ecere__sys__BinaryTree * this, char *  key);
12714
12715 static struct Symbol * ScanWithNameSpace(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, char * nameSpace, char * name)
12716 {
12717 int nsLen = strlen(nameSpace);
12718 struct Symbol * symbol;
12719
12720 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)))
12721 {
12722 char * s = symbol->string;
12723
12724 if(!strncmp(s, nameSpace, nsLen))
12725 {
12726 int c;
12727 char * namePart;
12728
12729 for(c = strlen(s) - 1; c >= 0; c--)
12730 if(s[c] == ':')
12731 break;
12732 namePart = s + c + 1;
12733 if(!strcmp(namePart, name))
12734 {
12735 return symbol;
12736 }
12737 }
12738 else
12739 break;
12740 }
12741 return (((void *)0));
12742 }
12743
12744 static struct Symbol * FindWithNameSpace(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, char * name)
12745 {
12746 int c;
12747 char nameSpace[1024];
12748 char * namePart;
12749 unsigned int gotColon = 0x0;
12750
12751 nameSpace[0] = '\0';
12752 for(c = strlen(name) - 1; c >= 0; c--)
12753 if(name[c] == ':')
12754 {
12755 gotColon = 0x1;
12756 break;
12757 }
12758 namePart = name + c + 1;
12759 while(c >= 0 && name[c] == ':')
12760 c--;
12761 if(c >= 0)
12762 {
12763 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, name);
12764
12765 if(symbol)
12766 return symbol;
12767 memcpy(nameSpace, name, c + 1);
12768 nameSpace[c + 1] = (char)0;
12769 return ScanWithNameSpace(tree, nameSpace, namePart);
12770 }
12771 else if(gotColon)
12772 {
12773 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, namePart);
12774
12775 return symbol;
12776 }
12777 else
12778 {
12779 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, namePart);
12780
12781 if(symbol)
12782 return symbol;
12783 return ScanWithNameSpace(tree, "", namePart);
12784 }
12785 return (((void *)0));
12786 }
12787
12788 static void ProcessDeclaration(struct Declaration * decl);
12789
12790 struct Symbol * FindSymbol(char * name, struct Context * startContext, struct Context * endContext, unsigned int isStruct, unsigned int globalNameSpace)
12791 {
12792 struct Context * ctx;
12793 struct Symbol * symbol = (((void *)0));
12794
12795 for(ctx = startContext; ctx && !symbol; ctx = ctx->parent)
12796 {
12797 if(ctx == globalContext && !globalNameSpace && ctx->hasNameSpace)
12798 {
12799 symbol = (((void *)0));
12800 if(thisNameSpace)
12801 {
12802 char curName[1024];
12803
12804 strcpy(curName, thisNameSpace);
12805 strcat(curName, "::");
12806 strcat(curName, name);
12807 symbol = FindWithNameSpace(isStruct ? &ctx->structSymbols : &ctx->symbols, curName);
12808 }
12809 if(!symbol)
12810 symbol = FindWithNameSpace(isStruct ? &ctx->structSymbols : &ctx->symbols, name);
12811 }
12812 else
12813 symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString((isStruct ? &ctx->structSymbols : &ctx->symbols), name);
12814 if(symbol || ctx == endContext)
12815 break;
12816 }
12817 if(inCompiler && curExternal && symbol && ctx == globalContext && curExternal->symbol && symbol->id > curExternal->symbol->idCode && symbol->pointerExternal)
12818 {
12819 if(symbol->pointerExternal->type == 0)
12820 {
12821 struct FunctionDefinition * function = symbol->pointerExternal->function;
12822 struct Context * tmpContext = curContext;
12823
12824 curContext = (((void *)0));
12825 symbol->pointerExternal = MkExternalDeclaration(MkDeclaration(CopyList(function->specifiers, CopySpecifier), MkListOne(MkInitDeclarator(CopyDeclarator(function->declarator), (((void *)0))))));
12826 curContext = tmpContext;
12827 symbol->pointerExternal->symbol = symbol;
12828 DeclareType(symbol->type, 0x1, 0x1);
12829 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, symbol->pointerExternal);
12830 symbol->id = curExternal->symbol->idCode;
12831 }
12832 else if(symbol->pointerExternal->type == 1 && curExternal->symbol->idCode < symbol->pointerExternal->symbol->id)
12833 {
12834 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
12835 symbol->id = curExternal->symbol->idCode;
12836 }
12837 }
12838 return symbol;
12839 }
12840
12841 static void GetTypeSpecs(struct Type * type, struct __ecereNameSpace__ecere__sys__OldList * specs)
12842 {
12843 if(!type->isSigned && type->kind != 22 && type->kind != 23)
12844 ListAdd(specs, MkSpecifier(UNSIGNED));
12845 switch(type->kind)
12846 {
12847 case 8:
12848 {
12849 if(type->_class->registered)
12850 {
12851 if(!type->_class->registered->dataType)
12852 type->_class->registered->dataType = ProcessTypeString(type->_class->registered->dataTypeString, 0x0);
12853 GetTypeSpecs(type->_class->registered->dataType, specs);
12854 }
12855 break;
12856 }
12857 case 7:
12858 ListAdd(specs, MkSpecifier(DOUBLE));
12859 break;
12860 case 6:
12861 ListAdd(specs, MkSpecifier(FLOAT));
12862 break;
12863 case 1:
12864 ListAdd(specs, MkSpecifier(CHAR));
12865 break;
12866 case 24:
12867 ListAdd(specs, MkSpecifier(_BOOL));
12868 break;
12869 case 2:
12870 ListAdd(specs, MkSpecifier(SHORT));
12871 break;
12872 case 4:
12873 ListAdd(specs, MkSpecifier(INT64));
12874 break;
12875 case 22:
12876 ListAdd(specs, MkSpecifierName(type->isSigned ? "intptr" : "uintptr"));
12877 break;
12878 case 23:
12879 ListAdd(specs, MkSpecifierName(type->isSigned ? "intsize" : "uintsize"));
12880 break;
12881 case 3:
12882 default:
12883 ListAdd(specs, MkSpecifier(INT));
12884 break;
12885 }
12886 }
12887
12888 static void PrintArraySize(struct Type * arrayType, char * string)
12889 {
12890 char size[256];
12891
12892 size[0] = '\0';
12893 strcat(size, "[");
12894 if(arrayType->enumClass)
12895 strcat(size, arrayType->enumClass->string);
12896 else if(arrayType->arraySizeExp)
12897 PrintExpression(arrayType->arraySizeExp, size);
12898 strcat(size, "]");
12899 strcat(string, size);
12900 }
12901
12902 static void PrintTypeSpecs(struct Type * type, char * string, unsigned int fullName, unsigned int printConst)
12903 {
12904 if(type)
12905 {
12906 if(printConst && type->constant)
12907 strcat(string, "const ");
12908 switch(type->kind)
12909 {
12910 case 8:
12911 {
12912 struct Symbol * c = type->_class;
12913
12914 if(type->classObjectType == 2)
12915 strcat(string, "typed_object");
12916 else if(type->classObjectType == 3)
12917 strcat(string, "any_object");
12918 else
12919 {
12920 if(c && c->string)
12921 strcat(string, (fullName || !c->registered) ? c->string : c->registered->name);
12922 }
12923 if(type->byReference)
12924 strcat(string, " &");
12925 break;
12926 }
12927 case 0:
12928 strcat(string, "void");
12929 break;
12930 case 3:
12931 strcat(string, type->isSigned ? "int" : "uint");
12932 break;
12933 case 4:
12934 strcat(string, type->isSigned ? "int64" : "uint64");
12935 break;
12936 case 22:
12937 strcat(string, type->isSigned ? "intptr" : "uintptr");
12938 break;
12939 case 23:
12940 strcat(string, type->isSigned ? "intsize" : "uintsize");
12941 break;
12942 case 1:
12943 strcat(string, type->isSigned ? "char" : "byte");
12944 break;
12945 case 24:
12946 strcat(string, "_Bool");
12947 break;
12948 case 2:
12949 strcat(string, type->isSigned ? "short" : "uint16");
12950 break;
12951 case 6:
12952 strcat(string, "float");
12953 break;
12954 case 7:
12955 strcat(string, "double");
12956 break;
12957 case 9:
12958 if(type->enumName)
12959 {
12960 strcat(string, "struct ");
12961 strcat(string, type->enumName);
12962 }
12963 else if(type->typeName)
12964 strcat(string, type->typeName);
12965 else
12966 {
12967 struct Type * member;
12968
12969 strcat(string, "struct { ");
12970 for(member = type->members.first; member; member = member->next)
12971 {
12972 PrintType(member, string, 0x1, fullName);
12973 strcat(string, "; ");
12974 }
12975 strcat(string, "}");
12976 }
12977 break;
12978 case 10:
12979 if(type->enumName)
12980 {
12981 strcat(string, "union ");
12982 strcat(string, type->enumName);
12983 }
12984 else if(type->typeName)
12985 strcat(string, type->typeName);
12986 else
12987 {
12988 strcat(string, "union ");
12989 strcat(string, "(unnamed)");
12990 }
12991 break;
12992 case 15:
12993 if(type->enumName)
12994 {
12995 strcat(string, "enum ");
12996 strcat(string, type->enumName);
12997 }
12998 else if(type->typeName)
12999 strcat(string, type->typeName);
13000 else
13001 strcat(string, "int");
13002 break;
13003 case 14:
13004 strcat(string, "...");
13005 break;
13006 case 19:
13007 strcat(string, "subclass(");
13008 strcat(string, type->_class ? type->_class->string : "int");
13009 strcat(string, ")");
13010 break;
13011 case 20:
13012 strcat(string, type->templateParameter->identifier->string);
13013 break;
13014 case 21:
13015 strcat(string, "thisclass");
13016 break;
13017 case 17:
13018 strcat(string, "__builtin_va_list");
13019 break;
13020 }
13021 }
13022 }
13023
13024 extern char *  __ecereNameSpace__ecere__sys__RSearchString(char *  buffer, char *  subStr, int maxLen, unsigned int matchCase, unsigned int matchWord);
13025
13026 static void PrintName(struct Type * type, char * string, unsigned int fullName)
13027 {
13028 if(type->name && type->name[0])
13029 {
13030 if(fullName)
13031 strcat(string, type->name);
13032 else
13033 {
13034 char * name = __ecereNameSpace__ecere__sys__RSearchString(type->name, "::", strlen(type->name), 0x1, 0x0);
13035
13036 if(name)
13037 name += 2;
13038 else
13039 name = type->name;
13040 strcat(string, name);
13041 }
13042 }
13043 }
13044
13045 static void PrintAttribs(struct Type * type, char * string)
13046 {
13047 if(type)
13048 {
13049 if(type->dllExport)
13050 strcat(string, "dllexport ");
13051 if(type->attrStdcall)
13052 strcat(string, "stdcall ");
13053 }
13054 }
13055
13056 static void PrePrintType(struct Type * type, char * string, unsigned int fullName, struct Type * parentType, unsigned int printConst)
13057 {
13058 if(type->kind == 12 || type->kind == 13 || type->kind == 11 || type->kind == 16)
13059 {
13060 struct Type * attrType = (((void *)0));
13061
13062 if((type->kind == 11 || type->kind == 16) && (!parentType || parentType->kind != 13))
13063 PrintAttribs(type, string);
13064 if(printConst && type->constant && (type->kind == 11 || type->kind == 16))
13065 strcat(string, " const");
13066 PrePrintType(type->kind == 16 ? type->method->dataType : type->type, string, fullName, type, printConst);
13067 if(type->kind == 13 && (type->type->kind == 12 || type->type->kind == 11 || type->type->kind == 16))
13068 strcat(string, " (");
13069 if(type->kind == 13)
13070 {
13071 if(type->type->kind == 11 || type->type->kind == 16)
13072 PrintAttribs(type->type, string);
13073 }
13074 if(type->kind == 13)
13075 {
13076 if(type->type->kind == 11 || type->type->kind == 16 || type->type->kind == 12)
13077 strcat(string, "*");
13078 else
13079 strcat(string, " *");
13080 }
13081 if(printConst && type->constant && type->kind == 13)
13082 strcat(string, " const");
13083 }
13084 else
13085 PrintTypeSpecs(type, string, fullName, printConst);
13086 }
13087
13088 static void PostPrintType(struct Type * type, char * string, unsigned int fullName)
13089 {
13090 if(type->kind == 13 && (type->type->kind == 12 || type->type->kind == 11 || type->type->kind == 16))
13091 strcat(string, ")");
13092 if(type->kind == 12)
13093 PrintArraySize(type, string);
13094 else if(type->kind == 11)
13095 {
13096 struct Type * param;
13097
13098 strcat(string, "(");
13099 for(param = type->params.first; param; param = param->next)
13100 {
13101 PrintType(param, string, 0x1, fullName);
13102 if(param->next)
13103 strcat(string, ", ");
13104 }
13105 strcat(string, ")");
13106 }
13107 if(type->kind == 12 || type->kind == 13 || type->kind == 11 || type->kind == 16)
13108 PostPrintType(type->kind == 16 ? type->method->dataType : type->type, string, fullName);
13109 }
13110
13111 static void _PrintType(struct Type * type, char * string, unsigned int printName, unsigned int fullName, unsigned int printConst)
13112 {
13113 PrePrintType(type, string, fullName, (((void *)0)), printConst);
13114 if(type->thisClass || (printName && type->name && type->name[0]))
13115 strcat(string, " ");
13116 if((type->thisClass || type->staticMethod))
13117 {
13118 struct Symbol * _class = type->thisClass;
13119
13120 if((type->classObjectType == 2 || type->classObjectType == 1) || (_class && !strcmp(_class->string, "class")))
13121 {
13122 if(type->classObjectType == 1)
13123 strcat(string, "class");
13124 else
13125 strcat(string, type->byReference ? "typed_object&" : "typed_object");
13126 }
13127 else if(_class && _class->string)
13128 {
13129 char * s = _class->string;
13130
13131 if(fullName)
13132 strcat(string, s);
13133 else
13134 {
13135 char * name = __ecereNameSpace__ecere__sys__RSearchString(s, "::", strlen(s), 0x1, 0x0);
13136
13137 if(name)
13138 name += 2;
13139 else
13140 name = s;
13141 strcat(string, name);
13142 }
13143 }
13144 strcat(string, "::");
13145 }
13146 if(printName && type->name)
13147 PrintName(type, string, fullName);
13148 PostPrintType(type, string, fullName);
13149 if(type->bitFieldCount)
13150 {
13151 char count[100];
13152
13153 sprintf(count, ":%d", type->bitFieldCount);
13154 strcat(string, count);
13155 }
13156 }
13157
13158 void PrintType(struct Type * type, char * string, unsigned int printName, unsigned int fullName)
13159 {
13160 _PrintType(type, string, printName, fullName, 0x1);
13161 }
13162
13163 void PrintTypeNoConst(struct Type * type, char * string, unsigned int printName, unsigned int fullName)
13164 {
13165 _PrintType(type, string, printName, fullName, 0x0);
13166 }
13167
13168 static struct Type * FindMember(struct Type * type, char * string)
13169 {
13170 struct Type * memberType;
13171
13172 for(memberType = type->members.first; memberType; memberType = memberType->next)
13173 {
13174 if(!memberType->name)
13175 {
13176 struct Type * subType = FindMember(memberType, string);
13177
13178 if(subType)
13179 return subType;
13180 }
13181 else if(!strcmp(memberType->name, string))
13182 return memberType;
13183 }
13184 return (((void *)0));
13185 }
13186
13187 struct Type * FindMemberAndOffset(struct Type * type, char * string, unsigned int * offset)
13188 {
13189 struct Type * memberType;
13190
13191 for(memberType = type->members.first; memberType; memberType = memberType->next)
13192 {
13193 if(!memberType->name)
13194 {
13195 struct Type * subType = FindMember(memberType, string);
13196
13197 if(subType)
13198 {
13199 *offset += memberType->offset;
13200 return subType;
13201 }
13202 }
13203 else if(!strcmp(memberType->name, string))
13204 {
13205 *offset += memberType->offset;
13206 return memberType;
13207 }
13208 }
13209 return (((void *)0));
13210 }
13211
13212 extern unsigned int parseError;
13213
13214 unsigned int GetParseError()
13215 {
13216 return parseError;
13217 }
13218
13219 extern struct __ecereNameSpace__ecere__com__Instance * fileInput;
13220
13221 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Write;
13222
13223 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__File;
13224
13225 struct Expression * ParseExpressionString(char * expression)
13226 {
13227 parseError = 0x0;
13228 fileInput = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
13229 ((int (*)(struct __ecereNameSpace__ecere__com__Instance *, void *  buffer, unsigned int size, unsigned int count))__extension__ ({
13230 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
13231
13232 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
13233 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Write])(fileInput, expression, 1, strlen(expression));
13234 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))__extension__ ({
13235 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
13236
13237 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
13238 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(fileInput, 0, 0);
13239 echoOn = 0x0;
13240 parsedExpression = (((void *)0));
13241 resetScanner();
13242 expression_yyparse();
13243 (__ecereNameSpace__ecere__com__eInstance_DecRef(fileInput), fileInput = 0);
13244 return parsedExpression;
13245 }
13246
13247 extern char *  QMkString(char *  source);
13248
13249 static unsigned int ResolveIdWithClass(struct Expression * exp, struct __ecereNameSpace__ecere__com__Class * _class, unsigned int skipIDClassCheck)
13250 {
13251 struct Identifier * id = exp->identifier;
13252 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
13253 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
13254 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
13255 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
13256
13257 if(_class && _class->type == 4)
13258 {
13259 struct __ecereNameSpace__ecere__sys__NamedLink * value = (((void *)0));
13260 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
13261
13262 if(enumClass)
13263 {
13264 struct __ecereNameSpace__ecere__com__Class * baseClass;
13265
13266 for(baseClass = _class; baseClass && baseClass->type == 4; baseClass = baseClass->base)
13267 {
13268 struct __ecereNameSpace__ecere__com__EnumClassData * e = (baseClass ? ((void *)(((char *)baseClass->data) + enumClass->offsetClass)) : (((void *)0)));
13269
13270 for(value = e->values.first; value; value = value->next)
13271 {
13272 if(!strcmp(value->name, id->string))
13273 break;
13274 }
13275 if(value)
13276 {
13277 char constant[256];
13278
13279 FreeExpContents(exp);
13280 exp->type = 2;
13281 exp->isConstant = 0x1;
13282 if(!strcmp(baseClass->dataTypeString, "int"))
13283 sprintf(constant, "%d", (int)value->data);
13284 else
13285 sprintf(constant, "0x%X", (int)value->data);
13286 exp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
13287 exp->expType = MkClassType(baseClass->fullName);
13288 break;
13289 }
13290 }
13291 }
13292 if(value)
13293 return 0x1;
13294 }
13295 if((method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule)))
13296 {
13297 ProcessMethodType(method);
13298 exp->expType = __extension__ ({
13299 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13300
13301 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 16, __ecereInstance1->method = method, __ecereInstance1->methodClass = (skipIDClassCheck || (id && id->_class)) ? _class : (((void *)0)), __ecereInstance1;
13302 });
13303 return 0x1;
13304 }
13305 else if((prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule)))
13306 {
13307 if(!prop->dataType)
13308 ProcessPropertyType(prop);
13309 exp->expType = prop->dataType;
13310 if(prop->dataType)
13311 prop->dataType->refCount++;
13312 return 0x1;
13313 }
13314 else if((member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)))))
13315 {
13316 if(!member->dataType)
13317 member->dataType = ProcessTypeString(member->dataTypeString, 0x0);
13318 exp->expType = member->dataType;
13319 if(member->dataType)
13320 member->dataType->refCount++;
13321 return 0x1;
13322 }
13323 else if((classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(_class, id->string)))
13324 {
13325 if(!classProp->dataType)
13326 classProp->dataType = ProcessTypeString(classProp->dataTypeString, 0x0);
13327 if(classProp->constant)
13328 {
13329 FreeExpContents(exp);
13330 exp->isConstant = 0x1;
13331 if(classProp->dataType->kind == 13 && classProp->dataType->type->kind == 1)
13332 {
13333 exp->type = 3;
13334 exp->constant = QMkString((char *)classProp->Get(_class));
13335 }
13336 else
13337 {
13338 char constant[256];
13339
13340 exp->type = 2;
13341 sprintf(constant, "%d", (int)classProp->Get(_class));
13342 exp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
13343 }
13344 }
13345 else
13346 {
13347 }
13348 exp->expType = classProp->dataType;
13349 if(classProp->dataType)
13350 classProp->dataType->refCount++;
13351 return 0x1;
13352 }
13353 return 0x0;
13354 }
13355
13356 static struct GlobalData * ScanGlobalData(struct __ecereNameSpace__ecere__com__NameSpace * nameSpace, char * name)
13357 {
13358 struct __ecereNameSpace__ecere__sys__BinaryTree * tree = &nameSpace->functions;
13359 struct GlobalData * data = (struct GlobalData *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString((&*tree), name);
13360 struct __ecereNameSpace__ecere__com__NameSpace * child;
13361
13362 if(!data)
13363 {
13364 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)))
13365 {
13366 data = ScanGlobalData(child, name);
13367 if(data)
13368 break;
13369 }
13370 }
13371 return data;
13372 }
13373
13374 extern struct __ecereNameSpace__ecere__com__NameSpace *  globalData;
13375
13376 extern char *  strncpy(char * , const char * , size_t n);
13377
13378 static struct GlobalData * FindGlobalData(char * name)
13379 {
13380 int start = 0, c;
13381 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
13382
13383 nameSpace = globalData;
13384 for(c = 0; name[c]; c++)
13385 {
13386 if(name[c] == '.' || (name[c] == ':' && name[c + 1] == ':'))
13387 {
13388 struct __ecereNameSpace__ecere__com__NameSpace * newSpace;
13389 char * spaceName = __ecereNameSpace__ecere__com__eSystem_New(sizeof(char) * (c - start + 1));
13390
13391 strncpy(spaceName, name + start, c - start);
13392 spaceName[c - start] = '\0';
13393 newSpace = (struct __ecereNameSpace__ecere__com__NameSpace *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(&(*nameSpace).nameSpaces, spaceName);
13394 (__ecereNameSpace__ecere__com__eSystem_Delete(spaceName), spaceName = 0);
13395 if(!newSpace)
13396 return (((void *)0));
13397 nameSpace = newSpace;
13398 if(name[c] == ':')
13399 c++;
13400 start = c + 1;
13401 }
13402 }
13403 if(c - start)
13404 {
13405 return ScanGlobalData(nameSpace, name + start);
13406 }
13407 return (((void *)0));
13408 }
13409
13410 static int definedExpStackPos;
13411
13412 static void * definedExpStack[512];
13413
13414 void ReplaceExpContents(struct Expression * checkedExp, struct Expression * newExp)
13415 {
13416 struct Expression * prev = checkedExp->prev, * next = checkedExp->next;
13417
13418 FreeExpContents(checkedExp);
13419 FreeType(checkedExp->expType);
13420 FreeType(checkedExp->destType);
13421 *checkedExp = *newExp;
13422 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
13423 checkedExp->prev = prev;
13424 checkedExp->next = next;
13425 }
13426
13427 extern struct Expression * MkExpCall(struct Expression * expression, struct __ecereNameSpace__ecere__sys__OldList * arguments);
13428
13429 extern int printf(char * , ...);
13430
13431 void __ecereMethod_Expression_Clear();
13432
13433 void ApplyAnyObjectLogic(struct Expression * e)
13434 {
13435 struct Type * destType = e->destType;
13436
13437 if(destType && (destType->classObjectType == 3))
13438 {
13439 if(e && e->expType)
13440 {
13441 struct Type * type = e->expType;
13442 struct __ecereNameSpace__ecere__com__Class * _class = (((void *)0));
13443
13444 if(type->kind == 8 && type->_class && type->_class->registered)
13445 {
13446 _class = type->_class->registered;
13447 }
13448 else if(type->kind == 19)
13449 {
13450 _class = FindClass("ecere::com::Class")->registered;
13451 }
13452 else
13453 {
13454 char string[1024] = "";
13455 struct Symbol * classSym;
13456
13457 PrintTypeNoConst(type, string, 0x0, 0x1);
13458 classSym = FindClass(string);
13459 if(classSym)
13460 _class = classSym->registered;
13461 }
13462 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)))
13463 {
13464 if(!_class || strcmp(_class->fullName, "char *"))
13465 {
13466 struct Expression * checkedExp = e, * newExp;
13467
13468 while(((checkedExp->type == 5 || checkedExp->type == 32 || checkedExp->type == 23) && checkedExp->list) || checkedExp->type == 11)
13469 {
13470 if(checkedExp->type == 5 || checkedExp->type == 32 || checkedExp->type == 23)
13471 {
13472 if(checkedExp->type == 23)
13473 {
13474 checkedExp = (*((struct Statement *)(*checkedExp->compound->compound.statements).last)->expressions).last;
13475 }
13476 else
13477 checkedExp = (*checkedExp->list).last;
13478 }
13479 else if(checkedExp->type == 11)
13480 checkedExp = checkedExp->cast.exp;
13481 }
13482 if(checkedExp && checkedExp->type == 4 && checkedExp->op.op == '*' && !checkedExp->op.exp1)
13483 {
13484 newExp = checkedExp->op.exp2;
13485 checkedExp->op.exp2 = (((void *)0));
13486 FreeExpContents(checkedExp);
13487 if(e->expType && e->expType->passAsTemplate)
13488 {
13489 char size[100];
13490
13491 ComputeTypeSize(e->expType);
13492 sprintf(size, "%d", e->expType->size);
13493 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))))));
13494 }
13495 ReplaceExpContents(checkedExp, newExp);
13496 e->byReference = 0x1;
13497 }
13498 else if(!e->byReference || (_class && _class->type == 5))
13499 {
13500 struct Expression * checkedExp, * newExp;
13501
13502 {
13503 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;
13504
13505 if(_class && _class->type != 5 && _class->type != 0 && _class->type != 1 && !hasAddress)
13506 {
13507 struct Context * context = PushContext();
13508 struct Declarator * decl;
13509 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13510 char typeString[1024];
13511 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
13512
13513 typeString[0] = '\0';
13514 *newExp = *e;
13515 newExp->prev = (((void *)0));
13516 newExp->next = (((void *)0));
13517 newExp->expType = (((void *)0));
13518 PrintTypeNoConst(e->expType, typeString, 0x0, 0x1);
13519 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
13520 newExp->destType = ProcessType(specs, decl);
13521 curContext = context;
13522 if(curCompound)
13523 {
13524 char name[100];
13525 struct __ecereNameSpace__ecere__sys__OldList * stmts = MkList();
13526
13527 e->type = 23;
13528 sprintf(name, "__internalValue%03X", internalValueCounter++);
13529 if(!curCompound->compound.declarations)
13530 curCompound->compound.declarations = MkList();
13531 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*curCompound->compound.declarations), (((void *)0)), MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(name)), (((void *)0))))));
13532 ListAdd(stmts, MkExpressionStmt(MkListOne(MkExpOp(MkExpIdentifier(MkIdentifier(name)), '=', newExp))));
13533 ListAdd(stmts, MkExpressionStmt(MkListOne(MkExpIdentifier(MkIdentifier(name)))));
13534 e->compound = MkCompoundStmt((((void *)0)), stmts);
13535 }
13536 else
13537 printf("libec: compiler error, curCompound is null in ApplyAnyObjectLogic\n");
13538 {
13539 struct Type * type = e->destType;
13540
13541 e->destType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13542 CopyTypeInto(e->destType, type);
13543 e->destType->refCount = 1;
13544 e->destType->classObjectType = 0;
13545 FreeType(type);
13546 }
13547 e->compound->compound.context = context;
13548 PopContext(context);
13549 curContext = context->parent;
13550 }
13551 }
13552 checkedExp = e;
13553 while(((checkedExp->type == 5 || checkedExp->type == 32 || checkedExp->type == 23) && checkedExp->list) || checkedExp->type == 11)
13554 {
13555 if(checkedExp->type == 5 || checkedExp->type == 32 || checkedExp->type == 23)
13556 {
13557 if(checkedExp->type == 23)
13558 {
13559 checkedExp = (*((struct Statement *)(*checkedExp->compound->compound.statements).last)->expressions).last;
13560 }
13561 else
13562 checkedExp = (*checkedExp->list).last;
13563 }
13564 else if(checkedExp->type == 11)
13565 checkedExp = checkedExp->cast.exp;
13566 }
13567 {
13568 struct Expression * operand = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
13569
13570 *operand = *checkedExp;
13571 checkedExp->destType = (((void *)0));
13572 checkedExp->expType = (((void *)0));
13573 __ecereMethod_Expression_Clear(checkedExp);
13574 checkedExp->type = 4;
13575 checkedExp->op.op = '&';
13576 checkedExp->op.exp1 = (((void *)0));
13577 checkedExp->op.exp2 = operand;
13578 }
13579 }
13580 }
13581 }
13582 }
13583 }
13584 {
13585 }
13586 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))))
13587 {
13588 if(e->expType->classObjectType && destType && destType->classObjectType)
13589 {
13590 return ;
13591 }
13592 else
13593 {
13594 struct Expression * thisExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
13595
13596 *thisExp = *e;
13597 thisExp->prev = (((void *)0));
13598 thisExp->next = (((void *)0));
13599 __ecereMethod_Expression_Clear(e);
13600 e->type = 5;
13601 e->list = MkListOne(MkExpOp((((void *)0)), '*', thisExp->type == 0 ? thisExp : MkExpBrackets(MkListOne(thisExp))));
13602 if(thisExp->expType->kind == 8 && thisExp->expType->_class && thisExp->expType->_class->registered && thisExp->expType->_class->registered->type == 5)
13603 ((struct Expression *)(*e->list).first)->byReference = 0x1;
13604 {
13605 e->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13606 CopyTypeInto(e->expType, thisExp->expType);
13607 e->expType->byReference = 0x0;
13608 e->expType->refCount = 1;
13609 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))
13610 {
13611 e->expType->classObjectType = 0;
13612 }
13613 }
13614 }
13615 }
13616 else if(destType && e->expType && (e->expType->classObjectType == 3 || e->expType->classObjectType == 2) && !destType->classObjectType && destType->kind != 0)
13617 {
13618 if(destType->kind == 14)
13619 {
13620 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Unspecified type\n", (((void *)0))));
13621 }
13622 else if(!(destType->truth && e->expType->kind == 8 && e->expType->_class && e->expType->_class->registered && e->expType->_class->registered->type == 1))
13623 {
13624 unsigned int byReference = e->expType->byReference;
13625 struct Expression * thisExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
13626 struct Declarator * decl;
13627 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13628 char typeString[1024];
13629 struct Type * type;
13630 int backupClassObjectType;
13631 unsigned int backupByReference;
13632
13633 if(e->expType->kind == 8 && e->expType->_class && e->expType->_class->registered && strcmp(e->expType->_class->registered->name, "class"))
13634 type = e->expType;
13635 else
13636 type = destType;
13637 backupClassObjectType = type->classObjectType;
13638 backupByReference = type->byReference;
13639 type->classObjectType = 0;
13640 type->byReference = 0x0;
13641 typeString[0] = '\0';
13642 PrintType(type, typeString, 0x0, 0x1);
13643 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
13644 type->classObjectType = backupClassObjectType;
13645 type->byReference = backupByReference;
13646 *thisExp = *e;
13647 thisExp->prev = (((void *)0));
13648 thisExp->next = (((void *)0));
13649 __ecereMethod_Expression_Clear(e);
13650 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)))
13651 {
13652 e->type = 4;
13653 e->op.op = '*';
13654 e->op.exp1 = (((void *)0));
13655 e->op.exp2 = MkExpCast(MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl)), thisExp);
13656 e->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13657 CopyTypeInto(e->expType, type);
13658 e->expType->byReference = 0x0;
13659 e->expType->refCount = 1;
13660 }
13661 else
13662 {
13663 e->type = 11;
13664 e->cast.typeName = MkTypeName(specs, decl);
13665 e->cast.exp = thisExp;
13666 e->byReference = 0x1;
13667 e->expType = type;
13668 type->refCount++;
13669 }
13670 e->destType = destType;
13671 destType->refCount++;
13672 }
13673 }
13674 }
13675
13676 extern char *  strstr(const char * , const char * );
13677
13678 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__DefinedExpression;
13679
13680 struct __ecereNameSpace__ecere__com__DefinedExpression
13681 {
13682 struct __ecereNameSpace__ecere__com__DefinedExpression * prev;
13683 struct __ecereNameSpace__ecere__com__DefinedExpression * next;
13684 char *  name;
13685 char *  value;
13686 struct __ecereNameSpace__ecere__com__NameSpace *  nameSpace;
13687 } __attribute__ ((gcc_struct));
13688
13689 extern struct __ecereNameSpace__ecere__com__DefinedExpression * __ecereNameSpace__ecere__com__eSystem_FindDefine(struct __ecereNameSpace__ecere__com__Instance * module, char *  name);
13690
13691 extern struct __ecereNameSpace__ecere__com__GlobalFunction * __ecereNameSpace__ecere__com__eSystem_FindFunction(struct __ecereNameSpace__ecere__com__Instance * module, char *  name);
13692
13693 extern unsigned int __ecereNameSpace__ecere__sys__UTF8GetChar(char *  string, int *  numBytes);
13694
13695 extern struct Expression * GetTemplateArgExp(struct TemplateParameter * param, struct __ecereNameSpace__ecere__com__Class * curClass, unsigned int pointer);
13696
13697 extern struct Expression * MkExpCondition(struct Expression * cond, struct __ecereNameSpace__ecere__sys__OldList * expressions, struct Expression * elseExp);
13698
13699 extern struct Expression * CopyExpression(struct Expression * exp);
13700
13701 extern struct Expression * MkExpTypeSize(struct TypeName * typeName);
13702
13703 extern struct Expression * MkExpClass(struct __ecereNameSpace__ecere__sys__OldList *  specifiers, struct Declarator * decl);
13704
13705 static void ProcessStatement(struct Statement * stmt);
13706
13707 extern struct Expression * MkExpExtensionInitializer(struct TypeName * typeName, struct Initializer * initializer);
13708
13709 extern struct Initializer * MkInitializerList(struct __ecereNameSpace__ecere__sys__OldList * list);
13710
13711 extern char *  __ecereNameSpace__ecere__com__PrintString(struct __ecereNameSpace__ecere__com__Class * class, void * object, ...);
13712
13713 extern char *  sourceFile;
13714
13715 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear(struct __ecereNameSpace__ecere__sys__OldList * this);
13716
13717 void ProcessExpressionType(struct Expression * exp)
13718 {
13719 unsigned int unresolved = 0x0;
13720 struct Location oldyylloc = yylloc;
13721 unsigned int notByReference = 0x0;
13722
13723 if(!exp || exp->expType)
13724 return ;
13725 yylloc = exp->loc;
13726 switch(exp->type)
13727 {
13728 case 0:
13729 {
13730 struct Identifier * id = exp->identifier;
13731
13732 if(!id || !topContext)
13733 return ;
13734 if(id->_class && id->_class->name)
13735 {
13736 id->classSym = id->_class->symbol;
13737 }
13738 if(strstr(id->string, "__ecereClass") == id->string)
13739 {
13740 exp->expType = ProcessTypeString("ecere::com::Class", 0x1);
13741 break;
13742 }
13743 else if(id->_class && (id->classSym || (id->_class->name && !strcmp(id->_class->name, "property"))))
13744 {
13745 ReplaceClassMembers(exp, thisClass);
13746 if(exp->type != 0)
13747 {
13748 ProcessExpressionType(exp);
13749 break;
13750 }
13751 if(id->classSym && ResolveIdWithClass(exp, id->classSym->registered, 0x0))
13752 break;
13753 }
13754 else
13755 {
13756 struct Symbol * symbol = FindSymbol(id->string, curContext, topContext, 0x0, id->_class && id->_class->name == (((void *)0)));
13757
13758 if(!symbol)
13759 {
13760 if(exp->destType && CheckExpressionType(exp, exp->destType, 0x0))
13761 break;
13762 else
13763 {
13764 if(thisClass)
13765 {
13766 ReplaceClassMembers(exp, thisClass ? thisClass : currentClass);
13767 if(exp->type != 0)
13768 {
13769 ProcessExpressionType(exp);
13770 break;
13771 }
13772 }
13773 else if(currentClass && !id->_class)
13774 {
13775 if(ResolveIdWithClass(exp, currentClass, 0x1))
13776 break;
13777 }
13778 symbol = FindSymbol(id->string, topContext->parent, globalContext, 0x0, id->_class && id->_class->name == (((void *)0)));
13779 }
13780 }
13781 if(symbol)
13782 {
13783 struct Type * type = symbol->type;
13784 struct __ecereNameSpace__ecere__com__Class * _class = (type && type->kind == 8 && type->_class) ? type->_class->registered : (((void *)0));
13785
13786 if(_class && !strcmp(id->string, "this") && !type->classObjectType)
13787 {
13788 struct Context * context = SetupTemplatesContext(_class);
13789
13790 type = ReplaceThisClassType(_class);
13791 FinishTemplatesContext(context);
13792 if(type)
13793 type->refCount = 0;
13794 }
13795 FreeSpecifier(id->_class);
13796 id->_class = (((void *)0));
13797 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
13798 id->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
13799 id->classSym = (((void *)0));
13800 exp->expType = type;
13801 if(type)
13802 type->refCount++;
13803 if(type && (type->kind == 15 || (_class && _class->type == 4)))
13804 exp->isConstant = 0x1;
13805 if(symbol->isParam || !strcmp(id->string, "this"))
13806 {
13807 if(_class && _class->type == 1 && !type->declaredWithStruct)
13808 exp->byReference = 0x1;
13809 }
13810 if(symbol->isIterator)
13811 {
13812 if(symbol->isIterator == 3)
13813 {
13814 exp->type = 5;
13815 exp->list = MkListOne(MkExpOp((((void *)0)), '*', MkExpIdentifier(exp->identifier)));
13816 ((struct Expression *)(*exp->list).first)->op.exp2->expType = exp->expType;
13817 exp->expType = (((void *)0));
13818 ProcessExpressionType(exp);
13819 }
13820 else if(symbol->isIterator != 4)
13821 {
13822 exp->type = 8;
13823 exp->member.exp = MkExpIdentifier(exp->identifier);
13824 exp->member.exp->expType = exp->expType;
13825 exp->member.member = MkIdentifier("data");
13826 exp->expType = (((void *)0));
13827 ProcessExpressionType(exp);
13828 }
13829 }
13830 break;
13831 }
13832 else
13833 {
13834 struct __ecereNameSpace__ecere__com__DefinedExpression * definedExp = (((void *)0));
13835
13836 if(thisNameSpace && !(id->_class && !id->_class->name))
13837 {
13838 char name[1024];
13839
13840 strcpy(name, thisNameSpace);
13841 strcat(name, "::");
13842 strcat(name, id->string);
13843 definedExp = __ecereNameSpace__ecere__com__eSystem_FindDefine(privateModule, name);
13844 }
13845 if(!definedExp)
13846 definedExp = __ecereNameSpace__ecere__com__eSystem_FindDefine(privateModule, id->string);
13847 if(definedExp)
13848 {
13849 int c;
13850
13851 for(c = 0; c < definedExpStackPos; c++)
13852 if(definedExpStack[c] == definedExp)
13853 break;
13854 if(c == definedExpStackPos && c < sizeof (definedExpStack) / sizeof(void *))
13855 {
13856 struct Location backupYylloc = yylloc;
13857 struct __ecereNameSpace__ecere__com__Instance * backInput = fileInput;
13858
13859 definedExpStack[definedExpStackPos++] = definedExp;
13860 fileInput = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
13861 ((int (*)(struct __ecereNameSpace__ecere__com__Instance *, void *  buffer, unsigned int size, unsigned int count))__extension__ ({
13862 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
13863
13864 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
13865 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Write])(fileInput, definedExp->value, 1, strlen(definedExp->value));
13866 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))__extension__ ({
13867 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
13868
13869 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
13870 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(fileInput, 0, 0);
13871 echoOn = 0x0;
13872 parsedExpression = (((void *)0));
13873 resetScanner();
13874 expression_yyparse();
13875 (__ecereNameSpace__ecere__com__eInstance_DecRef(fileInput), fileInput = 0);
13876 if(backInput)
13877 fileInput = backInput;
13878 yylloc = backupYylloc;
13879 if(parsedExpression)
13880 {
13881 FreeIdentifier(id);
13882 exp->type = 5;
13883 exp->list = MkListOne(parsedExpression);
13884 parsedExpression->loc = yylloc;
13885 ProcessExpressionType(exp);
13886 definedExpStackPos--;
13887 return ;
13888 }
13889 definedExpStackPos--;
13890 }
13891 else
13892 {
13893 if(inCompiler)
13894 {
13895 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Recursion in defined expression %s\n", (((void *)0))), id->string);
13896 }
13897 }
13898 }
13899 else
13900 {
13901 struct GlobalData * data = (((void *)0));
13902
13903 if(thisNameSpace && !(id->_class && !id->_class->name))
13904 {
13905 char name[1024];
13906
13907 strcpy(name, thisNameSpace);
13908 strcat(name, "::");
13909 strcat(name, id->string);
13910 data = FindGlobalData(name);
13911 }
13912 if(!data)
13913 data = FindGlobalData(id->string);
13914 if(data)
13915 {
13916 DeclareGlobalData(data);
13917 exp->expType = data->dataType;
13918 if(data->dataType)
13919 data->dataType->refCount++;
13920 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
13921 id->string = __ecereNameSpace__ecere__sys__CopyString(data->fullName);
13922 FreeSpecifier(id->_class);
13923 id->_class = (((void *)0));
13924 break;
13925 }
13926 else
13927 {
13928 struct __ecereNameSpace__ecere__com__GlobalFunction * function = (((void *)0));
13929
13930 if(thisNameSpace && !(id->_class && !id->_class->name))
13931 {
13932 char name[1024];
13933
13934 strcpy(name, thisNameSpace);
13935 strcat(name, "::");
13936 strcat(name, id->string);
13937 function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, name);
13938 }
13939 if(!function)
13940 function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, id->string);
13941 if(function)
13942 {
13943 char name[1024];
13944
13945 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
13946 id->string = __ecereNameSpace__ecere__sys__CopyString(function->name);
13947 name[0] = (char)0;
13948 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType != 1 && (!function->dataType || !function->dataType->dllExport))
13949 strcpy(name, "__ecereFunction_");
13950 FullClassNameCat(name, id->string, 0x0);
13951 if(DeclareFunction(function, name))
13952 {
13953 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
13954 id->string = __ecereNameSpace__ecere__sys__CopyString(name);
13955 }
13956 exp->expType = function->dataType;
13957 if(function->dataType)
13958 function->dataType->refCount++;
13959 FreeSpecifier(id->_class);
13960 id->_class = (((void *)0));
13961 break;
13962 }
13963 }
13964 }
13965 }
13966 }
13967 unresolved = 0x1;
13968 break;
13969 }
13970 case 1:
13971 {
13972 struct __ecereNameSpace__ecere__com__Class * _class;
13973
13974 if(!exp->instance->_class)
13975 {
13976 if(exp->destType && exp->destType->kind == 8 && exp->destType->_class)
13977 {
13978 exp->instance->_class = MkSpecifierName(exp->destType->_class->string);
13979 }
13980 }
13981 ProcessInstantiationType(exp->instance);
13982 exp->isConstant = exp->instance->isConstant;
13983 if(exp->instance->_class)
13984 {
13985 exp->expType = MkClassType(exp->instance->_class->name);
13986 }
13987 break;
13988 }
13989 case 2:
13990 {
13991 if(!exp->expType)
13992 {
13993 char * constant = exp->constant;
13994 struct Type * type = (type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), type->refCount = 1, type->constant = 0x1, type);
13995
13996 exp->expType = type;
13997 if(constant[0] == '\'')
13998 {
13999 if((int)((unsigned char *)constant)[1] > 127)
14000 {
14001 int nb;
14002 unsigned int ch = __ecereNameSpace__ecere__sys__UTF8GetChar(constant + 1, &nb);
14003
14004 if(nb < 2)
14005 ch = constant[1];
14006 (__ecereNameSpace__ecere__com__eSystem_Delete(constant), constant = 0);
14007 exp->constant = PrintUInt(ch);
14008 type->kind = 8;
14009 type->_class = FindClass("unichar");
14010 type->isSigned = 0x0;
14011 }
14012 else
14013 {
14014 type->kind = 1;
14015 type->isSigned = 0x1;
14016 }
14017 }
14018 else
14019 {
14020 char * dot = strchr(constant, '.');
14021 unsigned int isHex = (constant[0] == '0' && (constant[1] == 'x' || constant[1] == 'X'));
14022 char * exponent;
14023
14024 if(isHex)
14025 {
14026 exponent = strchr(constant, 'p');
14027 if(!exponent)
14028 exponent = strchr(constant, 'P');
14029 }
14030 else
14031 {
14032 exponent = strchr(constant, 'e');
14033 if(!exponent)
14034 exponent = strchr(constant, 'E');
14035 }
14036 if(dot || exponent)
14037 {
14038 if(strchr(constant, 'f') || strchr(constant, 'F'))
14039 type->kind = 6;
14040 else
14041 type->kind = 7;
14042 type->isSigned = 0x1;
14043 }
14044 else
14045 {
14046 unsigned int isSigned = constant[0] == '-';
14047 long long i64 = strtoll(constant, (((void *)0)), 0);
14048 uint64 ui64 = strtoull(constant, (((void *)0)), 0);
14049 unsigned int is64Bit = 0x0;
14050
14051 if(isSigned)
14052 {
14053 if(i64 < (((int)0x80000000)))
14054 is64Bit = 0x1;
14055 }
14056 else
14057 {
14058 if(ui64 > (((int)0x7fffffff)))
14059 {
14060 if(ui64 > (0xffffffff))
14061 {
14062 is64Bit = 0x1;
14063 if(ui64 <= (((long long)0x7fffffffffffffffLL)) && (constant[0] != '0' || !constant[1]))
14064 isSigned = 0x1;
14065 }
14066 }
14067 else if(constant[0] != '0' || !constant[1])
14068 isSigned = 0x1;
14069 }
14070 type->kind = is64Bit ? 4 : 3;
14071 type->isSigned = isSigned;
14072 }
14073 }
14074 exp->isConstant = 0x1;
14075 if(exp->destType && exp->destType->kind == 7)
14076 type->kind = 7;
14077 else if(exp->destType && exp->destType->kind == 6)
14078 type->kind = 6;
14079 else if(exp->destType && exp->destType->kind == 4)
14080 type->kind = 4;
14081 }
14082 break;
14083 }
14084 case 3:
14085 {
14086 exp->isConstant = 0x1;
14087 exp->expType = __extension__ ({
14088 struct Type * __ecereInstance2 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14089
14090 __ecereInstance2->refCount = 1, __ecereInstance2->kind = 13, __ecereInstance2->type = __extension__ ({
14091 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14092
14093 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 1, __ecereInstance1->constant = 0x1, __ecereInstance1->isSigned = 0x1, __ecereInstance1;
14094 }), __ecereInstance2;
14095 });
14096 break;
14097 }
14098 case 13:
14099 case 26:
14100 ProcessExpressionType(exp->_new.size);
14101 exp->expType = __extension__ ({
14102 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14103
14104 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 13, __ecereInstance1->type = ProcessType(exp->_new.typeName->qualifiers, exp->_new.typeName->declarator), __ecereInstance1;
14105 });
14106 DeclareType(exp->expType->type, 0x0, 0x0);
14107 break;
14108 case 14:
14109 case 27:
14110 ProcessExpressionType(exp->_renew.size);
14111 ProcessExpressionType(exp->_renew.exp);
14112 exp->expType = __extension__ ({
14113 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14114
14115 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 13, __ecereInstance1->type = ProcessType(exp->_renew.typeName->qualifiers, exp->_renew.typeName->declarator), __ecereInstance1;
14116 });
14117 DeclareType(exp->expType->type, 0x0, 0x0);
14118 break;
14119 case 4:
14120 {
14121 unsigned int assign = 0x0, boolResult = 0x0, boolOps = 0x0;
14122 struct Type * type1 = (((void *)0)), * type2 = (((void *)0));
14123 unsigned int useDestType = 0x0, useSideType = 0x0;
14124 struct Location oldyylloc = yylloc;
14125 unsigned int useSideUnit = 0x0;
14126 struct Type * dummy = (dummy = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), dummy->count = 1, dummy->refCount = 1, dummy);
14127
14128 switch(exp->op.op)
14129 {
14130 case '=':
14131 case MUL_ASSIGN:
14132 case DIV_ASSIGN:
14133 case MOD_ASSIGN:
14134 case ADD_ASSIGN:
14135 case SUB_ASSIGN:
14136 case LEFT_ASSIGN:
14137 case RIGHT_ASSIGN:
14138 case AND_ASSIGN:
14139 case XOR_ASSIGN:
14140 case OR_ASSIGN:
14141 assign = 0x1;
14142 break;
14143 case '!':
14144 break;
14145 case AND_OP:
14146 case OR_OP:
14147 boolOps = 0x1;
14148 boolResult = 0x1;
14149 break;
14150 case EQ_OP:
14151 case '<':
14152 case '>':
14153 case LE_OP:
14154 case GE_OP:
14155 case NE_OP:
14156 boolResult = 0x1;
14157 useSideType = 0x1;
14158 break;
14159 case '+':
14160 case '-':
14161 useSideUnit = 0x1;
14162 case '|':
14163 case '&':
14164 case '^':
14165 case '/':
14166 case '%':
14167 case '*':
14168 if(exp->op.op != '*' || exp->op.exp1)
14169 {
14170 useSideType = 0x1;
14171 useDestType = 0x1;
14172 }
14173 break;
14174 }
14175 if(exp->op.op == '&')
14176 {
14177 if(!exp->op.exp1 && exp->op.exp2 && exp->op.exp2->type == 0 && exp->op.exp2->identifier)
14178 {
14179 struct Identifier * id = exp->op.exp2->identifier;
14180 struct Symbol * symbol = FindSymbol(id->string, curContext, topContext, 0x0, id->_class && id->_class->name == (((void *)0)));
14181
14182 if(symbol && symbol->isIterator == 2)
14183 {
14184 exp->type = 8;
14185 exp->member.exp = exp->op.exp2;
14186 exp->member.member = MkIdentifier("key");
14187 exp->expType = (((void *)0));
14188 exp->op.exp2->expType = symbol->type;
14189 symbol->type->refCount++;
14190 ProcessExpressionType(exp);
14191 FreeType(dummy);
14192 break;
14193 }
14194 }
14195 }
14196 if(exp->op.exp1)
14197 {
14198 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))
14199 {
14200 if(exp->op.exp1->destType)
14201 FreeType(exp->op.exp1->destType);
14202 exp->op.exp1->destType = exp->destType;
14203 if(exp->destType)
14204 exp->destType->refCount++;
14205 }
14206 else if(!assign)
14207 {
14208 if(exp->op.exp1->destType)
14209 FreeType(exp->op.exp1->destType);
14210 exp->op.exp1->destType = dummy;
14211 dummy->refCount++;
14212 }
14213 if(exp->op.exp1->destType && exp->op.op != '=')
14214 exp->op.exp1->destType->count++;
14215 ProcessExpressionType(exp->op.exp1);
14216 if(exp->op.exp1->destType && exp->op.op != '=')
14217 exp->op.exp1->destType->count--;
14218 if(exp->op.exp1->destType == dummy)
14219 {
14220 FreeType(dummy);
14221 exp->op.exp1->destType = (((void *)0));
14222 }
14223 type1 = exp->op.exp1->expType;
14224 }
14225 if(exp->op.exp2)
14226 {
14227 char expString[10240];
14228
14229 expString[0] = '\0';
14230 if(exp->op.exp2->type == 1 && !exp->op.exp2->instance->_class)
14231 {
14232 if(exp->op.exp1)
14233 {
14234 exp->op.exp2->destType = exp->op.exp1->expType;
14235 if(exp->op.exp1->expType)
14236 exp->op.exp1->expType->refCount++;
14237 }
14238 else
14239 {
14240 exp->op.exp2->destType = exp->destType;
14241 if(exp->destType)
14242 exp->destType->refCount++;
14243 }
14244 if(type1)
14245 type1->refCount++;
14246 exp->expType = type1;
14247 }
14248 else if(assign)
14249 {
14250 if(inCompiler)
14251 PrintExpression(exp->op.exp2, expString);
14252 if(type1 && type1->kind == 13)
14253 {
14254 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)
14255 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "operator %s illegal on pointer\n", (((void *)0))), exp->op.op);
14256 else if(exp->op.op == '=')
14257 {
14258 if(exp->op.exp2->destType)
14259 FreeType(exp->op.exp2->destType);
14260 exp->op.exp2->destType = type1;
14261 if(type1)
14262 type1->refCount++;
14263 }
14264 }
14265 else
14266 {
14267 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)
14268 ;
14269 else
14270 {
14271 if(exp->op.exp2->destType)
14272 FreeType(exp->op.exp2->destType);
14273 exp->op.exp2->destType = type1;
14274 if(type1)
14275 type1->refCount++;
14276 }
14277 }
14278 if(type1)
14279 type1->refCount++;
14280 exp->expType = type1;
14281 }
14282 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)))
14283 {
14284 if(exp->op.exp2->destType)
14285 FreeType(exp->op.exp2->destType);
14286 exp->op.exp2->destType = exp->destType;
14287 if(exp->destType)
14288 exp->destType->refCount++;
14289 }
14290 else
14291 {
14292 if(exp->op.exp2->destType)
14293 FreeType(exp->op.exp2->destType);
14294 exp->op.exp2->destType = dummy;
14295 dummy->refCount++;
14296 }
14297 if(type1 && boolResult && useSideType && type1->kind == 8 && type1->_class && type1->_class->registered && (type1->_class->registered->type == 2 || type1->_class->registered->type == 4))
14298 {
14299 FreeType(exp->op.exp2->destType);
14300 exp->op.exp2->destType = type1;
14301 type1->refCount++;
14302 }
14303 if(exp->op.exp2->destType && exp->op.op != '=')
14304 exp->op.exp2->destType->count++;
14305 if(exp->op.op == SIZEOF)
14306 {
14307 struct Expression * e = exp->op.exp2;
14308
14309 while((e->type == 5 || e->type == 32 || e->type == 23) && e->list)
14310 {
14311 if(e->type == 5 || e->type == 32 || e->type == 23)
14312 {
14313 if(e->type == 23)
14314 e = (*((struct Statement *)(*e->compound->compound.statements).last)->expressions).last;
14315 else
14316 e = (*e->list).last;
14317 }
14318 }
14319 if(e->type == 11 && e->cast.exp)
14320 e->cast.exp->needCast = 0x1;
14321 }
14322 ProcessExpressionType(exp->op.exp2);
14323 if(exp->op.exp2->destType && exp->op.op != '=')
14324 exp->op.exp2->destType->count--;
14325 if(assign && type1 && type1->kind == 13 && exp->op.exp2->expType)
14326 {
14327 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)
14328 {
14329 if(exp->op.op != '=' && type1->type->kind == 0)
14330 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "void *: unknown size\n", (((void *)0))));
14331 }
14332 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)))
14333 {
14334 if(exp->op.op == ADD_ASSIGN)
14335 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "cannot add two pointers\n", (((void *)0))));
14336 }
14337 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))
14338 {
14339 if(exp->op.op == ADD_ASSIGN)
14340 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "cannot add two pointers\n", (((void *)0))));
14341 }
14342 else if(inCompiler)
14343 {
14344 char type1String[1024];
14345 char type2String[1024];
14346
14347 type1String[0] = '\0';
14348 type2String[0] = '\0';
14349 PrintType(exp->op.exp2->expType, type1String, 0x0, 0x1);
14350 PrintType(type1, type2String, 0x0, 0x1);
14351 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14352 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expression %s (%s); expected %s\n", (((void *)0))), expString, type1String, type2String);
14353 }
14354 }
14355 if(exp->op.exp2->destType == dummy)
14356 {
14357 FreeType(dummy);
14358 exp->op.exp2->destType = (((void *)0));
14359 }
14360 if(exp->op.op == '-' && !exp->op.exp1 && exp->op.exp2->expType && !exp->op.exp2->expType->isSigned)
14361 {
14362 type2 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14363 type2->refCount = 1;
14364 CopyTypeInto(type2, exp->op.exp2->expType);
14365 type2->isSigned = 0x1;
14366 }
14367 else if(exp->op.op == '~' && !exp->op.exp1 && exp->op.exp2->expType && (!exp->op.exp2->expType->isSigned || exp->op.exp2->expType->kind != 3))
14368 {
14369 type2 = __extension__ ({
14370 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14371
14372 __ecereInstance1->kind = 3, __ecereInstance1;
14373 });
14374 type2->refCount = 1;
14375 type2->isSigned = 0x1;
14376 }
14377 else
14378 {
14379 type2 = exp->op.exp2->expType;
14380 if(type2)
14381 type2->refCount++;
14382 }
14383 }
14384 dummy->kind = 0;
14385 if(exp->op.op == SIZEOF)
14386 {
14387 exp->expType = __extension__ ({
14388 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14389
14390 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 3, __ecereInstance1;
14391 });
14392 exp->isConstant = 0x1;
14393 }
14394 else if(exp->op.op == '*' && !exp->op.exp1)
14395 {
14396 exp->expType = Dereference(type2);
14397 if(type2 && type2->kind == 8)
14398 notByReference = 0x1;
14399 }
14400 else if(exp->op.op == '&' && !exp->op.exp1)
14401 exp->expType = Reference(type2);
14402 else if(!assign)
14403 {
14404 if(boolOps)
14405 {
14406 if(exp->op.exp1)
14407 {
14408 if(exp->op.exp1->destType)
14409 FreeType(exp->op.exp1->destType);
14410 exp->op.exp1->destType = MkClassType("bool");
14411 exp->op.exp1->destType->truth = 0x1;
14412 if(!exp->op.exp1->expType)
14413 ProcessExpressionType(exp->op.exp1);
14414 else
14415 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
14416 FreeType(exp->op.exp1->expType);
14417 exp->op.exp1->expType = MkClassType("bool");
14418 exp->op.exp1->expType->truth = 0x1;
14419 }
14420 if(exp->op.exp2)
14421 {
14422 if(exp->op.exp2->destType)
14423 FreeType(exp->op.exp2->destType);
14424 exp->op.exp2->destType = MkClassType("bool");
14425 exp->op.exp2->destType->truth = 0x1;
14426 if(!exp->op.exp2->expType)
14427 ProcessExpressionType(exp->op.exp2);
14428 else
14429 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
14430 FreeType(exp->op.exp2->expType);
14431 exp->op.exp2->expType = MkClassType("bool");
14432 exp->op.exp2->expType->truth = 0x1;
14433 }
14434 }
14435 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")))))
14436 {
14437 if(type1 && type2 && ((type1->kind == 8 && type1->_class && strcmp(type1->_class->string, "String")) == (type2->kind == 8 && type2->_class && strcmp(type2->_class->string, "String"))))
14438 {
14439 if(exp->op.exp2->destType)
14440 FreeType(exp->op.exp2->destType);
14441 exp->op.exp2->destType = type1;
14442 type1->refCount++;
14443 if(exp->op.exp1->destType)
14444 FreeType(exp->op.exp1->destType);
14445 exp->op.exp1->destType = type2;
14446 type2->refCount++;
14447 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)
14448 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);
14449 if(type1->kind == 13 && type1->type->kind == 20 && type2->kind != 13)
14450 {
14451 struct Expression * argExp = GetTemplateArgExp(type1->type->templateParameter, thisClass, 0x1);
14452
14453 if(argExp)
14454 {
14455 struct Expression * classExp = MkExpMember(argExp, MkIdentifier("dataTypeClass"));
14456
14457 exp->op.exp1 = MkExpBrackets(MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName("byte")), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), exp->op.exp1)));
14458 ProcessExpressionType(exp->op.exp1);
14459 if(type2->kind != 13)
14460 {
14461 ProcessExpressionType(classExp);
14462 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"))))))));
14463 if(!exp->op.exp2->expType)
14464 {
14465 if(type2)
14466 FreeType(type2);
14467 type2 = exp->op.exp2->expType = ProcessTypeString("int", 0x0);
14468 type2->refCount++;
14469 }
14470 ProcessExpressionType(exp->op.exp2);
14471 }
14472 }
14473 }
14474 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)))
14475 {
14476 if(type1->kind != 8 && type1->type->kind == 0)
14477 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "void *: unknown size\n", (((void *)0))));
14478 exp->expType = type1;
14479 if(type1)
14480 type1->refCount++;
14481 }
14482 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)))
14483 {
14484 if(type2->kind != 8 && type2->type->kind == 0)
14485 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "void *: unknown size\n", (((void *)0))));
14486 exp->expType = type2;
14487 if(type2)
14488 type2->refCount++;
14489 }
14490 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))
14491 {
14492 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "different levels of indirection\n", (((void *)0))));
14493 }
14494 else
14495 {
14496 unsigned int success = 0x0;
14497
14498 if(type1->kind == 13 && type2->kind == 13)
14499 {
14500 if(exp->op.op == '+')
14501 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "cannot add two pointers\n", (((void *)0))));
14502 else if(exp->op.op == '-')
14503 {
14504 if(MatchTypes(type1->type, type2->type, (((void *)0)), (((void *)0)), (((void *)0)), 0x0, 0x0, 0x0, 0x0))
14505 {
14506 exp->expType = __extension__ ({
14507 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14508
14509 __ecereInstance1->kind = 3, __ecereInstance1->refCount = 1, __ecereInstance1;
14510 });
14511 success = 0x1;
14512 if(type1->type->kind == 20)
14513 {
14514 struct Expression * argExp = GetTemplateArgExp(type1->type->templateParameter, thisClass, 0x1);
14515
14516 if(argExp)
14517 {
14518 struct Expression * classExp = MkExpMember(argExp, MkIdentifier("dataTypeClass"));
14519
14520 ProcessExpressionType(classExp);
14521 exp->type = 5;
14522 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")))))));
14523 ProcessExpressionType(((struct Expression *)(*exp->list).first)->op.exp2);
14524 FreeType(dummy);
14525 return ;
14526 }
14527 }
14528 }
14529 }
14530 }
14531 if(!success && exp->op.exp1->type == 2)
14532 {
14533 if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
14534 {
14535 if(exp->expType)
14536 FreeType(exp->expType);
14537 exp->expType = exp->op.exp1->destType;
14538 if(exp->op.exp1->destType)
14539 exp->op.exp1->destType->refCount++;
14540 success = 0x1;
14541 }
14542 else if(CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0))
14543 {
14544 if(exp->expType)
14545 FreeType(exp->expType);
14546 exp->expType = exp->op.exp2->destType;
14547 if(exp->op.exp2->destType)
14548 exp->op.exp2->destType->refCount++;
14549 success = 0x1;
14550 }
14551 }
14552 else if(!success)
14553 {
14554 if(CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0))
14555 {
14556 if(exp->expType)
14557 FreeType(exp->expType);
14558 exp->expType = exp->op.exp2->destType;
14559 if(exp->op.exp2->destType)
14560 exp->op.exp2->destType->refCount++;
14561 success = 0x1;
14562 }
14563 else if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
14564 {
14565 if(exp->expType)
14566 FreeType(exp->expType);
14567 exp->expType = exp->op.exp1->destType;
14568 if(exp->op.exp1->destType)
14569 exp->op.exp1->destType->refCount++;
14570 success = 0x1;
14571 }
14572 }
14573 if(!success)
14574 {
14575 char expString1[10240];
14576 char expString2[10240];
14577 char type1[1024];
14578 char type2[1024];
14579
14580 expString1[0] = '\0';
14581 expString2[0] = '\0';
14582 type1[0] = '\0';
14583 type2[0] = '\0';
14584 if(inCompiler)
14585 {
14586 PrintExpression(exp->op.exp1, expString1);
14587 __ecereNameSpace__ecere__sys__ChangeCh(expString1, '\n', ' ');
14588 PrintExpression(exp->op.exp2, expString2);
14589 __ecereNameSpace__ecere__sys__ChangeCh(expString2, '\n', ' ');
14590 PrintType(exp->op.exp1->expType, type1, 0x0, 0x1);
14591 PrintType(exp->op.exp2->expType, type2, 0x0, 0x1);
14592 }
14593 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expressions %s (%s) and %s (%s)\n", (((void *)0))), expString1, type1, expString2, type2);
14594 }
14595 }
14596 }
14597 else if(!boolResult && (!useSideUnit) && type2 && type1 && type2->kind == 8 && type1->kind != 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 3)
14598 {
14599 if(exp->op.exp1->destType)
14600 FreeType(exp->op.exp1->destType);
14601 exp->op.exp1->destType = type2->_class->registered->dataType;
14602 if(type2->_class->registered->dataType)
14603 type2->_class->registered->dataType->refCount++;
14604 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
14605 exp->expType = type2;
14606 if(type2)
14607 type2->refCount++;
14608 }
14609 else if(!boolResult && (!useSideUnit) && type1 && type2 && type1->kind == 8 && type2->kind != 8 && type1->_class && type1->_class->registered && type1->_class->registered->type == 3)
14610 {
14611 if(exp->op.exp2->destType)
14612 FreeType(exp->op.exp2->destType);
14613 exp->op.exp2->destType = type1->_class->registered->dataType;
14614 if(type1->_class->registered->dataType)
14615 type1->_class->registered->dataType->refCount++;
14616 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
14617 exp->expType = type1;
14618 if(type1)
14619 type1->refCount++;
14620 }
14621 else if(type1)
14622 {
14623 unsigned int valid = 0x0;
14624
14625 if(!boolResult && useSideUnit && type1 && type1->kind == 8 && type1->_class->registered && type1->_class->registered->type == 3 && type2 && type2->kind != 8)
14626 {
14627 if(exp->op.exp2->destType)
14628 FreeType(exp->op.exp2->destType);
14629 if(!type1->_class->registered->dataType)
14630 type1->_class->registered->dataType = ProcessTypeString(type1->_class->registered->dataTypeString, 0x0);
14631 exp->op.exp2->destType = type1->_class->registered->dataType;
14632 exp->op.exp2->destType->refCount++;
14633 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
14634 if(type2)
14635 FreeType(type2);
14636 type2 = exp->op.exp2->destType;
14637 if(type2)
14638 type2->refCount++;
14639 exp->expType = type2;
14640 type2->refCount++;
14641 }
14642 if(!boolResult && useSideUnit && type2 && type2->kind == 8 && type2->_class->registered && type2->_class->registered->type == 3 && type1 && type1->kind != 8)
14643 {
14644 if(exp->op.exp1->destType)
14645 FreeType(exp->op.exp1->destType);
14646 if(!type2->_class->registered->dataType)
14647 type2->_class->registered->dataType = ProcessTypeString(type2->_class->registered->dataTypeString, 0x0);
14648 exp->op.exp1->destType = type2->_class->registered->dataType;
14649 exp->op.exp1->destType->refCount++;
14650 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
14651 type1 = exp->op.exp1->destType;
14652 exp->expType = type1;
14653 type1->refCount++;
14654 }
14655 if(!boolResult || exp->op.op == '>' || exp->op.op == '<')
14656 {
14657 if(type1->kind == 8 && type1->_class && type1->_class->registered && type1->_class->registered->type == 4 && exp->op.exp2->expType)
14658 {
14659 if(CheckExpressionType(exp->op.exp1, exp->op.exp2->expType, 0x0))
14660 {
14661 if(exp->expType)
14662 FreeType(exp->expType);
14663 exp->expType = exp->op.exp1->expType;
14664 if(exp->op.exp2->expType)
14665 exp->op.exp1->expType->refCount++;
14666 valid = 0x1;
14667 }
14668 }
14669 else if(type2 && (type2->kind == 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 4 && exp->op.exp1->expType))
14670 {
14671 if(CheckExpressionType(exp->op.exp2, exp->op.exp1->expType, 0x0))
14672 {
14673 if(exp->expType)
14674 FreeType(exp->expType);
14675 exp->expType = exp->op.exp2->expType;
14676 if(exp->op.exp2->expType)
14677 exp->op.exp2->expType->refCount++;
14678 valid = 0x1;
14679 }
14680 }
14681 }
14682 if(!valid)
14683 {
14684 if(exp->op.exp2->destType)
14685 FreeType(exp->op.exp2->destType);
14686 exp->op.exp2->destType = type1;
14687 type1->refCount++;
14688 if(CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0))
14689 {
14690 if(exp->expType)
14691 FreeType(exp->expType);
14692 exp->expType = exp->op.exp2->destType;
14693 if(exp->op.exp2->destType)
14694 exp->op.exp2->destType->refCount++;
14695 }
14696 else if(type1 && type2)
14697 {
14698 char expString1[10240];
14699 char expString2[10240];
14700 char type1String[1024];
14701 char type2String[1024];
14702
14703 expString1[0] = '\0';
14704 expString2[0] = '\0';
14705 type1String[0] = '\0';
14706 type2String[0] = '\0';
14707 if(inCompiler)
14708 {
14709 PrintExpression(exp->op.exp1, expString1);
14710 __ecereNameSpace__ecere__sys__ChangeCh(expString1, '\n', ' ');
14711 PrintExpression(exp->op.exp2, expString2);
14712 __ecereNameSpace__ecere__sys__ChangeCh(expString2, '\n', ' ');
14713 PrintType(exp->op.exp1->expType, type1String, 0x0, 0x1);
14714 PrintType(exp->op.exp2->expType, type2String, 0x0, 0x1);
14715 }
14716 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expressions %s (%s) and %s (%s)\n", (((void *)0))), expString1, type1String, expString2, type2String);
14717 if(type1->kind == 8 && type1->_class && type1->_class->registered && type1->_class->registered->type == 4)
14718 {
14719 exp->expType = exp->op.exp1->expType;
14720 if(exp->op.exp1->expType)
14721 exp->op.exp1->expType->refCount++;
14722 }
14723 else if(type2->kind == 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 4)
14724 {
14725 exp->expType = exp->op.exp2->expType;
14726 if(exp->op.exp2->expType)
14727 exp->op.exp2->expType->refCount++;
14728 }
14729 }
14730 }
14731 }
14732 else if(type2)
14733 {
14734 if(type2->kind == 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 4)
14735 {
14736 struct Type * oldType = exp->op.exp1->expType;
14737
14738 exp->op.exp1->expType = (((void *)0));
14739 if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
14740 FreeType(oldType);
14741 else
14742 exp->op.exp1->expType = oldType;
14743 }
14744 if(exp->op.exp1->destType)
14745 FreeType(exp->op.exp1->destType);
14746 exp->op.exp1->destType = type2;
14747 type2->refCount++;
14748 if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
14749 {
14750 if(exp->expType)
14751 FreeType(exp->expType);
14752 exp->expType = exp->op.exp1->destType;
14753 if(exp->op.exp1->destType)
14754 exp->op.exp1->destType->refCount++;
14755 }
14756 }
14757 }
14758 else if(type2 && (!type1 || (type2->kind == 8 && type1->kind != 8)))
14759 {
14760 if(type1 && type2->_class && type2->_class->registered && type2->_class->registered->type == 3)
14761 {
14762 if(exp->op.exp1->destType)
14763 FreeType(exp->op.exp1->destType);
14764 exp->op.exp1->destType = type2->_class->registered->dataType;
14765 if(type2->_class->registered->dataType)
14766 type2->_class->registered->dataType->refCount++;
14767 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
14768 }
14769 if(exp->op.op == '!')
14770 {
14771 exp->expType = MkClassType("bool");
14772 exp->expType->truth = 0x1;
14773 }
14774 else
14775 {
14776 exp->expType = type2;
14777 if(type2)
14778 type2->refCount++;
14779 }
14780 }
14781 else if(type1 && (!type2 || (type1->kind == 8 && type2->kind != 8)))
14782 {
14783 if(type2 && type1->_class && type1->_class->registered && type1->_class->registered->type == 3)
14784 {
14785 if(exp->op.exp2->destType)
14786 FreeType(exp->op.exp2->destType);
14787 exp->op.exp2->destType = type1->_class->registered->dataType;
14788 if(type1->_class->registered->dataType)
14789 type1->_class->registered->dataType->refCount++;
14790 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
14791 }
14792 exp->expType = type1;
14793 if(type1)
14794 type1->refCount++;
14795 }
14796 }
14797 yylloc = exp->loc;
14798 if(exp->op.exp1 && !exp->op.exp1->expType)
14799 {
14800 char expString[10000];
14801
14802 expString[0] = '\0';
14803 if(inCompiler)
14804 {
14805 PrintExpression(exp->op.exp1, expString);
14806 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14807 }
14808 if(expString[0])
14809 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s\n", (((void *)0))), expString);
14810 }
14811 if(exp->op.exp2 && !exp->op.exp2->expType)
14812 {
14813 char expString[10240];
14814
14815 expString[0] = '\0';
14816 if(inCompiler)
14817 {
14818 PrintExpression(exp->op.exp2, expString);
14819 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14820 }
14821 if(expString[0])
14822 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s\n", (((void *)0))), expString);
14823 }
14824 if(boolResult)
14825 {
14826 FreeType(exp->expType);
14827 exp->expType = MkClassType("bool");
14828 exp->expType->truth = 0x1;
14829 }
14830 if(exp->op.op != SIZEOF)
14831 exp->isConstant = (!exp->op.exp1 || exp->op.exp1->isConstant) && (!exp->op.exp2 || exp->op.exp2->isConstant);
14832 if(exp->op.op == SIZEOF && exp->op.exp2->expType)
14833 {
14834 DeclareType(exp->op.exp2->expType, 0x0, 0x0);
14835 }
14836 yylloc = oldyylloc;
14837 FreeType(dummy);
14838 if(type2)
14839 FreeType(type2);
14840 break;
14841 }
14842 case 5:
14843 case 32:
14844 {
14845 struct Expression * e;
14846
14847 exp->isConstant = 0x1;
14848 for(e = (*exp->list).first; e; e = e->next)
14849 {
14850 unsigned int inced = 0x0;
14851
14852 if(!e->next)
14853 {
14854 FreeType(e->destType);
14855 e->destType = exp->destType;
14856 if(e->destType)
14857 {
14858 exp->destType->refCount++;
14859 e->destType->count++;
14860 inced = 0x1;
14861 }
14862 }
14863 ProcessExpressionType(e);
14864 if(inced)
14865 exp->destType->count--;
14866 if(!exp->expType && !e->next)
14867 {
14868 exp->expType = e->expType;
14869 if(e->expType)
14870 e->expType->refCount++;
14871 }
14872 if(!e->isConstant)
14873 exp->isConstant = 0x0;
14874 }
14875 e = (*exp->list).first;
14876 if(!e->next && e->type == 8)
14877 {
14878 struct Expression * next = exp->next, * prev = exp->prev;
14879
14880 FreeType(exp->expType);
14881 FreeType(exp->destType);
14882 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->list), exp->list = 0);
14883 *exp = *e;
14884 exp->prev = prev;
14885 exp->next = next;
14886 ((e ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(e) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(e)) : 0), e = 0);
14887 ProcessExpressionType(exp);
14888 }
14889 break;
14890 }
14891 case 6:
14892 {
14893 struct Expression * e;
14894
14895 exp->isConstant = 0x1;
14896 ProcessExpressionType(exp->index.exp);
14897 if(!exp->index.exp->isConstant)
14898 exp->isConstant = 0x0;
14899 if(exp->index.exp->expType)
14900 {
14901 struct Type * source = exp->index.exp->expType;
14902
14903 if(source->kind == 8 && source->_class && source->_class->registered)
14904 {
14905 struct __ecereNameSpace__ecere__com__Class * _class = source->_class->registered;
14906 struct __ecereNameSpace__ecere__com__Class * c = _class->templateClass ? _class->templateClass : _class;
14907
14908 if(_class != containerClass && __ecereNameSpace__ecere__com__eClass_IsDerived(c, containerClass) && _class->templateArgs)
14909 {
14910 exp->expType = ProcessTypeString(_class->templateArgs[2].dataTypeString, 0x0);
14911 if(exp->index.index && (*exp->index.index).last)
14912 {
14913 ((struct Expression *)(*exp->index.index).last)->destType = ProcessTypeString(_class->templateArgs[1].dataTypeString, 0x0);
14914 }
14915 }
14916 }
14917 }
14918 for(e = (*exp->index.index).first; e; e = e->next)
14919 {
14920 if(!e->next && exp->index.exp->expType && exp->index.exp->expType->kind == 12 && exp->index.exp->expType->enumClass)
14921 {
14922 if(e->destType)
14923 FreeType(e->destType);
14924 e->destType = MkClassType(exp->index.exp->expType->enumClass->string);
14925 }
14926 ProcessExpressionType(e);
14927 if(!e->next)
14928 {
14929 }
14930 if(!e->isConstant)
14931 exp->isConstant = 0x0;
14932 }
14933 if(!exp->expType)
14934 exp->expType = Dereference(exp->index.exp->expType);
14935 if(exp->expType)
14936 DeclareType(exp->expType, 0x0, 0x0);
14937 break;
14938 }
14939 case 7:
14940 {
14941 struct Expression * e;
14942 struct Type * functionType;
14943 struct Type * methodType = (((void *)0));
14944 char name[1024];
14945
14946 name[0] = '\0';
14947 if(inCompiler)
14948 {
14949 PrintExpression(exp->call.exp, name);
14950 if(exp->call.exp->expType && !exp->call.exp->expType->returnType)
14951 {
14952 PrintExpression(exp->call.exp, name);
14953 }
14954 }
14955 if(exp->call.exp->type == 0)
14956 {
14957 struct Expression * idExp = exp->call.exp;
14958 struct Identifier * id = idExp->identifier;
14959
14960 if(!strcmp(id->string, "__builtin_frame_address"))
14961 {
14962 exp->expType = ProcessTypeString("void *", 0x1);
14963 if(exp->call.arguments && (*exp->call.arguments).first)
14964 ProcessExpressionType((*exp->call.arguments).first);
14965 break;
14966 }
14967 else if(!strcmp(id->string, "__ENDIAN_PAD"))
14968 {
14969 exp->expType = ProcessTypeString("int", 0x1);
14970 if(exp->call.arguments && (*exp->call.arguments).first)
14971 ProcessExpressionType((*exp->call.arguments).first);
14972 break;
14973 }
14974 else if(!strcmp(id->string, "Max") || !strcmp(id->string, "Min") || !strcmp(id->string, "Sgn") || !strcmp(id->string, "Abs"))
14975 {
14976 struct Expression * a = (((void *)0));
14977 struct Expression * b = (((void *)0));
14978 struct Expression * tempExp1 = (((void *)0)), * tempExp2 = (((void *)0));
14979
14980 if((!strcmp(id->string, "Max") || !strcmp(id->string, "Min")) && (*exp->call.arguments).count == 2)
14981 {
14982 a = (*exp->call.arguments).first;
14983 b = (*exp->call.arguments).last;
14984 tempExp1 = a;
14985 tempExp2 = b;
14986 }
14987 else if((*exp->call.arguments).count == 1)
14988 {
14989 a = (*exp->call.arguments).first;
14990 tempExp1 = a;
14991 }
14992 if(a)
14993 {
14994 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear((&*exp->call.arguments));
14995 idExp->identifier = (((void *)0));
14996 FreeExpContents(exp);
14997 ProcessExpressionType(a);
14998 if(b)
14999 ProcessExpressionType(b);
15000 exp->type = 5;
15001 exp->list = MkList();
15002 if(a->expType && (!b || b->expType))
15003 {
15004 if((!a->isConstant && a->type != 0) || (b && !b->isConstant && b->type != 0))
15005 {
15006 if(inCompiler)
15007 {
15008 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15009 struct __ecereNameSpace__ecere__sys__OldList * decls = MkList();
15010 struct Declaration * decl;
15011 char temp1[1024], temp2[1024];
15012
15013 GetTypeSpecs(a->expType, specs);
15014 if(a && !a->isConstant && a->type != 0)
15015 {
15016 sprintf(temp1, "__simpleStruct%d", curContext->simpleID++);
15017 ListAdd(decls, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(temp1)), (((void *)0))));
15018 tempExp1 = QMkExpId(temp1);
15019 tempExp1->expType = a->expType;
15020 if(a->expType)
15021 a->expType->refCount++;
15022 ListAdd(exp->list, MkExpOp(CopyExpression(tempExp1), '=', a));
15023 }
15024 if(b && !b->isConstant && b->type != 0)
15025 {
15026 sprintf(temp2, "__simpleStruct%d", curContext->simpleID++);
15027 ListAdd(decls, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(temp2)), (((void *)0))));
15028 tempExp2 = QMkExpId(temp2);
15029 tempExp2->expType = b->expType;
15030 if(b->expType)
15031 b->expType->refCount++;
15032 ListAdd(exp->list, MkExpOp(CopyExpression(tempExp2), '=', b));
15033 }
15034 decl = MkDeclaration(specs, decls);
15035 if(!curCompound->compound.declarations)
15036 curCompound->compound.declarations = MkList();
15037 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*curCompound->compound.declarations), (((void *)0)), decl);
15038 }
15039 }
15040 }
15041 if(!strcmp(id->string, "Max") || !strcmp(id->string, "Min"))
15042 {
15043 int op = (!strcmp(id->string, "Max")) ? '>' : '<';
15044
15045 ListAdd(exp->list, MkExpCondition(MkExpBrackets(MkListOne(MkExpOp(CopyExpression(tempExp1), op, CopyExpression(tempExp2)))), MkListOne(CopyExpression(tempExp1)), CopyExpression(tempExp2)));
15046 exp->expType = a->expType;
15047 if(a->expType)
15048 a->expType->refCount++;
15049 }
15050 else if(!strcmp(id->string, "Abs"))
15051 {
15052 ListAdd(exp->list, MkExpCondition(MkExpBrackets(MkListOne(MkExpOp(CopyExpression(tempExp1), '<', MkExpConstant("0")))), MkListOne(MkExpOp((((void *)0)), '-', CopyExpression(tempExp1))), CopyExpression(tempExp1)));
15053 exp->expType = a->expType;
15054 if(a->expType)
15055 a->expType->refCount++;
15056 }
15057 else if(!strcmp(id->string, "Sgn"))
15058 {
15059 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"))))));
15060 exp->expType = ProcessTypeString("int", 0x0);
15061 }
15062 FreeExpression(tempExp1);
15063 if(tempExp2)
15064 FreeExpression(tempExp2);
15065 FreeIdentifier(id);
15066 break;
15067 }
15068 }
15069 }
15070 {
15071 struct Type * dummy = (dummy = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), dummy->count = 1, dummy->refCount = 1, dummy);
15072
15073 if(!exp->call.exp->destType)
15074 {
15075 exp->call.exp->destType = dummy;
15076 dummy->refCount++;
15077 }
15078 ProcessExpressionType(exp->call.exp);
15079 if(exp->call.exp->destType == dummy)
15080 {
15081 FreeType(dummy);
15082 exp->call.exp->destType = (((void *)0));
15083 }
15084 FreeType(dummy);
15085 }
15086 functionType = exp->call.exp->expType;
15087 if(functionType && functionType->kind == 16)
15088 {
15089 methodType = functionType;
15090 functionType = methodType->method->dataType;
15091 if(exp->call.exp->expType->usedClass)
15092 {
15093 char typeString[1024];
15094
15095 typeString[0] = '\0';
15096 {
15097 struct Symbol * back = functionType->thisClass;
15098
15099 functionType->thisClass = (((void *)0));
15100 PrintType(functionType, typeString, 0x1, 0x1);
15101 functionType->thisClass = back;
15102 }
15103 if(strstr(typeString, "thisclass"))
15104 {
15105 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15106 struct Declarator * decl;
15107
15108 {
15109 struct Context * context = SetupTemplatesContext(exp->call.exp->expType->usedClass);
15110
15111 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
15112 if(thisClass != (exp->call.exp->expType->usedClass->templateClass ? exp->call.exp->expType->usedClass->templateClass : exp->call.exp->expType->usedClass))
15113 thisClassParams = 0x0;
15114 ReplaceThisClassSpecifiers(specs, exp->call.exp->expType->usedClass);
15115 {
15116 struct __ecereNameSpace__ecere__com__Class * backupThisClass = thisClass;
15117
15118 thisClass = exp->call.exp->expType->usedClass;
15119 ProcessDeclarator(decl);
15120 thisClass = backupThisClass;
15121 }
15122 thisClassParams = 0x1;
15123 functionType = ProcessType(specs, decl);
15124 functionType->refCount = 0;
15125 FinishTemplatesContext(context);
15126 }
15127 FreeList(specs, FreeSpecifier);
15128 FreeDeclarator(decl);
15129 }
15130 }
15131 }
15132 if(functionType && functionType->kind == 13 && functionType->type && functionType->type->kind == 11)
15133 {
15134 struct Type * type = functionType->type;
15135
15136 if(!functionType->refCount)
15137 {
15138 functionType->type = (((void *)0));
15139 FreeType(functionType);
15140 }
15141 functionType = type;
15142 }
15143 if(functionType && functionType->kind != 11)
15144 {
15145 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "called object %s is not a function\n", (((void *)0))), name);
15146 }
15147 else if(functionType)
15148 {
15149 unsigned int emptyParams = 0x0, noParams = 0x0;
15150 struct Expression * e = exp->call.arguments ? (*exp->call.arguments).first : (((void *)0));
15151 struct Type * type = functionType->params.first;
15152 struct Expression * memberExp = (exp->call.exp->type == 8) ? exp->call.exp : (((void *)0));
15153 int extra = 0;
15154 struct Location oldyylloc = yylloc;
15155
15156 if(!type)
15157 emptyParams = 0x1;
15158 if(functionType->extraParam && e && functionType->thisClass)
15159 {
15160 e->destType = MkClassType(functionType->thisClass->string);
15161 e = e->next;
15162 }
15163 if(!functionType->staticMethod && !functionType->extraParam)
15164 {
15165 if(memberExp && memberExp->member.exp && memberExp->member.exp->expType && memberExp->member.exp->expType->kind == 19 && memberExp->member.exp->expType->_class)
15166 {
15167 type = MkClassType(memberExp->member.exp->expType->_class->string);
15168 if(e)
15169 {
15170 e->destType = type;
15171 e = e->next;
15172 type = functionType->params.first;
15173 }
15174 else
15175 type->refCount = 0;
15176 }
15177 else if(!memberExp && (functionType->thisClass || (methodType && methodType->methodClass)))
15178 {
15179 type = MkClassType(functionType->thisClass ? functionType->thisClass->string : (methodType ? methodType->methodClass->fullName : (((void *)0))));
15180 type->byReference = functionType->byReference;
15181 type->typedByReference = functionType->typedByReference;
15182 if(e)
15183 {
15184 if(e->next && type->kind == 8 && (functionType && functionType->thisClass) && functionType->classObjectType == 2)
15185 e = e->next;
15186 e->destType = type;
15187 e = e->next;
15188 type = functionType->params.first;
15189 }
15190 else
15191 type->refCount = 0;
15192 }
15193 }
15194 if(type && type->kind == 0)
15195 {
15196 noParams = 0x1;
15197 if(!type->refCount)
15198 FreeType(type);
15199 type = (((void *)0));
15200 }
15201 for(; e; e = e->next)
15202 {
15203 if(!type && !emptyParams)
15204 {
15205 yylloc = e->loc;
15206 if(methodType && methodType->methodClass)
15207 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);
15208 else
15209 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);
15210 break;
15211 }
15212 if(methodType && type && type->kind == 20 && type->templateParameter->type == 0)
15213 {
15214 struct Type * templatedType = (((void *)0));
15215 struct __ecereNameSpace__ecere__com__Class * _class = methodType->usedClass;
15216 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
15217 int id = 0;
15218
15219 if(_class && _class->templateArgs)
15220 {
15221 struct __ecereNameSpace__ecere__com__Class * sClass;
15222
15223 for(sClass = _class; sClass; sClass = sClass->base)
15224 {
15225 if(sClass->templateClass)
15226 sClass = sClass->templateClass;
15227 id = 0;
15228 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
15229 {
15230 if(curParam->type == 0 && !strcmp(type->templateParameter->identifier->string, curParam->name))
15231 {
15232 struct __ecereNameSpace__ecere__com__Class * nextClass;
15233
15234 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
15235 {
15236 if(nextClass->templateClass)
15237 nextClass = nextClass->templateClass;
15238 id += nextClass->templateParams.count;
15239 }
15240 break;
15241 }
15242 id++;
15243 }
15244 if(curParam)
15245 break;
15246 }
15247 }
15248 if(curParam && _class->templateArgs[id].dataTypeString)
15249 {
15250 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = _class->templateArgs[id];
15251
15252 {
15253 struct Context * context = SetupTemplatesContext(_class);
15254
15255 templatedType = ProcessTypeString(arg.dataTypeString, 0x0);
15256 FinishTemplatesContext(context);
15257 }
15258 e->destType = templatedType;
15259 if(templatedType)
15260 {
15261 templatedType->passAsTemplate = 0x1;
15262 }
15263 }
15264 else
15265 {
15266 e->destType = type;
15267 if(type)
15268 type->refCount++;
15269 }
15270 }
15271 else
15272 {
15273 if(type && type->kind == 14 && type->prev && type->prev->kind == 8 && type->prev->classObjectType)
15274 {
15275 e->destType = type->prev;
15276 e->destType->refCount++;
15277 }
15278 else
15279 {
15280 e->destType = type;
15281 if(type)
15282 type->refCount++;
15283 }
15284 }
15285 if(type && type->kind != 14)
15286 {
15287 struct Type * next = type->next;
15288
15289 if(!type->refCount)
15290 FreeType(type);
15291 type = next;
15292 }
15293 }
15294 if(type && type->kind != 14)
15295 {
15296 if(methodType && methodType->methodClass)
15297 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);
15298 else
15299 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);
15300 }
15301 yylloc = oldyylloc;
15302 if(type && !type->refCount)
15303 FreeType(type);
15304 }
15305 else
15306 {
15307 functionType = __extension__ ({
15308 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
15309
15310 __ecereInstance1->refCount = 0, __ecereInstance1->kind = 11, __ecereInstance1;
15311 });
15312 if(exp->call.exp->type == 0)
15313 {
15314 char * string = exp->call.exp->identifier->string;
15315
15316 if(inCompiler)
15317 {
15318 struct Symbol * symbol;
15319 struct Location oldyylloc = yylloc;
15320
15321 yylloc = exp->call.exp->identifier->loc;
15322 if(strstr(string, "__builtin_") == string)
15323 {
15324 if(exp->destType)
15325 {
15326 functionType->returnType = exp->destType;
15327 exp->destType->refCount++;
15328 }
15329 }
15330 else
15331 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "%s undefined; assuming extern returning int\n", (((void *)0))), string);
15332 symbol = __extension__ ({
15333 struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
15334
15335 __ecereInstance1->string = __ecereNameSpace__ecere__sys__CopyString(string), __ecereInstance1->type = ProcessTypeString("int()", 0x1), __ecereInstance1;
15336 });
15337 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)symbol);
15338 if(strstr(symbol->string, "::"))
15339 globalContext->hasNameSpace = 0x1;
15340 yylloc = oldyylloc;
15341 }
15342 }
15343 else if(exp->call.exp->type == 8)
15344 {
15345 }
15346 else
15347 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "callable object undefined; extern assuming returning int\n", (((void *)0))));
15348 if(!functionType->returnType)
15349 {
15350 functionType->returnType = __extension__ ({
15351 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
15352
15353 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 3, __ecereInstance1;
15354 });
15355 }
15356 }
15357 if(functionType && functionType->kind == 11)
15358 {
15359 exp->expType = functionType->returnType;
15360 if(functionType->returnType)
15361 functionType->returnType->refCount++;
15362 if(!functionType->refCount)
15363 FreeType(functionType);
15364 }
15365 if(exp->call.arguments)
15366 {
15367 for(e = (*exp->call.arguments).first; e; e = e->next)
15368 {
15369 struct Type * destType = e->destType;
15370
15371 ProcessExpressionType(e);
15372 }
15373 }
15374 break;
15375 }
15376 case 8:
15377 {
15378 struct Type * type;
15379 struct Location oldyylloc = yylloc;
15380 unsigned int thisPtr;
15381 struct Expression * checkExp = exp->member.exp;
15382
15383 while(checkExp)
15384 {
15385 if(checkExp->type == 11)
15386 checkExp = checkExp->cast.exp;
15387 else if(checkExp->type == 5)
15388 checkExp = checkExp->list ? (*checkExp->list).first : (((void *)0));
15389 else
15390 break;
15391 }
15392 thisPtr = (checkExp && checkExp->type == 0 && !strcmp(checkExp->identifier->string, "this"));
15393 exp->thisPtr = thisPtr;
15394 if(exp->member.member && exp->member.member->_class && exp->member.member->_class->name)
15395 {
15396 exp->member.member->classSym = exp->member.member->_class->symbol;
15397 }
15398 ProcessExpressionType(exp->member.exp);
15399 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)
15400 {
15401 exp->isConstant = 0x0;
15402 }
15403 else
15404 exp->isConstant = exp->member.exp->isConstant;
15405 type = exp->member.exp->expType;
15406 yylloc = exp->loc;
15407 if(type && (type->kind == 20))
15408 {
15409 struct __ecereNameSpace__ecere__com__Class * _class = thisClass ? thisClass : currentClass;
15410 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param = (((void *)0));
15411
15412 if(_class)
15413 {
15414 for(param = _class->templateParams.first; param; param = param->next)
15415 {
15416 if(param->type == 1 && exp->member.member && exp->member.member->string && !strcmp(param->name, exp->member.member->string))
15417 break;
15418 }
15419 }
15420 if(param && param->defaultArg.member)
15421 {
15422 struct Expression * argExp = GetTemplateArgExpByName(param->name, thisClass, 1);
15423
15424 if(argExp)
15425 {
15426 struct Expression * expMember = exp->member.exp;
15427 struct Declarator * decl;
15428 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15429 char thisClassTypeString[1024];
15430
15431 FreeIdentifier(exp->member.member);
15432 ProcessExpressionType(argExp);
15433 {
15434 char * colon = strstr(param->defaultArg.memberString, "::");
15435
15436 if(colon)
15437 {
15438 char className[1024];
15439 struct __ecereNameSpace__ecere__com__Class * sClass;
15440
15441 memcpy(thisClassTypeString, param->defaultArg.memberString, colon - param->defaultArg.memberString);
15442 thisClassTypeString[colon - param->defaultArg.memberString] = '\0';
15443 }
15444 else
15445 strcpy(thisClassTypeString, _class->fullName);
15446 }
15447 decl = SpecDeclFromString(param->defaultArg.member->dataTypeString, specs, (((void *)0)));
15448 exp->expType = ProcessType(specs, decl);
15449 if(exp->expType->kind == 8 && exp->expType->_class && exp->expType->_class->registered && exp->expType->_class->registered->templateClass)
15450 {
15451 struct __ecereNameSpace__ecere__com__Class * expClass = exp->expType->_class->registered;
15452 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
15453 int c;
15454 int paramCount = 0;
15455 int lastParam = -1;
15456 char templateString[1024];
15457 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
15458
15459 sprintf(templateString, "%s<", expClass->templateClass->fullName);
15460 for(cClass = expClass; cClass; cClass = cClass->base)
15461 {
15462 int p = 0;
15463
15464 for(param = cClass->templateParams.first; param; param = param->next)
15465 {
15466 int id = p;
15467 struct __ecereNameSpace__ecere__com__Class * sClass;
15468 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
15469
15470 for(sClass = cClass->base; sClass; sClass = sClass->base)
15471 id += sClass->templateParams.count;
15472 arg = expClass->templateArgs[id];
15473 for(sClass = _class; sClass; sClass = sClass->base)
15474 {
15475 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * cParam;
15476 int p = 0;
15477 struct __ecereNameSpace__ecere__com__Class * nextClass;
15478
15479 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
15480 p += nextClass->templateParams.count;
15481 for(cParam = sClass->templateParams.first; cParam; cParam = cParam->next, p++)
15482 {
15483 if(cParam->type == 0 && arg.dataTypeString && !strcmp(cParam->name, arg.dataTypeString))
15484 {
15485 if(_class->templateArgs && arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
15486 {
15487 arg.dataTypeString = _class->templateArgs[p].dataTypeString;
15488 arg.dataTypeClass = _class->templateArgs[p].dataTypeClass;
15489 break;
15490 }
15491 }
15492 }
15493 }
15494 {
15495 char argument[256];
15496
15497 argument[0] = '\0';
15498 switch(param->type)
15499 {
15500 case 2:
15501 {
15502 char expString[1024];
15503 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15504 struct Declarator * decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
15505 struct Expression * exp;
15506 char * string = PrintHexUInt64(arg.expression.ui64);
15507
15508 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
15509 (__ecereNameSpace__ecere__com__eSystem_Delete(string), string = 0);
15510 ProcessExpressionType(exp);
15511 ComputeExpression(exp);
15512 expString[0] = '\0';
15513 PrintExpression(exp, expString);
15514 strcat(argument, expString);
15515 FreeExpression(exp);
15516 break;
15517 }
15518 case 1:
15519 {
15520 strcat(argument, arg.member->name);
15521 break;
15522 }
15523 case 0:
15524 {
15525 if(arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
15526 {
15527 if(!strcmp(arg.dataTypeString, "thisclass"))
15528 strcat(argument, thisClassTypeString);
15529 else
15530 strcat(argument, arg.dataTypeString);
15531 }
15532 break;
15533 }
15534 }
15535 if(argument[0])
15536 {
15537 if(paramCount)
15538 strcat(templateString, ", ");
15539 if(lastParam != p - 1)
15540 {
15541 strcat(templateString, param->name);
15542 strcat(templateString, " = ");
15543 }
15544 strcat(templateString, argument);
15545 paramCount++;
15546 lastParam = p;
15547 }
15548 p++;
15549 }
15550 }
15551 }
15552 {
15553 int len = strlen(templateString);
15554
15555 if(templateString[len - 1] == '>')
15556 templateString[len++] = ' ';
15557 templateString[len++] = '>';
15558 templateString[len++] = '\0';
15559 }
15560 {
15561 struct Context * context = SetupTemplatesContext(_class);
15562
15563 FreeType(exp->expType);
15564 exp->expType = ProcessTypeString(templateString, 0x0);
15565 FinishTemplatesContext(context);
15566 }
15567 }
15568 exp->type = 5;
15569 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")))))))));
15570 }
15571 }
15572 else if(type->templateParameter && type->templateParameter->type == 0 && (type->templateParameter->dataType || type->templateParameter->dataTypeString))
15573 {
15574 type = ProcessTemplateParameterType(type->templateParameter);
15575 }
15576 }
15577 if(type && (type->kind == 20))
15578 ;
15579 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)))
15580 {
15581 struct Identifier * id = exp->member.member;
15582 int typeKind = type->kind;
15583 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));
15584
15585 if(typeKind == 19 && exp->member.exp->type == 24)
15586 {
15587 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "ecere::com::Class");
15588 typeKind = 8;
15589 }
15590 if(id)
15591 {
15592 if(typeKind == 3 || typeKind == 15)
15593 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "int");
15594 else if(!_class)
15595 {
15596 if(type->kind == 8 && type->_class && type->_class->registered)
15597 {
15598 _class = type->_class->registered;
15599 }
15600 else if((type->kind == 12 || type->kind == 13) && type->type && type->type->kind == 1)
15601 {
15602 _class = FindClass("char *")->registered;
15603 }
15604 else if(type->kind == 13)
15605 {
15606 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "uintptr");
15607 FreeType(exp->expType);
15608 exp->expType = ProcessTypeString("uintptr", 0x0);
15609 exp->byReference = 0x1;
15610 }
15611 else
15612 {
15613 char string[1024] = "";
15614 struct Symbol * classSym;
15615
15616 PrintTypeNoConst(type, string, 0x0, 0x1);
15617 classSym = FindClass(string);
15618 if(classSym)
15619 _class = classSym->registered;
15620 }
15621 }
15622 }
15623 if(_class && id)
15624 {
15625 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
15626 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
15627 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
15628 struct __ecereNameSpace__ecere__com__Property * revConvert = (((void *)0));
15629 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
15630
15631 if(id && id->_class && id->_class->name && !strcmp(id->_class->name, "property"))
15632 exp->member.memberType = 1;
15633 if(id && id->_class && type->_class && !__ecereNameSpace__ecere__com__eClass_IsDerived(type->_class->registered, _class))
15634 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "invalid class specifier %s for object of class %s\n", (((void *)0))), _class->fullName, type->_class->string);
15635 if(typeKind != 19)
15636 {
15637 if((exp->member.memberType == 0 && thisPtr) || exp->member.memberType == 3)
15638 {
15639 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
15640 if(member && member->_class != (_class->templateClass ? _class->templateClass : _class) && exp->member.memberType != 3)
15641 {
15642 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
15643 if(prop)
15644 member = (((void *)0));
15645 }
15646 if(!member && !prop)
15647 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
15648 if((member && member->_class == (_class->templateClass ? _class->templateClass : _class)) || (prop && prop->_class == (_class->templateClass ? _class->templateClass : _class)))
15649 exp->member.thisPtr = 0x1;
15650 }
15651 else
15652 {
15653 if(!id->classSym)
15654 {
15655 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, (((void *)0)));
15656 if(!id->_class || !id->_class->name || strcmp(id->_class->name, "property"))
15657 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, (((void *)0)), (((void *)0)), (((void *)0)));
15658 }
15659 if(!prop && !member)
15660 {
15661 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, (((void *)0)));
15662 if(!method)
15663 {
15664 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
15665 if(!id->_class || !id->_class->name || strcmp(id->_class->name, "property"))
15666 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
15667 }
15668 }
15669 if(member && prop)
15670 {
15671 if(member->_class != prop->_class && !id->_class && __ecereNameSpace__ecere__com__eClass_IsDerived(member->_class, prop->_class))
15672 prop = (((void *)0));
15673 else
15674 member = (((void *)0));
15675 }
15676 }
15677 }
15678 if(!prop && !member && !method)
15679 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule);
15680 if(!prop && !member && !method)
15681 {
15682 if(typeKind == 19)
15683 {
15684 classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(type->_class->registered, exp->member.member->string);
15685 if(classProp)
15686 {
15687 exp->member.memberType = 5;
15688 exp->expType = ProcessTypeString(classProp->dataTypeString, 0x0);
15689 }
15690 else
15691 {
15692 char structName[1024];
15693 struct Identifier * id = exp->member.member;
15694 struct Expression * classExp = exp->member.exp;
15695
15696 type->refCount++;
15697 FreeType(classExp->expType);
15698 classExp->expType = ProcessTypeString("ecere::com::Class", 0x0);
15699 strcpy(structName, "__ecereClassData_");
15700 FullClassNameCat(structName, type->_class->string, 0x0);
15701 exp->type = 9;
15702 exp->member.member = id;
15703 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"))))))));
15704 FreeType(type);
15705 ProcessExpressionType(exp);
15706 return ;
15707 }
15708 }
15709 else
15710 {
15711 struct Symbol * classSym = FindClass(id->string);
15712
15713 if(classSym)
15714 {
15715 struct __ecereNameSpace__ecere__com__Class * convertClass = classSym->registered;
15716
15717 if(convertClass)
15718 revConvert = __ecereNameSpace__ecere__com__eClass_FindProperty(convertClass, _class->fullName, privateModule);
15719 }
15720 }
15721 }
15722 if(prop)
15723 {
15724 exp->member.memberType = 1;
15725 if(!prop->dataType)
15726 ProcessPropertyType(prop);
15727 exp->expType = prop->dataType;
15728 if(prop->dataType)
15729 prop->dataType->refCount++;
15730 }
15731 else if(member)
15732 {
15733 if(exp->member.exp->expType->classObjectType == 2 && !strcmp(exp->member.member->string, "_class"))
15734 {
15735 FreeExpContents(exp);
15736 exp->type = 0;
15737 exp->identifier = MkIdentifier("class");
15738 ProcessExpressionType(exp);
15739 return ;
15740 }
15741 exp->member.memberType = 3;
15742 DeclareStruct(_class->fullName, 0x0);
15743 if(!member->dataType)
15744 {
15745 struct Context * context = SetupTemplatesContext(_class);
15746
15747 member->dataType = ProcessTypeString(member->dataTypeString, 0x0);
15748 FinishTemplatesContext(context);
15749 }
15750 exp->expType = member->dataType;
15751 if(member->dataType)
15752 member->dataType->refCount++;
15753 }
15754 else if(revConvert)
15755 {
15756 exp->member.memberType = 4;
15757 exp->expType = MkClassType(revConvert->_class->fullName);
15758 }
15759 else if(method)
15760 {
15761 {
15762 exp->member.memberType = 2;
15763 }
15764 if(!method->dataType)
15765 ProcessMethodType(method);
15766 exp->expType = __extension__ ({
15767 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
15768
15769 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 16, __ecereInstance1->method = method, __ecereInstance1;
15770 });
15771 exp->expType->methodClass = (id && id->_class) ? _class : (((void *)0));
15772 exp->expType->usedClass = _class;
15773 }
15774 else if(!classProp)
15775 {
15776 if(exp->member.exp->expType->classObjectType == 2 && !strcmp(exp->member.member->string, "_class"))
15777 {
15778 FreeExpContents(exp);
15779 exp->type = 0;
15780 exp->identifier = MkIdentifier("class");
15781 FreeType(exp->expType);
15782 exp->expType = MkClassType("ecere::com::Class");
15783 return ;
15784 }
15785 yylloc = exp->member.member->loc;
15786 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't find member %s in class %s\n", (((void *)0))), id->string, _class->fullName);
15787 if(inCompiler)
15788 __ecereNameSpace__ecere__com__eClass_AddDataMember(_class, id->string, "int", 0, 0, 1);
15789 }
15790 if(_class && exp->expType)
15791 {
15792 struct __ecereNameSpace__ecere__com__Class * tClass;
15793
15794 tClass = _class;
15795 while(tClass && !tClass->templateClass)
15796 tClass = tClass->base;
15797 if(tClass && exp->expType->kind == 20 && exp->expType->templateParameter->type == 0)
15798 {
15799 int id = 0;
15800 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
15801 struct __ecereNameSpace__ecere__com__Class * sClass;
15802
15803 for(sClass = tClass; sClass; sClass = sClass->base)
15804 {
15805 id = 0;
15806 if(sClass->templateClass)
15807 sClass = sClass->templateClass;
15808 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
15809 {
15810 if(curParam->type == 0 && !strcmp(exp->expType->templateParameter->identifier->string, curParam->name))
15811 {
15812 for(sClass = sClass->base; sClass; sClass = sClass->base)
15813 id += sClass->templateParams.count;
15814 break;
15815 }
15816 id++;
15817 }
15818 if(curParam)
15819 break;
15820 }
15821 if(curParam && tClass->templateArgs[id].dataTypeString)
15822 {
15823 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = tClass->templateArgs[id];
15824 struct Context * context = SetupTemplatesContext(tClass);
15825
15826 FreeType(exp->expType);
15827 exp->expType = ProcessTypeString(arg.dataTypeString, 0x0);
15828 if(exp->expType)
15829 {
15830 if(exp->expType->kind == 21)
15831 {
15832 FreeType(exp->expType);
15833 exp->expType = ReplaceThisClassType(_class);
15834 }
15835 if(tClass->templateClass)
15836 exp->expType->passAsTemplate = 0x1;
15837 if(!exp->destType)
15838 {
15839 exp->destType = ProcessTypeString(arg.dataTypeString, 0x0);
15840 if(exp->destType->kind == 21)
15841 {
15842 FreeType(exp->destType);
15843 exp->destType = ReplaceThisClassType(_class);
15844 }
15845 }
15846 }
15847 FinishTemplatesContext(context);
15848 }
15849 }
15850 else if(tClass && exp->expType->kind == 13 && exp->expType->type && exp->expType->type->kind == 20 && exp->expType->type->templateParameter->type == 0)
15851 {
15852 int id = 0;
15853 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
15854 struct __ecereNameSpace__ecere__com__Class * sClass;
15855
15856 for(sClass = tClass; sClass; sClass = sClass->base)
15857 {
15858 id = 0;
15859 if(sClass->templateClass)
15860 sClass = sClass->templateClass;
15861 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
15862 {
15863 if(curParam->type == 0 && !strcmp(exp->expType->type->templateParameter->identifier->string, curParam->name))
15864 {
15865 for(sClass = sClass->base; sClass; sClass = sClass->base)
15866 id += sClass->templateParams.count;
15867 break;
15868 }
15869 id++;
15870 }
15871 if(curParam)
15872 break;
15873 }
15874 if(curParam)
15875 {
15876 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = tClass->templateArgs[id];
15877 struct Context * context = SetupTemplatesContext(tClass);
15878 struct Type * basicType;
15879
15880 basicType = ProcessTypeString(arg.dataTypeString, 0x0);
15881 if(basicType)
15882 {
15883 if(basicType->kind == 21)
15884 {
15885 FreeType(basicType);
15886 basicType = ReplaceThisClassType(_class);
15887 }
15888 FreeType(exp->expType);
15889 exp->expType = __extension__ ({
15890 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
15891
15892 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 13, __ecereInstance1->type = basicType, __ecereInstance1;
15893 });
15894 if(!exp->destType)
15895 {
15896 exp->destType = exp->expType;
15897 exp->destType->refCount++;
15898 }
15899 {
15900 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
15901 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15902 struct Declarator * decl;
15903
15904 decl = SpecDeclFromString(arg.dataTypeString, specs, (((void *)0)));
15905 *newExp = *exp;
15906 if(exp->destType)
15907 exp->destType->refCount++;
15908 if(exp->expType)
15909 exp->expType->refCount++;
15910 exp->type = 11;
15911 exp->cast.typeName = MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl));
15912 exp->cast.exp = newExp;
15913 }
15914 }
15915 FinishTemplatesContext(context);
15916 }
15917 }
15918 else if(tClass && exp->expType->kind == 8 && exp->expType->_class && strchr(exp->expType->_class->string, '<'))
15919 {
15920 struct __ecereNameSpace__ecere__com__Class * expClass = exp->expType->_class->registered;
15921
15922 if(expClass)
15923 {
15924 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
15925 int c;
15926 int p = 0;
15927 int paramCount = 0;
15928 int lastParam = -1;
15929 char templateString[1024];
15930 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
15931
15932 sprintf(templateString, "%s<", expClass->templateClass->fullName);
15933 while(cClass != expClass)
15934 {
15935 struct __ecereNameSpace__ecere__com__Class * sClass;
15936
15937 for(sClass = expClass; sClass && sClass->base != cClass; sClass = sClass->base)
15938 ;
15939 cClass = sClass;
15940 for(param = cClass->templateParams.first; param; param = param->next)
15941 {
15942 struct __ecereNameSpace__ecere__com__Class * cClassCur = (((void *)0));
15943 int c;
15944 int cp = 0;
15945 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * paramCur = (((void *)0));
15946 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
15947
15948 while(cClassCur != tClass && !paramCur)
15949 {
15950 struct __ecereNameSpace__ecere__com__Class * sClassCur;
15951
15952 for(sClassCur = tClass; sClassCur && sClassCur->base != cClassCur; sClassCur = sClassCur->base)
15953 ;
15954 cClassCur = sClassCur;
15955 for(paramCur = cClassCur->templateParams.first; paramCur; paramCur = paramCur->next)
15956 {
15957 if(!strcmp(paramCur->name, param->name))
15958 {
15959 break;
15960 }
15961 cp++;
15962 }
15963 }
15964 if(paramCur && paramCur->type == 0)
15965 arg = tClass->templateArgs[cp];
15966 else
15967 arg = expClass->templateArgs[p];
15968 {
15969 char argument[256];
15970
15971 argument[0] = '\0';
15972 switch(param->type)
15973 {
15974 case 2:
15975 {
15976 char expString[1024];
15977 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15978 struct Declarator * decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
15979 struct Expression * exp;
15980 char * string = PrintHexUInt64(arg.expression.ui64);
15981
15982 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
15983 (__ecereNameSpace__ecere__com__eSystem_Delete(string), string = 0);
15984 ProcessExpressionType(exp);
15985 ComputeExpression(exp);
15986 expString[0] = '\0';
15987 PrintExpression(exp, expString);
15988 strcat(argument, expString);
15989 FreeExpression(exp);
15990 break;
15991 }
15992 case 1:
15993 {
15994 strcat(argument, arg.member->name);
15995 break;
15996 }
15997 case 0:
15998 {
15999 if(arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
16000 strcat(argument, arg.dataTypeString);
16001 break;
16002 }
16003 }
16004 if(argument[0])
16005 {
16006 if(paramCount)
16007 strcat(templateString, ", ");
16008 if(lastParam != p - 1)
16009 {
16010 strcat(templateString, param->name);
16011 strcat(templateString, " = ");
16012 }
16013 strcat(templateString, argument);
16014 paramCount++;
16015 lastParam = p;
16016 }
16017 }
16018 p++;
16019 }
16020 }
16021 {
16022 int len = strlen(templateString);
16023
16024 if(templateString[len - 1] == '>')
16025 templateString[len++] = ' ';
16026 templateString[len++] = '>';
16027 templateString[len++] = '\0';
16028 }
16029 FreeType(exp->expType);
16030 {
16031 struct Context * context = SetupTemplatesContext(tClass);
16032
16033 exp->expType = ProcessTypeString(templateString, 0x0);
16034 FinishTemplatesContext(context);
16035 }
16036 }
16037 }
16038 }
16039 }
16040 else
16041 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)");
16042 }
16043 else if(type && (type->kind == 9 || type->kind == 10))
16044 {
16045 struct Type * memberType = exp->member.member ? FindMember(type, exp->member.member->string) : (((void *)0));
16046
16047 if(memberType)
16048 {
16049 exp->expType = memberType;
16050 if(memberType)
16051 memberType->refCount++;
16052 }
16053 }
16054 else
16055 {
16056 char expString[10240];
16057
16058 expString[0] = '\0';
16059 if(inCompiler)
16060 {
16061 PrintExpression(exp, expString);
16062 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
16063 }
16064 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "member operator on non-structure type expression %s\n", (((void *)0))), expString);
16065 }
16066 if(exp->expType && exp->expType->kind == 21 && (!exp->destType || exp->destType->kind != 21))
16067 {
16068 if(type && (type->kind == 8 || type->kind == 19 || type->kind == 3 || type->kind == 15))
16069 {
16070 struct Identifier * id = exp->member.member;
16071 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));
16072
16073 if(_class)
16074 {
16075 FreeType(exp->expType);
16076 exp->expType = ReplaceThisClassType(_class);
16077 }
16078 }
16079 }
16080 yylloc = oldyylloc;
16081 break;
16082 }
16083 case 9:
16084 {
16085 struct Type * destType = exp->destType;
16086
16087 if(exp->member.member && exp->member.member->_class && exp->member.member->_class->name)
16088 {
16089 exp->member.member->classSym = exp->member.member->_class->symbol;
16090 }
16091 exp->member.exp = MkExpBrackets(MkListOne(MkExpOp((((void *)0)), '*', exp->member.exp)));
16092 exp->type = 8;
16093 if(destType)
16094 destType->count++;
16095 ProcessExpressionType(exp);
16096 if(destType)
16097 destType->count--;
16098 break;
16099 }
16100 case 15:
16101 {
16102 struct Symbol * classSym = exp->_class->symbol;
16103
16104 if(classSym && classSym->registered)
16105 {
16106 if(classSym->registered->type == 5)
16107 {
16108 char name[1024];
16109
16110 name[0] = '\0';
16111 DeclareStruct(classSym->string, 0x0);
16112 FreeSpecifier(exp->_class);
16113 exp->type = 10;
16114 FullClassNameCat(name, classSym->string, 0x0);
16115 exp->typeName = MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(name), (((void *)0)))), (((void *)0)));
16116 }
16117 else
16118 {
16119 if(classSym->registered->fixed)
16120 {
16121 FreeSpecifier(exp->_class);
16122 exp->constant = PrintUInt(classSym->registered->templateClass ? classSym->registered->templateClass->structSize : classSym->registered->structSize);
16123 exp->type = 2;
16124 }
16125 else
16126 {
16127 char className[1024];
16128
16129 strcpy(className, "__ecereClass_");
16130 FullClassNameCat(className, classSym->string, 0x1);
16131 MangleClassName(className);
16132 DeclareClass(classSym, className);
16133 FreeExpContents(exp);
16134 exp->type = 9;
16135 exp->member.exp = MkExpIdentifier(MkIdentifier(className));
16136 exp->member.member = MkIdentifier("structSize");
16137 }
16138 }
16139 }
16140 exp->expType = __extension__ ({
16141 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16142
16143 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 3, __ecereInstance1;
16144 });
16145 break;
16146 }
16147 case 10:
16148 {
16149 struct Type * type = ProcessType(exp->typeName->qualifiers, exp->typeName->declarator);
16150
16151 exp->expType = __extension__ ({
16152 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16153
16154 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 3, __ecereInstance1;
16155 });
16156 exp->isConstant = 0x1;
16157 DeclareType(type, 0x0, 0x0);
16158 FreeType(type);
16159 break;
16160 }
16161 case 11:
16162 {
16163 struct Type * type = ProcessType(exp->cast.typeName->qualifiers, exp->cast.typeName->declarator);
16164
16165 type->count = 1;
16166 FreeType(exp->cast.exp->destType);
16167 exp->cast.exp->destType = type;
16168 type->refCount++;
16169 ProcessExpressionType(exp->cast.exp);
16170 type->count = 0;
16171 exp->expType = type;
16172 if(!exp->cast.exp->needCast && !NeedCast(exp->cast.exp->expType, type))
16173 {
16174 void * prev = exp->prev, * next = exp->next;
16175 struct Type * expType = exp->cast.exp->destType;
16176 struct Expression * castExp = exp->cast.exp;
16177 struct Type * destType = exp->destType;
16178
16179 if(expType)
16180 expType->refCount++;
16181 FreeType(exp->expType);
16182 FreeTypeName(exp->cast.typeName);
16183 *exp = *castExp;
16184 FreeType(exp->expType);
16185 FreeType(exp->destType);
16186 exp->expType = expType;
16187 exp->destType = destType;
16188 ((castExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(castExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(castExp)) : 0), castExp = 0);
16189 exp->prev = prev;
16190 exp->next = next;
16191 }
16192 else
16193 {
16194 exp->isConstant = exp->cast.exp->isConstant;
16195 }
16196 break;
16197 }
16198 case 33:
16199 {
16200 struct Type * type = ProcessType(exp->initializer.typeName->qualifiers, exp->initializer.typeName->declarator);
16201
16202 exp->expType = type;
16203 break;
16204 }
16205 case 34:
16206 {
16207 struct Type * type = ProcessType(exp->vaArg.typeName->qualifiers, exp->vaArg.typeName->declarator);
16208
16209 ProcessExpressionType(exp->vaArg.exp);
16210 exp->expType = type;
16211 break;
16212 }
16213 case 12:
16214 {
16215 struct Expression * e;
16216
16217 exp->isConstant = 0x1;
16218 FreeType(exp->cond.cond->destType);
16219 exp->cond.cond->destType = MkClassType("bool");
16220 exp->cond.cond->destType->truth = 0x1;
16221 ProcessExpressionType(exp->cond.cond);
16222 if(!exp->cond.cond->isConstant)
16223 exp->isConstant = 0x0;
16224 for(e = (*exp->cond.exp).first; e; e = e->next)
16225 {
16226 if(!e->next)
16227 {
16228 FreeType(e->destType);
16229 e->destType = exp->destType;
16230 if(e->destType)
16231 e->destType->refCount++;
16232 }
16233 ProcessExpressionType(e);
16234 if(!e->next)
16235 {
16236 exp->expType = e->expType;
16237 if(e->expType)
16238 e->expType->refCount++;
16239 }
16240 if(!e->isConstant)
16241 exp->isConstant = 0x0;
16242 }
16243 FreeType(exp->cond.elseExp->destType);
16244 exp->cond.elseExp->destType = exp->destType ? exp->destType : exp->expType;
16245 if(exp->cond.elseExp->destType)
16246 exp->cond.elseExp->destType->refCount++;
16247 ProcessExpressionType(exp->cond.elseExp);
16248 if(!exp->cond.elseExp->isConstant)
16249 exp->isConstant = 0x0;
16250 break;
16251 }
16252 case 23:
16253 {
16254 if(exp->compound && exp->compound->compound.statements && (*exp->compound->compound.statements).last)
16255 {
16256 struct Statement * last = (*exp->compound->compound.statements).last;
16257
16258 if(last->type == 3 && last->expressions && (*last->expressions).last)
16259 {
16260 ((struct Expression *)(*last->expressions).last)->destType = exp->destType;
16261 if(exp->destType)
16262 exp->destType->refCount++;
16263 }
16264 ProcessStatement(exp->compound);
16265 exp->expType = (last->expressions && (*last->expressions).last) ? ((struct Expression *)(*last->expressions).last)->expType : (((void *)0));
16266 if(exp->expType)
16267 exp->expType->refCount++;
16268 }
16269 break;
16270 }
16271 case 24:
16272 {
16273 struct Specifier * spec = (*exp->_classExp.specifiers).first;
16274
16275 if(spec && spec->type == 1)
16276 {
16277 exp->expType = MkClassType(spec->name);
16278 exp->expType->kind = 19;
16279 exp->byReference = 0x1;
16280 }
16281 else
16282 {
16283 exp->expType = MkClassType("ecere::com::Class");
16284 exp->byReference = 0x1;
16285 }
16286 break;
16287 }
16288 case 25:
16289 {
16290 struct __ecereNameSpace__ecere__com__Class * _class = thisClass ? thisClass : currentClass;
16291
16292 if(_class)
16293 {
16294 struct Identifier * id = exp->classData.id;
16295 char structName[1024];
16296 struct Expression * classExp;
16297
16298 strcpy(structName, "__ecereClassData_");
16299 FullClassNameCat(structName, _class->fullName, 0x0);
16300 exp->type = 9;
16301 exp->member.member = id;
16302 if(curCompound && FindSymbol("this", curContext, curCompound->compound.context, 0x0, 0x0))
16303 classExp = MkExpMember(MkExpIdentifier(MkIdentifier("this")), MkIdentifier("_class"));
16304 else
16305 classExp = MkExpIdentifier(MkIdentifier("class"));
16306 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"))))))));
16307 ProcessExpressionType(exp);
16308 return ;
16309 }
16310 break;
16311 }
16312 case 35:
16313 {
16314 struct Type * type = (((void *)0));
16315 char * typeString = (((void *)0));
16316 char typeStringBuf[1024];
16317
16318 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))
16319 {
16320 struct __ecereNameSpace__ecere__com__Class * templateClass = exp->destType->_class->registered;
16321
16322 typeString = templateClass->templateArgs[2].dataTypeString;
16323 }
16324 else if(exp->list)
16325 {
16326 struct Expression * e;
16327
16328 for(e = (*exp->list).first; e; e = e->next)
16329 {
16330 ProcessExpressionType(e);
16331 if(e->expType)
16332 {
16333 if(!type)
16334 {
16335 type = e->expType;
16336 type->refCount++;
16337 }
16338 else
16339 {
16340 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
16341 {
16342 FreeType(type);
16343 type = e->expType;
16344 e->expType = (((void *)0));
16345 e = (*exp->list).first;
16346 ProcessExpressionType(e);
16347 if(e->expType)
16348 {
16349 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
16350 {
16351 FreeType(e->expType);
16352 e->expType = (((void *)0));
16353 FreeType(type);
16354 type = (((void *)0));
16355 break;
16356 }
16357 }
16358 }
16359 }
16360 if(e->expType)
16361 {
16362 FreeType(e->expType);
16363 e->expType = (((void *)0));
16364 }
16365 }
16366 }
16367 if(type)
16368 {
16369 typeStringBuf[0] = '\0';
16370 PrintTypeNoConst(type, typeStringBuf, 0x0, 0x1);
16371 typeString = typeStringBuf;
16372 FreeType(type);
16373 type = (((void *)0));
16374 }
16375 }
16376 if(typeString)
16377 {
16378 char templateString[1024];
16379 struct __ecereNameSpace__ecere__sys__OldList * initializers = MkList();
16380 struct __ecereNameSpace__ecere__sys__OldList * structInitializers = MkList();
16381 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
16382 struct Expression * expExt;
16383 struct Declarator * decl = SpecDeclFromString(typeString, specs, (((void *)0)));
16384
16385 sprintf(templateString, "Container<%s>", typeString);
16386 if(exp->list)
16387 {
16388 struct Expression * e;
16389
16390 type = ProcessTypeString(typeString, 0x0);
16391 while(e = (*exp->list).first)
16392 {
16393 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*exp->list), e);
16394 e->destType = type;
16395 type->refCount++;
16396 ProcessExpressionType(e);
16397 ListAdd(initializers, MkInitializerAssignment(e));
16398 }
16399 FreeType(type);
16400 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->list), exp->list = 0);
16401 }
16402 DeclareStruct("ecere::com::BuiltInContainer", 0x0);
16403 ListAdd(structInitializers, MkInitializerAssignment(MkExpMember(MkExpClass(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0))), MkIdentifier("_vTbl"))));
16404 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
16405 ListAdd(structInitializers, MkInitializerAssignment(MkExpClass(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0)))));
16406 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
16407 ListAdd(structInitializers, MkInitializerAssignment(MkExpConstant("0")));
16408 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
16409 ListAdd(structInitializers, MkInitializerAssignment(MkExpExtensionInitializer(MkTypeName(specs, MkDeclaratorArray(decl, (((void *)0)))), MkInitializerList(initializers))));
16410 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
16411 ListAdd(structInitializers, MkInitializerAssignment(__extension__ ({
16412 struct Expression * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
16413
16414 __ecereInstance1->type = 2, __ecereInstance1->constant = __ecereNameSpace__ecere__com__PrintString(__ecereClass_int, &(*initializers).count, (void *)0), __ecereInstance1;
16415 })));
16416 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
16417 ListAdd(structInitializers, MkInitializerAssignment(MkExpClass(CopyList(specs, CopySpecifier), CopyDeclarator(decl))));
16418 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
16419 exp->expType = ProcessTypeString(templateString, 0x0);
16420 exp->type = 5;
16421 exp->list = MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName(templateString)), (((void *)0))), MkExpOp((((void *)0)), '&', expExt = MkExpExtensionInitializer(MkTypeName(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0))), MkInitializerList(structInitializers)))));
16422 ProcessExpressionType(expExt);
16423 }
16424 else
16425 {
16426 exp->expType = ProcessTypeString("Container", 0x0);
16427 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Couldn't determine type of array elements\n", (((void *)0))));
16428 }
16429 break;
16430 }
16431 }
16432 if(exp->expType && exp->expType->kind == 21 && thisClass && (!exp->destType || exp->destType->kind != 21))
16433 {
16434 FreeType(exp->expType);
16435 exp->expType = ReplaceThisClassType(thisClass);
16436 }
16437 if(exp->expType && (exp->expType->kind == 9 || exp->expType->kind == 10 || exp->expType->kind == 15) && !exp->expType->members.first && exp->expType->enumName)
16438 {
16439 struct Symbol * symbol = FindSymbol(exp->expType->enumName, curContext, globalContext, 0x1, 0x0);
16440
16441 if(symbol)
16442 {
16443 if(exp->expType->kind != 15)
16444 {
16445 struct Type * member;
16446 char * enumName = __ecereNameSpace__ecere__sys__CopyString(exp->expType->enumName);
16447
16448 FreeType(exp->expType);
16449 exp->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16450 exp->expType->kind = symbol->type->kind;
16451 exp->expType->refCount++;
16452 exp->expType->enumName = enumName;
16453 exp->expType->members = symbol->type->members;
16454 for(member = symbol->type->members.first; member; member = member->next)
16455 member->refCount++;
16456 }
16457 else
16458 {
16459 struct __ecereNameSpace__ecere__sys__NamedLink * member;
16460
16461 for(member = symbol->type->members.first; member; member = member->next)
16462 {
16463 struct __ecereNameSpace__ecere__sys__NamedLink * value = (value = __ecereNameSpace__ecere__com__eSystem_New0(structSize_NamedLink), value->name = __ecereNameSpace__ecere__sys__CopyString(member->name), value);
16464
16465 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&exp->expType->members, value);
16466 }
16467 }
16468 }
16469 }
16470 yylloc = exp->loc;
16471 if(exp->destType && (exp->destType->kind == 0 || exp->destType->kind == 18))
16472 ;
16473 else if(exp->destType && !exp->destType->keepCast)
16474 {
16475 if(!CheckExpressionType(exp, exp->destType, 0x0))
16476 {
16477 if(!exp->destType->count || unresolved)
16478 {
16479 if(!exp->expType)
16480 {
16481 yylloc = exp->loc;
16482 if(exp->destType->kind != 14)
16483 {
16484 char type2[1024];
16485
16486 type2[0] = '\0';
16487 if(inCompiler)
16488 {
16489 char expString[10240];
16490
16491 expString[0] = '\0';
16492 PrintType(exp->destType, type2, 0x0, 0x1);
16493 if(inCompiler)
16494 {
16495 PrintExpression(exp, expString);
16496 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
16497 }
16498 if(unresolved)
16499 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved identifier %s; expected %s\n", (((void *)0))), expString, type2);
16500 else if(exp->type != 16)
16501 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s; expected %s\n", (((void *)0))), expString, type2);
16502 }
16503 }
16504 else
16505 {
16506 char expString[10240];
16507
16508 expString[0] = '\0';
16509 if(inCompiler)
16510 {
16511 PrintExpression(exp, expString);
16512 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
16513 }
16514 if(unresolved)
16515 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved identifier %s\n", (((void *)0))), expString);
16516 else if(exp->type != 16)
16517 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s\n", (((void *)0))), expString);
16518 }
16519 }
16520 else
16521 {
16522 char type1[1024];
16523 char type2[1024];
16524
16525 type1[0] = '\0';
16526 type2[0] = '\0';
16527 if(inCompiler)
16528 {
16529 PrintType(exp->expType, type1, 0x0, 0x1);
16530 PrintType(exp->destType, type2, 0x0, 0x1);
16531 }
16532 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)))
16533 ;
16534 else
16535 {
16536 char expString[10240];
16537
16538 expString[0] = '\0';
16539 if(inCompiler)
16540 {
16541 PrintExpression(exp, expString);
16542 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
16543 }
16544 if(!sourceFile || (strcmp(sourceFile, "src\\lexer.ec") && strcmp(sourceFile, "src/lexer.ec") && strcmp(sourceFile, "src\\grammar.ec") && strcmp(sourceFile, "src/grammar.ec")))
16545 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expression %s (%s); expected %s\n", (((void *)0))), expString, type1, type2);
16546 FreeType(exp->expType);
16547 exp->destType->refCount++;
16548 exp->expType = exp->destType;
16549 }
16550 }
16551 }
16552 }
16553 else if(exp->destType && exp->destType->kind == 14 && exp->expType && exp->expType->passAsTemplate)
16554 {
16555 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
16556 char typeString[1024];
16557 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
16558 struct Declarator * decl;
16559
16560 typeString[0] = '\0';
16561 *newExp = *exp;
16562 if(exp->expType)
16563 exp->expType->refCount++;
16564 if(exp->expType)
16565 exp->expType->refCount++;
16566 exp->type = 11;
16567 newExp->destType = exp->expType;
16568 PrintType(exp->expType, typeString, 0x0, 0x0);
16569 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
16570 exp->cast.typeName = MkTypeName(specs, decl);
16571 exp->cast.exp = newExp;
16572 }
16573 }
16574 else if(unresolved)
16575 {
16576 if(exp->identifier->_class && exp->identifier->_class->name)
16577 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved identifier %s::%s\n", (((void *)0))), exp->identifier->_class->name, exp->identifier->string);
16578 else if(exp->identifier->string && exp->identifier->string[0])
16579 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved identifier %s\n", (((void *)0))), exp->identifier->string);
16580 }
16581 else if(!exp->expType && exp->type != 16)
16582 {
16583 char expString[10240];
16584
16585 expString[0] = '\0';
16586 if(inCompiler)
16587 {
16588 PrintExpression(exp, expString);
16589 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
16590 }
16591 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s\n", (((void *)0))), expString);
16592 }
16593 if(inCompiler)
16594 ApplyAnyObjectLogic(exp);
16595 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)))
16596 {
16597 exp->byReference = 0x1;
16598 }
16599 yylloc = oldyylloc;
16600 }
16601
16602 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)
16603 {
16604 if(*curMember)
16605 {
16606 *curMember = (*curMember)->next;
16607 if(subMemberStackPos && *subMemberStackPos > 0 && subMemberStack[*subMemberStackPos - 1]->type == 1)
16608 {
16609 *curMember = subMemberStack[--(*subMemberStackPos)];
16610 *curMember = (*curMember)->next;
16611 }
16612 while((*curMember) && (*curMember)->isProperty)
16613 *curMember = (*curMember)->next;
16614 if(subMemberStackPos)
16615 {
16616 while((*curMember) && !(*curMember)->isProperty && !(*curMember)->name && ((*curMember)->type == 2 || (*curMember)->type == 1))
16617 {
16618 subMemberStack[(*subMemberStackPos)++] = *curMember;
16619 *curMember = (*curMember)->members.first;
16620 while(*curMember && (*curMember)->isProperty)
16621 *curMember = (*curMember)->next;
16622 }
16623 }
16624 }
16625 while(!*curMember)
16626 {
16627 if(!*curMember)
16628 {
16629 if(subMemberStackPos && *subMemberStackPos)
16630 {
16631 *curMember = subMemberStack[--(*subMemberStackPos)];
16632 *curMember = (*curMember)->next;
16633 }
16634 else
16635 {
16636 struct __ecereNameSpace__ecere__com__Class * lastCurClass = *curClass;
16637
16638 if(*curClass == _class)
16639 break;
16640 for(*curClass = _class; (*curClass)->base != lastCurClass && (*curClass)->base->type != 1000; *curClass = (*curClass)->base)
16641 ;
16642 *curMember = (*curClass)->membersAndProperties.first;
16643 }
16644 while((*curMember) && (*curMember)->isProperty)
16645 *curMember = (*curMember)->next;
16646 if(subMemberStackPos)
16647 {
16648 while((*curMember) && !(*curMember)->isProperty && !(*curMember)->name && ((*curMember)->type == 2 || (*curMember)->type == 1))
16649 {
16650 subMemberStack[(*subMemberStackPos)++] = *curMember;
16651 *curMember = (*curMember)->members.first;
16652 while(*curMember && (*curMember)->isProperty)
16653 *curMember = (*curMember)->next;
16654 }
16655 }
16656 }
16657 }
16658 }
16659
16660 static void ProcessInitializer(struct Initializer * init, struct Type * type)
16661 {
16662 switch(init->type)
16663 {
16664 case 0:
16665 if(!init->exp || init->exp->type != 1 || !init->exp->instance || init->exp->instance->_class || !type || type->kind == 8)
16666 {
16667 if(init->exp && !init->exp->destType)
16668 {
16669 FreeType(init->exp->destType);
16670 init->exp->destType = type;
16671 if(type)
16672 type->refCount++;
16673 }
16674 if(init->exp)
16675 {
16676 ProcessExpressionType(init->exp);
16677 init->isConstant = init->exp->isConstant;
16678 }
16679 break;
16680 }
16681 else
16682 {
16683 struct Expression * exp = init->exp;
16684 struct Instantiation * inst = exp->instance;
16685 struct MembersInit * members;
16686
16687 init->type = 1;
16688 init->list = MkList();
16689 if(inst->members)
16690 {
16691 for(members = (*inst->members).first; members; members = members->next)
16692 {
16693 if(members->type == 0)
16694 {
16695 struct MemberInit * member;
16696
16697 for(member = (*members->dataMembers).first; member; member = member->next)
16698 {
16699 ListAdd(init->list, member->initializer);
16700 member->initializer = (((void *)0));
16701 }
16702 }
16703 }
16704 }
16705 FreeExpression(exp);
16706 }
16707 case 1:
16708 {
16709 struct Initializer * i;
16710 struct Type * initializerType = (((void *)0));
16711 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
16712 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
16713 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
16714 int subMemberStackPos = 0;
16715
16716 if(type && type->kind == 12)
16717 initializerType = Dereference(type);
16718 else if(type && (type->kind == 9 || type->kind == 10))
16719 initializerType = type->members.first;
16720 for(i = (*init->list).first; i; i = i->next)
16721 {
16722 if(type && type->kind == 8 && type->_class && type->_class->registered)
16723 {
16724 FindNextDataMember(type->_class->registered, &curClass, &curMember, subMemberStack, &subMemberStackPos);
16725 if(curMember)
16726 {
16727 if(!curMember->dataType)
16728 curMember->dataType = ProcessTypeString(curMember->dataTypeString, 0x0);
16729 initializerType = curMember->dataType;
16730 }
16731 }
16732 ProcessInitializer(i, initializerType);
16733 if(initializerType && type && (type->kind == 9 || type->kind == 10))
16734 initializerType = initializerType->next;
16735 if(!i->isConstant)
16736 init->isConstant = 0x0;
16737 }
16738 if(type && type->kind == 12)
16739 FreeType(initializerType);
16740 if(type && type->kind != 12 && type->kind != 9 && type->kind != 10 && (type->kind != 8 || !type->_class->registered || type->_class->registered->type != 1))
16741 {
16742 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Assigning list initializer to non list\n", (((void *)0))));
16743 }
16744 break;
16745 }
16746 }
16747 }
16748
16749 extern struct Symbol * FindType(struct Context * ctx, char *  name);
16750
16751 static void ProcessClass(struct __ecereNameSpace__ecere__sys__OldList * definitions, struct Symbol * symbol);
16752
16753 static void ProcessSpecifier(struct Specifier * spec, unsigned int declareStruct)
16754 {
16755 switch(spec->type)
16756 {
16757 case 0:
16758 {
16759 if(spec->specifier == THISCLASS)
16760 {
16761 if(thisClass)
16762 {
16763 spec->type = 1;
16764 spec->name = ReplaceThisClass(thisClass);
16765 spec->symbol = FindClass(spec->name);
16766 ProcessSpecifier(spec, declareStruct);
16767 }
16768 }
16769 break;
16770 }
16771 case 1:
16772 {
16773 struct Symbol * symbol = FindType(curContext, spec->name);
16774
16775 if(symbol)
16776 DeclareType(symbol->type, 0x1, 0x1);
16777 else if((symbol = spec->symbol) && symbol->registered && symbol->registered->type == 1 && declareStruct)
16778 DeclareStruct(spec->name, 0x0);
16779 break;
16780 }
16781 case 2:
16782 {
16783 struct Enumerator * e;
16784
16785 if(spec->list)
16786 {
16787 for(e = (*spec->list).first; e; e = e->next)
16788 {
16789 if(e->exp)
16790 ProcessExpressionType(e->exp);
16791 }
16792 }
16793 break;
16794 }
16795 case 3:
16796 case 4:
16797 {
16798 if(spec->definitions)
16799 {
16800 struct ClassDef * def;
16801 struct Symbol * symbol = spec->id ? FindClass(spec->id->string) : (((void *)0));
16802
16803 ProcessClass(spec->definitions, symbol);
16804 }
16805 break;
16806 }
16807 }
16808 }
16809
16810 static void ProcessDeclarator(struct Declarator * decl)
16811 {
16812 switch(decl->type)
16813 {
16814 case 1:
16815 if(decl->identifier->classSym)
16816 {
16817 FreeSpecifier(decl->identifier->_class);
16818 decl->identifier->_class = (((void *)0));
16819 }
16820 break;
16821 case 3:
16822 if(decl->array.exp)
16823 ProcessExpressionType(decl->array.exp);
16824 case 0:
16825 case 2:
16826 case 4:
16827 case 5:
16828 case 6:
16829 case 7:
16830 if(decl->declarator)
16831 ProcessDeclarator(decl->declarator);
16832 if(decl->type == 4)
16833 {
16834 struct Identifier * id = GetDeclId(decl);
16835
16836 if(id && id->_class)
16837 {
16838 struct TypeName * param = (param = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TypeName), param->qualifiers = MkListOne(id->_class), param->declarator = (((void *)0)), param);
16839
16840 if(!decl->function.parameters)
16841 decl->function.parameters = MkList();
16842 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*decl->function.parameters), (((void *)0)), param);
16843 id->_class = (((void *)0));
16844 }
16845 if(decl->function.parameters)
16846 {
16847 struct TypeName * param;
16848
16849 for(param = (*decl->function.parameters).first; param; param = param->next)
16850 {
16851 if(param->qualifiers && (*param->qualifiers).first)
16852 {
16853 struct Specifier * spec = (*param->qualifiers).first;
16854
16855 if(spec && spec->specifier == TYPED_OBJECT)
16856 {
16857 struct Declarator * d = param->declarator;
16858 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);
16859
16860 FreeList(param->qualifiers, FreeSpecifier);
16861 param->qualifiers = MkListOne(MkStructOrUnion(3, MkIdentifier("__ecereNameSpace__ecere__com__Class"), (((void *)0))));
16862 param->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier("class")));
16863 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*decl->function.parameters), param, newParam);
16864 param = newParam;
16865 }
16866 else if(spec && spec->specifier == ANY_OBJECT)
16867 {
16868 struct Declarator * d = param->declarator;
16869
16870 FreeList(param->qualifiers, FreeSpecifier);
16871 param->qualifiers = MkListOne(MkSpecifier(VOID));
16872 param->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d);
16873 }
16874 else if(spec->specifier == THISCLASS)
16875 {
16876 if(thisClass)
16877 {
16878 spec->type = 1;
16879 spec->name = ReplaceThisClass(thisClass);
16880 spec->symbol = FindClass(spec->name);
16881 ProcessSpecifier(spec, 0x0);
16882 }
16883 }
16884 }
16885 if(param->declarator)
16886 ProcessDeclarator(param->declarator);
16887 }
16888 }
16889 }
16890 break;
16891 }
16892 }
16893
16894 extern struct Identifier * CopyIdentifier(struct Identifier * id);
16895
16896 extern void FreeInitDeclarator(struct InitDeclarator * decl);
16897
16898 static void ProcessDeclaration(struct Declaration * decl)
16899 {
16900 yylloc = decl->loc;
16901 switch(decl->type)
16902 {
16903 case 1:
16904 {
16905 unsigned int declareStruct = 0x0;
16906
16907 if(decl->declarators)
16908 {
16909 struct InitDeclarator * d;
16910
16911 for(d = (*decl->declarators).first; d; d = d->next)
16912 {
16913 struct Type * type, * subType;
16914
16915 ProcessDeclarator(d->declarator);
16916 type = ProcessType(decl->specifiers, d->declarator);
16917 if(d->initializer)
16918 {
16919 ProcessInitializer(d->initializer, type);
16920 if((*decl->declarators).count == 1 && d->initializer->type == 0 && d->initializer->exp->type == 1)
16921 {
16922 if(type->kind == 8 && type->_class == d->initializer->exp->expType->_class)
16923 {
16924 struct Instantiation * inst = d->initializer->exp->instance;
16925
16926 inst->exp = MkExpIdentifier(CopyIdentifier(GetDeclId(d->declarator)));
16927 d->initializer->exp->instance = (((void *)0));
16928 if(decl->specifiers)
16929 FreeList(decl->specifiers, FreeSpecifier);
16930 FreeList(decl->declarators, FreeInitDeclarator);
16931 d = (((void *)0));
16932 decl->type = 2;
16933 decl->inst = inst;
16934 }
16935 }
16936 }
16937 for(subType = type; subType; )
16938 {
16939 if(subType->kind == 8)
16940 {
16941 declareStruct = 0x1;
16942 break;
16943 }
16944 else if(subType->kind == 13)
16945 break;
16946 else if(subType->kind == 12)
16947 subType = subType->arrayType;
16948 else
16949 break;
16950 }
16951 FreeType(type);
16952 if(!d)
16953 break;
16954 }
16955 }
16956 if(decl->specifiers)
16957 {
16958 struct Specifier * s;
16959
16960 for(s = (*decl->specifiers).first; s; s = s->next)
16961 {
16962 ProcessSpecifier(s, declareStruct);
16963 }
16964 }
16965 break;
16966 }
16967 case 2:
16968 {
16969 ProcessInstantiationType(decl->inst);
16970 break;
16971 }
16972 case 0:
16973 {
16974 struct Specifier * spec;
16975 struct Declarator * d;
16976 unsigned int declareStruct = 0x0;
16977
16978 if(decl->declarators)
16979 {
16980 for(d = (*decl->declarators).first; d; d = d->next)
16981 {
16982 struct Type * type = ProcessType(decl->specifiers, d->declarator);
16983 struct Type * subType;
16984
16985 ProcessDeclarator(d);
16986 for(subType = type; subType; )
16987 {
16988 if(subType->kind == 8)
16989 {
16990 declareStruct = 0x1;
16991 break;
16992 }
16993 else if(subType->kind == 13)
16994 break;
16995 else if(subType->kind == 12)
16996 subType = subType->arrayType;
16997 else
16998 break;
16999 }
17000 FreeType(type);
17001 }
17002 }
17003 if(decl->specifiers)
17004 {
17005 for(spec = (*decl->specifiers).first; spec; spec = spec->next)
17006 ProcessSpecifier(spec, declareStruct);
17007 }
17008 break;
17009 }
17010 }
17011 }
17012
17013 static struct FunctionDefinition * curFunction;
17014
17015 static void CreateFireWatcher(struct __ecereNameSpace__ecere__com__Property * prop, struct Expression * object, struct Statement * stmt)
17016 {
17017 char propName[1024], propNameM[1024];
17018 char getName[1024], setName[1024];
17019 struct __ecereNameSpace__ecere__sys__OldList * args;
17020
17021 DeclareProperty(prop, setName, getName);
17022 strcpy(propName, "__ecereProp_");
17023 FullClassNameCat(propName, prop->_class->fullName, 0x0);
17024 strcat(propName, "_");
17025 FullClassNameCat(propName, prop->name, 0x1);
17026 MangleClassName(propName);
17027 strcpy(propNameM, "__ecerePropM_");
17028 FullClassNameCat(propNameM, prop->_class->fullName, 0x0);
17029 strcat(propNameM, "_");
17030 FullClassNameCat(propNameM, prop->name, 0x1);
17031 MangleClassName(propNameM);
17032 if(prop->isWatchable)
17033 {
17034 args = MkList();
17035 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
17036 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
17037 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireWatchers")), args));
17038 args = MkList();
17039 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
17040 ListAdd(args, MkExpIdentifier(MkIdentifier(propNameM)));
17041 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireWatchers")), args));
17042 }
17043 {
17044 args = MkList();
17045 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
17046 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
17047 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireSelfWatchers")), args));
17048 args = MkList();
17049 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
17050 ListAdd(args, MkExpIdentifier(MkIdentifier(propNameM)));
17051 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireSelfWatchers")), args));
17052 }
17053 if(curFunction->propSet && !strcmp(curFunction->propSet->string, prop->name) && (!object || (object->type == 0 && !strcmp(object->identifier->string, "this"))))
17054 curFunction->propSet->fireWatchersDone = 0x1;
17055 }
17056
17057 extern struct Declaration * MkDeclarationInst(struct Instantiation * inst);
17058
17059 extern struct Instantiation * MkInstantiationNamed(struct __ecereNameSpace__ecere__sys__OldList * specs, struct Expression * exp, struct __ecereNameSpace__ecere__sys__OldList * members);
17060
17061 extern struct Statement * MkIfStmt(struct __ecereNameSpace__ecere__sys__OldList * exp, struct Statement * statement, struct Statement * elseStmt);
17062
17063 extern struct Statement * MkForStmt(struct Statement * init, struct Statement * check, struct __ecereNameSpace__ecere__sys__OldList * inc, struct Statement * statement);
17064
17065 extern struct Statement * MkWhileStmt(struct __ecereNameSpace__ecere__sys__OldList * exp, struct Statement * statement);
17066
17067 extern struct ClassFunction * MkClassFunction(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct Specifier * _class, struct Declarator * decl, struct __ecereNameSpace__ecere__sys__OldList * declList);
17068
17069 extern void ProcessClassFunctionBody(struct ClassFunction * func, struct Statement * body);
17070
17071 extern void FreePropertyWatch(struct PropertyWatch * watcher);
17072
17073 static void ProcessStatement(struct Statement * stmt)
17074 {
17075 yylloc = stmt->loc;
17076 switch(stmt->type)
17077 {
17078 case 0:
17079 ProcessStatement(stmt->labeled.stmt);
17080 break;
17081 case 1:
17082 if(stmt->caseStmt.exp)
17083 {
17084 FreeType(stmt->caseStmt.exp->destType);
17085 stmt->caseStmt.exp->destType = curSwitchType;
17086 if(curSwitchType)
17087 curSwitchType->refCount++;
17088 ProcessExpressionType(stmt->caseStmt.exp);
17089 ComputeExpression(stmt->caseStmt.exp);
17090 }
17091 if(stmt->caseStmt.stmt)
17092 ProcessStatement(stmt->caseStmt.stmt);
17093 break;
17094 case 2:
17095 {
17096 if(stmt->compound.context)
17097 {
17098 struct Declaration * decl;
17099 struct Statement * s;
17100 struct Statement * prevCompound = curCompound;
17101 struct Context * prevContext = curContext;
17102
17103 if(!stmt->compound.isSwitch)
17104 curCompound = stmt;
17105 curContext = stmt->compound.context;
17106 if(stmt->compound.declarations)
17107 {
17108 for(decl = (*stmt->compound.declarations).first; decl; decl = decl->next)
17109 ProcessDeclaration(decl);
17110 }
17111 if(stmt->compound.statements)
17112 {
17113 for(s = (*stmt->compound.statements).first; s; s = s->next)
17114 ProcessStatement(s);
17115 }
17116 curContext = prevContext;
17117 curCompound = prevCompound;
17118 }
17119 break;
17120 }
17121 case 3:
17122 {
17123 struct Expression * exp;
17124
17125 if(stmt->expressions)
17126 {
17127 for(exp = (*stmt->expressions).first; exp; exp = exp->next)
17128 ProcessExpressionType(exp);
17129 }
17130 break;
17131 }
17132 case 4:
17133 {
17134 struct Expression * exp;
17135
17136 FreeType(((struct Expression *)(*stmt->ifStmt.exp).last)->destType);
17137 ((struct Expression *)(*stmt->ifStmt.exp).last)->destType = MkClassType("bool");
17138 ((struct Expression *)(*stmt->ifStmt.exp).last)->destType->truth = 0x1;
17139 for(exp = (*stmt->ifStmt.exp).first; exp; exp = exp->next)
17140 {
17141 ProcessExpressionType(exp);
17142 }
17143 if(stmt->ifStmt.stmt)
17144 ProcessStatement(stmt->ifStmt.stmt);
17145 if(stmt->ifStmt.elseStmt)
17146 ProcessStatement(stmt->ifStmt.elseStmt);
17147 break;
17148 }
17149 case 5:
17150 {
17151 struct Type * oldSwitchType = curSwitchType;
17152
17153 if(stmt->switchStmt.exp)
17154 {
17155 struct Expression * exp;
17156
17157 for(exp = (*stmt->switchStmt.exp).first; exp; exp = exp->next)
17158 {
17159 if(!exp->next)
17160 {
17161 ProcessExpressionType(exp);
17162 }
17163 if(!exp->next)
17164 curSwitchType = exp->expType;
17165 }
17166 }
17167 ProcessStatement(stmt->switchStmt.stmt);
17168 curSwitchType = oldSwitchType;
17169 break;
17170 }
17171 case 6:
17172 {
17173 if(stmt->whileStmt.exp)
17174 {
17175 struct Expression * exp;
17176
17177 FreeType(((struct Expression *)(*stmt->whileStmt.exp).last)->destType);
17178 ((struct Expression *)(*stmt->whileStmt.exp).last)->destType = MkClassType("bool");
17179 ((struct Expression *)(*stmt->whileStmt.exp).last)->destType->truth = 0x1;
17180 for(exp = (*stmt->whileStmt.exp).first; exp; exp = exp->next)
17181 {
17182 ProcessExpressionType(exp);
17183 }
17184 }
17185 if(stmt->whileStmt.stmt)
17186 ProcessStatement(stmt->whileStmt.stmt);
17187 break;
17188 }
17189 case 7:
17190 {
17191 if(stmt->doWhile.exp)
17192 {
17193 struct Expression * exp;
17194
17195 if((*stmt->doWhile.exp).last)
17196 {
17197 FreeType(((struct Expression *)(*stmt->doWhile.exp).last)->destType);
17198 ((struct Expression *)(*stmt->doWhile.exp).last)->destType = MkClassType("bool");
17199 ((struct Expression *)(*stmt->doWhile.exp).last)->destType->truth = 0x1;
17200 }
17201 for(exp = (*stmt->doWhile.exp).first; exp; exp = exp->next)
17202 {
17203 ProcessExpressionType(exp);
17204 }
17205 }
17206 if(stmt->doWhile.stmt)
17207 ProcessStatement(stmt->doWhile.stmt);
17208 break;
17209 }
17210 case 8:
17211 {
17212 struct Expression * exp;
17213
17214 if(stmt->forStmt.init)
17215 ProcessStatement(stmt->forStmt.init);
17216 if(stmt->forStmt.check && stmt->forStmt.check->expressions)
17217 {
17218 FreeType(((struct Expression *)(*stmt->forStmt.check->expressions).last)->destType);
17219 ((struct Expression *)(*stmt->forStmt.check->expressions).last)->destType = MkClassType("bool");
17220 ((struct Expression *)(*stmt->forStmt.check->expressions).last)->destType->truth = 0x1;
17221 }
17222 if(stmt->forStmt.check)
17223 ProcessStatement(stmt->forStmt.check);
17224 if(stmt->forStmt.increment)
17225 {
17226 for(exp = (*stmt->forStmt.increment).first; exp; exp = exp->next)
17227 ProcessExpressionType(exp);
17228 }
17229 if(stmt->forStmt.stmt)
17230 ProcessStatement(stmt->forStmt.stmt);
17231 break;
17232 }
17233 case 18:
17234 {
17235 struct Identifier * id = stmt->forEachStmt.id;
17236 struct __ecereNameSpace__ecere__sys__OldList * exp = stmt->forEachStmt.exp;
17237 struct __ecereNameSpace__ecere__sys__OldList * filter = stmt->forEachStmt.filter;
17238 struct Statement * block = stmt->forEachStmt.stmt;
17239 char iteratorType[1024];
17240 struct Type * source;
17241 struct Expression * e;
17242 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));
17243 struct Expression * arrayExp;
17244 char * typeString = (((void *)0));
17245 int builtinCount = 0;
17246
17247 for(e = exp ? (*exp).first : (((void *)0)); e; e = e->next)
17248 {
17249 if(!e->next)
17250 {
17251 FreeType(e->destType);
17252 e->destType = ProcessTypeString("Container", 0x0);
17253 }
17254 if(!isBuiltin || e->next)
17255 ProcessExpressionType(e);
17256 }
17257 source = (exp && (*exp).last) ? ((struct Expression *)(*exp).last)->expType : (((void *)0));
17258 if(isBuiltin || (source && source->kind == 8 && source->_class && source->_class->registered && source->_class->registered != containerClass && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, containerClass)))
17259 {
17260 struct __ecereNameSpace__ecere__com__Class * _class = source ? source->_class->registered : (((void *)0));
17261 struct Symbol * symbol;
17262 struct Expression * expIt = (((void *)0));
17263 unsigned int isMap = 0x0, isArray = 0x0, isLinkList = 0x0, isList = 0x0, isCustomAVLTree = 0x0, isAVLTree = 0x0;
17264 struct __ecereNameSpace__ecere__com__Class * arrayClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "Array");
17265 struct __ecereNameSpace__ecere__com__Class * linkListClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "LinkList");
17266 struct __ecereNameSpace__ecere__com__Class * customAVLTreeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "CustomAVLTree");
17267
17268 stmt->type = 2;
17269 stmt->compound.context = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Context);
17270 stmt->compound.context->parent = curContext;
17271 curContext = stmt->compound.context;
17272 if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, customAVLTreeClass))
17273 {
17274 struct __ecereNameSpace__ecere__com__Class * mapClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "Map");
17275 struct __ecereNameSpace__ecere__com__Class * avlTreeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "AVLTree");
17276
17277 isCustomAVLTree = 0x1;
17278 if(__ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, avlTreeClass))
17279 isAVLTree = 0x1;
17280 else if(__ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, mapClass))
17281 isMap = 0x1;
17282 }
17283 else if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, arrayClass))
17284 isArray = 0x1;
17285 else if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, linkListClass))
17286 {
17287 struct __ecereNameSpace__ecere__com__Class * listClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "List");
17288
17289 isLinkList = 0x1;
17290 isList = __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, listClass);
17291 }
17292 if(isArray)
17293 {
17294 struct Declarator * decl;
17295 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
17296
17297 decl = SpecDeclFromString(_class->templateArgs[2].dataTypeString, specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(id)));
17298 stmt->compound.declarations = MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(decl, (((void *)0))))));
17299 ListAdd(stmt->compound.declarations, MkDeclaration(MkListOne(MkSpecifierName(source->_class->registered->fullName)), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internalArray")), MkInitializerAssignment(MkExpBrackets(exp))))));
17300 }
17301 else if(isBuiltin)
17302 {
17303 struct Type * type = (((void *)0));
17304 char typeStringBuf[1024];
17305
17306 arrayExp = (((struct Expression *)(*exp).last)->type == 35) ? (struct Expression *)(*exp).last : ((struct Expression *)(*exp).last)->cast.exp;
17307 if(((struct Expression *)(*exp).last)->type == 11)
17308 {
17309 struct TypeName * typeName = ((struct Expression *)(*exp).last)->cast.typeName;
17310
17311 if(typeName)
17312 arrayExp->destType = ProcessType(typeName->qualifiers, typeName->declarator);
17313 }
17314 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)
17315 {
17316 struct __ecereNameSpace__ecere__com__Class * templateClass = arrayExp->destType->_class->registered;
17317
17318 typeString = templateClass->templateArgs[2].dataTypeString;
17319 }
17320 else if(arrayExp->list)
17321 {
17322 struct Expression * e;
17323
17324 for(e = (*arrayExp->list).first; e; e = e->next)
17325 {
17326 ProcessExpressionType(e);
17327 if(e->expType)
17328 {
17329 if(!type)
17330 {
17331 type = e->expType;
17332 type->refCount++;
17333 }
17334 else
17335 {
17336 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
17337 {
17338 FreeType(type);
17339 type = e->expType;
17340 e->expType = (((void *)0));
17341 e = (*arrayExp->list).first;
17342 ProcessExpressionType(e);
17343 if(e->expType)
17344 {
17345 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
17346 {
17347 FreeType(e->expType);
17348 e->expType = (((void *)0));
17349 FreeType(type);
17350 type = (((void *)0));
17351 break;
17352 }
17353 }
17354 }
17355 }
17356 if(e->expType)
17357 {
17358 FreeType(e->expType);
17359 e->expType = (((void *)0));
17360 }
17361 }
17362 }
17363 if(type)
17364 {
17365 typeStringBuf[0] = '\0';
17366 PrintType(type, typeStringBuf, 0x0, 0x1);
17367 typeString = typeStringBuf;
17368 FreeType(type);
17369 }
17370 }
17371 if(typeString)
17372 {
17373 struct __ecereNameSpace__ecere__sys__OldList * initializers = MkList();
17374 struct Declarator * decl;
17375 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
17376
17377 if(arrayExp->list)
17378 {
17379 struct Expression * e;
17380
17381 builtinCount = (*arrayExp->list).count;
17382 type = ProcessTypeString(typeString, 0x0);
17383 while(e = (*arrayExp->list).first)
17384 {
17385 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*arrayExp->list), e);
17386 e->destType = type;
17387 type->refCount++;
17388 ProcessExpressionType(e);
17389 ListAdd(initializers, MkInitializerAssignment(e));
17390 }
17391 FreeType(type);
17392 (__ecereNameSpace__ecere__com__eSystem_Delete(arrayExp->list), arrayExp->list = 0);
17393 }
17394 decl = SpecDeclFromString(typeString, specs, MkDeclaratorIdentifier(id));
17395 stmt->compound.declarations = MkListOne(MkDeclaration(CopyList(specs, CopySpecifier), MkListOne(MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl), (((void *)0))))));
17396 ListAdd(stmt->compound.declarations, MkDeclaration(specs, MkListOne(MkInitDeclarator(PlugDeclarator(decl, MkDeclaratorArray(MkDeclaratorIdentifier(MkIdentifier("__internalArray")), (((void *)0)))), MkInitializerList(initializers)))));
17397 FreeList(exp, FreeExpression);
17398 }
17399 else
17400 {
17401 arrayExp->expType = ProcessTypeString("Container", 0x0);
17402 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Couldn't determine type of array elements\n", (((void *)0))));
17403 }
17404 }
17405 else if(isLinkList && !isList)
17406 {
17407 struct Declarator * decl;
17408 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
17409
17410 decl = SpecDeclFromString(_class->templateArgs[3].dataTypeString, specs, MkDeclaratorIdentifier(id));
17411 stmt->compound.declarations = MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(decl, (((void *)0))))));
17412 ListAdd(stmt->compound.declarations, MkDeclaration(MkListOne(MkSpecifierName(source->_class->registered->fullName)), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internalLinkList")), MkInitializerAssignment(MkExpBrackets(exp))))));
17413 }
17414 else if(_class->templateArgs)
17415 {
17416 if(isMap)
17417 sprintf(iteratorType, "MapIterator<%s, %s >", _class->templateArgs[5].dataTypeString, _class->templateArgs[6].dataTypeString);
17418 else
17419 sprintf(iteratorType, "Iterator<%s, %s >", _class->templateArgs[2].dataTypeString, _class->templateArgs[1].dataTypeString);
17420 stmt->compound.declarations = MkListOne(MkDeclarationInst(MkInstantiationNamed(MkListOne(MkSpecifierName(iteratorType)), MkExpIdentifier(id), MkListOne(MkMembersInitList(MkListOne(MkMemberInit(isMap ? MkListOne(MkIdentifier("map")) : (((void *)0)), MkInitializerAssignment(MkExpBrackets(exp)))))))));
17421 }
17422 symbol = FindSymbol(id->string, curContext, curContext, 0x0, 0x0);
17423 if(block)
17424 {
17425 switch(block->type)
17426 {
17427 case 2:
17428 if(block->compound.context)
17429 block->compound.context->parent = stmt->compound.context;
17430 break;
17431 case 4:
17432 if(block->ifStmt.stmt && block->ifStmt.stmt->type == 2 && block->ifStmt.stmt->compound.context)
17433 block->ifStmt.stmt->compound.context->parent = stmt->compound.context;
17434 if(block->ifStmt.elseStmt && block->ifStmt.elseStmt->type == 2 && block->ifStmt.elseStmt->compound.context)
17435 block->ifStmt.elseStmt->compound.context->parent = stmt->compound.context;
17436 break;
17437 case 5:
17438 if(block->switchStmt.stmt && block->switchStmt.stmt->type == 2 && block->switchStmt.stmt->compound.context)
17439 block->switchStmt.stmt->compound.context->parent = stmt->compound.context;
17440 break;
17441 case 6:
17442 if(block->whileStmt.stmt && block->whileStmt.stmt->type == 2 && block->whileStmt.stmt->compound.context)
17443 block->whileStmt.stmt->compound.context->parent = stmt->compound.context;
17444 break;
17445 case 7:
17446 if(block->doWhile.stmt && block->doWhile.stmt->type == 2 && block->doWhile.stmt->compound.context)
17447 block->doWhile.stmt->compound.context->parent = stmt->compound.context;
17448 break;
17449 case 8:
17450 if(block->forStmt.stmt && block->forStmt.stmt->type == 2 && block->forStmt.stmt->compound.context)
17451 block->forStmt.stmt->compound.context->parent = stmt->compound.context;
17452 break;
17453 case 18:
17454 if(block->forEachStmt.stmt && block->forEachStmt.stmt->type == 2 && block->forEachStmt.stmt->compound.context)
17455 block->forEachStmt.stmt->compound.context->parent = stmt->compound.context;
17456 break;
17457 }
17458 }
17459 if(filter)
17460 {
17461 block = MkIfStmt(filter, block, (((void *)0)));
17462 }
17463 if(isArray)
17464 {
17465 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));
17466 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.init);
17467 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.check);
17468 ProcessExpressionType((*((struct Statement *)(*stmt->compound.statements).first)->forStmt.increment).first);
17469 }
17470 else if(isBuiltin)
17471 {
17472 char count[128];
17473
17474 sprintf(count, "%d", builtinCount);
17475 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));
17476 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.init);
17477 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.check);
17478 ProcessExpressionType((*((struct Statement *)(*stmt->compound.statements).first)->forStmt.increment).first);
17479 }
17480 else if(isLinkList && !isList)
17481 {
17482 struct __ecereNameSpace__ecere__com__Class * typeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, _class->templateArgs[3].dataTypeString);
17483 struct __ecereNameSpace__ecere__com__Class * listItemClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, "ListItem");
17484
17485 if(typeClass && __ecereNameSpace__ecere__com__eClass_IsDerived(typeClass, listItemClass) && _class->templateArgs[5].dataTypeString && !strcmp(_class->templateArgs[5].dataTypeString, "LT::link"))
17486 {
17487 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));
17488 }
17489 else
17490 {
17491 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
17492 struct Declarator * decl = SpecDeclFromString(_class->templateArgs[3].dataTypeString, specs, (((void *)0)));
17493
17494 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));
17495 }
17496 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.init);
17497 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.check);
17498 ProcessExpressionType((*((struct Statement *)(*stmt->compound.statements).first)->forStmt.increment).first);
17499 }
17500 else
17501 {
17502 stmt->compound.statements = MkListOne(MkWhileStmt(MkListOne(MkExpCall(MkExpMember(expIt = MkExpIdentifier(CopyIdentifier(id)), MkIdentifier("Next")), (((void *)0)))), block));
17503 }
17504 ProcessExpressionType(expIt);
17505 if((*stmt->compound.declarations).first)
17506 ProcessDeclaration((*stmt->compound.declarations).first);
17507 if(symbol)
17508 symbol->isIterator = isMap ? 2 : ((isArray || isBuiltin) ? 3 : (isLinkList ? (isList ? 5 : 4) : (isCustomAVLTree ? 6 : 1)));
17509 ProcessStatement(stmt);
17510 curContext = stmt->compound.context->parent;
17511 break;
17512 }
17513 else
17514 {
17515 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Expression is not a container\n", (((void *)0))));
17516 }
17517 break;
17518 }
17519 case 9:
17520 break;
17521 case 10:
17522 break;
17523 case 11:
17524 break;
17525 case 12:
17526 {
17527 struct Expression * exp;
17528
17529 if(stmt->expressions)
17530 {
17531 for(exp = (*stmt->expressions).first; exp; exp = exp->next)
17532 {
17533 if(!exp->next)
17534 {
17535 if(curFunction && !curFunction->type)
17536 curFunction->type = ProcessType(curFunction->specifiers, curFunction->declarator);
17537 FreeType(exp->destType);
17538 exp->destType = (curFunction && curFunction->type && curFunction->type->kind == 11) ? curFunction->type->returnType : (((void *)0));
17539 if(exp->destType)
17540 exp->destType->refCount++;
17541 }
17542 ProcessExpressionType(exp);
17543 }
17544 }
17545 break;
17546 }
17547 case 14:
17548 {
17549 ProcessDeclaration(stmt->decl);
17550 break;
17551 }
17552 case 13:
17553 {
17554 struct AsmField * field;
17555
17556 if(stmt->asmStmt.inputFields)
17557 {
17558 for(field = (*stmt->asmStmt.inputFields).first; field; field = field->next)
17559 if(field->expression)
17560 ProcessExpressionType(field->expression);
17561 }
17562 if(stmt->asmStmt.outputFields)
17563 {
17564 for(field = (*stmt->asmStmt.outputFields).first; field; field = field->next)
17565 if(field->expression)
17566 ProcessExpressionType(field->expression);
17567 }
17568 if(stmt->asmStmt.clobberedFields)
17569 {
17570 for(field = (*stmt->asmStmt.clobberedFields).first; field; field = field->next)
17571 {
17572 if(field->expression)
17573 ProcessExpressionType(field->expression);
17574 }
17575 }
17576 break;
17577 }
17578 case 17:
17579 {
17580 struct PropertyWatch * propWatch;
17581 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->_watch.watches;
17582 struct Expression * object = stmt->_watch.object;
17583 struct Expression * watcher = stmt->_watch.watcher;
17584
17585 if(watcher)
17586 ProcessExpressionType(watcher);
17587 if(object)
17588 ProcessExpressionType(object);
17589 if(inCompiler)
17590 {
17591 if(watcher || thisClass)
17592 {
17593 struct External * external = curExternal;
17594 struct Context * context = curContext;
17595
17596 stmt->type = 3;
17597 stmt->expressions = MkList();
17598 curExternal = external->prev;
17599 for(propWatch = (*watches).first; propWatch; propWatch = propWatch->next)
17600 {
17601 struct ClassFunction * func;
17602 char watcherName[1024];
17603 struct __ecereNameSpace__ecere__com__Class * watcherClass = watcher ? ((watcher->expType && watcher->expType->kind == 8 && watcher->expType->_class) ? watcher->expType->_class->registered : (((void *)0))) : thisClass;
17604 struct External * createdExternal;
17605 struct External * externalDecl = MkExternalDeclaration((((void *)0)));
17606
17607 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, externalDecl);
17608 sprintf(watcherName, "__ecerePropertyWatcher_%d", propWatcherID++);
17609 if(propWatch->deleteWatch)
17610 strcat(watcherName, "_delete");
17611 else
17612 {
17613 struct Identifier * propID;
17614
17615 for(propID = (*propWatch->properties).first; propID; propID = propID->next)
17616 {
17617 strcat(watcherName, "_");
17618 strcat(watcherName, propID->string);
17619 }
17620 }
17621 if(object && object->expType && object->expType->kind == 8 && object->expType->_class && object->expType->_class->registered)
17622 {
17623 func = MkClassFunction(MkListOne(MkSpecifier(VOID)), (((void *)0)), MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(watcherName)), MkListOne(MkTypeName(MkListOne(MkSpecifierName(object->expType->_class->string)), MkDeclaratorIdentifier(MkIdentifier("value"))))), (((void *)0)));
17624 ProcessClassFunctionBody(func, propWatch->compound);
17625 propWatch->compound = (((void *)0));
17626 createdExternal = ProcessClassFunction(watcherClass, func, ast, curExternal, 0x1);
17627 createdExternal->symbol->idCode = external->symbol->idCode;
17628 curExternal = createdExternal;
17629 ProcessFunction(createdExternal->function);
17630 {
17631 struct Declaration * decl = MkDeclaration(CopyList(createdExternal->function->specifiers, CopySpecifier), MkListOne(MkInitDeclarator(CopyDeclarator(createdExternal->function->declarator), (((void *)0)))));
17632
17633 externalDecl->declaration = decl;
17634 if(decl->symbol && !decl->symbol->pointerExternal)
17635 decl->symbol->pointerExternal = externalDecl;
17636 }
17637 if(propWatch->deleteWatch)
17638 {
17639 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
17640
17641 ListAdd(args, CopyExpression(object));
17642 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
17643 ListAdd(args, MkExpIdentifier(MkIdentifier(watcherName)));
17644 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_WatchDestruction")), args));
17645 }
17646 else
17647 {
17648 struct __ecereNameSpace__ecere__com__Class * _class = object->expType->_class->registered;
17649 struct Identifier * propID;
17650
17651 for(propID = (*propWatch->properties).first; propID; propID = propID->next)
17652 {
17653 char propName[1024];
17654 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
17655
17656 if(prop)
17657 {
17658 char getName[1024], setName[1024];
17659 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
17660
17661 DeclareProperty(prop, setName, getName);
17662 strcpy(propName, "__ecereProp_");
17663 FullClassNameCat(propName, prop->_class->fullName, 0x0);
17664 strcat(propName, "_");
17665 FullClassNameCat(propName, prop->name, 0x1);
17666 ListAdd(args, CopyExpression(object));
17667 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
17668 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
17669 ListAdd(args, MkExpIdentifier(MkIdentifier(watcherName)));
17670 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_Watch")), args));
17671 }
17672 else
17673 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Property %s not found in class %s\n", (((void *)0))), prop->name, _class->fullName);
17674 }
17675 }
17676 }
17677 else
17678 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Invalid watched object\n", (((void *)0))));
17679 }
17680 curExternal = external;
17681 curContext = context;
17682 if(watcher)
17683 FreeExpression(watcher);
17684 if(object)
17685 FreeExpression(object);
17686 FreeList(watches, FreePropertyWatch);
17687 }
17688 else
17689 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "No observer specified and not inside a _class\n", (((void *)0))));
17690 }
17691 else
17692 {
17693 for(propWatch = (*watches).first; propWatch; propWatch = propWatch->next)
17694 {
17695 ProcessStatement(propWatch->compound);
17696 }
17697 }
17698 break;
17699 }
17700 case 15:
17701 {
17702 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->_watch.watches;
17703 struct Expression * object = stmt->_watch.object;
17704 struct __ecereNameSpace__ecere__com__Class * _class;
17705
17706 if(object)
17707 ProcessExpressionType(object);
17708 if(inCompiler)
17709 {
17710 _class = object ? ((object->expType && object->expType->kind == 8 && object->expType->_class) ? object->expType->_class->registered : (((void *)0))) : thisClass;
17711 if(_class)
17712 {
17713 struct Identifier * propID;
17714
17715 stmt->type = 3;
17716 stmt->expressions = MkList();
17717 if(!watches && curFunction->propSet && (!object || (object->type == 0 && !strcmp(object->identifier->string, "this"))))
17718 {
17719 watches = MkListOne(MkIdentifier(curFunction->propSet->string));
17720 }
17721 else if(!watches)
17722 {
17723 }
17724 if(watches)
17725 {
17726 for(propID = (*watches).first; propID; propID = propID->next)
17727 {
17728 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
17729
17730 if(prop)
17731 {
17732 CreateFireWatcher(prop, object, stmt);
17733 }
17734 else
17735 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Property %s not found in class %s\n", (((void *)0))), propID->string, _class->fullName);
17736 }
17737 }
17738 else
17739 {
17740 struct __ecereNameSpace__ecere__com__Property * prop;
17741 struct __ecereNameSpace__ecere__com__Class * base;
17742
17743 for(base = _class; base; base = base->base)
17744 {
17745 for(prop = base->membersAndProperties.first; prop; prop = prop->next)
17746 {
17747 if(prop->isProperty && prop->isWatchable)
17748 {
17749 CreateFireWatcher(prop, object, stmt);
17750 }
17751 }
17752 }
17753 }
17754 if(object)
17755 FreeExpression(object);
17756 FreeList(watches, FreeIdentifier);
17757 }
17758 else
17759 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Invalid object specified and not inside a class\n", (((void *)0))));
17760 }
17761 break;
17762 }
17763 case 16:
17764 {
17765 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->_watch.watches;
17766 struct Expression * object = stmt->_watch.object;
17767 struct Expression * watcher = stmt->_watch.watcher;
17768 struct __ecereNameSpace__ecere__com__Class * _class;
17769
17770 if(object)
17771 ProcessExpressionType(object);
17772 if(watcher)
17773 ProcessExpressionType(watcher);
17774 if(inCompiler)
17775 {
17776 _class = (object && object->expType && object->expType->kind == 8 && object->expType->_class) ? object->expType->_class->registered : (((void *)0));
17777 if(watcher || thisClass)
17778 {
17779 if(_class)
17780 {
17781 struct Identifier * propID;
17782
17783 stmt->type = 3;
17784 stmt->expressions = MkList();
17785 if(!watches)
17786 {
17787 struct __ecereNameSpace__ecere__sys__OldList * args;
17788
17789 args = MkList();
17790 ListAdd(args, CopyExpression(object));
17791 ListAdd(args, MkExpConstant("0"));
17792 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
17793 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_StopWatching")), args));
17794 }
17795 else
17796 {
17797 for(propID = (*watches).first; propID; propID = propID->next)
17798 {
17799 char propName[1024];
17800 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
17801
17802 if(prop)
17803 {
17804 char getName[1024], setName[1024];
17805 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
17806
17807 DeclareProperty(prop, setName, getName);
17808 strcpy(propName, "__ecereProp_");
17809 FullClassNameCat(propName, prop->_class->fullName, 0x0);
17810 strcat(propName, "_");
17811 FullClassNameCat(propName, prop->name, 0x1);
17812 MangleClassName(propName);
17813 ListAdd(args, CopyExpression(object));
17814 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
17815 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
17816 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_StopWatching")), args));
17817 }
17818 else
17819 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Property %s not found in class %s\n", (((void *)0))), prop->name, _class->fullName);
17820 }
17821 }
17822 if(object)
17823 FreeExpression(object);
17824 if(watcher)
17825 FreeExpression(watcher);
17826 FreeList(watches, FreeIdentifier);
17827 }
17828 else
17829 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Invalid object specified and not inside a class\n", (((void *)0))));
17830 }
17831 else
17832 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "No observer specified and not inside a class\n", (((void *)0))));
17833 }
17834 break;
17835 }
17836 }
17837 }
17838
17839 extern struct Expression * QBrackets(struct Expression * exp);
17840
17841 extern struct TypeName * QMkType(char *  spec, struct Declarator * decl);
17842
17843 extern struct Declarator * QMkPtrDecl(char *  id);
17844
17845 extern struct Expression * MkExpPointer(struct Expression * expression, struct Identifier * member);
17846
17847 extern struct Expression * QMkExpCond(struct Expression * cond, struct Expression * exp, struct Expression * elseExp);
17848
17849 extern struct Statement * MkFireWatchersStmt(struct Expression * object, struct __ecereNameSpace__ecere__sys__OldList * watches);
17850
17851 static void ProcessFunction(struct FunctionDefinition * function)
17852 {
17853 struct Identifier * id = GetDeclId(function->declarator);
17854 struct Symbol * symbol = function->declarator ? function->declarator->symbol : (((void *)0));
17855 struct Type * type = symbol ? symbol->type : (((void *)0));
17856 struct __ecereNameSpace__ecere__com__Class * oldThisClass = thisClass;
17857 struct Context * oldTopContext = topContext;
17858
17859 yylloc = function->loc;
17860 if(type && type->thisClass)
17861 {
17862 struct Symbol * classSym = type->thisClass;
17863 struct __ecereNameSpace__ecere__com__Class * _class = type->thisClass->registered;
17864 char className[1024];
17865 char structName[1024];
17866 struct Declarator * funcDecl;
17867 struct Symbol * thisSymbol;
17868 unsigned int typedObject = 0x0;
17869
17870 if(_class && !_class->base)
17871 {
17872 _class = currentClass;
17873 if(_class && !_class->symbol)
17874 _class->symbol = FindClass(_class->fullName);
17875 classSym = _class ? _class->symbol : (((void *)0));
17876 typedObject = 0x1;
17877 }
17878 thisClass = _class;
17879 if(inCompiler && _class)
17880 {
17881 if(type->kind == 11)
17882 {
17883 if(symbol->type->params.count == 1 && ((struct Type *)symbol->type->params.first)->kind == 0)
17884 {
17885 struct Type * param = symbol->type->params.first;
17886
17887 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(&symbol->type->params, param);
17888 FreeType(param);
17889 }
17890 if(type->classObjectType != 1)
17891 {
17892 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(&symbol->type->params, (((void *)0)), MkClassType(_class->fullName));
17893 symbol->type->staticMethod = 0x1;
17894 symbol->type->thisClass = (((void *)0));
17895 symbol->type->extraParam = 0x0;
17896 }
17897 }
17898 strcpy(className, "__ecereClass_");
17899 FullClassNameCat(className, _class->fullName, 0x1);
17900 MangleClassName(className);
17901 structName[0] = (char)0;
17902 FullClassNameCat(structName, _class->fullName, 0x0);
17903 funcDecl = GetFuncDecl(function->declarator);
17904 if(funcDecl)
17905 {
17906 if(funcDecl->function.parameters && (*funcDecl->function.parameters).count == 1)
17907 {
17908 struct TypeName * param = (*funcDecl->function.parameters).first;
17909
17910 if(param->qualifiers && (*param->qualifiers).count == 1 && ((struct Specifier *)(*param->qualifiers).first)->specifier == VOID && !param->declarator)
17911 {
17912 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->function.parameters), param);
17913 FreeTypeName(param);
17914 }
17915 }
17916 if(!function->propertyNoThis)
17917 {
17918 struct TypeName * thisParam;
17919
17920 if(type->classObjectType != 1)
17921 {
17922 thisParam = QMkClass(_class->fullName, MkDeclaratorIdentifier(MkIdentifier("this")));
17923 if(!funcDecl->function.parameters)
17924 funcDecl->function.parameters = MkList();
17925 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
17926 }
17927 if(typedObject)
17928 {
17929 if(type->classObjectType != 1)
17930 {
17931 if(type->byReference || _class->type == 3 || _class->type == 1000 || _class->type == 4 || _class->type == 2)
17932 thisParam->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), thisParam->declarator);
17933 }
17934 thisParam = __extension__ ({
17935 struct TypeName * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TypeName);
17936
17937 __ecereInstance1->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier("class"))), __ecereInstance1->qualifiers = MkListOne(MkStructOrUnion(3, MkIdentifier("__ecereNameSpace__ecere__com__Class"), (((void *)0)))), __ecereInstance1;
17938 });
17939 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
17940 }
17941 }
17942 }
17943 if(symbol && symbol->pointerExternal && symbol->pointerExternal->type == 1)
17944 {
17945 struct InitDeclarator * initDecl = (*symbol->pointerExternal->declaration->declarators).first;
17946
17947 funcDecl = GetFuncDecl(initDecl->declarator);
17948 if(funcDecl)
17949 {
17950 if(funcDecl->function.parameters && (*funcDecl->function.parameters).count == 1)
17951 {
17952 struct TypeName * param = (*funcDecl->function.parameters).first;
17953
17954 if(param->qualifiers && (*param->qualifiers).count == 1 && ((struct Specifier *)(*param->qualifiers).first)->specifier == VOID && !param->declarator)
17955 {
17956 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->function.parameters), param);
17957 FreeTypeName(param);
17958 }
17959 }
17960 if(type->classObjectType != 1)
17961 {
17962 if((_class->type != 2 && _class->type != 3 && _class->type != 4) || function != (struct FunctionDefinition *)symbol->externalSet)
17963 {
17964 struct TypeName * thisParam = QMkClass(_class->fullName, MkDeclaratorIdentifier(MkIdentifier("this")));
17965
17966 if(!funcDecl->function.parameters)
17967 funcDecl->function.parameters = MkList();
17968 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
17969 }
17970 }
17971 }
17972 }
17973 }
17974 if(function->body)
17975 {
17976 if(type->classObjectType != 1)
17977 {
17978 thisSymbol = __extension__ ({
17979 struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
17980
17981 __ecereInstance1->string = __ecereNameSpace__ecere__sys__CopyString("this"), __ecereInstance1->type = classSym ? MkClassType(classSym->string) : (((void *)0)), __ecereInstance1;
17982 });
17983 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&function->body->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
17984 if(typedObject && thisSymbol->type)
17985 {
17986 thisSymbol->type->classObjectType = 2;
17987 thisSymbol->type->byReference = type->byReference;
17988 thisSymbol->type->typedByReference = type->byReference;
17989 }
17990 }
17991 }
17992 if(inCompiler && _class && (_class->type == 0) && type->classObjectType != 1)
17993 {
17994 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
17995
17996 {
17997 struct __ecereNameSpace__ecere__com__Class * base;
17998
17999 for(base = _class; base && base->type != 1000; base = base->next)
18000 {
18001 for(member = base->membersAndProperties.first; member; member = member->next)
18002 if(!member->isProperty)
18003 break;
18004 if(member)
18005 break;
18006 }
18007 }
18008 for(member = _class->membersAndProperties.first; member; member = member->next)
18009 if(!member->isProperty)
18010 break;
18011 if(member)
18012 {
18013 char pointerName[1024];
18014 struct Declaration * decl;
18015 struct Initializer * initializer;
18016 struct Expression * exp, * bytePtr;
18017
18018 strcpy(pointerName, "__ecerePointer_");
18019 FullClassNameCat(pointerName, _class->fullName, 0x0);
18020 {
18021 char className[1024];
18022
18023 strcpy(className, "__ecereClass_");
18024 FullClassNameCat(className, classSym->string, 0x1);
18025 MangleClassName(className);
18026 DeclareClass(classSym, className);
18027 }
18028 bytePtr = QBrackets(MkExpCast(QMkType("char", QMkPtrDecl((((void *)0)))), QMkExpId("this")));
18029 if(_class->fixed)
18030 {
18031 char string[256];
18032
18033 sprintf(string, "%d", _class->offset);
18034 exp = QBrackets(MkExpOp(bytePtr, '+', MkExpConstant(string)));
18035 }
18036 else
18037 {
18038 exp = QBrackets(MkExpOp(bytePtr, '+', MkExpPointer(QMkExpId(className), MkIdentifier("offset"))));
18039 }
18040 exp = QBrackets(QMkExpCond(QMkExpId("this"), exp, MkExpConstant("0")));
18041 exp->expType = __extension__ ({
18042 struct Type * __ecereInstance2 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
18043
18044 __ecereInstance2->refCount = 1, __ecereInstance2->kind = 13, __ecereInstance2->type = __extension__ ({
18045 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
18046
18047 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 0, __ecereInstance1;
18048 }), __ecereInstance2;
18049 });
18050 if(function->body)
18051 {
18052 yylloc = function->body->loc;
18053 initializer = MkInitializerAssignment(MkExpCast(MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(structName), (((void *)0)))), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), exp));
18054 {
18055 struct Context * prevContext = curContext;
18056
18057 curContext = function->body->compound.context;
18058 decl = MkDeclaration(MkListOne(MkStructOrUnion(3, MkIdentifier(structName), (((void *)0)))), MkListOne(MkInitDeclarator(QMkPtrDecl(pointerName), initializer)));
18059 curContext = prevContext;
18060 }
18061 decl->symbol = (((void *)0));
18062 if(!function->body->compound.declarations)
18063 function->body->compound.declarations = MkList();
18064 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*function->body->compound.declarations), (((void *)0)), decl);
18065 }
18066 }
18067 }
18068 }
18069 else
18070 thisClass = (((void *)0));
18071 if(id)
18072 {
18073 FreeSpecifier(id->_class);
18074 id->_class = (((void *)0));
18075 if(symbol && symbol->pointerExternal && symbol->pointerExternal->type == 1)
18076 {
18077 struct InitDeclarator * initDecl = (*symbol->pointerExternal->declaration->declarators).first;
18078
18079 id = GetDeclId(initDecl->declarator);
18080 FreeSpecifier(id->_class);
18081 id->_class = (((void *)0));
18082 }
18083 }
18084 if(function->body)
18085 topContext = function->body->compound.context;
18086 {
18087 struct FunctionDefinition * oldFunction = curFunction;
18088
18089 curFunction = function;
18090 if(function->body)
18091 ProcessStatement(function->body);
18092 if(inCompiler && function->propSet && !function->propSet->fireWatchersDone)
18093 {
18094 struct Statement * prevCompound = curCompound;
18095 struct Context * prevContext = curContext;
18096 struct Statement * fireWatchers = MkFireWatchersStmt((((void *)0)), (((void *)0)));
18097
18098 if(!function->body->compound.statements)
18099 function->body->compound.statements = MkList();
18100 ListAdd(function->body->compound.statements, fireWatchers);
18101 curCompound = function->body;
18102 curContext = function->body->compound.context;
18103 ProcessStatement(fireWatchers);
18104 curContext = prevContext;
18105 curCompound = prevCompound;
18106 }
18107 curFunction = oldFunction;
18108 }
18109 if(function->declarator)
18110 {
18111 ProcessDeclarator(function->declarator);
18112 }
18113 topContext = oldTopContext;
18114 thisClass = oldThisClass;
18115 }
18116
18117 extern void FreeSymbol(struct Symbol * symbol);
18118
18119 void __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Remove(struct __ecereNameSpace__ecere__sys__BinaryTree * this, struct __ecereNameSpace__ecere__sys__BTNode * node);
18120
18121 static void ProcessClass(struct __ecereNameSpace__ecere__sys__OldList * definitions, struct Symbol * symbol)
18122 {
18123 struct ClassDef * def;
18124 struct External * external = curExternal;
18125 struct __ecereNameSpace__ecere__com__Class * regClass = symbol ? symbol->registered : (((void *)0));
18126
18127 for(def = definitions->first; def; def = def->next)
18128 {
18129 if(def->type == 0)
18130 {
18131 if(def->function->declarator)
18132 curExternal = def->function->declarator->symbol->pointerExternal;
18133 else
18134 curExternal = external;
18135 ProcessFunction((struct FunctionDefinition *)def->function);
18136 }
18137 else if(def->type == 2)
18138 {
18139 if(def->decl->type == 2)
18140 {
18141 thisClass = regClass;
18142 ProcessInstantiationType(def->decl->inst);
18143 thisClass = (((void *)0));
18144 }
18145 else
18146 {
18147 struct __ecereNameSpace__ecere__com__Class * backThisClass = thisClass;
18148
18149 if(regClass)
18150 thisClass = regClass;
18151 ProcessDeclaration(def->decl);
18152 thisClass = backThisClass;
18153 }
18154 }
18155 else if(def->type == 1 && def->defProperties)
18156 {
18157 struct MemberInit * defProperty;
18158 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);
18159
18160 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18161 for(defProperty = (*def->defProperties).first; defProperty; defProperty = defProperty->next)
18162 {
18163 thisClass = regClass;
18164 ProcessMemberInitData(defProperty, regClass, (((void *)0)), (((void *)0)), (((void *)0)), (((void *)0)));
18165 thisClass = (((void *)0));
18166 }
18167 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Remove(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18168 FreeSymbol(thisSymbol);
18169 }
18170 else if(def->type == 3 && def->propertyDef)
18171 {
18172 struct PropertyDef * prop = def->propertyDef;
18173
18174 thisClass = regClass;
18175 if(prop->setStmt)
18176 {
18177 if(regClass)
18178 {
18179 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
18180
18181 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->setStmt->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18182 }
18183 curExternal = prop->symbol ? prop->symbol->externalSet : (((void *)0));
18184 ProcessStatement(prop->setStmt);
18185 }
18186 if(prop->getStmt)
18187 {
18188 if(regClass)
18189 {
18190 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
18191
18192 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->getStmt->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18193 }
18194 curExternal = prop->symbol ? prop->symbol->externalGet : (((void *)0));
18195 ProcessStatement(prop->getStmt);
18196 }
18197 if(prop->issetStmt)
18198 {
18199 if(regClass)
18200 {
18201 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
18202
18203 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->issetStmt->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18204 }
18205 curExternal = prop->symbol ? prop->symbol->externalIsSet : (((void *)0));
18206 ProcessStatement(prop->issetStmt);
18207 }
18208 thisClass = (((void *)0));
18209 }
18210 else if(def->type == 4 && def->propertyWatch)
18211 {
18212 struct PropertyWatch * propertyWatch = def->propertyWatch;
18213
18214 thisClass = regClass;
18215 if(propertyWatch->compound)
18216 {
18217 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);
18218
18219 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&propertyWatch->compound->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18220 curExternal = (((void *)0));
18221 ProcessStatement(propertyWatch->compound);
18222 }
18223 thisClass = (((void *)0));
18224 }
18225 }
18226 }
18227
18228 void DeclareFunctionUtil(char * s)
18229 {
18230 struct __ecereNameSpace__ecere__com__GlobalFunction * function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, s);
18231
18232 if(function)
18233 {
18234 char name[1024];
18235
18236 name[0] = (char)0;
18237 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType != 1 && (!function->dataType || !function->dataType->dllExport))
18238 strcpy(name, "__ecereFunction_");
18239 FullClassNameCat(name, s, 0x0);
18240 DeclareFunction(function, name);
18241 }
18242 }
18243
18244 extern struct __ecereNameSpace__ecere__com__Instance * GetPrivateModule(void);
18245
18246 void ComputeDataTypes()
18247 {
18248 struct External * external;
18249 struct External * temp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_External);
18250 struct External * after = (((void *)0));
18251
18252 currentClass = (((void *)0));
18253 containerClass = __ecereNameSpace__ecere__com__eSystem_FindClass(GetPrivateModule(), "Container");
18254 for(external = (*ast).first; external; external = external->next)
18255 {
18256 if(external->type == 1)
18257 {
18258 struct Declaration * decl = external->declaration;
18259
18260 if(decl)
18261 {
18262 struct __ecereNameSpace__ecere__sys__OldList * decls = decl->declarators;
18263
18264 if(decls)
18265 {
18266 struct InitDeclarator * initDecl = (*decls).first;
18267
18268 if(initDecl)
18269 {
18270 struct Declarator * declarator = initDecl->declarator;
18271
18272 if(declarator && declarator->type == 1)
18273 {
18274 struct Identifier * id = declarator->identifier;
18275
18276 if(id && id->string)
18277 {
18278 if(!strcmp(id->string, "uintptr_t") || !strcmp(id->string, "intptr_t") || !strcmp(id->string, "size_t") || !strcmp(id->string, "ssize_t"))
18279 {
18280 external->symbol->id = -1001, external->symbol->idCode = -1001;
18281 after = external;
18282 }
18283 }
18284 }
18285 }
18286 }
18287 }
18288 }
18289 }
18290 temp->symbol = __extension__ ({
18291 struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
18292
18293 __ecereInstance1->id = -1000, __ecereInstance1->idCode = -1000, __ecereInstance1;
18294 });
18295 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), after, temp);
18296 curExternal = temp;
18297 DeclareFunctionUtil("eSystem_New");
18298 DeclareFunctionUtil("eSystem_New0");
18299 DeclareFunctionUtil("eSystem_Renew");
18300 DeclareFunctionUtil("eSystem_Renew0");
18301 DeclareFunctionUtil("eSystem_Delete");
18302 DeclareFunctionUtil("eClass_GetProperty");
18303 DeclareFunctionUtil("eInstance_FireSelfWatchers");
18304 DeclareStruct("ecere::com::Class", 0x0);
18305 DeclareStruct("ecere::com::Instance", 0x0);
18306 DeclareStruct("ecere::com::Property", 0x0);
18307 DeclareStruct("ecere::com::DataMember", 0x0);
18308 DeclareStruct("ecere::com::Method", 0x0);
18309 DeclareStruct("ecere::com::SerialBuffer", 0x0);
18310 DeclareStruct("ecere::com::ClassTemplateArgument", 0x0);
18311 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*ast), temp);
18312 for(external = (*ast).first; external; external = external->next)
18313 {
18314 afterExternal = curExternal = external;
18315 if(external->type == 0)
18316 {
18317 currentClass = external->function->_class;
18318 ProcessFunction(external->function);
18319 }
18320 else if(external->type == 1)
18321 {
18322 currentClass = (((void *)0));
18323 ProcessDeclaration(external->declaration);
18324 }
18325 else if(external->type == 2)
18326 {
18327 struct ClassDefinition * _class = external->_class;
18328
18329 currentClass = external->symbol->registered;
18330 if(_class->definitions)
18331 {
18332 ProcessClass(_class->definitions, _class->symbol);
18333 }
18334 if(inCompiler)
18335 {
18336 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*ast), external);
18337 ((external ? (__ecereClass_External->Destructor ? __ecereClass_External->Destructor(external) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(external)) : 0), external = 0);
18338 }
18339 }
18340 else if(external->type == 4)
18341 {
18342 thisNameSpace = external->id->string;
18343 }
18344 }
18345 currentClass = (((void *)0));
18346 thisNameSpace = (((void *)0));
18347 ((temp->symbol ? (__ecereClass_Symbol->Destructor ? __ecereClass_Symbol->Destructor(temp->symbol) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(temp->symbol)) : 0), temp->symbol = 0);
18348 ((temp ? (__ecereClass_External->Destructor ? __ecereClass_External->Destructor(temp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(temp)) : 0), temp = 0);
18349 }
18350
18351 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);
18352
18353 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);
18354
18355 extern struct __ecereNameSpace__ecere__com__Instance * __thisModule;
18356
18357 void __ecereRegisterModule_pass15(struct __ecereNameSpace__ecere__com__Instance * module)
18358 {
18359 struct __ecereNameSpace__ecere__com__Class * class;
18360
18361 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetYydebug", "void SetYydebug(bool b)", SetYydebug, module, 1);
18362 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetThisClass", "void SetThisClass(ecere::com::Class c)", SetThisClass, module, 1);
18363 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetThisClass", "ecere::com::Class GetThisClass(void)", GetThisClass, module, 1);
18364 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintExpression", "void PrintExpression(Expression exp, char * string)", PrintExpression, module, 1);
18365 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessTemplateParameterType", "Type ProcessTemplateParameterType(TemplateParameter param)", ProcessTemplateParameterType, module, 2);
18366 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("NeedCast", "bool NeedCast(Type type1, Type type2)", NeedCast, module, 2);
18367 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintInt", "char * PrintInt(int64 result)", PrintInt, module, 1);
18368 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUInt", "char * PrintUInt(uint64 result)", PrintUInt, module, 1);
18369 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintInt64", "char * PrintInt64(int64 result)", PrintInt64, module, 1);
18370 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUInt64", "char * PrintUInt64(uint64 result)", PrintUInt64, module, 1);
18371 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintHexUInt", "char * PrintHexUInt(uint64 result)", PrintHexUInt, module, 1);
18372 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintHexUInt64", "char * PrintHexUInt64(uint64 result)", PrintHexUInt64, module, 1);
18373 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintShort", "char * PrintShort(short result)", PrintShort, module, 1);
18374 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUShort", "char * PrintUShort(uint16 result)", PrintUShort, module, 1);
18375 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintChar", "char * PrintChar(char result)", PrintChar, module, 1);
18376 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUChar", "char * PrintUChar(byte result)", PrintUChar, module, 1);
18377 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintFloat", "char * PrintFloat(float result)", PrintFloat, module, 1);
18378 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintDouble", "char * PrintDouble(double result)", PrintDouble, module, 1);
18379 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpInt", "bool GetOpInt(Operand op2, int * value2)", GetOpInt, module, 1);
18380 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetInt", "bool GetInt(Expression exp, int * value2)", GetInt, module, 1);
18381 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUInt", "bool GetOpUInt(Operand op2, uint * value2)", GetOpUInt, module, 1);
18382 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUInt", "bool GetUInt(Expression exp, uint * value2)", GetUInt, module, 1);
18383 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpInt64", "bool GetOpInt64(Operand op2, int64 * value2)", GetOpInt64, module, 1);
18384 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetInt64", "bool GetInt64(Expression exp, int64 * value2)", GetInt64, module, 1);
18385 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUInt64", "bool GetOpUInt64(Operand op2, uint64 * value2)", GetOpUInt64, module, 1);
18386 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUInt64", "bool GetUInt64(Expression exp, uint64 * value2)", GetUInt64, module, 1);
18387 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpIntPtr", "bool GetOpIntPtr(Operand op2, intptr * value2)", GetOpIntPtr, module, 1);
18388 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetIntPtr", "bool GetIntPtr(Expression exp, intptr * value2)", GetIntPtr, module, 1);
18389 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUIntPtr", "bool GetOpUIntPtr(Operand op2, uintptr * value2)", GetOpUIntPtr, module, 1);
18390 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUIntPtr", "bool GetUIntPtr(Expression exp, uintptr * value2)", GetUIntPtr, module, 1);
18391 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpIntSize", "bool GetOpIntSize(Operand op2, intsize * value2)", GetOpIntSize, module, 1);
18392 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetIntSize", "bool GetIntSize(Expression exp, intsize * value2)", GetIntSize, module, 1);
18393 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUIntSize", "bool GetOpUIntSize(Operand op2, uintsize * value2)", GetOpUIntSize, module, 1);
18394 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUIntSize", "bool GetUIntSize(Expression exp, uintsize * value2)", GetUIntSize, module, 1);
18395 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpShort", "bool GetOpShort(Operand op2, short * value2)", GetOpShort, module, 1);
18396 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetShort", "bool GetShort(Expression exp, short * value2)", GetShort, module, 1);
18397 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUShort", "bool GetOpUShort(Operand op2, uint16 * value2)", GetOpUShort, module, 1);
18398 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUShort", "bool GetUShort(Expression exp, uint16 * value2)", GetUShort, module, 1);
18399 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpChar", "bool GetOpChar(Operand op2, char * value2)", GetOpChar, module, 1);
18400 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetChar", "bool GetChar(Expression exp, char * value2)", GetChar, module, 1);
18401 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUChar", "bool GetOpUChar(Operand op2, byte * value2)", GetOpUChar, module, 1);
18402 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUChar", "bool GetUChar(Expression exp, byte * value2)", GetUChar, module, 1);
18403 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpFloat", "bool GetOpFloat(Operand op2, float * value2)", GetOpFloat, module, 1);
18404 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetFloat", "bool GetFloat(Expression exp, float * value2)", GetFloat, module, 1);
18405 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpDouble", "bool GetOpDouble(Operand op2, double * value2)", GetOpDouble, module, 1);
18406 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetDouble", "bool GetDouble(Expression exp, double * value2)", GetDouble, module, 1);
18407 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeClassMembers", "void ComputeClassMembers(ecere::com::Class _class, bool isMember)", ComputeClassMembers, module, 2);
18408 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeModuleClasses", "void ComputeModuleClasses(ecere::com::Module module)", ComputeModuleClasses, module, 1);
18409 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeTypeSize", "int ComputeTypeSize(Type type)", ComputeTypeSize, module, 1);
18410 __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);
18411 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareStruct", "void DeclareStruct(char * name, bool skipNoHead)", DeclareStruct, module, 2);
18412 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareProperty", "void DeclareProperty(ecere::com::Property prop, char * setName, char * getName)", DeclareProperty, module, 2);
18413 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("Dereference", "Type Dereference(Type source)", Dereference, module, 1);
18414 __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);
18415 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessInstantiationType", "void ProcessInstantiationType(Instantiation inst)", ProcessInstantiationType, module, 2);
18416 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindTemplateArg", "ecere::com::ClassTemplateArgument * FindTemplateArg(ecere::com::Class _class, TemplateParameter param)", FindTemplateArg, module, 2);
18417 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetupTemplatesContext", "Context SetupTemplatesContext(ecere::com::Class _class)", SetupTemplatesContext, module, 1);
18418 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FinishTemplatesContext", "void FinishTemplatesContext(Context context)", FinishTemplatesContext, module, 1);
18419 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessMethodType", "void ProcessMethodType(ecere::com::Method method)", ProcessMethodType, module, 1);
18420 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessPropertyType", "void ProcessPropertyType(ecere::com::Property prop)", ProcessPropertyType, module, 1);
18421 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareMethod", "void DeclareMethod(ecere::com::Method method, char * name)", DeclareMethod, module, 1);
18422 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClass", "char * ReplaceThisClass(ecere::com::Class _class)", ReplaceThisClass, module, 2);
18423 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClassType", "Type ReplaceThisClassType(ecere::com::Class _class)", ReplaceThisClassType, module, 2);
18424 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClassSpecifiers", "void ReplaceThisClassSpecifiers(ecere::sys::OldList specs, ecere::com::Class _class)", ReplaceThisClassSpecifiers, module, 2);
18425 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareFunction", "bool DeclareFunction(ecere::com::GlobalFunction function, char * name)", DeclareFunction, module, 2);
18426 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareGlobalData", "void DeclareGlobalData(GlobalData data)", DeclareGlobalData, module, 2);
18427 class = __ecereNameSpace__ecere__com__eSystem_RegisterClass(5, "Conversion", 0, sizeof(struct Conversion), 0, 0, 0, module, 2, 1);
18428 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->application == ((struct __ecereNameSpace__ecere__com__Module *)(((char *)__thisModule + structSize_Instance)))->application && class)
18429 __ecereClass_Conversion = class;
18430 __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);
18431 __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);
18432 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ModuleVisibility", "bool ModuleVisibility(ecere::com::Module searchIn, ecere::com::Module searchFor)", ModuleVisibility, module, 1);
18433 __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);
18434 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("MatchTypeExpression", "bool MatchTypeExpression(Expression sourceExp, Type dest, ecere::sys::OldList conversions, bool skipUnitBla)", MatchTypeExpression, module, 2);
18435 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReadString", "void ReadString(char * output, char * string)", ReadString, module, 1);
18436 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("UnescapeString", "int UnescapeString(char * d, char * s, int len)", UnescapeString, module, 1);
18437 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("OffsetEscapedString", "char * OffsetEscapedString(char * s, int len, int offset)", OffsetEscapedString, module, 1);
18438 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOperand", "Operand GetOperand(Expression exp)", GetOperand, module, 1);
18439 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PopulateInstance", "void PopulateInstance(Instantiation inst)", PopulateInstance, module, 1);
18440 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeInstantiation", "void ComputeInstantiation(Expression exp)", ComputeInstantiation, module, 1);
18441 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CallOperator", "void CallOperator(Expression exp, Expression exp1, Expression exp2, Operand op1, Operand op2)", CallOperator, module, 1);
18442 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeExpression", "void ComputeExpression(Expression exp)", ComputeExpression, module, 1);
18443 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CheckTemplateTypes", "void CheckTemplateTypes(Expression exp)", CheckTemplateTypes, module, 1);
18444 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindSymbol", "Symbol FindSymbol(char * name, Context startContext, Context endContext, bool isStruct, bool globalNameSpace)", FindSymbol, module, 1);
18445 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintType", "void PrintType(Type type, char * string, bool printName, bool fullName)", PrintType, module, 1);
18446 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintTypeNoConst", "void PrintTypeNoConst(Type type, char * string, bool printName, bool fullName)", PrintTypeNoConst, module, 1);
18447 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindMemberAndOffset", "Type FindMemberAndOffset(Type type, char * string, uint * offset)", FindMemberAndOffset, module, 1);
18448 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetParseError", "bool GetParseError(void)", GetParseError, module, 1);
18449 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ParseExpressionString", "Expression ParseExpressionString(char * expression)", ParseExpressionString, module, 1);
18450 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceExpContents", "void ReplaceExpContents(Expression checkedExp, Expression newExp)", ReplaceExpContents, module, 1);
18451 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ApplyAnyObjectLogic", "void ApplyAnyObjectLogic(Expression e)", ApplyAnyObjectLogic, module, 1);
18452 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessExpressionType", "void ProcessExpressionType(Expression exp)", ProcessExpressionType, module, 1);
18453 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareFunctionUtil", "void DeclareFunctionUtil(String s)", DeclareFunctionUtil, module, 1);
18454 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeDataTypes", "void ComputeDataTypes(void)", ComputeDataTypes, module, 1);
18455 }
18456
18457 void __ecereUnregisterModule_pass15(struct __ecereNameSpace__ecere__com__Instance * module)
18458 {
18459
18460 }
18461