7ca7afae5045629d34c2bce222290412985f948d
[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 extern char *  strcpy(char * , const char * );
1585
1586 extern unsigned int (* __ecereProp_float_Get_isInf)(float this);
1587
1588 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp_float_isInf;
1589
1590 extern int (* __ecereProp_float_Get_signBit)(float this);
1591
1592 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp_float_signBit;
1593
1594 extern unsigned int (* __ecereProp_float_Get_isNan)(float this);
1595
1596 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp_float_isNan;
1597
1598 char * PrintFloat(float result)
1599 {
1600 char temp[350];
1601
1602 if(__ecereProp_float_Get_isInf(result))
1603 {
1604 if(__ecereProp_float_Get_signBit(result))
1605 strcpy(temp, "-inf");
1606 else
1607 strcpy(temp, "inf");
1608 }
1609 else if(__ecereProp_float_Get_isNan(result))
1610 {
1611 if(__ecereProp_float_Get_signBit(result))
1612 strcpy(temp, "-nan");
1613 else
1614 strcpy(temp, "nan");
1615 }
1616 else
1617 sprintf(temp, "%.16ff", result);
1618 return __ecereNameSpace__ecere__sys__CopyString(temp);
1619 }
1620
1621 extern unsigned int (* __ecereProp_double_Get_isInf)(double this);
1622
1623 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp_double_isInf;
1624
1625 extern int (* __ecereProp_double_Get_signBit)(double this);
1626
1627 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp_double_signBit;
1628
1629 extern unsigned int (* __ecereProp_double_Get_isNan)(double this);
1630
1631 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp_double_isNan;
1632
1633 char * PrintDouble(double result)
1634 {
1635 char temp[350];
1636
1637 if(__ecereProp_double_Get_isInf(result))
1638 {
1639 if(__ecereProp_double_Get_signBit(result))
1640 strcpy(temp, "-inf");
1641 else
1642 strcpy(temp, "inf");
1643 }
1644 else if(__ecereProp_double_Get_isNan(result))
1645 {
1646 if(__ecereProp_double_Get_signBit(result))
1647 strcpy(temp, "-nan");
1648 else
1649 strcpy(temp, "nan");
1650 }
1651 else
1652 sprintf(temp, "%.16f", result);
1653 return __ecereNameSpace__ecere__sys__CopyString(temp);
1654 }
1655
1656 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_OpTable;
1657
1658 struct OpTable
1659 {
1660 unsigned int (*  Add)(struct Expression *, struct Operand *, struct Operand *);
1661 unsigned int (*  Sub)(struct Expression *, struct Operand *, struct Operand *);
1662 unsigned int (*  Mul)(struct Expression *, struct Operand *, struct Operand *);
1663 unsigned int (*  Div)(struct Expression *, struct Operand *, struct Operand *);
1664 unsigned int (*  Mod)(struct Expression *, struct Operand *, struct Operand *);
1665 unsigned int (*  Neg)(struct Expression *, struct Operand *);
1666 unsigned int (*  Inc)(struct Expression *, struct Operand *);
1667 unsigned int (*  Dec)(struct Expression *, struct Operand *);
1668 unsigned int (*  Asign)(struct Expression *, struct Operand *, struct Operand *);
1669 unsigned int (*  AddAsign)(struct Expression *, struct Operand *, struct Operand *);
1670 unsigned int (*  SubAsign)(struct Expression *, struct Operand *, struct Operand *);
1671 unsigned int (*  MulAsign)(struct Expression *, struct Operand *, struct Operand *);
1672 unsigned int (*  DivAsign)(struct Expression *, struct Operand *, struct Operand *);
1673 unsigned int (*  ModAsign)(struct Expression *, struct Operand *, struct Operand *);
1674 unsigned int (*  BitAnd)(struct Expression *, struct Operand *, struct Operand *);
1675 unsigned int (*  BitOr)(struct Expression *, struct Operand *, struct Operand *);
1676 unsigned int (*  BitXor)(struct Expression *, struct Operand *, struct Operand *);
1677 unsigned int (*  LShift)(struct Expression *, struct Operand *, struct Operand *);
1678 unsigned int (*  RShift)(struct Expression *, struct Operand *, struct Operand *);
1679 unsigned int (*  BitNot)(struct Expression *, struct Operand *);
1680 unsigned int (*  AndAsign)(struct Expression *, struct Operand *, struct Operand *);
1681 unsigned int (*  OrAsign)(struct Expression *, struct Operand *, struct Operand *);
1682 unsigned int (*  XorAsign)(struct Expression *, struct Operand *, struct Operand *);
1683 unsigned int (*  LShiftAsign)(struct Expression *, struct Operand *, struct Operand *);
1684 unsigned int (*  RShiftAsign)(struct Expression *, struct Operand *, struct Operand *);
1685 unsigned int (*  Not)(struct Expression *, struct Operand *);
1686 unsigned int (*  Equ)(struct Expression *, struct Operand *, struct Operand *);
1687 unsigned int (*  Nqu)(struct Expression *, struct Operand *, struct Operand *);
1688 unsigned int (*  And)(struct Expression *, struct Operand *, struct Operand *);
1689 unsigned int (*  Or)(struct Expression *, struct Operand *, struct Operand *);
1690 unsigned int (*  Grt)(struct Expression *, struct Operand *, struct Operand *);
1691 unsigned int (*  Sma)(struct Expression *, struct Operand *, struct Operand *);
1692 unsigned int (*  GrtEqu)(struct Expression *, struct Operand *, struct Operand *);
1693 unsigned int (*  SmaEqu)(struct Expression *, struct Operand *, struct Operand *);
1694 unsigned int (*  Cond)(struct Expression *, struct Operand *, struct Operand *, struct Operand *);
1695 } __attribute__ ((gcc_struct));
1696
1697 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Operand;
1698
1699 struct Operand
1700 {
1701 int kind;
1702 struct Type * type;
1703 unsigned int ptrSize;
1704 union
1705 {
1706 char c;
1707 unsigned char uc;
1708 short s;
1709 unsigned short us;
1710 int i;
1711 unsigned int ui;
1712 float f;
1713 double d;
1714 long long i64;
1715 uint64 ui64;
1716 } __attribute__ ((gcc_struct));
1717 struct OpTable ops;
1718 } __attribute__ ((gcc_struct));
1719
1720 unsigned int GetOpInt(struct Operand * op2, int * value2)
1721 {
1722 if(op2->kind == 3 && op2->type->isSigned)
1723 *value2 = op2->i;
1724 else if(op2->kind == 3)
1725 *value2 = (int)op2->ui;
1726 else if(op2->kind == 4 && op2->type->isSigned)
1727 *value2 = (int)op2->i64;
1728 else if(op2->kind == 4)
1729 *value2 = (int)op2->ui64;
1730 else if(op2->kind == 23 && op2->type->isSigned)
1731 *value2 = (int)op2->i64;
1732 else if(op2->kind == 23)
1733 *value2 = (int)op2->ui64;
1734 else if(op2->kind == 22 && op2->type->isSigned)
1735 *value2 = (int)op2->i64;
1736 else if(op2->kind == 22)
1737 *value2 = (int)op2->ui64;
1738 else if(op2->kind == 2 && op2->type->isSigned)
1739 *value2 = (int)op2->s;
1740 else if(op2->kind == 2)
1741 *value2 = (int)op2->us;
1742 else if(op2->kind == 1 && op2->type->isSigned)
1743 *value2 = (int)op2->c;
1744 else if(op2->kind == 24 || op2->kind == 1)
1745 *value2 = (int)op2->uc;
1746 else if(op2->kind == 6)
1747 *value2 = (int)op2->f;
1748 else if(op2->kind == 7)
1749 *value2 = (int)op2->d;
1750 else if(op2->kind == 13)
1751 *value2 = (int)op2->ui64;
1752 else
1753 return 0x0;
1754 return 0x1;
1755 }
1756
1757 struct Operand GetOperand(struct Expression * exp);
1758
1759 unsigned int GetInt(struct Expression * exp, int * value2)
1760 {
1761 struct Operand op2 = GetOperand(exp);
1762
1763 return GetOpInt(&op2, value2);
1764 }
1765
1766 unsigned int GetOpUInt(struct Operand * op2, unsigned int * value2)
1767 {
1768 if(op2->kind == 3 && op2->type->isSigned)
1769 *value2 = (unsigned int)op2->i;
1770 else if(op2->kind == 3)
1771 *value2 = op2->ui;
1772 else if(op2->kind == 4 && op2->type->isSigned)
1773 *value2 = (unsigned int)op2->i64;
1774 else if(op2->kind == 4)
1775 *value2 = (unsigned int)op2->ui64;
1776 else if(op2->kind == 23 && op2->type->isSigned)
1777 *value2 = (unsigned int)op2->i64;
1778 else if(op2->kind == 23)
1779 *value2 = (unsigned int)op2->ui64;
1780 else if(op2->kind == 22 && op2->type->isSigned)
1781 *value2 = (unsigned int)op2->i64;
1782 else if(op2->kind == 22)
1783 *value2 = (unsigned int)op2->ui64;
1784 else if(op2->kind == 2 && op2->type->isSigned)
1785 *value2 = (unsigned int)op2->s;
1786 else if(op2->kind == 2)
1787 *value2 = (unsigned int)op2->us;
1788 else if(op2->kind == 1 && op2->type->isSigned)
1789 *value2 = (unsigned int)op2->c;
1790 else if(op2->kind == 24 || op2->kind == 1)
1791 *value2 = (unsigned int)op2->uc;
1792 else if(op2->kind == 6)
1793 *value2 = (unsigned int)op2->f;
1794 else if(op2->kind == 7)
1795 *value2 = (unsigned int)op2->d;
1796 else if(op2->kind == 13)
1797 *value2 = (unsigned int)op2->ui64;
1798 else
1799 return 0x0;
1800 return 0x1;
1801 }
1802
1803 unsigned int GetUInt(struct Expression * exp, unsigned int * value2)
1804 {
1805 struct Operand op2 = GetOperand(exp);
1806
1807 return GetOpUInt(&op2, value2);
1808 }
1809
1810 unsigned int GetOpInt64(struct Operand * op2, long long * value2)
1811 {
1812 if(op2->kind == 3 && op2->type->isSigned)
1813 *value2 = (long long)op2->i;
1814 else if(op2->kind == 3)
1815 *value2 = (long long)op2->ui;
1816 else if(op2->kind == 4 && op2->type->isSigned)
1817 *value2 = op2->i64;
1818 else if(op2->kind == 4)
1819 *value2 = (long long)op2->ui64;
1820 else if(op2->kind == 23 && op2->type->isSigned)
1821 *value2 = op2->i64;
1822 else if(op2->kind == 23)
1823 *value2 = (long long)op2->ui64;
1824 else if(op2->kind == 22 && op2->type->isSigned)
1825 *value2 = op2->i64;
1826 else if(op2->kind == 22)
1827 *value2 = (long long)op2->ui64;
1828 else if(op2->kind == 2 && op2->type->isSigned)
1829 *value2 = (long long)op2->s;
1830 else if(op2->kind == 2)
1831 *value2 = (long long)op2->us;
1832 else if(op2->kind == 1 && op2->type->isSigned)
1833 *value2 = (long long)op2->c;
1834 else if(op2->kind == 24 || op2->kind == 1)
1835 *value2 = (long long)op2->uc;
1836 else if(op2->kind == 6)
1837 *value2 = (long long)op2->f;
1838 else if(op2->kind == 7)
1839 *value2 = (long long)op2->d;
1840 else if(op2->kind == 13)
1841 *value2 = (long long)op2->ui64;
1842 else
1843 return 0x0;
1844 return 0x1;
1845 }
1846
1847 unsigned int GetInt64(struct Expression * exp, long long * value2)
1848 {
1849 struct Operand op2 = GetOperand(exp);
1850
1851 return GetOpInt64(&op2, value2);
1852 }
1853
1854 unsigned int GetOpUInt64(struct Operand * op2, uint64 * value2)
1855 {
1856 if(op2->kind == 3 && op2->type->isSigned)
1857 *value2 = (uint64)op2->i;
1858 else if(op2->kind == 3)
1859 *value2 = (uint64)op2->ui;
1860 else if(op2->kind == 4 && op2->type->isSigned)
1861 *value2 = (uint64)op2->i64;
1862 else if(op2->kind == 4)
1863 *value2 = op2->ui64;
1864 else if(op2->kind == 23 && op2->type->isSigned)
1865 *value2 = (uint64)op2->i64;
1866 else if(op2->kind == 23)
1867 *value2 = op2->ui64;
1868 else if(op2->kind == 22 && op2->type->isSigned)
1869 *value2 = (uint64)op2->i64;
1870 else if(op2->kind == 22)
1871 *value2 = op2->ui64;
1872 else if(op2->kind == 2 && op2->type->isSigned)
1873 *value2 = (uint64)op2->s;
1874 else if(op2->kind == 2)
1875 *value2 = (uint64)op2->us;
1876 else if(op2->kind == 1 && op2->type->isSigned)
1877 *value2 = (uint64)op2->c;
1878 else if(op2->kind == 24 || op2->kind == 1)
1879 *value2 = (uint64)op2->uc;
1880 else if(op2->kind == 6)
1881 *value2 = (uint64)op2->f;
1882 else if(op2->kind == 7)
1883 *value2 = (uint64)op2->d;
1884 else if(op2->kind == 13)
1885 *value2 = op2->ui64;
1886 else
1887 return 0x0;
1888 return 0x1;
1889 }
1890
1891 unsigned int GetUInt64(struct Expression * exp, uint64 * value2)
1892 {
1893 struct Operand op2 = GetOperand(exp);
1894
1895 return GetOpUInt64(&op2, value2);
1896 }
1897
1898 unsigned int GetOpIntPtr(struct Operand * op2, intptr_t * value2)
1899 {
1900 if(op2->kind == 3 && op2->type->isSigned)
1901 *value2 = (intptr_t)op2->i;
1902 else if(op2->kind == 3)
1903 *value2 = (intptr_t)op2->ui;
1904 else if(op2->kind == 4 && op2->type->isSigned)
1905 *value2 = (intptr_t)op2->i64;
1906 else if(op2->kind == 4)
1907 *value2 = (intptr_t)op2->ui64;
1908 else if(op2->kind == 23 && op2->type->isSigned)
1909 *value2 = (intptr_t)op2->i64;
1910 else if(op2->kind == 23)
1911 *value2 = (intptr_t)op2->ui64;
1912 else if(op2->kind == 22 && op2->type->isSigned)
1913 *value2 = (intptr_t)op2->i64;
1914 else if(op2->kind == 22)
1915 *value2 = (intptr_t)op2->ui64;
1916 else if(op2->kind == 2 && op2->type->isSigned)
1917 *value2 = (intptr_t)op2->s;
1918 else if(op2->kind == 2)
1919 *value2 = (intptr_t)op2->us;
1920 else if(op2->kind == 1 && op2->type->isSigned)
1921 *value2 = (intptr_t)op2->c;
1922 else if(op2->kind == 24 || op2->kind == 1)
1923 *value2 = (intptr_t)op2->uc;
1924 else if(op2->kind == 6)
1925 *value2 = (intptr_t)op2->f;
1926 else if(op2->kind == 7)
1927 *value2 = (intptr_t)op2->d;
1928 else if(op2->kind == 13)
1929 *value2 = (intptr_t)op2->ui64;
1930 else
1931 return 0x0;
1932 return 0x1;
1933 }
1934
1935 unsigned int GetIntPtr(struct Expression * exp, intptr_t * value2)
1936 {
1937 struct Operand op2 = GetOperand(exp);
1938
1939 return GetOpIntPtr(&op2, value2);
1940 }
1941
1942 unsigned int GetOpUIntPtr(struct Operand * op2, uintptr_t * value2)
1943 {
1944 if(op2->kind == 3 && op2->type->isSigned)
1945 *value2 = (uintptr_t)op2->i;
1946 else if(op2->kind == 3)
1947 *value2 = (uintptr_t)op2->ui;
1948 else if(op2->kind == 4 && op2->type->isSigned)
1949 *value2 = (uintptr_t)op2->i64;
1950 else if(op2->kind == 4)
1951 *value2 = (uintptr_t)op2->ui64;
1952 else if(op2->kind == 23 && op2->type->isSigned)
1953 *value2 = (uintptr_t)op2->i64;
1954 else if(op2->kind == 23)
1955 *value2 = (uintptr_t)op2->ui64;
1956 else if(op2->kind == 22 && op2->type->isSigned)
1957 *value2 = (uintptr_t)op2->i64;
1958 else if(op2->kind == 22)
1959 *value2 = (uintptr_t)op2->ui64;
1960 else if(op2->kind == 2 && op2->type->isSigned)
1961 *value2 = (uintptr_t)op2->s;
1962 else if(op2->kind == 2)
1963 *value2 = (uintptr_t)op2->us;
1964 else if(op2->kind == 1 && op2->type->isSigned)
1965 *value2 = (uintptr_t)op2->c;
1966 else if(op2->kind == 24 || op2->kind == 1)
1967 *value2 = (uintptr_t)op2->uc;
1968 else if(op2->kind == 6)
1969 *value2 = (uintptr_t)op2->f;
1970 else if(op2->kind == 7)
1971 *value2 = (uintptr_t)op2->d;
1972 else if(op2->kind == 13)
1973 *value2 = (uintptr_t)op2->ui64;
1974 else
1975 return 0x0;
1976 return 0x1;
1977 }
1978
1979 unsigned int GetUIntPtr(struct Expression * exp, uintptr_t * value2)
1980 {
1981 struct Operand op2 = GetOperand(exp);
1982
1983 return GetOpUIntPtr(&op2, value2);
1984 }
1985
1986 unsigned int GetOpIntSize(struct Operand * op2, ssize_t * value2)
1987 {
1988 if(op2->kind == 3 && op2->type->isSigned)
1989 *value2 = (ssize_t)op2->i;
1990 else if(op2->kind == 3)
1991 *value2 = (ssize_t)op2->ui;
1992 else if(op2->kind == 4 && op2->type->isSigned)
1993 *value2 = (ssize_t)op2->i64;
1994 else if(op2->kind == 4)
1995 *value2 = (ssize_t)op2->ui64;
1996 else if(op2->kind == 23 && op2->type->isSigned)
1997 *value2 = (ssize_t)op2->i64;
1998 else if(op2->kind == 23)
1999 *value2 = (ssize_t)op2->ui64;
2000 else if(op2->kind == 22 && op2->type->isSigned)
2001 *value2 = (ssize_t)op2->i64;
2002 else if(op2->kind == 22)
2003 *value2 = (ssize_t)op2->ui64;
2004 else if(op2->kind == 2 && op2->type->isSigned)
2005 *value2 = (ssize_t)op2->s;
2006 else if(op2->kind == 2)
2007 *value2 = (ssize_t)op2->us;
2008 else if(op2->kind == 1 && op2->type->isSigned)
2009 *value2 = (ssize_t)op2->c;
2010 else if(op2->kind == 24 || op2->kind == 1)
2011 *value2 = (ssize_t)op2->uc;
2012 else if(op2->kind == 6)
2013 *value2 = (ssize_t)op2->f;
2014 else if(op2->kind == 7)
2015 *value2 = (ssize_t)op2->d;
2016 else if(op2->kind == 13)
2017 *value2 = (ssize_t)op2->ui64;
2018 else
2019 return 0x0;
2020 return 0x1;
2021 }
2022
2023 unsigned int GetIntSize(struct Expression * exp, ssize_t * value2)
2024 {
2025 struct Operand op2 = GetOperand(exp);
2026
2027 return GetOpIntSize(&op2, value2);
2028 }
2029
2030 unsigned int GetOpUIntSize(struct Operand * op2, size_t * value2)
2031 {
2032 if(op2->kind == 3 && op2->type->isSigned)
2033 *value2 = (size_t)op2->i;
2034 else if(op2->kind == 3)
2035 *value2 = (size_t)op2->ui;
2036 else if(op2->kind == 4 && op2->type->isSigned)
2037 *value2 = (size_t)op2->i64;
2038 else if(op2->kind == 4)
2039 *value2 = (size_t)op2->ui64;
2040 else if(op2->kind == 23 && op2->type->isSigned)
2041 *value2 = (size_t)op2->i64;
2042 else if(op2->kind == 23)
2043 *value2 = (size_t)op2->ui64;
2044 else if(op2->kind == 22 && op2->type->isSigned)
2045 *value2 = (size_t)op2->i64;
2046 else if(op2->kind == 22)
2047 *value2 = (size_t)op2->ui64;
2048 else if(op2->kind == 2 && op2->type->isSigned)
2049 *value2 = (size_t)op2->s;
2050 else if(op2->kind == 2)
2051 *value2 = (size_t)op2->us;
2052 else if(op2->kind == 1 && op2->type->isSigned)
2053 *value2 = (size_t)op2->c;
2054 else if(op2->kind == 24 || op2->kind == 1)
2055 *value2 = (size_t)op2->uc;
2056 else if(op2->kind == 6)
2057 *value2 = (size_t)op2->f;
2058 else if(op2->kind == 7)
2059 *value2 = (size_t)op2->d;
2060 else if(op2->kind == 13)
2061 *value2 = (size_t)op2->ui64;
2062 else
2063 return 0x0;
2064 return 0x1;
2065 }
2066
2067 unsigned int GetUIntSize(struct Expression * exp, size_t * value2)
2068 {
2069 struct Operand op2 = GetOperand(exp);
2070
2071 return GetOpUIntSize(&op2, value2);
2072 }
2073
2074 unsigned int GetOpShort(struct Operand * op2, short * value2)
2075 {
2076 if(op2->kind == 3 && op2->type->isSigned)
2077 *value2 = (short)op2->i;
2078 else if(op2->kind == 3)
2079 *value2 = (short)op2->ui;
2080 else if(op2->kind == 4 && op2->type->isSigned)
2081 *value2 = (short)op2->i64;
2082 else if(op2->kind == 4)
2083 *value2 = (short)op2->ui64;
2084 else if(op2->kind == 23 && op2->type->isSigned)
2085 *value2 = (short)op2->i64;
2086 else if(op2->kind == 23)
2087 *value2 = (short)op2->ui64;
2088 else if(op2->kind == 22 && op2->type->isSigned)
2089 *value2 = (short)op2->i64;
2090 else if(op2->kind == 22)
2091 *value2 = (short)op2->ui64;
2092 else if(op2->kind == 2 && op2->type->isSigned)
2093 *value2 = op2->s;
2094 else if(op2->kind == 2)
2095 *value2 = (short)op2->us;
2096 else if(op2->kind == 1 && op2->type->isSigned)
2097 *value2 = (short)op2->c;
2098 else if(op2->kind == 24 || op2->kind == 1)
2099 *value2 = (short)op2->uc;
2100 else if(op2->kind == 6)
2101 *value2 = (short)op2->f;
2102 else if(op2->kind == 7)
2103 *value2 = (short)op2->d;
2104 else if(op2->kind == 13)
2105 *value2 = (short)op2->ui64;
2106 else
2107 return 0x0;
2108 return 0x1;
2109 }
2110
2111 unsigned int GetShort(struct Expression * exp, short * value2)
2112 {
2113 struct Operand op2 = GetOperand(exp);
2114
2115 return GetOpShort(&op2, value2);
2116 }
2117
2118 unsigned int GetOpUShort(struct Operand * op2, unsigned short * value2)
2119 {
2120 if(op2->kind == 3 && op2->type->isSigned)
2121 *value2 = (unsigned short)op2->i;
2122 else if(op2->kind == 3)
2123 *value2 = (unsigned short)op2->ui;
2124 else if(op2->kind == 4 && op2->type->isSigned)
2125 *value2 = (unsigned short)op2->i64;
2126 else if(op2->kind == 4)
2127 *value2 = (unsigned short)op2->ui64;
2128 else if(op2->kind == 23 && op2->type->isSigned)
2129 *value2 = (unsigned short)op2->i64;
2130 else if(op2->kind == 23)
2131 *value2 = (unsigned short)op2->ui64;
2132 else if(op2->kind == 22 && op2->type->isSigned)
2133 *value2 = (unsigned short)op2->i64;
2134 else if(op2->kind == 22)
2135 *value2 = (unsigned short)op2->ui64;
2136 else if(op2->kind == 2 && op2->type->isSigned)
2137 *value2 = (unsigned short)op2->s;
2138 else if(op2->kind == 2)
2139 *value2 = op2->us;
2140 else if(op2->kind == 1 && op2->type->isSigned)
2141 *value2 = (unsigned short)op2->c;
2142 else if(op2->kind == 24 || op2->kind == 1)
2143 *value2 = (unsigned short)op2->uc;
2144 else if(op2->kind == 6)
2145 *value2 = (unsigned short)op2->f;
2146 else if(op2->kind == 7)
2147 *value2 = (unsigned short)op2->d;
2148 else if(op2->kind == 13)
2149 *value2 = (unsigned short)op2->ui64;
2150 else
2151 return 0x0;
2152 return 0x1;
2153 }
2154
2155 unsigned int GetUShort(struct Expression * exp, unsigned short * value2)
2156 {
2157 struct Operand op2 = GetOperand(exp);
2158
2159 return GetOpUShort(&op2, value2);
2160 }
2161
2162 unsigned int GetOpChar(struct Operand * op2, char * value2)
2163 {
2164 if(op2->kind == 3 && op2->type->isSigned)
2165 *value2 = (char)op2->i;
2166 else if(op2->kind == 3)
2167 *value2 = (char)op2->ui;
2168 else if(op2->kind == 4 && op2->type->isSigned)
2169 *value2 = (char)op2->i64;
2170 else if(op2->kind == 4)
2171 *value2 = (char)op2->ui64;
2172 else if(op2->kind == 23 && op2->type->isSigned)
2173 *value2 = (char)op2->i64;
2174 else if(op2->kind == 23)
2175 *value2 = (char)op2->ui64;
2176 else if(op2->kind == 22 && op2->type->isSigned)
2177 *value2 = (char)op2->i64;
2178 else if(op2->kind == 22)
2179 *value2 = (char)op2->ui64;
2180 else if(op2->kind == 2 && op2->type->isSigned)
2181 *value2 = (char)op2->s;
2182 else if(op2->kind == 2)
2183 *value2 = (char)op2->us;
2184 else if(op2->kind == 1 && op2->type->isSigned)
2185 *value2 = op2->c;
2186 else if(op2->kind == 24 || op2->kind == 1)
2187 *value2 = (char)op2->uc;
2188 else if(op2->kind == 6)
2189 *value2 = (char)op2->f;
2190 else if(op2->kind == 7)
2191 *value2 = (char)op2->d;
2192 else if(op2->kind == 13)
2193 *value2 = (char)op2->ui64;
2194 else
2195 return 0x0;
2196 return 0x1;
2197 }
2198
2199 unsigned int GetChar(struct Expression * exp, char * value2)
2200 {
2201 struct Operand op2 = GetOperand(exp);
2202
2203 return GetOpChar(&op2, value2);
2204 }
2205
2206 unsigned int GetOpUChar(struct Operand * op2, unsigned char * value2)
2207 {
2208 if(op2->kind == 3 && op2->type->isSigned)
2209 *value2 = (unsigned char)op2->i;
2210 else if(op2->kind == 3)
2211 *value2 = (unsigned char)op2->ui;
2212 else if(op2->kind == 4 && op2->type->isSigned)
2213 *value2 = (unsigned char)op2->i64;
2214 else if(op2->kind == 4)
2215 *value2 = (unsigned char)op2->ui64;
2216 else if(op2->kind == 23 && op2->type->isSigned)
2217 *value2 = (unsigned char)op2->i64;
2218 else if(op2->kind == 23)
2219 *value2 = (unsigned char)op2->ui64;
2220 else if(op2->kind == 22 && op2->type->isSigned)
2221 *value2 = (unsigned char)op2->i64;
2222 else if(op2->kind == 22)
2223 *value2 = (unsigned char)op2->ui64;
2224 else if(op2->kind == 2 && op2->type->isSigned)
2225 *value2 = (unsigned char)op2->s;
2226 else if(op2->kind == 2)
2227 *value2 = (unsigned char)op2->us;
2228 else if(op2->kind == 1 && op2->type->isSigned)
2229 *value2 = (unsigned char)op2->c;
2230 else if(op2->kind == 24 || op2->kind == 1)
2231 *value2 = op2->uc;
2232 else if(op2->kind == 6)
2233 *value2 = (unsigned char)op2->f;
2234 else if(op2->kind == 7)
2235 *value2 = (unsigned char)op2->d;
2236 else if(op2->kind == 13)
2237 *value2 = (unsigned char)op2->ui64;
2238 else
2239 return 0x0;
2240 return 0x1;
2241 }
2242
2243 unsigned int GetUChar(struct Expression * exp, unsigned char * value2)
2244 {
2245 struct Operand op2 = GetOperand(exp);
2246
2247 return GetOpUChar(&op2, value2);
2248 }
2249
2250 unsigned int GetOpFloat(struct Operand * op2, float * value2)
2251 {
2252 if(op2->kind == 3 && op2->type->isSigned)
2253 *value2 = (float)(float)op2->i;
2254 else if(op2->kind == 3)
2255 *value2 = (float)(float)op2->ui;
2256 else if(op2->kind == 4 && op2->type->isSigned)
2257 *value2 = (float)(float)op2->i64;
2258 else if(op2->kind == 4)
2259 *value2 = (float)(float)op2->ui64;
2260 else if(op2->kind == 23 && op2->type->isSigned)
2261 *value2 = (float)(float)op2->i64;
2262 else if(op2->kind == 23)
2263 *value2 = (float)(float)op2->ui64;
2264 else if(op2->kind == 22 && op2->type->isSigned)
2265 *value2 = (float)(float)op2->i64;
2266 else if(op2->kind == 22)
2267 *value2 = (float)(float)op2->ui64;
2268 else if(op2->kind == 2 && op2->type->isSigned)
2269 *value2 = (float)(float)op2->s;
2270 else if(op2->kind == 2)
2271 *value2 = (float)(float)op2->us;
2272 else if(op2->kind == 1 && op2->type->isSigned)
2273 *value2 = (float)(float)op2->c;
2274 else if(op2->kind == 24 || op2->kind == 1)
2275 *value2 = (float)(float)op2->uc;
2276 else if(op2->kind == 6)
2277 *value2 = (float)op2->f;
2278 else if(op2->kind == 7)
2279 *value2 = (float)op2->d;
2280 else if(op2->kind == 13)
2281 *value2 = (float)(float)op2->ui64;
2282 else
2283 return 0x0;
2284 return 0x1;
2285 }
2286
2287 unsigned int GetFloat(struct Expression * exp, float * value2)
2288 {
2289 struct Operand op2 = GetOperand(exp);
2290
2291 return GetOpFloat(&op2, value2);
2292 }
2293
2294 unsigned int GetOpDouble(struct Operand * op2, double * value2)
2295 {
2296 if(op2->kind == 3 && op2->type->isSigned)
2297 *value2 = (double)(double)op2->i;
2298 else if(op2->kind == 3)
2299 *value2 = (double)(double)op2->ui;
2300 else if(op2->kind == 4 && op2->type->isSigned)
2301 *value2 = (double)(double)op2->i64;
2302 else if(op2->kind == 4)
2303 *value2 = (double)(double)op2->ui64;
2304 else if(op2->kind == 23 && op2->type->isSigned)
2305 *value2 = (double)(double)op2->i64;
2306 else if(op2->kind == 23)
2307 *value2 = (double)(double)op2->ui64;
2308 else if(op2->kind == 22 && op2->type->isSigned)
2309 *value2 = (double)(double)op2->i64;
2310 else if(op2->kind == 22)
2311 *value2 = (double)(double)op2->ui64;
2312 else if(op2->kind == 2 && op2->type->isSigned)
2313 *value2 = (double)(double)op2->s;
2314 else if(op2->kind == 2)
2315 *value2 = (double)(double)op2->us;
2316 else if(op2->kind == 1 && op2->type->isSigned)
2317 *value2 = (double)(double)op2->c;
2318 else if(op2->kind == 24 || op2->kind == 1)
2319 *value2 = (double)(double)op2->uc;
2320 else if(op2->kind == 6)
2321 *value2 = (double)op2->f;
2322 else if(op2->kind == 7)
2323 *value2 = (double)op2->d;
2324 else if(op2->kind == 13)
2325 *value2 = (double)(double)op2->ui64;
2326 else
2327 return 0x0;
2328 return 0x1;
2329 }
2330
2331 unsigned int GetDouble(struct Expression * exp, double * value2)
2332 {
2333 struct Operand op2 = GetOperand(exp);
2334
2335 return GetOpDouble(&op2, value2);
2336 }
2337
2338 void ComputeExpression(struct Expression * exp);
2339
2340 struct Context * SetupTemplatesContext(struct __ecereNameSpace__ecere__com__Class * _class);
2341
2342 extern int targetBits;
2343
2344 int ComputeTypeSize(struct Type * type);
2345
2346 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__BitMember;
2347
2348 struct __ecereNameSpace__ecere__com__BitMember
2349 {
2350 struct __ecereNameSpace__ecere__com__BitMember * prev;
2351 struct __ecereNameSpace__ecere__com__BitMember * next;
2352 char *  name;
2353 unsigned int isProperty;
2354 int memberAccess;
2355 int id;
2356 struct __ecereNameSpace__ecere__com__Class * _class;
2357 char *  dataTypeString;
2358 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
2359 struct Type * dataType;
2360 int type;
2361 int size;
2362 int pos;
2363 uint64 mask;
2364 } __attribute__ ((gcc_struct));
2365
2366 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__OldLink;
2367
2368 struct __ecereNameSpace__ecere__sys__OldLink
2369 {
2370 struct __ecereNameSpace__ecere__sys__OldLink * prev;
2371 struct __ecereNameSpace__ecere__sys__OldLink * next;
2372 void *  data;
2373 } __attribute__ ((gcc_struct));
2374
2375 void FinishTemplatesContext(struct Context * context);
2376
2377 void ComputeClassMembers(struct __ecereNameSpace__ecere__com__Class * _class, unsigned int isMember)
2378 {
2379 struct __ecereNameSpace__ecere__com__DataMember * member = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
2380 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
2381
2382 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))
2383 {
2384 int c;
2385 int unionMemberOffset = 0;
2386 int bitFields = 0;
2387
2388 if(member)
2389 {
2390 member->memberOffset = 0;
2391 if(targetBits < sizeof(void *) * 8)
2392 member->structAlignment = 0;
2393 }
2394 else if(targetBits < sizeof(void *) * 8)
2395 _class->structAlignment = 0;
2396 if(!member && ((_class->type == 0 || _class->type == 5) || (_class->type == 1 && _class->memberOffset && _class->memberOffset > _class->base->structSize)))
2397 _class->memberOffset = (_class->base && _class->type == 1) ? _class->base->structSize : 0;
2398 if(!member && _class->destructionWatchOffset)
2399 _class->memberOffset += sizeof(struct __ecereNameSpace__ecere__sys__OldList);
2400 {
2401 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
2402
2403 for(dataMember = member ? member->members.first : _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
2404 {
2405 if(!dataMember->isProperty)
2406 {
2407 if(dataMember->type == 0 && dataMember->dataTypeString && !dataMember->dataType)
2408 {
2409 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
2410 }
2411 }
2412 }
2413 }
2414 {
2415 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
2416
2417 for(dataMember = member ? member->members.first : _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
2418 {
2419 if(!dataMember->isProperty && (dataMember->type != 0 || dataMember->dataTypeString))
2420 {
2421 if(!isMember && _class->type == 2 && dataMember->dataType)
2422 {
2423 struct __ecereNameSpace__ecere__com__BitMember * bitMember = (struct __ecereNameSpace__ecere__com__BitMember *)dataMember;
2424 uint64 mask = 0;
2425 int d;
2426
2427 ComputeTypeSize(dataMember->dataType);
2428 if(bitMember->pos == -1)
2429 bitMember->pos = _class->memberOffset;
2430 if(!bitMember->size)
2431 bitMember->size = dataMember->dataType->size * 8;
2432 _class->memberOffset = bitMember->pos + bitMember->size;
2433 for(d = 0; d < bitMember->size; d++)
2434 {
2435 if(d)
2436 mask <<= 1;
2437 mask |= 1;
2438 }
2439 bitMember->mask = mask << bitMember->pos;
2440 }
2441 else if(dataMember->type == 0 && dataMember->dataType)
2442 {
2443 int size;
2444 int alignment = 0;
2445
2446 if(dataMember->dataType->kind != 8 || ((!dataMember->dataType->_class || !dataMember->dataType->_class->registered || dataMember->dataType->_class->registered != _class || _class->type != 1)))
2447 ComputeTypeSize(dataMember->dataType);
2448 if(dataMember->dataType->bitFieldCount)
2449 {
2450 bitFields += dataMember->dataType->bitFieldCount;
2451 size = 0;
2452 }
2453 else
2454 {
2455 if(bitFields)
2456 {
2457 int size = (bitFields + 7) / 8;
2458
2459 if(isMember)
2460 {
2461 int __simpleStruct0;
2462
2463 if(alignment)
2464 {
2465 int __simpleStruct0;
2466
2467 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2468 if(member->memberOffset % alignment)
2469 member->memberOffset += alignment - (member->memberOffset % alignment);
2470 }
2471 dataMember->offset = member->memberOffset;
2472 if(member->type == 1)
2473 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2474 else
2475 {
2476 member->memberOffset += size;
2477 }
2478 }
2479 else
2480 {
2481 if(alignment)
2482 {
2483 int __simpleStruct0;
2484
2485 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2486 if(_class->memberOffset % alignment)
2487 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2488 }
2489 dataMember->offset = _class->memberOffset;
2490 _class->memberOffset += size;
2491 }
2492 bitFields = 0;
2493 }
2494 size = dataMember->dataType->size;
2495 alignment = dataMember->dataType->alignment;
2496 }
2497 if(isMember)
2498 {
2499 int __simpleStruct0;
2500
2501 if(alignment)
2502 {
2503 int __simpleStruct0;
2504
2505 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2506 if(member->memberOffset % alignment)
2507 member->memberOffset += alignment - (member->memberOffset % alignment);
2508 }
2509 dataMember->offset = member->memberOffset;
2510 if(member->type == 1)
2511 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2512 else
2513 {
2514 member->memberOffset += size;
2515 }
2516 }
2517 else
2518 {
2519 if(alignment)
2520 {
2521 int __simpleStruct0;
2522
2523 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2524 if(_class->memberOffset % alignment)
2525 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2526 }
2527 dataMember->offset = _class->memberOffset;
2528 _class->memberOffset += size;
2529 }
2530 }
2531 else
2532 {
2533 int alignment;
2534
2535 ComputeClassMembers((struct __ecereNameSpace__ecere__com__Class *)dataMember, 0x1);
2536 alignment = dataMember->structAlignment;
2537 if(isMember)
2538 {
2539 int __simpleStruct0;
2540
2541 if(alignment)
2542 {
2543 int __simpleStruct0;
2544
2545 if(member->memberOffset % alignment)
2546 member->memberOffset += alignment - (member->memberOffset % alignment);
2547 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2548 }
2549 dataMember->offset = member->memberOffset;
2550 if(member->type == 1)
2551 unionMemberOffset = (__simpleStruct0 = dataMember->memberOffset, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2552 else
2553 member->memberOffset += dataMember->memberOffset;
2554 }
2555 else
2556 {
2557 if(alignment)
2558 {
2559 int __simpleStruct0;
2560
2561 if(_class->memberOffset % alignment)
2562 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2563 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2564 }
2565 dataMember->offset = _class->memberOffset;
2566 _class->memberOffset += dataMember->memberOffset;
2567 }
2568 }
2569 }
2570 }
2571 if(bitFields)
2572 {
2573 int alignment = 0;
2574 int size = (bitFields + 7) / 8;
2575
2576 if(isMember)
2577 {
2578 int __simpleStruct0;
2579
2580 if(alignment)
2581 {
2582 int __simpleStruct0;
2583
2584 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2585 if(member->memberOffset % alignment)
2586 member->memberOffset += alignment - (member->memberOffset % alignment);
2587 }
2588 if(member->type == 1)
2589 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2590 else
2591 {
2592 member->memberOffset += size;
2593 }
2594 }
2595 else
2596 {
2597 if(alignment)
2598 {
2599 int __simpleStruct0;
2600
2601 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2602 if(_class->memberOffset % alignment)
2603 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2604 }
2605 _class->memberOffset += size;
2606 }
2607 bitFields = 0;
2608 }
2609 }
2610 if(member && member->type == 1)
2611 {
2612 member->memberOffset = unionMemberOffset;
2613 }
2614 if(!isMember)
2615 {
2616 if(_class->type != 2)
2617 {
2618 int extra = 0;
2619
2620 if(_class->structAlignment)
2621 {
2622 if(_class->memberOffset % _class->structAlignment)
2623 extra += _class->structAlignment - (_class->memberOffset % _class->structAlignment);
2624 }
2625 _class->structSize = (_class->base ? (_class->base->templateClass ? _class->base->templateClass->structSize : _class->base->structSize) : 0) + _class->memberOffset + extra;
2626 if(!member)
2627 {
2628 struct __ecereNameSpace__ecere__com__Property * prop;
2629
2630 for(prop = _class->membersAndProperties.first; prop; prop = prop->next)
2631 {
2632 if(prop->isProperty && prop->isWatchable)
2633 {
2634 prop->watcherOffset = _class->structSize;
2635 _class->structSize += sizeof(struct __ecereNameSpace__ecere__sys__OldList);
2636 }
2637 }
2638 }
2639 {
2640 struct __ecereNameSpace__ecere__sys__OldLink * derivative;
2641
2642 for(derivative = _class->derivatives.first; derivative; derivative = derivative->next)
2643 {
2644 struct __ecereNameSpace__ecere__com__Class * deriv = derivative->data;
2645
2646 if(deriv->computeSize)
2647 {
2648 deriv->offset = _class->structSize;
2649 deriv->memberOffset = 0;
2650 deriv->structSize = deriv->offset;
2651 ComputeClassMembers(deriv, 0x0);
2652 }
2653 }
2654 }
2655 }
2656 }
2657 }
2658 if(context)
2659 FinishTemplatesContext(context);
2660 }
2661
2662 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__NameSpace;
2663
2664 struct __ecereNameSpace__ecere__com__NameSpace
2665 {
2666 char *  name;
2667 struct __ecereNameSpace__ecere__com__NameSpace *  btParent;
2668 struct __ecereNameSpace__ecere__com__NameSpace *  left;
2669 struct __ecereNameSpace__ecere__com__NameSpace *  right;
2670 int depth;
2671 struct __ecereNameSpace__ecere__com__NameSpace *  parent;
2672 struct __ecereNameSpace__ecere__sys__BinaryTree nameSpaces;
2673 struct __ecereNameSpace__ecere__sys__BinaryTree classes;
2674 struct __ecereNameSpace__ecere__sys__BinaryTree defines;
2675 struct __ecereNameSpace__ecere__sys__BinaryTree functions;
2676 } __attribute__ ((gcc_struct));
2677
2678 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Module;
2679
2680 struct __ecereNameSpace__ecere__com__Module
2681 {
2682 struct __ecereNameSpace__ecere__com__Instance * application;
2683 struct __ecereNameSpace__ecere__sys__OldList classes;
2684 struct __ecereNameSpace__ecere__sys__OldList defines;
2685 struct __ecereNameSpace__ecere__sys__OldList functions;
2686 struct __ecereNameSpace__ecere__sys__OldList modules;
2687 struct __ecereNameSpace__ecere__com__Instance * prev;
2688 struct __ecereNameSpace__ecere__com__Instance * next;
2689 char *  name;
2690 void *  library;
2691 void *  Unload;
2692 int importType;
2693 int origImportType;
2694 struct __ecereNameSpace__ecere__com__NameSpace privateNameSpace;
2695 struct __ecereNameSpace__ecere__com__NameSpace publicNameSpace;
2696 } __attribute__ ((gcc_struct));
2697
2698 void ComputeModuleClasses(struct __ecereNameSpace__ecere__com__Instance * module)
2699 {
2700 struct __ecereNameSpace__ecere__com__Class * _class;
2701 struct __ecereNameSpace__ecere__sys__OldLink * subModule;
2702
2703 for(subModule = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->modules.first; subModule; subModule = subModule->next)
2704 ComputeModuleClasses(subModule->data);
2705 for(_class = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->classes.first; _class; _class = _class->next)
2706 ComputeClassMembers(_class, 0x0);
2707 }
2708
2709 extern unsigned int inCompiler;
2710
2711 extern void Compiler_Error(char *  format, ...);
2712
2713 extern char *  __ecereNameSpace__ecere__GetTranslatedString(char * name, char *  string, char *  stringAndContext);
2714
2715 int ComputeTypeSize(struct Type * type)
2716 {
2717 unsigned int size = type ? type->size : 0;
2718
2719 if(!size && type && !type->computing)
2720 {
2721 type->computing = 0x1;
2722 switch(type->kind)
2723 {
2724 case 24:
2725 type->alignment = size = sizeof(char);
2726 break;
2727 case 1:
2728 type->alignment = size = sizeof(char);
2729 break;
2730 case 3:
2731 type->alignment = size = sizeof(int);
2732 break;
2733 case 4:
2734 type->alignment = size = sizeof(long long);
2735 break;
2736 case 22:
2737 type->alignment = size = targetBits / 8;
2738 break;
2739 case 23:
2740 type->alignment = size = targetBits / 8;
2741 break;
2742 case 5:
2743 type->alignment = size = sizeof(long);
2744 break;
2745 case 2:
2746 type->alignment = size = sizeof(short);
2747 break;
2748 case 6:
2749 type->alignment = size = sizeof(float);
2750 break;
2751 case 7:
2752 type->alignment = size = sizeof(double);
2753 break;
2754 case 8:
2755 {
2756 struct __ecereNameSpace__ecere__com__Class * _class = type->_class ? type->_class->registered : (((void *)0));
2757
2758 if(_class && _class->type == 1)
2759 {
2760 ComputeClassMembers(_class, 0x0);
2761 type->alignment = _class->structAlignment;
2762 size = _class->structSize;
2763 if(type->alignment && size % type->alignment)
2764 size += type->alignment - (size % type->alignment);
2765 }
2766 else if(_class && (_class->type == 3 || _class->type == 4 || _class->type == 2))
2767 {
2768 if(!_class->dataType)
2769 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
2770 size = type->alignment = ComputeTypeSize(_class->dataType);
2771 }
2772 else
2773 size = type->alignment = targetBits / 8;
2774 break;
2775 }
2776 case 13:
2777 case 19:
2778 size = type->alignment = targetBits / 8;
2779 break;
2780 case 12:
2781 if(type->arraySizeExp)
2782 {
2783 ProcessExpressionType(type->arraySizeExp);
2784 ComputeExpression(type->arraySizeExp);
2785 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)))
2786 {
2787 struct Location oldLoc = yylloc;
2788 char expression[10240];
2789
2790 expression[0] = '\0';
2791 type->arraySizeExp->expType = (((void *)0));
2792 yylloc = type->arraySizeExp->loc;
2793 if(inCompiler)
2794 PrintExpression(type->arraySizeExp, expression);
2795 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Array size not constant int (%s)\n", (((void *)0))), expression);
2796 yylloc = oldLoc;
2797 }
2798 GetInt(type->arraySizeExp, &type->arraySize);
2799 }
2800 else if(type->enumClass)
2801 {
2802 if(type->enumClass && type->enumClass->registered && type->enumClass->registered->type == 4)
2803 {
2804 type->arraySize = (int)__ecereNameSpace__ecere__com__eClass_GetProperty(type->enumClass->registered, "enumSize");
2805 }
2806 else
2807 type->arraySize = 0;
2808 }
2809 else
2810 {
2811 type->arraySize = 0;
2812 }
2813 size = ComputeTypeSize(type->type) * type->arraySize;
2814 if(type->type)
2815 type->alignment = type->type->alignment;
2816 break;
2817 case 9:
2818 {
2819 struct Type * member;
2820
2821 for(member = type->members.first; member; member = member->next)
2822 {
2823 int __simpleStruct0, __simpleStruct1;
2824 unsigned int addSize = ComputeTypeSize(member);
2825
2826 member->offset = size;
2827 if(member->alignment && size % member->alignment)
2828 member->offset += member->alignment - (size % member->alignment);
2829 size = member->offset;
2830 type->alignment = (__simpleStruct0 = type->alignment, __simpleStruct1 = member->alignment, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
2831 size += addSize;
2832 }
2833 if(type->alignment && size % type->alignment)
2834 size += type->alignment - (size % type->alignment);
2835 break;
2836 }
2837 case 10:
2838 {
2839 struct Type * member;
2840
2841 for(member = type->members.first; member; member = member->next)
2842 {
2843 int __simpleStruct0, __simpleStruct1;
2844 unsigned int addSize = ComputeTypeSize(member);
2845
2846 member->offset = size;
2847 if(member->alignment && size % member->alignment)
2848 member->offset += member->alignment - (size % member->alignment);
2849 size = member->offset;
2850 type->alignment = (__simpleStruct0 = type->alignment, __simpleStruct1 = member->alignment, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
2851 size = ((size > addSize) ? size : addSize);
2852 }
2853 if(type->alignment && size % type->alignment)
2854 size += type->alignment - (size % type->alignment);
2855 break;
2856 }
2857 case 20:
2858 {
2859 struct TemplateParameter * param = type->templateParameter;
2860 struct Type * baseType = ProcessTemplateParameterType(param);
2861
2862 if(baseType)
2863 {
2864 size = ComputeTypeSize(baseType);
2865 type->alignment = baseType->alignment;
2866 }
2867 else
2868 type->alignment = size = sizeof(uint64);
2869 break;
2870 }
2871 case 15:
2872 {
2873 type->alignment = size = sizeof(enum
2874 {
2875 test
2876 });
2877 break;
2878 }
2879 case 21:
2880 {
2881 type->alignment = size = targetBits / 8;
2882 break;
2883 }
2884 }
2885 type->size = size;
2886 type->computing = 0x0;
2887 }
2888 return size;
2889 }
2890
2891 extern struct Declarator * MkDeclaratorIdentifier(struct Identifier * id);
2892
2893 extern struct Identifier * MkIdentifier(char *  string);
2894
2895 extern void ListAdd(struct __ecereNameSpace__ecere__sys__OldList * list, void *  item);
2896
2897 extern struct Declarator * MkStructDeclarator(struct Declarator * declarator, struct Expression * exp);
2898
2899 extern struct ClassDef * MkClassDefDeclaration(struct Declaration * decl);
2900
2901 extern struct Declaration * MkStructDeclaration(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct __ecereNameSpace__ecere__sys__OldList * declarators, struct Specifier * extStorage);
2902
2903 void ReplaceThisClassSpecifiers(struct __ecereNameSpace__ecere__sys__OldList * specs, struct __ecereNameSpace__ecere__com__Class * _class);
2904
2905 static void DeclareType(struct Type * type, unsigned int declarePointers, unsigned int declareParams);
2906
2907 extern void FreeType(struct Type * type);
2908
2909 extern struct Specifier * MkStructOrUnion(int type, struct Identifier * id, struct __ecereNameSpace__ecere__sys__OldList * definitions);
2910
2911 extern struct Specifier * MkSpecifier(int specifier);
2912
2913 extern struct Declarator * MkDeclaratorArray(struct Declarator * declarator, struct Expression * exp);
2914
2915 extern struct Expression * MkExpConstant(char *  string);
2916
2917 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)
2918 {
2919 struct __ecereNameSpace__ecere__com__DataMember * topMember = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
2920 unsigned int totalSize = 0;
2921 unsigned int maxSize = 0;
2922 int alignment, size;
2923 struct __ecereNameSpace__ecere__com__DataMember * member;
2924 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
2925
2926 if(addedPadding)
2927 *addedPadding = 0x0;
2928 if(!isMember && _class->base)
2929 {
2930 maxSize = _class->structSize;
2931 {
2932 if(_class->type == 1 || _class->type == 5)
2933 AddMembers(declarations, _class->base, 0x0, &totalSize, topClass, (((void *)0)));
2934 else
2935 {
2936 unsigned int baseSize = _class->base->templateClass ? _class->base->templateClass->structSize : _class->base->structSize;
2937
2938 if(maxSize > baseSize)
2939 maxSize -= baseSize;
2940 else
2941 maxSize = 0;
2942 }
2943 }
2944 }
2945 for(member = isMember ? topMember->members.first : _class->membersAndProperties.first; member; member = member->next)
2946 {
2947 if(!member->isProperty)
2948 {
2949 switch(member->type)
2950 {
2951 case 0:
2952 {
2953 if(member->dataTypeString)
2954 {
2955 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList(), * decls = MkList();
2956 struct Declarator * decl;
2957
2958 decl = SpecDeclFromString(member->dataTypeString, specs, MkDeclaratorIdentifier(MkIdentifier(member->name)));
2959 ListAdd(decls, MkStructDeclarator(decl, (((void *)0))));
2960 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(specs, decls, (((void *)0)))));
2961 if(!member->dataType)
2962 member->dataType = ProcessType(specs, decl);
2963 ReplaceThisClassSpecifiers(specs, topClass);
2964 {
2965 struct Type * type = ProcessType(specs, decl);
2966
2967 DeclareType(member->dataType, 0x0, 0x0);
2968 FreeType(type);
2969 }
2970 ComputeTypeSize(member->dataType);
2971 size = member->dataType->size;
2972 alignment = member->dataType->alignment;
2973 if(alignment)
2974 {
2975 if(totalSize % alignment)
2976 totalSize += alignment - (totalSize % alignment);
2977 }
2978 totalSize += size;
2979 }
2980 break;
2981 }
2982 case 1:
2983 case 2:
2984 {
2985 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList(), * list = MkList();
2986
2987 size = 0;
2988 AddMembers(list, (struct __ecereNameSpace__ecere__com__Class *)member, 0x1, &size, topClass, (((void *)0)));
2989 ListAdd(specs, MkStructOrUnion((member->type == 1) ? 4 : 3, (((void *)0)), list));
2990 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(specs, (((void *)0)), (((void *)0)))));
2991 alignment = member->structAlignment;
2992 if(alignment)
2993 {
2994 if(totalSize % alignment)
2995 totalSize += alignment - (totalSize % alignment);
2996 }
2997 totalSize += size;
2998 break;
2999 }
3000 }
3001 }
3002 }
3003 if(retSize)
3004 {
3005 unsigned int __simpleStruct0;
3006
3007 if(topMember && topMember->type == 1)
3008 *retSize = (__simpleStruct0 = *retSize, (__simpleStruct0 > totalSize) ? __simpleStruct0 : totalSize);
3009 else
3010 *retSize += totalSize;
3011 }
3012 else if(totalSize < maxSize && _class->type != 1000)
3013 {
3014 int autoPadding = 0;
3015
3016 if(!isMember && _class->structAlignment && totalSize % _class->structAlignment)
3017 autoPadding = _class->structAlignment - (totalSize % _class->structAlignment);
3018 if(totalSize + autoPadding < maxSize)
3019 {
3020 char sizeString[50];
3021
3022 sprintf(sizeString, "%d", maxSize - totalSize);
3023 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(CHAR)), MkListOne(MkDeclaratorArray(MkDeclaratorIdentifier(MkIdentifier("__ecere_padding")), MkExpConstant(sizeString))), (((void *)0)))));
3024 if(addedPadding)
3025 *addedPadding = 0x1;
3026 }
3027 }
3028 if(context)
3029 FinishTemplatesContext(context);
3030 return topMember ? topMember->memberID : _class->memberID;
3031 }
3032
3033 static int DeclareMembers(struct __ecereNameSpace__ecere__com__Class * _class, unsigned int isMember)
3034 {
3035 struct __ecereNameSpace__ecere__com__DataMember * topMember = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
3036 unsigned int totalSize = 0;
3037 struct __ecereNameSpace__ecere__com__DataMember * member;
3038 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
3039
3040 if(!isMember && (_class->type == 1 || _class->type == 5) && _class->base->type != 1000)
3041 DeclareMembers(_class->base, 0x0);
3042 for(member = isMember ? topMember->members.first : _class->membersAndProperties.first; member; member = member->next)
3043 {
3044 if(!member->isProperty)
3045 {
3046 switch(member->type)
3047 {
3048 case 0:
3049 {
3050 if(!member->dataType && member->dataTypeString)
3051 member->dataType = ProcessTypeString(member->dataTypeString, 0x0);
3052 if(member->dataType)
3053 DeclareType(member->dataType, 0x0, 0x0);
3054 break;
3055 }
3056 case 1:
3057 case 2:
3058 {
3059 DeclareMembers((struct __ecereNameSpace__ecere__com__Class *)member, 0x1);
3060 break;
3061 }
3062 }
3063 }
3064 }
3065 if(context)
3066 FinishTemplatesContext(context);
3067 return topMember ? topMember->memberID : _class->memberID;
3068 }
3069
3070 extern struct Symbol * FindClass(char *  name);
3071
3072 extern char *  strchr(const char * , int);
3073
3074 extern void FullClassNameCat(char *  output, char *  className, unsigned int includeTemplateParams);
3075
3076 extern void FreeList(struct __ecereNameSpace__ecere__sys__OldList * list, void (*  FreeFunction)(void * ));
3077
3078 extern void FreeClassDef(struct ClassDef * def);
3079
3080 extern struct External * MkExternalDeclaration(struct Declaration * declaration);
3081
3082 extern struct Declaration * MkDeclaration(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct __ecereNameSpace__ecere__sys__OldList * initDeclarators);
3083
3084 extern void MangleClassName(char *  className);
3085
3086 extern void DeclareClass(struct Symbol * classSym, char *  className);
3087
3088 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move(struct __ecereNameSpace__ecere__sys__OldList * this, void *  item, void *  prevItem);
3089
3090 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(struct __ecereNameSpace__ecere__sys__OldList * this, void *  prevItem, void *  item);
3091
3092 void DeclareStruct(char * name, unsigned int skipNoHead)
3093 {
3094 struct External * external = (((void *)0));
3095 struct Symbol * classSym = FindClass(name);
3096
3097 if(!inCompiler || !classSym)
3098 return ;
3099 if(classSym->registered && (classSym->registered->type == 2 || classSym->registered->type == 3 || classSym->registered->type == 4))
3100 return ;
3101 if(classSym->registered && classSym->imported && !classSym->declaredStructSym)
3102 {
3103 struct Declaration * decl;
3104 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
3105 struct __ecereNameSpace__ecere__sys__OldList * declarations = (((void *)0));
3106 char structName[1024];
3107
3108 external = (classSym->registered && classSym->registered->type == 1) ? classSym->pointerExternal : classSym->structExternal;
3109 classSym->declaring++;
3110 if(strchr(classSym->string, '<'))
3111 {
3112 if(classSym->registered->templateClass)
3113 {
3114 DeclareStruct(classSym->registered->templateClass->fullName, skipNoHead);
3115 classSym->declaring--;
3116 }
3117 return ;
3118 }
3119 DeclareMembers(classSym->registered, 0x0);
3120 structName[0] = (char)0;
3121 FullClassNameCat(structName, name, 0x0);
3122 if(!skipNoHead)
3123 {
3124 unsigned int addedPadding = 0x0;
3125
3126 classSym->declaredStructSym = 0x1;
3127 declarations = MkList();
3128 AddMembers(declarations, classSym->registered, 0x0, (((void *)0)), classSym->registered, &addedPadding);
3129 if(!(*declarations).count || ((*declarations).count == 1 && addedPadding))
3130 {
3131 FreeList(declarations, FreeClassDef);
3132 declarations = (((void *)0));
3133 }
3134 }
3135 if(skipNoHead || declarations)
3136 {
3137 if(external && external->declaration)
3138 {
3139 ((struct Specifier *)(*external->declaration->specifiers).first)->definitions = declarations;
3140 if(curExternal && curExternal->symbol && curExternal->symbol->idCode < classSym->id)
3141 {
3142 if(classSym->structExternal)
3143 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->structExternal, curExternal->prev);
3144 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->pointerExternal, curExternal->prev);
3145 classSym->id = curExternal->symbol->idCode;
3146 classSym->idCode = curExternal->symbol->idCode;
3147 }
3148 }
3149 else
3150 {
3151 if(!external)
3152 external = MkExternalDeclaration((((void *)0)));
3153 specifiers = MkList();
3154 declarators = MkList();
3155 ListAdd(specifiers, MkStructOrUnion(3, MkIdentifier(structName), declarations));
3156 external->declaration = decl = MkDeclaration(specifiers, declarators);
3157 if(decl->symbol && !decl->symbol->pointerExternal)
3158 decl->symbol->pointerExternal = external;
3159 if(classSym->registered && classSym->registered->type == 1)
3160 {
3161 char className[1024];
3162
3163 strcpy(className, "__ecereClass_");
3164 FullClassNameCat(className, classSym->string, 0x1);
3165 MangleClassName(className);
3166 DeclareClass(classSym, className);
3167 external->symbol = classSym;
3168 classSym->pointerExternal = external;
3169 classSym->id = (curExternal && curExternal->symbol) ? curExternal->symbol->idCode : 0;
3170 classSym->idCode = (curExternal && curExternal->symbol) ? curExternal->symbol->idCode : 0;
3171 }
3172 else
3173 {
3174 char className[1024];
3175
3176 strcpy(className, "__ecereClass_");
3177 FullClassNameCat(className, classSym->string, 0x1);
3178 MangleClassName(className);
3179 classSym->structExternal = external;
3180 DeclareClass(classSym, className);
3181 external->symbol = classSym;
3182 }
3183 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal ? curExternal->prev : (((void *)0)), external);
3184 }
3185 }
3186 classSym->declaring--;
3187 }
3188 else if(curExternal && curExternal->symbol && curExternal->symbol->idCode < classSym->id)
3189 {
3190 classSym->declaring++;
3191 {
3192 if(classSym->registered)
3193 DeclareMembers(classSym->registered, 0x0);
3194 }
3195 if(classSym->registered && (classSym->registered->type == 1 || classSym->registered->type == 5))
3196 {
3197 if(classSym->structExternal)
3198 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->structExternal, curExternal->prev);
3199 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->pointerExternal, curExternal->prev);
3200 classSym->id = curExternal->symbol->idCode;
3201 classSym->idCode = curExternal->symbol->idCode;
3202 }
3203 classSym->declaring--;
3204 }
3205 }
3206
3207 extern char *  strcat(char * , const char * );
3208
3209 extern struct ModuleImport * FindModule(struct __ecereNameSpace__ecere__com__Instance * moduleToFind);
3210
3211 extern struct ModuleImport * mainModule;
3212
3213 extern struct Specifier * MkSpecifierName(char *  name);
3214
3215 extern struct Declarator * MkDeclaratorBrackets(struct Declarator * declarator);
3216
3217 extern struct Declarator * PlugDeclarator(struct Declarator * decl, struct Declarator * baseDecl);
3218
3219 extern struct Declarator * MkDeclaratorFunction(struct Declarator * declarator, struct __ecereNameSpace__ecere__sys__OldList * parameters);
3220
3221 extern struct InitDeclarator * MkInitDeclarator(struct Declarator * declarator, struct Initializer * initializer);
3222
3223 extern void FreeDeclarator(struct Declarator * decl);
3224
3225 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_PropertyImport;
3226
3227 struct PropertyImport
3228 {
3229 struct PropertyImport * prev;
3230 struct PropertyImport * next;
3231 char *  name;
3232 unsigned int isVirtual;
3233 unsigned int hasSet;
3234 unsigned int hasGet;
3235 } __attribute__ ((gcc_struct));
3236
3237 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(struct __ecereNameSpace__ecere__sys__OldList * this, void *  item);
3238
3239 void DeclareProperty(struct __ecereNameSpace__ecere__com__Property * prop, char * setName, char * getName)
3240 {
3241 struct Symbol * symbol = prop->symbol;
3242 char propName[1024];
3243
3244 strcpy(setName, "__ecereProp_");
3245 FullClassNameCat(setName, prop->_class->fullName, 0x0);
3246 strcat(setName, "_Set_");
3247 FullClassNameCat(setName, prop->name, 0x1);
3248 strcpy(getName, "__ecereProp_");
3249 FullClassNameCat(getName, prop->_class->fullName, 0x0);
3250 strcat(getName, "_Get_");
3251 FullClassNameCat(getName, prop->name, 0x1);
3252 strcpy(propName, "__ecereProp_");
3253 FullClassNameCat(propName, prop->_class->fullName, 0x0);
3254 strcat(propName, "_");
3255 FullClassNameCat(propName, prop->name, 0x1);
3256 MangleClassName(getName);
3257 MangleClassName(setName);
3258 MangleClassName(propName);
3259 if(prop->_class->type == 1)
3260 DeclareStruct(prop->_class->fullName, 0x0);
3261 if(!symbol || curExternal->symbol->idCode < symbol->id)
3262 {
3263 unsigned int imported = 0x0;
3264 unsigned int dllImport = 0x0;
3265
3266 if(!symbol || symbol->_import)
3267 {
3268 if(!symbol)
3269 {
3270 struct Symbol * classSym;
3271
3272 if(!prop->_class->symbol)
3273 prop->_class->symbol = FindClass(prop->_class->fullName);
3274 classSym = prop->_class->symbol;
3275 if(classSym && !classSym->_import)
3276 {
3277 struct ModuleImport * module;
3278
3279 if(prop->_class->module)
3280 module = FindModule(prop->_class->module);
3281 else
3282 module = mainModule;
3283 classSym->_import = __extension__ ({
3284 struct ClassImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_ClassImport);
3285
3286 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(prop->_class->fullName), __ecereInstance1->isRemote = prop->_class->isRemote, __ecereInstance1;
3287 });
3288 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->classes, classSym->_import);
3289 }
3290 symbol = prop->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
3291 symbol->_import = (struct ClassImport *)__extension__ ({
3292 struct PropertyImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_PropertyImport);
3293
3294 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(prop->name), __ecereInstance1->isVirtual = 0x0, __ecereInstance1->hasSet = prop->Set ? 0x1 : 0x0, __ecereInstance1->hasGet = prop->Get ? 0x1 : 0x0, __ecereInstance1;
3295 });
3296 if(classSym)
3297 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&classSym->_import->properties, symbol->_import);
3298 }
3299 imported = 0x1;
3300 if((prop->_class->module != privateModule || !strcmp(prop->_class->name, "float") || !strcmp(prop->_class->name, "double")) && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)prop->_class->module + 24)))->importType != 1)
3301 dllImport = 0x1;
3302 }
3303 if(!symbol->type)
3304 {
3305 struct Context * context = SetupTemplatesContext(prop->_class);
3306
3307 symbol->type = ProcessTypeString(prop->dataTypeString, 0x0);
3308 FinishTemplatesContext(context);
3309 }
3310 if(prop->Get)
3311 {
3312 if(!symbol->externalGet || symbol->externalGet->type == 0)
3313 {
3314 struct Declaration * decl;
3315 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
3316 struct Declarator * d;
3317 struct __ecereNameSpace__ecere__sys__OldList * params;
3318 struct Specifier * spec;
3319 struct External * external;
3320 struct Declarator * typeDecl;
3321 unsigned int simple = 0x0;
3322
3323 specifiers = MkList();
3324 declarators = MkList();
3325 params = MkList();
3326 ListAdd(params, MkTypeName(MkListOne(MkSpecifierName(prop->_class->fullName)), MkDeclaratorIdentifier(MkIdentifier("this"))));
3327 d = MkDeclaratorIdentifier(MkIdentifier(getName));
3328 if(dllImport)
3329 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
3330 {
3331 struct Context * context = SetupTemplatesContext(prop->_class);
3332
3333 typeDecl = SpecDeclFromString(prop->dataTypeString, specifiers, (((void *)0)));
3334 FinishTemplatesContext(context);
3335 }
3336 for(spec = (*specifiers).first; spec; spec = spec->next)
3337 {
3338 if(spec->type == 1)
3339 {
3340 if((!typeDecl || typeDecl->type == 1))
3341 {
3342 struct Symbol * classSym = spec->symbol;
3343
3344 symbol->_class = classSym->registered;
3345 if(classSym->registered && classSym->registered->type == 1)
3346 {
3347 DeclareStruct(spec->name, 0x0);
3348 simple = 0x1;
3349 }
3350 }
3351 }
3352 }
3353 if(!simple)
3354 d = PlugDeclarator(typeDecl, d);
3355 else
3356 {
3357 ListAdd(params, MkTypeName(specifiers, PlugDeclarator(typeDecl, MkDeclaratorIdentifier(MkIdentifier("value")))));
3358 specifiers = MkList();
3359 }
3360 d = MkDeclaratorFunction(d, params);
3361 if(dllImport)
3362 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
3363 else if(prop->_class->symbol && ((struct Symbol *)prop->_class->symbol)->isStatic)
3364 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
3365 if(simple)
3366 ListAdd(specifiers, MkSpecifier(VOID));
3367 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
3368 decl = MkDeclaration(specifiers, declarators);
3369 external = MkExternalDeclaration(decl);
3370 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
3371 external->symbol = symbol;
3372 symbol->externalGet = external;
3373 ReplaceThisClassSpecifiers(specifiers, prop->_class);
3374 if(typeDecl)
3375 FreeDeclarator(typeDecl);
3376 }
3377 else
3378 {
3379 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->externalGet, curExternal->prev);
3380 }
3381 }
3382 if(prop->Set)
3383 {
3384 if(!symbol->externalSet || symbol->externalSet->type == 0)
3385 {
3386 struct Declaration * decl;
3387 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
3388 struct Declarator * d;
3389 struct __ecereNameSpace__ecere__sys__OldList * params;
3390 struct Specifier * spec;
3391 struct External * external;
3392 struct Declarator * typeDecl;
3393
3394 declarators = MkList();
3395 params = MkList();
3396 if(!prop->conversion || prop->_class->type == 1)
3397 {
3398 ListAdd(params, MkTypeName(MkListOne(MkSpecifierName(prop->_class->fullName)), MkDeclaratorIdentifier(MkIdentifier("this"))));
3399 }
3400 specifiers = MkList();
3401 {
3402 struct Context * context = SetupTemplatesContext(prop->_class);
3403
3404 typeDecl = d = SpecDeclFromString(prop->dataTypeString, specifiers, MkDeclaratorIdentifier(MkIdentifier("value")));
3405 FinishTemplatesContext(context);
3406 }
3407 ListAdd(params, MkTypeName(specifiers, d));
3408 d = MkDeclaratorIdentifier(MkIdentifier(setName));
3409 if(dllImport)
3410 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
3411 d = MkDeclaratorFunction(d, params);
3412 for(spec = (*specifiers).first; spec; spec = spec->next)
3413 {
3414 if(spec->type == 1)
3415 {
3416 if((!typeDecl || typeDecl->type == 1))
3417 {
3418 struct Symbol * classSym = spec->symbol;
3419
3420 symbol->_class = classSym->registered;
3421 if(classSym->registered && classSym->registered->type == 1)
3422 DeclareStruct(spec->name, 0x0);
3423 }
3424 }
3425 }
3426 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
3427 specifiers = MkList();
3428 if(dllImport)
3429 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
3430 else if(prop->_class->symbol && ((struct Symbol *)prop->_class->symbol)->isStatic)
3431 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
3432 if(!prop->conversion || prop->_class->type == 1)
3433 ListAdd(specifiers, MkSpecifier(VOID));
3434 else
3435 ListAdd(specifiers, MkSpecifierName(prop->_class->fullName));
3436 decl = MkDeclaration(specifiers, declarators);
3437 external = MkExternalDeclaration(decl);
3438 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
3439 external->symbol = symbol;
3440 symbol->externalSet = external;
3441 ReplaceThisClassSpecifiers(specifiers, prop->_class);
3442 }
3443 else
3444 {
3445 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->externalSet, curExternal->prev);
3446 }
3447 }
3448 if(!symbol->externalPtr)
3449 {
3450 struct Declaration * decl;
3451 struct External * external;
3452 struct __ecereNameSpace__ecere__sys__OldList * specifiers = MkList();
3453
3454 if(imported)
3455 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
3456 else
3457 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
3458 ListAdd(specifiers, MkSpecifierName("Property"));
3459 {
3460 struct __ecereNameSpace__ecere__sys__OldList * list = MkList();
3461
3462 ListAdd(list, MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier(propName))), (((void *)0))));
3463 if(!imported)
3464 {
3465 strcpy(propName, "__ecerePropM_");
3466 FullClassNameCat(propName, prop->_class->fullName, 0x0);
3467 strcat(propName, "_");
3468 FullClassNameCat(propName, prop->name, 0x1);
3469 MangleClassName(propName);
3470 ListAdd(list, MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier(propName))), (((void *)0))));
3471 }
3472 decl = MkDeclaration(specifiers, list);
3473 }
3474 external = MkExternalDeclaration(decl);
3475 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
3476 external->symbol = symbol;
3477 symbol->externalPtr = external;
3478 }
3479 else
3480 {
3481 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->externalPtr, curExternal->prev);
3482 }
3483 symbol->id = curExternal->symbol->idCode;
3484 }
3485 }
3486
3487 struct Type * Dereference(struct Type * source)
3488 {
3489 struct Type * type = (((void *)0));
3490
3491 if(source)
3492 {
3493 if(source->kind == 13 || source->kind == 12)
3494 {
3495 type = source->type;
3496 source->type->refCount++;
3497 }
3498 else if(source->kind == 8 && !strcmp(source->_class->string, "String"))
3499 {
3500 type = __extension__ ({
3501 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
3502
3503 __ecereInstance1->kind = 1, __ecereInstance1->refCount = 1, __ecereInstance1;
3504 });
3505 }
3506 else if(source->kind == 8 && source->_class && source->_class->registered && source->_class->registered->type == 5)
3507 {
3508 type = source;
3509 source->refCount++;
3510 }
3511 else
3512 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "cannot dereference type\n", (((void *)0))));
3513 }
3514 return type;
3515 }
3516
3517 static struct Type * Reference(struct Type * source)
3518 {
3519 struct Type * type = (((void *)0));
3520
3521 if(source)
3522 {
3523 type = __extension__ ({
3524 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
3525
3526 __ecereInstance1->kind = 13, __ecereInstance1->type = source, __ecereInstance1->refCount = 1, __ecereInstance1;
3527 });
3528 source->refCount++;
3529 }
3530 return type;
3531 }
3532
3533 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);
3534
3535 extern void *  memcpy(void * , const void * , size_t size);
3536
3537 void ProcessMethodType(struct __ecereNameSpace__ecere__com__Method * method);
3538
3539 extern void FreeExpression(struct Expression * exp);
3540
3541 extern void __ecereNameSpace__ecere__sys__ChangeCh(char *  string, char ch1, char ch2);
3542
3543 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);
3544
3545 static void ProcessInitializer(struct Initializer * init, struct Type * type);
3546
3547 extern struct Type * MkClassType(char *  name);
3548
3549 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);
3550
3551 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)
3552 {
3553 struct Identifier * ident = member->identifiers ? (*member->identifiers).first : (((void *)0));
3554 unsigned int found = 0x0;
3555 struct __ecereNameSpace__ecere__com__DataMember * dataMember = (((void *)0));
3556 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
3557 unsigned int freeType = 0x0;
3558
3559 yylloc = member->loc;
3560 if(!ident)
3561 {
3562 if(curMember)
3563 {
3564 __ecereNameSpace__ecere__com__eClass_FindNextMember(_class, curClass, curMember, subMemberStack, subMemberStackPos);
3565 if(*curMember)
3566 {
3567 found = 0x1;
3568 dataMember = *curMember;
3569 }
3570 }
3571 }
3572 else
3573 {
3574 struct __ecereNameSpace__ecere__com__DataMember * thisMember = (struct __ecereNameSpace__ecere__com__DataMember *)__ecereNameSpace__ecere__com__eClass_FindProperty(_class, ident->string, privateModule);
3575 struct __ecereNameSpace__ecere__com__DataMember * _subMemberStack[256];
3576 int _subMemberStackPos = 0;
3577
3578 if(!thisMember)
3579 thisMember = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, ident->string, privateModule, _subMemberStack, &_subMemberStackPos);
3580 if(thisMember)
3581 {
3582 dataMember = thisMember;
3583 if(curMember && thisMember->memberAccess == 1)
3584 {
3585 *curMember = thisMember;
3586 *curClass = thisMember->_class;
3587 memcpy(subMemberStack, _subMemberStack, sizeof(struct __ecereNameSpace__ecere__com__DataMember *) * _subMemberStackPos);
3588 *subMemberStackPos = _subMemberStackPos;
3589 }
3590 found = 0x1;
3591 }
3592 else
3593 {
3594 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, ident->string, privateModule);
3595 if(method && method->type == 1)
3596 found = 0x1;
3597 else
3598 method = (((void *)0));
3599 }
3600 }
3601 if(found)
3602 {
3603 struct Type * type = (((void *)0));
3604
3605 if(dataMember)
3606 {
3607 if(!dataMember->dataType && dataMember->dataTypeString)
3608 {
3609 struct Context * context = SetupTemplatesContext(_class);
3610
3611 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
3612 FinishTemplatesContext(context);
3613 }
3614 type = dataMember->dataType;
3615 }
3616 else if(method)
3617 {
3618 if(!method->dataType)
3619 ProcessMethodType(method);
3620 type = method->dataType;
3621 }
3622 if(ident && ident->next)
3623 {
3624 for(ident = ident->next; ident && type; ident = ident->next)
3625 {
3626 if(type->kind == 8)
3627 {
3628 dataMember = (struct __ecereNameSpace__ecere__com__DataMember *)__ecereNameSpace__ecere__com__eClass_FindProperty(type->_class->registered, ident->string, privateModule);
3629 if(!dataMember)
3630 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMember(type->_class->registered, ident->string, privateModule, (((void *)0)), (((void *)0)));
3631 if(dataMember)
3632 type = dataMember->dataType;
3633 }
3634 else if(type->kind == 9 || type->kind == 10)
3635 {
3636 struct Type * memberType;
3637
3638 for(memberType = type->members.first; memberType; memberType = memberType->next)
3639 {
3640 if(!strcmp(memberType->name, ident->string))
3641 {
3642 type = memberType;
3643 break;
3644 }
3645 }
3646 }
3647 }
3648 }
3649 if(type && type->kind == 20 && type->templateParameter->type == 0 && _class->templateArgs)
3650 {
3651 int id = 0;
3652 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
3653 struct __ecereNameSpace__ecere__com__Class * sClass;
3654
3655 for(sClass = _class; sClass; sClass = sClass->base)
3656 {
3657 id = 0;
3658 if(sClass->templateClass)
3659 sClass = sClass->templateClass;
3660 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
3661 {
3662 if(curParam->type == 0 && !strcmp(type->templateParameter->identifier->string, curParam->name))
3663 {
3664 for(sClass = sClass->base; sClass; sClass = sClass->base)
3665 {
3666 if(sClass->templateClass)
3667 sClass = sClass->templateClass;
3668 id += sClass->templateParams.count;
3669 }
3670 break;
3671 }
3672 id++;
3673 }
3674 if(curParam)
3675 break;
3676 }
3677 if(curParam)
3678 {
3679 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = _class->templateArgs[id];
3680
3681 if(arg.dataTypeString)
3682 {
3683 type = ProcessTypeString(arg.dataTypeString, 0x0);
3684 freeType = 0x1;
3685 if(type && _class->templateClass)
3686 type->passAsTemplate = 0x1;
3687 if(type)
3688 {
3689 }
3690 }
3691 }
3692 }
3693 if(type && type->kind == 8 && type->_class && type->_class->registered && strchr(type->_class->registered->fullName, '<'))
3694 {
3695 struct __ecereNameSpace__ecere__com__Class * expClass = type->_class->registered;
3696 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
3697 int c;
3698 int paramCount = 0;
3699 int lastParam = -1;
3700 char templateString[1024];
3701 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
3702
3703 sprintf(templateString, "%s<", expClass->templateClass->fullName);
3704 for(cClass = expClass; cClass; cClass = cClass->base)
3705 {
3706 int p = 0;
3707
3708 if(cClass->templateClass)
3709 cClass = cClass->templateClass;
3710 for(param = cClass->templateParams.first; param; param = param->next)
3711 {
3712 int id = p;
3713 struct __ecereNameSpace__ecere__com__Class * sClass;
3714 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
3715
3716 for(sClass = cClass->base; sClass; sClass = sClass->base)
3717 {
3718 if(sClass->templateClass)
3719 sClass = sClass->templateClass;
3720 id += sClass->templateParams.count;
3721 }
3722 arg = expClass->templateArgs[id];
3723 for(sClass = _class; sClass; sClass = sClass->base)
3724 {
3725 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * cParam;
3726 int p = 0;
3727 struct __ecereNameSpace__ecere__com__Class * nextClass;
3728
3729 if(sClass->templateClass)
3730 sClass = sClass->templateClass;
3731 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
3732 {
3733 if(nextClass->templateClass)
3734 nextClass = nextClass->templateClass;
3735 p += nextClass->templateParams.count;
3736 }
3737 for(cParam = sClass->templateParams.first; cParam; cParam = cParam->next, p++)
3738 {
3739 if(cParam->type == 0 && arg.dataTypeString && !strcmp(cParam->name, arg.dataTypeString))
3740 {
3741 if(_class->templateArgs && arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
3742 {
3743 arg.dataTypeString = _class->templateArgs[p].dataTypeString;
3744 arg.dataTypeClass = _class->templateArgs[p].dataTypeClass;
3745 break;
3746 }
3747 }
3748 }
3749 }
3750 {
3751 char argument[256];
3752
3753 argument[0] = '\0';
3754 switch(param->type)
3755 {
3756 case 2:
3757 {
3758 char expString[1024];
3759 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
3760 struct Declarator * decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
3761 struct Expression * exp;
3762 char * string = PrintHexUInt64(arg.expression.ui64);
3763
3764 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
3765 (__ecereNameSpace__ecere__com__eSystem_Delete(string), string = 0);
3766 ProcessExpressionType(exp);
3767 ComputeExpression(exp);
3768 expString[0] = '\0';
3769 PrintExpression(exp, expString);
3770 strcat(argument, expString);
3771 FreeExpression(exp);
3772 break;
3773 }
3774 case 1:
3775 {
3776 strcat(argument, arg.member->name);
3777 break;
3778 }
3779 case 0:
3780 {
3781 if(arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
3782 strcat(argument, arg.dataTypeString);
3783 break;
3784 }
3785 }
3786 if(argument[0])
3787 {
3788 if(paramCount)
3789 strcat(templateString, ", ");
3790 if(lastParam != p - 1)
3791 {
3792 strcat(templateString, param->name);
3793 strcat(templateString, " = ");
3794 }
3795 strcat(templateString, argument);
3796 paramCount++;
3797 lastParam = p;
3798 }
3799 p++;
3800 }
3801 }
3802 }
3803 {
3804 int len = strlen(templateString);
3805
3806 if(templateString[len - 1] == '<')
3807 len--;
3808 else
3809 {
3810 if(templateString[len - 1] == '>')
3811 templateString[len++] = ' ';
3812 templateString[len++] = '>';
3813 }
3814 templateString[len++] = '\0';
3815 }
3816 {
3817 struct Context * context = SetupTemplatesContext(_class);
3818
3819 if(freeType)
3820 FreeType(type);
3821 type = ProcessTypeString(templateString, 0x0);
3822 freeType = 0x1;
3823 FinishTemplatesContext(context);
3824 }
3825 }
3826 if(method && member->initializer && member->initializer->type == 0 && member->initializer->exp)
3827 {
3828 ProcessExpressionType(member->initializer->exp);
3829 if(!member->initializer->exp->expType)
3830 {
3831 if(inCompiler)
3832 {
3833 char expString[10240];
3834
3835 expString[0] = '\0';
3836 PrintExpression(member->initializer->exp, expString);
3837 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
3838 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved symbol used as an instance method %s\n", (((void *)0))), expString);
3839 }
3840 }
3841 else if(!MatchTypes(member->initializer->exp->expType, type, (((void *)0)), (((void *)0)), _class, 0x1, 0x1, 0x0, 0x0))
3842 {
3843 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible instance method %s\n", (((void *)0))), ident->string);
3844 }
3845 }
3846 else if(member->initializer)
3847 {
3848 ProcessInitializer(member->initializer, type);
3849 }
3850 if(freeType)
3851 FreeType(type);
3852 }
3853 else
3854 {
3855 if(_class && _class->type == 3)
3856 {
3857 if(member->initializer)
3858 {
3859 struct Type * type = MkClassType(_class->fullName);
3860
3861 ProcessInitializer(member->initializer, type);
3862 FreeType(type);
3863 }
3864 }
3865 else
3866 {
3867 if(member->initializer)
3868 {
3869 ProcessInitializer(member->initializer, (((void *)0)));
3870 }
3871 if(ident)
3872 {
3873 if(method)
3874 {
3875 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't find virtual method %s in class %s\n", (((void *)0))), ident->string, _class->fullName);
3876 }
3877 else if(_class)
3878 {
3879 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't find member %s in class %s\n", (((void *)0))), ident->string, _class->fullName);
3880 if(inCompiler)
3881 __ecereNameSpace__ecere__com__eClass_AddDataMember(_class, ident->string, "int", 0, 0, 1);
3882 }
3883 }
3884 else if(_class)
3885 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "too many initializers for instantiation of class %s\n", (((void *)0))), _class->fullName);
3886 }
3887 }
3888 }
3889
3890 extern struct Identifier * GetDeclId(struct Declarator * decl);
3891
3892 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);
3893
3894 extern void FreeSpecifier(struct Specifier * spec);
3895
3896 static void ProcessFunction(struct FunctionDefinition * function);
3897
3898 extern struct __ecereNameSpace__ecere__sys__OldList *  CopyList(struct __ecereNameSpace__ecere__sys__OldList *  source, void *  (*  CopyFunction)(void * ));
3899
3900 extern struct Specifier * CopySpecifier(struct Specifier * spec);
3901
3902 extern struct Declarator * CopyDeclarator(struct Declarator * declarator);
3903
3904 extern void FreeClassFunction(struct ClassFunction * func);
3905
3906 extern struct MemberInit * MkMemberInit(struct __ecereNameSpace__ecere__sys__OldList * ids, struct Initializer * initializer);
3907
3908 extern struct Initializer * MkInitializerAssignment(struct Expression * exp);
3909
3910 void ProcessInstantiationType(struct Instantiation * inst)
3911 {
3912 yylloc = inst->loc;
3913 if(inst->_class)
3914 {
3915 struct MembersInit * members;
3916 struct Symbol * classSym;
3917 struct __ecereNameSpace__ecere__com__Class * _class;
3918
3919 classSym = inst->_class->symbol;
3920 _class = classSym ? classSym->registered : (((void *)0));
3921 if(!_class || _class->type != 5)
3922 DeclareStruct(inst->_class->name, 0x0);
3923 afterExternal = afterExternal ? afterExternal : curExternal;
3924 if(inst->exp)
3925 ProcessExpressionType(inst->exp);
3926 inst->isConstant = 0x1;
3927 if(inst->members)
3928 {
3929 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
3930 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
3931 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
3932 int subMemberStackPos = 0;
3933
3934 for(members = (*inst->members).first; members; members = members->next)
3935 {
3936 switch(members->type)
3937 {
3938 case 1:
3939 {
3940 char name[1024];
3941 static unsigned int instMethodID = 0;
3942 struct External * external = curExternal;
3943 struct Context * context = curContext;
3944 struct Declarator * declarator = members->function->declarator;
3945 struct Identifier * nameID = GetDeclId(declarator);
3946 char * unmangled = nameID ? nameID->string : (((void *)0));
3947 struct Expression * exp;
3948 struct External * createdExternal = (((void *)0));
3949
3950 if(inCompiler)
3951 {
3952 char number[16];
3953
3954 strcpy(name, "__ecereInstMeth_");
3955 FullClassNameCat(name, _class ? _class->fullName : "_UNKNOWNCLASS", 0x0);
3956 strcat(name, "_");
3957 strcat(name, nameID->string);
3958 strcat(name, "_");
3959 sprintf(number, "_%08d", instMethodID++);
3960 strcat(name, number);
3961 nameID->string = __ecereNameSpace__ecere__sys__CopyString(name);
3962 }
3963 if(declarator)
3964 {
3965 struct Symbol * symbol = declarator->symbol;
3966 struct __ecereNameSpace__ecere__com__Method * method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, unmangled, privateModule);
3967
3968 if(method && method->type == 1)
3969 {
3970 symbol->method = method;
3971 ProcessMethodType(method);
3972 if(!symbol->type->thisClass)
3973 {
3974 if(method->dataType->thisClass && currentClass && __ecereNameSpace__ecere__com__eClass_IsDerived(currentClass, method->dataType->thisClass->registered))
3975 {
3976 if(!currentClass->symbol)
3977 currentClass->symbol = FindClass(currentClass->fullName);
3978 symbol->type->thisClass = currentClass->symbol;
3979 }
3980 else
3981 {
3982 if(!_class->symbol)
3983 _class->symbol = FindClass(_class->fullName);
3984 symbol->type->thisClass = _class->symbol;
3985 }
3986 }
3987 DeclareType(symbol->type, 0x1, 0x1);
3988 }
3989 else if(classSym)
3990 {
3991 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't find virtual method %s in class %s\n", (((void *)0))), unmangled, classSym->string);
3992 }
3993 }
3994 createdExternal = ProcessClassFunction(classSym ? classSym->registered : (((void *)0)), members->function, ast, afterExternal, 0x1);
3995 if(nameID)
3996 {
3997 FreeSpecifier(nameID->_class);
3998 nameID->_class = (((void *)0));
3999 }
4000 if(inCompiler)
4001 {
4002 struct Type * type = declarator->symbol->type;
4003 struct External * oldExternal = curExternal;
4004
4005 declarator->symbol->id = declarator->symbol->idCode = curExternal->symbol->idCode;
4006 {
4007 struct External * externalDecl;
4008
4009 externalDecl = MkExternalDeclaration((((void *)0)));
4010 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), oldExternal->prev, externalDecl);
4011 if(createdExternal->function)
4012 {
4013 ProcessFunction(createdExternal->function);
4014 {
4015 struct Declaration * decl = MkDeclaration(CopyList(createdExternal->function->specifiers, CopySpecifier), MkListOne(MkInitDeclarator(CopyDeclarator(declarator), (((void *)0)))));
4016
4017 externalDecl->declaration = decl;
4018 if(decl->symbol && !decl->symbol->pointerExternal)
4019 decl->symbol->pointerExternal = externalDecl;
4020 declarator->symbol->pointerExternal = externalDecl;
4021 }
4022 }
4023 }
4024 }
4025 else if(declarator)
4026 {
4027 curExternal = declarator->symbol->pointerExternal;
4028 ProcessFunction((struct FunctionDefinition *)members->function);
4029 }
4030 curExternal = external;
4031 curContext = context;
4032 if(inCompiler)
4033 {
4034 FreeClassFunction(members->function);
4035 exp = QMkExpId(name);
4036 members->type = 0;
4037 members->dataMembers = MkListOne(MkMemberInit(MkListOne(MkIdentifier(unmangled)), MkInitializerAssignment(exp)));
4038 (__ecereNameSpace__ecere__com__eSystem_Delete(unmangled), unmangled = 0);
4039 }
4040 break;
4041 }
4042 case 0:
4043 {
4044 if(members->dataMembers && classSym)
4045 {
4046 struct MemberInit * member;
4047 struct Location oldyyloc = yylloc;
4048
4049 for(member = (*members->dataMembers).first; member; member = member->next)
4050 {
4051 ProcessMemberInitData(member, classSym->registered, &curClass, &curMember, subMemberStack, &subMemberStackPos);
4052 if(member->initializer && !member->initializer->isConstant)
4053 inst->isConstant = 0x0;
4054 }
4055 yylloc = oldyyloc;
4056 }
4057 break;
4058 }
4059 }
4060 }
4061 }
4062 }
4063 }
4064
4065 static void DeclareType(struct Type * type, unsigned int declarePointers, unsigned int declareParams)
4066 {
4067 if(inCompiler)
4068 {
4069 if(type->kind == 11)
4070 {
4071 struct Type * param;
4072
4073 if(declareParams)
4074 {
4075 for(param = type->params.first; param; param = param->next)
4076 DeclareType(param, declarePointers, 0x1);
4077 }
4078 DeclareType(type->returnType, declarePointers, 0x1);
4079 }
4080 else if(type->kind == 13 && declarePointers)
4081 DeclareType(type->type, declarePointers, 0x0);
4082 else if(type->kind == 8)
4083 {
4084 if(type->_class->registered && (type->_class->registered->type == 1 || type->_class->registered->type == 5) && !type->_class->declaring)
4085 DeclareStruct(type->_class->registered->fullName, type->_class->registered->type == 5);
4086 }
4087 else if(type->kind == 9 || type->kind == 10)
4088 {
4089 struct Type * member;
4090
4091 for(member = type->members.first; member; member = member->next)
4092 DeclareType(member, 0x0, 0x0);
4093 }
4094 else if(type->kind == 12)
4095 DeclareType(type->arrayType, declarePointers, 0x0);
4096 }
4097 }
4098
4099 extern struct __ecereNameSpace__ecere__com__Class * __ecereNameSpace__ecere__com__eSystem_FindClass(struct __ecereNameSpace__ecere__com__Instance * module, char *  name);
4100
4101 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * FindTemplateArg(struct __ecereNameSpace__ecere__com__Class * _class, struct TemplateParameter * param)
4102 {
4103 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * arg = (((void *)0));
4104 int id = 0;
4105 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
4106 struct __ecereNameSpace__ecere__com__Class * sClass;
4107
4108 for(sClass = _class; sClass; sClass = sClass->base)
4109 {
4110 id = 0;
4111 if(sClass->templateClass)
4112 sClass = sClass->templateClass;
4113 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
4114 {
4115 if(curParam->type == 0 && !strcmp(param->identifier->string, curParam->name))
4116 {
4117 for(sClass = sClass->base; sClass; sClass = sClass->base)
4118 {
4119 if(sClass->templateClass)
4120 sClass = sClass->templateClass;
4121 id += sClass->templateParams.count;
4122 }
4123 break;
4124 }
4125 id++;
4126 }
4127 if(curParam)
4128 break;
4129 }
4130 if(curParam)
4131 {
4132 arg = &_class->templateArgs[id];
4133 if(arg && param->type == 0)
4134 (*arg).dataTypeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, (*arg).dataTypeString);
4135 }
4136 return arg;
4137 }
4138
4139 extern struct Context * PushContext(void);
4140
4141 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplatedType;
4142
4143 struct TemplatedType
4144 {
4145 uintptr_t key;
4146 struct __ecereNameSpace__ecere__sys__BTNode * parent;
4147 struct __ecereNameSpace__ecere__sys__BTNode * left;
4148 struct __ecereNameSpace__ecere__sys__BTNode * right;
4149 int depth;
4150 struct TemplateParameter * param;
4151 } __attribute__ ((gcc_struct));
4152
4153 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(struct __ecereNameSpace__ecere__sys__BinaryTree * this, struct __ecereNameSpace__ecere__sys__BTNode * node);
4154
4155 struct Context * SetupTemplatesContext(struct __ecereNameSpace__ecere__com__Class * _class)
4156 {
4157 struct Context * context = PushContext();
4158
4159 context->templateTypesOnly = 0x1;
4160 if(_class->symbol && ((struct Symbol *)_class->symbol)->templateParams)
4161 {
4162 struct TemplateParameter * param = (*((struct Symbol *)_class->symbol)->templateParams).first;
4163
4164 for(; param; param = param->next)
4165 {
4166 if(param->type == 0 && param->identifier)
4167 {
4168 struct TemplatedType * type = (type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TemplatedType), type->key = (uintptr_t)param->identifier->string, type->param = param, type);
4169
4170 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&curContext->templateTypes, (struct __ecereNameSpace__ecere__sys__BTNode *)type);
4171 }
4172 }
4173 }
4174 else if(_class)
4175 {
4176 struct __ecereNameSpace__ecere__com__Class * sClass;
4177
4178 for(sClass = _class; sClass; sClass = sClass->base)
4179 {
4180 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * p;
4181
4182 for(p = sClass->templateParams.first; p; p = p->next)
4183 {
4184 if(p->type == 0)
4185 {
4186 struct TemplateParameter * param = p->param;
4187 struct TemplatedType * type;
4188
4189 if(!param)
4190 {
4191 p->param = param = __extension__ ({
4192 struct TemplateParameter * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TemplateParameter);
4193
4194 __ecereInstance1->identifier = MkIdentifier(p->name), __ecereInstance1->type = p->type, __ecereInstance1->dataTypeString = p->dataTypeString, __ecereInstance1;
4195 });
4196 }
4197 type = __extension__ ({
4198 struct TemplatedType * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TemplatedType);
4199
4200 __ecereInstance1->key = (uintptr_t)p->name, __ecereInstance1->param = param, __ecereInstance1;
4201 });
4202 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&curContext->templateTypes, (struct __ecereNameSpace__ecere__sys__BTNode *)type);
4203 }
4204 }
4205 }
4206 }
4207 return context;
4208 }
4209
4210 extern void PopContext(struct Context * ctx);
4211
4212 extern void FreeContext(struct Context * context);
4213
4214 void FinishTemplatesContext(struct Context * context)
4215 {
4216 PopContext(context);
4217 FreeContext(context);
4218 ((context ? (__ecereClass_Context->Destructor ? __ecereClass_Context->Destructor(context) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(context)) : 0), context = 0);
4219 }
4220
4221 void ProcessMethodType(struct __ecereNameSpace__ecere__com__Method * method)
4222 {
4223 if(!method->dataType)
4224 {
4225 struct Context * context = SetupTemplatesContext(method->_class);
4226
4227 method->dataType = ProcessTypeString(method->dataTypeString, 0x0);
4228 FinishTemplatesContext(context);
4229 if(method->type != 1 && method->dataType)
4230 {
4231 if(!method->dataType->thisClass && !method->dataType->staticMethod)
4232 {
4233 if(!method->_class->symbol)
4234 method->_class->symbol = FindClass(method->_class->fullName);
4235 method->dataType->thisClass = method->_class->symbol;
4236 }
4237 }
4238 }
4239 }
4240
4241 void ProcessPropertyType(struct __ecereNameSpace__ecere__com__Property * prop)
4242 {
4243 if(!prop->dataType)
4244 {
4245 struct Context * context = SetupTemplatesContext(prop->_class);
4246
4247 prop->dataType = ProcessTypeString(prop->dataTypeString, 0x0);
4248 FinishTemplatesContext(context);
4249 }
4250 }
4251
4252 extern struct Declarator * GetFuncDecl(struct Declarator * decl);
4253
4254 extern void FreeTypeName(struct TypeName * typeName);
4255
4256 static void ProcessDeclarator(struct Declarator * decl);
4257
4258 extern struct __ecereNameSpace__ecere__sys__OldList *  excludedSymbols;
4259
4260 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_MethodImport;
4261
4262 struct MethodImport
4263 {
4264 struct MethodImport * prev;
4265 struct MethodImport * next;
4266 char *  name;
4267 unsigned int isVirtual;
4268 } __attribute__ ((gcc_struct));
4269
4270 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(struct __ecereNameSpace__ecere__sys__OldList * this, void *  item);
4271
4272 void DeclareMethod(struct __ecereNameSpace__ecere__com__Method * method, char * name)
4273 {
4274 struct Symbol * symbol = method->symbol;
4275
4276 if(!symbol || (!symbol->pointerExternal && method->type == 1) || symbol->id > (curExternal ? curExternal->symbol->idCode : -1))
4277 {
4278 unsigned int imported = 0x0;
4279 unsigned int dllImport = 0x0;
4280
4281 if(!method->dataType)
4282 method->dataType = ProcessTypeString(method->dataTypeString, 0x0);
4283 if(!symbol || symbol->_import || method->type == 1)
4284 {
4285 if(!symbol || method->type == 1)
4286 {
4287 struct Symbol * classSym;
4288
4289 if(!method->_class->symbol)
4290 method->_class->symbol = FindClass(method->_class->fullName);
4291 classSym = method->_class->symbol;
4292 if(!classSym->_import)
4293 {
4294 struct ModuleImport * module;
4295
4296 if(method->_class->module && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)method->_class->module + structSize_Instance)))->name)
4297 module = FindModule(method->_class->module);
4298 else
4299 module = mainModule;
4300 classSym->_import = __extension__ ({
4301 struct ClassImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_ClassImport);
4302
4303 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(method->_class->fullName), __ecereInstance1->isRemote = method->_class->isRemote, __ecereInstance1;
4304 });
4305 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->classes, classSym->_import);
4306 }
4307 if(!symbol)
4308 {
4309 symbol = method->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4310 }
4311 if(!symbol->_import)
4312 {
4313 symbol->_import = (struct ClassImport *)__extension__ ({
4314 struct MethodImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_MethodImport);
4315
4316 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(method->name), __ecereInstance1->isVirtual = method->type == 1, __ecereInstance1;
4317 });
4318 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&classSym->_import->methods, symbol->_import);
4319 }
4320 if(!symbol)
4321 {
4322 symbol->type = method->dataType;
4323 if(symbol->type)
4324 symbol->type->refCount++;
4325 }
4326 }
4327 if(!method->dataType->dllExport)
4328 {
4329 imported = 0x1;
4330 if((method->_class->module != privateModule || !strcmp(method->_class->name, "float") || !strcmp(method->_class->name, "double")) && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)method->_class->module + 24)))->importType != 1)
4331 dllImport = 0x1;
4332 }
4333 }
4334 if(method->type != 1 && method->dataType)
4335 DeclareType(method->dataType, 0x1, 0x1);
4336 if(!symbol->pointerExternal || symbol->pointerExternal->type == 0)
4337 {
4338 struct Declaration * decl;
4339 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
4340 struct Declarator * d;
4341 struct Declarator * funcDecl;
4342 struct External * external;
4343
4344 specifiers = MkList();
4345 declarators = MkList();
4346 if(dllImport)
4347 ListAdd(specifiers, MkSpecifier(EXTERN));
4348 else if(method->_class->symbol && ((struct Symbol *)method->_class->symbol)->isStatic)
4349 ListAdd(specifiers, MkSpecifier(STATIC));
4350 if(method->type == 1)
4351 {
4352 ListAdd(specifiers, MkSpecifier(INT));
4353 d = MkDeclaratorIdentifier(MkIdentifier(name));
4354 }
4355 else
4356 {
4357 d = MkDeclaratorIdentifier(MkIdentifier(name));
4358 if(dllImport)
4359 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
4360 {
4361 struct Context * context = SetupTemplatesContext(method->_class);
4362
4363 d = SpecDeclFromString(method->dataTypeString, specifiers, d);
4364 FinishTemplatesContext(context);
4365 }
4366 funcDecl = GetFuncDecl(d);
4367 if(dllImport)
4368 {
4369 struct Specifier * spec, * next;
4370
4371 for(spec = (*specifiers).first; spec; spec = next)
4372 {
4373 next = spec->next;
4374 if(spec->type == 5)
4375 {
4376 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*specifiers), spec);
4377 FreeSpecifier(spec);
4378 }
4379 }
4380 }
4381 if(method->dataType && !method->dataType->staticMethod)
4382 {
4383 if(funcDecl && funcDecl->function.parameters && (*funcDecl->function.parameters).count)
4384 {
4385 struct __ecereNameSpace__ecere__com__Class * _class = method->dataType->thisClass ? method->dataType->thisClass->registered : method->_class;
4386 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")));
4387 struct TypeName * firstParam = ((struct TypeName *)(*funcDecl->function.parameters).first);
4388 struct Specifier * firstSpec = firstParam->qualifiers ? (*firstParam->qualifiers).first : (((void *)0));
4389
4390 if(firstSpec && firstSpec->type == 0 && firstSpec->specifier == VOID && !firstParam->declarator)
4391 {
4392 struct TypeName * param = (*funcDecl->function.parameters).first;
4393
4394 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->function.parameters), param);
4395 FreeTypeName(param);
4396 }
4397 if(!funcDecl->function.parameters)
4398 funcDecl->function.parameters = MkList();
4399 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
4400 }
4401 }
4402 }
4403 ProcessDeclarator(d);
4404 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
4405 decl = MkDeclaration(specifiers, declarators);
4406 ReplaceThisClassSpecifiers(specifiers, method->_class);
4407 if(symbol->pointerExternal)
4408 {
4409 struct Symbol * functionSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4410
4411 {
4412 *functionSymbol = *symbol;
4413 functionSymbol->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
4414 if(functionSymbol->type)
4415 functionSymbol->type->refCount++;
4416 }
4417 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*excludedSymbols), functionSymbol);
4418 symbol->pointerExternal->symbol = functionSymbol;
4419 }
4420 external = MkExternalDeclaration(decl);
4421 if(curExternal)
4422 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal ? curExternal->prev : (((void *)0)), external);
4423 external->symbol = symbol;
4424 symbol->pointerExternal = external;
4425 }
4426 else if(ast)
4427 {
4428 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
4429 }
4430 symbol->id = curExternal ? curExternal->symbol->idCode : (((int)0x7fffffff));
4431 }
4432 }
4433
4434 char * ReplaceThisClass(struct __ecereNameSpace__ecere__com__Class * _class)
4435 {
4436 if(thisClassParams && _class->templateParams.count && !_class->templateClass)
4437 {
4438 unsigned int first = 0x1;
4439 int p = 0;
4440 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
4441 int lastParam = -1;
4442 char className[1024];
4443
4444 strcpy(className, _class->fullName);
4445 for(param = _class->templateParams.first; param; param = param->next)
4446 {
4447 {
4448 if(first)
4449 strcat(className, "<");
4450 if(!first)
4451 strcat(className, ", ");
4452 if(lastParam + 1 != p)
4453 {
4454 strcat(className, param->name);
4455 strcat(className, " = ");
4456 }
4457 strcat(className, param->name);
4458 first = 0x0;
4459 lastParam = p;
4460 }
4461 p++;
4462 }
4463 if(!first)
4464 {
4465 int len = strlen(className);
4466
4467 if(className[len - 1] == '>')
4468 className[len++] = ' ';
4469 className[len++] = '>';
4470 className[len++] = '\0';
4471 }
4472 return __ecereNameSpace__ecere__sys__CopyString(className);
4473 }
4474 else
4475 return __ecereNameSpace__ecere__sys__CopyString(_class->fullName);
4476 }
4477
4478 struct Type * ReplaceThisClassType(struct __ecereNameSpace__ecere__com__Class * _class)
4479 {
4480 if(thisClassParams && _class->templateParams.count && !_class->templateClass)
4481 {
4482 unsigned int first = 0x1;
4483 int p = 0;
4484 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
4485 int lastParam = -1;
4486 char className[1024];
4487
4488 strcpy(className, _class->fullName);
4489 for(param = _class->templateParams.first; param; param = param->next)
4490 {
4491 {
4492 if(first)
4493 strcat(className, "<");
4494 if(!first)
4495 strcat(className, ", ");
4496 if(lastParam + 1 != p)
4497 {
4498 strcat(className, param->name);
4499 strcat(className, " = ");
4500 }
4501 strcat(className, param->name);
4502 first = 0x0;
4503 lastParam = p;
4504 }
4505 p++;
4506 }
4507 if(!first)
4508 {
4509 int len = strlen(className);
4510
4511 if(className[len - 1] == '>')
4512 className[len++] = ' ';
4513 className[len++] = '>';
4514 className[len++] = '\0';
4515 }
4516 return MkClassType(className);
4517 }
4518 else
4519 {
4520 return MkClassType(_class->fullName);
4521 }
4522 }
4523
4524 void ReplaceThisClassSpecifiers(struct __ecereNameSpace__ecere__sys__OldList * specs, struct __ecereNameSpace__ecere__com__Class * _class)
4525 {
4526 if(specs != (((void *)0)) && _class)
4527 {
4528 struct Specifier * spec;
4529
4530 for(spec = specs->first; spec; spec = spec->next)
4531 {
4532 if(spec->type == 0 && spec->specifier == THISCLASS)
4533 {
4534 spec->type = 1;
4535 spec->name = ReplaceThisClass(_class);
4536 spec->symbol = FindClass(spec->name);
4537 }
4538 }
4539 }
4540 }
4541
4542 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__GlobalFunction;
4543
4544 struct __ecereNameSpace__ecere__com__GlobalFunction
4545 {
4546 struct __ecereNameSpace__ecere__com__GlobalFunction * prev;
4547 struct __ecereNameSpace__ecere__com__GlobalFunction * next;
4548 char *  name;
4549 int (*  function)();
4550 struct __ecereNameSpace__ecere__com__Instance * module;
4551 struct __ecereNameSpace__ecere__com__NameSpace *  nameSpace;
4552 char *  dataTypeString;
4553 struct Type * dataType;
4554 void *  symbol;
4555 } __attribute__ ((gcc_struct));
4556
4557 extern struct Context * globalContext;
4558
4559 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_FunctionImport;
4560
4561 struct FunctionImport
4562 {
4563 struct FunctionImport * prev;
4564 struct FunctionImport * next;
4565 char *  name;
4566 } __attribute__ ((gcc_struct));
4567
4568 unsigned int DeclareFunction(struct __ecereNameSpace__ecere__com__GlobalFunction * function, char * name)
4569 {
4570 struct Symbol * symbol = function->symbol;
4571
4572 if(curExternal && (!symbol || symbol->id > curExternal->symbol->idCode))
4573 {
4574 unsigned int imported = 0x0;
4575 unsigned int dllImport = 0x0;
4576
4577 if(!function->dataType)
4578 {
4579 function->dataType = ProcessTypeString(function->dataTypeString, 0x0);
4580 if(!function->dataType->thisClass)
4581 function->dataType->staticMethod = 0x1;
4582 }
4583 if(inCompiler)
4584 {
4585 if(!symbol)
4586 {
4587 struct ModuleImport * module = FindModule(function->module);
4588
4589 symbol = function->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4590 if(module->name)
4591 {
4592 if(!function->dataType->dllExport)
4593 {
4594 symbol->_import = (struct ClassImport *)__extension__ ({
4595 struct FunctionImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_FunctionImport);
4596
4597 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(function->name), __ecereInstance1;
4598 });
4599 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->functions, symbol->_import);
4600 }
4601 }
4602 {
4603 symbol->type = ProcessTypeString(function->dataTypeString, 0x0);
4604 if(!symbol->type->thisClass)
4605 symbol->type->staticMethod = 0x1;
4606 }
4607 }
4608 imported = symbol->_import ? 0x1 : 0x0;
4609 if(imported && function->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType != 1)
4610 dllImport = 0x1;
4611 }
4612 DeclareType(function->dataType, 0x1, 0x1);
4613 if(inCompiler)
4614 {
4615 if(!symbol->pointerExternal || symbol->pointerExternal->type == 0)
4616 {
4617 struct Declaration * decl;
4618 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
4619 struct Declarator * d;
4620 struct Declarator * funcDecl;
4621 struct External * external;
4622
4623 specifiers = MkList();
4624 declarators = MkList();
4625 ListAdd(specifiers, MkSpecifier(EXTERN));
4626 d = MkDeclaratorIdentifier(MkIdentifier(imported ? name : function->name));
4627 if(dllImport)
4628 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
4629 d = SpecDeclFromString(function->dataTypeString, specifiers, d);
4630 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType == 1)
4631 {
4632 struct Specifier * spec;
4633
4634 for(spec = (*specifiers).first; spec; spec = spec->next)
4635 if(spec->type == 5 && spec->extDecl && spec->extDecl->type == 0 && !strcmp(spec->extDecl->s, "dllexport"))
4636 {
4637 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*specifiers), spec);
4638 FreeSpecifier(spec);
4639 break;
4640 }
4641 }
4642 funcDecl = GetFuncDecl(d);
4643 if(funcDecl && !funcDecl->function.parameters)
4644 {
4645 funcDecl->function.parameters = MkList();
4646 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), MkTypeName(MkListOne(MkSpecifier(VOID)), (((void *)0))));
4647 }
4648 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
4649 {
4650 struct Context * oldCtx = curContext;
4651
4652 curContext = globalContext;
4653 decl = MkDeclaration(specifiers, declarators);
4654 curContext = oldCtx;
4655 }
4656 if(symbol->pointerExternal)
4657 {
4658 struct Symbol * functionSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4659
4660 {
4661 *functionSymbol = *symbol;
4662 functionSymbol->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
4663 if(functionSymbol->type)
4664 functionSymbol->type->refCount++;
4665 }
4666 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*excludedSymbols), functionSymbol);
4667 symbol->pointerExternal->symbol = functionSymbol;
4668 }
4669 external = MkExternalDeclaration(decl);
4670 if(curExternal)
4671 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
4672 external->symbol = symbol;
4673 symbol->pointerExternal = external;
4674 }
4675 else
4676 {
4677 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
4678 }
4679 if(curExternal)
4680 symbol->id = curExternal->symbol->idCode;
4681 }
4682 }
4683 return (symbol && symbol->_import && function->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType != 1) ? 0x1 : 0x0;
4684 }
4685
4686 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_GlobalData;
4687
4688 struct GlobalData
4689 {
4690 uintptr_t key;
4691 struct __ecereNameSpace__ecere__sys__BTNode * parent;
4692 struct __ecereNameSpace__ecere__sys__BTNode * left;
4693 struct __ecereNameSpace__ecere__sys__BTNode * right;
4694 int depth;
4695 struct __ecereNameSpace__ecere__com__Instance * module;
4696 char *  dataTypeString;
4697 struct Type * dataType;
4698 void *  symbol;
4699 char *  fullName;
4700 } __attribute__ ((gcc_struct));
4701
4702 void DeclareGlobalData(struct GlobalData * data)
4703 {
4704 struct Symbol * symbol = data->symbol;
4705
4706 if(curExternal && (!symbol || symbol->id > curExternal->symbol->idCode))
4707 {
4708 if(inCompiler)
4709 {
4710 if(!symbol)
4711 symbol = data->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4712 }
4713 if(!data->dataType)
4714 data->dataType = ProcessTypeString(data->dataTypeString, 0x0);
4715 DeclareType(data->dataType, 0x1, 0x1);
4716 if(inCompiler)
4717 {
4718 if(!symbol->pointerExternal)
4719 {
4720 struct Declaration * decl;
4721 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
4722 struct Declarator * d;
4723 struct External * external;
4724
4725 specifiers = MkList();
4726 declarators = MkList();
4727 ListAdd(specifiers, MkSpecifier(EXTERN));
4728 d = MkDeclaratorIdentifier(MkIdentifier(data->fullName));
4729 d = SpecDeclFromString(data->dataTypeString, specifiers, d);
4730 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
4731 decl = MkDeclaration(specifiers, declarators);
4732 external = MkExternalDeclaration(decl);
4733 if(curExternal)
4734 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
4735 external->symbol = symbol;
4736 symbol->pointerExternal = external;
4737 }
4738 else
4739 {
4740 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
4741 }
4742 if(curExternal)
4743 symbol->id = curExternal->symbol->idCode;
4744 }
4745 }
4746 }
4747
4748 struct Conversion
4749 {
4750 struct Conversion * prev, * next;
4751 struct __ecereNameSpace__ecere__com__Property * convert;
4752 unsigned int isGet;
4753 struct Type * resultType;
4754 } __attribute__ ((gcc_struct));
4755
4756 static struct __ecereNameSpace__ecere__com__Class * __ecereClass_Conversion;
4757
4758 extern void Compiler_Warning(char *  format, ...);
4759
4760 void PrintType(struct Type * type, char *  string, unsigned int printName, unsigned int fullName);
4761
4762 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)
4763 {
4764 if(source && dest)
4765 {
4766 if(source->kind == 20 && dest->kind != 20)
4767 {
4768 struct Type * type = ProcessTemplateParameterType(source->templateParameter);
4769
4770 if(type)
4771 source = type;
4772 }
4773 if(dest->kind == 20 && source->kind != 20)
4774 {
4775 struct Type * type = ProcessTemplateParameterType(dest->templateParameter);
4776
4777 if(type)
4778 dest = type;
4779 }
4780 if(dest->classObjectType == 2)
4781 {
4782 if(source->classObjectType != 3)
4783 return 0x1;
4784 else
4785 {
4786 if((dest->_class && strcmp(dest->_class->string, "class")) || (source->_class && strcmp(source->_class->string, "class")))
4787 {
4788 return 0x1;
4789 }
4790 }
4791 }
4792 else
4793 {
4794 if(source->classObjectType == 3)
4795 return 0x1;
4796 if(dest->classObjectType == 3 && source->classObjectType != 2)
4797 return 0x1;
4798 }
4799 if((dest->kind == 9 && source->kind == 9) || (dest->kind == 10 && source->kind == 10))
4800 {
4801 if((dest->enumName && source->enumName && !strcmp(dest->enumName, source->enumName)) || (source->members.first && source->members.first == dest->members.first))
4802 return 0x1;
4803 }
4804 if(dest->kind == 14 && source->kind != 0)
4805 return 0x1;
4806 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))
4807 return 0x1;
4808 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))
4809 return 0x1;
4810 if(((source->kind == 8 && dest->kind == 8) || (source->kind == 19 && dest->kind == 19)) && source->_class)
4811 {
4812 if(source->_class->registered && source->_class->registered->type == 3)
4813 {
4814 if(conversions != (((void *)0)))
4815 {
4816 if(source->_class->registered == dest->_class->registered)
4817 return 0x1;
4818 }
4819 else
4820 {
4821 struct __ecereNameSpace__ecere__com__Class * sourceBase, * destBase;
4822
4823 for(sourceBase = source->_class->registered; sourceBase && sourceBase->base->type != 1000; sourceBase = sourceBase->base)
4824 ;
4825 for(destBase = dest->_class->registered; destBase && destBase->base->type != 1000; destBase = destBase->base)
4826 ;
4827 if(sourceBase == destBase)
4828 return 0x1;
4829 }
4830 }
4831 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))
4832 return 0x1;
4833 else
4834 {
4835 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))
4836 {
4837 if(__ecereNameSpace__ecere__com__eClass_IsDerived(dest->_class->registered, source->_class->registered))
4838 {
4839 return 0x1;
4840 }
4841 }
4842 }
4843 }
4844 if(source->kind == 19 && dest->kind == 8 && dest->_class && !strcmp(dest->_class->string, "ecere::com::Class"))
4845 return 0x1;
4846 if(doConversion)
4847 {
4848 if(source->kind == 8)
4849 {
4850 struct __ecereNameSpace__ecere__com__Class * _class;
4851
4852 for(_class = source->_class ? source->_class->registered : (((void *)0)); _class; _class = _class->base)
4853 {
4854 struct __ecereNameSpace__ecere__com__Property * convert;
4855
4856 for(convert = _class->conversions.first; convert; convert = convert->next)
4857 {
4858 if(convert->memberAccess == 1 || _class->module == privateModule)
4859 {
4860 struct Conversion * after = (conversions != (((void *)0))) ? conversions->last : (((void *)0));
4861
4862 if(!convert->dataType)
4863 convert->dataType = ProcessTypeString(convert->dataTypeString, 0x0);
4864 if(MatchTypes(convert->dataType, dest, conversions, (((void *)0)), (((void *)0)), 0x0, 0x1, 0x0, 0x1))
4865 {
4866 if(!conversions && !convert->Get)
4867 return 0x1;
4868 else if(conversions != (((void *)0)))
4869 {
4870 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))
4871 return 0x1;
4872 else
4873 {
4874 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv->isGet = 0x1, conv);
4875
4876 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(conversions, after, conv);
4877 return 0x1;
4878 }
4879 }
4880 }
4881 }
4882 }
4883 }
4884 }
4885 if(dest->kind == 8)
4886 {
4887 struct __ecereNameSpace__ecere__com__Class * _class;
4888
4889 for(_class = dest->_class ? dest->_class->registered : (((void *)0)); _class; _class = _class->base)
4890 {
4891 struct __ecereNameSpace__ecere__com__Property * convert;
4892
4893 for(convert = _class->conversions.first; convert; convert = convert->next)
4894 {
4895 if(convert->memberAccess == 1 || _class->module == privateModule)
4896 {
4897 if(!convert->dataType)
4898 convert->dataType = ProcessTypeString(convert->dataTypeString, 0x0);
4899 if(convert->dataType != dest && MatchTypes(source, convert->dataType, conversions, (((void *)0)), (((void *)0)), 0x1, 0x0, 0x0, 0x1))
4900 {
4901 if(!conversions && !convert->Set)
4902 return 0x1;
4903 else if(conversions != (((void *)0)))
4904 {
4905 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))
4906 return 0x1;
4907 else
4908 {
4909 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv);
4910
4911 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(conversions, conv);
4912 return 0x1;
4913 }
4914 }
4915 }
4916 }
4917 }
4918 }
4919 if(enumBaseType && dest->_class && dest->_class->registered && dest->_class->registered->type == 4)
4920 {
4921 if(!dest->_class->registered->dataType)
4922 dest->_class->registered->dataType = ProcessTypeString(dest->_class->registered->dataTypeString, 0x0);
4923 if(dest->_class->registered->dataType->kind == 8 || source->truth || dest->truth)
4924 {
4925 if(MatchTypes(source, dest->_class->registered->dataType, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
4926 {
4927 return 0x1;
4928 }
4929 }
4930 }
4931 }
4932 if(source->kind == 8)
4933 {
4934 struct __ecereNameSpace__ecere__com__Class * _class;
4935
4936 for(_class = source->_class ? source->_class->registered : (((void *)0)); _class; _class = _class->base)
4937 {
4938 struct __ecereNameSpace__ecere__com__Property * convert;
4939
4940 for(convert = _class->conversions.first; convert; convert = convert->next)
4941 {
4942 if(convert->memberAccess == 1 || _class->module == privateModule)
4943 {
4944 struct Conversion * after = (conversions != (((void *)0))) ? conversions->last : (((void *)0));
4945
4946 if(!convert->dataType)
4947 convert->dataType = ProcessTypeString(convert->dataTypeString, 0x0);
4948 if(convert->dataType != source && MatchTypes(convert->dataType, dest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x1))
4949 {
4950 if(!conversions && !convert->Get)
4951 return 0x1;
4952 else if(conversions != (((void *)0)))
4953 {
4954 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))
4955 return 0x1;
4956 else
4957 {
4958 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv->isGet = 0x1, conv);
4959
4960 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(conversions, after, conv);
4961 return 0x1;
4962 }
4963 }
4964 }
4965 }
4966 }
4967 }
4968 if(enumBaseType && source->_class && source->_class->registered && source->_class->registered->type == 4)
4969 {
4970 if(!source->_class->registered->dataType)
4971 source->_class->registered->dataType = ProcessTypeString(source->_class->registered->dataTypeString, 0x0);
4972 if(MatchTypes(source->_class->registered->dataType, dest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
4973 {
4974 return 0x1;
4975 }
4976 }
4977 }
4978 }
4979 if(source->kind == 8 || source->kind == 19)
4980 ;
4981 else if(dest->kind == source->kind && (dest->kind != 9 && dest->kind != 10 && dest->kind != 11 && dest->kind != 12 && dest->kind != 13 && dest->kind != 16))
4982 return 0x1;
4983 else if(dest->kind == 7 && source->kind == 6)
4984 return 0x1;
4985 else if(dest->kind == 2 && (source->kind == 1 || source->kind == 24))
4986 return 0x1;
4987 else if(dest->kind == 3 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 23))
4988 return 0x1;
4989 else if(dest->kind == 4 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 3 || source->kind == 22 || source->kind == 23))
4990 return 0x1;
4991 else if(dest->kind == 22 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 3 || source->kind == 23 || source->kind == 4))
4992 return 0x1;
4993 else if(dest->kind == 23 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 3 || source->kind == 4 || source->kind == 22))
4994 return 0x1;
4995 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))
4996 return 0x1;
4997 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))
4998 return 0x1;
4999 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)))
5000 {
5001 struct Type * paramSource, * paramDest;
5002
5003 if(dest->kind == 16)
5004 owningClassDest = dest->methodClass ? dest->methodClass : dest->method->_class;
5005 if(source->kind == 16)
5006 owningClassSource = source->methodClass ? source->methodClass : source->method->_class;
5007 if(dest->kind == 13 && dest->type->kind == 11)
5008 dest = dest->type;
5009 if(source->kind == 13 && source->type->kind == 11)
5010 source = source->type;
5011 if(dest->kind == 16)
5012 dest = dest->method->dataType;
5013 if(source->kind == 16)
5014 source = source->method->dataType;
5015 paramSource = source->params.first;
5016 if(paramSource && paramSource->kind == 0)
5017 paramSource = (((void *)0));
5018 paramDest = dest->params.first;
5019 if(paramDest && paramDest->kind == 0)
5020 paramDest = (((void *)0));
5021 if((dest->staticMethod || (!dest->thisClass && !owningClassDest)) && !(source->staticMethod || (!source->thisClass && !owningClassSource)))
5022 {
5023 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))))
5024 {
5025 if(paramDest && paramDest->kind == 8)
5026 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "method class must be derived from %s\n", (((void *)0))), paramDest->_class->string);
5027 else
5028 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "method class should not take an object\n", (((void *)0))));
5029 return 0x0;
5030 }
5031 paramDest = paramDest->next;
5032 }
5033 else if(!dest->staticMethod && (dest->thisClass || owningClassDest))
5034 {
5035 if((source->staticMethod || (!source->thisClass && !owningClassSource)))
5036 {
5037 if(dest->thisClass)
5038 {
5039 if(!paramSource || paramSource->kind != 8 || !__ecereNameSpace__ecere__com__eClass_IsDerived(paramSource->_class->registered, dest->thisClass->registered))
5040 {
5041 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "method class must be derived from %s\n", (((void *)0))), dest->thisClass->string);
5042 return 0x0;
5043 }
5044 }
5045 else
5046 {
5047 if(!paramSource || paramSource->kind != 8 || (owningClassDest && !__ecereNameSpace__ecere__com__eClass_IsDerived(paramSource->_class->registered, owningClassDest)))
5048 {
5049 if(owningClassDest)
5050 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "%s expected to be derived from method class\n", (((void *)0))), owningClassDest->fullName);
5051 else
5052 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "overriding class expected to be derived from method class\n", (((void *)0))));
5053 return 0x0;
5054 }
5055 }
5056 paramSource = paramSource->next;
5057 }
5058 else
5059 {
5060 if(dest->thisClass)
5061 {
5062 if(!__ecereNameSpace__ecere__com__eClass_IsDerived(source->thisClass ? source->thisClass->registered : owningClassSource, dest->thisClass->registered))
5063 {
5064 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "method class must be derived from %s\n", (((void *)0))), dest->thisClass->string);
5065 return 0x0;
5066 }
5067 }
5068 else
5069 {
5070 if(source->thisClass && source->thisClass->registered && owningClassDest && !__ecereNameSpace__ecere__com__eClass_IsDerived(source->thisClass->registered, owningClassDest))
5071 {
5072 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "%s expected to be derived from method class\n", (((void *)0))), source->thisClass->registered->fullName);
5073 return 0x0;
5074 }
5075 }
5076 }
5077 }
5078 if(!MatchTypes(source->returnType, dest->returnType, (((void *)0)), (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
5079 {
5080 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible return type for function\n", (((void *)0))));
5081 return 0x0;
5082 }
5083 for(; paramDest; paramDest = paramDest->next)
5084 {
5085 if(!paramSource)
5086 {
5087 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "not enough parameters\n", (((void *)0))));
5088 return 0x0;
5089 }
5090 {
5091 struct Type * paramDestType = paramDest;
5092 struct Type * paramSourceType = paramSource;
5093 struct Type * type = paramDestType;
5094
5095 if(paramDest->kind == 20 && paramDest->templateParameter->type == 0 && owningClassSource && paramSource->kind != 20)
5096 {
5097 int id = 0;
5098 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
5099 struct __ecereNameSpace__ecere__com__Class * sClass;
5100
5101 for(sClass = owningClassSource; sClass; sClass = sClass->base)
5102 {
5103 id = 0;
5104 if(sClass->templateClass)
5105 sClass = sClass->templateClass;
5106 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
5107 {
5108 if(curParam->type == 0 && !strcmp(type->templateParameter->identifier->string, curParam->name))
5109 {
5110 for(sClass = sClass->base; sClass; sClass = sClass->base)
5111 {
5112 if(sClass->templateClass)
5113 sClass = sClass->templateClass;
5114 id += sClass->templateParams.count;
5115 }
5116 break;
5117 }
5118 id++;
5119 }
5120 if(curParam)
5121 break;
5122 }
5123 if(curParam)
5124 {
5125 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = owningClassSource->templateArgs[id];
5126
5127 paramDestType = type = ProcessTypeString(arg.dataTypeString, 0x0);
5128 }
5129 }
5130 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)))
5131 {
5132 char type[1024];
5133
5134 type[0] = (char)0;
5135 PrintType(paramDest, type, 0x0, 0x1);
5136 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible parameter %s (expected %s)\n", (((void *)0))), paramSource->name, type);
5137 if(paramDestType != paramDest)
5138 FreeType(paramDestType);
5139 return 0x0;
5140 }
5141 if(paramDestType != paramDest)
5142 FreeType(paramDestType);
5143 }
5144 paramSource = paramSource->next;
5145 }
5146 if(paramSource)
5147 {
5148 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "too many parameters\n", (((void *)0))));
5149 return 0x0;
5150 }
5151 return 0x1;
5152 }
5153 else if((dest->kind == 11 || (dest->kind == 13 && dest->type->kind == 11) || dest->kind == 16) && (source->kind == 13 && source->type->kind == 0))
5154 {
5155 return 0x1;
5156 }
5157 else if((dest->kind == 13 || dest->kind == 12) && (source->kind == 12 || source->kind == 13))
5158 {
5159 if(MatchTypes(source->type, dest->type, (((void *)0)), (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
5160 return 0x1;
5161 }
5162 }
5163 return 0x0;
5164 }
5165
5166 static void FreeConvert(struct Conversion * convert)
5167 {
5168 if(convert->resultType)
5169 FreeType(convert->resultType);
5170 }
5171
5172 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__BTNamedLink;
5173
5174 struct __ecereNameSpace__ecere__com__BTNamedLink
5175 {
5176 char *  name;
5177 struct __ecereNameSpace__ecere__com__BTNamedLink * parent;
5178 struct __ecereNameSpace__ecere__com__BTNamedLink * left;
5179 struct __ecereNameSpace__ecere__com__BTNamedLink * right;
5180 int depth;
5181 void *  data;
5182 } __attribute__ ((gcc_struct));
5183
5184 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__EnumClassData;
5185
5186 struct __ecereNameSpace__ecere__com__EnumClassData
5187 {
5188 struct __ecereNameSpace__ecere__sys__OldList values;
5189 int largest;
5190 } __attribute__ ((gcc_struct));
5191
5192 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__NamedLink;
5193
5194 struct __ecereNameSpace__ecere__sys__NamedLink
5195 {
5196 struct __ecereNameSpace__ecere__sys__NamedLink * prev;
5197 struct __ecereNameSpace__ecere__sys__NamedLink * next;
5198 char *  name;
5199 void *  data;
5200 } __attribute__ ((gcc_struct));
5201
5202 extern void FreeExpContents(struct Expression * exp);
5203
5204 struct __ecereNameSpace__ecere__sys__BTNode * __ecereProp___ecereNameSpace__ecere__sys__BinaryTree_Get_first(struct __ecereNameSpace__ecere__sys__BinaryTree * this);
5205
5206 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp___ecereNameSpace__ecere__sys__BinaryTree_first;
5207
5208 struct __ecereNameSpace__ecere__sys__BTNode * __ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_next(struct __ecereNameSpace__ecere__sys__BTNode * this);
5209
5210 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp___ecereNameSpace__ecere__sys__BTNode_next;
5211
5212 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(struct __ecereNameSpace__ecere__sys__OldList * this, void (*  freeFn)(void * ));
5213
5214 unsigned int MatchWithEnums_NameSpace(struct __ecereNameSpace__ecere__com__NameSpace * nameSpace, struct Expression * sourceExp, struct Type * dest, char * string, struct __ecereNameSpace__ecere__sys__OldList * conversions)
5215 {
5216 struct __ecereNameSpace__ecere__com__BTNamedLink * link;
5217
5218 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)))
5219 {
5220 struct __ecereNameSpace__ecere__com__Class * _class = link->data;
5221
5222 if(_class->type == 4)
5223 {
5224 struct __ecereNameSpace__ecere__sys__OldList converts = 
5225 {
5226 0, 0, 0, 0, 0
5227 };
5228 struct Type * type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5229
5230 type->kind = 8;
5231 if(!_class->symbol)
5232 _class->symbol = FindClass(_class->fullName);
5233 type->_class = _class->symbol;
5234 if(MatchTypes(type, dest, &converts, (((void *)0)), (((void *)0)), 0x1, 0x0, 0x0, 0x0))
5235 {
5236 struct __ecereNameSpace__ecere__sys__NamedLink * value;
5237 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
5238
5239 if(enumClass)
5240 {
5241 struct __ecereNameSpace__ecere__com__Class * baseClass;
5242
5243 for(baseClass = _class; baseClass && baseClass->type == 4; baseClass = baseClass->base)
5244 {
5245 struct __ecereNameSpace__ecere__com__EnumClassData * e = (baseClass ? ((void *)(((char *)baseClass->data) + enumClass->offsetClass)) : (((void *)0)));
5246
5247 for(value = e->values.first; value; value = value->next)
5248 {
5249 if(!strcmp(value->name, string))
5250 break;
5251 }
5252 if(value)
5253 {
5254 FreeExpContents(sourceExp);
5255 FreeType(sourceExp->expType);
5256 sourceExp->isConstant = 0x1;
5257 sourceExp->expType = MkClassType(baseClass->fullName);
5258 {
5259 char constant[256];
5260
5261 sourceExp->type = 2;
5262 if(!strcmp(baseClass->dataTypeString, "int"))
5263 sprintf(constant, "%d", (int)value->data);
5264 else
5265 sprintf(constant, "0x%X", (int)value->data);
5266 sourceExp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
5267 }
5268 while(converts.first)
5269 {
5270 struct Conversion * convert = converts.first;
5271
5272 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(&converts, convert);
5273 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(conversions, convert);
5274 }
5275 ((type ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(type) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(type)) : 0), type = 0);
5276 return 0x1;
5277 }
5278 }
5279 }
5280 }
5281 if(converts.first)
5282 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(&converts, FreeConvert);
5283 ((type ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(type) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(type)) : 0), type = 0);
5284 }
5285 }
5286 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)))
5287 if(MatchWithEnums_NameSpace(nameSpace, sourceExp, dest, string, conversions))
5288 return 0x1;
5289 return 0x0;
5290 }
5291
5292 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__SubModule;
5293
5294 struct __ecereNameSpace__ecere__com__SubModule
5295 {
5296 struct __ecereNameSpace__ecere__com__SubModule * prev;
5297 struct __ecereNameSpace__ecere__com__SubModule * next;
5298 struct __ecereNameSpace__ecere__com__Instance * module;
5299 int importMode;
5300 } __attribute__ ((gcc_struct));
5301
5302 unsigned int ModuleVisibility(struct __ecereNameSpace__ecere__com__Instance * searchIn, struct __ecereNameSpace__ecere__com__Instance * searchFor)
5303 {
5304 struct __ecereNameSpace__ecere__com__SubModule * subModule;
5305
5306 if(searchFor == searchIn)
5307 return 0x1;
5308 for(subModule = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)searchIn + structSize_Instance)))->modules.first; subModule; subModule = subModule->next)
5309 {
5310 if(subModule->importMode == 1 || searchIn == ((struct __ecereNameSpace__ecere__com__Module *)(((char *)searchIn + structSize_Instance)))->application)
5311 {
5312 if(ModuleVisibility(subModule->module, searchFor))
5313 return 0x1;
5314 }
5315 }
5316 return 0x0;
5317 }
5318
5319 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Application;
5320
5321 struct __ecereNameSpace__ecere__com__Application
5322 {
5323 int argc;
5324 char * *  argv;
5325 int exitCode;
5326 unsigned int isGUIApp;
5327 struct __ecereNameSpace__ecere__sys__OldList allModules;
5328 char *  parsedCommand;
5329 struct __ecereNameSpace__ecere__com__NameSpace systemNameSpace;
5330 } __attribute__ ((gcc_struct));
5331
5332 unsigned int MatchWithEnums_Module(struct __ecereNameSpace__ecere__com__Instance * mainModule, struct Expression * sourceExp, struct Type * dest, char * string, struct __ecereNameSpace__ecere__sys__OldList * conversions)
5333 {
5334 struct __ecereNameSpace__ecere__com__Instance * module;
5335
5336 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))
5337 return 0x1;
5338 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))
5339 return 0x1;
5340 if(MatchWithEnums_NameSpace(&((struct __ecereNameSpace__ecere__com__Module *)(((char *)((struct __ecereNameSpace__ecere__com__Module *)(((char *)mainModule + structSize_Instance)))->application + structSize_Instance)))->publicNameSpace, sourceExp, dest, string, conversions))
5341 return 0x1;
5342 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)
5343 {
5344 if(ModuleVisibility(mainModule, module) && MatchWithEnums_NameSpace(&((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->publicNameSpace, sourceExp, dest, string, conversions))
5345 return 0x1;
5346 }
5347 return 0x0;
5348 }
5349
5350 extern unsigned long strtoul(const char *  nptr, char * *  endptr, int base);
5351
5352 void ReadString(char *  output, char *  string);
5353
5354 extern struct Specifier * MkEnum(struct Identifier * id, struct __ecereNameSpace__ecere__sys__OldList * list);
5355
5356 extern struct TypeName * QMkClass(char *  spec, struct Declarator * decl);
5357
5358 extern struct Expression * MkExpBrackets(struct __ecereNameSpace__ecere__sys__OldList * expressions);
5359
5360 unsigned int MatchTypeExpression(struct Expression * sourceExp, struct Type * dest, struct __ecereNameSpace__ecere__sys__OldList * conversions, unsigned int skipUnitBla)
5361 {
5362 struct Type * source = sourceExp->expType;
5363 struct Type * realDest = dest;
5364 struct Type * backupSourceExpType = (((void *)0));
5365
5366 if(dest->kind == 13 && sourceExp->type == 2 && !strtoul(sourceExp->constant, (((void *)0)), 0))
5367 return 0x1;
5368 if(!skipUnitBla && source && dest && source->kind == 8 && dest->kind == 8)
5369 {
5370 if(source->_class && source->_class->registered && source->_class->registered->type == 3)
5371 {
5372 struct __ecereNameSpace__ecere__com__Class * sourceBase, * destBase;
5373
5374 for(sourceBase = source->_class->registered; sourceBase && sourceBase->base && sourceBase->base->type != 1000; sourceBase = sourceBase->base)
5375 ;
5376 for(destBase = dest->_class->registered; destBase && destBase->base && destBase->base->type != 1000; destBase = destBase->base)
5377 ;
5378 if(sourceBase == destBase)
5379 return 0x1;
5380 }
5381 }
5382 if(source)
5383 {
5384 struct __ecereNameSpace__ecere__sys__OldList * specs;
5385 unsigned int flag = 0x0;
5386 long long value = (((int)0x7fffffff));
5387
5388 source->refCount++;
5389 dest->refCount++;
5390 if(sourceExp->type == 2)
5391 {
5392 if(source->isSigned)
5393 value = strtoll(sourceExp->constant, (((void *)0)), 0);
5394 else
5395 value = strtoull(sourceExp->constant, (((void *)0)), 0);
5396 }
5397 else if(sourceExp->type == 4 && sourceExp->op.op == '-' && !sourceExp->op.exp1 && sourceExp->op.exp2 && sourceExp->op.exp2->type == 2)
5398 {
5399 if(source->isSigned)
5400 value = -strtoll(sourceExp->op.exp2->constant, (((void *)0)), 0);
5401 else
5402 value = -strtoull(sourceExp->op.exp2->constant, (((void *)0)), 0);
5403 }
5404 if(dest->kind != 8 && source->kind == 8 && source->_class && source->_class->registered && !strcmp(source->_class->registered->fullName, "ecere::com::unichar"))
5405 {
5406 FreeType(source);
5407 source = __extension__ ({
5408 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5409
5410 __ecereInstance1->kind = 3, __ecereInstance1->isSigned = 0x0, __ecereInstance1->refCount = 1, __ecereInstance1;
5411 });
5412 }
5413 if(dest->kind == 8)
5414 {
5415 struct __ecereNameSpace__ecere__com__Class * _class = dest->_class ? dest->_class->registered : (((void *)0));
5416
5417 if(_class && _class->type == 3)
5418 {
5419 if(source->kind != 8)
5420 {
5421 struct Type * tempType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5422 struct Type * tempDest, * tempSource;
5423
5424 for(; _class->base->type != 1000; _class = _class->base)
5425 ;
5426 tempSource = dest;
5427 tempDest = tempType;
5428 tempType->kind = 8;
5429 if(!_class->symbol)
5430 _class->symbol = FindClass(_class->fullName);
5431 tempType->_class = _class->symbol;
5432 tempType->truth = dest->truth;
5433 if(tempType->_class)
5434 MatchTypes(tempSource, tempDest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0);
5435 backupSourceExpType = sourceExp->expType;
5436 sourceExp->expType = dest;
5437 dest->refCount++;
5438 flag = 0x1;
5439 ((tempType ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(tempType) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(tempType)) : 0), tempType = 0);
5440 }
5441 }
5442 if(_class && _class->type == 2 && source->kind != 8)
5443 {
5444 if(!dest->_class->registered->dataType)
5445 dest->_class->registered->dataType = ProcessTypeString(dest->_class->registered->dataTypeString, 0x0);
5446 if(MatchTypes(source, dest->_class->registered->dataType, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
5447 {
5448 FreeType(source);
5449 FreeType(sourceExp->expType);
5450 source = sourceExp->expType = MkClassType(dest->_class->string);
5451 source->refCount++;
5452 }
5453 }
5454 if(_class && !strcmp(_class->fullName, "ecere::com::Class") && source->kind == 13 && source->type && source->type->kind == 1 && sourceExp->type == 3)
5455 {
5456 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
5457 struct Declarator * decl;
5458 char string[1024];
5459
5460 ReadString(string, sourceExp->string);
5461 decl = SpecDeclFromString(string, specs, (((void *)0)));
5462 FreeExpContents(sourceExp);
5463 FreeType(sourceExp->expType);
5464 sourceExp->type = 24;
5465 sourceExp->_classExp.specifiers = specs;
5466 sourceExp->_classExp.decl = decl;
5467 sourceExp->expType = dest;
5468 dest->refCount++;
5469 FreeType(source);
5470 FreeType(dest);
5471 if(backupSourceExpType)
5472 FreeType(backupSourceExpType);
5473 return 0x1;
5474 }
5475 }
5476 else if(source->kind == 8)
5477 {
5478 struct __ecereNameSpace__ecere__com__Class * _class = source->_class ? source->_class->registered : (((void *)0));
5479
5480 if(_class && (_class->type == 3 || !strcmp(_class->fullName, "bool") || _class->type == 2))
5481 {
5482 if(dest->kind != 8)
5483 {
5484 struct Type * tempType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5485 struct Type * tempDest, * tempSource;
5486
5487 if(!source->_class->registered->dataType)
5488 source->_class->registered->dataType = ProcessTypeString(source->_class->registered->dataTypeString, 0x0);
5489 for(; _class->base->type != 1000; _class = _class->base)
5490 ;
5491 tempDest = source;
5492 tempSource = tempType;
5493 tempType->kind = 8;
5494 tempType->_class = FindClass(_class->fullName);
5495 tempType->truth = source->truth;
5496 tempType->classObjectType = source->classObjectType;
5497 if(tempType->_class)
5498 MatchTypes(tempSource, tempDest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0);
5499 if(conversions->last)
5500 {
5501 ((struct Conversion *)conversions->last)->resultType = dest;
5502 dest->refCount++;
5503 }
5504 FreeType(sourceExp->expType);
5505 sourceExp->expType = MkClassType(_class->fullName);
5506 sourceExp->expType->truth = source->truth;
5507 sourceExp->expType->classObjectType = source->classObjectType;
5508 if(!sourceExp->destType)
5509 {
5510 FreeType(sourceExp->destType);
5511 sourceExp->destType = sourceExp->expType;
5512 if(sourceExp->expType)
5513 sourceExp->expType->refCount++;
5514 }
5515 if(!_class->dataType)
5516 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
5517 FreeType(dest);
5518 dest = MkClassType(source->_class->string);
5519 dest->truth = source->truth;
5520 dest->classObjectType = source->classObjectType;
5521 FreeType(source);
5522 source = _class->dataType;
5523 source->refCount++;
5524 ((tempType ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(tempType) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(tempType)) : 0), tempType = 0);
5525 }
5526 }
5527 }
5528 if(!flag)
5529 {
5530 if(MatchTypes(source, dest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
5531 {
5532 FreeType(source);
5533 FreeType(dest);
5534 return 0x1;
5535 }
5536 }
5537 if(dest->kind == 8)
5538 {
5539 struct __ecereNameSpace__ecere__com__Class * _class = dest->_class ? dest->_class->registered : (((void *)0));
5540
5541 if(_class && !dest->truth && (_class->type == 3 || !strcmp(_class->fullName, "bool") || (_class->type != 1 && !value && source->kind == 3) || _class->type == 2))
5542 {
5543 if(_class->type == 0 || _class->type == 5)
5544 {
5545 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
5546
5547 *newExp = *sourceExp;
5548 if(sourceExp->destType)
5549 sourceExp->destType->refCount++;
5550 if(sourceExp->expType)
5551 sourceExp->expType->refCount++;
5552 sourceExp->type = 11;
5553 sourceExp->cast.typeName = MkTypeName(MkListOne(MkSpecifier(VOID)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0))));
5554 sourceExp->cast.exp = newExp;
5555 FreeType(sourceExp->expType);
5556 sourceExp->expType = (((void *)0));
5557 ProcessExpressionType(sourceExp);
5558 if(!inCompiler)
5559 {
5560 FreeType(sourceExp->expType);
5561 sourceExp->expType = dest;
5562 }
5563 FreeType(source);
5564 if(inCompiler)
5565 FreeType(dest);
5566 if(backupSourceExpType)
5567 FreeType(backupSourceExpType);
5568 return 0x1;
5569 }
5570 if(!_class->dataType)
5571 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
5572 FreeType(dest);
5573 dest = _class->dataType;
5574 dest->refCount++;
5575 }
5576 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))
5577 {
5578 specs = MkListOne(MkSpecifier(DOUBLE));
5579 }
5580 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))
5581 {
5582 specs = MkListOne(MkSpecifier(FLOAT));
5583 }
5584 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))
5585 {
5586 specs = MkList();
5587 if(!dest->isSigned)
5588 ListAdd(specs, MkSpecifier(UNSIGNED));
5589 ListAdd(specs, MkSpecifier(INT64));
5590 }
5591 else if(dest->kind == 3 && (source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 6 || source->kind == 7))
5592 {
5593 specs = MkList();
5594 if(!dest->isSigned)
5595 ListAdd(specs, MkSpecifier(UNSIGNED));
5596 ListAdd(specs, MkSpecifier(INT));
5597 }
5598 else if(dest->kind == 2 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 3 || source->kind == 6 || source->kind == 7))
5599 {
5600 specs = MkList();
5601 if(!dest->isSigned)
5602 ListAdd(specs, MkSpecifier(UNSIGNED));
5603 ListAdd(specs, MkSpecifier(SHORT));
5604 }
5605 else if(dest->kind == 1 && (source->kind == 1 || source->kind == 24 || source->kind == 2 || source->kind == 3 || source->kind == 6 || source->kind == 7))
5606 {
5607 specs = MkList();
5608 if(!dest->isSigned)
5609 ListAdd(specs, MkSpecifier(UNSIGNED));
5610 ListAdd(specs, MkSpecifier(CHAR));
5611 }
5612 else
5613 {
5614 FreeType(source);
5615 FreeType(dest);
5616 if(backupSourceExpType)
5617 {
5618 if(sourceExp->expType)
5619 FreeType(sourceExp->expType);
5620 sourceExp->expType = backupSourceExpType;
5621 }
5622 return 0x0;
5623 }
5624 }
5625 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))
5626 {
5627 specs = MkListOne(MkSpecifier(DOUBLE));
5628 }
5629 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))
5630 {
5631 specs = MkListOne(MkSpecifier(FLOAT));
5632 }
5633 else if(dest->kind == 24 && (source->kind == 24 || source->kind == 1 || source->kind == 15 || source->kind == 2 || source->kind == 3) && (value == 1 || value == 0))
5634 {
5635 specs = MkList();
5636 ListAdd(specs, MkSpecifier(BOOL));
5637 }
5638 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)))
5639 {
5640 specs = MkList();
5641 if(!dest->isSigned)
5642 ListAdd(specs, MkSpecifier(UNSIGNED));
5643 ListAdd(specs, MkSpecifier(CHAR));
5644 }
5645 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)))))
5646 {
5647 specs = MkList();
5648 if(!dest->isSigned)
5649 ListAdd(specs, MkSpecifier(UNSIGNED));
5650 ListAdd(specs, MkSpecifier(SHORT));
5651 }
5652 else if(dest->kind == 3 && (source->kind == 15 || source->kind == 2 || source->kind == 24 || source->kind == 1 || source->kind == 3))
5653 {
5654 specs = MkList();
5655 if(!dest->isSigned)
5656 ListAdd(specs, MkSpecifier(UNSIGNED));
5657 ListAdd(specs, MkSpecifier(INT));
5658 }
5659 else if(dest->kind == 4 && (source->kind == 15 || source->kind == 2 || source->kind == 24 || source->kind == 1 || source->kind == 3 || source->kind == 4))
5660 {
5661 specs = MkList();
5662 if(!dest->isSigned)
5663 ListAdd(specs, MkSpecifier(UNSIGNED));
5664 ListAdd(specs, MkSpecifier(INT64));
5665 }
5666 else if(dest->kind == 15 && (source->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 24 || source->kind == 1))
5667 {
5668 specs = MkListOne(MkEnum(MkIdentifier(dest->enumName), (((void *)0))));
5669 }
5670 else
5671 {
5672 FreeType(source);
5673 FreeType(dest);
5674 if(backupSourceExpType)
5675 {
5676 if(sourceExp->expType)
5677 FreeType(sourceExp->expType);
5678 sourceExp->expType = backupSourceExpType;
5679 }
5680 return 0x0;
5681 }
5682 if(!flag)
5683 {
5684 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
5685
5686 *newExp = *sourceExp;
5687 newExp->prev = (((void *)0));
5688 newExp->next = (((void *)0));
5689 if(sourceExp->destType)
5690 sourceExp->destType->refCount++;
5691 if(sourceExp->expType)
5692 sourceExp->expType->refCount++;
5693 sourceExp->type = 11;
5694 if(realDest->kind == 8)
5695 {
5696 sourceExp->cast.typeName = QMkClass(realDest->_class->string, (((void *)0)));
5697 FreeList(specs, FreeSpecifier);
5698 }
5699 else
5700 sourceExp->cast.typeName = MkTypeName(specs, (((void *)0)));
5701 if(newExp->type == 4)
5702 {
5703 sourceExp->cast.exp = MkExpBrackets(MkListOne(newExp));
5704 }
5705 else
5706 sourceExp->cast.exp = newExp;
5707 FreeType(sourceExp->expType);
5708 sourceExp->expType = (((void *)0));
5709 ProcessExpressionType(sourceExp);
5710 }
5711 else
5712 FreeList(specs, FreeSpecifier);
5713 FreeType(dest);
5714 FreeType(source);
5715 if(backupSourceExpType)
5716 FreeType(backupSourceExpType);
5717 return 0x1;
5718 }
5719 else
5720 {
5721 while((sourceExp->type == 5 || sourceExp->type == 32) && sourceExp->list)
5722 sourceExp = (*sourceExp->list).last;
5723 if(sourceExp->type == 0)
5724 {
5725 struct Identifier * id = sourceExp->identifier;
5726
5727 if(dest->kind == 8)
5728 {
5729 if(dest->_class && dest->_class->registered && dest->_class->registered->type == 4)
5730 {
5731 struct __ecereNameSpace__ecere__com__Class * _class = dest->_class->registered;
5732 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
5733
5734 if(enumClass)
5735 {
5736 for(; _class && _class->type == 4; _class = _class->base)
5737 {
5738 struct __ecereNameSpace__ecere__sys__NamedLink * value;
5739 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
5740
5741 for(value = e->values.first; value; value = value->next)
5742 {
5743 if(!strcmp(value->name, id->string))
5744 break;
5745 }
5746 if(value)
5747 {
5748 FreeExpContents(sourceExp);
5749 FreeType(sourceExp->expType);
5750 sourceExp->isConstant = 0x1;
5751 sourceExp->expType = MkClassType(_class->fullName);
5752 {
5753 char constant[256];
5754
5755 sourceExp->type = 2;
5756 if(_class->dataTypeString && !strcmp(_class->dataTypeString, "int"))
5757 sprintf(constant, "%d", (int)value->data);
5758 else
5759 sprintf(constant, "0x%X", (int)value->data);
5760 sourceExp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
5761 }
5762 return 0x1;
5763 }
5764 }
5765 }
5766 }
5767 }
5768 if(dest->classObjectType != 2 && dest->kind == 8 && MatchWithEnums_Module(privateModule, sourceExp, dest, id->string, conversions))
5769 return 0x1;
5770 }
5771 }
5772 return 0x0;
5773 }
5774
5775 static unsigned int IntAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5776 {
5777 int value2 = op2->i;
5778
5779 exp->type = 2;
5780 exp->string = PrintInt(op1->i + value2);
5781 if(!exp->expType)
5782 {
5783 exp->expType = op1->type;
5784 if(op1->type)
5785 op1->type->refCount++;
5786 }
5787 return 0x1;
5788 }
5789
5790 static unsigned int UIntAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5791 {
5792 unsigned int value2 = op2->ui;
5793
5794 exp->type = 2;
5795 exp->string = PrintUInt(op1->ui + value2);
5796 if(!exp->expType)
5797 {
5798 exp->expType = op1->type;
5799 if(op1->type)
5800 op1->type->refCount++;
5801 }
5802 return 0x1;
5803 }
5804
5805 static unsigned int Int64Add(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5806 {
5807 long long value2 = op2->i64;
5808
5809 exp->type = 2;
5810 exp->string = PrintInt64(op1->i64 + value2);
5811 if(!exp->expType)
5812 {
5813 exp->expType = op1->type;
5814 if(op1->type)
5815 op1->type->refCount++;
5816 }
5817 return 0x1;
5818 }
5819
5820 static unsigned int UInt64Add(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5821 {
5822 uint64 value2 = op2->ui64;
5823
5824 exp->type = 2;
5825 exp->string = PrintUInt64(op1->ui64 + value2);
5826 if(!exp->expType)
5827 {
5828 exp->expType = op1->type;
5829 if(op1->type)
5830 op1->type->refCount++;
5831 }
5832 return 0x1;
5833 }
5834
5835 static unsigned int ShortAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5836 {
5837 short value2 = op2->s;
5838
5839 exp->type = 2;
5840 exp->string = PrintShort(op1->s + value2);
5841 if(!exp->expType)
5842 {
5843 exp->expType = op1->type;
5844 if(op1->type)
5845 op1->type->refCount++;
5846 }
5847 return 0x1;
5848 }
5849
5850 static unsigned int UShortAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5851 {
5852 unsigned short value2 = op2->us;
5853
5854 exp->type = 2;
5855 exp->string = PrintUShort(op1->us + value2);
5856 if(!exp->expType)
5857 {
5858 exp->expType = op1->type;
5859 if(op1->type)
5860 op1->type->refCount++;
5861 }
5862 return 0x1;
5863 }
5864
5865 static unsigned int CharAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5866 {
5867 char value2 = op2->c;
5868
5869 exp->type = 2;
5870 exp->string = PrintChar(op1->c + value2);
5871 if(!exp->expType)
5872 {
5873 exp->expType = op1->type;
5874 if(op1->type)
5875 op1->type->refCount++;
5876 }
5877 return 0x1;
5878 }
5879
5880 static unsigned int UCharAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5881 {
5882 unsigned char value2 = op2->uc;
5883
5884 exp->type = 2;
5885 exp->string = PrintUChar(op1->uc + value2);
5886 if(!exp->expType)
5887 {
5888 exp->expType = op1->type;
5889 if(op1->type)
5890 op1->type->refCount++;
5891 }
5892 return 0x1;
5893 }
5894
5895 static unsigned int FloatAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5896 {
5897 float value2 = op2->f;
5898
5899 exp->type = 2;
5900 exp->string = PrintFloat(op1->f + value2);
5901 if(!exp->expType)
5902 {
5903 exp->expType = op1->type;
5904 if(op1->type)
5905 op1->type->refCount++;
5906 }
5907 return 0x1;
5908 }
5909
5910 static unsigned int DoubleAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5911 {
5912 double value2 = op2->d;
5913
5914 exp->type = 2;
5915 exp->string = PrintDouble(op1->d + value2);
5916 if(!exp->expType)
5917 {
5918 exp->expType = op1->type;
5919 if(op1->type)
5920 op1->type->refCount++;
5921 }
5922 return 0x1;
5923 }
5924
5925 static unsigned int IntSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5926 {
5927 int value2 = op2->i;
5928
5929 exp->type = 2;
5930 exp->string = PrintInt(op1->i - value2);
5931 if(!exp->expType)
5932 {
5933 exp->expType = op1->type;
5934 if(op1->type)
5935 op1->type->refCount++;
5936 }
5937 return 0x1;
5938 }
5939
5940 static unsigned int UIntSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5941 {
5942 unsigned int value2 = op2->ui;
5943
5944 exp->type = 2;
5945 exp->string = PrintUInt(op1->ui - value2);
5946 if(!exp->expType)
5947 {
5948 exp->expType = op1->type;
5949 if(op1->type)
5950 op1->type->refCount++;
5951 }
5952 return 0x1;
5953 }
5954
5955 static unsigned int Int64Sub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5956 {
5957 long long value2 = op2->i64;
5958
5959 exp->type = 2;
5960 exp->string = PrintInt64(op1->i64 - value2);
5961 if(!exp->expType)
5962 {
5963 exp->expType = op1->type;
5964 if(op1->type)
5965 op1->type->refCount++;
5966 }
5967 return 0x1;
5968 }
5969
5970 static unsigned int UInt64Sub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5971 {
5972 uint64 value2 = op2->ui64;
5973
5974 exp->type = 2;
5975 exp->string = PrintUInt64(op1->ui64 - value2);
5976 if(!exp->expType)
5977 {
5978 exp->expType = op1->type;
5979 if(op1->type)
5980 op1->type->refCount++;
5981 }
5982 return 0x1;
5983 }
5984
5985 static unsigned int ShortSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5986 {
5987 short value2 = op2->s;
5988
5989 exp->type = 2;
5990 exp->string = PrintShort(op1->s - value2);
5991 if(!exp->expType)
5992 {
5993 exp->expType = op1->type;
5994 if(op1->type)
5995 op1->type->refCount++;
5996 }
5997 return 0x1;
5998 }
5999
6000 static unsigned int UShortSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6001 {
6002 unsigned short value2 = op2->us;
6003
6004 exp->type = 2;
6005 exp->string = PrintUShort(op1->us - value2);
6006 if(!exp->expType)
6007 {
6008 exp->expType = op1->type;
6009 if(op1->type)
6010 op1->type->refCount++;
6011 }
6012 return 0x1;
6013 }
6014
6015 static unsigned int CharSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6016 {
6017 char value2 = op2->c;
6018
6019 exp->type = 2;
6020 exp->string = PrintChar(op1->c - value2);
6021 if(!exp->expType)
6022 {
6023 exp->expType = op1->type;
6024 if(op1->type)
6025 op1->type->refCount++;
6026 }
6027 return 0x1;
6028 }
6029
6030 static unsigned int UCharSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6031 {
6032 unsigned char value2 = op2->uc;
6033
6034 exp->type = 2;
6035 exp->string = PrintUChar(op1->uc - value2);
6036 if(!exp->expType)
6037 {
6038 exp->expType = op1->type;
6039 if(op1->type)
6040 op1->type->refCount++;
6041 }
6042 return 0x1;
6043 }
6044
6045 static unsigned int FloatSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6046 {
6047 float value2 = op2->f;
6048
6049 exp->type = 2;
6050 exp->string = PrintFloat(op1->f - value2);
6051 if(!exp->expType)
6052 {
6053 exp->expType = op1->type;
6054 if(op1->type)
6055 op1->type->refCount++;
6056 }
6057 return 0x1;
6058 }
6059
6060 static unsigned int DoubleSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6061 {
6062 double value2 = op2->d;
6063
6064 exp->type = 2;
6065 exp->string = PrintDouble(op1->d - value2);
6066 if(!exp->expType)
6067 {
6068 exp->expType = op1->type;
6069 if(op1->type)
6070 op1->type->refCount++;
6071 }
6072 return 0x1;
6073 }
6074
6075 static unsigned int IntMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6076 {
6077 int value2 = op2->i;
6078
6079 exp->type = 2;
6080 exp->string = PrintInt(op1->i * value2);
6081 if(!exp->expType)
6082 {
6083 exp->expType = op1->type;
6084 if(op1->type)
6085 op1->type->refCount++;
6086 }
6087 return 0x1;
6088 }
6089
6090 static unsigned int UIntMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6091 {
6092 unsigned int value2 = op2->ui;
6093
6094 exp->type = 2;
6095 exp->string = PrintUInt(op1->ui * value2);
6096 if(!exp->expType)
6097 {
6098 exp->expType = op1->type;
6099 if(op1->type)
6100 op1->type->refCount++;
6101 }
6102 return 0x1;
6103 }
6104
6105 static unsigned int Int64Mul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6106 {
6107 long long value2 = op2->i64;
6108
6109 exp->type = 2;
6110 exp->string = PrintInt64(op1->i64 * value2);
6111 if(!exp->expType)
6112 {
6113 exp->expType = op1->type;
6114 if(op1->type)
6115 op1->type->refCount++;
6116 }
6117 return 0x1;
6118 }
6119
6120 static unsigned int UInt64Mul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6121 {
6122 uint64 value2 = op2->ui64;
6123
6124 exp->type = 2;
6125 exp->string = PrintUInt64(op1->ui64 * value2);
6126 if(!exp->expType)
6127 {
6128 exp->expType = op1->type;
6129 if(op1->type)
6130 op1->type->refCount++;
6131 }
6132 return 0x1;
6133 }
6134
6135 static unsigned int ShortMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6136 {
6137 short value2 = op2->s;
6138
6139 exp->type = 2;
6140 exp->string = PrintShort(op1->s * value2);
6141 if(!exp->expType)
6142 {
6143 exp->expType = op1->type;
6144 if(op1->type)
6145 op1->type->refCount++;
6146 }
6147 return 0x1;
6148 }
6149
6150 static unsigned int UShortMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6151 {
6152 unsigned short value2 = op2->us;
6153
6154 exp->type = 2;
6155 exp->string = PrintUShort(op1->us * value2);
6156 if(!exp->expType)
6157 {
6158 exp->expType = op1->type;
6159 if(op1->type)
6160 op1->type->refCount++;
6161 }
6162 return 0x1;
6163 }
6164
6165 static unsigned int CharMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6166 {
6167 char value2 = op2->c;
6168
6169 exp->type = 2;
6170 exp->string = PrintChar(op1->c * value2);
6171 if(!exp->expType)
6172 {
6173 exp->expType = op1->type;
6174 if(op1->type)
6175 op1->type->refCount++;
6176 }
6177 return 0x1;
6178 }
6179
6180 static unsigned int UCharMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6181 {
6182 unsigned char value2 = op2->uc;
6183
6184 exp->type = 2;
6185 exp->string = PrintUChar(op1->uc * value2);
6186 if(!exp->expType)
6187 {
6188 exp->expType = op1->type;
6189 if(op1->type)
6190 op1->type->refCount++;
6191 }
6192 return 0x1;
6193 }
6194
6195 static unsigned int FloatMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6196 {
6197 float value2 = op2->f;
6198
6199 exp->type = 2;
6200 exp->string = PrintFloat(op1->f * value2);
6201 if(!exp->expType)
6202 {
6203 exp->expType = op1->type;
6204 if(op1->type)
6205 op1->type->refCount++;
6206 }
6207 return 0x1;
6208 }
6209
6210 static unsigned int DoubleMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6211 {
6212 double value2 = op2->d;
6213
6214 exp->type = 2;
6215 exp->string = PrintDouble(op1->d * value2);
6216 if(!exp->expType)
6217 {
6218 exp->expType = op1->type;
6219 if(op1->type)
6220 op1->type->refCount++;
6221 }
6222 return 0x1;
6223 }
6224
6225 static unsigned int IntDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6226 {
6227 int value2 = op2->i;
6228
6229 exp->type = 2;
6230 exp->string = PrintInt(value2 ? (op1->i / value2) : 0);
6231 if(!exp->expType)
6232 {
6233 exp->expType = op1->type;
6234 if(op1->type)
6235 op1->type->refCount++;
6236 }
6237 return 0x1;
6238 }
6239
6240 static unsigned int UIntDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6241 {
6242 unsigned int value2 = op2->ui;
6243
6244 exp->type = 2;
6245 exp->string = PrintUInt(value2 ? (op1->ui / value2) : 0);
6246 if(!exp->expType)
6247 {
6248 exp->expType = op1->type;
6249 if(op1->type)
6250 op1->type->refCount++;
6251 }
6252 return 0x1;
6253 }
6254
6255 static unsigned int Int64Div(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6256 {
6257 long long value2 = op2->i64;
6258
6259 exp->type = 2;
6260 exp->string = PrintInt64(value2 ? (op1->i64 / value2) : 0);
6261 if(!exp->expType)
6262 {
6263 exp->expType = op1->type;
6264 if(op1->type)
6265 op1->type->refCount++;
6266 }
6267 return 0x1;
6268 }
6269
6270 static unsigned int UInt64Div(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6271 {
6272 uint64 value2 = op2->ui64;
6273
6274 exp->type = 2;
6275 exp->string = PrintUInt64(value2 ? (op1->ui64 / value2) : 0);
6276 if(!exp->expType)
6277 {
6278 exp->expType = op1->type;
6279 if(op1->type)
6280 op1->type->refCount++;
6281 }
6282 return 0x1;
6283 }
6284
6285 static unsigned int ShortDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6286 {
6287 short value2 = op2->s;
6288
6289 exp->type = 2;
6290 exp->string = PrintShort(value2 ? (op1->s / value2) : (short)0);
6291 if(!exp->expType)
6292 {
6293 exp->expType = op1->type;
6294 if(op1->type)
6295 op1->type->refCount++;
6296 }
6297 return 0x1;
6298 }
6299
6300 static unsigned int UShortDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6301 {
6302 unsigned short value2 = op2->us;
6303
6304 exp->type = 2;
6305 exp->string = PrintUShort(value2 ? (op1->us / value2) : (unsigned short)0);
6306 if(!exp->expType)
6307 {
6308 exp->expType = op1->type;
6309 if(op1->type)
6310 op1->type->refCount++;
6311 }
6312 return 0x1;
6313 }
6314
6315 static unsigned int CharDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6316 {
6317 char value2 = op2->c;
6318
6319 exp->type = 2;
6320 exp->string = PrintChar(value2 ? (op1->c / value2) : (char)0);
6321 if(!exp->expType)
6322 {
6323 exp->expType = op1->type;
6324 if(op1->type)
6325 op1->type->refCount++;
6326 }
6327 return 0x1;
6328 }
6329
6330 static unsigned int UCharDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6331 {
6332 unsigned char value2 = op2->uc;
6333
6334 exp->type = 2;
6335 exp->string = PrintUChar(value2 ? (op1->uc / value2) : (unsigned char)0);
6336 if(!exp->expType)
6337 {
6338 exp->expType = op1->type;
6339 if(op1->type)
6340 op1->type->refCount++;
6341 }
6342 return 0x1;
6343 }
6344
6345 static unsigned int FloatDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6346 {
6347 float value2 = op2->f;
6348
6349 exp->type = 2;
6350 exp->string = PrintFloat(op1->f / value2);
6351 if(!exp->expType)
6352 {
6353 exp->expType = op1->type;
6354 if(op1->type)
6355 op1->type->refCount++;
6356 }
6357 return 0x1;
6358 }
6359
6360 static unsigned int DoubleDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6361 {
6362 double value2 = op2->d;
6363
6364 exp->type = 2;
6365 exp->string = PrintDouble(op1->d / value2);
6366 if(!exp->expType)
6367 {
6368 exp->expType = op1->type;
6369 if(op1->type)
6370 op1->type->refCount++;
6371 }
6372 return 0x1;
6373 }
6374
6375 static unsigned int IntMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6376 {
6377 int value2 = op2->i;
6378
6379 exp->type = 2;
6380 exp->string = PrintInt(value2 ? (op1->i % value2) : 0);
6381 if(!exp->expType)
6382 {
6383 exp->expType = op1->type;
6384 if(op1->type)
6385 op1->type->refCount++;
6386 }
6387 return 0x1;
6388 }
6389
6390 static unsigned int UIntMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6391 {
6392 unsigned int value2 = op2->ui;
6393
6394 exp->type = 2;
6395 exp->string = PrintUInt(value2 ? (op1->ui % value2) : 0);
6396 if(!exp->expType)
6397 {
6398 exp->expType = op1->type;
6399 if(op1->type)
6400 op1->type->refCount++;
6401 }
6402 return 0x1;
6403 }
6404
6405 static unsigned int Int64Mod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6406 {
6407 long long value2 = op2->i64;
6408
6409 exp->type = 2;
6410 exp->string = PrintInt64(value2 ? (op1->i64 % value2) : 0);
6411 if(!exp->expType)
6412 {
6413 exp->expType = op1->type;
6414 if(op1->type)
6415 op1->type->refCount++;
6416 }
6417 return 0x1;
6418 }
6419
6420 static unsigned int UInt64Mod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6421 {
6422 uint64 value2 = op2->ui64;
6423
6424 exp->type = 2;
6425 exp->string = PrintUInt64(value2 ? (op1->ui64 % value2) : 0);
6426 if(!exp->expType)
6427 {
6428 exp->expType = op1->type;
6429 if(op1->type)
6430 op1->type->refCount++;
6431 }
6432 return 0x1;
6433 }
6434
6435 static unsigned int ShortMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6436 {
6437 short value2 = op2->s;
6438
6439 exp->type = 2;
6440 exp->string = PrintShort(value2 ? (op1->s % value2) : (short)0);
6441 if(!exp->expType)
6442 {
6443 exp->expType = op1->type;
6444 if(op1->type)
6445 op1->type->refCount++;
6446 }
6447 return 0x1;
6448 }
6449
6450 static unsigned int UShortMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6451 {
6452 unsigned short value2 = op2->us;
6453
6454 exp->type = 2;
6455 exp->string = PrintUShort(value2 ? (op1->us % value2) : (unsigned short)0);
6456 if(!exp->expType)
6457 {
6458 exp->expType = op1->type;
6459 if(op1->type)
6460 op1->type->refCount++;
6461 }
6462 return 0x1;
6463 }
6464
6465 static unsigned int CharMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6466 {
6467 char value2 = op2->c;
6468
6469 exp->type = 2;
6470 exp->string = PrintChar(value2 ? (op1->c % value2) : (char)0);
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 UCharMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6481 {
6482 unsigned char value2 = op2->uc;
6483
6484 exp->type = 2;
6485 exp->string = PrintUChar(value2 ? (op1->uc % value2) : (unsigned char)0);
6486 if(!exp->expType)
6487 {
6488 exp->expType = op1->type;
6489 if(op1->type)
6490 op1->type->refCount++;
6491 }
6492 return 0x1;
6493 }
6494
6495 static unsigned int IntNeg(struct Expression * exp, struct Operand * op1)
6496 {
6497 exp->type = 2;
6498 exp->string = PrintInt((-op1->i));
6499 if(!exp->expType)
6500 {
6501 exp->expType = op1->type;
6502 if(op1->type)
6503 op1->type->refCount++;
6504 }
6505 return 0x1;
6506 }
6507
6508 static unsigned int UIntNeg(struct Expression * exp, struct Operand * op1)
6509 {
6510 exp->type = 2;
6511 exp->string = PrintUInt((unsigned int)(-op1->ui));
6512 if(!exp->expType)
6513 {
6514 exp->expType = op1->type;
6515 if(op1->type)
6516 op1->type->refCount++;
6517 }
6518 return 0x1;
6519 }
6520
6521 static unsigned int Int64Neg(struct Expression * exp, struct Operand * op1)
6522 {
6523 exp->type = 2;
6524 exp->string = PrintInt64((-op1->i64));
6525 if(!exp->expType)
6526 {
6527 exp->expType = op1->type;
6528 if(op1->type)
6529 op1->type->refCount++;
6530 }
6531 return 0x1;
6532 }
6533
6534 static unsigned int UInt64Neg(struct Expression * exp, struct Operand * op1)
6535 {
6536 exp->type = 2;
6537 exp->string = PrintUInt64((uint64)(-op1->ui64));
6538 if(!exp->expType)
6539 {
6540 exp->expType = op1->type;
6541 if(op1->type)
6542 op1->type->refCount++;
6543 }
6544 return 0x1;
6545 }
6546
6547 static unsigned int ShortNeg(struct Expression * exp, struct Operand * op1)
6548 {
6549 exp->type = 2;
6550 exp->string = PrintShort((-op1->s));
6551 if(!exp->expType)
6552 {
6553 exp->expType = op1->type;
6554 if(op1->type)
6555 op1->type->refCount++;
6556 }
6557 return 0x1;
6558 }
6559
6560 static unsigned int UShortNeg(struct Expression * exp, struct Operand * op1)
6561 {
6562 exp->type = 2;
6563 exp->string = PrintUShort((unsigned short)(-op1->us));
6564 if(!exp->expType)
6565 {
6566 exp->expType = op1->type;
6567 if(op1->type)
6568 op1->type->refCount++;
6569 }
6570 return 0x1;
6571 }
6572
6573 static unsigned int CharNeg(struct Expression * exp, struct Operand * op1)
6574 {
6575 exp->type = 2;
6576 exp->string = PrintChar((-op1->c));
6577 if(!exp->expType)
6578 {
6579 exp->expType = op1->type;
6580 if(op1->type)
6581 op1->type->refCount++;
6582 }
6583 return 0x1;
6584 }
6585
6586 static unsigned int UCharNeg(struct Expression * exp, struct Operand * op1)
6587 {
6588 exp->type = 2;
6589 exp->string = PrintUChar((unsigned char)(-op1->uc));
6590 if(!exp->expType)
6591 {
6592 exp->expType = op1->type;
6593 if(op1->type)
6594 op1->type->refCount++;
6595 }
6596 return 0x1;
6597 }
6598
6599 static unsigned int FloatNeg(struct Expression * exp, struct Operand * op1)
6600 {
6601 exp->type = 2;
6602 exp->string = PrintFloat((float)(-op1->f));
6603 if(!exp->expType)
6604 {
6605 exp->expType = op1->type;
6606 if(op1->type)
6607 op1->type->refCount++;
6608 }
6609 return 0x1;
6610 }
6611
6612 static unsigned int DoubleNeg(struct Expression * exp, struct Operand * op1)
6613 {
6614 exp->type = 2;
6615 exp->string = PrintDouble((double)(-op1->d));
6616 if(!exp->expType)
6617 {
6618 exp->expType = op1->type;
6619 if(op1->type)
6620 op1->type->refCount++;
6621 }
6622 return 0x1;
6623 }
6624
6625 static unsigned int IntInc(struct Expression * exp, struct Operand * op1)
6626 {
6627 exp->type = 2;
6628 exp->string = PrintInt((++op1->i));
6629 if(!exp->expType)
6630 {
6631 exp->expType = op1->type;
6632 if(op1->type)
6633 op1->type->refCount++;
6634 }
6635 return 0x1;
6636 }
6637
6638 static unsigned int UIntInc(struct Expression * exp, struct Operand * op1)
6639 {
6640 exp->type = 2;
6641 exp->string = PrintUInt((++op1->ui));
6642 if(!exp->expType)
6643 {
6644 exp->expType = op1->type;
6645 if(op1->type)
6646 op1->type->refCount++;
6647 }
6648 return 0x1;
6649 }
6650
6651 static unsigned int Int64Inc(struct Expression * exp, struct Operand * op1)
6652 {
6653 exp->type = 2;
6654 exp->string = PrintInt64((++op1->i64));
6655 if(!exp->expType)
6656 {
6657 exp->expType = op1->type;
6658 if(op1->type)
6659 op1->type->refCount++;
6660 }
6661 return 0x1;
6662 }
6663
6664 static unsigned int UInt64Inc(struct Expression * exp, struct Operand * op1)
6665 {
6666 exp->type = 2;
6667 exp->string = PrintUInt64((++op1->ui64));
6668 if(!exp->expType)
6669 {
6670 exp->expType = op1->type;
6671 if(op1->type)
6672 op1->type->refCount++;
6673 }
6674 return 0x1;
6675 }
6676
6677 static unsigned int ShortInc(struct Expression * exp, struct Operand * op1)
6678 {
6679 exp->type = 2;
6680 exp->string = PrintShort((++op1->s));
6681 if(!exp->expType)
6682 {
6683 exp->expType = op1->type;
6684 if(op1->type)
6685 op1->type->refCount++;
6686 }
6687 return 0x1;
6688 }
6689
6690 static unsigned int UShortInc(struct Expression * exp, struct Operand * op1)
6691 {
6692 exp->type = 2;
6693 exp->string = PrintUShort((++op1->us));
6694 if(!exp->expType)
6695 {
6696 exp->expType = op1->type;
6697 if(op1->type)
6698 op1->type->refCount++;
6699 }
6700 return 0x1;
6701 }
6702
6703 static unsigned int CharInc(struct Expression * exp, struct Operand * op1)
6704 {
6705 exp->type = 2;
6706 exp->string = PrintChar((++op1->c));
6707 if(!exp->expType)
6708 {
6709 exp->expType = op1->type;
6710 if(op1->type)
6711 op1->type->refCount++;
6712 }
6713 return 0x1;
6714 }
6715
6716 static unsigned int UCharInc(struct Expression * exp, struct Operand * op1)
6717 {
6718 exp->type = 2;
6719 exp->string = PrintUChar((++op1->uc));
6720 if(!exp->expType)
6721 {
6722 exp->expType = op1->type;
6723 if(op1->type)
6724 op1->type->refCount++;
6725 }
6726 return 0x1;
6727 }
6728
6729 static unsigned int FloatInc(struct Expression * exp, struct Operand * op1)
6730 {
6731 exp->type = 2;
6732 exp->string = PrintFloat((float)(++op1->f));
6733 if(!exp->expType)
6734 {
6735 exp->expType = op1->type;
6736 if(op1->type)
6737 op1->type->refCount++;
6738 }
6739 return 0x1;
6740 }
6741
6742 static unsigned int DoubleInc(struct Expression * exp, struct Operand * op1)
6743 {
6744 exp->type = 2;
6745 exp->string = PrintDouble((double)(++op1->d));
6746 if(!exp->expType)
6747 {
6748 exp->expType = op1->type;
6749 if(op1->type)
6750 op1->type->refCount++;
6751 }
6752 return 0x1;
6753 }
6754
6755 static unsigned int IntDec(struct Expression * exp, struct Operand * op1)
6756 {
6757 exp->type = 2;
6758 exp->string = PrintInt((--op1->i));
6759 if(!exp->expType)
6760 {
6761 exp->expType = op1->type;
6762 if(op1->type)
6763 op1->type->refCount++;
6764 }
6765 return 0x1;
6766 }
6767
6768 static unsigned int UIntDec(struct Expression * exp, struct Operand * op1)
6769 {
6770 exp->type = 2;
6771 exp->string = PrintUInt((--op1->ui));
6772 if(!exp->expType)
6773 {
6774 exp->expType = op1->type;
6775 if(op1->type)
6776 op1->type->refCount++;
6777 }
6778 return 0x1;
6779 }
6780
6781 static unsigned int Int64Dec(struct Expression * exp, struct Operand * op1)
6782 {
6783 exp->type = 2;
6784 exp->string = PrintInt64((--op1->i64));
6785 if(!exp->expType)
6786 {
6787 exp->expType = op1->type;
6788 if(op1->type)
6789 op1->type->refCount++;
6790 }
6791 return 0x1;
6792 }
6793
6794 static unsigned int UInt64Dec(struct Expression * exp, struct Operand * op1)
6795 {
6796 exp->type = 2;
6797 exp->string = PrintUInt64((--op1->ui64));
6798 if(!exp->expType)
6799 {
6800 exp->expType = op1->type;
6801 if(op1->type)
6802 op1->type->refCount++;
6803 }
6804 return 0x1;
6805 }
6806
6807 static unsigned int ShortDec(struct Expression * exp, struct Operand * op1)
6808 {
6809 exp->type = 2;
6810 exp->string = PrintShort((--op1->s));
6811 if(!exp->expType)
6812 {
6813 exp->expType = op1->type;
6814 if(op1->type)
6815 op1->type->refCount++;
6816 }
6817 return 0x1;
6818 }
6819
6820 static unsigned int UShortDec(struct Expression * exp, struct Operand * op1)
6821 {
6822 exp->type = 2;
6823 exp->string = PrintUShort((--op1->us));
6824 if(!exp->expType)
6825 {
6826 exp->expType = op1->type;
6827 if(op1->type)
6828 op1->type->refCount++;
6829 }
6830 return 0x1;
6831 }
6832
6833 static unsigned int CharDec(struct Expression * exp, struct Operand * op1)
6834 {
6835 exp->type = 2;
6836 exp->string = PrintChar((--op1->c));
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 UCharDec(struct Expression * exp, struct Operand * op1)
6847 {
6848 exp->type = 2;
6849 exp->string = PrintUChar((--op1->uc));
6850 if(!exp->expType)
6851 {
6852 exp->expType = op1->type;
6853 if(op1->type)
6854 op1->type->refCount++;
6855 }
6856 return 0x1;
6857 }
6858
6859 static unsigned int FloatDec(struct Expression * exp, struct Operand * op1)
6860 {
6861 exp->type = 2;
6862 exp->string = PrintFloat((float)(--op1->f));
6863 if(!exp->expType)
6864 {
6865 exp->expType = op1->type;
6866 if(op1->type)
6867 op1->type->refCount++;
6868 }
6869 return 0x1;
6870 }
6871
6872 static unsigned int DoubleDec(struct Expression * exp, struct Operand * op1)
6873 {
6874 exp->type = 2;
6875 exp->string = PrintDouble((double)(--op1->d));
6876 if(!exp->expType)
6877 {
6878 exp->expType = op1->type;
6879 if(op1->type)
6880 op1->type->refCount++;
6881 }
6882 return 0x1;
6883 }
6884
6885 static unsigned int IntAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6886 {
6887 int value2 = op2->i;
6888
6889 exp->type = 2;
6890 exp->string = PrintInt(op1->i = value2);
6891 if(!exp->expType)
6892 {
6893 exp->expType = op1->type;
6894 if(op1->type)
6895 op1->type->refCount++;
6896 }
6897 return 0x1;
6898 }
6899
6900 static unsigned int UIntAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6901 {
6902 unsigned int value2 = op2->ui;
6903
6904 exp->type = 2;
6905 exp->string = PrintUInt(op1->ui = value2);
6906 if(!exp->expType)
6907 {
6908 exp->expType = op1->type;
6909 if(op1->type)
6910 op1->type->refCount++;
6911 }
6912 return 0x1;
6913 }
6914
6915 static unsigned int Int64Asign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6916 {
6917 long long value2 = op2->i64;
6918
6919 exp->type = 2;
6920 exp->string = PrintInt64(op1->i64 = value2);
6921 if(!exp->expType)
6922 {
6923 exp->expType = op1->type;
6924 if(op1->type)
6925 op1->type->refCount++;
6926 }
6927 return 0x1;
6928 }
6929
6930 static unsigned int UInt64Asign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6931 {
6932 uint64 value2 = op2->ui64;
6933
6934 exp->type = 2;
6935 exp->string = PrintUInt64(op1->ui64 = value2);
6936 if(!exp->expType)
6937 {
6938 exp->expType = op1->type;
6939 if(op1->type)
6940 op1->type->refCount++;
6941 }
6942 return 0x1;
6943 }
6944
6945 static unsigned int ShortAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6946 {
6947 short value2 = op2->s;
6948
6949 exp->type = 2;
6950 exp->string = PrintShort(op1->s = value2);
6951 if(!exp->expType)
6952 {
6953 exp->expType = op1->type;
6954 if(op1->type)
6955 op1->type->refCount++;
6956 }
6957 return 0x1;
6958 }
6959
6960 static unsigned int UShortAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6961 {
6962 unsigned short value2 = op2->us;
6963
6964 exp->type = 2;
6965 exp->string = PrintUShort(op1->us = value2);
6966 if(!exp->expType)
6967 {
6968 exp->expType = op1->type;
6969 if(op1->type)
6970 op1->type->refCount++;
6971 }
6972 return 0x1;
6973 }
6974
6975 static unsigned int CharAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6976 {
6977 char value2 = op2->c;
6978
6979 exp->type = 2;
6980 exp->string = PrintChar(op1->c = value2);
6981 if(!exp->expType)
6982 {
6983 exp->expType = op1->type;
6984 if(op1->type)
6985 op1->type->refCount++;
6986 }
6987 return 0x1;
6988 }
6989
6990 static unsigned int UCharAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6991 {
6992 unsigned char value2 = op2->uc;
6993
6994 exp->type = 2;
6995 exp->string = PrintUChar(op1->uc = value2);
6996 if(!exp->expType)
6997 {
6998 exp->expType = op1->type;
6999 if(op1->type)
7000 op1->type->refCount++;
7001 }
7002 return 0x1;
7003 }
7004
7005 static unsigned int FloatAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7006 {
7007 float value2 = op2->f;
7008
7009 exp->type = 2;
7010 exp->string = PrintFloat(op1->f = value2);
7011 if(!exp->expType)
7012 {
7013 exp->expType = op1->type;
7014 if(op1->type)
7015 op1->type->refCount++;
7016 }
7017 return 0x1;
7018 }
7019
7020 static unsigned int DoubleAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7021 {
7022 double value2 = op2->d;
7023
7024 exp->type = 2;
7025 exp->string = PrintDouble(op1->d = value2);
7026 if(!exp->expType)
7027 {
7028 exp->expType = op1->type;
7029 if(op1->type)
7030 op1->type->refCount++;
7031 }
7032 return 0x1;
7033 }
7034
7035 static unsigned int IntAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7036 {
7037 int value2 = op2->i;
7038
7039 exp->type = 2;
7040 exp->string = PrintInt(op1->i += value2);
7041 if(!exp->expType)
7042 {
7043 exp->expType = op1->type;
7044 if(op1->type)
7045 op1->type->refCount++;
7046 }
7047 return 0x1;
7048 }
7049
7050 static unsigned int UIntAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7051 {
7052 unsigned int value2 = op2->ui;
7053
7054 exp->type = 2;
7055 exp->string = PrintUInt(op1->ui += value2);
7056 if(!exp->expType)
7057 {
7058 exp->expType = op1->type;
7059 if(op1->type)
7060 op1->type->refCount++;
7061 }
7062 return 0x1;
7063 }
7064
7065 static unsigned int Int64AddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7066 {
7067 long long value2 = op2->i64;
7068
7069 exp->type = 2;
7070 exp->string = PrintInt64(op1->i64 += value2);
7071 if(!exp->expType)
7072 {
7073 exp->expType = op1->type;
7074 if(op1->type)
7075 op1->type->refCount++;
7076 }
7077 return 0x1;
7078 }
7079
7080 static unsigned int UInt64AddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7081 {
7082 uint64 value2 = op2->ui64;
7083
7084 exp->type = 2;
7085 exp->string = PrintUInt64(op1->ui64 += value2);
7086 if(!exp->expType)
7087 {
7088 exp->expType = op1->type;
7089 if(op1->type)
7090 op1->type->refCount++;
7091 }
7092 return 0x1;
7093 }
7094
7095 static unsigned int ShortAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7096 {
7097 short value2 = op2->s;
7098
7099 exp->type = 2;
7100 exp->string = PrintShort(op1->s += value2);
7101 if(!exp->expType)
7102 {
7103 exp->expType = op1->type;
7104 if(op1->type)
7105 op1->type->refCount++;
7106 }
7107 return 0x1;
7108 }
7109
7110 static unsigned int UShortAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7111 {
7112 unsigned short value2 = op2->us;
7113
7114 exp->type = 2;
7115 exp->string = PrintUShort(op1->us += value2);
7116 if(!exp->expType)
7117 {
7118 exp->expType = op1->type;
7119 if(op1->type)
7120 op1->type->refCount++;
7121 }
7122 return 0x1;
7123 }
7124
7125 static unsigned int CharAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7126 {
7127 char value2 = op2->c;
7128
7129 exp->type = 2;
7130 exp->string = PrintChar(op1->c += value2);
7131 if(!exp->expType)
7132 {
7133 exp->expType = op1->type;
7134 if(op1->type)
7135 op1->type->refCount++;
7136 }
7137 return 0x1;
7138 }
7139
7140 static unsigned int UCharAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7141 {
7142 unsigned char value2 = op2->uc;
7143
7144 exp->type = 2;
7145 exp->string = PrintUChar(op1->uc += value2);
7146 if(!exp->expType)
7147 {
7148 exp->expType = op1->type;
7149 if(op1->type)
7150 op1->type->refCount++;
7151 }
7152 return 0x1;
7153 }
7154
7155 static unsigned int FloatAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7156 {
7157 float value2 = op2->f;
7158
7159 exp->type = 2;
7160 exp->string = PrintFloat(op1->f += value2);
7161 if(!exp->expType)
7162 {
7163 exp->expType = op1->type;
7164 if(op1->type)
7165 op1->type->refCount++;
7166 }
7167 return 0x1;
7168 }
7169
7170 static unsigned int DoubleAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7171 {
7172 double value2 = op2->d;
7173
7174 exp->type = 2;
7175 exp->string = PrintDouble(op1->d += value2);
7176 if(!exp->expType)
7177 {
7178 exp->expType = op1->type;
7179 if(op1->type)
7180 op1->type->refCount++;
7181 }
7182 return 0x1;
7183 }
7184
7185 static unsigned int IntSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7186 {
7187 int value2 = op2->i;
7188
7189 exp->type = 2;
7190 exp->string = PrintInt(op1->i -= value2);
7191 if(!exp->expType)
7192 {
7193 exp->expType = op1->type;
7194 if(op1->type)
7195 op1->type->refCount++;
7196 }
7197 return 0x1;
7198 }
7199
7200 static unsigned int UIntSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7201 {
7202 unsigned int value2 = op2->ui;
7203
7204 exp->type = 2;
7205 exp->string = PrintUInt(op1->ui -= value2);
7206 if(!exp->expType)
7207 {
7208 exp->expType = op1->type;
7209 if(op1->type)
7210 op1->type->refCount++;
7211 }
7212 return 0x1;
7213 }
7214
7215 static unsigned int Int64SubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7216 {
7217 long long value2 = op2->i64;
7218
7219 exp->type = 2;
7220 exp->string = PrintInt64(op1->i64 -= value2);
7221 if(!exp->expType)
7222 {
7223 exp->expType = op1->type;
7224 if(op1->type)
7225 op1->type->refCount++;
7226 }
7227 return 0x1;
7228 }
7229
7230 static unsigned int UInt64SubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7231 {
7232 uint64 value2 = op2->ui64;
7233
7234 exp->type = 2;
7235 exp->string = PrintUInt64(op1->ui64 -= value2);
7236 if(!exp->expType)
7237 {
7238 exp->expType = op1->type;
7239 if(op1->type)
7240 op1->type->refCount++;
7241 }
7242 return 0x1;
7243 }
7244
7245 static unsigned int ShortSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7246 {
7247 short value2 = op2->s;
7248
7249 exp->type = 2;
7250 exp->string = PrintShort(op1->s -= value2);
7251 if(!exp->expType)
7252 {
7253 exp->expType = op1->type;
7254 if(op1->type)
7255 op1->type->refCount++;
7256 }
7257 return 0x1;
7258 }
7259
7260 static unsigned int UShortSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7261 {
7262 unsigned short value2 = op2->us;
7263
7264 exp->type = 2;
7265 exp->string = PrintUShort(op1->us -= value2);
7266 if(!exp->expType)
7267 {
7268 exp->expType = op1->type;
7269 if(op1->type)
7270 op1->type->refCount++;
7271 }
7272 return 0x1;
7273 }
7274
7275 static unsigned int CharSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7276 {
7277 char value2 = op2->c;
7278
7279 exp->type = 2;
7280 exp->string = PrintChar(op1->c -= value2);
7281 if(!exp->expType)
7282 {
7283 exp->expType = op1->type;
7284 if(op1->type)
7285 op1->type->refCount++;
7286 }
7287 return 0x1;
7288 }
7289
7290 static unsigned int UCharSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7291 {
7292 unsigned char value2 = op2->uc;
7293
7294 exp->type = 2;
7295 exp->string = PrintUChar(op1->uc -= value2);
7296 if(!exp->expType)
7297 {
7298 exp->expType = op1->type;
7299 if(op1->type)
7300 op1->type->refCount++;
7301 }
7302 return 0x1;
7303 }
7304
7305 static unsigned int FloatSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7306 {
7307 float value2 = op2->f;
7308
7309 exp->type = 2;
7310 exp->string = PrintFloat(op1->f -= value2);
7311 if(!exp->expType)
7312 {
7313 exp->expType = op1->type;
7314 if(op1->type)
7315 op1->type->refCount++;
7316 }
7317 return 0x1;
7318 }
7319
7320 static unsigned int DoubleSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7321 {
7322 double value2 = op2->d;
7323
7324 exp->type = 2;
7325 exp->string = PrintDouble(op1->d -= value2);
7326 if(!exp->expType)
7327 {
7328 exp->expType = op1->type;
7329 if(op1->type)
7330 op1->type->refCount++;
7331 }
7332 return 0x1;
7333 }
7334
7335 static unsigned int IntMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7336 {
7337 int value2 = op2->i;
7338
7339 exp->type = 2;
7340 exp->string = PrintInt(op1->i *= value2);
7341 if(!exp->expType)
7342 {
7343 exp->expType = op1->type;
7344 if(op1->type)
7345 op1->type->refCount++;
7346 }
7347 return 0x1;
7348 }
7349
7350 static unsigned int UIntMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7351 {
7352 unsigned int value2 = op2->ui;
7353
7354 exp->type = 2;
7355 exp->string = PrintUInt(op1->ui *= value2);
7356 if(!exp->expType)
7357 {
7358 exp->expType = op1->type;
7359 if(op1->type)
7360 op1->type->refCount++;
7361 }
7362 return 0x1;
7363 }
7364
7365 static unsigned int Int64MulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7366 {
7367 long long value2 = op2->i64;
7368
7369 exp->type = 2;
7370 exp->string = PrintInt64(op1->i64 *= value2);
7371 if(!exp->expType)
7372 {
7373 exp->expType = op1->type;
7374 if(op1->type)
7375 op1->type->refCount++;
7376 }
7377 return 0x1;
7378 }
7379
7380 static unsigned int UInt64MulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7381 {
7382 uint64 value2 = op2->ui64;
7383
7384 exp->type = 2;
7385 exp->string = PrintUInt64(op1->ui64 *= value2);
7386 if(!exp->expType)
7387 {
7388 exp->expType = op1->type;
7389 if(op1->type)
7390 op1->type->refCount++;
7391 }
7392 return 0x1;
7393 }
7394
7395 static unsigned int ShortMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7396 {
7397 short value2 = op2->s;
7398
7399 exp->type = 2;
7400 exp->string = PrintShort(op1->s *= value2);
7401 if(!exp->expType)
7402 {
7403 exp->expType = op1->type;
7404 if(op1->type)
7405 op1->type->refCount++;
7406 }
7407 return 0x1;
7408 }
7409
7410 static unsigned int UShortMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7411 {
7412 unsigned short value2 = op2->us;
7413
7414 exp->type = 2;
7415 exp->string = PrintUShort(op1->us *= value2);
7416 if(!exp->expType)
7417 {
7418 exp->expType = op1->type;
7419 if(op1->type)
7420 op1->type->refCount++;
7421 }
7422 return 0x1;
7423 }
7424
7425 static unsigned int CharMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7426 {
7427 char value2 = op2->c;
7428
7429 exp->type = 2;
7430 exp->string = PrintChar(op1->c *= value2);
7431 if(!exp->expType)
7432 {
7433 exp->expType = op1->type;
7434 if(op1->type)
7435 op1->type->refCount++;
7436 }
7437 return 0x1;
7438 }
7439
7440 static unsigned int UCharMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7441 {
7442 unsigned char value2 = op2->uc;
7443
7444 exp->type = 2;
7445 exp->string = PrintUChar(op1->uc *= value2);
7446 if(!exp->expType)
7447 {
7448 exp->expType = op1->type;
7449 if(op1->type)
7450 op1->type->refCount++;
7451 }
7452 return 0x1;
7453 }
7454
7455 static unsigned int FloatMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7456 {
7457 float value2 = op2->f;
7458
7459 exp->type = 2;
7460 exp->string = PrintFloat(op1->f *= value2);
7461 if(!exp->expType)
7462 {
7463 exp->expType = op1->type;
7464 if(op1->type)
7465 op1->type->refCount++;
7466 }
7467 return 0x1;
7468 }
7469
7470 static unsigned int DoubleMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7471 {
7472 double value2 = op2->d;
7473
7474 exp->type = 2;
7475 exp->string = PrintDouble(op1->d *= value2);
7476 if(!exp->expType)
7477 {
7478 exp->expType = op1->type;
7479 if(op1->type)
7480 op1->type->refCount++;
7481 }
7482 return 0x1;
7483 }
7484
7485 static unsigned int IntDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7486 {
7487 int value2 = op2->i;
7488
7489 exp->type = 2;
7490 exp->string = PrintInt(value2 ? (op1->i /= value2) : 0);
7491 if(!exp->expType)
7492 {
7493 exp->expType = op1->type;
7494 if(op1->type)
7495 op1->type->refCount++;
7496 }
7497 return 0x1;
7498 }
7499
7500 static unsigned int UIntDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7501 {
7502 unsigned int value2 = op2->ui;
7503
7504 exp->type = 2;
7505 exp->string = PrintUInt(value2 ? (op1->ui /= value2) : 0);
7506 if(!exp->expType)
7507 {
7508 exp->expType = op1->type;
7509 if(op1->type)
7510 op1->type->refCount++;
7511 }
7512 return 0x1;
7513 }
7514
7515 static unsigned int Int64DivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7516 {
7517 long long value2 = op2->i64;
7518
7519 exp->type = 2;
7520 exp->string = PrintInt64(value2 ? (op1->i64 /= value2) : 0);
7521 if(!exp->expType)
7522 {
7523 exp->expType = op1->type;
7524 if(op1->type)
7525 op1->type->refCount++;
7526 }
7527 return 0x1;
7528 }
7529
7530 static unsigned int UInt64DivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7531 {
7532 uint64 value2 = op2->ui64;
7533
7534 exp->type = 2;
7535 exp->string = PrintUInt64(value2 ? (op1->ui64 /= value2) : 0);
7536 if(!exp->expType)
7537 {
7538 exp->expType = op1->type;
7539 if(op1->type)
7540 op1->type->refCount++;
7541 }
7542 return 0x1;
7543 }
7544
7545 static unsigned int ShortDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7546 {
7547 short value2 = op2->s;
7548
7549 exp->type = 2;
7550 exp->string = PrintShort(value2 ? (op1->s /= value2) : (short)0);
7551 if(!exp->expType)
7552 {
7553 exp->expType = op1->type;
7554 if(op1->type)
7555 op1->type->refCount++;
7556 }
7557 return 0x1;
7558 }
7559
7560 static unsigned int UShortDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7561 {
7562 unsigned short value2 = op2->us;
7563
7564 exp->type = 2;
7565 exp->string = PrintUShort(value2 ? (op1->us /= value2) : (unsigned short)0);
7566 if(!exp->expType)
7567 {
7568 exp->expType = op1->type;
7569 if(op1->type)
7570 op1->type->refCount++;
7571 }
7572 return 0x1;
7573 }
7574
7575 static unsigned int CharDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7576 {
7577 char value2 = op2->c;
7578
7579 exp->type = 2;
7580 exp->string = PrintChar(value2 ? (op1->c /= value2) : (char)0);
7581 if(!exp->expType)
7582 {
7583 exp->expType = op1->type;
7584 if(op1->type)
7585 op1->type->refCount++;
7586 }
7587 return 0x1;
7588 }
7589
7590 static unsigned int UCharDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7591 {
7592 unsigned char value2 = op2->uc;
7593
7594 exp->type = 2;
7595 exp->string = PrintUChar(value2 ? (op1->uc /= value2) : (unsigned char)0);
7596 if(!exp->expType)
7597 {
7598 exp->expType = op1->type;
7599 if(op1->type)
7600 op1->type->refCount++;
7601 }
7602 return 0x1;
7603 }
7604
7605 static unsigned int FloatDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7606 {
7607 float value2 = op2->f;
7608
7609 exp->type = 2;
7610 exp->string = PrintFloat(op1->f /= value2);
7611 if(!exp->expType)
7612 {
7613 exp->expType = op1->type;
7614 if(op1->type)
7615 op1->type->refCount++;
7616 }
7617 return 0x1;
7618 }
7619
7620 static unsigned int DoubleDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7621 {
7622 double value2 = op2->d;
7623
7624 exp->type = 2;
7625 exp->string = PrintDouble(op1->d /= value2);
7626 if(!exp->expType)
7627 {
7628 exp->expType = op1->type;
7629 if(op1->type)
7630 op1->type->refCount++;
7631 }
7632 return 0x1;
7633 }
7634
7635 static unsigned int IntModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7636 {
7637 int value2 = op2->i;
7638
7639 exp->type = 2;
7640 exp->string = PrintInt(value2 ? (op1->i %= value2) : 0);
7641 if(!exp->expType)
7642 {
7643 exp->expType = op1->type;
7644 if(op1->type)
7645 op1->type->refCount++;
7646 }
7647 return 0x1;
7648 }
7649
7650 static unsigned int UIntModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7651 {
7652 unsigned int value2 = op2->ui;
7653
7654 exp->type = 2;
7655 exp->string = PrintUInt(value2 ? (op1->ui %= value2) : 0);
7656 if(!exp->expType)
7657 {
7658 exp->expType = op1->type;
7659 if(op1->type)
7660 op1->type->refCount++;
7661 }
7662 return 0x1;
7663 }
7664
7665 static unsigned int Int64ModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7666 {
7667 long long value2 = op2->i64;
7668
7669 exp->type = 2;
7670 exp->string = PrintInt64(value2 ? (op1->i64 %= value2) : 0);
7671 if(!exp->expType)
7672 {
7673 exp->expType = op1->type;
7674 if(op1->type)
7675 op1->type->refCount++;
7676 }
7677 return 0x1;
7678 }
7679
7680 static unsigned int UInt64ModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7681 {
7682 uint64 value2 = op2->ui64;
7683
7684 exp->type = 2;
7685 exp->string = PrintUInt64(value2 ? (op1->ui64 %= value2) : 0);
7686 if(!exp->expType)
7687 {
7688 exp->expType = op1->type;
7689 if(op1->type)
7690 op1->type->refCount++;
7691 }
7692 return 0x1;
7693 }
7694
7695 static unsigned int ShortModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7696 {
7697 short value2 = op2->s;
7698
7699 exp->type = 2;
7700 exp->string = PrintShort(value2 ? (op1->s %= value2) : (short)0);
7701 if(!exp->expType)
7702 {
7703 exp->expType = op1->type;
7704 if(op1->type)
7705 op1->type->refCount++;
7706 }
7707 return 0x1;
7708 }
7709
7710 static unsigned int UShortModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7711 {
7712 unsigned short value2 = op2->us;
7713
7714 exp->type = 2;
7715 exp->string = PrintUShort(value2 ? (op1->us %= value2) : (unsigned short)0);
7716 if(!exp->expType)
7717 {
7718 exp->expType = op1->type;
7719 if(op1->type)
7720 op1->type->refCount++;
7721 }
7722 return 0x1;
7723 }
7724
7725 static unsigned int CharModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7726 {
7727 char value2 = op2->c;
7728
7729 exp->type = 2;
7730 exp->string = PrintChar(value2 ? (op1->c %= value2) : (char)0);
7731 if(!exp->expType)
7732 {
7733 exp->expType = op1->type;
7734 if(op1->type)
7735 op1->type->refCount++;
7736 }
7737 return 0x1;
7738 }
7739
7740 static unsigned int UCharModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7741 {
7742 unsigned char value2 = op2->uc;
7743
7744 exp->type = 2;
7745 exp->string = PrintUChar(value2 ? (op1->uc %= value2) : (unsigned char)0);
7746 if(!exp->expType)
7747 {
7748 exp->expType = op1->type;
7749 if(op1->type)
7750 op1->type->refCount++;
7751 }
7752 return 0x1;
7753 }
7754
7755 static unsigned int IntBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7756 {
7757 int value2 = op2->i;
7758
7759 exp->type = 2;
7760 exp->string = PrintInt(op1->i & value2);
7761 if(!exp->expType)
7762 {
7763 exp->expType = op1->type;
7764 if(op1->type)
7765 op1->type->refCount++;
7766 }
7767 return 0x1;
7768 }
7769
7770 static unsigned int UIntBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7771 {
7772 unsigned int value2 = op2->ui;
7773
7774 exp->type = 2;
7775 exp->string = PrintUInt(op1->ui & value2);
7776 if(!exp->expType)
7777 {
7778 exp->expType = op1->type;
7779 if(op1->type)
7780 op1->type->refCount++;
7781 }
7782 return 0x1;
7783 }
7784
7785 static unsigned int Int64BitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7786 {
7787 long long value2 = op2->i64;
7788
7789 exp->type = 2;
7790 exp->string = PrintInt64(op1->i64 & value2);
7791 if(!exp->expType)
7792 {
7793 exp->expType = op1->type;
7794 if(op1->type)
7795 op1->type->refCount++;
7796 }
7797 return 0x1;
7798 }
7799
7800 static unsigned int UInt64BitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7801 {
7802 uint64 value2 = op2->ui64;
7803
7804 exp->type = 2;
7805 exp->string = PrintUInt64(op1->ui64 & value2);
7806 if(!exp->expType)
7807 {
7808 exp->expType = op1->type;
7809 if(op1->type)
7810 op1->type->refCount++;
7811 }
7812 return 0x1;
7813 }
7814
7815 static unsigned int ShortBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7816 {
7817 short value2 = op2->s;
7818
7819 exp->type = 2;
7820 exp->string = PrintShort(op1->s & value2);
7821 if(!exp->expType)
7822 {
7823 exp->expType = op1->type;
7824 if(op1->type)
7825 op1->type->refCount++;
7826 }
7827 return 0x1;
7828 }
7829
7830 static unsigned int UShortBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7831 {
7832 unsigned short value2 = op2->us;
7833
7834 exp->type = 2;
7835 exp->string = PrintUShort(op1->us & value2);
7836 if(!exp->expType)
7837 {
7838 exp->expType = op1->type;
7839 if(op1->type)
7840 op1->type->refCount++;
7841 }
7842 return 0x1;
7843 }
7844
7845 static unsigned int CharBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7846 {
7847 char value2 = op2->c;
7848
7849 exp->type = 2;
7850 exp->string = PrintChar(op1->c & value2);
7851 if(!exp->expType)
7852 {
7853 exp->expType = op1->type;
7854 if(op1->type)
7855 op1->type->refCount++;
7856 }
7857 return 0x1;
7858 }
7859
7860 static unsigned int UCharBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7861 {
7862 unsigned char value2 = op2->uc;
7863
7864 exp->type = 2;
7865 exp->string = PrintUChar(op1->uc & value2);
7866 if(!exp->expType)
7867 {
7868 exp->expType = op1->type;
7869 if(op1->type)
7870 op1->type->refCount++;
7871 }
7872 return 0x1;
7873 }
7874
7875 static unsigned int IntBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7876 {
7877 int value2 = op2->i;
7878
7879 exp->type = 2;
7880 exp->string = PrintInt(op1->i | value2);
7881 if(!exp->expType)
7882 {
7883 exp->expType = op1->type;
7884 if(op1->type)
7885 op1->type->refCount++;
7886 }
7887 return 0x1;
7888 }
7889
7890 static unsigned int UIntBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7891 {
7892 unsigned int value2 = op2->ui;
7893
7894 exp->type = 2;
7895 exp->string = PrintUInt(op1->ui | value2);
7896 if(!exp->expType)
7897 {
7898 exp->expType = op1->type;
7899 if(op1->type)
7900 op1->type->refCount++;
7901 }
7902 return 0x1;
7903 }
7904
7905 static unsigned int Int64BitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7906 {
7907 long long value2 = op2->i64;
7908
7909 exp->type = 2;
7910 exp->string = PrintInt64(op1->i64 | value2);
7911 if(!exp->expType)
7912 {
7913 exp->expType = op1->type;
7914 if(op1->type)
7915 op1->type->refCount++;
7916 }
7917 return 0x1;
7918 }
7919
7920 static unsigned int UInt64BitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7921 {
7922 uint64 value2 = op2->ui64;
7923
7924 exp->type = 2;
7925 exp->string = PrintUInt64(op1->ui64 | value2);
7926 if(!exp->expType)
7927 {
7928 exp->expType = op1->type;
7929 if(op1->type)
7930 op1->type->refCount++;
7931 }
7932 return 0x1;
7933 }
7934
7935 static unsigned int ShortBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7936 {
7937 short value2 = op2->s;
7938
7939 exp->type = 2;
7940 exp->string = PrintShort(op1->s | value2);
7941 if(!exp->expType)
7942 {
7943 exp->expType = op1->type;
7944 if(op1->type)
7945 op1->type->refCount++;
7946 }
7947 return 0x1;
7948 }
7949
7950 static unsigned int UShortBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7951 {
7952 unsigned short value2 = op2->us;
7953
7954 exp->type = 2;
7955 exp->string = PrintUShort(op1->us | value2);
7956 if(!exp->expType)
7957 {
7958 exp->expType = op1->type;
7959 if(op1->type)
7960 op1->type->refCount++;
7961 }
7962 return 0x1;
7963 }
7964
7965 static unsigned int CharBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7966 {
7967 char value2 = op2->c;
7968
7969 exp->type = 2;
7970 exp->string = PrintChar(op1->c | value2);
7971 if(!exp->expType)
7972 {
7973 exp->expType = op1->type;
7974 if(op1->type)
7975 op1->type->refCount++;
7976 }
7977 return 0x1;
7978 }
7979
7980 static unsigned int UCharBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7981 {
7982 unsigned char value2 = op2->uc;
7983
7984 exp->type = 2;
7985 exp->string = PrintUChar(op1->uc | value2);
7986 if(!exp->expType)
7987 {
7988 exp->expType = op1->type;
7989 if(op1->type)
7990 op1->type->refCount++;
7991 }
7992 return 0x1;
7993 }
7994
7995 static unsigned int IntBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7996 {
7997 int value2 = op2->i;
7998
7999 exp->type = 2;
8000 exp->string = PrintInt(op1->i ^ value2);
8001 if(!exp->expType)
8002 {
8003 exp->expType = op1->type;
8004 if(op1->type)
8005 op1->type->refCount++;
8006 }
8007 return 0x1;
8008 }
8009
8010 static unsigned int UIntBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8011 {
8012 unsigned int value2 = op2->ui;
8013
8014 exp->type = 2;
8015 exp->string = PrintUInt(op1->ui ^ value2);
8016 if(!exp->expType)
8017 {
8018 exp->expType = op1->type;
8019 if(op1->type)
8020 op1->type->refCount++;
8021 }
8022 return 0x1;
8023 }
8024
8025 static unsigned int Int64BitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8026 {
8027 long long value2 = op2->i64;
8028
8029 exp->type = 2;
8030 exp->string = PrintInt64(op1->i64 ^ value2);
8031 if(!exp->expType)
8032 {
8033 exp->expType = op1->type;
8034 if(op1->type)
8035 op1->type->refCount++;
8036 }
8037 return 0x1;
8038 }
8039
8040 static unsigned int UInt64BitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8041 {
8042 uint64 value2 = op2->ui64;
8043
8044 exp->type = 2;
8045 exp->string = PrintUInt64(op1->ui64 ^ value2);
8046 if(!exp->expType)
8047 {
8048 exp->expType = op1->type;
8049 if(op1->type)
8050 op1->type->refCount++;
8051 }
8052 return 0x1;
8053 }
8054
8055 static unsigned int ShortBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8056 {
8057 short value2 = op2->s;
8058
8059 exp->type = 2;
8060 exp->string = PrintShort(op1->s ^ value2);
8061 if(!exp->expType)
8062 {
8063 exp->expType = op1->type;
8064 if(op1->type)
8065 op1->type->refCount++;
8066 }
8067 return 0x1;
8068 }
8069
8070 static unsigned int UShortBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8071 {
8072 unsigned short value2 = op2->us;
8073
8074 exp->type = 2;
8075 exp->string = PrintUShort(op1->us ^ value2);
8076 if(!exp->expType)
8077 {
8078 exp->expType = op1->type;
8079 if(op1->type)
8080 op1->type->refCount++;
8081 }
8082 return 0x1;
8083 }
8084
8085 static unsigned int CharBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8086 {
8087 char value2 = op2->c;
8088
8089 exp->type = 2;
8090 exp->string = PrintChar(op1->c ^ value2);
8091 if(!exp->expType)
8092 {
8093 exp->expType = op1->type;
8094 if(op1->type)
8095 op1->type->refCount++;
8096 }
8097 return 0x1;
8098 }
8099
8100 static unsigned int UCharBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8101 {
8102 unsigned char value2 = op2->uc;
8103
8104 exp->type = 2;
8105 exp->string = PrintUChar(op1->uc ^ value2);
8106 if(!exp->expType)
8107 {
8108 exp->expType = op1->type;
8109 if(op1->type)
8110 op1->type->refCount++;
8111 }
8112 return 0x1;
8113 }
8114
8115 static unsigned int IntLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8116 {
8117 int value2 = op2->i;
8118
8119 exp->type = 2;
8120 exp->string = PrintInt(op1->i << value2);
8121 if(!exp->expType)
8122 {
8123 exp->expType = op1->type;
8124 if(op1->type)
8125 op1->type->refCount++;
8126 }
8127 return 0x1;
8128 }
8129
8130 static unsigned int UIntLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8131 {
8132 unsigned int value2 = op2->ui;
8133
8134 exp->type = 2;
8135 exp->string = PrintUInt(op1->ui << value2);
8136 if(!exp->expType)
8137 {
8138 exp->expType = op1->type;
8139 if(op1->type)
8140 op1->type->refCount++;
8141 }
8142 return 0x1;
8143 }
8144
8145 static unsigned int Int64LShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8146 {
8147 long long value2 = op2->i64;
8148
8149 exp->type = 2;
8150 exp->string = PrintInt64(op1->i64 << value2);
8151 if(!exp->expType)
8152 {
8153 exp->expType = op1->type;
8154 if(op1->type)
8155 op1->type->refCount++;
8156 }
8157 return 0x1;
8158 }
8159
8160 static unsigned int UInt64LShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8161 {
8162 uint64 value2 = op2->ui64;
8163
8164 exp->type = 2;
8165 exp->string = PrintUInt64(op1->ui64 << value2);
8166 if(!exp->expType)
8167 {
8168 exp->expType = op1->type;
8169 if(op1->type)
8170 op1->type->refCount++;
8171 }
8172 return 0x1;
8173 }
8174
8175 static unsigned int ShortLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8176 {
8177 short value2 = op2->s;
8178
8179 exp->type = 2;
8180 exp->string = PrintShort(op1->s << value2);
8181 if(!exp->expType)
8182 {
8183 exp->expType = op1->type;
8184 if(op1->type)
8185 op1->type->refCount++;
8186 }
8187 return 0x1;
8188 }
8189
8190 static unsigned int UShortLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8191 {
8192 unsigned short value2 = op2->us;
8193
8194 exp->type = 2;
8195 exp->string = PrintUShort(op1->us << value2);
8196 if(!exp->expType)
8197 {
8198 exp->expType = op1->type;
8199 if(op1->type)
8200 op1->type->refCount++;
8201 }
8202 return 0x1;
8203 }
8204
8205 static unsigned int CharLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8206 {
8207 char value2 = op2->c;
8208
8209 exp->type = 2;
8210 exp->string = PrintChar(op1->c << value2);
8211 if(!exp->expType)
8212 {
8213 exp->expType = op1->type;
8214 if(op1->type)
8215 op1->type->refCount++;
8216 }
8217 return 0x1;
8218 }
8219
8220 static unsigned int UCharLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8221 {
8222 unsigned char value2 = op2->uc;
8223
8224 exp->type = 2;
8225 exp->string = PrintUChar(op1->uc << value2);
8226 if(!exp->expType)
8227 {
8228 exp->expType = op1->type;
8229 if(op1->type)
8230 op1->type->refCount++;
8231 }
8232 return 0x1;
8233 }
8234
8235 static unsigned int IntRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8236 {
8237 int value2 = op2->i;
8238
8239 exp->type = 2;
8240 exp->string = PrintInt(op1->i >> value2);
8241 if(!exp->expType)
8242 {
8243 exp->expType = op1->type;
8244 if(op1->type)
8245 op1->type->refCount++;
8246 }
8247 return 0x1;
8248 }
8249
8250 static unsigned int UIntRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8251 {
8252 unsigned int value2 = op2->ui;
8253
8254 exp->type = 2;
8255 exp->string = PrintUInt(op1->ui >> value2);
8256 if(!exp->expType)
8257 {
8258 exp->expType = op1->type;
8259 if(op1->type)
8260 op1->type->refCount++;
8261 }
8262 return 0x1;
8263 }
8264
8265 static unsigned int Int64RShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8266 {
8267 long long value2 = op2->i64;
8268
8269 exp->type = 2;
8270 exp->string = PrintInt64(op1->i64 >> value2);
8271 if(!exp->expType)
8272 {
8273 exp->expType = op1->type;
8274 if(op1->type)
8275 op1->type->refCount++;
8276 }
8277 return 0x1;
8278 }
8279
8280 static unsigned int UInt64RShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8281 {
8282 uint64 value2 = op2->ui64;
8283
8284 exp->type = 2;
8285 exp->string = PrintUInt64(op1->ui64 >> value2);
8286 if(!exp->expType)
8287 {
8288 exp->expType = op1->type;
8289 if(op1->type)
8290 op1->type->refCount++;
8291 }
8292 return 0x1;
8293 }
8294
8295 static unsigned int ShortRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8296 {
8297 short value2 = op2->s;
8298
8299 exp->type = 2;
8300 exp->string = PrintShort(op1->s >> value2);
8301 if(!exp->expType)
8302 {
8303 exp->expType = op1->type;
8304 if(op1->type)
8305 op1->type->refCount++;
8306 }
8307 return 0x1;
8308 }
8309
8310 static unsigned int UShortRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8311 {
8312 unsigned short value2 = op2->us;
8313
8314 exp->type = 2;
8315 exp->string = PrintUShort(op1->us >> value2);
8316 if(!exp->expType)
8317 {
8318 exp->expType = op1->type;
8319 if(op1->type)
8320 op1->type->refCount++;
8321 }
8322 return 0x1;
8323 }
8324
8325 static unsigned int CharRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8326 {
8327 char value2 = op2->c;
8328
8329 exp->type = 2;
8330 exp->string = PrintChar(op1->c >> value2);
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 UCharRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8341 {
8342 unsigned char value2 = op2->uc;
8343
8344 exp->type = 2;
8345 exp->string = PrintUChar(op1->uc >> value2);
8346 if(!exp->expType)
8347 {
8348 exp->expType = op1->type;
8349 if(op1->type)
8350 op1->type->refCount++;
8351 }
8352 return 0x1;
8353 }
8354
8355 static unsigned int IntBitNot(struct Expression * exp, struct Operand * op1)
8356 {
8357 exp->type = 2;
8358 exp->string = PrintInt((~op1->i));
8359 if(!exp->expType)
8360 {
8361 exp->expType = op1->type;
8362 if(op1->type)
8363 op1->type->refCount++;
8364 }
8365 return 0x1;
8366 }
8367
8368 static unsigned int UIntBitNot(struct Expression * exp, struct Operand * op1)
8369 {
8370 exp->type = 2;
8371 exp->string = PrintUInt((unsigned int)(~op1->ui));
8372 if(!exp->expType)
8373 {
8374 exp->expType = op1->type;
8375 if(op1->type)
8376 op1->type->refCount++;
8377 }
8378 return 0x1;
8379 }
8380
8381 static unsigned int Int64BitNot(struct Expression * exp, struct Operand * op1)
8382 {
8383 exp->type = 2;
8384 exp->string = PrintInt64((long long)(~op1->i64));
8385 if(!exp->expType)
8386 {
8387 exp->expType = op1->type;
8388 if(op1->type)
8389 op1->type->refCount++;
8390 }
8391 return 0x1;
8392 }
8393
8394 static unsigned int UInt64BitNot(struct Expression * exp, struct Operand * op1)
8395 {
8396 exp->type = 2;
8397 exp->string = PrintUInt64((uint64)(~op1->ui64));
8398 if(!exp->expType)
8399 {
8400 exp->expType = op1->type;
8401 if(op1->type)
8402 op1->type->refCount++;
8403 }
8404 return 0x1;
8405 }
8406
8407 static unsigned int ShortBitNot(struct Expression * exp, struct Operand * op1)
8408 {
8409 exp->type = 2;
8410 exp->string = PrintShort((short)(~op1->s));
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 UShortBitNot(struct Expression * exp, struct Operand * op1)
8421 {
8422 exp->type = 2;
8423 exp->string = PrintUShort((unsigned short)(~op1->us));
8424 if(!exp->expType)
8425 {
8426 exp->expType = op1->type;
8427 if(op1->type)
8428 op1->type->refCount++;
8429 }
8430 return 0x1;
8431 }
8432
8433 static unsigned int CharBitNot(struct Expression * exp, struct Operand * op1)
8434 {
8435 exp->type = 2;
8436 exp->string = PrintChar((char)(~op1->c));
8437 if(!exp->expType)
8438 {
8439 exp->expType = op1->type;
8440 if(op1->type)
8441 op1->type->refCount++;
8442 }
8443 return 0x1;
8444 }
8445
8446 static unsigned int UCharBitNot(struct Expression * exp, struct Operand * op1)
8447 {
8448 exp->type = 2;
8449 exp->string = PrintUChar((unsigned char)(~op1->uc));
8450 if(!exp->expType)
8451 {
8452 exp->expType = op1->type;
8453 if(op1->type)
8454 op1->type->refCount++;
8455 }
8456 return 0x1;
8457 }
8458
8459 static unsigned int IntAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8460 {
8461 int value2 = op2->i;
8462
8463 exp->type = 2;
8464 exp->string = PrintInt(op1->i &= value2);
8465 if(!exp->expType)
8466 {
8467 exp->expType = op1->type;
8468 if(op1->type)
8469 op1->type->refCount++;
8470 }
8471 return 0x1;
8472 }
8473
8474 static unsigned int UIntAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8475 {
8476 unsigned int value2 = op2->ui;
8477
8478 exp->type = 2;
8479 exp->string = PrintUInt(op1->ui &= value2);
8480 if(!exp->expType)
8481 {
8482 exp->expType = op1->type;
8483 if(op1->type)
8484 op1->type->refCount++;
8485 }
8486 return 0x1;
8487 }
8488
8489 static unsigned int Int64AndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8490 {
8491 long long value2 = op2->i64;
8492
8493 exp->type = 2;
8494 exp->string = PrintInt64(op1->i64 &= value2);
8495 if(!exp->expType)
8496 {
8497 exp->expType = op1->type;
8498 if(op1->type)
8499 op1->type->refCount++;
8500 }
8501 return 0x1;
8502 }
8503
8504 static unsigned int UInt64AndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8505 {
8506 uint64 value2 = op2->ui64;
8507
8508 exp->type = 2;
8509 exp->string = PrintUInt64(op1->ui64 &= value2);
8510 if(!exp->expType)
8511 {
8512 exp->expType = op1->type;
8513 if(op1->type)
8514 op1->type->refCount++;
8515 }
8516 return 0x1;
8517 }
8518
8519 static unsigned int ShortAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8520 {
8521 short value2 = op2->s;
8522
8523 exp->type = 2;
8524 exp->string = PrintShort(op1->s &= value2);
8525 if(!exp->expType)
8526 {
8527 exp->expType = op1->type;
8528 if(op1->type)
8529 op1->type->refCount++;
8530 }
8531 return 0x1;
8532 }
8533
8534 static unsigned int UShortAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8535 {
8536 unsigned short value2 = op2->us;
8537
8538 exp->type = 2;
8539 exp->string = PrintUShort(op1->us &= value2);
8540 if(!exp->expType)
8541 {
8542 exp->expType = op1->type;
8543 if(op1->type)
8544 op1->type->refCount++;
8545 }
8546 return 0x1;
8547 }
8548
8549 static unsigned int CharAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8550 {
8551 char value2 = op2->c;
8552
8553 exp->type = 2;
8554 exp->string = PrintChar(op1->c &= value2);
8555 if(!exp->expType)
8556 {
8557 exp->expType = op1->type;
8558 if(op1->type)
8559 op1->type->refCount++;
8560 }
8561 return 0x1;
8562 }
8563
8564 static unsigned int UCharAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8565 {
8566 unsigned char value2 = op2->uc;
8567
8568 exp->type = 2;
8569 exp->string = PrintUChar(op1->uc &= value2);
8570 if(!exp->expType)
8571 {
8572 exp->expType = op1->type;
8573 if(op1->type)
8574 op1->type->refCount++;
8575 }
8576 return 0x1;
8577 }
8578
8579 static unsigned int IntOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8580 {
8581 int value2 = op2->i;
8582
8583 exp->type = 2;
8584 exp->string = PrintInt(op1->i |= value2);
8585 if(!exp->expType)
8586 {
8587 exp->expType = op1->type;
8588 if(op1->type)
8589 op1->type->refCount++;
8590 }
8591 return 0x1;
8592 }
8593
8594 static unsigned int UIntOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8595 {
8596 unsigned int value2 = op2->ui;
8597
8598 exp->type = 2;
8599 exp->string = PrintUInt(op1->ui |= value2);
8600 if(!exp->expType)
8601 {
8602 exp->expType = op1->type;
8603 if(op1->type)
8604 op1->type->refCount++;
8605 }
8606 return 0x1;
8607 }
8608
8609 static unsigned int Int64OrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8610 {
8611 long long value2 = op2->i64;
8612
8613 exp->type = 2;
8614 exp->string = PrintInt64(op1->i64 |= value2);
8615 if(!exp->expType)
8616 {
8617 exp->expType = op1->type;
8618 if(op1->type)
8619 op1->type->refCount++;
8620 }
8621 return 0x1;
8622 }
8623
8624 static unsigned int UInt64OrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8625 {
8626 uint64 value2 = op2->ui64;
8627
8628 exp->type = 2;
8629 exp->string = PrintUInt64(op1->ui64 |= value2);
8630 if(!exp->expType)
8631 {
8632 exp->expType = op1->type;
8633 if(op1->type)
8634 op1->type->refCount++;
8635 }
8636 return 0x1;
8637 }
8638
8639 static unsigned int ShortOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8640 {
8641 short value2 = op2->s;
8642
8643 exp->type = 2;
8644 exp->string = PrintShort(op1->s |= value2);
8645 if(!exp->expType)
8646 {
8647 exp->expType = op1->type;
8648 if(op1->type)
8649 op1->type->refCount++;
8650 }
8651 return 0x1;
8652 }
8653
8654 static unsigned int UShortOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8655 {
8656 unsigned short value2 = op2->us;
8657
8658 exp->type = 2;
8659 exp->string = PrintUShort(op1->us |= value2);
8660 if(!exp->expType)
8661 {
8662 exp->expType = op1->type;
8663 if(op1->type)
8664 op1->type->refCount++;
8665 }
8666 return 0x1;
8667 }
8668
8669 static unsigned int CharOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8670 {
8671 char value2 = op2->c;
8672
8673 exp->type = 2;
8674 exp->string = PrintChar(op1->c |= value2);
8675 if(!exp->expType)
8676 {
8677 exp->expType = op1->type;
8678 if(op1->type)
8679 op1->type->refCount++;
8680 }
8681 return 0x1;
8682 }
8683
8684 static unsigned int UCharOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8685 {
8686 unsigned char value2 = op2->uc;
8687
8688 exp->type = 2;
8689 exp->string = PrintUChar(op1->uc |= value2);
8690 if(!exp->expType)
8691 {
8692 exp->expType = op1->type;
8693 if(op1->type)
8694 op1->type->refCount++;
8695 }
8696 return 0x1;
8697 }
8698
8699 static unsigned int IntXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8700 {
8701 int value2 = op2->i;
8702
8703 exp->type = 2;
8704 exp->string = PrintInt(op1->i ^= value2);
8705 if(!exp->expType)
8706 {
8707 exp->expType = op1->type;
8708 if(op1->type)
8709 op1->type->refCount++;
8710 }
8711 return 0x1;
8712 }
8713
8714 static unsigned int UIntXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8715 {
8716 unsigned int value2 = op2->ui;
8717
8718 exp->type = 2;
8719 exp->string = PrintUInt(op1->ui ^= value2);
8720 if(!exp->expType)
8721 {
8722 exp->expType = op1->type;
8723 if(op1->type)
8724 op1->type->refCount++;
8725 }
8726 return 0x1;
8727 }
8728
8729 static unsigned int Int64XorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8730 {
8731 long long value2 = op2->i64;
8732
8733 exp->type = 2;
8734 exp->string = PrintInt64(op1->i64 ^= value2);
8735 if(!exp->expType)
8736 {
8737 exp->expType = op1->type;
8738 if(op1->type)
8739 op1->type->refCount++;
8740 }
8741 return 0x1;
8742 }
8743
8744 static unsigned int UInt64XorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8745 {
8746 uint64 value2 = op2->ui64;
8747
8748 exp->type = 2;
8749 exp->string = PrintUInt64(op1->ui64 ^= value2);
8750 if(!exp->expType)
8751 {
8752 exp->expType = op1->type;
8753 if(op1->type)
8754 op1->type->refCount++;
8755 }
8756 return 0x1;
8757 }
8758
8759 static unsigned int ShortXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8760 {
8761 short value2 = op2->s;
8762
8763 exp->type = 2;
8764 exp->string = PrintShort(op1->s ^= value2);
8765 if(!exp->expType)
8766 {
8767 exp->expType = op1->type;
8768 if(op1->type)
8769 op1->type->refCount++;
8770 }
8771 return 0x1;
8772 }
8773
8774 static unsigned int UShortXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8775 {
8776 unsigned short value2 = op2->us;
8777
8778 exp->type = 2;
8779 exp->string = PrintUShort(op1->us ^= value2);
8780 if(!exp->expType)
8781 {
8782 exp->expType = op1->type;
8783 if(op1->type)
8784 op1->type->refCount++;
8785 }
8786 return 0x1;
8787 }
8788
8789 static unsigned int CharXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8790 {
8791 char value2 = op2->c;
8792
8793 exp->type = 2;
8794 exp->string = PrintChar(op1->c ^= value2);
8795 if(!exp->expType)
8796 {
8797 exp->expType = op1->type;
8798 if(op1->type)
8799 op1->type->refCount++;
8800 }
8801 return 0x1;
8802 }
8803
8804 static unsigned int UCharXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8805 {
8806 unsigned char value2 = op2->uc;
8807
8808 exp->type = 2;
8809 exp->string = PrintUChar(op1->uc ^= value2);
8810 if(!exp->expType)
8811 {
8812 exp->expType = op1->type;
8813 if(op1->type)
8814 op1->type->refCount++;
8815 }
8816 return 0x1;
8817 }
8818
8819 static unsigned int IntLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8820 {
8821 int value2 = op2->i;
8822
8823 exp->type = 2;
8824 exp->string = PrintInt(op1->i <<= value2);
8825 if(!exp->expType)
8826 {
8827 exp->expType = op1->type;
8828 if(op1->type)
8829 op1->type->refCount++;
8830 }
8831 return 0x1;
8832 }
8833
8834 static unsigned int UIntLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8835 {
8836 unsigned int value2 = op2->ui;
8837
8838 exp->type = 2;
8839 exp->string = PrintUInt(op1->ui <<= value2);
8840 if(!exp->expType)
8841 {
8842 exp->expType = op1->type;
8843 if(op1->type)
8844 op1->type->refCount++;
8845 }
8846 return 0x1;
8847 }
8848
8849 static unsigned int Int64LShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8850 {
8851 long long value2 = op2->i64;
8852
8853 exp->type = 2;
8854 exp->string = PrintInt64(op1->i64 <<= value2);
8855 if(!exp->expType)
8856 {
8857 exp->expType = op1->type;
8858 if(op1->type)
8859 op1->type->refCount++;
8860 }
8861 return 0x1;
8862 }
8863
8864 static unsigned int UInt64LShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8865 {
8866 uint64 value2 = op2->ui64;
8867
8868 exp->type = 2;
8869 exp->string = PrintUInt64(op1->ui64 <<= value2);
8870 if(!exp->expType)
8871 {
8872 exp->expType = op1->type;
8873 if(op1->type)
8874 op1->type->refCount++;
8875 }
8876 return 0x1;
8877 }
8878
8879 static unsigned int ShortLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8880 {
8881 short value2 = op2->s;
8882
8883 exp->type = 2;
8884 exp->string = PrintShort(op1->s <<= value2);
8885 if(!exp->expType)
8886 {
8887 exp->expType = op1->type;
8888 if(op1->type)
8889 op1->type->refCount++;
8890 }
8891 return 0x1;
8892 }
8893
8894 static unsigned int UShortLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8895 {
8896 unsigned short value2 = op2->us;
8897
8898 exp->type = 2;
8899 exp->string = PrintUShort(op1->us <<= value2);
8900 if(!exp->expType)
8901 {
8902 exp->expType = op1->type;
8903 if(op1->type)
8904 op1->type->refCount++;
8905 }
8906 return 0x1;
8907 }
8908
8909 static unsigned int CharLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8910 {
8911 char value2 = op2->c;
8912
8913 exp->type = 2;
8914 exp->string = PrintChar(op1->c <<= value2);
8915 if(!exp->expType)
8916 {
8917 exp->expType = op1->type;
8918 if(op1->type)
8919 op1->type->refCount++;
8920 }
8921 return 0x1;
8922 }
8923
8924 static unsigned int UCharLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8925 {
8926 unsigned char value2 = op2->uc;
8927
8928 exp->type = 2;
8929 exp->string = PrintUChar(op1->uc <<= value2);
8930 if(!exp->expType)
8931 {
8932 exp->expType = op1->type;
8933 if(op1->type)
8934 op1->type->refCount++;
8935 }
8936 return 0x1;
8937 }
8938
8939 static unsigned int IntRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8940 {
8941 int value2 = op2->i;
8942
8943 exp->type = 2;
8944 exp->string = PrintInt(op1->i >>= value2);
8945 if(!exp->expType)
8946 {
8947 exp->expType = op1->type;
8948 if(op1->type)
8949 op1->type->refCount++;
8950 }
8951 return 0x1;
8952 }
8953
8954 static unsigned int UIntRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8955 {
8956 unsigned int value2 = op2->ui;
8957
8958 exp->type = 2;
8959 exp->string = PrintUInt(op1->ui >>= value2);
8960 if(!exp->expType)
8961 {
8962 exp->expType = op1->type;
8963 if(op1->type)
8964 op1->type->refCount++;
8965 }
8966 return 0x1;
8967 }
8968
8969 static unsigned int Int64RShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8970 {
8971 long long value2 = op2->i64;
8972
8973 exp->type = 2;
8974 exp->string = PrintInt64(op1->i64 >>= value2);
8975 if(!exp->expType)
8976 {
8977 exp->expType = op1->type;
8978 if(op1->type)
8979 op1->type->refCount++;
8980 }
8981 return 0x1;
8982 }
8983
8984 static unsigned int UInt64RShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8985 {
8986 uint64 value2 = op2->ui64;
8987
8988 exp->type = 2;
8989 exp->string = PrintUInt64(op1->ui64 >>= value2);
8990 if(!exp->expType)
8991 {
8992 exp->expType = op1->type;
8993 if(op1->type)
8994 op1->type->refCount++;
8995 }
8996 return 0x1;
8997 }
8998
8999 static unsigned int ShortRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9000 {
9001 short value2 = op2->s;
9002
9003 exp->type = 2;
9004 exp->string = PrintShort(op1->s >>= value2);
9005 if(!exp->expType)
9006 {
9007 exp->expType = op1->type;
9008 if(op1->type)
9009 op1->type->refCount++;
9010 }
9011 return 0x1;
9012 }
9013
9014 static unsigned int UShortRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9015 {
9016 unsigned short value2 = op2->us;
9017
9018 exp->type = 2;
9019 exp->string = PrintUShort(op1->us >>= value2);
9020 if(!exp->expType)
9021 {
9022 exp->expType = op1->type;
9023 if(op1->type)
9024 op1->type->refCount++;
9025 }
9026 return 0x1;
9027 }
9028
9029 static unsigned int CharRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9030 {
9031 char value2 = op2->c;
9032
9033 exp->type = 2;
9034 exp->string = PrintChar(op1->c >>= value2);
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 UCharRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9045 {
9046 unsigned char value2 = op2->uc;
9047
9048 exp->type = 2;
9049 exp->string = PrintUChar(op1->uc >>= value2);
9050 if(!exp->expType)
9051 {
9052 exp->expType = op1->type;
9053 if(op1->type)
9054 op1->type->refCount++;
9055 }
9056 return 0x1;
9057 }
9058
9059 static unsigned int IntNot(struct Expression * exp, struct Operand * op1)
9060 {
9061 exp->type = 2;
9062 exp->string = PrintInt((int)(!op1->i));
9063 if(!exp->expType)
9064 {
9065 exp->expType = op1->type;
9066 if(op1->type)
9067 op1->type->refCount++;
9068 }
9069 return 0x1;
9070 }
9071
9072 static unsigned int UIntNot(struct Expression * exp, struct Operand * op1)
9073 {
9074 exp->type = 2;
9075 exp->string = PrintUInt((unsigned int)(!op1->ui));
9076 if(!exp->expType)
9077 {
9078 exp->expType = op1->type;
9079 if(op1->type)
9080 op1->type->refCount++;
9081 }
9082 return 0x1;
9083 }
9084
9085 static unsigned int Int64Not(struct Expression * exp, struct Operand * op1)
9086 {
9087 exp->type = 2;
9088 exp->string = PrintInt64((long long)(!op1->i64));
9089 if(!exp->expType)
9090 {
9091 exp->expType = op1->type;
9092 if(op1->type)
9093 op1->type->refCount++;
9094 }
9095 return 0x1;
9096 }
9097
9098 static unsigned int UInt64Not(struct Expression * exp, struct Operand * op1)
9099 {
9100 exp->type = 2;
9101 exp->string = PrintUInt64((uint64)(!op1->ui64));
9102 if(!exp->expType)
9103 {
9104 exp->expType = op1->type;
9105 if(op1->type)
9106 op1->type->refCount++;
9107 }
9108 return 0x1;
9109 }
9110
9111 static unsigned int ShortNot(struct Expression * exp, struct Operand * op1)
9112 {
9113 exp->type = 2;
9114 exp->string = PrintShort((short)(!op1->s));
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 UShortNot(struct Expression * exp, struct Operand * op1)
9125 {
9126 exp->type = 2;
9127 exp->string = PrintUShort((unsigned short)(!op1->us));
9128 if(!exp->expType)
9129 {
9130 exp->expType = op1->type;
9131 if(op1->type)
9132 op1->type->refCount++;
9133 }
9134 return 0x1;
9135 }
9136
9137 static unsigned int CharNot(struct Expression * exp, struct Operand * op1)
9138 {
9139 exp->type = 2;
9140 exp->string = PrintChar((char)(!op1->c));
9141 if(!exp->expType)
9142 {
9143 exp->expType = op1->type;
9144 if(op1->type)
9145 op1->type->refCount++;
9146 }
9147 return 0x1;
9148 }
9149
9150 static unsigned int UCharNot(struct Expression * exp, struct Operand * op1)
9151 {
9152 exp->type = 2;
9153 exp->string = PrintUChar((unsigned char)(!op1->uc));
9154 if(!exp->expType)
9155 {
9156 exp->expType = op1->type;
9157 if(op1->type)
9158 op1->type->refCount++;
9159 }
9160 return 0x1;
9161 }
9162
9163 static unsigned int IntEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9164 {
9165 int value2 = op2->i;
9166
9167 exp->type = 2;
9168 exp->string = PrintInt(op1->i == value2);
9169 if(!exp->expType)
9170 {
9171 exp->expType = op1->type;
9172 if(op1->type)
9173 op1->type->refCount++;
9174 }
9175 return 0x1;
9176 }
9177
9178 static unsigned int UIntEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9179 {
9180 unsigned int value2 = op2->ui;
9181
9182 exp->type = 2;
9183 exp->string = PrintUInt(op1->ui == value2);
9184 if(!exp->expType)
9185 {
9186 exp->expType = op1->type;
9187 if(op1->type)
9188 op1->type->refCount++;
9189 }
9190 return 0x1;
9191 }
9192
9193 static unsigned int Int64Equ(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9194 {
9195 long long value2 = op2->i64;
9196
9197 exp->type = 2;
9198 exp->string = PrintInt64(op1->i64 == value2);
9199 if(!exp->expType)
9200 {
9201 exp->expType = op1->type;
9202 if(op1->type)
9203 op1->type->refCount++;
9204 }
9205 return 0x1;
9206 }
9207
9208 static unsigned int UInt64Equ(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9209 {
9210 uint64 value2 = op2->ui64;
9211
9212 exp->type = 2;
9213 exp->string = PrintUInt64(op1->ui64 == value2);
9214 if(!exp->expType)
9215 {
9216 exp->expType = op1->type;
9217 if(op1->type)
9218 op1->type->refCount++;
9219 }
9220 return 0x1;
9221 }
9222
9223 static unsigned int ShortEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9224 {
9225 short value2 = op2->s;
9226
9227 exp->type = 2;
9228 exp->string = PrintShort(op1->s == value2);
9229 if(!exp->expType)
9230 {
9231 exp->expType = op1->type;
9232 if(op1->type)
9233 op1->type->refCount++;
9234 }
9235 return 0x1;
9236 }
9237
9238 static unsigned int UShortEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9239 {
9240 unsigned short value2 = op2->us;
9241
9242 exp->type = 2;
9243 exp->string = PrintUShort(op1->us == value2);
9244 if(!exp->expType)
9245 {
9246 exp->expType = op1->type;
9247 if(op1->type)
9248 op1->type->refCount++;
9249 }
9250 return 0x1;
9251 }
9252
9253 static unsigned int CharEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9254 {
9255 char value2 = op2->c;
9256
9257 exp->type = 2;
9258 exp->string = PrintChar(op1->c == value2);
9259 if(!exp->expType)
9260 {
9261 exp->expType = op1->type;
9262 if(op1->type)
9263 op1->type->refCount++;
9264 }
9265 return 0x1;
9266 }
9267
9268 static unsigned int UCharEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9269 {
9270 unsigned char value2 = op2->uc;
9271
9272 exp->type = 2;
9273 exp->string = PrintUChar(op1->uc == value2);
9274 if(!exp->expType)
9275 {
9276 exp->expType = op1->type;
9277 if(op1->type)
9278 op1->type->refCount++;
9279 }
9280 return 0x1;
9281 }
9282
9283 static unsigned int FloatEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9284 {
9285 float value2 = op2->f;
9286
9287 exp->type = 2;
9288 exp->string = PrintFloat(op1->f == value2);
9289 if(!exp->expType)
9290 {
9291 exp->expType = op1->type;
9292 if(op1->type)
9293 op1->type->refCount++;
9294 }
9295 return 0x1;
9296 }
9297
9298 static unsigned int DoubleEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9299 {
9300 double value2 = op2->d;
9301
9302 exp->type = 2;
9303 exp->string = PrintDouble(op1->d == value2);
9304 if(!exp->expType)
9305 {
9306 exp->expType = op1->type;
9307 if(op1->type)
9308 op1->type->refCount++;
9309 }
9310 return 0x1;
9311 }
9312
9313 static unsigned int IntNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9314 {
9315 int value2 = op2->i;
9316
9317 exp->type = 2;
9318 exp->string = PrintInt(op1->i != value2);
9319 if(!exp->expType)
9320 {
9321 exp->expType = op1->type;
9322 if(op1->type)
9323 op1->type->refCount++;
9324 }
9325 return 0x1;
9326 }
9327
9328 static unsigned int UIntNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9329 {
9330 unsigned int value2 = op2->ui;
9331
9332 exp->type = 2;
9333 exp->string = PrintUInt(op1->ui != value2);
9334 if(!exp->expType)
9335 {
9336 exp->expType = op1->type;
9337 if(op1->type)
9338 op1->type->refCount++;
9339 }
9340 return 0x1;
9341 }
9342
9343 static unsigned int Int64Nqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9344 {
9345 long long value2 = op2->i64;
9346
9347 exp->type = 2;
9348 exp->string = PrintInt64(op1->i64 != value2);
9349 if(!exp->expType)
9350 {
9351 exp->expType = op1->type;
9352 if(op1->type)
9353 op1->type->refCount++;
9354 }
9355 return 0x1;
9356 }
9357
9358 static unsigned int UInt64Nqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9359 {
9360 uint64 value2 = op2->ui64;
9361
9362 exp->type = 2;
9363 exp->string = PrintUInt64(op1->ui64 != value2);
9364 if(!exp->expType)
9365 {
9366 exp->expType = op1->type;
9367 if(op1->type)
9368 op1->type->refCount++;
9369 }
9370 return 0x1;
9371 }
9372
9373 static unsigned int ShortNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9374 {
9375 short value2 = op2->s;
9376
9377 exp->type = 2;
9378 exp->string = PrintShort(op1->s != value2);
9379 if(!exp->expType)
9380 {
9381 exp->expType = op1->type;
9382 if(op1->type)
9383 op1->type->refCount++;
9384 }
9385 return 0x1;
9386 }
9387
9388 static unsigned int UShortNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9389 {
9390 unsigned short value2 = op2->us;
9391
9392 exp->type = 2;
9393 exp->string = PrintUShort(op1->us != value2);
9394 if(!exp->expType)
9395 {
9396 exp->expType = op1->type;
9397 if(op1->type)
9398 op1->type->refCount++;
9399 }
9400 return 0x1;
9401 }
9402
9403 static unsigned int CharNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9404 {
9405 char value2 = op2->c;
9406
9407 exp->type = 2;
9408 exp->string = PrintChar(op1->c != value2);
9409 if(!exp->expType)
9410 {
9411 exp->expType = op1->type;
9412 if(op1->type)
9413 op1->type->refCount++;
9414 }
9415 return 0x1;
9416 }
9417
9418 static unsigned int UCharNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9419 {
9420 unsigned char value2 = op2->uc;
9421
9422 exp->type = 2;
9423 exp->string = PrintUChar(op1->uc != value2);
9424 if(!exp->expType)
9425 {
9426 exp->expType = op1->type;
9427 if(op1->type)
9428 op1->type->refCount++;
9429 }
9430 return 0x1;
9431 }
9432
9433 static unsigned int FloatNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9434 {
9435 float value2 = op2->f;
9436
9437 exp->type = 2;
9438 exp->string = PrintFloat(op1->f != value2);
9439 if(!exp->expType)
9440 {
9441 exp->expType = op1->type;
9442 if(op1->type)
9443 op1->type->refCount++;
9444 }
9445 return 0x1;
9446 }
9447
9448 static unsigned int DoubleNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9449 {
9450 double value2 = op2->d;
9451
9452 exp->type = 2;
9453 exp->string = PrintDouble(op1->d != value2);
9454 if(!exp->expType)
9455 {
9456 exp->expType = op1->type;
9457 if(op1->type)
9458 op1->type->refCount++;
9459 }
9460 return 0x1;
9461 }
9462
9463 static unsigned int IntAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9464 {
9465 int value2 = op2->i;
9466
9467 exp->type = 2;
9468 exp->string = PrintInt(op1->i && value2);
9469 if(!exp->expType)
9470 {
9471 exp->expType = op1->type;
9472 if(op1->type)
9473 op1->type->refCount++;
9474 }
9475 return 0x1;
9476 }
9477
9478 static unsigned int UIntAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9479 {
9480 unsigned int value2 = op2->ui;
9481
9482 exp->type = 2;
9483 exp->string = PrintUInt(op1->ui && value2);
9484 if(!exp->expType)
9485 {
9486 exp->expType = op1->type;
9487 if(op1->type)
9488 op1->type->refCount++;
9489 }
9490 return 0x1;
9491 }
9492
9493 static unsigned int Int64And(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9494 {
9495 long long value2 = op2->i64;
9496
9497 exp->type = 2;
9498 exp->string = PrintInt64(op1->i64 && value2);
9499 if(!exp->expType)
9500 {
9501 exp->expType = op1->type;
9502 if(op1->type)
9503 op1->type->refCount++;
9504 }
9505 return 0x1;
9506 }
9507
9508 static unsigned int UInt64And(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9509 {
9510 uint64 value2 = op2->ui64;
9511
9512 exp->type = 2;
9513 exp->string = PrintUInt64(op1->ui64 && value2);
9514 if(!exp->expType)
9515 {
9516 exp->expType = op1->type;
9517 if(op1->type)
9518 op1->type->refCount++;
9519 }
9520 return 0x1;
9521 }
9522
9523 static unsigned int ShortAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9524 {
9525 short value2 = op2->s;
9526
9527 exp->type = 2;
9528 exp->string = PrintShort(op1->s && value2);
9529 if(!exp->expType)
9530 {
9531 exp->expType = op1->type;
9532 if(op1->type)
9533 op1->type->refCount++;
9534 }
9535 return 0x1;
9536 }
9537
9538 static unsigned int UShortAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9539 {
9540 unsigned short value2 = op2->us;
9541
9542 exp->type = 2;
9543 exp->string = PrintUShort(op1->us && value2);
9544 if(!exp->expType)
9545 {
9546 exp->expType = op1->type;
9547 if(op1->type)
9548 op1->type->refCount++;
9549 }
9550 return 0x1;
9551 }
9552
9553 static unsigned int CharAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9554 {
9555 char value2 = op2->c;
9556
9557 exp->type = 2;
9558 exp->string = PrintChar(op1->c && value2);
9559 if(!exp->expType)
9560 {
9561 exp->expType = op1->type;
9562 if(op1->type)
9563 op1->type->refCount++;
9564 }
9565 return 0x1;
9566 }
9567
9568 static unsigned int UCharAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9569 {
9570 unsigned char value2 = op2->uc;
9571
9572 exp->type = 2;
9573 exp->string = PrintUChar(op1->uc && value2);
9574 if(!exp->expType)
9575 {
9576 exp->expType = op1->type;
9577 if(op1->type)
9578 op1->type->refCount++;
9579 }
9580 return 0x1;
9581 }
9582
9583 static unsigned int FloatAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9584 {
9585 float value2 = op2->f;
9586
9587 exp->type = 2;
9588 exp->string = PrintFloat(op1->f && value2);
9589 if(!exp->expType)
9590 {
9591 exp->expType = op1->type;
9592 if(op1->type)
9593 op1->type->refCount++;
9594 }
9595 return 0x1;
9596 }
9597
9598 static unsigned int DoubleAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9599 {
9600 double value2 = op2->d;
9601
9602 exp->type = 2;
9603 exp->string = PrintDouble(op1->d && value2);
9604 if(!exp->expType)
9605 {
9606 exp->expType = op1->type;
9607 if(op1->type)
9608 op1->type->refCount++;
9609 }
9610 return 0x1;
9611 }
9612
9613 static unsigned int IntOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9614 {
9615 int value2 = op2->i;
9616
9617 exp->type = 2;
9618 exp->string = PrintInt(op1->i || value2);
9619 if(!exp->expType)
9620 {
9621 exp->expType = op1->type;
9622 if(op1->type)
9623 op1->type->refCount++;
9624 }
9625 return 0x1;
9626 }
9627
9628 static unsigned int UIntOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9629 {
9630 unsigned int value2 = op2->ui;
9631
9632 exp->type = 2;
9633 exp->string = PrintUInt(op1->ui || value2);
9634 if(!exp->expType)
9635 {
9636 exp->expType = op1->type;
9637 if(op1->type)
9638 op1->type->refCount++;
9639 }
9640 return 0x1;
9641 }
9642
9643 static unsigned int Int64Or(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9644 {
9645 long long value2 = op2->i64;
9646
9647 exp->type = 2;
9648 exp->string = PrintInt64(op1->i64 || value2);
9649 if(!exp->expType)
9650 {
9651 exp->expType = op1->type;
9652 if(op1->type)
9653 op1->type->refCount++;
9654 }
9655 return 0x1;
9656 }
9657
9658 static unsigned int UInt64Or(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9659 {
9660 uint64 value2 = op2->ui64;
9661
9662 exp->type = 2;
9663 exp->string = PrintUInt64(op1->ui64 || value2);
9664 if(!exp->expType)
9665 {
9666 exp->expType = op1->type;
9667 if(op1->type)
9668 op1->type->refCount++;
9669 }
9670 return 0x1;
9671 }
9672
9673 static unsigned int ShortOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9674 {
9675 short value2 = op2->s;
9676
9677 exp->type = 2;
9678 exp->string = PrintShort(op1->s || value2);
9679 if(!exp->expType)
9680 {
9681 exp->expType = op1->type;
9682 if(op1->type)
9683 op1->type->refCount++;
9684 }
9685 return 0x1;
9686 }
9687
9688 static unsigned int UShortOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9689 {
9690 unsigned short value2 = op2->us;
9691
9692 exp->type = 2;
9693 exp->string = PrintUShort(op1->us || value2);
9694 if(!exp->expType)
9695 {
9696 exp->expType = op1->type;
9697 if(op1->type)
9698 op1->type->refCount++;
9699 }
9700 return 0x1;
9701 }
9702
9703 static unsigned int CharOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9704 {
9705 char value2 = op2->c;
9706
9707 exp->type = 2;
9708 exp->string = PrintChar(op1->c || value2);
9709 if(!exp->expType)
9710 {
9711 exp->expType = op1->type;
9712 if(op1->type)
9713 op1->type->refCount++;
9714 }
9715 return 0x1;
9716 }
9717
9718 static unsigned int UCharOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9719 {
9720 unsigned char value2 = op2->uc;
9721
9722 exp->type = 2;
9723 exp->string = PrintUChar(op1->uc || value2);
9724 if(!exp->expType)
9725 {
9726 exp->expType = op1->type;
9727 if(op1->type)
9728 op1->type->refCount++;
9729 }
9730 return 0x1;
9731 }
9732
9733 static unsigned int FloatOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9734 {
9735 float value2 = op2->f;
9736
9737 exp->type = 2;
9738 exp->string = PrintFloat(op1->f || value2);
9739 if(!exp->expType)
9740 {
9741 exp->expType = op1->type;
9742 if(op1->type)
9743 op1->type->refCount++;
9744 }
9745 return 0x1;
9746 }
9747
9748 static unsigned int DoubleOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9749 {
9750 double value2 = op2->d;
9751
9752 exp->type = 2;
9753 exp->string = PrintDouble(op1->d || value2);
9754 if(!exp->expType)
9755 {
9756 exp->expType = op1->type;
9757 if(op1->type)
9758 op1->type->refCount++;
9759 }
9760 return 0x1;
9761 }
9762
9763 static unsigned int IntGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9764 {
9765 int value2 = op2->i;
9766
9767 exp->type = 2;
9768 exp->string = PrintInt(op1->i > value2);
9769 if(!exp->expType)
9770 {
9771 exp->expType = op1->type;
9772 if(op1->type)
9773 op1->type->refCount++;
9774 }
9775 return 0x1;
9776 }
9777
9778 static unsigned int UIntGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9779 {
9780 unsigned int value2 = op2->ui;
9781
9782 exp->type = 2;
9783 exp->string = PrintUInt(op1->ui > value2);
9784 if(!exp->expType)
9785 {
9786 exp->expType = op1->type;
9787 if(op1->type)
9788 op1->type->refCount++;
9789 }
9790 return 0x1;
9791 }
9792
9793 static unsigned int Int64Grt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9794 {
9795 long long value2 = op2->i64;
9796
9797 exp->type = 2;
9798 exp->string = PrintInt64(op1->i64 > value2);
9799 if(!exp->expType)
9800 {
9801 exp->expType = op1->type;
9802 if(op1->type)
9803 op1->type->refCount++;
9804 }
9805 return 0x1;
9806 }
9807
9808 static unsigned int UInt64Grt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9809 {
9810 uint64 value2 = op2->ui64;
9811
9812 exp->type = 2;
9813 exp->string = PrintUInt64(op1->ui64 > value2);
9814 if(!exp->expType)
9815 {
9816 exp->expType = op1->type;
9817 if(op1->type)
9818 op1->type->refCount++;
9819 }
9820 return 0x1;
9821 }
9822
9823 static unsigned int ShortGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9824 {
9825 short value2 = op2->s;
9826
9827 exp->type = 2;
9828 exp->string = PrintShort(op1->s > value2);
9829 if(!exp->expType)
9830 {
9831 exp->expType = op1->type;
9832 if(op1->type)
9833 op1->type->refCount++;
9834 }
9835 return 0x1;
9836 }
9837
9838 static unsigned int UShortGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9839 {
9840 unsigned short value2 = op2->us;
9841
9842 exp->type = 2;
9843 exp->string = PrintUShort(op1->us > value2);
9844 if(!exp->expType)
9845 {
9846 exp->expType = op1->type;
9847 if(op1->type)
9848 op1->type->refCount++;
9849 }
9850 return 0x1;
9851 }
9852
9853 static unsigned int CharGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9854 {
9855 char value2 = op2->c;
9856
9857 exp->type = 2;
9858 exp->string = PrintChar(op1->c > value2);
9859 if(!exp->expType)
9860 {
9861 exp->expType = op1->type;
9862 if(op1->type)
9863 op1->type->refCount++;
9864 }
9865 return 0x1;
9866 }
9867
9868 static unsigned int UCharGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9869 {
9870 unsigned char value2 = op2->uc;
9871
9872 exp->type = 2;
9873 exp->string = PrintUChar(op1->uc > value2);
9874 if(!exp->expType)
9875 {
9876 exp->expType = op1->type;
9877 if(op1->type)
9878 op1->type->refCount++;
9879 }
9880 return 0x1;
9881 }
9882
9883 static unsigned int FloatGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9884 {
9885 float value2 = op2->f;
9886
9887 exp->type = 2;
9888 exp->string = PrintFloat(op1->f > value2);
9889 if(!exp->expType)
9890 {
9891 exp->expType = op1->type;
9892 if(op1->type)
9893 op1->type->refCount++;
9894 }
9895 return 0x1;
9896 }
9897
9898 static unsigned int DoubleGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9899 {
9900 double value2 = op2->d;
9901
9902 exp->type = 2;
9903 exp->string = PrintDouble(op1->d > value2);
9904 if(!exp->expType)
9905 {
9906 exp->expType = op1->type;
9907 if(op1->type)
9908 op1->type->refCount++;
9909 }
9910 return 0x1;
9911 }
9912
9913 static unsigned int IntSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9914 {
9915 int value2 = op2->i;
9916
9917 exp->type = 2;
9918 exp->string = PrintInt(op1->i < value2);
9919 if(!exp->expType)
9920 {
9921 exp->expType = op1->type;
9922 if(op1->type)
9923 op1->type->refCount++;
9924 }
9925 return 0x1;
9926 }
9927
9928 static unsigned int UIntSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9929 {
9930 unsigned int value2 = op2->ui;
9931
9932 exp->type = 2;
9933 exp->string = PrintUInt(op1->ui < value2);
9934 if(!exp->expType)
9935 {
9936 exp->expType = op1->type;
9937 if(op1->type)
9938 op1->type->refCount++;
9939 }
9940 return 0x1;
9941 }
9942
9943 static unsigned int Int64Sma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9944 {
9945 long long value2 = op2->i64;
9946
9947 exp->type = 2;
9948 exp->string = PrintInt64(op1->i64 < value2);
9949 if(!exp->expType)
9950 {
9951 exp->expType = op1->type;
9952 if(op1->type)
9953 op1->type->refCount++;
9954 }
9955 return 0x1;
9956 }
9957
9958 static unsigned int UInt64Sma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9959 {
9960 uint64 value2 = op2->ui64;
9961
9962 exp->type = 2;
9963 exp->string = PrintUInt64(op1->ui64 < value2);
9964 if(!exp->expType)
9965 {
9966 exp->expType = op1->type;
9967 if(op1->type)
9968 op1->type->refCount++;
9969 }
9970 return 0x1;
9971 }
9972
9973 static unsigned int ShortSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9974 {
9975 short value2 = op2->s;
9976
9977 exp->type = 2;
9978 exp->string = PrintShort(op1->s < value2);
9979 if(!exp->expType)
9980 {
9981 exp->expType = op1->type;
9982 if(op1->type)
9983 op1->type->refCount++;
9984 }
9985 return 0x1;
9986 }
9987
9988 static unsigned int UShortSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9989 {
9990 unsigned short value2 = op2->us;
9991
9992 exp->type = 2;
9993 exp->string = PrintUShort(op1->us < value2);
9994 if(!exp->expType)
9995 {
9996 exp->expType = op1->type;
9997 if(op1->type)
9998 op1->type->refCount++;
9999 }
10000 return 0x1;
10001 }
10002
10003 static unsigned int CharSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10004 {
10005 char value2 = op2->c;
10006
10007 exp->type = 2;
10008 exp->string = PrintChar(op1->c < value2);
10009 if(!exp->expType)
10010 {
10011 exp->expType = op1->type;
10012 if(op1->type)
10013 op1->type->refCount++;
10014 }
10015 return 0x1;
10016 }
10017
10018 static unsigned int UCharSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10019 {
10020 unsigned char value2 = op2->uc;
10021
10022 exp->type = 2;
10023 exp->string = PrintUChar(op1->uc < value2);
10024 if(!exp->expType)
10025 {
10026 exp->expType = op1->type;
10027 if(op1->type)
10028 op1->type->refCount++;
10029 }
10030 return 0x1;
10031 }
10032
10033 static unsigned int FloatSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10034 {
10035 float value2 = op2->f;
10036
10037 exp->type = 2;
10038 exp->string = PrintFloat(op1->f < value2);
10039 if(!exp->expType)
10040 {
10041 exp->expType = op1->type;
10042 if(op1->type)
10043 op1->type->refCount++;
10044 }
10045 return 0x1;
10046 }
10047
10048 static unsigned int DoubleSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10049 {
10050 double value2 = op2->d;
10051
10052 exp->type = 2;
10053 exp->string = PrintDouble(op1->d < value2);
10054 if(!exp->expType)
10055 {
10056 exp->expType = op1->type;
10057 if(op1->type)
10058 op1->type->refCount++;
10059 }
10060 return 0x1;
10061 }
10062
10063 static unsigned int IntGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10064 {
10065 int value2 = op2->i;
10066
10067 exp->type = 2;
10068 exp->string = PrintInt(op1->i >= value2);
10069 if(!exp->expType)
10070 {
10071 exp->expType = op1->type;
10072 if(op1->type)
10073 op1->type->refCount++;
10074 }
10075 return 0x1;
10076 }
10077
10078 static unsigned int UIntGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10079 {
10080 unsigned int value2 = op2->ui;
10081
10082 exp->type = 2;
10083 exp->string = PrintUInt(op1->ui >= value2);
10084 if(!exp->expType)
10085 {
10086 exp->expType = op1->type;
10087 if(op1->type)
10088 op1->type->refCount++;
10089 }
10090 return 0x1;
10091 }
10092
10093 static unsigned int Int64GrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10094 {
10095 long long value2 = op2->i64;
10096
10097 exp->type = 2;
10098 exp->string = PrintInt64(op1->i64 >= value2);
10099 if(!exp->expType)
10100 {
10101 exp->expType = op1->type;
10102 if(op1->type)
10103 op1->type->refCount++;
10104 }
10105 return 0x1;
10106 }
10107
10108 static unsigned int UInt64GrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10109 {
10110 uint64 value2 = op2->ui64;
10111
10112 exp->type = 2;
10113 exp->string = PrintUInt64(op1->ui64 >= value2);
10114 if(!exp->expType)
10115 {
10116 exp->expType = op1->type;
10117 if(op1->type)
10118 op1->type->refCount++;
10119 }
10120 return 0x1;
10121 }
10122
10123 static unsigned int ShortGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10124 {
10125 short value2 = op2->s;
10126
10127 exp->type = 2;
10128 exp->string = PrintShort(op1->s >= value2);
10129 if(!exp->expType)
10130 {
10131 exp->expType = op1->type;
10132 if(op1->type)
10133 op1->type->refCount++;
10134 }
10135 return 0x1;
10136 }
10137
10138 static unsigned int UShortGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10139 {
10140 unsigned short value2 = op2->us;
10141
10142 exp->type = 2;
10143 exp->string = PrintUShort(op1->us >= value2);
10144 if(!exp->expType)
10145 {
10146 exp->expType = op1->type;
10147 if(op1->type)
10148 op1->type->refCount++;
10149 }
10150 return 0x1;
10151 }
10152
10153 static unsigned int CharGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10154 {
10155 char value2 = op2->c;
10156
10157 exp->type = 2;
10158 exp->string = PrintChar(op1->c >= value2);
10159 if(!exp->expType)
10160 {
10161 exp->expType = op1->type;
10162 if(op1->type)
10163 op1->type->refCount++;
10164 }
10165 return 0x1;
10166 }
10167
10168 static unsigned int UCharGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10169 {
10170 unsigned char value2 = op2->uc;
10171
10172 exp->type = 2;
10173 exp->string = PrintUChar(op1->uc >= value2);
10174 if(!exp->expType)
10175 {
10176 exp->expType = op1->type;
10177 if(op1->type)
10178 op1->type->refCount++;
10179 }
10180 return 0x1;
10181 }
10182
10183 static unsigned int FloatGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10184 {
10185 float value2 = op2->f;
10186
10187 exp->type = 2;
10188 exp->string = PrintFloat(op1->f >= value2);
10189 if(!exp->expType)
10190 {
10191 exp->expType = op1->type;
10192 if(op1->type)
10193 op1->type->refCount++;
10194 }
10195 return 0x1;
10196 }
10197
10198 static unsigned int DoubleGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10199 {
10200 double value2 = op2->d;
10201
10202 exp->type = 2;
10203 exp->string = PrintDouble(op1->d >= value2);
10204 if(!exp->expType)
10205 {
10206 exp->expType = op1->type;
10207 if(op1->type)
10208 op1->type->refCount++;
10209 }
10210 return 0x1;
10211 }
10212
10213 static unsigned int IntSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10214 {
10215 int value2 = op2->i;
10216
10217 exp->type = 2;
10218 exp->string = PrintInt(op1->i <= value2);
10219 if(!exp->expType)
10220 {
10221 exp->expType = op1->type;
10222 if(op1->type)
10223 op1->type->refCount++;
10224 }
10225 return 0x1;
10226 }
10227
10228 static unsigned int UIntSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10229 {
10230 unsigned int value2 = op2->ui;
10231
10232 exp->type = 2;
10233 exp->string = PrintUInt(op1->ui <= value2);
10234 if(!exp->expType)
10235 {
10236 exp->expType = op1->type;
10237 if(op1->type)
10238 op1->type->refCount++;
10239 }
10240 return 0x1;
10241 }
10242
10243 static unsigned int Int64SmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10244 {
10245 long long value2 = op2->i64;
10246
10247 exp->type = 2;
10248 exp->string = PrintInt64(op1->i64 <= value2);
10249 if(!exp->expType)
10250 {
10251 exp->expType = op1->type;
10252 if(op1->type)
10253 op1->type->refCount++;
10254 }
10255 return 0x1;
10256 }
10257
10258 static unsigned int UInt64SmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10259 {
10260 uint64 value2 = op2->ui64;
10261
10262 exp->type = 2;
10263 exp->string = PrintUInt64(op1->ui64 <= value2);
10264 if(!exp->expType)
10265 {
10266 exp->expType = op1->type;
10267 if(op1->type)
10268 op1->type->refCount++;
10269 }
10270 return 0x1;
10271 }
10272
10273 static unsigned int ShortSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10274 {
10275 short value2 = op2->s;
10276
10277 exp->type = 2;
10278 exp->string = PrintShort(op1->s <= value2);
10279 if(!exp->expType)
10280 {
10281 exp->expType = op1->type;
10282 if(op1->type)
10283 op1->type->refCount++;
10284 }
10285 return 0x1;
10286 }
10287
10288 static unsigned int UShortSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10289 {
10290 unsigned short value2 = op2->us;
10291
10292 exp->type = 2;
10293 exp->string = PrintUShort(op1->us <= value2);
10294 if(!exp->expType)
10295 {
10296 exp->expType = op1->type;
10297 if(op1->type)
10298 op1->type->refCount++;
10299 }
10300 return 0x1;
10301 }
10302
10303 static unsigned int CharSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10304 {
10305 char value2 = op2->c;
10306
10307 exp->type = 2;
10308 exp->string = PrintChar(op1->c <= value2);
10309 if(!exp->expType)
10310 {
10311 exp->expType = op1->type;
10312 if(op1->type)
10313 op1->type->refCount++;
10314 }
10315 return 0x1;
10316 }
10317
10318 static unsigned int UCharSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10319 {
10320 unsigned char value2 = op2->uc;
10321
10322 exp->type = 2;
10323 exp->string = PrintUChar(op1->uc <= value2);
10324 if(!exp->expType)
10325 {
10326 exp->expType = op1->type;
10327 if(op1->type)
10328 op1->type->refCount++;
10329 }
10330 return 0x1;
10331 }
10332
10333 static unsigned int FloatSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10334 {
10335 float value2 = op2->f;
10336
10337 exp->type = 2;
10338 exp->string = PrintFloat(op1->f <= value2);
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 DoubleSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10349 {
10350 double value2 = op2->d;
10351
10352 exp->type = 2;
10353 exp->string = PrintDouble(op1->d <= value2);
10354 if(!exp->expType)
10355 {
10356 exp->expType = op1->type;
10357 if(op1->type)
10358 op1->type->refCount++;
10359 }
10360 return 0x1;
10361 }
10362
10363 static unsigned int IntCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10364 {
10365 exp->type = 2;
10366 exp->string = PrintInt(op1->i ? op2->i : op3->i);
10367 if(!exp->expType)
10368 {
10369 exp->expType = op1->type;
10370 if(op1->type)
10371 op1->type->refCount++;
10372 }
10373 return 0x1;
10374 }
10375
10376 static unsigned int UIntCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10377 {
10378 exp->type = 2;
10379 exp->string = PrintUInt(op1->ui ? op2->ui : op3->ui);
10380 if(!exp->expType)
10381 {
10382 exp->expType = op1->type;
10383 if(op1->type)
10384 op1->type->refCount++;
10385 }
10386 return 0x1;
10387 }
10388
10389 static unsigned int Int64Cond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10390 {
10391 exp->type = 2;
10392 exp->string = PrintInt64(op1->i64 ? op2->i64 : op3->i64);
10393 if(!exp->expType)
10394 {
10395 exp->expType = op1->type;
10396 if(op1->type)
10397 op1->type->refCount++;
10398 }
10399 return 0x1;
10400 }
10401
10402 static unsigned int UInt64Cond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10403 {
10404 exp->type = 2;
10405 exp->string = PrintUInt64(op1->ui64 ? op2->ui64 : op3->ui64);
10406 if(!exp->expType)
10407 {
10408 exp->expType = op1->type;
10409 if(op1->type)
10410 op1->type->refCount++;
10411 }
10412 return 0x1;
10413 }
10414
10415 static unsigned int ShortCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10416 {
10417 exp->type = 2;
10418 exp->string = PrintShort(op1->s ? op2->s : op3->s);
10419 if(!exp->expType)
10420 {
10421 exp->expType = op1->type;
10422 if(op1->type)
10423 op1->type->refCount++;
10424 }
10425 return 0x1;
10426 }
10427
10428 static unsigned int UShortCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10429 {
10430 exp->type = 2;
10431 exp->string = PrintUShort(op1->us ? op2->us : op3->us);
10432 if(!exp->expType)
10433 {
10434 exp->expType = op1->type;
10435 if(op1->type)
10436 op1->type->refCount++;
10437 }
10438 return 0x1;
10439 }
10440
10441 static unsigned int CharCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10442 {
10443 exp->type = 2;
10444 exp->string = PrintChar(op1->c ? op2->c : op3->c);
10445 if(!exp->expType)
10446 {
10447 exp->expType = op1->type;
10448 if(op1->type)
10449 op1->type->refCount++;
10450 }
10451 return 0x1;
10452 }
10453
10454 static unsigned int UCharCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10455 {
10456 exp->type = 2;
10457 exp->string = PrintUChar(op1->uc ? op2->uc : op3->uc);
10458 if(!exp->expType)
10459 {
10460 exp->expType = op1->type;
10461 if(op1->type)
10462 op1->type->refCount++;
10463 }
10464 return 0x1;
10465 }
10466
10467 static unsigned int FloatCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10468 {
10469 exp->type = 2;
10470 exp->string = PrintFloat(op1->f ? op2->f : op3->f);
10471 if(!exp->expType)
10472 {
10473 exp->expType = op1->type;
10474 if(op1->type)
10475 op1->type->refCount++;
10476 }
10477 return 0x1;
10478 }
10479
10480 static unsigned int DoubleCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10481 {
10482 exp->type = 2;
10483 exp->string = PrintDouble(op1->d ? op2->d : op3->d);
10484 if(!exp->expType)
10485 {
10486 exp->expType = op1->type;
10487 if(op1->type)
10488 op1->type->refCount++;
10489 }
10490 return 0x1;
10491 }
10492
10493 struct OpTable intOps = 
10494 {
10495 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
10496 };
10497
10498 struct OpTable uintOps = 
10499 {
10500 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
10501 };
10502
10503 struct OpTable int64Ops = 
10504 {
10505 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
10506 };
10507
10508 struct OpTable uint64Ops = 
10509 {
10510 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
10511 };
10512
10513 struct OpTable shortOps = 
10514 {
10515 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
10516 };
10517
10518 struct OpTable ushortOps = 
10519 {
10520 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
10521 };
10522
10523 struct OpTable floatOps = 
10524 {
10525 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
10526 };
10527
10528 struct OpTable doubleOps = 
10529 {
10530 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
10531 };
10532
10533 struct OpTable charOps = 
10534 {
10535 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
10536 };
10537
10538 struct OpTable ucharOps = 
10539 {
10540 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
10541 };
10542
10543 void ReadString(char * output, char * string)
10544 {
10545 int len = strlen(string);
10546 int c, d = 0;
10547 unsigned int quoted = 0x0, escaped = 0x0;
10548
10549 for(c = 0; c < len; c++)
10550 {
10551 char ch = string[c];
10552
10553 if(escaped)
10554 {
10555 switch(ch)
10556 {
10557 case 'n':
10558 output[d] = '\n';
10559 break;
10560 case 't':
10561 output[d] = '\t';
10562 break;
10563 case 'a':
10564 output[d] = '\a';
10565 break;
10566 case 'b':
10567 output[d] = '\b';
10568 break;
10569 case 'f':
10570 output[d] = '\f';
10571 break;
10572 case 'r':
10573 output[d] = '\r';
10574 break;
10575 case 'v':
10576 output[d] = '\v';
10577 break;
10578 case '\\':
10579 output[d] = '\\';
10580 break;
10581 case '\"':
10582 output[d] = '\"';
10583 break;
10584 case '\'':
10585 output[d] = '\'';
10586 break;
10587 default:
10588 output[d] = ch;
10589 }
10590 d++;
10591 escaped = 0x0;
10592 }
10593 else
10594 {
10595 if(ch == '\"')
10596 quoted ^= 0x1;
10597 else if(quoted)
10598 {
10599 if(ch == '\\')
10600 escaped = 0x1;
10601 else
10602 output[d++] = ch;
10603 }
10604 }
10605 }
10606 output[d] = '\0';
10607 }
10608
10609 int UnescapeString(char * d, char * s, int len)
10610 {
10611 int j = 0, k = 0;
10612 char ch;
10613
10614 while(j < len && (ch = s[j]))
10615 {
10616 switch(ch)
10617 {
10618 case '\\':
10619 switch((ch = s[++j]))
10620 {
10621 case 'n':
10622 d[k] = '\n';
10623 break;
10624 case 't':
10625 d[k] = '\t';
10626 break;
10627 case 'a':
10628 d[k] = '\a';
10629 break;
10630 case 'b':
10631 d[k] = '\b';
10632 break;
10633 case 'f':
10634 d[k] = '\f';
10635 break;
10636 case 'r':
10637 d[k] = '\r';
10638 break;
10639 case 'v':
10640 d[k] = '\v';
10641 break;
10642 case '\\':
10643 d[k] = '\\';
10644 break;
10645 case '\"':
10646 d[k] = '\"';
10647 break;
10648 case '\'':
10649 d[k] = '\'';
10650 break;
10651 default:
10652 d[k] = '\\';
10653 d[k] = ch;
10654 }
10655 break;
10656 default:
10657 d[k] = ch;
10658 }
10659 j++, k++;
10660 }
10661 d[k] = '\0';
10662 return k;
10663 }
10664
10665 char * OffsetEscapedString(char * s, int len, int offset)
10666 {
10667 char ch;
10668 int j = 0, k = 0;
10669
10670 while(j < len && k < offset && (ch = s[j]))
10671 {
10672 if(ch == '\\')
10673 ++j;
10674 j++, k++;
10675 }
10676 return (k == offset) ? s + j : (((void *)0));
10677 }
10678
10679 extern long long __ecereNameSpace__ecere__com___strtoi64(char *  string, char * *  endString, int base);
10680
10681 extern uint64 __ecereNameSpace__ecere__com___strtoui64(char *  string, char * *  endString, int base);
10682
10683 extern double strtod(char * , char * * );
10684
10685 extern float (* __ecereMethod_float_inf)(void);
10686
10687 extern float (* __ecereMethod_float_nan)(void);
10688
10689 extern double (* __ecereMethod_double_inf)(void);
10690
10691 extern double (* __ecereMethod_double_nan)(void);
10692
10693 struct Operand GetOperand(struct Expression * exp)
10694 {
10695 struct Operand op = 
10696 {
10697 0, 0, 0, 0, 
10698 {
10699 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
10700 }
10701 };
10702 struct Type * type = exp->expType;
10703
10704 if(type)
10705 {
10706 while(type->kind == 8 && type->_class->registered && (type->_class->registered->type == 2 || type->_class->registered->type == 3 || type->_class->registered->type == 4))
10707 {
10708 if(!type->_class->registered->dataType)
10709 type->_class->registered->dataType = ProcessTypeString(type->_class->registered->dataTypeString, 0x0);
10710 type = type->_class->registered->dataType;
10711 }
10712 if(exp->type == 3 && op.kind == 13)
10713 {
10714 op.ui64 = (uint64)exp->string;
10715 op.kind = 13;
10716 op.ops = uint64Ops;
10717 }
10718 else if(exp->isConstant && exp->type == 2)
10719 {
10720 op.kind = type->kind;
10721 op.type = exp->expType;
10722 switch(op.kind)
10723 {
10724 case 24:
10725 case 1:
10726 {
10727 if(exp->constant[0] == '\'')
10728 {
10729 op.c = exp->constant[1];
10730 op.ops = charOps;
10731 }
10732 else if(type->isSigned)
10733 {
10734 op.c = (char)strtol(exp->constant, (((void *)0)), 0);
10735 op.ops = charOps;
10736 }
10737 else
10738 {
10739 op.uc = (unsigned char)strtoul(exp->constant, (((void *)0)), 0);
10740 op.ops = ucharOps;
10741 }
10742 break;
10743 }
10744 case 2:
10745 if(type->isSigned)
10746 {
10747 op.s = (short)strtol(exp->constant, (((void *)0)), 0);
10748 op.ops = shortOps;
10749 }
10750 else
10751 {
10752 op.us = (unsigned short)strtoul(exp->constant, (((void *)0)), 0);
10753 op.ops = ushortOps;
10754 }
10755 break;
10756 case 3:
10757 case 5:
10758 if(type->isSigned)
10759 {
10760 op.i = strtol(exp->constant, (((void *)0)), 0);
10761 op.ops = intOps;
10762 }
10763 else
10764 {
10765 op.ui = strtoul(exp->constant, (((void *)0)), 0);
10766 op.ops = uintOps;
10767 }
10768 op.kind = 3;
10769 break;
10770 case 4:
10771 if(type->isSigned)
10772 {
10773 op.i64 = __ecereNameSpace__ecere__com___strtoi64(exp->constant, (((void *)0)), 0);
10774 op.ops = intOps;
10775 }
10776 else
10777 {
10778 op.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->constant, (((void *)0)), 0);
10779 op.ops = uintOps;
10780 }
10781 op.kind = 4;
10782 break;
10783 case 22:
10784 if(type->isSigned)
10785 {
10786 op.i64 = __ecereNameSpace__ecere__com___strtoi64(exp->constant, (((void *)0)), 0);
10787 op.ops = int64Ops;
10788 }
10789 else
10790 {
10791 op.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->constant, (((void *)0)), 0);
10792 op.ops = uint64Ops;
10793 }
10794 op.kind = 4;
10795 break;
10796 case 23:
10797 if(type->isSigned)
10798 {
10799 op.i64 = __ecereNameSpace__ecere__com___strtoi64(exp->constant, (((void *)0)), 0);
10800 op.ops = int64Ops;
10801 }
10802 else
10803 {
10804 op.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->constant, (((void *)0)), 0);
10805 op.ops = uint64Ops;
10806 }
10807 op.kind = 4;
10808 break;
10809 case 6:
10810 if(!strcmp(exp->constant, "inf"))
10811 op.f = __ecereMethod_float_inf();
10812 else if(!strcmp(exp->constant, "-inf"))
10813 op.f = -__ecereMethod_float_inf();
10814 else if(!strcmp(exp->constant, "nan"))
10815 op.f = __ecereMethod_float_nan();
10816 else if(!strcmp(exp->constant, "-nan"))
10817 op.f = -__ecereMethod_float_nan();
10818 else
10819 op.f = (float)strtod(exp->constant, (((void *)0)));
10820 op.ops = floatOps;
10821 break;
10822 case 7:
10823 if(!strcmp(exp->constant, "inf"))
10824 op.d = __ecereMethod_double_inf();
10825 else if(!strcmp(exp->constant, "-inf"))
10826 op.d = -__ecereMethod_double_inf();
10827 else if(!strcmp(exp->constant, "nan"))
10828 op.d = __ecereMethod_double_nan();
10829 else if(!strcmp(exp->constant, "-nan"))
10830 op.d = -__ecereMethod_double_nan();
10831 else
10832 op.d = (double)strtod(exp->constant, (((void *)0)));
10833 op.ops = doubleOps;
10834 break;
10835 case 12:
10836 case 13:
10837 case 8:
10838 op.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->constant, (((void *)0)), 0);
10839 op.kind = 13;
10840 op.ops = uint64Ops;
10841 break;
10842 }
10843 }
10844 }
10845 return op;
10846 }
10847
10848 int __ecereVMethodID_class_OnGetString;
10849
10850 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_int;
10851
10852 static void UnusedFunction()
10853 {
10854 int a;
10855
10856 ((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);
10857 }
10858
10859 extern int __ecereVMethodID_class_OnGetString;
10860
10861 static void PopulateInstanceProcessMember(struct Instantiation * inst, struct __ecereNameSpace__ecere__sys__OldList * memberList, struct __ecereNameSpace__ecere__com__DataMember * parentDataMember, unsigned int offset)
10862 {
10863 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
10864
10865 for(dataMember = parentDataMember->members.first; dataMember; dataMember = dataMember->next)
10866 {
10867 if(!dataMember->name && (dataMember->type == 2 || dataMember->type == 1))
10868 PopulateInstanceProcessMember(inst, memberList, dataMember, offset + dataMember->offset);
10869 else
10870 {
10871 struct Expression * exp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
10872 struct MemberInit * member = MkMemberInit(MkListOne(MkIdentifier(dataMember->name)), MkInitializerAssignment(exp));
10873 struct Type * type;
10874 void * ptr = inst->data + dataMember->offset + offset;
10875 char * result = (((void *)0));
10876
10877 exp->loc = member->loc = inst->loc;
10878 ((struct Identifier *)(*member->identifiers).first)->loc = inst->loc;
10879 if(!dataMember->dataType)
10880 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
10881 type = dataMember->dataType;
10882 if(type->kind == 8)
10883 {
10884 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
10885
10886 if(_class->type == 4)
10887 {
10888 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
10889
10890 if(enumClass)
10891 {
10892 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
10893 struct __ecereNameSpace__ecere__sys__NamedLink * item;
10894
10895 for(item = e->values.first; item; item = item->next)
10896 {
10897 if((int)item->data == *(int *)ptr)
10898 {
10899 result = item->name;
10900 break;
10901 }
10902 }
10903 if(result)
10904 {
10905 exp->identifier = MkIdentifier(result);
10906 exp->type = 0;
10907 exp->destType = MkClassType(_class->fullName);
10908 ProcessExpressionType(exp);
10909 }
10910 }
10911 }
10912 if(_class->type == 4 || _class->type == 3 || _class->type == 2)
10913 {
10914 if(!_class->dataType)
10915 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
10916 type = _class->dataType;
10917 }
10918 }
10919 if(!result)
10920 {
10921 switch(type->kind)
10922 {
10923 case 6:
10924 {
10925 FreeExpContents(exp);
10926 exp->constant = PrintFloat(*(float *)ptr);
10927 exp->type = 2;
10928 break;
10929 }
10930 case 7:
10931 {
10932 FreeExpContents(exp);
10933 exp->constant = PrintDouble(*(double *)ptr);
10934 exp->type = 2;
10935 break;
10936 }
10937 case 3:
10938 {
10939 FreeExpContents(exp);
10940 exp->constant = PrintInt(*(int *)ptr);
10941 exp->type = 2;
10942 break;
10943 }
10944 case 4:
10945 {
10946 FreeExpContents(exp);
10947 exp->constant = PrintInt64(*(long long *)ptr);
10948 exp->type = 2;
10949 break;
10950 }
10951 case 22:
10952 {
10953 FreeExpContents(exp);
10954 exp->constant = PrintInt64((long long)*(intptr_t *)ptr);
10955 exp->type = 2;
10956 break;
10957 }
10958 case 23:
10959 {
10960 FreeExpContents(exp);
10961 exp->constant = PrintInt64((long long)*(intptr_t *)ptr);
10962 exp->type = 2;
10963 break;
10964 }
10965 default:
10966 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Unhandled type populating instance\n", (((void *)0))));
10967 }
10968 }
10969 ListAdd(memberList, member);
10970 }
10971 if(parentDataMember->type == 1)
10972 break;
10973 }
10974 }
10975
10976 extern struct MembersInit * MkMembersInitList(struct __ecereNameSpace__ecere__sys__OldList * dataMembers);
10977
10978 void PopulateInstance(struct Instantiation * inst)
10979 {
10980 struct Symbol * classSym = inst->_class->symbol;
10981 struct __ecereNameSpace__ecere__com__Class * _class = classSym->registered;
10982 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
10983 struct __ecereNameSpace__ecere__sys__OldList * memberList = MkList();
10984
10985 if(!inst->members)
10986 inst->members = MkListOne(MkMembersInitList(memberList));
10987 else
10988 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*inst->members), MkMembersInitList(memberList));
10989 for(dataMember = _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
10990 {
10991 if(!dataMember->isProperty)
10992 {
10993 if(!dataMember->name && (dataMember->type == 2 || dataMember->type == 1))
10994 PopulateInstanceProcessMember(inst, memberList, dataMember, dataMember->offset);
10995 else
10996 {
10997 struct Expression * exp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
10998 struct MemberInit * member = MkMemberInit(MkListOne(MkIdentifier(dataMember->name)), MkInitializerAssignment(exp));
10999 struct Type * type;
11000 void * ptr = inst->data + dataMember->offset;
11001 char * result = (((void *)0));
11002
11003 exp->loc = member->loc = inst->loc;
11004 ((struct Identifier *)(*member->identifiers).first)->loc = inst->loc;
11005 if(!dataMember->dataType)
11006 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
11007 type = dataMember->dataType;
11008 if(type->kind == 8)
11009 {
11010 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
11011
11012 if(_class->type == 4)
11013 {
11014 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
11015
11016 if(enumClass)
11017 {
11018 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
11019 struct __ecereNameSpace__ecere__sys__NamedLink * item;
11020
11021 for(item = e->values.first; item; item = item->next)
11022 {
11023 if((int)item->data == *(int *)ptr)
11024 {
11025 result = item->name;
11026 break;
11027 }
11028 }
11029 }
11030 if(result)
11031 {
11032 exp->identifier = MkIdentifier(result);
11033 exp->type = 0;
11034 exp->destType = MkClassType(_class->fullName);
11035 ProcessExpressionType(exp);
11036 }
11037 }
11038 if(_class->type == 4 || _class->type == 3 || _class->type == 2)
11039 {
11040 if(!_class->dataType)
11041 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
11042 type = _class->dataType;
11043 }
11044 }
11045 if(!result)
11046 {
11047 switch(type->kind)
11048 {
11049 case 6:
11050 {
11051 exp->constant = PrintFloat(*(float *)ptr);
11052 exp->type = 2;
11053 break;
11054 }
11055 case 7:
11056 {
11057 exp->constant = PrintDouble(*(double *)ptr);
11058 exp->type = 2;
11059 break;
11060 }
11061 case 3:
11062 {
11063 exp->constant = PrintInt(*(int *)ptr);
11064 exp->type = 2;
11065 break;
11066 }
11067 case 4:
11068 {
11069 exp->constant = PrintInt64(*(long long *)ptr);
11070 exp->type = 2;
11071 break;
11072 }
11073 case 22:
11074 {
11075 exp->constant = PrintInt64((long long)*(intptr_t *)ptr);
11076 exp->type = 2;
11077 break;
11078 }
11079 default:
11080 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Unhandled type populating instance\n", (((void *)0))));
11081 }
11082 }
11083 ListAdd(memberList, member);
11084 }
11085 }
11086 }
11087 }
11088
11089 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);
11090
11091 extern void FreeInstance(struct Instantiation * inst);
11092
11093 void ComputeInstantiation(struct Expression * exp)
11094 {
11095 struct Instantiation * inst = exp->instance;
11096 struct MembersInit * members;
11097 struct Symbol * classSym = inst->_class ? inst->_class->symbol : (((void *)0));
11098 struct __ecereNameSpace__ecere__com__Class * _class = classSym ? classSym->registered : (((void *)0));
11099 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
11100 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
11101 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
11102 int subMemberStackPos = 0;
11103 uint64 bits = 0;
11104
11105 if(_class && (_class->type == 1 || _class->type == 0 || _class->type == 5))
11106 {
11107 if(inst->data)
11108 return ;
11109 if(_class->type == 0 || _class->type == 5)
11110 {
11111 inst->data = (unsigned char *)__ecereNameSpace__ecere__com__eInstance_New(_class);
11112 if(_class->type == 0)
11113 ((struct __ecereNameSpace__ecere__com__Instance *)(char *)((struct __ecereNameSpace__ecere__com__Instance *)inst->data))->_refCount++;
11114 }
11115 else
11116 inst->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
11117 }
11118 if(inst->members)
11119 {
11120 for(members = (*inst->members).first; members; members = members->next)
11121 {
11122 switch(members->type)
11123 {
11124 case 0:
11125 {
11126 if(members->dataMembers)
11127 {
11128 struct MemberInit * member;
11129
11130 for(member = (*members->dataMembers).first; member; member = member->next)
11131 {
11132 struct Identifier * ident = member->identifiers ? (*member->identifiers).first : (((void *)0));
11133 unsigned int found = 0x0;
11134 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
11135 struct __ecereNameSpace__ecere__com__DataMember * dataMember = (((void *)0));
11136 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
11137 unsigned int dataMemberOffset;
11138
11139 if(!ident)
11140 {
11141 __ecereNameSpace__ecere__com__eClass_FindNextMember(_class, &curClass, &curMember, subMemberStack, &subMemberStackPos);
11142 if(curMember)
11143 {
11144 if(curMember->isProperty)
11145 prop = (struct __ecereNameSpace__ecere__com__Property *)curMember;
11146 else
11147 {
11148 dataMember = curMember;
11149 __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(_class, dataMember->name, &dataMemberOffset, privateModule, (((void *)0)), (((void *)0)));
11150 if(_class->type == 0)
11151 dataMemberOffset += _class->base->structSize;
11152 }
11153 found = 0x1;
11154 }
11155 }
11156 else
11157 {
11158 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, ident->string, privateModule);
11159 if(prop)
11160 {
11161 found = 0x1;
11162 if(prop->memberAccess == 1)
11163 {
11164 curMember = (struct __ecereNameSpace__ecere__com__DataMember *)prop;
11165 curClass = prop->_class;
11166 }
11167 }
11168 else
11169 {
11170 struct __ecereNameSpace__ecere__com__DataMember * _subMemberStack[256];
11171 int _subMemberStackPos = 0;
11172
11173 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(_class, ident->string, &dataMemberOffset, privateModule, _subMemberStack, &_subMemberStackPos);
11174 if(dataMember)
11175 {
11176 found = 0x1;
11177 if(dataMember->memberAccess == 1)
11178 {
11179 curMember = dataMember;
11180 curClass = dataMember->_class;
11181 memcpy(subMemberStack, _subMemberStack, sizeof(struct __ecereNameSpace__ecere__com__DataMember *) * _subMemberStackPos);
11182 subMemberStackPos = _subMemberStackPos;
11183 }
11184 }
11185 }
11186 }
11187 if(found && member->initializer && member->initializer->type == 0)
11188 {
11189 struct Expression * value = member->initializer->exp;
11190 struct Type * type = (((void *)0));
11191 unsigned int deepMember = 0x0;
11192
11193 if(prop)
11194 {
11195 type = prop->dataType;
11196 }
11197 else if(dataMember)
11198 {
11199 if(!dataMember->dataType)
11200 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
11201 type = dataMember->dataType;
11202 }
11203 if(ident && ident->next)
11204 {
11205 deepMember = 0x1;
11206 for(ident = ident->next; ident && type; ident = ident->next)
11207 {
11208 if(type->kind == 8)
11209 {
11210 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(type->_class->registered, ident->string, privateModule);
11211 if(prop)
11212 type = prop->dataType;
11213 else
11214 {
11215 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(type->_class->registered, ident->string, &dataMemberOffset, privateModule, (((void *)0)), (((void *)0)));
11216 if(dataMember)
11217 type = dataMember->dataType;
11218 }
11219 }
11220 else if(type->kind == 9 || type->kind == 10)
11221 {
11222 struct Type * memberType;
11223
11224 for(memberType = type->members.first; memberType; memberType = memberType->next)
11225 {
11226 if(!strcmp(memberType->name, ident->string))
11227 {
11228 type = memberType;
11229 break;
11230 }
11231 }
11232 }
11233 }
11234 }
11235 if(value)
11236 {
11237 FreeType(value->destType);
11238 value->destType = type;
11239 if(type)
11240 type->refCount++;
11241 ComputeExpression(value);
11242 }
11243 if(!deepMember && type && value && (_class->type == 1 || _class->type == 0 || _class->type == 5))
11244 {
11245 if(type->kind == 8)
11246 {
11247 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
11248
11249 if(_class->type == 2 || _class->type == 3 || _class->type == 4)
11250 {
11251 if(!_class->dataType)
11252 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
11253 type = _class->dataType;
11254 }
11255 }
11256 if(dataMember)
11257 {
11258 void * ptr = inst->data + dataMemberOffset;
11259
11260 if(value->type == 2)
11261 {
11262 switch(type->kind)
11263 {
11264 case 3:
11265 {
11266 GetInt(value, (int *)ptr);
11267 break;
11268 }
11269 case 4:
11270 {
11271 GetInt64(value, (long long *)ptr);
11272 break;
11273 }
11274 case 22:
11275 {
11276 GetIntPtr(value, (intptr_t *)ptr);
11277 break;
11278 }
11279 case 23:
11280 {
11281 GetIntSize(value, (ssize_t *)ptr);
11282 break;
11283 }
11284 case 6:
11285 {
11286 GetFloat(value, (float *)ptr);
11287 break;
11288 }
11289 case 7:
11290 {
11291 GetDouble(value, (double *)ptr);
11292 break;
11293 }
11294 }
11295 }
11296 else if(value->type == 1)
11297 {
11298 if(type->kind == 8)
11299 {
11300 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
11301
11302 if(_class->type == 1)
11303 {
11304 ComputeTypeSize(type);
11305 if(value->instance->data)
11306 memcpy(ptr, value->instance->data, type->size);
11307 }
11308 }
11309 }
11310 }
11311 else if(prop)
11312 {
11313 if(value->type == 1 && value->instance->data)
11314 {
11315 if(type->kind == 8)
11316 {
11317 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
11318
11319 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)))
11320 {
11321 void (* Set)(void *, void *) = (void *)prop->Set;
11322
11323 Set(inst->data, value->instance->data);
11324 PopulateInstance(inst);
11325 }
11326 }
11327 }
11328 else if(value->type == 2)
11329 {
11330 switch(type->kind)
11331 {
11332 case 7:
11333 {
11334 void (* Set)(void *, double) = (void *)prop->Set;
11335
11336 Set(inst->data, strtod(value->constant, (((void *)0))));
11337 break;
11338 }
11339 case 6:
11340 {
11341 void (* Set)(void *, float) = (void *)prop->Set;
11342
11343 Set(inst->data, (float)(strtod(value->constant, (((void *)0)))));
11344 break;
11345 }
11346 case 3:
11347 {
11348 void (* Set)(void *, int) = (void *)prop->Set;
11349
11350 Set(inst->data, strtol(value->constant, (((void *)0)), 0));
11351 break;
11352 }
11353 case 4:
11354 {
11355 void (* Set)(void *, long long) = (void *)prop->Set;
11356
11357 Set(inst->data, __ecereNameSpace__ecere__com___strtoi64(value->constant, (((void *)0)), 0));
11358 break;
11359 }
11360 case 22:
11361 {
11362 void (* Set)(void *, intptr_t) = (void *)prop->Set;
11363
11364 Set(inst->data, (intptr_t)__ecereNameSpace__ecere__com___strtoi64(value->constant, (((void *)0)), 0));
11365 break;
11366 }
11367 case 23:
11368 {
11369 void (* Set)(void *, ssize_t) = (void *)prop->Set;
11370
11371 Set(inst->data, (ssize_t)__ecereNameSpace__ecere__com___strtoi64(value->constant, (((void *)0)), 0));
11372 break;
11373 }
11374 }
11375 }
11376 else if(value->type == 3)
11377 {
11378 char temp[1024];
11379
11380 ReadString(temp, value->string);
11381 ((void (*)(void *, void *))(void *)prop->Set)(inst->data, temp);
11382 }
11383 }
11384 }
11385 else if(!deepMember && type && _class->type == 3)
11386 {
11387 if(prop)
11388 {
11389 if(value->type == 2)
11390 {
11391 if(type->kind == 8)
11392 {
11393 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
11394
11395 if(_class->type == 3)
11396 {
11397 if(!_class->dataType)
11398 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
11399 type = _class->dataType;
11400 }
11401 }
11402 switch(type->kind)
11403 {
11404 case 6:
11405 {
11406 float fValue;
11407 float (* Set)(float) = (void *)prop->Set;
11408
11409 GetFloat(member->initializer->exp, &fValue);
11410 exp->constant = PrintFloat(Set(fValue));
11411 exp->type = 2;
11412 break;
11413 }
11414 case 7:
11415 {
11416 double dValue;
11417 double (* Set)(double) = (void *)prop->Set;
11418
11419 GetDouble(member->initializer->exp, &dValue);
11420 exp->constant = PrintDouble(Set(dValue));
11421 exp->type = 2;
11422 break;
11423 }
11424 }
11425 }
11426 }
11427 }
11428 else if(!deepMember && type && _class->type == 2)
11429 {
11430 if(prop)
11431 {
11432 if(value->type == 1 && value->instance->data)
11433 {
11434 unsigned int (* Set)(void *) = (void *)prop->Set;
11435
11436 bits = Set(value->instance->data);
11437 }
11438 else if(value->type == 2)
11439 {
11440 }
11441 }
11442 else if(dataMember)
11443 {
11444 struct __ecereNameSpace__ecere__com__BitMember * bitMember = (struct __ecereNameSpace__ecere__com__BitMember *)dataMember;
11445 struct Type * type;
11446 int part = 0;
11447
11448 GetInt(value, &part);
11449 bits = (bits & ~bitMember->mask);
11450 if(!bitMember->dataType)
11451 bitMember->dataType = ProcessTypeString(bitMember->dataTypeString, 0x0);
11452 type = bitMember->dataType;
11453 if(type->kind == 8 && type->_class && type->_class->registered)
11454 {
11455 if(!type->_class->registered->dataType)
11456 type->_class->registered->dataType = ProcessTypeString(type->_class->registered->dataTypeString, 0x0);
11457 type = type->_class->registered->dataType;
11458 }
11459 switch(type->kind)
11460 {
11461 case 24:
11462 case 1:
11463 if(type->isSigned)
11464 bits |= ((char)part << bitMember->pos);
11465 else
11466 bits |= ((unsigned char)part << bitMember->pos);
11467 break;
11468 case 2:
11469 if(type->isSigned)
11470 bits |= ((short)part << bitMember->pos);
11471 else
11472 bits |= ((unsigned short)part << bitMember->pos);
11473 break;
11474 case 3:
11475 case 5:
11476 if(type->isSigned)
11477 bits |= (part << bitMember->pos);
11478 else
11479 bits |= ((unsigned int)part << bitMember->pos);
11480 break;
11481 case 4:
11482 if(type->isSigned)
11483 bits |= ((long long)part << bitMember->pos);
11484 else
11485 bits |= ((uint64)part << bitMember->pos);
11486 break;
11487 case 22:
11488 if(type->isSigned)
11489 {
11490 bits |= ((intptr_t)part << bitMember->pos);
11491 }
11492 else
11493 {
11494 bits |= ((uintptr_t)part << bitMember->pos);
11495 }
11496 break;
11497 case 23:
11498 if(type->isSigned)
11499 {
11500 bits |= ((ssize_t)part << bitMember->pos);
11501 }
11502 else
11503 {
11504 bits |= ((size_t)part << bitMember->pos);
11505 }
11506 break;
11507 }
11508 }
11509 }
11510 }
11511 else
11512 {
11513 if(_class && _class->type == 3)
11514 {
11515 ComputeExpression(member->initializer->exp);
11516 exp->constant = member->initializer->exp->constant;
11517 exp->type = 2;
11518 member->initializer->exp->constant = (((void *)0));
11519 }
11520 }
11521 }
11522 }
11523 break;
11524 }
11525 }
11526 }
11527 }
11528 if(_class && _class->type == 2)
11529 {
11530 exp->constant = PrintHexUInt(bits);
11531 exp->type = 2;
11532 }
11533 if(exp->type != 1)
11534 {
11535 FreeInstance(inst);
11536 }
11537 }
11538
11539 static unsigned int Promote(struct Operand * op, int kind, unsigned int isSigned)
11540 {
11541 unsigned int result = 0x0;
11542
11543 switch(kind)
11544 {
11545 case 2:
11546 if(op->kind == 1 || op->kind == 15 || op->kind == 24)
11547 result = isSigned ? GetOpShort(op, &op->s) : GetOpUShort(op, &op->us);
11548 break;
11549 case 3:
11550 case 5:
11551 if(op->kind == 1 || op->kind == 2 || op->kind == 15 || op->kind == 24)
11552 result = isSigned ? GetOpInt(op, &op->i) : GetOpUInt(op, &op->ui);
11553 break;
11554 case 4:
11555 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)
11556 result = isSigned ? GetOpInt64(op, &op->i64) : GetOpUInt64(op, &op->ui64);
11557 break;
11558 case 6:
11559 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)
11560 result = GetOpFloat(op, &op->f);
11561 break;
11562 case 7:
11563 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)
11564 result = GetOpDouble(op, &op->d);
11565 break;
11566 case 13:
11567 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)
11568 result = GetOpUIntPtr(op, &op->ui64);
11569 break;
11570 case 15:
11571 if(op->kind == 1 || op->kind == 2 || op->kind == 3 || op->kind == 4 || op->kind == 5 || op->kind == 6 || op->kind == 7 || op->kind == 13 || op->kind == 15 || op->kind == 22 || op->kind == 23 || op->kind == 24)
11572 result = isSigned ? GetOpInt(op, &op->i) : GetOpUInt(op, &op->ui);
11573 break;
11574 case 22:
11575 if(op->kind == 1 || op->kind == 2 || op->kind == 3 || op->kind == 5 || op->kind == 15 || op->kind == 24)
11576 result = isSigned ? GetOpIntPtr(op, &op->i64) : GetOpUIntPtr(op, &op->i64);
11577 break;
11578 case 23:
11579 if(op->kind == 1 || op->kind == 2 || op->kind == 3 || op->kind == 5 || op->kind == 15 || op->kind == 24)
11580 result = isSigned ? GetOpIntSize(op, &op->ui64) : GetOpUIntSize(op, &op->ui64);
11581 break;
11582 }
11583 return result;
11584 }
11585
11586 void CallOperator(struct Expression * exp, struct Expression * exp1, struct Expression * exp2, struct Operand * op1, struct Operand * op2)
11587 {
11588 if(exp->op.op == SIZEOF)
11589 {
11590 FreeExpContents(exp);
11591 exp->type = 2;
11592 exp->constant = PrintUInt(ComputeTypeSize(op1->type));
11593 }
11594 else
11595 {
11596 if(!exp->op.exp1)
11597 {
11598 switch(exp->op.op)
11599 {
11600 case '+':
11601 {
11602 struct Expression * exp2 = exp->op.exp2;
11603
11604 exp->op.exp2 = (((void *)0));
11605 FreeExpContents(exp);
11606 FreeType(exp->expType);
11607 FreeType(exp->destType);
11608 *exp = *exp2;
11609 ((exp2 ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(exp2) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(exp2)) : 0), exp2 = 0);
11610 break;
11611 }
11612 case '-':
11613 if(op1->ops.Neg)
11614 {
11615 FreeExpContents(exp);
11616 op1->ops.Neg(exp, op1);
11617 }
11618 break;
11619 case '~':
11620 if(op1->ops.BitNot)
11621 {
11622 FreeExpContents(exp);
11623 op1->ops.BitNot(exp, op1);
11624 }
11625 break;
11626 case '!':
11627 if(op1->ops.Not)
11628 {
11629 FreeExpContents(exp);
11630 op1->ops.Not(exp, op1);
11631 }
11632 break;
11633 }
11634 }
11635 else
11636 {
11637 if(op1 && op2 && op1->type && op2->type && op1->kind != op2->kind)
11638 {
11639 if(Promote(op2, op1->kind, op1->type->isSigned))
11640 op2->kind = op1->kind, op2->ops = op1->ops;
11641 else if(Promote(op1, op2->kind, op2->type->isSigned))
11642 op1->kind = op2->kind, op1->ops = op2->ops;
11643 }
11644 switch(exp->op.op)
11645 {
11646 case '+':
11647 if(op1->ops.Add)
11648 {
11649 FreeExpContents(exp);
11650 op1->ops.Add(exp, op1, op2);
11651 }
11652 break;
11653 case '-':
11654 if(op1->ops.Sub)
11655 {
11656 FreeExpContents(exp);
11657 op1->ops.Sub(exp, op1, op2);
11658 }
11659 break;
11660 case '*':
11661 if(op1->ops.Mul)
11662 {
11663 FreeExpContents(exp);
11664 op1->ops.Mul(exp, op1, op2);
11665 }
11666 break;
11667 case '/':
11668 if(op1->ops.Div)
11669 {
11670 FreeExpContents(exp);
11671 op1->ops.Div(exp, op1, op2);
11672 }
11673 break;
11674 case '%':
11675 if(op1->ops.Mod)
11676 {
11677 FreeExpContents(exp);
11678 op1->ops.Mod(exp, op1, op2);
11679 }
11680 break;
11681 case '&':
11682 if(exp->op.exp2)
11683 {
11684 if(op1->ops.BitAnd)
11685 {
11686 FreeExpContents(exp);
11687 op1->ops.BitAnd(exp, op1, op2);
11688 }
11689 }
11690 break;
11691 case '|':
11692 if(op1->ops.BitOr)
11693 {
11694 FreeExpContents(exp);
11695 op1->ops.BitOr(exp, op1, op2);
11696 }
11697 break;
11698 case '^':
11699 if(op1->ops.BitXor)
11700 {
11701 FreeExpContents(exp);
11702 op1->ops.BitXor(exp, op1, op2);
11703 }
11704 break;
11705 case LEFT_OP:
11706 if(op1->ops.LShift)
11707 {
11708 FreeExpContents(exp);
11709 op1->ops.LShift(exp, op1, op2);
11710 }
11711 break;
11712 case RIGHT_OP:
11713 if(op1->ops.RShift)
11714 {
11715 FreeExpContents(exp);
11716 op1->ops.RShift(exp, op1, op2);
11717 }
11718 break;
11719 case EQ_OP:
11720 if(op1->ops.Equ)
11721 {
11722 FreeExpContents(exp);
11723 op1->ops.Equ(exp, op1, op2);
11724 }
11725 break;
11726 case NE_OP:
11727 if(op1->ops.Nqu)
11728 {
11729 FreeExpContents(exp);
11730 op1->ops.Nqu(exp, op1, op2);
11731 }
11732 break;
11733 case AND_OP:
11734 if(op1->ops.And)
11735 {
11736 FreeExpContents(exp);
11737 op1->ops.And(exp, op1, op2);
11738 }
11739 break;
11740 case OR_OP:
11741 if(op1->ops.Or)
11742 {
11743 FreeExpContents(exp);
11744 op1->ops.Or(exp, op1, op2);
11745 }
11746 break;
11747 case '>':
11748 if(op1->ops.Grt)
11749 {
11750 FreeExpContents(exp);
11751 op1->ops.Grt(exp, op1, op2);
11752 }
11753 break;
11754 case '<':
11755 if(op1->ops.Sma)
11756 {
11757 FreeExpContents(exp);
11758 op1->ops.Sma(exp, op1, op2);
11759 }
11760 break;
11761 case GE_OP:
11762 if(op1->ops.GrtEqu)
11763 {
11764 FreeExpContents(exp);
11765 op1->ops.GrtEqu(exp, op1, op2);
11766 }
11767 break;
11768 case LE_OP:
11769 if(op1->ops.SmaEqu)
11770 {
11771 FreeExpContents(exp);
11772 op1->ops.SmaEqu(exp, op1, op2);
11773 }
11774 break;
11775 }
11776 }
11777 }
11778 }
11779
11780 void PrintTypeNoConst(struct Type * type, char *  string, unsigned int printName, unsigned int fullName);
11781
11782 extern struct Expression * MkExpIdentifier(struct Identifier * id);
11783
11784 void ComputeExpression(struct Expression * exp)
11785 {
11786 char expString[10240];
11787
11788 expString[0] = '\0';
11789 switch(exp->type)
11790 {
11791 case 1:
11792 {
11793 ComputeInstantiation(exp);
11794 break;
11795 }
11796 case 4:
11797 {
11798 struct Expression * exp1, * exp2 = (((void *)0));
11799 struct Operand op1 = 
11800 {
11801 0, 0, 0, 0, 
11802 {
11803 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
11804 }
11805 };
11806 struct Operand op2 = 
11807 {
11808 0, 0, 0, 0, 
11809 {
11810 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
11811 }
11812 };
11813
11814 if(exp->op.exp2)
11815 {
11816 struct Expression * e = exp->op.exp2;
11817
11818 while((e->type == 5 || e->type == 32 || e->type == 23) && e->list)
11819 {
11820 if(e->type == 5 || e->type == 32 || e->type == 23)
11821 {
11822 if(e->type == 23)
11823 e = (*((struct Statement *)(*e->compound->compound.statements).last)->expressions).last;
11824 else
11825 e = (*e->list).last;
11826 }
11827 }
11828 if(exp->op.op == 261 && e && e->expType)
11829 {
11830 if(e->type == 3 && e->string)
11831 {
11832 char * string = e->string;
11833 int len = strlen(string);
11834 char * tmp = __ecereNameSpace__ecere__com__eSystem_New(sizeof(char) * (len - 2 + 1));
11835
11836 len = UnescapeString(tmp, string + 1, len - 2);
11837 (__ecereNameSpace__ecere__com__eSystem_Delete(tmp), tmp = 0);
11838 FreeExpContents(exp);
11839 exp->type = 2;
11840 exp->constant = PrintUInt(len + 1);
11841 }
11842 else
11843 {
11844 struct Type * type = e->expType;
11845
11846 type->refCount++;
11847 FreeExpContents(exp);
11848 exp->type = 2;
11849 exp->constant = PrintUInt(ComputeTypeSize(type));
11850 FreeType(type);
11851 }
11852 break;
11853 }
11854 else
11855 ComputeExpression(exp->op.exp2);
11856 }
11857 if(exp->op.exp1)
11858 {
11859 ComputeExpression(exp->op.exp1);
11860 exp1 = exp->op.exp1;
11861 exp2 = exp->op.exp2;
11862 op1 = GetOperand(exp1);
11863 if(op1.type)
11864 op1.type->refCount++;
11865 if(exp2)
11866 {
11867 op2 = GetOperand(exp2);
11868 if(op2.type)
11869 op2.type->refCount++;
11870 }
11871 }
11872 else
11873 {
11874 exp1 = exp->op.exp2;
11875 op1 = GetOperand(exp1);
11876 if(op1.type)
11877 op1.type->refCount++;
11878 }
11879 CallOperator(exp, exp1, exp2, &op1, &op2);
11880 if(op1.type)
11881 FreeType(op1.type);
11882 if(op2.type)
11883 FreeType(op2.type);
11884 break;
11885 }
11886 case 5:
11887 case 32:
11888 {
11889 struct Expression * e, * n;
11890
11891 for(e = (*exp->list).first; e; e = n)
11892 {
11893 n = e->next;
11894 if(!n)
11895 {
11896 struct __ecereNameSpace__ecere__sys__OldList * list = exp->list;
11897
11898 ComputeExpression(e);
11899 FreeType(exp->expType);
11900 FreeType(exp->destType);
11901 *exp = *e;
11902 ((e ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(e) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(e)) : 0), e = 0);
11903 (__ecereNameSpace__ecere__com__eSystem_Delete(list), list = 0);
11904 }
11905 else
11906 {
11907 FreeExpression(e);
11908 }
11909 }
11910 break;
11911 }
11912 case 8:
11913 {
11914 struct Expression * memberExp = exp->member.exp;
11915 struct Identifier * memberID = exp->member.member;
11916 struct Type * type;
11917
11918 ComputeExpression(exp->member.exp);
11919 type = exp->member.exp->expType;
11920 if(type)
11921 {
11922 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)));
11923 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
11924 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
11925 struct __ecereNameSpace__ecere__com__Class * convertTo = (((void *)0));
11926
11927 if(type->kind == 19 && exp->member.exp->type == 24)
11928 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "ecere::com::Class");
11929 if(!_class)
11930 {
11931 char string[256];
11932 struct Symbol * classSym;
11933
11934 string[0] = '\0';
11935 PrintTypeNoConst(type, string, 0x0, 0x1);
11936 classSym = FindClass(string);
11937 _class = classSym ? classSym->registered : (((void *)0));
11938 }
11939 if(exp->member.member)
11940 {
11941 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, exp->member.member->string, privateModule);
11942 if(!prop)
11943 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, exp->member.member->string, privateModule, (((void *)0)), (((void *)0)));
11944 }
11945 if(!prop && !member && _class && exp->member.member)
11946 {
11947 struct Symbol * classSym = FindClass(exp->member.member->string);
11948
11949 convertTo = _class;
11950 _class = classSym ? classSym->registered : (((void *)0));
11951 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, convertTo->fullName, privateModule);
11952 }
11953 if(prop)
11954 {
11955 if(prop->compiled)
11956 {
11957 struct Type * type = prop->dataType;
11958
11959 if(_class->type == 3)
11960 {
11961 if(type->kind == 8)
11962 {
11963 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
11964
11965 if(_class->type == 3)
11966 {
11967 if(!_class->dataType)
11968 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
11969 type = _class->dataType;
11970 }
11971 }
11972 switch(type->kind)
11973 {
11974 case 6:
11975 {
11976 float value;
11977 float (* Get)(float) = (void *)prop->Get;
11978
11979 GetFloat(exp->member.exp, &value);
11980 exp->constant = PrintFloat(Get ? Get(value) : value);
11981 exp->type = 2;
11982 break;
11983 }
11984 case 7:
11985 {
11986 double value;
11987 double (* Get)(double);
11988
11989 GetDouble(exp->member.exp, &value);
11990 if(convertTo)
11991 Get = (void *)prop->Set;
11992 else
11993 Get = (void *)prop->Get;
11994 exp->constant = PrintDouble(Get ? Get(value) : value);
11995 exp->type = 2;
11996 break;
11997 }
11998 }
11999 }
12000 else
12001 {
12002 if(convertTo)
12003 {
12004 struct Expression * value = exp->member.exp;
12005 struct Type * type;
12006
12007 if(!prop->dataType)
12008 ProcessPropertyType(prop);
12009 type = prop->dataType;
12010 if(!type)
12011 {
12012 }
12013 else if(_class->type == 1)
12014 {
12015 switch(type->kind)
12016 {
12017 case 8:
12018 {
12019 struct __ecereNameSpace__ecere__com__Class * propertyClass = type->_class->registered;
12020
12021 if(propertyClass->type == 1 && value->type == 1)
12022 {
12023 void (* Set)(void *, void *) = (void *)prop->Set;
12024
12025 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12026 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12027 exp->instance->_class = MkSpecifierName(_class->fullName);
12028 exp->instance->loc = exp->loc;
12029 exp->type = 1;
12030 Set(exp->instance->data, value->instance->data);
12031 PopulateInstance(exp->instance);
12032 }
12033 break;
12034 }
12035 case 3:
12036 {
12037 int intValue;
12038 void (* Set)(void *, int) = (void *)prop->Set;
12039
12040 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12041 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12042 exp->instance->_class = MkSpecifierName(_class->fullName);
12043 exp->instance->loc = exp->loc;
12044 exp->type = 1;
12045 GetInt(value, &intValue);
12046 Set(exp->instance->data, intValue);
12047 PopulateInstance(exp->instance);
12048 break;
12049 }
12050 case 4:
12051 {
12052 long long intValue;
12053 void (* Set)(void *, long long) = (void *)prop->Set;
12054
12055 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12056 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12057 exp->instance->_class = MkSpecifierName(_class->fullName);
12058 exp->instance->loc = exp->loc;
12059 exp->type = 1;
12060 GetInt64(value, &intValue);
12061 Set(exp->instance->data, intValue);
12062 PopulateInstance(exp->instance);
12063 break;
12064 }
12065 case 22:
12066 {
12067 intptr_t intValue;
12068 void (* Set)(void *, intptr_t) = (void *)prop->Set;
12069
12070 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12071 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12072 exp->instance->_class = MkSpecifierName(_class->fullName);
12073 exp->instance->loc = exp->loc;
12074 exp->type = 1;
12075 GetIntPtr(value, &intValue);
12076 Set(exp->instance->data, intValue);
12077 PopulateInstance(exp->instance);
12078 break;
12079 }
12080 case 23:
12081 {
12082 ssize_t intValue;
12083 void (* Set)(void *, ssize_t) = (void *)prop->Set;
12084
12085 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12086 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12087 exp->instance->_class = MkSpecifierName(_class->fullName);
12088 exp->instance->loc = exp->loc;
12089 exp->type = 1;
12090 GetIntSize(value, &intValue);
12091 Set(exp->instance->data, intValue);
12092 PopulateInstance(exp->instance);
12093 break;
12094 }
12095 case 7:
12096 {
12097 double doubleValue;
12098 void (* Set)(void *, double) = (void *)prop->Set;
12099
12100 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12101 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12102 exp->instance->_class = MkSpecifierName(_class->fullName);
12103 exp->instance->loc = exp->loc;
12104 exp->type = 1;
12105 GetDouble(value, &doubleValue);
12106 Set(exp->instance->data, doubleValue);
12107 PopulateInstance(exp->instance);
12108 break;
12109 }
12110 }
12111 }
12112 else if(_class->type == 2)
12113 {
12114 switch(type->kind)
12115 {
12116 case 8:
12117 {
12118 struct __ecereNameSpace__ecere__com__Class * propertyClass = type->_class->registered;
12119
12120 if(propertyClass->type == 1 && value->instance->data)
12121 {
12122 unsigned int (* Set)(void *) = (void *)prop->Set;
12123 unsigned int bits = Set(value->instance->data);
12124
12125 exp->constant = PrintHexUInt(bits);
12126 exp->type = 2;
12127 break;
12128 }
12129 else if(_class->type == 2)
12130 {
12131 unsigned int value;
12132 unsigned int (* Set)(unsigned int) = (void *)prop->Set;
12133 unsigned int bits;
12134
12135 GetUInt(exp->member.exp, &value);
12136 bits = Set(value);
12137 exp->constant = PrintHexUInt(bits);
12138 exp->type = 2;
12139 }
12140 }
12141 }
12142 }
12143 }
12144 else
12145 {
12146 if(_class->type == 2)
12147 {
12148 unsigned int value;
12149
12150 GetUInt(exp->member.exp, &value);
12151 switch(type->kind)
12152 {
12153 case 8:
12154 {
12155 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
12156
12157 if(_class->type == 1)
12158 {
12159 void (* Get)(unsigned int, void *) = (void *)prop->Get;
12160
12161 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12162 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12163 exp->instance->_class = MkSpecifierName(_class->fullName);
12164 exp->instance->loc = exp->loc;
12165 exp->type = 1;
12166 Get(value, exp->instance->data);
12167 PopulateInstance(exp->instance);
12168 }
12169 else if(_class->type == 2)
12170 {
12171 unsigned int (* Get)(unsigned int) = (void *)prop->Get;
12172 uint64 bits = Get(value);
12173
12174 exp->constant = PrintHexUInt64(bits);
12175 exp->type = 2;
12176 }
12177 break;
12178 }
12179 }
12180 }
12181 else if(_class->type == 1)
12182 {
12183 char * value = (exp->member.exp->type == 1) ? exp->member.exp->instance->data : (((void *)0));
12184
12185 switch(type->kind)
12186 {
12187 case 8:
12188 {
12189 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
12190
12191 if(_class->type == 1 && value)
12192 {
12193 void (* Get)(void *, void *) = (void *)prop->Get;
12194
12195 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12196 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12197 exp->instance->_class = MkSpecifierName(_class->fullName);
12198 exp->instance->loc = exp->loc;
12199 exp->type = 1;
12200 Get(value, exp->instance->data);
12201 PopulateInstance(exp->instance);
12202 }
12203 break;
12204 }
12205 }
12206 }
12207 }
12208 }
12209 }
12210 else
12211 {
12212 exp->isConstant = 0x0;
12213 }
12214 }
12215 else if(member)
12216 {
12217 }
12218 }
12219 if(exp->type != 8)
12220 {
12221 FreeExpression(memberExp);
12222 FreeIdentifier(memberID);
12223 }
12224 break;
12225 }
12226 case 10:
12227 {
12228 struct Type * type = ProcessType(exp->typeName->qualifiers, exp->typeName->declarator);
12229
12230 FreeExpContents(exp);
12231 exp->constant = PrintUInt(ComputeTypeSize(type));
12232 exp->type = 2;
12233 FreeType(type);
12234 break;
12235 }
12236 case 15:
12237 {
12238 struct Symbol * classSym = exp->_class->symbol;
12239
12240 if(classSym && classSym->registered)
12241 {
12242 if(classSym->registered->fixed)
12243 {
12244 FreeSpecifier(exp->_class);
12245 exp->constant = PrintUInt(classSym->registered->templateClass ? classSym->registered->templateClass->structSize : classSym->registered->structSize);
12246 exp->type = 2;
12247 }
12248 else
12249 {
12250 char className[1024];
12251
12252 strcpy(className, "__ecereClass_");
12253 FullClassNameCat(className, classSym->string, 0x1);
12254 MangleClassName(className);
12255 DeclareClass(classSym, className);
12256 FreeExpContents(exp);
12257 exp->type = 9;
12258 exp->member.exp = MkExpIdentifier(MkIdentifier(className));
12259 exp->member.member = MkIdentifier("structSize");
12260 }
12261 }
12262 break;
12263 }
12264 case 11:
12265 {
12266 struct Type * type;
12267 struct Expression * e = exp;
12268
12269 if(exp->type == 11)
12270 {
12271 if(exp->cast.exp)
12272 ComputeExpression(exp->cast.exp);
12273 e = exp->cast.exp;
12274 }
12275 if(e && exp->expType)
12276 {
12277 type = exp->expType;
12278 if(type->kind == 8)
12279 {
12280 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
12281
12282 if(_class && (_class->type == 3 || _class->type == 2))
12283 {
12284 if(!_class->dataType)
12285 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
12286 type = _class->dataType;
12287 }
12288 }
12289 switch(type->kind)
12290 {
12291 case 24:
12292 case 1:
12293 if(type->isSigned)
12294 {
12295 char value = (char)0;
12296
12297 if(GetChar(e, &value))
12298 {
12299 FreeExpContents(exp);
12300 exp->constant = PrintChar(value);
12301 exp->type = 2;
12302 }
12303 }
12304 else
12305 {
12306 unsigned char value = (unsigned char)0;
12307
12308 if(GetUChar(e, &value))
12309 {
12310 FreeExpContents(exp);
12311 exp->constant = PrintUChar(value);
12312 exp->type = 2;
12313 }
12314 }
12315 break;
12316 case 2:
12317 if(type->isSigned)
12318 {
12319 short value = (short)0;
12320
12321 if(GetShort(e, &value))
12322 {
12323 FreeExpContents(exp);
12324 exp->constant = PrintShort(value);
12325 exp->type = 2;
12326 }
12327 }
12328 else
12329 {
12330 unsigned short value = (unsigned short)0;
12331
12332 if(GetUShort(e, &value))
12333 {
12334 FreeExpContents(exp);
12335 exp->constant = PrintUShort(value);
12336 exp->type = 2;
12337 }
12338 }
12339 break;
12340 case 3:
12341 if(type->isSigned)
12342 {
12343 int value = 0;
12344
12345 if(GetInt(e, &value))
12346 {
12347 FreeExpContents(exp);
12348 exp->constant = PrintInt(value);
12349 exp->type = 2;
12350 }
12351 }
12352 else
12353 {
12354 unsigned int value = 0;
12355
12356 if(GetUInt(e, &value))
12357 {
12358 FreeExpContents(exp);
12359 exp->constant = PrintUInt(value);
12360 exp->type = 2;
12361 }
12362 }
12363 break;
12364 case 4:
12365 if(type->isSigned)
12366 {
12367 long long value = 0;
12368
12369 if(GetInt64(e, &value))
12370 {
12371 FreeExpContents(exp);
12372 exp->constant = PrintInt64(value);
12373 exp->type = 2;
12374 }
12375 }
12376 else
12377 {
12378 uint64 value = 0;
12379
12380 if(GetUInt64(e, &value))
12381 {
12382 FreeExpContents(exp);
12383 exp->constant = PrintUInt64(value);
12384 exp->type = 2;
12385 }
12386 }
12387 break;
12388 case 22:
12389 if(type->isSigned)
12390 {
12391 intptr_t value = 0;
12392
12393 if(GetIntPtr(e, &value))
12394 {
12395 FreeExpContents(exp);
12396 exp->constant = PrintInt64((long long)value);
12397 exp->type = 2;
12398 }
12399 }
12400 else
12401 {
12402 uintptr_t value = 0;
12403
12404 if(GetUIntPtr(e, &value))
12405 {
12406 FreeExpContents(exp);
12407 exp->constant = PrintUInt64((uint64)value);
12408 exp->type = 2;
12409 }
12410 }
12411 break;
12412 case 23:
12413 if(type->isSigned)
12414 {
12415 ssize_t value = 0;
12416
12417 if(GetIntSize(e, &value))
12418 {
12419 FreeExpContents(exp);
12420 exp->constant = PrintInt64((long long)value);
12421 exp->type = 2;
12422 }
12423 }
12424 else
12425 {
12426 size_t value = 0;
12427
12428 if(GetUIntSize(e, &value))
12429 {
12430 FreeExpContents(exp);
12431 exp->constant = PrintUInt64((uint64)value);
12432 exp->type = 2;
12433 }
12434 }
12435 break;
12436 case 6:
12437 {
12438 float value = 0;
12439
12440 if(GetFloat(e, &value))
12441 {
12442 FreeExpContents(exp);
12443 exp->constant = PrintFloat(value);
12444 exp->type = 2;
12445 }
12446 break;
12447 }
12448 case 7:
12449 {
12450 double value = 0;
12451
12452 if(GetDouble(e, &value))
12453 {
12454 FreeExpContents(exp);
12455 exp->constant = PrintDouble(value);
12456 exp->type = 2;
12457 }
12458 break;
12459 }
12460 }
12461 }
12462 break;
12463 }
12464 case 12:
12465 {
12466 struct Operand op1 = 
12467 {
12468 0, 0, 0, 0, 
12469 {
12470 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
12471 }
12472 };
12473 struct Operand op2 = 
12474 {
12475 0, 0, 0, 0, 
12476 {
12477 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
12478 }
12479 };
12480 struct Operand op3 = 
12481 {
12482 0, 0, 0, 0, 
12483 {
12484 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
12485 }
12486 };
12487
12488 if(exp->cond.exp)
12489 ComputeExpression((*exp->cond.exp).last);
12490 if(exp->cond.elseExp)
12491 ComputeExpression(exp->cond.elseExp);
12492 if(exp->cond.cond)
12493 ComputeExpression(exp->cond.cond);
12494 op1 = GetOperand(exp->cond.cond);
12495 if(op1.type)
12496 op1.type->refCount++;
12497 op2 = GetOperand((*exp->cond.exp).last);
12498 if(op2.type)
12499 op2.type->refCount++;
12500 op3 = GetOperand(exp->cond.elseExp);
12501 if(op3.type)
12502 op3.type->refCount++;
12503 if(op1.ops.Cond)
12504 {
12505 FreeExpContents(exp);
12506 op1.ops.Cond(exp, &op1, &op2, &op3);
12507 }
12508 if(op1.type)
12509 FreeType(op1.type);
12510 if(op2.type)
12511 FreeType(op2.type);
12512 if(op3.type)
12513 FreeType(op3.type);
12514 break;
12515 }
12516 }
12517 }
12518
12519 void ApplyAnyObjectLogic(struct Expression * e);
12520
12521 extern void CopyTypeInto(struct Type * type, struct Type * src);
12522
12523 static unsigned int CheckExpressionType(struct Expression * exp, struct Type * destType, unsigned int skipUnitBla)
12524 {
12525 unsigned int result = 0x1;
12526
12527 if(destType)
12528 {
12529 struct __ecereNameSpace__ecere__sys__OldList converts = 
12530 {
12531 0, 0, 0, 0, 0
12532 };
12533 struct Conversion * convert;
12534
12535 if(destType->kind == 0)
12536 return 0x0;
12537 if(!MatchTypeExpression(exp, destType, &converts, skipUnitBla))
12538 result = 0x0;
12539 if(converts.count)
12540 {
12541 for(convert = converts.first; convert; convert = convert->next)
12542 {
12543 unsigned int empty = !(convert->isGet ? (void *)convert->convert->Get : (void *)convert->convert->Set);
12544
12545 if(!empty)
12546 {
12547 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12548 int objectType = exp->expType ? exp->expType->classObjectType : 0;
12549
12550 *newExp = *exp;
12551 newExp->destType = (((void *)0));
12552 if(convert->isGet)
12553 {
12554 exp->type = 8;
12555 exp->addedThis = 0x1;
12556 exp->member.exp = newExp;
12557 FreeType(exp->member.exp->expType);
12558 exp->member.exp->expType = MkClassType(convert->convert->_class->fullName);
12559 exp->member.exp->expType->classObjectType = objectType;
12560 exp->member.member = MkIdentifier(convert->convert->dataTypeString);
12561 exp->member.memberType = 1;
12562 exp->expType = convert->resultType ? convert->resultType : convert->convert->dataType;
12563 exp->needCast = 0x1;
12564 if(exp->expType)
12565 exp->expType->refCount++;
12566 ApplyAnyObjectLogic(exp->member.exp);
12567 }
12568 else
12569 {
12570 {
12571 exp->type = 8;
12572 exp->addedThis = 0x1;
12573 exp->member.exp = newExp;
12574 if(newExp->expType && newExp->expType->kind == 8 && newExp->expType->_class && newExp->expType->_class->registered && newExp->expType->_class->registered->type == 5)
12575 {
12576 newExp->byReference = 0x1;
12577 }
12578 FreeType(exp->member.exp->expType);
12579 exp->member.exp->expType = (((void *)0));
12580 if(convert->convert->dataType)
12581 {
12582 exp->member.exp->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
12583 CopyTypeInto(exp->member.exp->expType, convert->convert->dataType);
12584 exp->member.exp->expType->refCount = 1;
12585 exp->member.exp->expType->classObjectType = objectType;
12586 ApplyAnyObjectLogic(exp->member.exp);
12587 }
12588 exp->member.member = MkIdentifier(convert->convert->_class->fullName);
12589 exp->member.memberType = 4;
12590 exp->expType = convert->resultType ? convert->resultType : MkClassType(convert->convert->_class->fullName);
12591 exp->needCast = 0x1;
12592 if(convert->resultType)
12593 convert->resultType->refCount++;
12594 }
12595 }
12596 }
12597 else
12598 {
12599 FreeType(exp->expType);
12600 if(convert->isGet)
12601 {
12602 exp->expType = convert->resultType ? convert->resultType : convert->convert->dataType;
12603 exp->needCast = 0x1;
12604 if(exp->expType)
12605 exp->expType->refCount++;
12606 }
12607 else
12608 {
12609 exp->expType = convert->resultType ? convert->resultType : MkClassType(convert->convert->_class->fullName);
12610 exp->needCast = 0x1;
12611 if(convert->resultType)
12612 convert->resultType->refCount++;
12613 }
12614 }
12615 }
12616 if(exp->isConstant && inCompiler)
12617 ComputeExpression(exp);
12618 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(&converts, FreeConvert);
12619 }
12620 if(!result && exp->expType && converts.count)
12621 {
12622 result = MatchTypes(exp->expType, exp->destType, (((void *)0)), (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0);
12623 }
12624 if(!result && exp->expType && exp->destType)
12625 {
12626 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))
12627 result = 0x1;
12628 }
12629 }
12630 return result;
12631 }
12632
12633 extern struct Statement * MkCompoundStmt(struct __ecereNameSpace__ecere__sys__OldList * declarations, struct __ecereNameSpace__ecere__sys__OldList * statements);
12634
12635 extern struct Statement * MkExpressionStmt(struct __ecereNameSpace__ecere__sys__OldList * expressions);
12636
12637 extern struct Expression * MkExpMember(struct Expression * expression, struct Identifier * member);
12638
12639 void CheckTemplateTypes(struct Expression * exp)
12640 {
12641 if(exp->destType && exp->destType->passAsTemplate && exp->expType && exp->expType->kind != 20 && !exp->expType->passAsTemplate)
12642 {
12643 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12644 struct Statement * compound;
12645 struct Context * context;
12646
12647 *newExp = *exp;
12648 if(exp->destType)
12649 exp->destType->refCount++;
12650 if(exp->expType)
12651 exp->expType->refCount++;
12652 newExp->prev = (((void *)0));
12653 newExp->next = (((void *)0));
12654 switch(exp->expType->kind)
12655 {
12656 case 7:
12657 if(exp->destType->classObjectType)
12658 {
12659 if(exp->destType)
12660 exp->destType->refCount--;
12661 if(exp->expType)
12662 exp->expType->refCount--;
12663 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
12664 }
12665 else
12666 {
12667 struct __ecereNameSpace__ecere__sys__OldList * specs;
12668 struct __ecereNameSpace__ecere__sys__OldList * unionDefs = MkList();
12669 struct __ecereNameSpace__ecere__sys__OldList * statements = MkList();
12670
12671 context = PushContext();
12672 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(DOUBLE)), MkListOne(MkDeclaratorIdentifier(MkIdentifier("d"))), (((void *)0)))));
12673 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifierName("uint64")), MkListOne(MkDeclaratorIdentifier(MkIdentifier("i"))), (((void *)0)))));
12674 specs = MkListOne(MkStructOrUnion(4, (((void *)0)), unionDefs));
12675 exp->type = 23;
12676 exp->compound = MkCompoundStmt(MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internal_union")), (((void *)0)))))), statements);
12677 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("d")), '=', newExp))));
12678 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("i")))));
12679 exp->compound->compound.context = context;
12680 PopContext(context);
12681 }
12682 break;
12683 default:
12684 exp->type = 11;
12685 exp->cast.typeName = MkTypeName(MkListOne(MkSpecifierName("uint64")), (((void *)0)));
12686 exp->cast.exp = MkExpBrackets(MkListOne(newExp));
12687 break;
12688 }
12689 }
12690 else if(exp->expType && exp->expType->passAsTemplate && exp->destType && ((unsigned int)((exp->usage & 0x1) >> 0)) && exp->destType->kind != 20 && !exp->destType->passAsTemplate)
12691 {
12692 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12693 struct Statement * compound;
12694 struct Context * context;
12695
12696 *newExp = *exp;
12697 if(exp->destType)
12698 exp->destType->refCount++;
12699 if(exp->expType)
12700 exp->expType->refCount++;
12701 newExp->prev = (((void *)0));
12702 newExp->next = (((void *)0));
12703 switch(exp->expType->kind)
12704 {
12705 case 7:
12706 if(exp->destType->classObjectType)
12707 {
12708 if(exp->destType)
12709 exp->destType->refCount--;
12710 if(exp->expType)
12711 exp->expType->refCount--;
12712 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
12713 }
12714 else
12715 {
12716 struct __ecereNameSpace__ecere__sys__OldList * specs;
12717 struct __ecereNameSpace__ecere__sys__OldList * unionDefs = MkList();
12718 struct __ecereNameSpace__ecere__sys__OldList * statements = MkList();
12719
12720 context = PushContext();
12721 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(DOUBLE)), MkListOne(MkDeclaratorIdentifier(MkIdentifier("d"))), (((void *)0)))));
12722 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifierName("uint64")), MkListOne(MkDeclaratorIdentifier(MkIdentifier("i"))), (((void *)0)))));
12723 specs = MkListOne(MkStructOrUnion(4, (((void *)0)), unionDefs));
12724 exp->type = 23;
12725 exp->compound = MkCompoundStmt(MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internal_union")), (((void *)0)))))), statements);
12726 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("i")), '=', newExp))));
12727 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("d")))));
12728 exp->compound->compound.context = context;
12729 PopContext(context);
12730 }
12731 break;
12732 case 8:
12733 {
12734 if(exp->expType->_class && exp->expType->_class->registered && exp->expType->_class->registered->type == 1)
12735 {
12736 exp->type = 5;
12737 exp->list = MkListOne(MkExpOp((((void *)0)), '*', MkExpCast(MkTypeName(MkListOne(MkSpecifierName(exp->expType->_class->string)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), newExp)));
12738 ProcessExpressionType((*exp->list).first);
12739 break;
12740 }
12741 else
12742 {
12743 exp->type = 5;
12744 exp->list = MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName(exp->expType->_class->string)), (((void *)0))), newExp));
12745 newExp->needCast = 0x1;
12746 ProcessExpressionType((*exp->list).first);
12747 break;
12748 }
12749 }
12750 default:
12751 {
12752 if(exp->expType->kind == 20)
12753 {
12754 struct Type * type = ProcessTemplateParameterType(exp->expType->templateParameter);
12755
12756 if(type)
12757 {
12758 FreeType(exp->destType);
12759 FreeType(exp->expType);
12760 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
12761 break;
12762 }
12763 }
12764 if(newExp->type == 8 && newExp->member.memberType == 3)
12765 {
12766 exp->type = 4;
12767 exp->op.op = '*';
12768 exp->op.exp1 = (((void *)0));
12769 exp->op.exp2 = MkExpCast(MkTypeName(MkListOne(MkSpecifierName("uint64")), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), MkExpBrackets(MkListOne(MkExpOp((((void *)0)), '&', newExp))));
12770 }
12771 else
12772 {
12773 char typeString[1024];
12774 struct Declarator * decl;
12775 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
12776
12777 typeString[0] = '\0';
12778 PrintType(exp->expType, typeString, 0x0, 0x0);
12779 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
12780 exp->type = 11;
12781 exp->cast.typeName = MkTypeName(specs, decl);
12782 exp->cast.exp = MkExpBrackets(MkListOne(newExp));
12783 exp->cast.exp->needCast = 0x1;
12784 }
12785 break;
12786 }
12787 }
12788 }
12789 }
12790
12791 extern int strncmp(const char * , const char * , size_t n);
12792
12793 struct __ecereNameSpace__ecere__sys__BTNode * __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindPrefix(struct __ecereNameSpace__ecere__sys__BinaryTree * this, char *  key);
12794
12795 static struct Symbol * ScanWithNameSpace(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, char * nameSpace, char * name)
12796 {
12797 int nsLen = strlen(nameSpace);
12798 struct Symbol * symbol;
12799
12800 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)))
12801 {
12802 char * s = symbol->string;
12803
12804 if(!strncmp(s, nameSpace, nsLen))
12805 {
12806 int c;
12807 char * namePart;
12808
12809 for(c = strlen(s) - 1; c >= 0; c--)
12810 if(s[c] == ':')
12811 break;
12812 namePart = s + c + 1;
12813 if(!strcmp(namePart, name))
12814 {
12815 return symbol;
12816 }
12817 }
12818 else
12819 break;
12820 }
12821 return (((void *)0));
12822 }
12823
12824 static struct Symbol * FindWithNameSpace(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, char * name)
12825 {
12826 int c;
12827 char nameSpace[1024];
12828 char * namePart;
12829 unsigned int gotColon = 0x0;
12830
12831 nameSpace[0] = '\0';
12832 for(c = strlen(name) - 1; c >= 0; c--)
12833 if(name[c] == ':')
12834 {
12835 gotColon = 0x1;
12836 break;
12837 }
12838 namePart = name + c + 1;
12839 while(c >= 0 && name[c] == ':')
12840 c--;
12841 if(c >= 0)
12842 {
12843 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, name);
12844
12845 if(symbol)
12846 return symbol;
12847 memcpy(nameSpace, name, c + 1);
12848 nameSpace[c + 1] = (char)0;
12849 return ScanWithNameSpace(tree, nameSpace, namePart);
12850 }
12851 else if(gotColon)
12852 {
12853 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, namePart);
12854
12855 return symbol;
12856 }
12857 else
12858 {
12859 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, namePart);
12860
12861 if(symbol)
12862 return symbol;
12863 return ScanWithNameSpace(tree, "", namePart);
12864 }
12865 return (((void *)0));
12866 }
12867
12868 static void ProcessDeclaration(struct Declaration * decl);
12869
12870 struct Symbol * FindSymbol(char * name, struct Context * startContext, struct Context * endContext, unsigned int isStruct, unsigned int globalNameSpace)
12871 {
12872 struct Context * ctx;
12873 struct Symbol * symbol = (((void *)0));
12874
12875 for(ctx = startContext; ctx && !symbol; ctx = ctx->parent)
12876 {
12877 if(ctx == globalContext && !globalNameSpace && ctx->hasNameSpace)
12878 {
12879 symbol = (((void *)0));
12880 if(thisNameSpace)
12881 {
12882 char curName[1024];
12883
12884 strcpy(curName, thisNameSpace);
12885 strcat(curName, "::");
12886 strcat(curName, name);
12887 symbol = FindWithNameSpace(isStruct ? &ctx->structSymbols : &ctx->symbols, curName);
12888 }
12889 if(!symbol)
12890 symbol = FindWithNameSpace(isStruct ? &ctx->structSymbols : &ctx->symbols, name);
12891 }
12892 else
12893 symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString((isStruct ? &ctx->structSymbols : &ctx->symbols), name);
12894 if(symbol || ctx == endContext)
12895 break;
12896 }
12897 if(inCompiler && curExternal && symbol && ctx == globalContext && curExternal->symbol && symbol->id > curExternal->symbol->idCode && symbol->pointerExternal)
12898 {
12899 if(symbol->pointerExternal->type == 0)
12900 {
12901 struct FunctionDefinition * function = symbol->pointerExternal->function;
12902 struct Context * tmpContext = curContext;
12903
12904 curContext = (((void *)0));
12905 symbol->pointerExternal = MkExternalDeclaration(MkDeclaration(CopyList(function->specifiers, CopySpecifier), MkListOne(MkInitDeclarator(CopyDeclarator(function->declarator), (((void *)0))))));
12906 curContext = tmpContext;
12907 symbol->pointerExternal->symbol = symbol;
12908 DeclareType(symbol->type, 0x1, 0x1);
12909 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, symbol->pointerExternal);
12910 symbol->id = curExternal->symbol->idCode;
12911 }
12912 else if(symbol->pointerExternal->type == 1 && curExternal->symbol->idCode < symbol->pointerExternal->symbol->id)
12913 {
12914 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
12915 symbol->id = curExternal->symbol->idCode;
12916 }
12917 }
12918 return symbol;
12919 }
12920
12921 static void GetTypeSpecs(struct Type * type, struct __ecereNameSpace__ecere__sys__OldList * specs)
12922 {
12923 if(!type->isSigned && type->kind != 22 && type->kind != 23)
12924 ListAdd(specs, MkSpecifier(UNSIGNED));
12925 switch(type->kind)
12926 {
12927 case 8:
12928 {
12929 if(type->_class->registered)
12930 {
12931 if(!type->_class->registered->dataType)
12932 type->_class->registered->dataType = ProcessTypeString(type->_class->registered->dataTypeString, 0x0);
12933 GetTypeSpecs(type->_class->registered->dataType, specs);
12934 }
12935 break;
12936 }
12937 case 7:
12938 ListAdd(specs, MkSpecifier(DOUBLE));
12939 break;
12940 case 6:
12941 ListAdd(specs, MkSpecifier(FLOAT));
12942 break;
12943 case 1:
12944 ListAdd(specs, MkSpecifier(CHAR));
12945 break;
12946 case 24:
12947 ListAdd(specs, MkSpecifier(_BOOL));
12948 break;
12949 case 2:
12950 ListAdd(specs, MkSpecifier(SHORT));
12951 break;
12952 case 4:
12953 ListAdd(specs, MkSpecifier(INT64));
12954 break;
12955 case 22:
12956 ListAdd(specs, MkSpecifierName(type->isSigned ? "intptr" : "uintptr"));
12957 break;
12958 case 23:
12959 ListAdd(specs, MkSpecifierName(type->isSigned ? "intsize" : "uintsize"));
12960 break;
12961 case 3:
12962 default:
12963 ListAdd(specs, MkSpecifier(INT));
12964 break;
12965 }
12966 }
12967
12968 static void PrintArraySize(struct Type * arrayType, char * string)
12969 {
12970 char size[256];
12971
12972 size[0] = '\0';
12973 strcat(size, "[");
12974 if(arrayType->enumClass)
12975 strcat(size, arrayType->enumClass->string);
12976 else if(arrayType->arraySizeExp)
12977 PrintExpression(arrayType->arraySizeExp, size);
12978 strcat(size, "]");
12979 strcat(string, size);
12980 }
12981
12982 static void PrintTypeSpecs(struct Type * type, char * string, unsigned int fullName, unsigned int printConst)
12983 {
12984 if(type)
12985 {
12986 if(printConst && type->constant)
12987 strcat(string, "const ");
12988 switch(type->kind)
12989 {
12990 case 8:
12991 {
12992 struct Symbol * c = type->_class;
12993
12994 if(type->classObjectType == 2)
12995 strcat(string, "typed_object");
12996 else if(type->classObjectType == 3)
12997 strcat(string, "any_object");
12998 else
12999 {
13000 if(c && c->string)
13001 strcat(string, (fullName || !c->registered) ? c->string : c->registered->name);
13002 }
13003 if(type->byReference)
13004 strcat(string, " &");
13005 break;
13006 }
13007 case 0:
13008 strcat(string, "void");
13009 break;
13010 case 3:
13011 strcat(string, type->isSigned ? "int" : "uint");
13012 break;
13013 case 4:
13014 strcat(string, type->isSigned ? "int64" : "uint64");
13015 break;
13016 case 22:
13017 strcat(string, type->isSigned ? "intptr" : "uintptr");
13018 break;
13019 case 23:
13020 strcat(string, type->isSigned ? "intsize" : "uintsize");
13021 break;
13022 case 1:
13023 strcat(string, type->isSigned ? "char" : "byte");
13024 break;
13025 case 24:
13026 strcat(string, "_Bool");
13027 break;
13028 case 2:
13029 strcat(string, type->isSigned ? "short" : "uint16");
13030 break;
13031 case 6:
13032 strcat(string, "float");
13033 break;
13034 case 7:
13035 strcat(string, "double");
13036 break;
13037 case 9:
13038 if(type->enumName)
13039 {
13040 strcat(string, "struct ");
13041 strcat(string, type->enumName);
13042 }
13043 else if(type->typeName)
13044 strcat(string, type->typeName);
13045 else
13046 {
13047 struct Type * member;
13048
13049 strcat(string, "struct { ");
13050 for(member = type->members.first; member; member = member->next)
13051 {
13052 PrintType(member, string, 0x1, fullName);
13053 strcat(string, "; ");
13054 }
13055 strcat(string, "}");
13056 }
13057 break;
13058 case 10:
13059 if(type->enumName)
13060 {
13061 strcat(string, "union ");
13062 strcat(string, type->enumName);
13063 }
13064 else if(type->typeName)
13065 strcat(string, type->typeName);
13066 else
13067 {
13068 strcat(string, "union ");
13069 strcat(string, "(unnamed)");
13070 }
13071 break;
13072 case 15:
13073 if(type->enumName)
13074 {
13075 strcat(string, "enum ");
13076 strcat(string, type->enumName);
13077 }
13078 else if(type->typeName)
13079 strcat(string, type->typeName);
13080 else
13081 strcat(string, "int");
13082 break;
13083 case 14:
13084 strcat(string, "...");
13085 break;
13086 case 19:
13087 strcat(string, "subclass(");
13088 strcat(string, type->_class ? type->_class->string : "int");
13089 strcat(string, ")");
13090 break;
13091 case 20:
13092 strcat(string, type->templateParameter->identifier->string);
13093 break;
13094 case 21:
13095 strcat(string, "thisclass");
13096 break;
13097 case 17:
13098 strcat(string, "__builtin_va_list");
13099 break;
13100 }
13101 }
13102 }
13103
13104 extern char *  __ecereNameSpace__ecere__sys__RSearchString(char *  buffer, char *  subStr, int maxLen, unsigned int matchCase, unsigned int matchWord);
13105
13106 static void PrintName(struct Type * type, char * string, unsigned int fullName)
13107 {
13108 if(type->name && type->name[0])
13109 {
13110 if(fullName)
13111 strcat(string, type->name);
13112 else
13113 {
13114 char * name = __ecereNameSpace__ecere__sys__RSearchString(type->name, "::", strlen(type->name), 0x1, 0x0);
13115
13116 if(name)
13117 name += 2;
13118 else
13119 name = type->name;
13120 strcat(string, name);
13121 }
13122 }
13123 }
13124
13125 static void PrintAttribs(struct Type * type, char * string)
13126 {
13127 if(type)
13128 {
13129 if(type->dllExport)
13130 strcat(string, "dllexport ");
13131 if(type->attrStdcall)
13132 strcat(string, "stdcall ");
13133 }
13134 }
13135
13136 static void PrePrintType(struct Type * type, char * string, unsigned int fullName, struct Type * parentType, unsigned int printConst)
13137 {
13138 if(type->kind == 12 || type->kind == 13 || type->kind == 11 || type->kind == 16)
13139 {
13140 struct Type * attrType = (((void *)0));
13141
13142 if((type->kind == 11 || type->kind == 16) && (!parentType || parentType->kind != 13))
13143 PrintAttribs(type, string);
13144 if(printConst && type->constant && (type->kind == 11 || type->kind == 16))
13145 strcat(string, " const");
13146 PrePrintType(type->kind == 16 ? type->method->dataType : type->type, string, fullName, type, printConst);
13147 if(type->kind == 13 && (type->type->kind == 12 || type->type->kind == 11 || type->type->kind == 16))
13148 strcat(string, " (");
13149 if(type->kind == 13)
13150 {
13151 if(type->type->kind == 11 || type->type->kind == 16)
13152 PrintAttribs(type->type, string);
13153 }
13154 if(type->kind == 13)
13155 {
13156 if(type->type->kind == 11 || type->type->kind == 16 || type->type->kind == 12)
13157 strcat(string, "*");
13158 else
13159 strcat(string, " *");
13160 }
13161 if(printConst && type->constant && type->kind == 13)
13162 strcat(string, " const");
13163 }
13164 else
13165 PrintTypeSpecs(type, string, fullName, printConst);
13166 }
13167
13168 static void PostPrintType(struct Type * type, char * string, unsigned int fullName)
13169 {
13170 if(type->kind == 13 && (type->type->kind == 12 || type->type->kind == 11 || type->type->kind == 16))
13171 strcat(string, ")");
13172 if(type->kind == 12)
13173 PrintArraySize(type, string);
13174 else if(type->kind == 11)
13175 {
13176 struct Type * param;
13177
13178 strcat(string, "(");
13179 for(param = type->params.first; param; param = param->next)
13180 {
13181 PrintType(param, string, 0x1, fullName);
13182 if(param->next)
13183 strcat(string, ", ");
13184 }
13185 strcat(string, ")");
13186 }
13187 if(type->kind == 12 || type->kind == 13 || type->kind == 11 || type->kind == 16)
13188 PostPrintType(type->kind == 16 ? type->method->dataType : type->type, string, fullName);
13189 }
13190
13191 static void _PrintType(struct Type * type, char * string, unsigned int printName, unsigned int fullName, unsigned int printConst)
13192 {
13193 PrePrintType(type, string, fullName, (((void *)0)), printConst);
13194 if(type->thisClass || (printName && type->name && type->name[0]))
13195 strcat(string, " ");
13196 if((type->thisClass || type->staticMethod))
13197 {
13198 struct Symbol * _class = type->thisClass;
13199
13200 if((type->classObjectType == 2 || type->classObjectType == 1) || (_class && !strcmp(_class->string, "class")))
13201 {
13202 if(type->classObjectType == 1)
13203 strcat(string, "class");
13204 else
13205 strcat(string, type->byReference ? "typed_object&" : "typed_object");
13206 }
13207 else if(_class && _class->string)
13208 {
13209 char * s = _class->string;
13210
13211 if(fullName)
13212 strcat(string, s);
13213 else
13214 {
13215 char * name = __ecereNameSpace__ecere__sys__RSearchString(s, "::", strlen(s), 0x1, 0x0);
13216
13217 if(name)
13218 name += 2;
13219 else
13220 name = s;
13221 strcat(string, name);
13222 }
13223 }
13224 strcat(string, "::");
13225 }
13226 if(printName && type->name)
13227 PrintName(type, string, fullName);
13228 PostPrintType(type, string, fullName);
13229 if(type->bitFieldCount)
13230 {
13231 char count[100];
13232
13233 sprintf(count, ":%d", type->bitFieldCount);
13234 strcat(string, count);
13235 }
13236 }
13237
13238 void PrintType(struct Type * type, char * string, unsigned int printName, unsigned int fullName)
13239 {
13240 _PrintType(type, string, printName, fullName, 0x1);
13241 }
13242
13243 void PrintTypeNoConst(struct Type * type, char * string, unsigned int printName, unsigned int fullName)
13244 {
13245 _PrintType(type, string, printName, fullName, 0x0);
13246 }
13247
13248 static struct Type * FindMember(struct Type * type, char * string)
13249 {
13250 struct Type * memberType;
13251
13252 for(memberType = type->members.first; memberType; memberType = memberType->next)
13253 {
13254 if(!memberType->name)
13255 {
13256 struct Type * subType = FindMember(memberType, string);
13257
13258 if(subType)
13259 return subType;
13260 }
13261 else if(!strcmp(memberType->name, string))
13262 return memberType;
13263 }
13264 return (((void *)0));
13265 }
13266
13267 struct Type * FindMemberAndOffset(struct Type * type, char * string, unsigned int * offset)
13268 {
13269 struct Type * memberType;
13270
13271 for(memberType = type->members.first; memberType; memberType = memberType->next)
13272 {
13273 if(!memberType->name)
13274 {
13275 struct Type * subType = FindMember(memberType, string);
13276
13277 if(subType)
13278 {
13279 *offset += memberType->offset;
13280 return subType;
13281 }
13282 }
13283 else if(!strcmp(memberType->name, string))
13284 {
13285 *offset += memberType->offset;
13286 return memberType;
13287 }
13288 }
13289 return (((void *)0));
13290 }
13291
13292 extern unsigned int parseError;
13293
13294 unsigned int GetParseError()
13295 {
13296 return parseError;
13297 }
13298
13299 extern struct __ecereNameSpace__ecere__com__Instance * fileInput;
13300
13301 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Write;
13302
13303 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__File;
13304
13305 struct Expression * ParseExpressionString(char * expression)
13306 {
13307 parseError = 0x0;
13308 fileInput = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
13309 ((int (*)(struct __ecereNameSpace__ecere__com__Instance *, void *  buffer, unsigned int size, unsigned int count))__extension__ ({
13310 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
13311
13312 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
13313 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Write])(fileInput, expression, 1, strlen(expression));
13314 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))__extension__ ({
13315 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
13316
13317 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
13318 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(fileInput, 0, 0);
13319 echoOn = 0x0;
13320 parsedExpression = (((void *)0));
13321 resetScanner();
13322 expression_yyparse();
13323 (__ecereNameSpace__ecere__com__eInstance_DecRef(fileInput), fileInput = 0);
13324 return parsedExpression;
13325 }
13326
13327 extern char *  QMkString(char *  source);
13328
13329 static unsigned int ResolveIdWithClass(struct Expression * exp, struct __ecereNameSpace__ecere__com__Class * _class, unsigned int skipIDClassCheck)
13330 {
13331 struct Identifier * id = exp->identifier;
13332 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
13333 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
13334 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
13335 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
13336
13337 if(_class && _class->type == 4)
13338 {
13339 struct __ecereNameSpace__ecere__sys__NamedLink * value = (((void *)0));
13340 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
13341
13342 if(enumClass)
13343 {
13344 struct __ecereNameSpace__ecere__com__Class * baseClass;
13345
13346 for(baseClass = _class; baseClass && baseClass->type == 4; baseClass = baseClass->base)
13347 {
13348 struct __ecereNameSpace__ecere__com__EnumClassData * e = (baseClass ? ((void *)(((char *)baseClass->data) + enumClass->offsetClass)) : (((void *)0)));
13349
13350 for(value = e->values.first; value; value = value->next)
13351 {
13352 if(!strcmp(value->name, id->string))
13353 break;
13354 }
13355 if(value)
13356 {
13357 char constant[256];
13358
13359 FreeExpContents(exp);
13360 exp->type = 2;
13361 exp->isConstant = 0x1;
13362 if(!strcmp(baseClass->dataTypeString, "int"))
13363 sprintf(constant, "%d", (int)value->data);
13364 else
13365 sprintf(constant, "0x%X", (int)value->data);
13366 exp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
13367 exp->expType = MkClassType(baseClass->fullName);
13368 break;
13369 }
13370 }
13371 }
13372 if(value)
13373 return 0x1;
13374 }
13375 if((method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule)))
13376 {
13377 ProcessMethodType(method);
13378 exp->expType = __extension__ ({
13379 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13380
13381 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 16, __ecereInstance1->method = method, __ecereInstance1->methodClass = (skipIDClassCheck || (id && id->_class)) ? _class : (((void *)0)), __ecereInstance1;
13382 });
13383 return 0x1;
13384 }
13385 else if((prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule)))
13386 {
13387 if(!prop->dataType)
13388 ProcessPropertyType(prop);
13389 exp->expType = prop->dataType;
13390 if(prop->dataType)
13391 prop->dataType->refCount++;
13392 return 0x1;
13393 }
13394 else if((member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)))))
13395 {
13396 if(!member->dataType)
13397 member->dataType = ProcessTypeString(member->dataTypeString, 0x0);
13398 exp->expType = member->dataType;
13399 if(member->dataType)
13400 member->dataType->refCount++;
13401 return 0x1;
13402 }
13403 else if((classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(_class, id->string)))
13404 {
13405 if(!classProp->dataType)
13406 classProp->dataType = ProcessTypeString(classProp->dataTypeString, 0x0);
13407 if(classProp->constant)
13408 {
13409 FreeExpContents(exp);
13410 exp->isConstant = 0x1;
13411 if(classProp->dataType->kind == 13 && classProp->dataType->type->kind == 1)
13412 {
13413 exp->type = 3;
13414 exp->constant = QMkString((char *)classProp->Get(_class));
13415 }
13416 else
13417 {
13418 char constant[256];
13419
13420 exp->type = 2;
13421 sprintf(constant, "%d", (int)classProp->Get(_class));
13422 exp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
13423 }
13424 }
13425 else
13426 {
13427 }
13428 exp->expType = classProp->dataType;
13429 if(classProp->dataType)
13430 classProp->dataType->refCount++;
13431 return 0x1;
13432 }
13433 return 0x0;
13434 }
13435
13436 static struct GlobalData * ScanGlobalData(struct __ecereNameSpace__ecere__com__NameSpace * nameSpace, char * name)
13437 {
13438 struct __ecereNameSpace__ecere__sys__BinaryTree * tree = &nameSpace->functions;
13439 struct GlobalData * data = (struct GlobalData *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString((&*tree), name);
13440 struct __ecereNameSpace__ecere__com__NameSpace * child;
13441
13442 if(!data)
13443 {
13444 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)))
13445 {
13446 data = ScanGlobalData(child, name);
13447 if(data)
13448 break;
13449 }
13450 }
13451 return data;
13452 }
13453
13454 extern struct __ecereNameSpace__ecere__com__NameSpace *  globalData;
13455
13456 extern char *  strncpy(char * , const char * , size_t n);
13457
13458 static struct GlobalData * FindGlobalData(char * name)
13459 {
13460 int start = 0, c;
13461 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
13462
13463 nameSpace = globalData;
13464 for(c = 0; name[c]; c++)
13465 {
13466 if(name[c] == '.' || (name[c] == ':' && name[c + 1] == ':'))
13467 {
13468 struct __ecereNameSpace__ecere__com__NameSpace * newSpace;
13469 char * spaceName = __ecereNameSpace__ecere__com__eSystem_New(sizeof(char) * (c - start + 1));
13470
13471 strncpy(spaceName, name + start, c - start);
13472 spaceName[c - start] = '\0';
13473 newSpace = (struct __ecereNameSpace__ecere__com__NameSpace *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(&(*nameSpace).nameSpaces, spaceName);
13474 (__ecereNameSpace__ecere__com__eSystem_Delete(spaceName), spaceName = 0);
13475 if(!newSpace)
13476 return (((void *)0));
13477 nameSpace = newSpace;
13478 if(name[c] == ':')
13479 c++;
13480 start = c + 1;
13481 }
13482 }
13483 if(c - start)
13484 {
13485 return ScanGlobalData(nameSpace, name + start);
13486 }
13487 return (((void *)0));
13488 }
13489
13490 static int definedExpStackPos;
13491
13492 static void * definedExpStack[512];
13493
13494 void ReplaceExpContents(struct Expression * checkedExp, struct Expression * newExp)
13495 {
13496 struct Expression * prev = checkedExp->prev, * next = checkedExp->next;
13497
13498 FreeExpContents(checkedExp);
13499 FreeType(checkedExp->expType);
13500 FreeType(checkedExp->destType);
13501 *checkedExp = *newExp;
13502 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
13503 checkedExp->prev = prev;
13504 checkedExp->next = next;
13505 }
13506
13507 extern struct Expression * MkExpCall(struct Expression * expression, struct __ecereNameSpace__ecere__sys__OldList * arguments);
13508
13509 extern int printf(char * , ...);
13510
13511 void __ecereMethod_Expression_Clear();
13512
13513 void ApplyAnyObjectLogic(struct Expression * e)
13514 {
13515 struct Type * destType = e->destType;
13516
13517 if(destType && (destType->classObjectType == 3))
13518 {
13519 if(e && e->expType)
13520 {
13521 struct Type * type = e->expType;
13522 struct __ecereNameSpace__ecere__com__Class * _class = (((void *)0));
13523
13524 if(type->kind == 8 && type->_class && type->_class->registered)
13525 {
13526 _class = type->_class->registered;
13527 }
13528 else if(type->kind == 19)
13529 {
13530 _class = FindClass("ecere::com::Class")->registered;
13531 }
13532 else
13533 {
13534 char string[1024] = "";
13535 struct Symbol * classSym;
13536
13537 PrintTypeNoConst(type, string, 0x0, 0x1);
13538 classSym = FindClass(string);
13539 if(classSym)
13540 _class = classSym->registered;
13541 }
13542 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)))
13543 {
13544 if(!_class || strcmp(_class->fullName, "char *"))
13545 {
13546 struct Expression * checkedExp = e, * newExp;
13547
13548 while(((checkedExp->type == 5 || checkedExp->type == 32 || checkedExp->type == 23) && checkedExp->list) || checkedExp->type == 11)
13549 {
13550 if(checkedExp->type == 5 || checkedExp->type == 32 || checkedExp->type == 23)
13551 {
13552 if(checkedExp->type == 23)
13553 {
13554 checkedExp = (*((struct Statement *)(*checkedExp->compound->compound.statements).last)->expressions).last;
13555 }
13556 else
13557 checkedExp = (*checkedExp->list).last;
13558 }
13559 else if(checkedExp->type == 11)
13560 checkedExp = checkedExp->cast.exp;
13561 }
13562 if(checkedExp && checkedExp->type == 4 && checkedExp->op.op == '*' && !checkedExp->op.exp1)
13563 {
13564 newExp = checkedExp->op.exp2;
13565 checkedExp->op.exp2 = (((void *)0));
13566 FreeExpContents(checkedExp);
13567 if(e->expType && e->expType->passAsTemplate)
13568 {
13569 char size[100];
13570
13571 ComputeTypeSize(e->expType);
13572 sprintf(size, "%d", e->expType->size);
13573 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))))));
13574 }
13575 ReplaceExpContents(checkedExp, newExp);
13576 e->byReference = 0x1;
13577 }
13578 else if(!e->byReference || (_class && _class->type == 5))
13579 {
13580 struct Expression * checkedExp, * newExp;
13581
13582 {
13583 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;
13584
13585 if(_class && _class->type != 5 && _class->type != 0 && _class->type != 1 && !hasAddress)
13586 {
13587 struct Context * context = PushContext();
13588 struct Declarator * decl;
13589 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13590 char typeString[1024];
13591 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
13592
13593 typeString[0] = '\0';
13594 *newExp = *e;
13595 newExp->prev = (((void *)0));
13596 newExp->next = (((void *)0));
13597 newExp->expType = (((void *)0));
13598 PrintTypeNoConst(e->expType, typeString, 0x0, 0x1);
13599 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
13600 newExp->destType = ProcessType(specs, decl);
13601 curContext = context;
13602 if(curCompound)
13603 {
13604 char name[100];
13605 struct __ecereNameSpace__ecere__sys__OldList * stmts = MkList();
13606
13607 e->type = 23;
13608 sprintf(name, "__internalValue%03X", internalValueCounter++);
13609 if(!curCompound->compound.declarations)
13610 curCompound->compound.declarations = MkList();
13611 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*curCompound->compound.declarations), (((void *)0)), MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(name)), (((void *)0))))));
13612 ListAdd(stmts, MkExpressionStmt(MkListOne(MkExpOp(MkExpIdentifier(MkIdentifier(name)), '=', newExp))));
13613 ListAdd(stmts, MkExpressionStmt(MkListOne(MkExpIdentifier(MkIdentifier(name)))));
13614 e->compound = MkCompoundStmt((((void *)0)), stmts);
13615 }
13616 else
13617 printf("libec: compiler error, curCompound is null in ApplyAnyObjectLogic\n");
13618 {
13619 struct Type * type = e->destType;
13620
13621 e->destType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13622 CopyTypeInto(e->destType, type);
13623 e->destType->refCount = 1;
13624 e->destType->classObjectType = 0;
13625 FreeType(type);
13626 }
13627 e->compound->compound.context = context;
13628 PopContext(context);
13629 curContext = context->parent;
13630 }
13631 }
13632 checkedExp = e;
13633 while(((checkedExp->type == 5 || checkedExp->type == 32 || checkedExp->type == 23) && checkedExp->list) || checkedExp->type == 11)
13634 {
13635 if(checkedExp->type == 5 || checkedExp->type == 32 || checkedExp->type == 23)
13636 {
13637 if(checkedExp->type == 23)
13638 {
13639 checkedExp = (*((struct Statement *)(*checkedExp->compound->compound.statements).last)->expressions).last;
13640 }
13641 else
13642 checkedExp = (*checkedExp->list).last;
13643 }
13644 else if(checkedExp->type == 11)
13645 checkedExp = checkedExp->cast.exp;
13646 }
13647 {
13648 struct Expression * operand = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
13649
13650 *operand = *checkedExp;
13651 checkedExp->destType = (((void *)0));
13652 checkedExp->expType = (((void *)0));
13653 __ecereMethod_Expression_Clear(checkedExp);
13654 checkedExp->type = 4;
13655 checkedExp->op.op = '&';
13656 checkedExp->op.exp1 = (((void *)0));
13657 checkedExp->op.exp2 = operand;
13658 }
13659 }
13660 }
13661 }
13662 }
13663 }
13664 {
13665 }
13666 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))))
13667 {
13668 if(e->expType->classObjectType && destType && destType->classObjectType)
13669 {
13670 return ;
13671 }
13672 else
13673 {
13674 struct Expression * thisExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
13675
13676 *thisExp = *e;
13677 thisExp->prev = (((void *)0));
13678 thisExp->next = (((void *)0));
13679 __ecereMethod_Expression_Clear(e);
13680 e->type = 5;
13681 e->list = MkListOne(MkExpOp((((void *)0)), '*', thisExp->type == 0 ? thisExp : MkExpBrackets(MkListOne(thisExp))));
13682 if(thisExp->expType->kind == 8 && thisExp->expType->_class && thisExp->expType->_class->registered && thisExp->expType->_class->registered->type == 5)
13683 ((struct Expression *)(*e->list).first)->byReference = 0x1;
13684 {
13685 e->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13686 CopyTypeInto(e->expType, thisExp->expType);
13687 e->expType->byReference = 0x0;
13688 e->expType->refCount = 1;
13689 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))
13690 {
13691 e->expType->classObjectType = 0;
13692 }
13693 }
13694 }
13695 }
13696 else if(destType && e->expType && (e->expType->classObjectType == 3 || e->expType->classObjectType == 2) && !destType->classObjectType && destType->kind != 0)
13697 {
13698 if(destType->kind == 14)
13699 {
13700 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Unspecified type\n", (((void *)0))));
13701 }
13702 else if(!(destType->truth && e->expType->kind == 8 && e->expType->_class && e->expType->_class->registered && e->expType->_class->registered->type == 1))
13703 {
13704 unsigned int byReference = e->expType->byReference;
13705 struct Expression * thisExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
13706 struct Declarator * decl;
13707 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13708 char typeString[1024];
13709 struct Type * type;
13710 int backupClassObjectType;
13711 unsigned int backupByReference;
13712
13713 if(e->expType->kind == 8 && e->expType->_class && e->expType->_class->registered && strcmp(e->expType->_class->registered->name, "class"))
13714 type = e->expType;
13715 else
13716 type = destType;
13717 backupClassObjectType = type->classObjectType;
13718 backupByReference = type->byReference;
13719 type->classObjectType = 0;
13720 type->byReference = 0x0;
13721 typeString[0] = '\0';
13722 PrintType(type, typeString, 0x0, 0x1);
13723 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
13724 type->classObjectType = backupClassObjectType;
13725 type->byReference = backupByReference;
13726 *thisExp = *e;
13727 thisExp->prev = (((void *)0));
13728 thisExp->next = (((void *)0));
13729 __ecereMethod_Expression_Clear(e);
13730 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)))
13731 {
13732 e->type = 4;
13733 e->op.op = '*';
13734 e->op.exp1 = (((void *)0));
13735 e->op.exp2 = MkExpCast(MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl)), thisExp);
13736 e->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13737 CopyTypeInto(e->expType, type);
13738 e->expType->byReference = 0x0;
13739 e->expType->refCount = 1;
13740 }
13741 else
13742 {
13743 e->type = 11;
13744 e->cast.typeName = MkTypeName(specs, decl);
13745 e->cast.exp = thisExp;
13746 e->byReference = 0x1;
13747 e->expType = type;
13748 type->refCount++;
13749 }
13750 e->destType = destType;
13751 destType->refCount++;
13752 }
13753 }
13754 }
13755
13756 extern char *  strstr(const char * , const char * );
13757
13758 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__DefinedExpression;
13759
13760 struct __ecereNameSpace__ecere__com__DefinedExpression
13761 {
13762 struct __ecereNameSpace__ecere__com__DefinedExpression * prev;
13763 struct __ecereNameSpace__ecere__com__DefinedExpression * next;
13764 char *  name;
13765 char *  value;
13766 struct __ecereNameSpace__ecere__com__NameSpace *  nameSpace;
13767 } __attribute__ ((gcc_struct));
13768
13769 extern struct __ecereNameSpace__ecere__com__DefinedExpression * __ecereNameSpace__ecere__com__eSystem_FindDefine(struct __ecereNameSpace__ecere__com__Instance * module, char *  name);
13770
13771 extern struct __ecereNameSpace__ecere__com__GlobalFunction * __ecereNameSpace__ecere__com__eSystem_FindFunction(struct __ecereNameSpace__ecere__com__Instance * module, char *  name);
13772
13773 extern unsigned int __ecereNameSpace__ecere__sys__UTF8GetChar(char *  string, int *  numBytes);
13774
13775 extern struct Expression * GetTemplateArgExp(struct TemplateParameter * param, struct __ecereNameSpace__ecere__com__Class * curClass, unsigned int pointer);
13776
13777 extern struct Expression * MkExpCondition(struct Expression * cond, struct __ecereNameSpace__ecere__sys__OldList * expressions, struct Expression * elseExp);
13778
13779 extern struct Expression * CopyExpression(struct Expression * exp);
13780
13781 extern struct Expression * MkExpTypeSize(struct TypeName * typeName);
13782
13783 extern struct Expression * MkExpClass(struct __ecereNameSpace__ecere__sys__OldList *  specifiers, struct Declarator * decl);
13784
13785 static void ProcessStatement(struct Statement * stmt);
13786
13787 extern struct Expression * MkExpExtensionInitializer(struct TypeName * typeName, struct Initializer * initializer);
13788
13789 extern struct Initializer * MkInitializerList(struct __ecereNameSpace__ecere__sys__OldList * list);
13790
13791 extern char *  __ecereNameSpace__ecere__com__PrintString(struct __ecereNameSpace__ecere__com__Class * class, void * object, ...);
13792
13793 extern char *  sourceFile;
13794
13795 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear(struct __ecereNameSpace__ecere__sys__OldList * this);
13796
13797 void ProcessExpressionType(struct Expression * exp)
13798 {
13799 unsigned int unresolved = 0x0;
13800 struct Location oldyylloc = yylloc;
13801 unsigned int notByReference = 0x0;
13802
13803 if(!exp || exp->expType)
13804 return ;
13805 yylloc = exp->loc;
13806 switch(exp->type)
13807 {
13808 case 0:
13809 {
13810 struct Identifier * id = exp->identifier;
13811
13812 if(!id || !topContext)
13813 return ;
13814 if(id->_class && id->_class->name)
13815 {
13816 id->classSym = id->_class->symbol;
13817 }
13818 if(strstr(id->string, "__ecereClass") == id->string)
13819 {
13820 exp->expType = ProcessTypeString("ecere::com::Class", 0x1);
13821 break;
13822 }
13823 else if(id->_class && (id->classSym || (id->_class->name && !strcmp(id->_class->name, "property"))))
13824 {
13825 ReplaceClassMembers(exp, thisClass);
13826 if(exp->type != 0)
13827 {
13828 ProcessExpressionType(exp);
13829 break;
13830 }
13831 if(id->classSym && ResolveIdWithClass(exp, id->classSym->registered, 0x0))
13832 break;
13833 }
13834 else
13835 {
13836 struct Symbol * symbol = FindSymbol(id->string, curContext, topContext, 0x0, id->_class && id->_class->name == (((void *)0)));
13837
13838 if(!symbol)
13839 {
13840 if(exp->destType && CheckExpressionType(exp, exp->destType, 0x0))
13841 break;
13842 else
13843 {
13844 if(thisClass)
13845 {
13846 ReplaceClassMembers(exp, thisClass ? thisClass : currentClass);
13847 if(exp->type != 0)
13848 {
13849 ProcessExpressionType(exp);
13850 break;
13851 }
13852 }
13853 else if(currentClass && !id->_class)
13854 {
13855 if(ResolveIdWithClass(exp, currentClass, 0x1))
13856 break;
13857 }
13858 symbol = FindSymbol(id->string, topContext->parent, globalContext, 0x0, id->_class && id->_class->name == (((void *)0)));
13859 }
13860 }
13861 if(symbol)
13862 {
13863 struct Type * type = symbol->type;
13864 struct __ecereNameSpace__ecere__com__Class * _class = (type && type->kind == 8 && type->_class) ? type->_class->registered : (((void *)0));
13865
13866 if(_class && !strcmp(id->string, "this") && !type->classObjectType)
13867 {
13868 struct Context * context = SetupTemplatesContext(_class);
13869
13870 type = ReplaceThisClassType(_class);
13871 FinishTemplatesContext(context);
13872 if(type)
13873 type->refCount = 0;
13874 }
13875 FreeSpecifier(id->_class);
13876 id->_class = (((void *)0));
13877 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
13878 id->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
13879 id->classSym = (((void *)0));
13880 exp->expType = type;
13881 if(type)
13882 type->refCount++;
13883 if(type && (type->kind == 15 || (_class && _class->type == 4)))
13884 exp->isConstant = 0x1;
13885 if(symbol->isParam || !strcmp(id->string, "this"))
13886 {
13887 if(_class && _class->type == 1 && !type->declaredWithStruct)
13888 exp->byReference = 0x1;
13889 }
13890 if(symbol->isIterator)
13891 {
13892 if(symbol->isIterator == 3)
13893 {
13894 exp->type = 5;
13895 exp->list = MkListOne(MkExpOp((((void *)0)), '*', MkExpIdentifier(exp->identifier)));
13896 ((struct Expression *)(*exp->list).first)->op.exp2->expType = exp->expType;
13897 exp->expType = (((void *)0));
13898 ProcessExpressionType(exp);
13899 }
13900 else if(symbol->isIterator != 4)
13901 {
13902 exp->type = 8;
13903 exp->member.exp = MkExpIdentifier(exp->identifier);
13904 exp->member.exp->expType = exp->expType;
13905 exp->member.member = MkIdentifier("data");
13906 exp->expType = (((void *)0));
13907 ProcessExpressionType(exp);
13908 }
13909 }
13910 break;
13911 }
13912 else
13913 {
13914 struct __ecereNameSpace__ecere__com__DefinedExpression * definedExp = (((void *)0));
13915
13916 if(thisNameSpace && !(id->_class && !id->_class->name))
13917 {
13918 char name[1024];
13919
13920 strcpy(name, thisNameSpace);
13921 strcat(name, "::");
13922 strcat(name, id->string);
13923 definedExp = __ecereNameSpace__ecere__com__eSystem_FindDefine(privateModule, name);
13924 }
13925 if(!definedExp)
13926 definedExp = __ecereNameSpace__ecere__com__eSystem_FindDefine(privateModule, id->string);
13927 if(definedExp)
13928 {
13929 int c;
13930
13931 for(c = 0; c < definedExpStackPos; c++)
13932 if(definedExpStack[c] == definedExp)
13933 break;
13934 if(c == definedExpStackPos && c < sizeof (definedExpStack) / sizeof(void *))
13935 {
13936 struct Location backupYylloc = yylloc;
13937 struct __ecereNameSpace__ecere__com__Instance * backInput = fileInput;
13938
13939 definedExpStack[definedExpStackPos++] = definedExp;
13940 fileInput = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
13941 ((int (*)(struct __ecereNameSpace__ecere__com__Instance *, void *  buffer, unsigned int size, unsigned int count))__extension__ ({
13942 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
13943
13944 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
13945 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Write])(fileInput, definedExp->value, 1, strlen(definedExp->value));
13946 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))__extension__ ({
13947 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
13948
13949 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
13950 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(fileInput, 0, 0);
13951 echoOn = 0x0;
13952 parsedExpression = (((void *)0));
13953 resetScanner();
13954 expression_yyparse();
13955 (__ecereNameSpace__ecere__com__eInstance_DecRef(fileInput), fileInput = 0);
13956 if(backInput)
13957 fileInput = backInput;
13958 yylloc = backupYylloc;
13959 if(parsedExpression)
13960 {
13961 FreeIdentifier(id);
13962 exp->type = 5;
13963 exp->list = MkListOne(parsedExpression);
13964 parsedExpression->loc = yylloc;
13965 ProcessExpressionType(exp);
13966 definedExpStackPos--;
13967 return ;
13968 }
13969 definedExpStackPos--;
13970 }
13971 else
13972 {
13973 if(inCompiler)
13974 {
13975 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Recursion in defined expression %s\n", (((void *)0))), id->string);
13976 }
13977 }
13978 }
13979 else
13980 {
13981 struct GlobalData * data = (((void *)0));
13982
13983 if(thisNameSpace && !(id->_class && !id->_class->name))
13984 {
13985 char name[1024];
13986
13987 strcpy(name, thisNameSpace);
13988 strcat(name, "::");
13989 strcat(name, id->string);
13990 data = FindGlobalData(name);
13991 }
13992 if(!data)
13993 data = FindGlobalData(id->string);
13994 if(data)
13995 {
13996 DeclareGlobalData(data);
13997 exp->expType = data->dataType;
13998 if(data->dataType)
13999 data->dataType->refCount++;
14000 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
14001 id->string = __ecereNameSpace__ecere__sys__CopyString(data->fullName);
14002 FreeSpecifier(id->_class);
14003 id->_class = (((void *)0));
14004 break;
14005 }
14006 else
14007 {
14008 struct __ecereNameSpace__ecere__com__GlobalFunction * function = (((void *)0));
14009
14010 if(thisNameSpace && !(id->_class && !id->_class->name))
14011 {
14012 char name[1024];
14013
14014 strcpy(name, thisNameSpace);
14015 strcat(name, "::");
14016 strcat(name, id->string);
14017 function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, name);
14018 }
14019 if(!function)
14020 function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, id->string);
14021 if(function)
14022 {
14023 char name[1024];
14024
14025 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
14026 id->string = __ecereNameSpace__ecere__sys__CopyString(function->name);
14027 name[0] = (char)0;
14028 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType != 1 && (!function->dataType || !function->dataType->dllExport))
14029 strcpy(name, "__ecereFunction_");
14030 FullClassNameCat(name, id->string, 0x0);
14031 if(DeclareFunction(function, name))
14032 {
14033 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
14034 id->string = __ecereNameSpace__ecere__sys__CopyString(name);
14035 }
14036 exp->expType = function->dataType;
14037 if(function->dataType)
14038 function->dataType->refCount++;
14039 FreeSpecifier(id->_class);
14040 id->_class = (((void *)0));
14041 break;
14042 }
14043 }
14044 }
14045 }
14046 }
14047 unresolved = 0x1;
14048 break;
14049 }
14050 case 1:
14051 {
14052 struct __ecereNameSpace__ecere__com__Class * _class;
14053
14054 if(!exp->instance->_class)
14055 {
14056 if(exp->destType && exp->destType->kind == 8 && exp->destType->_class)
14057 {
14058 exp->instance->_class = MkSpecifierName(exp->destType->_class->string);
14059 }
14060 }
14061 ProcessInstantiationType(exp->instance);
14062 exp->isConstant = exp->instance->isConstant;
14063 if(exp->instance->_class)
14064 {
14065 exp->expType = MkClassType(exp->instance->_class->name);
14066 }
14067 break;
14068 }
14069 case 2:
14070 {
14071 if(!exp->expType)
14072 {
14073 char * constant = exp->constant;
14074 struct Type * type = (type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), type->refCount = 1, type->constant = 0x1, type);
14075
14076 exp->expType = type;
14077 if(constant[0] == '\'')
14078 {
14079 if((int)((unsigned char *)constant)[1] > 127)
14080 {
14081 int nb;
14082 unsigned int ch = __ecereNameSpace__ecere__sys__UTF8GetChar(constant + 1, &nb);
14083
14084 if(nb < 2)
14085 ch = constant[1];
14086 (__ecereNameSpace__ecere__com__eSystem_Delete(constant), constant = 0);
14087 exp->constant = PrintUInt(ch);
14088 type->kind = 8;
14089 type->_class = FindClass("unichar");
14090 type->isSigned = 0x0;
14091 }
14092 else
14093 {
14094 type->kind = 1;
14095 type->isSigned = 0x1;
14096 }
14097 }
14098 else
14099 {
14100 char * dot = strchr(constant, '.');
14101 unsigned int isHex = (constant[0] == '0' && (constant[1] == 'x' || constant[1] == 'X'));
14102 char * exponent;
14103
14104 if(isHex)
14105 {
14106 exponent = strchr(constant, 'p');
14107 if(!exponent)
14108 exponent = strchr(constant, 'P');
14109 }
14110 else
14111 {
14112 exponent = strchr(constant, 'e');
14113 if(!exponent)
14114 exponent = strchr(constant, 'E');
14115 }
14116 if(dot || exponent)
14117 {
14118 if(strchr(constant, 'f') || strchr(constant, 'F'))
14119 type->kind = 6;
14120 else
14121 type->kind = 7;
14122 type->isSigned = 0x1;
14123 }
14124 else
14125 {
14126 unsigned int isSigned = constant[0] == '-';
14127 long long i64 = strtoll(constant, (((void *)0)), 0);
14128 uint64 ui64 = strtoull(constant, (((void *)0)), 0);
14129 unsigned int is64Bit = 0x0;
14130
14131 if(isSigned)
14132 {
14133 if(i64 < (((int)0x80000000)))
14134 is64Bit = 0x1;
14135 }
14136 else
14137 {
14138 if(ui64 > (((int)0x7fffffff)))
14139 {
14140 if(ui64 > (0xffffffff))
14141 {
14142 is64Bit = 0x1;
14143 if(ui64 <= (((long long)0x7fffffffffffffffLL)) && (constant[0] != '0' || !constant[1]))
14144 isSigned = 0x1;
14145 }
14146 }
14147 else if(constant[0] != '0' || !constant[1])
14148 isSigned = 0x1;
14149 }
14150 type->kind = is64Bit ? 4 : 3;
14151 type->isSigned = isSigned;
14152 }
14153 }
14154 exp->isConstant = 0x1;
14155 if(exp->destType && exp->destType->kind == 7)
14156 type->kind = 7;
14157 else if(exp->destType && exp->destType->kind == 6)
14158 type->kind = 6;
14159 else if(exp->destType && exp->destType->kind == 4)
14160 type->kind = 4;
14161 }
14162 break;
14163 }
14164 case 3:
14165 {
14166 exp->isConstant = 0x1;
14167 exp->expType = __extension__ ({
14168 struct Type * __ecereInstance2 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14169
14170 __ecereInstance2->refCount = 1, __ecereInstance2->kind = 13, __ecereInstance2->type = __extension__ ({
14171 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14172
14173 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 1, __ecereInstance1->constant = 0x1, __ecereInstance1->isSigned = 0x1, __ecereInstance1;
14174 }), __ecereInstance2;
14175 });
14176 break;
14177 }
14178 case 13:
14179 case 26:
14180 ProcessExpressionType(exp->_new.size);
14181 exp->expType = __extension__ ({
14182 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14183
14184 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 13, __ecereInstance1->type = ProcessType(exp->_new.typeName->qualifiers, exp->_new.typeName->declarator), __ecereInstance1;
14185 });
14186 DeclareType(exp->expType->type, 0x0, 0x0);
14187 break;
14188 case 14:
14189 case 27:
14190 ProcessExpressionType(exp->_renew.size);
14191 ProcessExpressionType(exp->_renew.exp);
14192 exp->expType = __extension__ ({
14193 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14194
14195 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 13, __ecereInstance1->type = ProcessType(exp->_renew.typeName->qualifiers, exp->_renew.typeName->declarator), __ecereInstance1;
14196 });
14197 DeclareType(exp->expType->type, 0x0, 0x0);
14198 break;
14199 case 4:
14200 {
14201 unsigned int assign = 0x0, boolResult = 0x0, boolOps = 0x0;
14202 struct Type * type1 = (((void *)0)), * type2 = (((void *)0));
14203 unsigned int useDestType = 0x0, useSideType = 0x0;
14204 struct Location oldyylloc = yylloc;
14205 unsigned int useSideUnit = 0x0;
14206 struct Type * dummy = (dummy = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), dummy->count = 1, dummy->refCount = 1, dummy);
14207
14208 switch(exp->op.op)
14209 {
14210 case '=':
14211 case MUL_ASSIGN:
14212 case DIV_ASSIGN:
14213 case MOD_ASSIGN:
14214 case ADD_ASSIGN:
14215 case SUB_ASSIGN:
14216 case LEFT_ASSIGN:
14217 case RIGHT_ASSIGN:
14218 case AND_ASSIGN:
14219 case XOR_ASSIGN:
14220 case OR_ASSIGN:
14221 assign = 0x1;
14222 break;
14223 case '!':
14224 break;
14225 case AND_OP:
14226 case OR_OP:
14227 boolOps = 0x1;
14228 boolResult = 0x1;
14229 break;
14230 case EQ_OP:
14231 case '<':
14232 case '>':
14233 case LE_OP:
14234 case GE_OP:
14235 case NE_OP:
14236 boolResult = 0x1;
14237 useSideType = 0x1;
14238 break;
14239 case '+':
14240 case '-':
14241 useSideUnit = 0x1;
14242 case '|':
14243 case '&':
14244 case '^':
14245 case '/':
14246 case '%':
14247 case '*':
14248 if(exp->op.op != '*' || exp->op.exp1)
14249 {
14250 useSideType = 0x1;
14251 useDestType = 0x1;
14252 }
14253 break;
14254 }
14255 if(exp->op.op == '&')
14256 {
14257 if(!exp->op.exp1 && exp->op.exp2 && exp->op.exp2->type == 0 && exp->op.exp2->identifier)
14258 {
14259 struct Identifier * id = exp->op.exp2->identifier;
14260 struct Symbol * symbol = FindSymbol(id->string, curContext, topContext, 0x0, id->_class && id->_class->name == (((void *)0)));
14261
14262 if(symbol && symbol->isIterator == 2)
14263 {
14264 exp->type = 8;
14265 exp->member.exp = exp->op.exp2;
14266 exp->member.member = MkIdentifier("key");
14267 exp->expType = (((void *)0));
14268 exp->op.exp2->expType = symbol->type;
14269 symbol->type->refCount++;
14270 ProcessExpressionType(exp);
14271 FreeType(dummy);
14272 break;
14273 }
14274 }
14275 }
14276 if(exp->op.exp1)
14277 {
14278 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))
14279 {
14280 if(exp->op.exp1->destType)
14281 FreeType(exp->op.exp1->destType);
14282 exp->op.exp1->destType = exp->destType;
14283 if(exp->destType)
14284 exp->destType->refCount++;
14285 }
14286 else if(!assign)
14287 {
14288 if(exp->op.exp1->destType)
14289 FreeType(exp->op.exp1->destType);
14290 exp->op.exp1->destType = dummy;
14291 dummy->refCount++;
14292 }
14293 if(exp->op.exp1->destType && exp->op.op != '=')
14294 exp->op.exp1->destType->count++;
14295 ProcessExpressionType(exp->op.exp1);
14296 if(exp->op.exp1->destType && exp->op.op != '=')
14297 exp->op.exp1->destType->count--;
14298 if(exp->op.exp1->destType == dummy)
14299 {
14300 FreeType(dummy);
14301 exp->op.exp1->destType = (((void *)0));
14302 }
14303 type1 = exp->op.exp1->expType;
14304 }
14305 if(exp->op.exp2)
14306 {
14307 char expString[10240];
14308
14309 expString[0] = '\0';
14310 if(exp->op.exp2->type == 1 && !exp->op.exp2->instance->_class)
14311 {
14312 if(exp->op.exp1)
14313 {
14314 exp->op.exp2->destType = exp->op.exp1->expType;
14315 if(exp->op.exp1->expType)
14316 exp->op.exp1->expType->refCount++;
14317 }
14318 else
14319 {
14320 exp->op.exp2->destType = exp->destType;
14321 if(exp->destType)
14322 exp->destType->refCount++;
14323 }
14324 if(type1)
14325 type1->refCount++;
14326 exp->expType = type1;
14327 }
14328 else if(assign)
14329 {
14330 if(inCompiler)
14331 PrintExpression(exp->op.exp2, expString);
14332 if(type1 && type1->kind == 13)
14333 {
14334 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)
14335 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "operator %s illegal on pointer\n", (((void *)0))), exp->op.op);
14336 else if(exp->op.op == '=')
14337 {
14338 if(exp->op.exp2->destType)
14339 FreeType(exp->op.exp2->destType);
14340 exp->op.exp2->destType = type1;
14341 if(type1)
14342 type1->refCount++;
14343 }
14344 }
14345 else
14346 {
14347 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)
14348 ;
14349 else
14350 {
14351 if(exp->op.exp2->destType)
14352 FreeType(exp->op.exp2->destType);
14353 exp->op.exp2->destType = type1;
14354 if(type1)
14355 type1->refCount++;
14356 }
14357 }
14358 if(type1)
14359 type1->refCount++;
14360 exp->expType = type1;
14361 }
14362 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)))
14363 {
14364 if(exp->op.exp2->destType)
14365 FreeType(exp->op.exp2->destType);
14366 exp->op.exp2->destType = exp->destType;
14367 if(exp->destType)
14368 exp->destType->refCount++;
14369 }
14370 else
14371 {
14372 if(exp->op.exp2->destType)
14373 FreeType(exp->op.exp2->destType);
14374 exp->op.exp2->destType = dummy;
14375 dummy->refCount++;
14376 }
14377 if(type1 && boolResult && useSideType && type1->kind == 8 && type1->_class && type1->_class->registered && (type1->_class->registered->type == 2 || type1->_class->registered->type == 4))
14378 {
14379 FreeType(exp->op.exp2->destType);
14380 exp->op.exp2->destType = type1;
14381 type1->refCount++;
14382 }
14383 if(exp->op.exp2->destType && exp->op.op != '=')
14384 exp->op.exp2->destType->count++;
14385 if(exp->op.op == SIZEOF)
14386 {
14387 struct Expression * e = exp->op.exp2;
14388
14389 while((e->type == 5 || e->type == 32 || e->type == 23) && e->list)
14390 {
14391 if(e->type == 5 || e->type == 32 || e->type == 23)
14392 {
14393 if(e->type == 23)
14394 e = (*((struct Statement *)(*e->compound->compound.statements).last)->expressions).last;
14395 else
14396 e = (*e->list).last;
14397 }
14398 }
14399 if(e->type == 11 && e->cast.exp)
14400 e->cast.exp->needCast = 0x1;
14401 }
14402 ProcessExpressionType(exp->op.exp2);
14403 if(exp->op.exp2->destType && exp->op.op != '=')
14404 exp->op.exp2->destType->count--;
14405 if(assign && type1 && type1->kind == 13 && exp->op.exp2->expType)
14406 {
14407 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)
14408 {
14409 if(exp->op.op != '=' && type1->type->kind == 0)
14410 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "void *: unknown size\n", (((void *)0))));
14411 }
14412 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)))
14413 {
14414 if(exp->op.op == ADD_ASSIGN)
14415 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "cannot add two pointers\n", (((void *)0))));
14416 }
14417 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))
14418 {
14419 if(exp->op.op == ADD_ASSIGN)
14420 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "cannot add two pointers\n", (((void *)0))));
14421 }
14422 else if(inCompiler)
14423 {
14424 char type1String[1024];
14425 char type2String[1024];
14426
14427 type1String[0] = '\0';
14428 type2String[0] = '\0';
14429 PrintType(exp->op.exp2->expType, type1String, 0x0, 0x1);
14430 PrintType(type1, type2String, 0x0, 0x1);
14431 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14432 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expression %s (%s); expected %s\n", (((void *)0))), expString, type1String, type2String);
14433 }
14434 }
14435 if(exp->op.exp2->destType == dummy)
14436 {
14437 FreeType(dummy);
14438 exp->op.exp2->destType = (((void *)0));
14439 }
14440 if(exp->op.op == '-' && !exp->op.exp1 && exp->op.exp2->expType && !exp->op.exp2->expType->isSigned)
14441 {
14442 type2 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14443 type2->refCount = 1;
14444 CopyTypeInto(type2, exp->op.exp2->expType);
14445 type2->isSigned = 0x1;
14446 }
14447 else if(exp->op.op == '~' && !exp->op.exp1 && exp->op.exp2->expType && (!exp->op.exp2->expType->isSigned || exp->op.exp2->expType->kind != 3))
14448 {
14449 type2 = __extension__ ({
14450 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14451
14452 __ecereInstance1->kind = 3, __ecereInstance1;
14453 });
14454 type2->refCount = 1;
14455 type2->isSigned = 0x1;
14456 }
14457 else
14458 {
14459 type2 = exp->op.exp2->expType;
14460 if(type2)
14461 type2->refCount++;
14462 }
14463 }
14464 dummy->kind = 0;
14465 if(exp->op.op == SIZEOF)
14466 {
14467 exp->expType = __extension__ ({
14468 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14469
14470 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 3, __ecereInstance1;
14471 });
14472 exp->isConstant = 0x1;
14473 }
14474 else if(exp->op.op == '*' && !exp->op.exp1)
14475 {
14476 exp->expType = Dereference(type2);
14477 if(type2 && type2->kind == 8)
14478 notByReference = 0x1;
14479 }
14480 else if(exp->op.op == '&' && !exp->op.exp1)
14481 exp->expType = Reference(type2);
14482 else if(!assign)
14483 {
14484 if(boolOps)
14485 {
14486 if(exp->op.exp1)
14487 {
14488 if(exp->op.exp1->destType)
14489 FreeType(exp->op.exp1->destType);
14490 exp->op.exp1->destType = MkClassType("bool");
14491 exp->op.exp1->destType->truth = 0x1;
14492 if(!exp->op.exp1->expType)
14493 ProcessExpressionType(exp->op.exp1);
14494 else
14495 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
14496 FreeType(exp->op.exp1->expType);
14497 exp->op.exp1->expType = MkClassType("bool");
14498 exp->op.exp1->expType->truth = 0x1;
14499 }
14500 if(exp->op.exp2)
14501 {
14502 if(exp->op.exp2->destType)
14503 FreeType(exp->op.exp2->destType);
14504 exp->op.exp2->destType = MkClassType("bool");
14505 exp->op.exp2->destType->truth = 0x1;
14506 if(!exp->op.exp2->expType)
14507 ProcessExpressionType(exp->op.exp2);
14508 else
14509 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
14510 FreeType(exp->op.exp2->expType);
14511 exp->op.exp2->expType = MkClassType("bool");
14512 exp->op.exp2->expType->truth = 0x1;
14513 }
14514 }
14515 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")))))
14516 {
14517 if(type1 && type2 && ((type1->kind == 8 && type1->_class && strcmp(type1->_class->string, "String")) == (type2->kind == 8 && type2->_class && strcmp(type2->_class->string, "String"))))
14518 {
14519 if(exp->op.exp2->destType)
14520 FreeType(exp->op.exp2->destType);
14521 exp->op.exp2->destType = type1;
14522 type1->refCount++;
14523 if(exp->op.exp1->destType)
14524 FreeType(exp->op.exp1->destType);
14525 exp->op.exp1->destType = type2;
14526 type2->refCount++;
14527 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)
14528 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);
14529 if(type1->kind == 13 && type1->type->kind == 20 && type2->kind != 13)
14530 {
14531 struct Expression * argExp = GetTemplateArgExp(type1->type->templateParameter, thisClass, 0x1);
14532
14533 if(argExp)
14534 {
14535 struct Expression * classExp = MkExpMember(argExp, MkIdentifier("dataTypeClass"));
14536
14537 exp->op.exp1 = MkExpBrackets(MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName("byte")), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), exp->op.exp1)));
14538 ProcessExpressionType(exp->op.exp1);
14539 if(type2->kind != 13)
14540 {
14541 ProcessExpressionType(classExp);
14542 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"))))))));
14543 if(!exp->op.exp2->expType)
14544 {
14545 if(type2)
14546 FreeType(type2);
14547 type2 = exp->op.exp2->expType = ProcessTypeString("int", 0x0);
14548 type2->refCount++;
14549 }
14550 ProcessExpressionType(exp->op.exp2);
14551 }
14552 }
14553 }
14554 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)))
14555 {
14556 if(type1->kind != 8 && type1->type->kind == 0)
14557 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "void *: unknown size\n", (((void *)0))));
14558 exp->expType = type1;
14559 if(type1)
14560 type1->refCount++;
14561 }
14562 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)))
14563 {
14564 if(type2->kind != 8 && type2->type->kind == 0)
14565 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "void *: unknown size\n", (((void *)0))));
14566 exp->expType = type2;
14567 if(type2)
14568 type2->refCount++;
14569 }
14570 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))
14571 {
14572 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "different levels of indirection\n", (((void *)0))));
14573 }
14574 else
14575 {
14576 unsigned int success = 0x0;
14577
14578 if(type1->kind == 13 && type2->kind == 13)
14579 {
14580 if(exp->op.op == '+')
14581 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "cannot add two pointers\n", (((void *)0))));
14582 else if(exp->op.op == '-')
14583 {
14584 if(MatchTypes(type1->type, type2->type, (((void *)0)), (((void *)0)), (((void *)0)), 0x0, 0x0, 0x0, 0x0))
14585 {
14586 exp->expType = __extension__ ({
14587 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14588
14589 __ecereInstance1->kind = 3, __ecereInstance1->refCount = 1, __ecereInstance1;
14590 });
14591 success = 0x1;
14592 if(type1->type->kind == 20)
14593 {
14594 struct Expression * argExp = GetTemplateArgExp(type1->type->templateParameter, thisClass, 0x1);
14595
14596 if(argExp)
14597 {
14598 struct Expression * classExp = MkExpMember(argExp, MkIdentifier("dataTypeClass"));
14599
14600 ProcessExpressionType(classExp);
14601 exp->type = 5;
14602 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")))))));
14603 ProcessExpressionType(((struct Expression *)(*exp->list).first)->op.exp2);
14604 FreeType(dummy);
14605 return ;
14606 }
14607 }
14608 }
14609 }
14610 }
14611 if(!success && exp->op.exp1->type == 2)
14612 {
14613 if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
14614 {
14615 if(exp->expType)
14616 FreeType(exp->expType);
14617 exp->expType = exp->op.exp1->destType;
14618 if(exp->op.exp1->destType)
14619 exp->op.exp1->destType->refCount++;
14620 success = 0x1;
14621 }
14622 else if(CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0))
14623 {
14624 if(exp->expType)
14625 FreeType(exp->expType);
14626 exp->expType = exp->op.exp2->destType;
14627 if(exp->op.exp2->destType)
14628 exp->op.exp2->destType->refCount++;
14629 success = 0x1;
14630 }
14631 }
14632 else if(!success)
14633 {
14634 if(CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0))
14635 {
14636 if(exp->expType)
14637 FreeType(exp->expType);
14638 exp->expType = exp->op.exp2->destType;
14639 if(exp->op.exp2->destType)
14640 exp->op.exp2->destType->refCount++;
14641 success = 0x1;
14642 }
14643 else if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
14644 {
14645 if(exp->expType)
14646 FreeType(exp->expType);
14647 exp->expType = exp->op.exp1->destType;
14648 if(exp->op.exp1->destType)
14649 exp->op.exp1->destType->refCount++;
14650 success = 0x1;
14651 }
14652 }
14653 if(!success)
14654 {
14655 char expString1[10240];
14656 char expString2[10240];
14657 char type1[1024];
14658 char type2[1024];
14659
14660 expString1[0] = '\0';
14661 expString2[0] = '\0';
14662 type1[0] = '\0';
14663 type2[0] = '\0';
14664 if(inCompiler)
14665 {
14666 PrintExpression(exp->op.exp1, expString1);
14667 __ecereNameSpace__ecere__sys__ChangeCh(expString1, '\n', ' ');
14668 PrintExpression(exp->op.exp2, expString2);
14669 __ecereNameSpace__ecere__sys__ChangeCh(expString2, '\n', ' ');
14670 PrintType(exp->op.exp1->expType, type1, 0x0, 0x1);
14671 PrintType(exp->op.exp2->expType, type2, 0x0, 0x1);
14672 }
14673 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expressions %s (%s) and %s (%s)\n", (((void *)0))), expString1, type1, expString2, type2);
14674 }
14675 }
14676 }
14677 else if(!boolResult && (!useSideUnit) && type2 && type1 && type2->kind == 8 && type1->kind != 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 3)
14678 {
14679 if(exp->op.exp1->destType)
14680 FreeType(exp->op.exp1->destType);
14681 exp->op.exp1->destType = type2->_class->registered->dataType;
14682 if(type2->_class->registered->dataType)
14683 type2->_class->registered->dataType->refCount++;
14684 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
14685 exp->expType = type2;
14686 if(type2)
14687 type2->refCount++;
14688 }
14689 else if(!boolResult && (!useSideUnit) && type1 && type2 && type1->kind == 8 && type2->kind != 8 && type1->_class && type1->_class->registered && type1->_class->registered->type == 3)
14690 {
14691 if(exp->op.exp2->destType)
14692 FreeType(exp->op.exp2->destType);
14693 exp->op.exp2->destType = type1->_class->registered->dataType;
14694 if(type1->_class->registered->dataType)
14695 type1->_class->registered->dataType->refCount++;
14696 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
14697 exp->expType = type1;
14698 if(type1)
14699 type1->refCount++;
14700 }
14701 else if(type1)
14702 {
14703 unsigned int valid = 0x0;
14704
14705 if(!boolResult && useSideUnit && type1 && type1->kind == 8 && type1->_class->registered && type1->_class->registered->type == 3 && type2 && type2->kind != 8)
14706 {
14707 if(exp->op.exp2->destType)
14708 FreeType(exp->op.exp2->destType);
14709 if(!type1->_class->registered->dataType)
14710 type1->_class->registered->dataType = ProcessTypeString(type1->_class->registered->dataTypeString, 0x0);
14711 exp->op.exp2->destType = type1->_class->registered->dataType;
14712 exp->op.exp2->destType->refCount++;
14713 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
14714 if(type2)
14715 FreeType(type2);
14716 type2 = exp->op.exp2->destType;
14717 if(type2)
14718 type2->refCount++;
14719 exp->expType = type2;
14720 type2->refCount++;
14721 }
14722 if(!boolResult && useSideUnit && type2 && type2->kind == 8 && type2->_class->registered && type2->_class->registered->type == 3 && type1 && type1->kind != 8)
14723 {
14724 if(exp->op.exp1->destType)
14725 FreeType(exp->op.exp1->destType);
14726 if(!type2->_class->registered->dataType)
14727 type2->_class->registered->dataType = ProcessTypeString(type2->_class->registered->dataTypeString, 0x0);
14728 exp->op.exp1->destType = type2->_class->registered->dataType;
14729 exp->op.exp1->destType->refCount++;
14730 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
14731 type1 = exp->op.exp1->destType;
14732 exp->expType = type1;
14733 type1->refCount++;
14734 }
14735 if(!boolResult || exp->op.op == '>' || exp->op.op == '<')
14736 {
14737 if(type1->kind == 8 && type1->_class && type1->_class->registered && type1->_class->registered->type == 4 && exp->op.exp2->expType)
14738 {
14739 if(CheckExpressionType(exp->op.exp1, exp->op.exp2->expType, 0x0))
14740 {
14741 if(exp->expType)
14742 FreeType(exp->expType);
14743 exp->expType = exp->op.exp1->expType;
14744 if(exp->op.exp2->expType)
14745 exp->op.exp1->expType->refCount++;
14746 valid = 0x1;
14747 }
14748 }
14749 else if(type2 && (type2->kind == 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 4 && exp->op.exp1->expType))
14750 {
14751 if(CheckExpressionType(exp->op.exp2, exp->op.exp1->expType, 0x0))
14752 {
14753 if(exp->expType)
14754 FreeType(exp->expType);
14755 exp->expType = exp->op.exp2->expType;
14756 if(exp->op.exp2->expType)
14757 exp->op.exp2->expType->refCount++;
14758 valid = 0x1;
14759 }
14760 }
14761 }
14762 if(!valid)
14763 {
14764 if(exp->op.exp2->destType)
14765 FreeType(exp->op.exp2->destType);
14766 exp->op.exp2->destType = type1;
14767 type1->refCount++;
14768 if(CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0))
14769 {
14770 if(exp->expType)
14771 FreeType(exp->expType);
14772 exp->expType = exp->op.exp2->destType;
14773 if(exp->op.exp2->destType)
14774 exp->op.exp2->destType->refCount++;
14775 }
14776 else if(type1 && type2)
14777 {
14778 char expString1[10240];
14779 char expString2[10240];
14780 char type1String[1024];
14781 char type2String[1024];
14782
14783 expString1[0] = '\0';
14784 expString2[0] = '\0';
14785 type1String[0] = '\0';
14786 type2String[0] = '\0';
14787 if(inCompiler)
14788 {
14789 PrintExpression(exp->op.exp1, expString1);
14790 __ecereNameSpace__ecere__sys__ChangeCh(expString1, '\n', ' ');
14791 PrintExpression(exp->op.exp2, expString2);
14792 __ecereNameSpace__ecere__sys__ChangeCh(expString2, '\n', ' ');
14793 PrintType(exp->op.exp1->expType, type1String, 0x0, 0x1);
14794 PrintType(exp->op.exp2->expType, type2String, 0x0, 0x1);
14795 }
14796 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expressions %s (%s) and %s (%s)\n", (((void *)0))), expString1, type1String, expString2, type2String);
14797 if(type1->kind == 8 && type1->_class && type1->_class->registered && type1->_class->registered->type == 4)
14798 {
14799 exp->expType = exp->op.exp1->expType;
14800 if(exp->op.exp1->expType)
14801 exp->op.exp1->expType->refCount++;
14802 }
14803 else if(type2->kind == 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 4)
14804 {
14805 exp->expType = exp->op.exp2->expType;
14806 if(exp->op.exp2->expType)
14807 exp->op.exp2->expType->refCount++;
14808 }
14809 }
14810 }
14811 }
14812 else if(type2)
14813 {
14814 if(type2->kind == 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 4)
14815 {
14816 struct Type * oldType = exp->op.exp1->expType;
14817
14818 exp->op.exp1->expType = (((void *)0));
14819 if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
14820 FreeType(oldType);
14821 else
14822 exp->op.exp1->expType = oldType;
14823 }
14824 if(exp->op.exp1->destType)
14825 FreeType(exp->op.exp1->destType);
14826 exp->op.exp1->destType = type2;
14827 type2->refCount++;
14828 if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
14829 {
14830 if(exp->expType)
14831 FreeType(exp->expType);
14832 exp->expType = exp->op.exp1->destType;
14833 if(exp->op.exp1->destType)
14834 exp->op.exp1->destType->refCount++;
14835 }
14836 }
14837 }
14838 else if(type2 && (!type1 || (type2->kind == 8 && type1->kind != 8)))
14839 {
14840 if(type1 && type2->_class && type2->_class->registered && type2->_class->registered->type == 3)
14841 {
14842 if(exp->op.exp1->destType)
14843 FreeType(exp->op.exp1->destType);
14844 exp->op.exp1->destType = type2->_class->registered->dataType;
14845 if(type2->_class->registered->dataType)
14846 type2->_class->registered->dataType->refCount++;
14847 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
14848 }
14849 if(exp->op.op == '!')
14850 {
14851 exp->expType = MkClassType("bool");
14852 exp->expType->truth = 0x1;
14853 }
14854 else
14855 {
14856 exp->expType = type2;
14857 if(type2)
14858 type2->refCount++;
14859 }
14860 }
14861 else if(type1 && (!type2 || (type1->kind == 8 && type2->kind != 8)))
14862 {
14863 if(type2 && type1->_class && type1->_class->registered && type1->_class->registered->type == 3)
14864 {
14865 if(exp->op.exp2->destType)
14866 FreeType(exp->op.exp2->destType);
14867 exp->op.exp2->destType = type1->_class->registered->dataType;
14868 if(type1->_class->registered->dataType)
14869 type1->_class->registered->dataType->refCount++;
14870 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
14871 }
14872 exp->expType = type1;
14873 if(type1)
14874 type1->refCount++;
14875 }
14876 }
14877 yylloc = exp->loc;
14878 if(exp->op.exp1 && !exp->op.exp1->expType)
14879 {
14880 char expString[10000];
14881
14882 expString[0] = '\0';
14883 if(inCompiler)
14884 {
14885 PrintExpression(exp->op.exp1, expString);
14886 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14887 }
14888 if(expString[0])
14889 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s\n", (((void *)0))), expString);
14890 }
14891 if(exp->op.exp2 && !exp->op.exp2->expType)
14892 {
14893 char expString[10240];
14894
14895 expString[0] = '\0';
14896 if(inCompiler)
14897 {
14898 PrintExpression(exp->op.exp2, expString);
14899 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14900 }
14901 if(expString[0])
14902 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s\n", (((void *)0))), expString);
14903 }
14904 if(boolResult)
14905 {
14906 FreeType(exp->expType);
14907 exp->expType = MkClassType("bool");
14908 exp->expType->truth = 0x1;
14909 }
14910 if(exp->op.op != SIZEOF)
14911 exp->isConstant = (!exp->op.exp1 || exp->op.exp1->isConstant) && (!exp->op.exp2 || exp->op.exp2->isConstant);
14912 if(exp->op.op == SIZEOF && exp->op.exp2->expType)
14913 {
14914 DeclareType(exp->op.exp2->expType, 0x0, 0x0);
14915 }
14916 yylloc = oldyylloc;
14917 FreeType(dummy);
14918 if(type2)
14919 FreeType(type2);
14920 break;
14921 }
14922 case 5:
14923 case 32:
14924 {
14925 struct Expression * e;
14926
14927 exp->isConstant = 0x1;
14928 for(e = (*exp->list).first; e; e = e->next)
14929 {
14930 unsigned int inced = 0x0;
14931
14932 if(!e->next)
14933 {
14934 FreeType(e->destType);
14935 e->destType = exp->destType;
14936 if(e->destType)
14937 {
14938 exp->destType->refCount++;
14939 e->destType->count++;
14940 inced = 0x1;
14941 }
14942 }
14943 ProcessExpressionType(e);
14944 if(inced)
14945 exp->destType->count--;
14946 if(!exp->expType && !e->next)
14947 {
14948 exp->expType = e->expType;
14949 if(e->expType)
14950 e->expType->refCount++;
14951 }
14952 if(!e->isConstant)
14953 exp->isConstant = 0x0;
14954 }
14955 e = (*exp->list).first;
14956 if(!e->next && e->type == 8)
14957 {
14958 struct Expression * next = exp->next, * prev = exp->prev;
14959
14960 FreeType(exp->expType);
14961 FreeType(exp->destType);
14962 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->list), exp->list = 0);
14963 *exp = *e;
14964 exp->prev = prev;
14965 exp->next = next;
14966 ((e ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(e) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(e)) : 0), e = 0);
14967 ProcessExpressionType(exp);
14968 }
14969 break;
14970 }
14971 case 6:
14972 {
14973 struct Expression * e;
14974
14975 exp->isConstant = 0x1;
14976 ProcessExpressionType(exp->index.exp);
14977 if(!exp->index.exp->isConstant)
14978 exp->isConstant = 0x0;
14979 if(exp->index.exp->expType)
14980 {
14981 struct Type * source = exp->index.exp->expType;
14982
14983 if(source->kind == 8 && source->_class && source->_class->registered)
14984 {
14985 struct __ecereNameSpace__ecere__com__Class * _class = source->_class->registered;
14986 struct __ecereNameSpace__ecere__com__Class * c = _class->templateClass ? _class->templateClass : _class;
14987
14988 if(_class != containerClass && __ecereNameSpace__ecere__com__eClass_IsDerived(c, containerClass) && _class->templateArgs)
14989 {
14990 exp->expType = ProcessTypeString(_class->templateArgs[2].dataTypeString, 0x0);
14991 if(exp->index.index && (*exp->index.index).last)
14992 {
14993 ((struct Expression *)(*exp->index.index).last)->destType = ProcessTypeString(_class->templateArgs[1].dataTypeString, 0x0);
14994 }
14995 }
14996 }
14997 }
14998 for(e = (*exp->index.index).first; e; e = e->next)
14999 {
15000 if(!e->next && exp->index.exp->expType && exp->index.exp->expType->kind == 12 && exp->index.exp->expType->enumClass)
15001 {
15002 if(e->destType)
15003 FreeType(e->destType);
15004 e->destType = MkClassType(exp->index.exp->expType->enumClass->string);
15005 }
15006 ProcessExpressionType(e);
15007 if(!e->next)
15008 {
15009 }
15010 if(!e->isConstant)
15011 exp->isConstant = 0x0;
15012 }
15013 if(!exp->expType)
15014 exp->expType = Dereference(exp->index.exp->expType);
15015 if(exp->expType)
15016 DeclareType(exp->expType, 0x0, 0x0);
15017 break;
15018 }
15019 case 7:
15020 {
15021 struct Expression * e;
15022 struct Type * functionType;
15023 struct Type * methodType = (((void *)0));
15024 char name[1024];
15025
15026 name[0] = '\0';
15027 if(inCompiler)
15028 {
15029 PrintExpression(exp->call.exp, name);
15030 if(exp->call.exp->expType && !exp->call.exp->expType->returnType)
15031 {
15032 PrintExpression(exp->call.exp, name);
15033 }
15034 }
15035 if(exp->call.exp->type == 0)
15036 {
15037 struct Expression * idExp = exp->call.exp;
15038 struct Identifier * id = idExp->identifier;
15039
15040 if(!strcmp(id->string, "__builtin_frame_address"))
15041 {
15042 exp->expType = ProcessTypeString("void *", 0x1);
15043 if(exp->call.arguments && (*exp->call.arguments).first)
15044 ProcessExpressionType((*exp->call.arguments).first);
15045 break;
15046 }
15047 else if(!strcmp(id->string, "__ENDIAN_PAD"))
15048 {
15049 exp->expType = ProcessTypeString("int", 0x1);
15050 if(exp->call.arguments && (*exp->call.arguments).first)
15051 ProcessExpressionType((*exp->call.arguments).first);
15052 break;
15053 }
15054 else if(!strcmp(id->string, "Max") || !strcmp(id->string, "Min") || !strcmp(id->string, "Sgn") || !strcmp(id->string, "Abs"))
15055 {
15056 struct Expression * a = (((void *)0));
15057 struct Expression * b = (((void *)0));
15058 struct Expression * tempExp1 = (((void *)0)), * tempExp2 = (((void *)0));
15059
15060 if((!strcmp(id->string, "Max") || !strcmp(id->string, "Min")) && (*exp->call.arguments).count == 2)
15061 {
15062 a = (*exp->call.arguments).first;
15063 b = (*exp->call.arguments).last;
15064 tempExp1 = a;
15065 tempExp2 = b;
15066 }
15067 else if((*exp->call.arguments).count == 1)
15068 {
15069 a = (*exp->call.arguments).first;
15070 tempExp1 = a;
15071 }
15072 if(a)
15073 {
15074 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear((&*exp->call.arguments));
15075 idExp->identifier = (((void *)0));
15076 FreeExpContents(exp);
15077 ProcessExpressionType(a);
15078 if(b)
15079 ProcessExpressionType(b);
15080 exp->type = 5;
15081 exp->list = MkList();
15082 if(a->expType && (!b || b->expType))
15083 {
15084 if((!a->isConstant && a->type != 0) || (b && !b->isConstant && b->type != 0))
15085 {
15086 if(inCompiler)
15087 {
15088 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15089 struct __ecereNameSpace__ecere__sys__OldList * decls = MkList();
15090 struct Declaration * decl;
15091 char temp1[1024], temp2[1024];
15092
15093 GetTypeSpecs(a->expType, specs);
15094 if(a && !a->isConstant && a->type != 0)
15095 {
15096 sprintf(temp1, "__simpleStruct%d", curContext->simpleID++);
15097 ListAdd(decls, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(temp1)), (((void *)0))));
15098 tempExp1 = QMkExpId(temp1);
15099 tempExp1->expType = a->expType;
15100 if(a->expType)
15101 a->expType->refCount++;
15102 ListAdd(exp->list, MkExpOp(CopyExpression(tempExp1), '=', a));
15103 }
15104 if(b && !b->isConstant && b->type != 0)
15105 {
15106 sprintf(temp2, "__simpleStruct%d", curContext->simpleID++);
15107 ListAdd(decls, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(temp2)), (((void *)0))));
15108 tempExp2 = QMkExpId(temp2);
15109 tempExp2->expType = b->expType;
15110 if(b->expType)
15111 b->expType->refCount++;
15112 ListAdd(exp->list, MkExpOp(CopyExpression(tempExp2), '=', b));
15113 }
15114 decl = MkDeclaration(specs, decls);
15115 if(!curCompound->compound.declarations)
15116 curCompound->compound.declarations = MkList();
15117 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*curCompound->compound.declarations), (((void *)0)), decl);
15118 }
15119 }
15120 }
15121 if(!strcmp(id->string, "Max") || !strcmp(id->string, "Min"))
15122 {
15123 int op = (!strcmp(id->string, "Max")) ? '>' : '<';
15124
15125 ListAdd(exp->list, MkExpCondition(MkExpBrackets(MkListOne(MkExpOp(CopyExpression(tempExp1), op, CopyExpression(tempExp2)))), MkListOne(CopyExpression(tempExp1)), CopyExpression(tempExp2)));
15126 exp->expType = a->expType;
15127 if(a->expType)
15128 a->expType->refCount++;
15129 }
15130 else if(!strcmp(id->string, "Abs"))
15131 {
15132 ListAdd(exp->list, MkExpCondition(MkExpBrackets(MkListOne(MkExpOp(CopyExpression(tempExp1), '<', MkExpConstant("0")))), MkListOne(MkExpOp((((void *)0)), '-', CopyExpression(tempExp1))), CopyExpression(tempExp1)));
15133 exp->expType = a->expType;
15134 if(a->expType)
15135 a->expType->refCount++;
15136 }
15137 else if(!strcmp(id->string, "Sgn"))
15138 {
15139 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"))))));
15140 exp->expType = ProcessTypeString("int", 0x0);
15141 }
15142 FreeExpression(tempExp1);
15143 if(tempExp2)
15144 FreeExpression(tempExp2);
15145 FreeIdentifier(id);
15146 break;
15147 }
15148 }
15149 }
15150 {
15151 struct Type * dummy = (dummy = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), dummy->count = 1, dummy->refCount = 1, dummy);
15152
15153 if(!exp->call.exp->destType)
15154 {
15155 exp->call.exp->destType = dummy;
15156 dummy->refCount++;
15157 }
15158 ProcessExpressionType(exp->call.exp);
15159 if(exp->call.exp->destType == dummy)
15160 {
15161 FreeType(dummy);
15162 exp->call.exp->destType = (((void *)0));
15163 }
15164 FreeType(dummy);
15165 }
15166 functionType = exp->call.exp->expType;
15167 if(functionType && functionType->kind == 16)
15168 {
15169 methodType = functionType;
15170 functionType = methodType->method->dataType;
15171 if(exp->call.exp->expType->usedClass)
15172 {
15173 char typeString[1024];
15174
15175 typeString[0] = '\0';
15176 {
15177 struct Symbol * back = functionType->thisClass;
15178
15179 functionType->thisClass = (((void *)0));
15180 PrintType(functionType, typeString, 0x1, 0x1);
15181 functionType->thisClass = back;
15182 }
15183 if(strstr(typeString, "thisclass"))
15184 {
15185 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15186 struct Declarator * decl;
15187
15188 {
15189 struct Context * context = SetupTemplatesContext(exp->call.exp->expType->usedClass);
15190
15191 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
15192 if(thisClass != (exp->call.exp->expType->usedClass->templateClass ? exp->call.exp->expType->usedClass->templateClass : exp->call.exp->expType->usedClass))
15193 thisClassParams = 0x0;
15194 ReplaceThisClassSpecifiers(specs, exp->call.exp->expType->usedClass);
15195 {
15196 struct __ecereNameSpace__ecere__com__Class * backupThisClass = thisClass;
15197
15198 thisClass = exp->call.exp->expType->usedClass;
15199 ProcessDeclarator(decl);
15200 thisClass = backupThisClass;
15201 }
15202 thisClassParams = 0x1;
15203 functionType = ProcessType(specs, decl);
15204 functionType->refCount = 0;
15205 FinishTemplatesContext(context);
15206 }
15207 FreeList(specs, FreeSpecifier);
15208 FreeDeclarator(decl);
15209 }
15210 }
15211 }
15212 if(functionType && functionType->kind == 13 && functionType->type && functionType->type->kind == 11)
15213 {
15214 struct Type * type = functionType->type;
15215
15216 if(!functionType->refCount)
15217 {
15218 functionType->type = (((void *)0));
15219 FreeType(functionType);
15220 }
15221 functionType = type;
15222 }
15223 if(functionType && functionType->kind != 11)
15224 {
15225 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "called object %s is not a function\n", (((void *)0))), name);
15226 }
15227 else if(functionType)
15228 {
15229 unsigned int emptyParams = 0x0, noParams = 0x0;
15230 struct Expression * e = exp->call.arguments ? (*exp->call.arguments).first : (((void *)0));
15231 struct Type * type = functionType->params.first;
15232 struct Expression * memberExp = (exp->call.exp->type == 8) ? exp->call.exp : (((void *)0));
15233 int extra = 0;
15234 struct Location oldyylloc = yylloc;
15235
15236 if(!type)
15237 emptyParams = 0x1;
15238 if(functionType->extraParam && e && functionType->thisClass)
15239 {
15240 e->destType = MkClassType(functionType->thisClass->string);
15241 e = e->next;
15242 }
15243 if(!functionType->staticMethod && !functionType->extraParam)
15244 {
15245 if(memberExp && memberExp->member.exp && memberExp->member.exp->expType && memberExp->member.exp->expType->kind == 19 && memberExp->member.exp->expType->_class)
15246 {
15247 type = MkClassType(memberExp->member.exp->expType->_class->string);
15248 if(e)
15249 {
15250 e->destType = type;
15251 e = e->next;
15252 type = functionType->params.first;
15253 }
15254 else
15255 type->refCount = 0;
15256 }
15257 else if(!memberExp && (functionType->thisClass || (methodType && methodType->methodClass)))
15258 {
15259 type = MkClassType(functionType->thisClass ? functionType->thisClass->string : (methodType ? methodType->methodClass->fullName : (((void *)0))));
15260 type->byReference = functionType->byReference;
15261 type->typedByReference = functionType->typedByReference;
15262 if(e)
15263 {
15264 if(e->next && type->kind == 8 && (functionType && functionType->thisClass) && functionType->classObjectType == 2)
15265 e = e->next;
15266 e->destType = type;
15267 e = e->next;
15268 type = functionType->params.first;
15269 }
15270 else
15271 type->refCount = 0;
15272 }
15273 }
15274 if(type && type->kind == 0)
15275 {
15276 noParams = 0x1;
15277 if(!type->refCount)
15278 FreeType(type);
15279 type = (((void *)0));
15280 }
15281 for(; e; e = e->next)
15282 {
15283 if(!type && !emptyParams)
15284 {
15285 yylloc = e->loc;
15286 if(methodType && methodType->methodClass)
15287 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);
15288 else
15289 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);
15290 break;
15291 }
15292 if(methodType && type && type->kind == 20 && type->templateParameter->type == 0)
15293 {
15294 struct Type * templatedType = (((void *)0));
15295 struct __ecereNameSpace__ecere__com__Class * _class = methodType->usedClass;
15296 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
15297 int id = 0;
15298
15299 if(_class && _class->templateArgs)
15300 {
15301 struct __ecereNameSpace__ecere__com__Class * sClass;
15302
15303 for(sClass = _class; sClass; sClass = sClass->base)
15304 {
15305 if(sClass->templateClass)
15306 sClass = sClass->templateClass;
15307 id = 0;
15308 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
15309 {
15310 if(curParam->type == 0 && !strcmp(type->templateParameter->identifier->string, curParam->name))
15311 {
15312 struct __ecereNameSpace__ecere__com__Class * nextClass;
15313
15314 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
15315 {
15316 if(nextClass->templateClass)
15317 nextClass = nextClass->templateClass;
15318 id += nextClass->templateParams.count;
15319 }
15320 break;
15321 }
15322 id++;
15323 }
15324 if(curParam)
15325 break;
15326 }
15327 }
15328 if(curParam && _class->templateArgs[id].dataTypeString)
15329 {
15330 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = _class->templateArgs[id];
15331
15332 {
15333 struct Context * context = SetupTemplatesContext(_class);
15334
15335 templatedType = ProcessTypeString(arg.dataTypeString, 0x0);
15336 FinishTemplatesContext(context);
15337 }
15338 e->destType = templatedType;
15339 if(templatedType)
15340 {
15341 templatedType->passAsTemplate = 0x1;
15342 }
15343 }
15344 else
15345 {
15346 e->destType = type;
15347 if(type)
15348 type->refCount++;
15349 }
15350 }
15351 else
15352 {
15353 if(type && type->kind == 14 && type->prev && type->prev->kind == 8 && type->prev->classObjectType)
15354 {
15355 e->destType = type->prev;
15356 e->destType->refCount++;
15357 }
15358 else
15359 {
15360 e->destType = type;
15361 if(type)
15362 type->refCount++;
15363 }
15364 }
15365 if(type && type->kind != 14)
15366 {
15367 struct Type * next = type->next;
15368
15369 if(!type->refCount)
15370 FreeType(type);
15371 type = next;
15372 }
15373 }
15374 if(type && type->kind != 14)
15375 {
15376 if(methodType && methodType->methodClass)
15377 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);
15378 else
15379 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);
15380 }
15381 yylloc = oldyylloc;
15382 if(type && !type->refCount)
15383 FreeType(type);
15384 }
15385 else
15386 {
15387 functionType = __extension__ ({
15388 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
15389
15390 __ecereInstance1->refCount = 0, __ecereInstance1->kind = 11, __ecereInstance1;
15391 });
15392 if(exp->call.exp->type == 0)
15393 {
15394 char * string = exp->call.exp->identifier->string;
15395
15396 if(inCompiler)
15397 {
15398 struct Symbol * symbol;
15399 struct Location oldyylloc = yylloc;
15400
15401 yylloc = exp->call.exp->identifier->loc;
15402 if(strstr(string, "__builtin_") == string)
15403 {
15404 if(exp->destType)
15405 {
15406 functionType->returnType = exp->destType;
15407 exp->destType->refCount++;
15408 }
15409 }
15410 else
15411 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "%s undefined; assuming extern returning int\n", (((void *)0))), string);
15412 symbol = __extension__ ({
15413 struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
15414
15415 __ecereInstance1->string = __ecereNameSpace__ecere__sys__CopyString(string), __ecereInstance1->type = ProcessTypeString("int()", 0x1), __ecereInstance1;
15416 });
15417 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)symbol);
15418 if(strstr(symbol->string, "::"))
15419 globalContext->hasNameSpace = 0x1;
15420 yylloc = oldyylloc;
15421 }
15422 }
15423 else if(exp->call.exp->type == 8)
15424 {
15425 }
15426 else
15427 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "callable object undefined; extern assuming returning int\n", (((void *)0))));
15428 if(!functionType->returnType)
15429 {
15430 functionType->returnType = __extension__ ({
15431 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
15432
15433 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 3, __ecereInstance1;
15434 });
15435 }
15436 }
15437 if(functionType && functionType->kind == 11)
15438 {
15439 exp->expType = functionType->returnType;
15440 if(functionType->returnType)
15441 functionType->returnType->refCount++;
15442 if(!functionType->refCount)
15443 FreeType(functionType);
15444 }
15445 if(exp->call.arguments)
15446 {
15447 for(e = (*exp->call.arguments).first; e; e = e->next)
15448 {
15449 struct Type * destType = e->destType;
15450
15451 ProcessExpressionType(e);
15452 }
15453 }
15454 break;
15455 }
15456 case 8:
15457 {
15458 struct Type * type;
15459 struct Location oldyylloc = yylloc;
15460 unsigned int thisPtr;
15461 struct Expression * checkExp = exp->member.exp;
15462
15463 while(checkExp)
15464 {
15465 if(checkExp->type == 11)
15466 checkExp = checkExp->cast.exp;
15467 else if(checkExp->type == 5)
15468 checkExp = checkExp->list ? (*checkExp->list).first : (((void *)0));
15469 else
15470 break;
15471 }
15472 thisPtr = (checkExp && checkExp->type == 0 && !strcmp(checkExp->identifier->string, "this"));
15473 exp->thisPtr = thisPtr;
15474 if(exp->member.member && exp->member.member->_class && exp->member.member->_class->name)
15475 {
15476 exp->member.member->classSym = exp->member.member->_class->symbol;
15477 }
15478 ProcessExpressionType(exp->member.exp);
15479 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)
15480 {
15481 exp->isConstant = 0x0;
15482 }
15483 else
15484 exp->isConstant = exp->member.exp->isConstant;
15485 type = exp->member.exp->expType;
15486 yylloc = exp->loc;
15487 if(type && (type->kind == 20))
15488 {
15489 struct __ecereNameSpace__ecere__com__Class * _class = thisClass ? thisClass : currentClass;
15490 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param = (((void *)0));
15491
15492 if(_class)
15493 {
15494 for(param = _class->templateParams.first; param; param = param->next)
15495 {
15496 if(param->type == 1 && exp->member.member && exp->member.member->string && !strcmp(param->name, exp->member.member->string))
15497 break;
15498 }
15499 }
15500 if(param && param->defaultArg.member)
15501 {
15502 struct Expression * argExp = GetTemplateArgExpByName(param->name, thisClass, 1);
15503
15504 if(argExp)
15505 {
15506 struct Expression * expMember = exp->member.exp;
15507 struct Declarator * decl;
15508 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15509 char thisClassTypeString[1024];
15510
15511 FreeIdentifier(exp->member.member);
15512 ProcessExpressionType(argExp);
15513 {
15514 char * colon = strstr(param->defaultArg.memberString, "::");
15515
15516 if(colon)
15517 {
15518 char className[1024];
15519 struct __ecereNameSpace__ecere__com__Class * sClass;
15520
15521 memcpy(thisClassTypeString, param->defaultArg.memberString, colon - param->defaultArg.memberString);
15522 thisClassTypeString[colon - param->defaultArg.memberString] = '\0';
15523 }
15524 else
15525 strcpy(thisClassTypeString, _class->fullName);
15526 }
15527 decl = SpecDeclFromString(param->defaultArg.member->dataTypeString, specs, (((void *)0)));
15528 exp->expType = ProcessType(specs, decl);
15529 if(exp->expType->kind == 8 && exp->expType->_class && exp->expType->_class->registered && exp->expType->_class->registered->templateClass)
15530 {
15531 struct __ecereNameSpace__ecere__com__Class * expClass = exp->expType->_class->registered;
15532 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
15533 int c;
15534 int paramCount = 0;
15535 int lastParam = -1;
15536 char templateString[1024];
15537 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
15538
15539 sprintf(templateString, "%s<", expClass->templateClass->fullName);
15540 for(cClass = expClass; cClass; cClass = cClass->base)
15541 {
15542 int p = 0;
15543
15544 for(param = cClass->templateParams.first; param; param = param->next)
15545 {
15546 int id = p;
15547 struct __ecereNameSpace__ecere__com__Class * sClass;
15548 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
15549
15550 for(sClass = cClass->base; sClass; sClass = sClass->base)
15551 id += sClass->templateParams.count;
15552 arg = expClass->templateArgs[id];
15553 for(sClass = _class; sClass; sClass = sClass->base)
15554 {
15555 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * cParam;
15556 int p = 0;
15557 struct __ecereNameSpace__ecere__com__Class * nextClass;
15558
15559 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
15560 p += nextClass->templateParams.count;
15561 for(cParam = sClass->templateParams.first; cParam; cParam = cParam->next, p++)
15562 {
15563 if(cParam->type == 0 && arg.dataTypeString && !strcmp(cParam->name, arg.dataTypeString))
15564 {
15565 if(_class->templateArgs && arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
15566 {
15567 arg.dataTypeString = _class->templateArgs[p].dataTypeString;
15568 arg.dataTypeClass = _class->templateArgs[p].dataTypeClass;
15569 break;
15570 }
15571 }
15572 }
15573 }
15574 {
15575 char argument[256];
15576
15577 argument[0] = '\0';
15578 switch(param->type)
15579 {
15580 case 2:
15581 {
15582 char expString[1024];
15583 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15584 struct Declarator * decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
15585 struct Expression * exp;
15586 char * string = PrintHexUInt64(arg.expression.ui64);
15587
15588 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
15589 (__ecereNameSpace__ecere__com__eSystem_Delete(string), string = 0);
15590 ProcessExpressionType(exp);
15591 ComputeExpression(exp);
15592 expString[0] = '\0';
15593 PrintExpression(exp, expString);
15594 strcat(argument, expString);
15595 FreeExpression(exp);
15596 break;
15597 }
15598 case 1:
15599 {
15600 strcat(argument, arg.member->name);
15601 break;
15602 }
15603 case 0:
15604 {
15605 if(arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
15606 {
15607 if(!strcmp(arg.dataTypeString, "thisclass"))
15608 strcat(argument, thisClassTypeString);
15609 else
15610 strcat(argument, arg.dataTypeString);
15611 }
15612 break;
15613 }
15614 }
15615 if(argument[0])
15616 {
15617 if(paramCount)
15618 strcat(templateString, ", ");
15619 if(lastParam != p - 1)
15620 {
15621 strcat(templateString, param->name);
15622 strcat(templateString, " = ");
15623 }
15624 strcat(templateString, argument);
15625 paramCount++;
15626 lastParam = p;
15627 }
15628 p++;
15629 }
15630 }
15631 }
15632 {
15633 int len = strlen(templateString);
15634
15635 if(templateString[len - 1] == '>')
15636 templateString[len++] = ' ';
15637 templateString[len++] = '>';
15638 templateString[len++] = '\0';
15639 }
15640 {
15641 struct Context * context = SetupTemplatesContext(_class);
15642
15643 FreeType(exp->expType);
15644 exp->expType = ProcessTypeString(templateString, 0x0);
15645 FinishTemplatesContext(context);
15646 }
15647 }
15648 exp->type = 5;
15649 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")))))))));
15650 }
15651 }
15652 else if(type->templateParameter && type->templateParameter->type == 0 && (type->templateParameter->dataType || type->templateParameter->dataTypeString))
15653 {
15654 type = ProcessTemplateParameterType(type->templateParameter);
15655 }
15656 }
15657 if(type && (type->kind == 20))
15658 ;
15659 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)))
15660 {
15661 struct Identifier * id = exp->member.member;
15662 int typeKind = type->kind;
15663 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));
15664
15665 if(typeKind == 19 && exp->member.exp->type == 24)
15666 {
15667 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "ecere::com::Class");
15668 typeKind = 8;
15669 }
15670 if(id)
15671 {
15672 if(typeKind == 3 || typeKind == 15)
15673 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "int");
15674 else if(!_class)
15675 {
15676 if(type->kind == 8 && type->_class && type->_class->registered)
15677 {
15678 _class = type->_class->registered;
15679 }
15680 else if((type->kind == 12 || type->kind == 13) && type->type && type->type->kind == 1)
15681 {
15682 _class = FindClass("char *")->registered;
15683 }
15684 else if(type->kind == 13)
15685 {
15686 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "uintptr");
15687 FreeType(exp->expType);
15688 exp->expType = ProcessTypeString("uintptr", 0x0);
15689 exp->byReference = 0x1;
15690 }
15691 else
15692 {
15693 char string[1024] = "";
15694 struct Symbol * classSym;
15695
15696 PrintTypeNoConst(type, string, 0x0, 0x1);
15697 classSym = FindClass(string);
15698 if(classSym)
15699 _class = classSym->registered;
15700 }
15701 }
15702 }
15703 if(_class && id)
15704 {
15705 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
15706 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
15707 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
15708 struct __ecereNameSpace__ecere__com__Property * revConvert = (((void *)0));
15709 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
15710
15711 if(id && id->_class && id->_class->name && !strcmp(id->_class->name, "property"))
15712 exp->member.memberType = 1;
15713 if(id && id->_class && type->_class && !__ecereNameSpace__ecere__com__eClass_IsDerived(type->_class->registered, _class))
15714 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "invalid class specifier %s for object of class %s\n", (((void *)0))), _class->fullName, type->_class->string);
15715 if(typeKind != 19)
15716 {
15717 if((exp->member.memberType == 0 && thisPtr) || exp->member.memberType == 3)
15718 {
15719 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
15720 if(member && member->_class != (_class->templateClass ? _class->templateClass : _class) && exp->member.memberType != 3)
15721 {
15722 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
15723 if(prop)
15724 member = (((void *)0));
15725 }
15726 if(!member && !prop)
15727 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
15728 if((member && member->_class == (_class->templateClass ? _class->templateClass : _class)) || (prop && prop->_class == (_class->templateClass ? _class->templateClass : _class)))
15729 exp->member.thisPtr = 0x1;
15730 }
15731 else
15732 {
15733 if(!id->classSym)
15734 {
15735 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, (((void *)0)));
15736 if(!id->_class || !id->_class->name || strcmp(id->_class->name, "property"))
15737 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, (((void *)0)), (((void *)0)), (((void *)0)));
15738 }
15739 if(!prop && !member)
15740 {
15741 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, (((void *)0)));
15742 if(!method)
15743 {
15744 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
15745 if(!id->_class || !id->_class->name || strcmp(id->_class->name, "property"))
15746 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
15747 }
15748 }
15749 if(member && prop)
15750 {
15751 if(member->_class != prop->_class && !id->_class && __ecereNameSpace__ecere__com__eClass_IsDerived(member->_class, prop->_class))
15752 prop = (((void *)0));
15753 else
15754 member = (((void *)0));
15755 }
15756 }
15757 }
15758 if(!prop && !member && !method)
15759 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule);
15760 if(!prop && !member && !method)
15761 {
15762 if(typeKind == 19)
15763 {
15764 classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(type->_class->registered, exp->member.member->string);
15765 if(classProp)
15766 {
15767 exp->member.memberType = 5;
15768 exp->expType = ProcessTypeString(classProp->dataTypeString, 0x0);
15769 }
15770 else
15771 {
15772 char structName[1024];
15773 struct Identifier * id = exp->member.member;
15774 struct Expression * classExp = exp->member.exp;
15775
15776 type->refCount++;
15777 FreeType(classExp->expType);
15778 classExp->expType = ProcessTypeString("ecere::com::Class", 0x0);
15779 strcpy(structName, "__ecereClassData_");
15780 FullClassNameCat(structName, type->_class->string, 0x0);
15781 exp->type = 9;
15782 exp->member.member = id;
15783 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"))))))));
15784 FreeType(type);
15785 ProcessExpressionType(exp);
15786 return ;
15787 }
15788 }
15789 else
15790 {
15791 struct Symbol * classSym = FindClass(id->string);
15792
15793 if(classSym)
15794 {
15795 struct __ecereNameSpace__ecere__com__Class * convertClass = classSym->registered;
15796
15797 if(convertClass)
15798 revConvert = __ecereNameSpace__ecere__com__eClass_FindProperty(convertClass, _class->fullName, privateModule);
15799 }
15800 }
15801 }
15802 if(prop)
15803 {
15804 exp->member.memberType = 1;
15805 if(!prop->dataType)
15806 ProcessPropertyType(prop);
15807 exp->expType = prop->dataType;
15808 if(prop->dataType)
15809 prop->dataType->refCount++;
15810 }
15811 else if(member)
15812 {
15813 if(exp->member.exp->expType->classObjectType == 2 && !strcmp(exp->member.member->string, "_class"))
15814 {
15815 FreeExpContents(exp);
15816 exp->type = 0;
15817 exp->identifier = MkIdentifier("class");
15818 ProcessExpressionType(exp);
15819 return ;
15820 }
15821 exp->member.memberType = 3;
15822 DeclareStruct(_class->fullName, 0x0);
15823 if(!member->dataType)
15824 {
15825 struct Context * context = SetupTemplatesContext(_class);
15826
15827 member->dataType = ProcessTypeString(member->dataTypeString, 0x0);
15828 FinishTemplatesContext(context);
15829 }
15830 exp->expType = member->dataType;
15831 if(member->dataType)
15832 member->dataType->refCount++;
15833 }
15834 else if(revConvert)
15835 {
15836 exp->member.memberType = 4;
15837 exp->expType = MkClassType(revConvert->_class->fullName);
15838 }
15839 else if(method)
15840 {
15841 {
15842 exp->member.memberType = 2;
15843 }
15844 if(!method->dataType)
15845 ProcessMethodType(method);
15846 exp->expType = __extension__ ({
15847 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
15848
15849 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 16, __ecereInstance1->method = method, __ecereInstance1;
15850 });
15851 exp->expType->methodClass = (id && id->_class) ? _class : (((void *)0));
15852 exp->expType->usedClass = _class;
15853 }
15854 else if(!classProp)
15855 {
15856 if(exp->member.exp->expType->classObjectType == 2 && !strcmp(exp->member.member->string, "_class"))
15857 {
15858 FreeExpContents(exp);
15859 exp->type = 0;
15860 exp->identifier = MkIdentifier("class");
15861 FreeType(exp->expType);
15862 exp->expType = MkClassType("ecere::com::Class");
15863 return ;
15864 }
15865 yylloc = exp->member.member->loc;
15866 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't find member %s in class %s\n", (((void *)0))), id->string, _class->fullName);
15867 if(inCompiler)
15868 __ecereNameSpace__ecere__com__eClass_AddDataMember(_class, id->string, "int", 0, 0, 1);
15869 }
15870 if(_class && exp->expType)
15871 {
15872 struct __ecereNameSpace__ecere__com__Class * tClass;
15873
15874 tClass = _class;
15875 while(tClass && !tClass->templateClass)
15876 tClass = tClass->base;
15877 if(tClass && exp->expType->kind == 20 && exp->expType->templateParameter->type == 0)
15878 {
15879 int id = 0;
15880 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
15881 struct __ecereNameSpace__ecere__com__Class * sClass;
15882
15883 for(sClass = tClass; sClass; sClass = sClass->base)
15884 {
15885 id = 0;
15886 if(sClass->templateClass)
15887 sClass = sClass->templateClass;
15888 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
15889 {
15890 if(curParam->type == 0 && !strcmp(exp->expType->templateParameter->identifier->string, curParam->name))
15891 {
15892 for(sClass = sClass->base; sClass; sClass = sClass->base)
15893 id += sClass->templateParams.count;
15894 break;
15895 }
15896 id++;
15897 }
15898 if(curParam)
15899 break;
15900 }
15901 if(curParam && tClass->templateArgs[id].dataTypeString)
15902 {
15903 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = tClass->templateArgs[id];
15904 struct Context * context = SetupTemplatesContext(tClass);
15905
15906 FreeType(exp->expType);
15907 exp->expType = ProcessTypeString(arg.dataTypeString, 0x0);
15908 if(exp->expType)
15909 {
15910 if(exp->expType->kind == 21)
15911 {
15912 FreeType(exp->expType);
15913 exp->expType = ReplaceThisClassType(_class);
15914 }
15915 if(tClass->templateClass)
15916 exp->expType->passAsTemplate = 0x1;
15917 if(!exp->destType)
15918 {
15919 exp->destType = ProcessTypeString(arg.dataTypeString, 0x0);
15920 if(exp->destType->kind == 21)
15921 {
15922 FreeType(exp->destType);
15923 exp->destType = ReplaceThisClassType(_class);
15924 }
15925 }
15926 }
15927 FinishTemplatesContext(context);
15928 }
15929 }
15930 else if(tClass && exp->expType->kind == 13 && exp->expType->type && exp->expType->type->kind == 20 && exp->expType->type->templateParameter->type == 0)
15931 {
15932 int id = 0;
15933 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
15934 struct __ecereNameSpace__ecere__com__Class * sClass;
15935
15936 for(sClass = tClass; sClass; sClass = sClass->base)
15937 {
15938 id = 0;
15939 if(sClass->templateClass)
15940 sClass = sClass->templateClass;
15941 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
15942 {
15943 if(curParam->type == 0 && !strcmp(exp->expType->type->templateParameter->identifier->string, curParam->name))
15944 {
15945 for(sClass = sClass->base; sClass; sClass = sClass->base)
15946 id += sClass->templateParams.count;
15947 break;
15948 }
15949 id++;
15950 }
15951 if(curParam)
15952 break;
15953 }
15954 if(curParam)
15955 {
15956 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = tClass->templateArgs[id];
15957 struct Context * context = SetupTemplatesContext(tClass);
15958 struct Type * basicType;
15959
15960 basicType = ProcessTypeString(arg.dataTypeString, 0x0);
15961 if(basicType)
15962 {
15963 if(basicType->kind == 21)
15964 {
15965 FreeType(basicType);
15966 basicType = ReplaceThisClassType(_class);
15967 }
15968 FreeType(exp->expType);
15969 exp->expType = __extension__ ({
15970 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
15971
15972 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 13, __ecereInstance1->type = basicType, __ecereInstance1;
15973 });
15974 if(!exp->destType)
15975 {
15976 exp->destType = exp->expType;
15977 exp->destType->refCount++;
15978 }
15979 {
15980 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
15981 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15982 struct Declarator * decl;
15983
15984 decl = SpecDeclFromString(arg.dataTypeString, specs, (((void *)0)));
15985 *newExp = *exp;
15986 if(exp->destType)
15987 exp->destType->refCount++;
15988 if(exp->expType)
15989 exp->expType->refCount++;
15990 exp->type = 11;
15991 exp->cast.typeName = MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl));
15992 exp->cast.exp = newExp;
15993 }
15994 }
15995 FinishTemplatesContext(context);
15996 }
15997 }
15998 else if(tClass && exp->expType->kind == 8 && exp->expType->_class && strchr(exp->expType->_class->string, '<'))
15999 {
16000 struct __ecereNameSpace__ecere__com__Class * expClass = exp->expType->_class->registered;
16001
16002 if(expClass)
16003 {
16004 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
16005 int c;
16006 int p = 0;
16007 int paramCount = 0;
16008 int lastParam = -1;
16009 char templateString[1024];
16010 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
16011
16012 sprintf(templateString, "%s<", expClass->templateClass->fullName);
16013 while(cClass != expClass)
16014 {
16015 struct __ecereNameSpace__ecere__com__Class * sClass;
16016
16017 for(sClass = expClass; sClass && sClass->base != cClass; sClass = sClass->base)
16018 ;
16019 cClass = sClass;
16020 for(param = cClass->templateParams.first; param; param = param->next)
16021 {
16022 struct __ecereNameSpace__ecere__com__Class * cClassCur = (((void *)0));
16023 int c;
16024 int cp = 0;
16025 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * paramCur = (((void *)0));
16026 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
16027
16028 while(cClassCur != tClass && !paramCur)
16029 {
16030 struct __ecereNameSpace__ecere__com__Class * sClassCur;
16031
16032 for(sClassCur = tClass; sClassCur && sClassCur->base != cClassCur; sClassCur = sClassCur->base)
16033 ;
16034 cClassCur = sClassCur;
16035 for(paramCur = cClassCur->templateParams.first; paramCur; paramCur = paramCur->next)
16036 {
16037 if(!strcmp(paramCur->name, param->name))
16038 {
16039 break;
16040 }
16041 cp++;
16042 }
16043 }
16044 if(paramCur && paramCur->type == 0)
16045 arg = tClass->templateArgs[cp];
16046 else
16047 arg = expClass->templateArgs[p];
16048 {
16049 char argument[256];
16050
16051 argument[0] = '\0';
16052 switch(param->type)
16053 {
16054 case 2:
16055 {
16056 char expString[1024];
16057 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
16058 struct Declarator * decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
16059 struct Expression * exp;
16060 char * string = PrintHexUInt64(arg.expression.ui64);
16061
16062 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
16063 (__ecereNameSpace__ecere__com__eSystem_Delete(string), string = 0);
16064 ProcessExpressionType(exp);
16065 ComputeExpression(exp);
16066 expString[0] = '\0';
16067 PrintExpression(exp, expString);
16068 strcat(argument, expString);
16069 FreeExpression(exp);
16070 break;
16071 }
16072 case 1:
16073 {
16074 strcat(argument, arg.member->name);
16075 break;
16076 }
16077 case 0:
16078 {
16079 if(arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
16080 strcat(argument, arg.dataTypeString);
16081 break;
16082 }
16083 }
16084 if(argument[0])
16085 {
16086 if(paramCount)
16087 strcat(templateString, ", ");
16088 if(lastParam != p - 1)
16089 {
16090 strcat(templateString, param->name);
16091 strcat(templateString, " = ");
16092 }
16093 strcat(templateString, argument);
16094 paramCount++;
16095 lastParam = p;
16096 }
16097 }
16098 p++;
16099 }
16100 }
16101 {
16102 int len = strlen(templateString);
16103
16104 if(templateString[len - 1] == '>')
16105 templateString[len++] = ' ';
16106 templateString[len++] = '>';
16107 templateString[len++] = '\0';
16108 }
16109 FreeType(exp->expType);
16110 {
16111 struct Context * context = SetupTemplatesContext(tClass);
16112
16113 exp->expType = ProcessTypeString(templateString, 0x0);
16114 FinishTemplatesContext(context);
16115 }
16116 }
16117 }
16118 }
16119 }
16120 else
16121 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)");
16122 }
16123 else if(type && (type->kind == 9 || type->kind == 10))
16124 {
16125 struct Type * memberType = exp->member.member ? FindMember(type, exp->member.member->string) : (((void *)0));
16126
16127 if(memberType)
16128 {
16129 exp->expType = memberType;
16130 if(memberType)
16131 memberType->refCount++;
16132 }
16133 }
16134 else
16135 {
16136 char expString[10240];
16137
16138 expString[0] = '\0';
16139 if(inCompiler)
16140 {
16141 PrintExpression(exp, expString);
16142 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
16143 }
16144 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "member operator on non-structure type expression %s\n", (((void *)0))), expString);
16145 }
16146 if(exp->expType && exp->expType->kind == 21 && (!exp->destType || exp->destType->kind != 21))
16147 {
16148 if(type && (type->kind == 8 || type->kind == 19 || type->kind == 3 || type->kind == 15))
16149 {
16150 struct Identifier * id = exp->member.member;
16151 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));
16152
16153 if(_class)
16154 {
16155 FreeType(exp->expType);
16156 exp->expType = ReplaceThisClassType(_class);
16157 }
16158 }
16159 }
16160 yylloc = oldyylloc;
16161 break;
16162 }
16163 case 9:
16164 {
16165 struct Type * destType = exp->destType;
16166
16167 if(exp->member.member && exp->member.member->_class && exp->member.member->_class->name)
16168 {
16169 exp->member.member->classSym = exp->member.member->_class->symbol;
16170 }
16171 exp->member.exp = MkExpBrackets(MkListOne(MkExpOp((((void *)0)), '*', exp->member.exp)));
16172 exp->type = 8;
16173 if(destType)
16174 destType->count++;
16175 ProcessExpressionType(exp);
16176 if(destType)
16177 destType->count--;
16178 break;
16179 }
16180 case 15:
16181 {
16182 struct Symbol * classSym = exp->_class->symbol;
16183
16184 if(classSym && classSym->registered)
16185 {
16186 if(classSym->registered->type == 5)
16187 {
16188 char name[1024];
16189
16190 name[0] = '\0';
16191 DeclareStruct(classSym->string, 0x0);
16192 FreeSpecifier(exp->_class);
16193 exp->type = 10;
16194 FullClassNameCat(name, classSym->string, 0x0);
16195 exp->typeName = MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(name), (((void *)0)))), (((void *)0)));
16196 }
16197 else
16198 {
16199 if(classSym->registered->fixed)
16200 {
16201 FreeSpecifier(exp->_class);
16202 exp->constant = PrintUInt(classSym->registered->templateClass ? classSym->registered->templateClass->structSize : classSym->registered->structSize);
16203 exp->type = 2;
16204 }
16205 else
16206 {
16207 char className[1024];
16208
16209 strcpy(className, "__ecereClass_");
16210 FullClassNameCat(className, classSym->string, 0x1);
16211 MangleClassName(className);
16212 DeclareClass(classSym, className);
16213 FreeExpContents(exp);
16214 exp->type = 9;
16215 exp->member.exp = MkExpIdentifier(MkIdentifier(className));
16216 exp->member.member = MkIdentifier("structSize");
16217 }
16218 }
16219 }
16220 exp->expType = __extension__ ({
16221 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16222
16223 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 3, __ecereInstance1;
16224 });
16225 break;
16226 }
16227 case 10:
16228 {
16229 struct Type * type = ProcessType(exp->typeName->qualifiers, exp->typeName->declarator);
16230
16231 exp->expType = __extension__ ({
16232 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16233
16234 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 3, __ecereInstance1;
16235 });
16236 exp->isConstant = 0x1;
16237 DeclareType(type, 0x0, 0x0);
16238 FreeType(type);
16239 break;
16240 }
16241 case 11:
16242 {
16243 struct Type * type = ProcessType(exp->cast.typeName->qualifiers, exp->cast.typeName->declarator);
16244
16245 type->count = 1;
16246 FreeType(exp->cast.exp->destType);
16247 exp->cast.exp->destType = type;
16248 type->refCount++;
16249 ProcessExpressionType(exp->cast.exp);
16250 type->count = 0;
16251 exp->expType = type;
16252 if(!exp->cast.exp->needCast && !NeedCast(exp->cast.exp->expType, type))
16253 {
16254 void * prev = exp->prev, * next = exp->next;
16255 struct Type * expType = exp->cast.exp->destType;
16256 struct Expression * castExp = exp->cast.exp;
16257 struct Type * destType = exp->destType;
16258
16259 if(expType)
16260 expType->refCount++;
16261 FreeType(exp->expType);
16262 FreeTypeName(exp->cast.typeName);
16263 *exp = *castExp;
16264 FreeType(exp->expType);
16265 FreeType(exp->destType);
16266 exp->expType = expType;
16267 exp->destType = destType;
16268 ((castExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(castExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(castExp)) : 0), castExp = 0);
16269 exp->prev = prev;
16270 exp->next = next;
16271 }
16272 else
16273 {
16274 exp->isConstant = exp->cast.exp->isConstant;
16275 }
16276 break;
16277 }
16278 case 33:
16279 {
16280 struct Type * type = ProcessType(exp->initializer.typeName->qualifiers, exp->initializer.typeName->declarator);
16281
16282 exp->expType = type;
16283 break;
16284 }
16285 case 34:
16286 {
16287 struct Type * type = ProcessType(exp->vaArg.typeName->qualifiers, exp->vaArg.typeName->declarator);
16288
16289 ProcessExpressionType(exp->vaArg.exp);
16290 exp->expType = type;
16291 break;
16292 }
16293 case 12:
16294 {
16295 struct Expression * e;
16296
16297 exp->isConstant = 0x1;
16298 FreeType(exp->cond.cond->destType);
16299 exp->cond.cond->destType = MkClassType("bool");
16300 exp->cond.cond->destType->truth = 0x1;
16301 ProcessExpressionType(exp->cond.cond);
16302 if(!exp->cond.cond->isConstant)
16303 exp->isConstant = 0x0;
16304 for(e = (*exp->cond.exp).first; e; e = e->next)
16305 {
16306 if(!e->next)
16307 {
16308 FreeType(e->destType);
16309 e->destType = exp->destType;
16310 if(e->destType)
16311 e->destType->refCount++;
16312 }
16313 ProcessExpressionType(e);
16314 if(!e->next)
16315 {
16316 exp->expType = e->expType;
16317 if(e->expType)
16318 e->expType->refCount++;
16319 }
16320 if(!e->isConstant)
16321 exp->isConstant = 0x0;
16322 }
16323 FreeType(exp->cond.elseExp->destType);
16324 exp->cond.elseExp->destType = exp->destType ? exp->destType : exp->expType;
16325 if(exp->cond.elseExp->destType)
16326 exp->cond.elseExp->destType->refCount++;
16327 ProcessExpressionType(exp->cond.elseExp);
16328 if(!exp->cond.elseExp->isConstant)
16329 exp->isConstant = 0x0;
16330 break;
16331 }
16332 case 23:
16333 {
16334 if(exp->compound && exp->compound->compound.statements && (*exp->compound->compound.statements).last)
16335 {
16336 struct Statement * last = (*exp->compound->compound.statements).last;
16337
16338 if(last->type == 3 && last->expressions && (*last->expressions).last)
16339 {
16340 ((struct Expression *)(*last->expressions).last)->destType = exp->destType;
16341 if(exp->destType)
16342 exp->destType->refCount++;
16343 }
16344 ProcessStatement(exp->compound);
16345 exp->expType = (last->expressions && (*last->expressions).last) ? ((struct Expression *)(*last->expressions).last)->expType : (((void *)0));
16346 if(exp->expType)
16347 exp->expType->refCount++;
16348 }
16349 break;
16350 }
16351 case 24:
16352 {
16353 struct Specifier * spec = (*exp->_classExp.specifiers).first;
16354
16355 if(spec && spec->type == 1)
16356 {
16357 exp->expType = MkClassType(spec->name);
16358 exp->expType->kind = 19;
16359 exp->byReference = 0x1;
16360 }
16361 else
16362 {
16363 exp->expType = MkClassType("ecere::com::Class");
16364 exp->byReference = 0x1;
16365 }
16366 break;
16367 }
16368 case 25:
16369 {
16370 struct __ecereNameSpace__ecere__com__Class * _class = thisClass ? thisClass : currentClass;
16371
16372 if(_class)
16373 {
16374 struct Identifier * id = exp->classData.id;
16375 char structName[1024];
16376 struct Expression * classExp;
16377
16378 strcpy(structName, "__ecereClassData_");
16379 FullClassNameCat(structName, _class->fullName, 0x0);
16380 exp->type = 9;
16381 exp->member.member = id;
16382 if(curCompound && FindSymbol("this", curContext, curCompound->compound.context, 0x0, 0x0))
16383 classExp = MkExpMember(MkExpIdentifier(MkIdentifier("this")), MkIdentifier("_class"));
16384 else
16385 classExp = MkExpIdentifier(MkIdentifier("class"));
16386 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"))))))));
16387 ProcessExpressionType(exp);
16388 return ;
16389 }
16390 break;
16391 }
16392 case 35:
16393 {
16394 struct Type * type = (((void *)0));
16395 char * typeString = (((void *)0));
16396 char typeStringBuf[1024];
16397
16398 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))
16399 {
16400 struct __ecereNameSpace__ecere__com__Class * templateClass = exp->destType->_class->registered;
16401
16402 typeString = templateClass->templateArgs[2].dataTypeString;
16403 }
16404 else if(exp->list)
16405 {
16406 struct Expression * e;
16407
16408 for(e = (*exp->list).first; e; e = e->next)
16409 {
16410 ProcessExpressionType(e);
16411 if(e->expType)
16412 {
16413 if(!type)
16414 {
16415 type = e->expType;
16416 type->refCount++;
16417 }
16418 else
16419 {
16420 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
16421 {
16422 FreeType(type);
16423 type = e->expType;
16424 e->expType = (((void *)0));
16425 e = (*exp->list).first;
16426 ProcessExpressionType(e);
16427 if(e->expType)
16428 {
16429 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
16430 {
16431 FreeType(e->expType);
16432 e->expType = (((void *)0));
16433 FreeType(type);
16434 type = (((void *)0));
16435 break;
16436 }
16437 }
16438 }
16439 }
16440 if(e->expType)
16441 {
16442 FreeType(e->expType);
16443 e->expType = (((void *)0));
16444 }
16445 }
16446 }
16447 if(type)
16448 {
16449 typeStringBuf[0] = '\0';
16450 PrintTypeNoConst(type, typeStringBuf, 0x0, 0x1);
16451 typeString = typeStringBuf;
16452 FreeType(type);
16453 type = (((void *)0));
16454 }
16455 }
16456 if(typeString)
16457 {
16458 char templateString[1024];
16459 struct __ecereNameSpace__ecere__sys__OldList * initializers = MkList();
16460 struct __ecereNameSpace__ecere__sys__OldList * structInitializers = MkList();
16461 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
16462 struct Expression * expExt;
16463 struct Declarator * decl = SpecDeclFromString(typeString, specs, (((void *)0)));
16464
16465 sprintf(templateString, "Container<%s>", typeString);
16466 if(exp->list)
16467 {
16468 struct Expression * e;
16469
16470 type = ProcessTypeString(typeString, 0x0);
16471 while(e = (*exp->list).first)
16472 {
16473 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*exp->list), e);
16474 e->destType = type;
16475 type->refCount++;
16476 ProcessExpressionType(e);
16477 ListAdd(initializers, MkInitializerAssignment(e));
16478 }
16479 FreeType(type);
16480 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->list), exp->list = 0);
16481 }
16482 DeclareStruct("ecere::com::BuiltInContainer", 0x0);
16483 ListAdd(structInitializers, MkInitializerAssignment(MkExpMember(MkExpClass(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0))), MkIdentifier("_vTbl"))));
16484 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
16485 ListAdd(structInitializers, MkInitializerAssignment(MkExpClass(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0)))));
16486 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
16487 ListAdd(structInitializers, MkInitializerAssignment(MkExpConstant("0")));
16488 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
16489 ListAdd(structInitializers, MkInitializerAssignment(MkExpExtensionInitializer(MkTypeName(specs, MkDeclaratorArray(decl, (((void *)0)))), MkInitializerList(initializers))));
16490 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
16491 ListAdd(structInitializers, MkInitializerAssignment(__extension__ ({
16492 struct Expression * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
16493
16494 __ecereInstance1->type = 2, __ecereInstance1->constant = __ecereNameSpace__ecere__com__PrintString(__ecereClass_int, &(*initializers).count, (void *)0), __ecereInstance1;
16495 })));
16496 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
16497 ListAdd(structInitializers, MkInitializerAssignment(MkExpClass(CopyList(specs, CopySpecifier), CopyDeclarator(decl))));
16498 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
16499 exp->expType = ProcessTypeString(templateString, 0x0);
16500 exp->type = 5;
16501 exp->list = MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName(templateString)), (((void *)0))), MkExpOp((((void *)0)), '&', expExt = MkExpExtensionInitializer(MkTypeName(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0))), MkInitializerList(structInitializers)))));
16502 ProcessExpressionType(expExt);
16503 }
16504 else
16505 {
16506 exp->expType = ProcessTypeString("Container", 0x0);
16507 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Couldn't determine type of array elements\n", (((void *)0))));
16508 }
16509 break;
16510 }
16511 }
16512 if(exp->expType && exp->expType->kind == 21 && thisClass && (!exp->destType || exp->destType->kind != 21))
16513 {
16514 FreeType(exp->expType);
16515 exp->expType = ReplaceThisClassType(thisClass);
16516 }
16517 if(exp->expType && (exp->expType->kind == 9 || exp->expType->kind == 10 || exp->expType->kind == 15) && !exp->expType->members.first && exp->expType->enumName)
16518 {
16519 struct Symbol * symbol = FindSymbol(exp->expType->enumName, curContext, globalContext, 0x1, 0x0);
16520
16521 if(symbol)
16522 {
16523 if(exp->expType->kind != 15)
16524 {
16525 struct Type * member;
16526 char * enumName = __ecereNameSpace__ecere__sys__CopyString(exp->expType->enumName);
16527
16528 FreeType(exp->expType);
16529 exp->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16530 exp->expType->kind = symbol->type->kind;
16531 exp->expType->refCount++;
16532 exp->expType->enumName = enumName;
16533 exp->expType->members = symbol->type->members;
16534 for(member = symbol->type->members.first; member; member = member->next)
16535 member->refCount++;
16536 }
16537 else
16538 {
16539 struct __ecereNameSpace__ecere__sys__NamedLink * member;
16540
16541 for(member = symbol->type->members.first; member; member = member->next)
16542 {
16543 struct __ecereNameSpace__ecere__sys__NamedLink * value = (value = __ecereNameSpace__ecere__com__eSystem_New0(structSize_NamedLink), value->name = __ecereNameSpace__ecere__sys__CopyString(member->name), value);
16544
16545 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&exp->expType->members, value);
16546 }
16547 }
16548 }
16549 }
16550 yylloc = exp->loc;
16551 if(exp->destType && (exp->destType->kind == 0 || exp->destType->kind == 18))
16552 ;
16553 else if(exp->destType && !exp->destType->keepCast)
16554 {
16555 if(!CheckExpressionType(exp, exp->destType, 0x0))
16556 {
16557 if(!exp->destType->count || unresolved)
16558 {
16559 if(!exp->expType)
16560 {
16561 yylloc = exp->loc;
16562 if(exp->destType->kind != 14)
16563 {
16564 char type2[1024];
16565
16566 type2[0] = '\0';
16567 if(inCompiler)
16568 {
16569 char expString[10240];
16570
16571 expString[0] = '\0';
16572 PrintType(exp->destType, type2, 0x0, 0x1);
16573 if(inCompiler)
16574 {
16575 PrintExpression(exp, expString);
16576 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
16577 }
16578 if(unresolved)
16579 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved identifier %s; expected %s\n", (((void *)0))), expString, type2);
16580 else if(exp->type != 16)
16581 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s; expected %s\n", (((void *)0))), expString, type2);
16582 }
16583 }
16584 else
16585 {
16586 char expString[10240];
16587
16588 expString[0] = '\0';
16589 if(inCompiler)
16590 {
16591 PrintExpression(exp, expString);
16592 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
16593 }
16594 if(unresolved)
16595 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved identifier %s\n", (((void *)0))), expString);
16596 else if(exp->type != 16)
16597 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s\n", (((void *)0))), expString);
16598 }
16599 }
16600 else
16601 {
16602 char type1[1024];
16603 char type2[1024];
16604
16605 type1[0] = '\0';
16606 type2[0] = '\0';
16607 if(inCompiler)
16608 {
16609 PrintType(exp->expType, type1, 0x0, 0x1);
16610 PrintType(exp->destType, type2, 0x0, 0x1);
16611 }
16612 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)))
16613 ;
16614 else
16615 {
16616 char expString[10240];
16617
16618 expString[0] = '\0';
16619 if(inCompiler)
16620 {
16621 PrintExpression(exp, expString);
16622 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
16623 }
16624 if(!sourceFile || (strcmp(sourceFile, "src\\lexer.ec") && strcmp(sourceFile, "src/lexer.ec") && strcmp(sourceFile, "src\\grammar.ec") && strcmp(sourceFile, "src/grammar.ec")))
16625 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expression %s (%s); expected %s\n", (((void *)0))), expString, type1, type2);
16626 FreeType(exp->expType);
16627 exp->destType->refCount++;
16628 exp->expType = exp->destType;
16629 }
16630 }
16631 }
16632 }
16633 else if(exp->destType && exp->destType->kind == 14 && exp->expType && exp->expType->passAsTemplate)
16634 {
16635 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
16636 char typeString[1024];
16637 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
16638 struct Declarator * decl;
16639
16640 typeString[0] = '\0';
16641 *newExp = *exp;
16642 if(exp->expType)
16643 exp->expType->refCount++;
16644 if(exp->expType)
16645 exp->expType->refCount++;
16646 exp->type = 11;
16647 newExp->destType = exp->expType;
16648 PrintType(exp->expType, typeString, 0x0, 0x0);
16649 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
16650 exp->cast.typeName = MkTypeName(specs, decl);
16651 exp->cast.exp = newExp;
16652 }
16653 }
16654 else if(unresolved)
16655 {
16656 if(exp->identifier->_class && exp->identifier->_class->name)
16657 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved identifier %s::%s\n", (((void *)0))), exp->identifier->_class->name, exp->identifier->string);
16658 else if(exp->identifier->string && exp->identifier->string[0])
16659 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved identifier %s\n", (((void *)0))), exp->identifier->string);
16660 }
16661 else if(!exp->expType && exp->type != 16)
16662 {
16663 char expString[10240];
16664
16665 expString[0] = '\0';
16666 if(inCompiler)
16667 {
16668 PrintExpression(exp, expString);
16669 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
16670 }
16671 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s\n", (((void *)0))), expString);
16672 }
16673 if(inCompiler)
16674 ApplyAnyObjectLogic(exp);
16675 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)))
16676 {
16677 exp->byReference = 0x1;
16678 }
16679 yylloc = oldyylloc;
16680 }
16681
16682 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)
16683 {
16684 if(*curMember)
16685 {
16686 *curMember = (*curMember)->next;
16687 if(subMemberStackPos && *subMemberStackPos > 0 && subMemberStack[*subMemberStackPos - 1]->type == 1)
16688 {
16689 *curMember = subMemberStack[--(*subMemberStackPos)];
16690 *curMember = (*curMember)->next;
16691 }
16692 while((*curMember) && (*curMember)->isProperty)
16693 *curMember = (*curMember)->next;
16694 if(subMemberStackPos)
16695 {
16696 while((*curMember) && !(*curMember)->isProperty && !(*curMember)->name && ((*curMember)->type == 2 || (*curMember)->type == 1))
16697 {
16698 subMemberStack[(*subMemberStackPos)++] = *curMember;
16699 *curMember = (*curMember)->members.first;
16700 while(*curMember && (*curMember)->isProperty)
16701 *curMember = (*curMember)->next;
16702 }
16703 }
16704 }
16705 while(!*curMember)
16706 {
16707 if(!*curMember)
16708 {
16709 if(subMemberStackPos && *subMemberStackPos)
16710 {
16711 *curMember = subMemberStack[--(*subMemberStackPos)];
16712 *curMember = (*curMember)->next;
16713 }
16714 else
16715 {
16716 struct __ecereNameSpace__ecere__com__Class * lastCurClass = *curClass;
16717
16718 if(*curClass == _class)
16719 break;
16720 for(*curClass = _class; (*curClass)->base != lastCurClass && (*curClass)->base->type != 1000; *curClass = (*curClass)->base)
16721 ;
16722 *curMember = (*curClass)->membersAndProperties.first;
16723 }
16724 while((*curMember) && (*curMember)->isProperty)
16725 *curMember = (*curMember)->next;
16726 if(subMemberStackPos)
16727 {
16728 while((*curMember) && !(*curMember)->isProperty && !(*curMember)->name && ((*curMember)->type == 2 || (*curMember)->type == 1))
16729 {
16730 subMemberStack[(*subMemberStackPos)++] = *curMember;
16731 *curMember = (*curMember)->members.first;
16732 while(*curMember && (*curMember)->isProperty)
16733 *curMember = (*curMember)->next;
16734 }
16735 }
16736 }
16737 }
16738 }
16739
16740 static void ProcessInitializer(struct Initializer * init, struct Type * type)
16741 {
16742 switch(init->type)
16743 {
16744 case 0:
16745 if(!init->exp || init->exp->type != 1 || !init->exp->instance || init->exp->instance->_class || !type || type->kind == 8)
16746 {
16747 if(init->exp && !init->exp->destType)
16748 {
16749 FreeType(init->exp->destType);
16750 init->exp->destType = type;
16751 if(type)
16752 type->refCount++;
16753 }
16754 if(init->exp)
16755 {
16756 ProcessExpressionType(init->exp);
16757 init->isConstant = init->exp->isConstant;
16758 }
16759 break;
16760 }
16761 else
16762 {
16763 struct Expression * exp = init->exp;
16764 struct Instantiation * inst = exp->instance;
16765 struct MembersInit * members;
16766
16767 init->type = 1;
16768 init->list = MkList();
16769 if(inst->members)
16770 {
16771 for(members = (*inst->members).first; members; members = members->next)
16772 {
16773 if(members->type == 0)
16774 {
16775 struct MemberInit * member;
16776
16777 for(member = (*members->dataMembers).first; member; member = member->next)
16778 {
16779 ListAdd(init->list, member->initializer);
16780 member->initializer = (((void *)0));
16781 }
16782 }
16783 }
16784 }
16785 FreeExpression(exp);
16786 }
16787 case 1:
16788 {
16789 struct Initializer * i;
16790 struct Type * initializerType = (((void *)0));
16791 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
16792 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
16793 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
16794 int subMemberStackPos = 0;
16795
16796 if(type && type->kind == 12)
16797 initializerType = Dereference(type);
16798 else if(type && (type->kind == 9 || type->kind == 10))
16799 initializerType = type->members.first;
16800 for(i = (*init->list).first; i; i = i->next)
16801 {
16802 if(type && type->kind == 8 && type->_class && type->_class->registered)
16803 {
16804 FindNextDataMember(type->_class->registered, &curClass, &curMember, subMemberStack, &subMemberStackPos);
16805 if(curMember)
16806 {
16807 if(!curMember->dataType)
16808 curMember->dataType = ProcessTypeString(curMember->dataTypeString, 0x0);
16809 initializerType = curMember->dataType;
16810 }
16811 }
16812 ProcessInitializer(i, initializerType);
16813 if(initializerType && type && (type->kind == 9 || type->kind == 10))
16814 initializerType = initializerType->next;
16815 if(!i->isConstant)
16816 init->isConstant = 0x0;
16817 }
16818 if(type && type->kind == 12)
16819 FreeType(initializerType);
16820 if(type && type->kind != 12 && type->kind != 9 && type->kind != 10 && (type->kind != 8 || !type->_class->registered || type->_class->registered->type != 1))
16821 {
16822 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Assigning list initializer to non list\n", (((void *)0))));
16823 }
16824 break;
16825 }
16826 }
16827 }
16828
16829 extern struct Symbol * FindType(struct Context * ctx, char *  name);
16830
16831 static void ProcessClass(struct __ecereNameSpace__ecere__sys__OldList * definitions, struct Symbol * symbol);
16832
16833 static void ProcessSpecifier(struct Specifier * spec, unsigned int declareStruct)
16834 {
16835 switch(spec->type)
16836 {
16837 case 0:
16838 {
16839 if(spec->specifier == THISCLASS)
16840 {
16841 if(thisClass)
16842 {
16843 spec->type = 1;
16844 spec->name = ReplaceThisClass(thisClass);
16845 spec->symbol = FindClass(spec->name);
16846 ProcessSpecifier(spec, declareStruct);
16847 }
16848 }
16849 break;
16850 }
16851 case 1:
16852 {
16853 struct Symbol * symbol = FindType(curContext, spec->name);
16854
16855 if(symbol)
16856 DeclareType(symbol->type, 0x1, 0x1);
16857 else if((symbol = spec->symbol) && symbol->registered && symbol->registered->type == 1 && declareStruct)
16858 DeclareStruct(spec->name, 0x0);
16859 break;
16860 }
16861 case 2:
16862 {
16863 struct Enumerator * e;
16864
16865 if(spec->list)
16866 {
16867 for(e = (*spec->list).first; e; e = e->next)
16868 {
16869 if(e->exp)
16870 ProcessExpressionType(e->exp);
16871 }
16872 }
16873 break;
16874 }
16875 case 3:
16876 case 4:
16877 {
16878 if(spec->definitions)
16879 {
16880 struct ClassDef * def;
16881 struct Symbol * symbol = spec->id ? FindClass(spec->id->string) : (((void *)0));
16882
16883 ProcessClass(spec->definitions, symbol);
16884 }
16885 break;
16886 }
16887 }
16888 }
16889
16890 static void ProcessDeclarator(struct Declarator * decl)
16891 {
16892 switch(decl->type)
16893 {
16894 case 1:
16895 if(decl->identifier->classSym)
16896 {
16897 FreeSpecifier(decl->identifier->_class);
16898 decl->identifier->_class = (((void *)0));
16899 }
16900 break;
16901 case 3:
16902 if(decl->array.exp)
16903 ProcessExpressionType(decl->array.exp);
16904 case 0:
16905 case 2:
16906 case 4:
16907 case 5:
16908 case 6:
16909 case 7:
16910 if(decl->declarator)
16911 ProcessDeclarator(decl->declarator);
16912 if(decl->type == 4)
16913 {
16914 struct Identifier * id = GetDeclId(decl);
16915
16916 if(id && id->_class)
16917 {
16918 struct TypeName * param = (param = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TypeName), param->qualifiers = MkListOne(id->_class), param->declarator = (((void *)0)), param);
16919
16920 if(!decl->function.parameters)
16921 decl->function.parameters = MkList();
16922 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*decl->function.parameters), (((void *)0)), param);
16923 id->_class = (((void *)0));
16924 }
16925 if(decl->function.parameters)
16926 {
16927 struct TypeName * param;
16928
16929 for(param = (*decl->function.parameters).first; param; param = param->next)
16930 {
16931 if(param->qualifiers && (*param->qualifiers).first)
16932 {
16933 struct Specifier * spec = (*param->qualifiers).first;
16934
16935 if(spec && spec->specifier == TYPED_OBJECT)
16936 {
16937 struct Declarator * d = param->declarator;
16938 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);
16939
16940 FreeList(param->qualifiers, FreeSpecifier);
16941 param->qualifiers = MkListOne(MkStructOrUnion(3, MkIdentifier("__ecereNameSpace__ecere__com__Class"), (((void *)0))));
16942 param->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier("class")));
16943 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*decl->function.parameters), param, newParam);
16944 param = newParam;
16945 }
16946 else if(spec && spec->specifier == ANY_OBJECT)
16947 {
16948 struct Declarator * d = param->declarator;
16949
16950 FreeList(param->qualifiers, FreeSpecifier);
16951 param->qualifiers = MkListOne(MkSpecifier(VOID));
16952 param->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d);
16953 }
16954 else if(spec->specifier == THISCLASS)
16955 {
16956 if(thisClass)
16957 {
16958 spec->type = 1;
16959 spec->name = ReplaceThisClass(thisClass);
16960 spec->symbol = FindClass(spec->name);
16961 ProcessSpecifier(spec, 0x0);
16962 }
16963 }
16964 }
16965 if(param->declarator)
16966 ProcessDeclarator(param->declarator);
16967 }
16968 }
16969 }
16970 break;
16971 }
16972 }
16973
16974 extern struct Identifier * CopyIdentifier(struct Identifier * id);
16975
16976 extern void FreeInitDeclarator(struct InitDeclarator * decl);
16977
16978 static void ProcessDeclaration(struct Declaration * decl)
16979 {
16980 yylloc = decl->loc;
16981 switch(decl->type)
16982 {
16983 case 1:
16984 {
16985 unsigned int declareStruct = 0x0;
16986
16987 if(decl->declarators)
16988 {
16989 struct InitDeclarator * d;
16990
16991 for(d = (*decl->declarators).first; d; d = d->next)
16992 {
16993 struct Type * type, * subType;
16994
16995 ProcessDeclarator(d->declarator);
16996 type = ProcessType(decl->specifiers, d->declarator);
16997 if(d->initializer)
16998 {
16999 ProcessInitializer(d->initializer, type);
17000 if((*decl->declarators).count == 1 && d->initializer->type == 0 && d->initializer->exp->type == 1)
17001 {
17002 if(type->kind == 8 && type->_class == d->initializer->exp->expType->_class)
17003 {
17004 struct Instantiation * inst = d->initializer->exp->instance;
17005
17006 inst->exp = MkExpIdentifier(CopyIdentifier(GetDeclId(d->declarator)));
17007 d->initializer->exp->instance = (((void *)0));
17008 if(decl->specifiers)
17009 FreeList(decl->specifiers, FreeSpecifier);
17010 FreeList(decl->declarators, FreeInitDeclarator);
17011 d = (((void *)0));
17012 decl->type = 2;
17013 decl->inst = inst;
17014 }
17015 }
17016 }
17017 for(subType = type; subType; )
17018 {
17019 if(subType->kind == 8)
17020 {
17021 declareStruct = 0x1;
17022 break;
17023 }
17024 else if(subType->kind == 13)
17025 break;
17026 else if(subType->kind == 12)
17027 subType = subType->arrayType;
17028 else
17029 break;
17030 }
17031 FreeType(type);
17032 if(!d)
17033 break;
17034 }
17035 }
17036 if(decl->specifiers)
17037 {
17038 struct Specifier * s;
17039
17040 for(s = (*decl->specifiers).first; s; s = s->next)
17041 {
17042 ProcessSpecifier(s, declareStruct);
17043 }
17044 }
17045 break;
17046 }
17047 case 2:
17048 {
17049 ProcessInstantiationType(decl->inst);
17050 break;
17051 }
17052 case 0:
17053 {
17054 struct Specifier * spec;
17055 struct Declarator * d;
17056 unsigned int declareStruct = 0x0;
17057
17058 if(decl->declarators)
17059 {
17060 for(d = (*decl->declarators).first; d; d = d->next)
17061 {
17062 struct Type * type = ProcessType(decl->specifiers, d->declarator);
17063 struct Type * subType;
17064
17065 ProcessDeclarator(d);
17066 for(subType = type; subType; )
17067 {
17068 if(subType->kind == 8)
17069 {
17070 declareStruct = 0x1;
17071 break;
17072 }
17073 else if(subType->kind == 13)
17074 break;
17075 else if(subType->kind == 12)
17076 subType = subType->arrayType;
17077 else
17078 break;
17079 }
17080 FreeType(type);
17081 }
17082 }
17083 if(decl->specifiers)
17084 {
17085 for(spec = (*decl->specifiers).first; spec; spec = spec->next)
17086 ProcessSpecifier(spec, declareStruct);
17087 }
17088 break;
17089 }
17090 }
17091 }
17092
17093 static struct FunctionDefinition * curFunction;
17094
17095 static void CreateFireWatcher(struct __ecereNameSpace__ecere__com__Property * prop, struct Expression * object, struct Statement * stmt)
17096 {
17097 char propName[1024], propNameM[1024];
17098 char getName[1024], setName[1024];
17099 struct __ecereNameSpace__ecere__sys__OldList * args;
17100
17101 DeclareProperty(prop, setName, getName);
17102 strcpy(propName, "__ecereProp_");
17103 FullClassNameCat(propName, prop->_class->fullName, 0x0);
17104 strcat(propName, "_");
17105 FullClassNameCat(propName, prop->name, 0x1);
17106 MangleClassName(propName);
17107 strcpy(propNameM, "__ecerePropM_");
17108 FullClassNameCat(propNameM, prop->_class->fullName, 0x0);
17109 strcat(propNameM, "_");
17110 FullClassNameCat(propNameM, prop->name, 0x1);
17111 MangleClassName(propNameM);
17112 if(prop->isWatchable)
17113 {
17114 args = MkList();
17115 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
17116 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
17117 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireWatchers")), args));
17118 args = MkList();
17119 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
17120 ListAdd(args, MkExpIdentifier(MkIdentifier(propNameM)));
17121 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireWatchers")), args));
17122 }
17123 {
17124 args = MkList();
17125 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
17126 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
17127 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireSelfWatchers")), args));
17128 args = MkList();
17129 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
17130 ListAdd(args, MkExpIdentifier(MkIdentifier(propNameM)));
17131 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireSelfWatchers")), args));
17132 }
17133 if(curFunction->propSet && !strcmp(curFunction->propSet->string, prop->name) && (!object || (object->type == 0 && !strcmp(object->identifier->string, "this"))))
17134 curFunction->propSet->fireWatchersDone = 0x1;
17135 }
17136
17137 extern struct Declaration * MkDeclarationInst(struct Instantiation * inst);
17138
17139 extern struct Instantiation * MkInstantiationNamed(struct __ecereNameSpace__ecere__sys__OldList * specs, struct Expression * exp, struct __ecereNameSpace__ecere__sys__OldList * members);
17140
17141 extern struct Statement * MkIfStmt(struct __ecereNameSpace__ecere__sys__OldList * exp, struct Statement * statement, struct Statement * elseStmt);
17142
17143 extern struct Statement * MkForStmt(struct Statement * init, struct Statement * check, struct __ecereNameSpace__ecere__sys__OldList * inc, struct Statement * statement);
17144
17145 extern struct Statement * MkWhileStmt(struct __ecereNameSpace__ecere__sys__OldList * exp, struct Statement * statement);
17146
17147 extern struct ClassFunction * MkClassFunction(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct Specifier * _class, struct Declarator * decl, struct __ecereNameSpace__ecere__sys__OldList * declList);
17148
17149 extern void ProcessClassFunctionBody(struct ClassFunction * func, struct Statement * body);
17150
17151 extern void FreePropertyWatch(struct PropertyWatch * watcher);
17152
17153 static void ProcessStatement(struct Statement * stmt)
17154 {
17155 yylloc = stmt->loc;
17156 switch(stmt->type)
17157 {
17158 case 0:
17159 ProcessStatement(stmt->labeled.stmt);
17160 break;
17161 case 1:
17162 if(stmt->caseStmt.exp)
17163 {
17164 FreeType(stmt->caseStmt.exp->destType);
17165 stmt->caseStmt.exp->destType = curSwitchType;
17166 if(curSwitchType)
17167 curSwitchType->refCount++;
17168 ProcessExpressionType(stmt->caseStmt.exp);
17169 ComputeExpression(stmt->caseStmt.exp);
17170 }
17171 if(stmt->caseStmt.stmt)
17172 ProcessStatement(stmt->caseStmt.stmt);
17173 break;
17174 case 2:
17175 {
17176 if(stmt->compound.context)
17177 {
17178 struct Declaration * decl;
17179 struct Statement * s;
17180 struct Statement * prevCompound = curCompound;
17181 struct Context * prevContext = curContext;
17182
17183 if(!stmt->compound.isSwitch)
17184 curCompound = stmt;
17185 curContext = stmt->compound.context;
17186 if(stmt->compound.declarations)
17187 {
17188 for(decl = (*stmt->compound.declarations).first; decl; decl = decl->next)
17189 ProcessDeclaration(decl);
17190 }
17191 if(stmt->compound.statements)
17192 {
17193 for(s = (*stmt->compound.statements).first; s; s = s->next)
17194 ProcessStatement(s);
17195 }
17196 curContext = prevContext;
17197 curCompound = prevCompound;
17198 }
17199 break;
17200 }
17201 case 3:
17202 {
17203 struct Expression * exp;
17204
17205 if(stmt->expressions)
17206 {
17207 for(exp = (*stmt->expressions).first; exp; exp = exp->next)
17208 ProcessExpressionType(exp);
17209 }
17210 break;
17211 }
17212 case 4:
17213 {
17214 struct Expression * exp;
17215
17216 FreeType(((struct Expression *)(*stmt->ifStmt.exp).last)->destType);
17217 ((struct Expression *)(*stmt->ifStmt.exp).last)->destType = MkClassType("bool");
17218 ((struct Expression *)(*stmt->ifStmt.exp).last)->destType->truth = 0x1;
17219 for(exp = (*stmt->ifStmt.exp).first; exp; exp = exp->next)
17220 {
17221 ProcessExpressionType(exp);
17222 }
17223 if(stmt->ifStmt.stmt)
17224 ProcessStatement(stmt->ifStmt.stmt);
17225 if(stmt->ifStmt.elseStmt)
17226 ProcessStatement(stmt->ifStmt.elseStmt);
17227 break;
17228 }
17229 case 5:
17230 {
17231 struct Type * oldSwitchType = curSwitchType;
17232
17233 if(stmt->switchStmt.exp)
17234 {
17235 struct Expression * exp;
17236
17237 for(exp = (*stmt->switchStmt.exp).first; exp; exp = exp->next)
17238 {
17239 if(!exp->next)
17240 {
17241 ProcessExpressionType(exp);
17242 }
17243 if(!exp->next)
17244 curSwitchType = exp->expType;
17245 }
17246 }
17247 ProcessStatement(stmt->switchStmt.stmt);
17248 curSwitchType = oldSwitchType;
17249 break;
17250 }
17251 case 6:
17252 {
17253 if(stmt->whileStmt.exp)
17254 {
17255 struct Expression * exp;
17256
17257 FreeType(((struct Expression *)(*stmt->whileStmt.exp).last)->destType);
17258 ((struct Expression *)(*stmt->whileStmt.exp).last)->destType = MkClassType("bool");
17259 ((struct Expression *)(*stmt->whileStmt.exp).last)->destType->truth = 0x1;
17260 for(exp = (*stmt->whileStmt.exp).first; exp; exp = exp->next)
17261 {
17262 ProcessExpressionType(exp);
17263 }
17264 }
17265 if(stmt->whileStmt.stmt)
17266 ProcessStatement(stmt->whileStmt.stmt);
17267 break;
17268 }
17269 case 7:
17270 {
17271 if(stmt->doWhile.exp)
17272 {
17273 struct Expression * exp;
17274
17275 if((*stmt->doWhile.exp).last)
17276 {
17277 FreeType(((struct Expression *)(*stmt->doWhile.exp).last)->destType);
17278 ((struct Expression *)(*stmt->doWhile.exp).last)->destType = MkClassType("bool");
17279 ((struct Expression *)(*stmt->doWhile.exp).last)->destType->truth = 0x1;
17280 }
17281 for(exp = (*stmt->doWhile.exp).first; exp; exp = exp->next)
17282 {
17283 ProcessExpressionType(exp);
17284 }
17285 }
17286 if(stmt->doWhile.stmt)
17287 ProcessStatement(stmt->doWhile.stmt);
17288 break;
17289 }
17290 case 8:
17291 {
17292 struct Expression * exp;
17293
17294 if(stmt->forStmt.init)
17295 ProcessStatement(stmt->forStmt.init);
17296 if(stmt->forStmt.check && stmt->forStmt.check->expressions)
17297 {
17298 FreeType(((struct Expression *)(*stmt->forStmt.check->expressions).last)->destType);
17299 ((struct Expression *)(*stmt->forStmt.check->expressions).last)->destType = MkClassType("bool");
17300 ((struct Expression *)(*stmt->forStmt.check->expressions).last)->destType->truth = 0x1;
17301 }
17302 if(stmt->forStmt.check)
17303 ProcessStatement(stmt->forStmt.check);
17304 if(stmt->forStmt.increment)
17305 {
17306 for(exp = (*stmt->forStmt.increment).first; exp; exp = exp->next)
17307 ProcessExpressionType(exp);
17308 }
17309 if(stmt->forStmt.stmt)
17310 ProcessStatement(stmt->forStmt.stmt);
17311 break;
17312 }
17313 case 18:
17314 {
17315 struct Identifier * id = stmt->forEachStmt.id;
17316 struct __ecereNameSpace__ecere__sys__OldList * exp = stmt->forEachStmt.exp;
17317 struct __ecereNameSpace__ecere__sys__OldList * filter = stmt->forEachStmt.filter;
17318 struct Statement * block = stmt->forEachStmt.stmt;
17319 char iteratorType[1024];
17320 struct Type * source;
17321 struct Expression * e;
17322 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));
17323 struct Expression * arrayExp;
17324 char * typeString = (((void *)0));
17325 int builtinCount = 0;
17326
17327 for(e = exp ? (*exp).first : (((void *)0)); e; e = e->next)
17328 {
17329 if(!e->next)
17330 {
17331 FreeType(e->destType);
17332 e->destType = ProcessTypeString("Container", 0x0);
17333 }
17334 if(!isBuiltin || e->next)
17335 ProcessExpressionType(e);
17336 }
17337 source = (exp && (*exp).last) ? ((struct Expression *)(*exp).last)->expType : (((void *)0));
17338 if(isBuiltin || (source && source->kind == 8 && source->_class && source->_class->registered && source->_class->registered != containerClass && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, containerClass)))
17339 {
17340 struct __ecereNameSpace__ecere__com__Class * _class = source ? source->_class->registered : (((void *)0));
17341 struct Symbol * symbol;
17342 struct Expression * expIt = (((void *)0));
17343 unsigned int isMap = 0x0, isArray = 0x0, isLinkList = 0x0, isList = 0x0, isCustomAVLTree = 0x0, isAVLTree = 0x0;
17344 struct __ecereNameSpace__ecere__com__Class * arrayClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "Array");
17345 struct __ecereNameSpace__ecere__com__Class * linkListClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "LinkList");
17346 struct __ecereNameSpace__ecere__com__Class * customAVLTreeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "CustomAVLTree");
17347
17348 stmt->type = 2;
17349 stmt->compound.context = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Context);
17350 stmt->compound.context->parent = curContext;
17351 curContext = stmt->compound.context;
17352 if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, customAVLTreeClass))
17353 {
17354 struct __ecereNameSpace__ecere__com__Class * mapClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "Map");
17355 struct __ecereNameSpace__ecere__com__Class * avlTreeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "AVLTree");
17356
17357 isCustomAVLTree = 0x1;
17358 if(__ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, avlTreeClass))
17359 isAVLTree = 0x1;
17360 else if(__ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, mapClass))
17361 isMap = 0x1;
17362 }
17363 else if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, arrayClass))
17364 isArray = 0x1;
17365 else if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, linkListClass))
17366 {
17367 struct __ecereNameSpace__ecere__com__Class * listClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "List");
17368
17369 isLinkList = 0x1;
17370 isList = __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, listClass);
17371 }
17372 if(isArray)
17373 {
17374 struct Declarator * decl;
17375 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
17376
17377 decl = SpecDeclFromString(_class->templateArgs[2].dataTypeString, specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(id)));
17378 stmt->compound.declarations = MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(decl, (((void *)0))))));
17379 ListAdd(stmt->compound.declarations, MkDeclaration(MkListOne(MkSpecifierName(source->_class->registered->fullName)), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internalArray")), MkInitializerAssignment(MkExpBrackets(exp))))));
17380 }
17381 else if(isBuiltin)
17382 {
17383 struct Type * type = (((void *)0));
17384 char typeStringBuf[1024];
17385
17386 arrayExp = (((struct Expression *)(*exp).last)->type == 35) ? (struct Expression *)(*exp).last : ((struct Expression *)(*exp).last)->cast.exp;
17387 if(((struct Expression *)(*exp).last)->type == 11)
17388 {
17389 struct TypeName * typeName = ((struct Expression *)(*exp).last)->cast.typeName;
17390
17391 if(typeName)
17392 arrayExp->destType = ProcessType(typeName->qualifiers, typeName->declarator);
17393 }
17394 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)
17395 {
17396 struct __ecereNameSpace__ecere__com__Class * templateClass = arrayExp->destType->_class->registered;
17397
17398 typeString = templateClass->templateArgs[2].dataTypeString;
17399 }
17400 else if(arrayExp->list)
17401 {
17402 struct Expression * e;
17403
17404 for(e = (*arrayExp->list).first; e; e = e->next)
17405 {
17406 ProcessExpressionType(e);
17407 if(e->expType)
17408 {
17409 if(!type)
17410 {
17411 type = e->expType;
17412 type->refCount++;
17413 }
17414 else
17415 {
17416 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
17417 {
17418 FreeType(type);
17419 type = e->expType;
17420 e->expType = (((void *)0));
17421 e = (*arrayExp->list).first;
17422 ProcessExpressionType(e);
17423 if(e->expType)
17424 {
17425 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
17426 {
17427 FreeType(e->expType);
17428 e->expType = (((void *)0));
17429 FreeType(type);
17430 type = (((void *)0));
17431 break;
17432 }
17433 }
17434 }
17435 }
17436 if(e->expType)
17437 {
17438 FreeType(e->expType);
17439 e->expType = (((void *)0));
17440 }
17441 }
17442 }
17443 if(type)
17444 {
17445 typeStringBuf[0] = '\0';
17446 PrintType(type, typeStringBuf, 0x0, 0x1);
17447 typeString = typeStringBuf;
17448 FreeType(type);
17449 }
17450 }
17451 if(typeString)
17452 {
17453 struct __ecereNameSpace__ecere__sys__OldList * initializers = MkList();
17454 struct Declarator * decl;
17455 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
17456
17457 if(arrayExp->list)
17458 {
17459 struct Expression * e;
17460
17461 builtinCount = (*arrayExp->list).count;
17462 type = ProcessTypeString(typeString, 0x0);
17463 while(e = (*arrayExp->list).first)
17464 {
17465 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*arrayExp->list), e);
17466 e->destType = type;
17467 type->refCount++;
17468 ProcessExpressionType(e);
17469 ListAdd(initializers, MkInitializerAssignment(e));
17470 }
17471 FreeType(type);
17472 (__ecereNameSpace__ecere__com__eSystem_Delete(arrayExp->list), arrayExp->list = 0);
17473 }
17474 decl = SpecDeclFromString(typeString, specs, MkDeclaratorIdentifier(id));
17475 stmt->compound.declarations = MkListOne(MkDeclaration(CopyList(specs, CopySpecifier), MkListOne(MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl), (((void *)0))))));
17476 ListAdd(stmt->compound.declarations, MkDeclaration(specs, MkListOne(MkInitDeclarator(PlugDeclarator(decl, MkDeclaratorArray(MkDeclaratorIdentifier(MkIdentifier("__internalArray")), (((void *)0)))), MkInitializerList(initializers)))));
17477 FreeList(exp, FreeExpression);
17478 }
17479 else
17480 {
17481 arrayExp->expType = ProcessTypeString("Container", 0x0);
17482 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Couldn't determine type of array elements\n", (((void *)0))));
17483 }
17484 }
17485 else if(isLinkList && !isList)
17486 {
17487 struct Declarator * decl;
17488 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
17489
17490 decl = SpecDeclFromString(_class->templateArgs[3].dataTypeString, specs, MkDeclaratorIdentifier(id));
17491 stmt->compound.declarations = MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(decl, (((void *)0))))));
17492 ListAdd(stmt->compound.declarations, MkDeclaration(MkListOne(MkSpecifierName(source->_class->registered->fullName)), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internalLinkList")), MkInitializerAssignment(MkExpBrackets(exp))))));
17493 }
17494 else if(_class->templateArgs)
17495 {
17496 if(isMap)
17497 sprintf(iteratorType, "MapIterator<%s, %s >", _class->templateArgs[5].dataTypeString, _class->templateArgs[6].dataTypeString);
17498 else
17499 sprintf(iteratorType, "Iterator<%s, %s >", _class->templateArgs[2].dataTypeString, _class->templateArgs[1].dataTypeString);
17500 stmt->compound.declarations = MkListOne(MkDeclarationInst(MkInstantiationNamed(MkListOne(MkSpecifierName(iteratorType)), MkExpIdentifier(id), MkListOne(MkMembersInitList(MkListOne(MkMemberInit(isMap ? MkListOne(MkIdentifier("map")) : (((void *)0)), MkInitializerAssignment(MkExpBrackets(exp)))))))));
17501 }
17502 symbol = FindSymbol(id->string, curContext, curContext, 0x0, 0x0);
17503 if(block)
17504 {
17505 switch(block->type)
17506 {
17507 case 2:
17508 if(block->compound.context)
17509 block->compound.context->parent = stmt->compound.context;
17510 break;
17511 case 4:
17512 if(block->ifStmt.stmt && block->ifStmt.stmt->type == 2 && block->ifStmt.stmt->compound.context)
17513 block->ifStmt.stmt->compound.context->parent = stmt->compound.context;
17514 if(block->ifStmt.elseStmt && block->ifStmt.elseStmt->type == 2 && block->ifStmt.elseStmt->compound.context)
17515 block->ifStmt.elseStmt->compound.context->parent = stmt->compound.context;
17516 break;
17517 case 5:
17518 if(block->switchStmt.stmt && block->switchStmt.stmt->type == 2 && block->switchStmt.stmt->compound.context)
17519 block->switchStmt.stmt->compound.context->parent = stmt->compound.context;
17520 break;
17521 case 6:
17522 if(block->whileStmt.stmt && block->whileStmt.stmt->type == 2 && block->whileStmt.stmt->compound.context)
17523 block->whileStmt.stmt->compound.context->parent = stmt->compound.context;
17524 break;
17525 case 7:
17526 if(block->doWhile.stmt && block->doWhile.stmt->type == 2 && block->doWhile.stmt->compound.context)
17527 block->doWhile.stmt->compound.context->parent = stmt->compound.context;
17528 break;
17529 case 8:
17530 if(block->forStmt.stmt && block->forStmt.stmt->type == 2 && block->forStmt.stmt->compound.context)
17531 block->forStmt.stmt->compound.context->parent = stmt->compound.context;
17532 break;
17533 case 18:
17534 if(block->forEachStmt.stmt && block->forEachStmt.stmt->type == 2 && block->forEachStmt.stmt->compound.context)
17535 block->forEachStmt.stmt->compound.context->parent = stmt->compound.context;
17536 break;
17537 }
17538 }
17539 if(filter)
17540 {
17541 block = MkIfStmt(filter, block, (((void *)0)));
17542 }
17543 if(isArray)
17544 {
17545 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));
17546 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.init);
17547 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.check);
17548 ProcessExpressionType((*((struct Statement *)(*stmt->compound.statements).first)->forStmt.increment).first);
17549 }
17550 else if(isBuiltin)
17551 {
17552 char count[128];
17553
17554 sprintf(count, "%d", builtinCount);
17555 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));
17556 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.init);
17557 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.check);
17558 ProcessExpressionType((*((struct Statement *)(*stmt->compound.statements).first)->forStmt.increment).first);
17559 }
17560 else if(isLinkList && !isList)
17561 {
17562 struct __ecereNameSpace__ecere__com__Class * typeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, _class->templateArgs[3].dataTypeString);
17563 struct __ecereNameSpace__ecere__com__Class * listItemClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, "ListItem");
17564
17565 if(typeClass && __ecereNameSpace__ecere__com__eClass_IsDerived(typeClass, listItemClass) && _class->templateArgs[5].dataTypeString && !strcmp(_class->templateArgs[5].dataTypeString, "LT::link"))
17566 {
17567 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));
17568 }
17569 else
17570 {
17571 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
17572 struct Declarator * decl = SpecDeclFromString(_class->templateArgs[3].dataTypeString, specs, (((void *)0)));
17573
17574 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));
17575 }
17576 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.init);
17577 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.check);
17578 ProcessExpressionType((*((struct Statement *)(*stmt->compound.statements).first)->forStmt.increment).first);
17579 }
17580 else
17581 {
17582 stmt->compound.statements = MkListOne(MkWhileStmt(MkListOne(MkExpCall(MkExpMember(expIt = MkExpIdentifier(CopyIdentifier(id)), MkIdentifier("Next")), (((void *)0)))), block));
17583 }
17584 ProcessExpressionType(expIt);
17585 if((*stmt->compound.declarations).first)
17586 ProcessDeclaration((*stmt->compound.declarations).first);
17587 if(symbol)
17588 symbol->isIterator = isMap ? 2 : ((isArray || isBuiltin) ? 3 : (isLinkList ? (isList ? 5 : 4) : (isCustomAVLTree ? 6 : 1)));
17589 ProcessStatement(stmt);
17590 curContext = stmt->compound.context->parent;
17591 break;
17592 }
17593 else
17594 {
17595 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Expression is not a container\n", (((void *)0))));
17596 }
17597 break;
17598 }
17599 case 9:
17600 break;
17601 case 10:
17602 break;
17603 case 11:
17604 break;
17605 case 12:
17606 {
17607 struct Expression * exp;
17608
17609 if(stmt->expressions)
17610 {
17611 for(exp = (*stmt->expressions).first; exp; exp = exp->next)
17612 {
17613 if(!exp->next)
17614 {
17615 if(curFunction && !curFunction->type)
17616 curFunction->type = ProcessType(curFunction->specifiers, curFunction->declarator);
17617 FreeType(exp->destType);
17618 exp->destType = (curFunction && curFunction->type && curFunction->type->kind == 11) ? curFunction->type->returnType : (((void *)0));
17619 if(exp->destType)
17620 exp->destType->refCount++;
17621 }
17622 ProcessExpressionType(exp);
17623 }
17624 }
17625 break;
17626 }
17627 case 14:
17628 {
17629 ProcessDeclaration(stmt->decl);
17630 break;
17631 }
17632 case 13:
17633 {
17634 struct AsmField * field;
17635
17636 if(stmt->asmStmt.inputFields)
17637 {
17638 for(field = (*stmt->asmStmt.inputFields).first; field; field = field->next)
17639 if(field->expression)
17640 ProcessExpressionType(field->expression);
17641 }
17642 if(stmt->asmStmt.outputFields)
17643 {
17644 for(field = (*stmt->asmStmt.outputFields).first; field; field = field->next)
17645 if(field->expression)
17646 ProcessExpressionType(field->expression);
17647 }
17648 if(stmt->asmStmt.clobberedFields)
17649 {
17650 for(field = (*stmt->asmStmt.clobberedFields).first; field; field = field->next)
17651 {
17652 if(field->expression)
17653 ProcessExpressionType(field->expression);
17654 }
17655 }
17656 break;
17657 }
17658 case 17:
17659 {
17660 struct PropertyWatch * propWatch;
17661 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->_watch.watches;
17662 struct Expression * object = stmt->_watch.object;
17663 struct Expression * watcher = stmt->_watch.watcher;
17664
17665 if(watcher)
17666 ProcessExpressionType(watcher);
17667 if(object)
17668 ProcessExpressionType(object);
17669 if(inCompiler)
17670 {
17671 if(watcher || thisClass)
17672 {
17673 struct External * external = curExternal;
17674 struct Context * context = curContext;
17675
17676 stmt->type = 3;
17677 stmt->expressions = MkList();
17678 curExternal = external->prev;
17679 for(propWatch = (*watches).first; propWatch; propWatch = propWatch->next)
17680 {
17681 struct ClassFunction * func;
17682 char watcherName[1024];
17683 struct __ecereNameSpace__ecere__com__Class * watcherClass = watcher ? ((watcher->expType && watcher->expType->kind == 8 && watcher->expType->_class) ? watcher->expType->_class->registered : (((void *)0))) : thisClass;
17684 struct External * createdExternal;
17685 struct External * externalDecl = MkExternalDeclaration((((void *)0)));
17686
17687 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, externalDecl);
17688 sprintf(watcherName, "__ecerePropertyWatcher_%d", propWatcherID++);
17689 if(propWatch->deleteWatch)
17690 strcat(watcherName, "_delete");
17691 else
17692 {
17693 struct Identifier * propID;
17694
17695 for(propID = (*propWatch->properties).first; propID; propID = propID->next)
17696 {
17697 strcat(watcherName, "_");
17698 strcat(watcherName, propID->string);
17699 }
17700 }
17701 if(object && object->expType && object->expType->kind == 8 && object->expType->_class && object->expType->_class->registered)
17702 {
17703 func = MkClassFunction(MkListOne(MkSpecifier(VOID)), (((void *)0)), MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(watcherName)), MkListOne(MkTypeName(MkListOne(MkSpecifierName(object->expType->_class->string)), MkDeclaratorIdentifier(MkIdentifier("value"))))), (((void *)0)));
17704 ProcessClassFunctionBody(func, propWatch->compound);
17705 propWatch->compound = (((void *)0));
17706 createdExternal = ProcessClassFunction(watcherClass, func, ast, curExternal, 0x1);
17707 createdExternal->symbol->idCode = external->symbol->idCode;
17708 curExternal = createdExternal;
17709 ProcessFunction(createdExternal->function);
17710 {
17711 struct Declaration * decl = MkDeclaration(CopyList(createdExternal->function->specifiers, CopySpecifier), MkListOne(MkInitDeclarator(CopyDeclarator(createdExternal->function->declarator), (((void *)0)))));
17712
17713 externalDecl->declaration = decl;
17714 if(decl->symbol && !decl->symbol->pointerExternal)
17715 decl->symbol->pointerExternal = externalDecl;
17716 }
17717 if(propWatch->deleteWatch)
17718 {
17719 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
17720
17721 ListAdd(args, CopyExpression(object));
17722 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
17723 ListAdd(args, MkExpIdentifier(MkIdentifier(watcherName)));
17724 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_WatchDestruction")), args));
17725 }
17726 else
17727 {
17728 struct __ecereNameSpace__ecere__com__Class * _class = object->expType->_class->registered;
17729 struct Identifier * propID;
17730
17731 for(propID = (*propWatch->properties).first; propID; propID = propID->next)
17732 {
17733 char propName[1024];
17734 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
17735
17736 if(prop)
17737 {
17738 char getName[1024], setName[1024];
17739 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
17740
17741 DeclareProperty(prop, setName, getName);
17742 strcpy(propName, "__ecereProp_");
17743 FullClassNameCat(propName, prop->_class->fullName, 0x0);
17744 strcat(propName, "_");
17745 FullClassNameCat(propName, prop->name, 0x1);
17746 ListAdd(args, CopyExpression(object));
17747 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
17748 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
17749 ListAdd(args, MkExpIdentifier(MkIdentifier(watcherName)));
17750 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_Watch")), args));
17751 }
17752 else
17753 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Property %s not found in class %s\n", (((void *)0))), prop->name, _class->fullName);
17754 }
17755 }
17756 }
17757 else
17758 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Invalid watched object\n", (((void *)0))));
17759 }
17760 curExternal = external;
17761 curContext = context;
17762 if(watcher)
17763 FreeExpression(watcher);
17764 if(object)
17765 FreeExpression(object);
17766 FreeList(watches, FreePropertyWatch);
17767 }
17768 else
17769 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "No observer specified and not inside a _class\n", (((void *)0))));
17770 }
17771 else
17772 {
17773 for(propWatch = (*watches).first; propWatch; propWatch = propWatch->next)
17774 {
17775 ProcessStatement(propWatch->compound);
17776 }
17777 }
17778 break;
17779 }
17780 case 15:
17781 {
17782 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->_watch.watches;
17783 struct Expression * object = stmt->_watch.object;
17784 struct __ecereNameSpace__ecere__com__Class * _class;
17785
17786 if(object)
17787 ProcessExpressionType(object);
17788 if(inCompiler)
17789 {
17790 _class = object ? ((object->expType && object->expType->kind == 8 && object->expType->_class) ? object->expType->_class->registered : (((void *)0))) : thisClass;
17791 if(_class)
17792 {
17793 struct Identifier * propID;
17794
17795 stmt->type = 3;
17796 stmt->expressions = MkList();
17797 if(!watches && curFunction->propSet && (!object || (object->type == 0 && !strcmp(object->identifier->string, "this"))))
17798 {
17799 watches = MkListOne(MkIdentifier(curFunction->propSet->string));
17800 }
17801 else if(!watches)
17802 {
17803 }
17804 if(watches)
17805 {
17806 for(propID = (*watches).first; propID; propID = propID->next)
17807 {
17808 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
17809
17810 if(prop)
17811 {
17812 CreateFireWatcher(prop, object, stmt);
17813 }
17814 else
17815 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Property %s not found in class %s\n", (((void *)0))), propID->string, _class->fullName);
17816 }
17817 }
17818 else
17819 {
17820 struct __ecereNameSpace__ecere__com__Property * prop;
17821 struct __ecereNameSpace__ecere__com__Class * base;
17822
17823 for(base = _class; base; base = base->base)
17824 {
17825 for(prop = base->membersAndProperties.first; prop; prop = prop->next)
17826 {
17827 if(prop->isProperty && prop->isWatchable)
17828 {
17829 CreateFireWatcher(prop, object, stmt);
17830 }
17831 }
17832 }
17833 }
17834 if(object)
17835 FreeExpression(object);
17836 FreeList(watches, FreeIdentifier);
17837 }
17838 else
17839 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Invalid object specified and not inside a class\n", (((void *)0))));
17840 }
17841 break;
17842 }
17843 case 16:
17844 {
17845 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->_watch.watches;
17846 struct Expression * object = stmt->_watch.object;
17847 struct Expression * watcher = stmt->_watch.watcher;
17848 struct __ecereNameSpace__ecere__com__Class * _class;
17849
17850 if(object)
17851 ProcessExpressionType(object);
17852 if(watcher)
17853 ProcessExpressionType(watcher);
17854 if(inCompiler)
17855 {
17856 _class = (object && object->expType && object->expType->kind == 8 && object->expType->_class) ? object->expType->_class->registered : (((void *)0));
17857 if(watcher || thisClass)
17858 {
17859 if(_class)
17860 {
17861 struct Identifier * propID;
17862
17863 stmt->type = 3;
17864 stmt->expressions = MkList();
17865 if(!watches)
17866 {
17867 struct __ecereNameSpace__ecere__sys__OldList * args;
17868
17869 args = MkList();
17870 ListAdd(args, CopyExpression(object));
17871 ListAdd(args, MkExpConstant("0"));
17872 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
17873 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_StopWatching")), args));
17874 }
17875 else
17876 {
17877 for(propID = (*watches).first; propID; propID = propID->next)
17878 {
17879 char propName[1024];
17880 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
17881
17882 if(prop)
17883 {
17884 char getName[1024], setName[1024];
17885 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
17886
17887 DeclareProperty(prop, setName, getName);
17888 strcpy(propName, "__ecereProp_");
17889 FullClassNameCat(propName, prop->_class->fullName, 0x0);
17890 strcat(propName, "_");
17891 FullClassNameCat(propName, prop->name, 0x1);
17892 MangleClassName(propName);
17893 ListAdd(args, CopyExpression(object));
17894 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
17895 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
17896 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_StopWatching")), args));
17897 }
17898 else
17899 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Property %s not found in class %s\n", (((void *)0))), prop->name, _class->fullName);
17900 }
17901 }
17902 if(object)
17903 FreeExpression(object);
17904 if(watcher)
17905 FreeExpression(watcher);
17906 FreeList(watches, FreeIdentifier);
17907 }
17908 else
17909 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Invalid object specified and not inside a class\n", (((void *)0))));
17910 }
17911 else
17912 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "No observer specified and not inside a class\n", (((void *)0))));
17913 }
17914 break;
17915 }
17916 }
17917 }
17918
17919 extern struct Expression * QBrackets(struct Expression * exp);
17920
17921 extern struct TypeName * QMkType(char *  spec, struct Declarator * decl);
17922
17923 extern struct Declarator * QMkPtrDecl(char *  id);
17924
17925 extern struct Expression * MkExpPointer(struct Expression * expression, struct Identifier * member);
17926
17927 extern struct Expression * QMkExpCond(struct Expression * cond, struct Expression * exp, struct Expression * elseExp);
17928
17929 extern struct Statement * MkFireWatchersStmt(struct Expression * object, struct __ecereNameSpace__ecere__sys__OldList * watches);
17930
17931 static void ProcessFunction(struct FunctionDefinition * function)
17932 {
17933 struct Identifier * id = GetDeclId(function->declarator);
17934 struct Symbol * symbol = function->declarator ? function->declarator->symbol : (((void *)0));
17935 struct Type * type = symbol ? symbol->type : (((void *)0));
17936 struct __ecereNameSpace__ecere__com__Class * oldThisClass = thisClass;
17937 struct Context * oldTopContext = topContext;
17938
17939 yylloc = function->loc;
17940 if(type && type->thisClass)
17941 {
17942 struct Symbol * classSym = type->thisClass;
17943 struct __ecereNameSpace__ecere__com__Class * _class = type->thisClass->registered;
17944 char className[1024];
17945 char structName[1024];
17946 struct Declarator * funcDecl;
17947 struct Symbol * thisSymbol;
17948 unsigned int typedObject = 0x0;
17949
17950 if(_class && !_class->base)
17951 {
17952 _class = currentClass;
17953 if(_class && !_class->symbol)
17954 _class->symbol = FindClass(_class->fullName);
17955 classSym = _class ? _class->symbol : (((void *)0));
17956 typedObject = 0x1;
17957 }
17958 thisClass = _class;
17959 if(inCompiler && _class)
17960 {
17961 if(type->kind == 11)
17962 {
17963 if(symbol->type->params.count == 1 && ((struct Type *)symbol->type->params.first)->kind == 0)
17964 {
17965 struct Type * param = symbol->type->params.first;
17966
17967 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(&symbol->type->params, param);
17968 FreeType(param);
17969 }
17970 if(type->classObjectType != 1)
17971 {
17972 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(&symbol->type->params, (((void *)0)), MkClassType(_class->fullName));
17973 symbol->type->staticMethod = 0x1;
17974 symbol->type->thisClass = (((void *)0));
17975 symbol->type->extraParam = 0x0;
17976 }
17977 }
17978 strcpy(className, "__ecereClass_");
17979 FullClassNameCat(className, _class->fullName, 0x1);
17980 MangleClassName(className);
17981 structName[0] = (char)0;
17982 FullClassNameCat(structName, _class->fullName, 0x0);
17983 funcDecl = GetFuncDecl(function->declarator);
17984 if(funcDecl)
17985 {
17986 if(funcDecl->function.parameters && (*funcDecl->function.parameters).count == 1)
17987 {
17988 struct TypeName * param = (*funcDecl->function.parameters).first;
17989
17990 if(param->qualifiers && (*param->qualifiers).count == 1 && ((struct Specifier *)(*param->qualifiers).first)->specifier == VOID && !param->declarator)
17991 {
17992 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->function.parameters), param);
17993 FreeTypeName(param);
17994 }
17995 }
17996 if(!function->propertyNoThis)
17997 {
17998 struct TypeName * thisParam;
17999
18000 if(type->classObjectType != 1)
18001 {
18002 thisParam = QMkClass(_class->fullName, MkDeclaratorIdentifier(MkIdentifier("this")));
18003 if(!funcDecl->function.parameters)
18004 funcDecl->function.parameters = MkList();
18005 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
18006 }
18007 if(typedObject)
18008 {
18009 if(type->classObjectType != 1)
18010 {
18011 if(type->byReference || _class->type == 3 || _class->type == 1000 || _class->type == 4 || _class->type == 2)
18012 thisParam->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), thisParam->declarator);
18013 }
18014 thisParam = __extension__ ({
18015 struct TypeName * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TypeName);
18016
18017 __ecereInstance1->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier("class"))), __ecereInstance1->qualifiers = MkListOne(MkStructOrUnion(3, MkIdentifier("__ecereNameSpace__ecere__com__Class"), (((void *)0)))), __ecereInstance1;
18018 });
18019 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
18020 }
18021 }
18022 }
18023 if(symbol && symbol->pointerExternal && symbol->pointerExternal->type == 1)
18024 {
18025 struct InitDeclarator * initDecl = (*symbol->pointerExternal->declaration->declarators).first;
18026
18027 funcDecl = GetFuncDecl(initDecl->declarator);
18028 if(funcDecl)
18029 {
18030 if(funcDecl->function.parameters && (*funcDecl->function.parameters).count == 1)
18031 {
18032 struct TypeName * param = (*funcDecl->function.parameters).first;
18033
18034 if(param->qualifiers && (*param->qualifiers).count == 1 && ((struct Specifier *)(*param->qualifiers).first)->specifier == VOID && !param->declarator)
18035 {
18036 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->function.parameters), param);
18037 FreeTypeName(param);
18038 }
18039 }
18040 if(type->classObjectType != 1)
18041 {
18042 if((_class->type != 2 && _class->type != 3 && _class->type != 4) || function != (struct FunctionDefinition *)symbol->externalSet)
18043 {
18044 struct TypeName * thisParam = QMkClass(_class->fullName, MkDeclaratorIdentifier(MkIdentifier("this")));
18045
18046 if(!funcDecl->function.parameters)
18047 funcDecl->function.parameters = MkList();
18048 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
18049 }
18050 }
18051 }
18052 }
18053 }
18054 if(function->body)
18055 {
18056 if(type->classObjectType != 1)
18057 {
18058 thisSymbol = __extension__ ({
18059 struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
18060
18061 __ecereInstance1->string = __ecereNameSpace__ecere__sys__CopyString("this"), __ecereInstance1->type = classSym ? MkClassType(classSym->string) : (((void *)0)), __ecereInstance1;
18062 });
18063 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&function->body->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18064 if(typedObject && thisSymbol->type)
18065 {
18066 thisSymbol->type->classObjectType = 2;
18067 thisSymbol->type->byReference = type->byReference;
18068 thisSymbol->type->typedByReference = type->byReference;
18069 }
18070 }
18071 }
18072 if(inCompiler && _class && (_class->type == 0) && type->classObjectType != 1)
18073 {
18074 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
18075
18076 {
18077 struct __ecereNameSpace__ecere__com__Class * base;
18078
18079 for(base = _class; base && base->type != 1000; base = base->next)
18080 {
18081 for(member = base->membersAndProperties.first; member; member = member->next)
18082 if(!member->isProperty)
18083 break;
18084 if(member)
18085 break;
18086 }
18087 }
18088 for(member = _class->membersAndProperties.first; member; member = member->next)
18089 if(!member->isProperty)
18090 break;
18091 if(member)
18092 {
18093 char pointerName[1024];
18094 struct Declaration * decl;
18095 struct Initializer * initializer;
18096 struct Expression * exp, * bytePtr;
18097
18098 strcpy(pointerName, "__ecerePointer_");
18099 FullClassNameCat(pointerName, _class->fullName, 0x0);
18100 {
18101 char className[1024];
18102
18103 strcpy(className, "__ecereClass_");
18104 FullClassNameCat(className, classSym->string, 0x1);
18105 MangleClassName(className);
18106 DeclareClass(classSym, className);
18107 }
18108 bytePtr = QBrackets(MkExpCast(QMkType("char", QMkPtrDecl((((void *)0)))), QMkExpId("this")));
18109 if(_class->fixed)
18110 {
18111 char string[256];
18112
18113 sprintf(string, "%d", _class->offset);
18114 exp = QBrackets(MkExpOp(bytePtr, '+', MkExpConstant(string)));
18115 }
18116 else
18117 {
18118 exp = QBrackets(MkExpOp(bytePtr, '+', MkExpPointer(QMkExpId(className), MkIdentifier("offset"))));
18119 }
18120 exp = QBrackets(QMkExpCond(QMkExpId("this"), exp, MkExpConstant("0")));
18121 exp->expType = __extension__ ({
18122 struct Type * __ecereInstance2 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
18123
18124 __ecereInstance2->refCount = 1, __ecereInstance2->kind = 13, __ecereInstance2->type = __extension__ ({
18125 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
18126
18127 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 0, __ecereInstance1;
18128 }), __ecereInstance2;
18129 });
18130 if(function->body)
18131 {
18132 yylloc = function->body->loc;
18133 initializer = MkInitializerAssignment(MkExpCast(MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(structName), (((void *)0)))), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), exp));
18134 {
18135 struct Context * prevContext = curContext;
18136
18137 curContext = function->body->compound.context;
18138 decl = MkDeclaration(MkListOne(MkStructOrUnion(3, MkIdentifier(structName), (((void *)0)))), MkListOne(MkInitDeclarator(QMkPtrDecl(pointerName), initializer)));
18139 curContext = prevContext;
18140 }
18141 decl->symbol = (((void *)0));
18142 if(!function->body->compound.declarations)
18143 function->body->compound.declarations = MkList();
18144 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*function->body->compound.declarations), (((void *)0)), decl);
18145 }
18146 }
18147 }
18148 }
18149 else
18150 thisClass = (((void *)0));
18151 if(id)
18152 {
18153 FreeSpecifier(id->_class);
18154 id->_class = (((void *)0));
18155 if(symbol && symbol->pointerExternal && symbol->pointerExternal->type == 1)
18156 {
18157 struct InitDeclarator * initDecl = (*symbol->pointerExternal->declaration->declarators).first;
18158
18159 id = GetDeclId(initDecl->declarator);
18160 FreeSpecifier(id->_class);
18161 id->_class = (((void *)0));
18162 }
18163 }
18164 if(function->body)
18165 topContext = function->body->compound.context;
18166 {
18167 struct FunctionDefinition * oldFunction = curFunction;
18168
18169 curFunction = function;
18170 if(function->body)
18171 ProcessStatement(function->body);
18172 if(inCompiler && function->propSet && !function->propSet->fireWatchersDone)
18173 {
18174 struct Statement * prevCompound = curCompound;
18175 struct Context * prevContext = curContext;
18176 struct Statement * fireWatchers = MkFireWatchersStmt((((void *)0)), (((void *)0)));
18177
18178 if(!function->body->compound.statements)
18179 function->body->compound.statements = MkList();
18180 ListAdd(function->body->compound.statements, fireWatchers);
18181 curCompound = function->body;
18182 curContext = function->body->compound.context;
18183 ProcessStatement(fireWatchers);
18184 curContext = prevContext;
18185 curCompound = prevCompound;
18186 }
18187 curFunction = oldFunction;
18188 }
18189 if(function->declarator)
18190 {
18191 ProcessDeclarator(function->declarator);
18192 }
18193 topContext = oldTopContext;
18194 thisClass = oldThisClass;
18195 }
18196
18197 extern void FreeSymbol(struct Symbol * symbol);
18198
18199 void __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Remove(struct __ecereNameSpace__ecere__sys__BinaryTree * this, struct __ecereNameSpace__ecere__sys__BTNode * node);
18200
18201 static void ProcessClass(struct __ecereNameSpace__ecere__sys__OldList * definitions, struct Symbol * symbol)
18202 {
18203 struct ClassDef * def;
18204 struct External * external = curExternal;
18205 struct __ecereNameSpace__ecere__com__Class * regClass = symbol ? symbol->registered : (((void *)0));
18206
18207 for(def = definitions->first; def; def = def->next)
18208 {
18209 if(def->type == 0)
18210 {
18211 if(def->function->declarator)
18212 curExternal = def->function->declarator->symbol->pointerExternal;
18213 else
18214 curExternal = external;
18215 ProcessFunction((struct FunctionDefinition *)def->function);
18216 }
18217 else if(def->type == 2)
18218 {
18219 if(def->decl->type == 2)
18220 {
18221 thisClass = regClass;
18222 ProcessInstantiationType(def->decl->inst);
18223 thisClass = (((void *)0));
18224 }
18225 else
18226 {
18227 struct __ecereNameSpace__ecere__com__Class * backThisClass = thisClass;
18228
18229 if(regClass)
18230 thisClass = regClass;
18231 ProcessDeclaration(def->decl);
18232 thisClass = backThisClass;
18233 }
18234 }
18235 else if(def->type == 1 && def->defProperties)
18236 {
18237 struct MemberInit * defProperty;
18238 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);
18239
18240 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18241 for(defProperty = (*def->defProperties).first; defProperty; defProperty = defProperty->next)
18242 {
18243 thisClass = regClass;
18244 ProcessMemberInitData(defProperty, regClass, (((void *)0)), (((void *)0)), (((void *)0)), (((void *)0)));
18245 thisClass = (((void *)0));
18246 }
18247 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Remove(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18248 FreeSymbol(thisSymbol);
18249 }
18250 else if(def->type == 3 && def->propertyDef)
18251 {
18252 struct PropertyDef * prop = def->propertyDef;
18253
18254 thisClass = regClass;
18255 if(prop->setStmt)
18256 {
18257 if(regClass)
18258 {
18259 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
18260
18261 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->setStmt->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18262 }
18263 curExternal = prop->symbol ? prop->symbol->externalSet : (((void *)0));
18264 ProcessStatement(prop->setStmt);
18265 }
18266 if(prop->getStmt)
18267 {
18268 if(regClass)
18269 {
18270 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
18271
18272 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->getStmt->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18273 }
18274 curExternal = prop->symbol ? prop->symbol->externalGet : (((void *)0));
18275 ProcessStatement(prop->getStmt);
18276 }
18277 if(prop->issetStmt)
18278 {
18279 if(regClass)
18280 {
18281 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
18282
18283 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->issetStmt->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18284 }
18285 curExternal = prop->symbol ? prop->symbol->externalIsSet : (((void *)0));
18286 ProcessStatement(prop->issetStmt);
18287 }
18288 thisClass = (((void *)0));
18289 }
18290 else if(def->type == 4 && def->propertyWatch)
18291 {
18292 struct PropertyWatch * propertyWatch = def->propertyWatch;
18293
18294 thisClass = regClass;
18295 if(propertyWatch->compound)
18296 {
18297 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);
18298
18299 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&propertyWatch->compound->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18300 curExternal = (((void *)0));
18301 ProcessStatement(propertyWatch->compound);
18302 }
18303 thisClass = (((void *)0));
18304 }
18305 }
18306 }
18307
18308 void DeclareFunctionUtil(char * s)
18309 {
18310 struct __ecereNameSpace__ecere__com__GlobalFunction * function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, s);
18311
18312 if(function)
18313 {
18314 char name[1024];
18315
18316 name[0] = (char)0;
18317 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType != 1 && (!function->dataType || !function->dataType->dllExport))
18318 strcpy(name, "__ecereFunction_");
18319 FullClassNameCat(name, s, 0x0);
18320 DeclareFunction(function, name);
18321 }
18322 }
18323
18324 extern struct __ecereNameSpace__ecere__com__Instance * GetPrivateModule(void);
18325
18326 void ComputeDataTypes()
18327 {
18328 struct External * external;
18329 struct External * temp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_External);
18330 struct External * after = (((void *)0));
18331
18332 currentClass = (((void *)0));
18333 containerClass = __ecereNameSpace__ecere__com__eSystem_FindClass(GetPrivateModule(), "Container");
18334 for(external = (*ast).first; external; external = external->next)
18335 {
18336 if(external->type == 1)
18337 {
18338 struct Declaration * decl = external->declaration;
18339
18340 if(decl)
18341 {
18342 struct __ecereNameSpace__ecere__sys__OldList * decls = decl->declarators;
18343
18344 if(decls)
18345 {
18346 struct InitDeclarator * initDecl = (*decls).first;
18347
18348 if(initDecl)
18349 {
18350 struct Declarator * declarator = initDecl->declarator;
18351
18352 if(declarator && declarator->type == 1)
18353 {
18354 struct Identifier * id = declarator->identifier;
18355
18356 if(id && id->string)
18357 {
18358 if(!strcmp(id->string, "uintptr_t") || !strcmp(id->string, "intptr_t") || !strcmp(id->string, "size_t") || !strcmp(id->string, "ssize_t"))
18359 {
18360 external->symbol->id = -1001, external->symbol->idCode = -1001;
18361 after = external;
18362 }
18363 }
18364 }
18365 }
18366 }
18367 }
18368 }
18369 }
18370 temp->symbol = __extension__ ({
18371 struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
18372
18373 __ecereInstance1->id = -1000, __ecereInstance1->idCode = -1000, __ecereInstance1;
18374 });
18375 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), after, temp);
18376 curExternal = temp;
18377 DeclareFunctionUtil("eSystem_New");
18378 DeclareFunctionUtil("eSystem_New0");
18379 DeclareFunctionUtil("eSystem_Renew");
18380 DeclareFunctionUtil("eSystem_Renew0");
18381 DeclareFunctionUtil("eSystem_Delete");
18382 DeclareFunctionUtil("eClass_GetProperty");
18383 DeclareFunctionUtil("eInstance_FireSelfWatchers");
18384 DeclareStruct("ecere::com::Class", 0x0);
18385 DeclareStruct("ecere::com::Instance", 0x0);
18386 DeclareStruct("ecere::com::Property", 0x0);
18387 DeclareStruct("ecere::com::DataMember", 0x0);
18388 DeclareStruct("ecere::com::Method", 0x0);
18389 DeclareStruct("ecere::com::SerialBuffer", 0x0);
18390 DeclareStruct("ecere::com::ClassTemplateArgument", 0x0);
18391 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*ast), temp);
18392 for(external = (*ast).first; external; external = external->next)
18393 {
18394 afterExternal = curExternal = external;
18395 if(external->type == 0)
18396 {
18397 currentClass = external->function->_class;
18398 ProcessFunction(external->function);
18399 }
18400 else if(external->type == 1)
18401 {
18402 currentClass = (((void *)0));
18403 ProcessDeclaration(external->declaration);
18404 }
18405 else if(external->type == 2)
18406 {
18407 struct ClassDefinition * _class = external->_class;
18408
18409 currentClass = external->symbol->registered;
18410 if(_class->definitions)
18411 {
18412 ProcessClass(_class->definitions, _class->symbol);
18413 }
18414 if(inCompiler)
18415 {
18416 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*ast), external);
18417 ((external ? (__ecereClass_External->Destructor ? __ecereClass_External->Destructor(external) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(external)) : 0), external = 0);
18418 }
18419 }
18420 else if(external->type == 4)
18421 {
18422 thisNameSpace = external->id->string;
18423 }
18424 }
18425 currentClass = (((void *)0));
18426 thisNameSpace = (((void *)0));
18427 ((temp->symbol ? (__ecereClass_Symbol->Destructor ? __ecereClass_Symbol->Destructor(temp->symbol) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(temp->symbol)) : 0), temp->symbol = 0);
18428 ((temp ? (__ecereClass_External->Destructor ? __ecereClass_External->Destructor(temp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(temp)) : 0), temp = 0);
18429 }
18430
18431 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);
18432
18433 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);
18434
18435 extern struct __ecereNameSpace__ecere__com__Instance * __thisModule;
18436
18437 void __ecereRegisterModule_pass15(struct __ecereNameSpace__ecere__com__Instance * module)
18438 {
18439 struct __ecereNameSpace__ecere__com__Class * class;
18440
18441 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetYydebug", "void SetYydebug(bool b)", SetYydebug, module, 1);
18442 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetThisClass", "void SetThisClass(ecere::com::Class c)", SetThisClass, module, 1);
18443 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetThisClass", "ecere::com::Class GetThisClass(void)", GetThisClass, module, 1);
18444 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintExpression", "void PrintExpression(Expression exp, char * string)", PrintExpression, module, 1);
18445 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessTemplateParameterType", "Type ProcessTemplateParameterType(TemplateParameter param)", ProcessTemplateParameterType, module, 2);
18446 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("NeedCast", "bool NeedCast(Type type1, Type type2)", NeedCast, module, 2);
18447 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintInt", "char * PrintInt(int64 result)", PrintInt, module, 1);
18448 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUInt", "char * PrintUInt(uint64 result)", PrintUInt, module, 1);
18449 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintInt64", "char * PrintInt64(int64 result)", PrintInt64, module, 1);
18450 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUInt64", "char * PrintUInt64(uint64 result)", PrintUInt64, module, 1);
18451 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintHexUInt", "char * PrintHexUInt(uint64 result)", PrintHexUInt, module, 1);
18452 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintHexUInt64", "char * PrintHexUInt64(uint64 result)", PrintHexUInt64, module, 1);
18453 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintShort", "char * PrintShort(short result)", PrintShort, module, 1);
18454 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUShort", "char * PrintUShort(uint16 result)", PrintUShort, module, 1);
18455 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintChar", "char * PrintChar(char result)", PrintChar, module, 1);
18456 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUChar", "char * PrintUChar(byte result)", PrintUChar, module, 1);
18457 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintFloat", "char * PrintFloat(float result)", PrintFloat, module, 1);
18458 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintDouble", "char * PrintDouble(double result)", PrintDouble, module, 1);
18459 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpInt", "bool GetOpInt(Operand op2, int * value2)", GetOpInt, module, 1);
18460 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetInt", "bool GetInt(Expression exp, int * value2)", GetInt, module, 1);
18461 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUInt", "bool GetOpUInt(Operand op2, uint * value2)", GetOpUInt, module, 1);
18462 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUInt", "bool GetUInt(Expression exp, uint * value2)", GetUInt, module, 1);
18463 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpInt64", "bool GetOpInt64(Operand op2, int64 * value2)", GetOpInt64, module, 1);
18464 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetInt64", "bool GetInt64(Expression exp, int64 * value2)", GetInt64, module, 1);
18465 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUInt64", "bool GetOpUInt64(Operand op2, uint64 * value2)", GetOpUInt64, module, 1);
18466 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUInt64", "bool GetUInt64(Expression exp, uint64 * value2)", GetUInt64, module, 1);
18467 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpIntPtr", "bool GetOpIntPtr(Operand op2, intptr * value2)", GetOpIntPtr, module, 1);
18468 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetIntPtr", "bool GetIntPtr(Expression exp, intptr * value2)", GetIntPtr, module, 1);
18469 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUIntPtr", "bool GetOpUIntPtr(Operand op2, uintptr * value2)", GetOpUIntPtr, module, 1);
18470 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUIntPtr", "bool GetUIntPtr(Expression exp, uintptr * value2)", GetUIntPtr, module, 1);
18471 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpIntSize", "bool GetOpIntSize(Operand op2, intsize * value2)", GetOpIntSize, module, 1);
18472 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetIntSize", "bool GetIntSize(Expression exp, intsize * value2)", GetIntSize, module, 1);
18473 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUIntSize", "bool GetOpUIntSize(Operand op2, uintsize * value2)", GetOpUIntSize, module, 1);
18474 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUIntSize", "bool GetUIntSize(Expression exp, uintsize * value2)", GetUIntSize, module, 1);
18475 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpShort", "bool GetOpShort(Operand op2, short * value2)", GetOpShort, module, 1);
18476 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetShort", "bool GetShort(Expression exp, short * value2)", GetShort, module, 1);
18477 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUShort", "bool GetOpUShort(Operand op2, uint16 * value2)", GetOpUShort, module, 1);
18478 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUShort", "bool GetUShort(Expression exp, uint16 * value2)", GetUShort, module, 1);
18479 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpChar", "bool GetOpChar(Operand op2, char * value2)", GetOpChar, module, 1);
18480 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetChar", "bool GetChar(Expression exp, char * value2)", GetChar, module, 1);
18481 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUChar", "bool GetOpUChar(Operand op2, byte * value2)", GetOpUChar, module, 1);
18482 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUChar", "bool GetUChar(Expression exp, byte * value2)", GetUChar, module, 1);
18483 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpFloat", "bool GetOpFloat(Operand op2, float * value2)", GetOpFloat, module, 1);
18484 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetFloat", "bool GetFloat(Expression exp, float * value2)", GetFloat, module, 1);
18485 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpDouble", "bool GetOpDouble(Operand op2, double * value2)", GetOpDouble, module, 1);
18486 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetDouble", "bool GetDouble(Expression exp, double * value2)", GetDouble, module, 1);
18487 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeClassMembers", "void ComputeClassMembers(ecere::com::Class _class, bool isMember)", ComputeClassMembers, module, 2);
18488 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeModuleClasses", "void ComputeModuleClasses(ecere::com::Module module)", ComputeModuleClasses, module, 1);
18489 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeTypeSize", "int ComputeTypeSize(Type type)", ComputeTypeSize, module, 1);
18490 __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);
18491 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareStruct", "void DeclareStruct(char * name, bool skipNoHead)", DeclareStruct, module, 2);
18492 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareProperty", "void DeclareProperty(ecere::com::Property prop, char * setName, char * getName)", DeclareProperty, module, 2);
18493 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("Dereference", "Type Dereference(Type source)", Dereference, module, 1);
18494 __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);
18495 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessInstantiationType", "void ProcessInstantiationType(Instantiation inst)", ProcessInstantiationType, module, 2);
18496 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindTemplateArg", "ecere::com::ClassTemplateArgument * FindTemplateArg(ecere::com::Class _class, TemplateParameter param)", FindTemplateArg, module, 2);
18497 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetupTemplatesContext", "Context SetupTemplatesContext(ecere::com::Class _class)", SetupTemplatesContext, module, 1);
18498 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FinishTemplatesContext", "void FinishTemplatesContext(Context context)", FinishTemplatesContext, module, 1);
18499 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessMethodType", "void ProcessMethodType(ecere::com::Method method)", ProcessMethodType, module, 1);
18500 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessPropertyType", "void ProcessPropertyType(ecere::com::Property prop)", ProcessPropertyType, module, 1);
18501 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareMethod", "void DeclareMethod(ecere::com::Method method, char * name)", DeclareMethod, module, 1);
18502 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClass", "char * ReplaceThisClass(ecere::com::Class _class)", ReplaceThisClass, module, 2);
18503 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClassType", "Type ReplaceThisClassType(ecere::com::Class _class)", ReplaceThisClassType, module, 2);
18504 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClassSpecifiers", "void ReplaceThisClassSpecifiers(ecere::sys::OldList specs, ecere::com::Class _class)", ReplaceThisClassSpecifiers, module, 2);
18505 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareFunction", "bool DeclareFunction(ecere::com::GlobalFunction function, char * name)", DeclareFunction, module, 2);
18506 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareGlobalData", "void DeclareGlobalData(GlobalData data)", DeclareGlobalData, module, 2);
18507 class = __ecereNameSpace__ecere__com__eSystem_RegisterClass(5, "Conversion", 0, sizeof(struct Conversion), 0, 0, 0, module, 2, 1);
18508 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->application == ((struct __ecereNameSpace__ecere__com__Module *)(((char *)__thisModule + structSize_Instance)))->application && class)
18509 __ecereClass_Conversion = class;
18510 __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);
18511 __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);
18512 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ModuleVisibility", "bool ModuleVisibility(ecere::com::Module searchIn, ecere::com::Module searchFor)", ModuleVisibility, module, 1);
18513 __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);
18514 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("MatchTypeExpression", "bool MatchTypeExpression(Expression sourceExp, Type dest, ecere::sys::OldList conversions, bool skipUnitBla)", MatchTypeExpression, module, 2);
18515 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReadString", "void ReadString(char * output, char * string)", ReadString, module, 1);
18516 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("UnescapeString", "int UnescapeString(char * d, char * s, int len)", UnescapeString, module, 1);
18517 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("OffsetEscapedString", "char * OffsetEscapedString(char * s, int len, int offset)", OffsetEscapedString, module, 1);
18518 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOperand", "Operand GetOperand(Expression exp)", GetOperand, module, 1);
18519 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PopulateInstance", "void PopulateInstance(Instantiation inst)", PopulateInstance, module, 1);
18520 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeInstantiation", "void ComputeInstantiation(Expression exp)", ComputeInstantiation, module, 1);
18521 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CallOperator", "void CallOperator(Expression exp, Expression exp1, Expression exp2, Operand op1, Operand op2)", CallOperator, module, 1);
18522 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeExpression", "void ComputeExpression(Expression exp)", ComputeExpression, module, 1);
18523 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CheckTemplateTypes", "void CheckTemplateTypes(Expression exp)", CheckTemplateTypes, module, 1);
18524 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindSymbol", "Symbol FindSymbol(char * name, Context startContext, Context endContext, bool isStruct, bool globalNameSpace)", FindSymbol, module, 1);
18525 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintType", "void PrintType(Type type, char * string, bool printName, bool fullName)", PrintType, module, 1);
18526 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintTypeNoConst", "void PrintTypeNoConst(Type type, char * string, bool printName, bool fullName)", PrintTypeNoConst, module, 1);
18527 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindMemberAndOffset", "Type FindMemberAndOffset(Type type, char * string, uint * offset)", FindMemberAndOffset, module, 1);
18528 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetParseError", "bool GetParseError(void)", GetParseError, module, 1);
18529 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ParseExpressionString", "Expression ParseExpressionString(char * expression)", ParseExpressionString, module, 1);
18530 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceExpContents", "void ReplaceExpContents(Expression checkedExp, Expression newExp)", ReplaceExpContents, module, 1);
18531 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ApplyAnyObjectLogic", "void ApplyAnyObjectLogic(Expression e)", ApplyAnyObjectLogic, module, 1);
18532 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessExpressionType", "void ProcessExpressionType(Expression exp)", ProcessExpressionType, module, 1);
18533 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareFunctionUtil", "void DeclareFunctionUtil(String s)", DeclareFunctionUtil, module, 1);
18534 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeDataTypes", "void ComputeDataTypes(void)", ComputeDataTypes, module, 1);
18535 }
18536
18537 void __ecereUnregisterModule_pass15(struct __ecereNameSpace__ecere__com__Instance * module)
18538 {
18539
18540 }
18541