compiler, ecere, ide: Compiler fixes ; Map & struct keys fixes; Support for cross...
[sdk] / compiler / bootstrap / libec / bootstrap / pass15.c
1 #if defined(__GNUC__)
2 typedef long long int64;
3 typedef unsigned long long uint64;
4 #ifndef _WIN32
5 #define __declspec(x)
6 #endif
7 #elif defined(__TINYC__)
8 #include <stdarg.h>
9 #define __builtin_va_list va_list
10 #define __builtin_va_start va_start
11 #define __builtin_va_end va_end
12 #ifdef _WIN32
13 #define strcasecmp stricmp
14 #define strncasecmp strnicmp
15 #define __declspec(x) __attribute__((x))
16 #else
17 #define __declspec(x)
18 #endif
19 typedef long long int64;
20 typedef unsigned long long uint64;
21 #else
22 typedef __int64 int64;
23 typedef unsigned __int64 uint64;
24 #endif
25 #ifdef __BIG_ENDIAN__
26 #define __ENDIAN_PAD(x) (8 - (x))
27 #else
28 #define __ENDIAN_PAD(x) 0
29 #endif
30 #ifdef __MINGW32__
31 #ifdef _WIN64
32 typedef unsigned long long int uintptr_t;
33 typedef long long int intptr_t;
34 #else
35 typedef unsigned int uintptr_t;
36 typedef int intptr_t;
37 #endif
38 #else
39 #include <stdint.h>
40 #endif
41 extern void *  __ecereNameSpace__ecere__com__eSystem_New(unsigned int size);
42
43 extern void *  __ecereNameSpace__ecere__com__eSystem_New0(unsigned int size);
44
45 extern void *  __ecereNameSpace__ecere__com__eSystem_Renew(void *  memory, unsigned int size);
46
47 extern void *  __ecereNameSpace__ecere__com__eSystem_Renew0(void *  memory, unsigned int size);
48
49 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__BTNode;
50
51 struct __ecereNameSpace__ecere__sys__BTNode;
52
53 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__BinaryTree;
54
55 struct __ecereNameSpace__ecere__sys__BinaryTree
56 {
57 struct __ecereNameSpace__ecere__sys__BTNode * root;
58 int count;
59 int (*  CompareKey)(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, uintptr_t a, uintptr_t b);
60 void (*  FreeKey)(void *  key);
61 } __attribute__ ((gcc_struct));
62
63 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__OldList;
64
65 struct __ecereNameSpace__ecere__sys__OldList
66 {
67 void *  first;
68 void *  last;
69 int count;
70 unsigned int offset;
71 unsigned int circ;
72 } __attribute__ ((gcc_struct));
73
74 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Method;
75
76 struct __ecereNameSpace__ecere__com__Method
77 {
78 char *  name;
79 struct __ecereNameSpace__ecere__com__Method * parent;
80 struct __ecereNameSpace__ecere__com__Method * left;
81 struct __ecereNameSpace__ecere__com__Method * right;
82 int depth;
83 int (*  function)();
84 int vid;
85 int type;
86 struct __ecereNameSpace__ecere__com__Class * _class;
87 void *  symbol;
88 char *  dataTypeString;
89 struct Type * dataType;
90 int memberAccess;
91 } __attribute__ ((gcc_struct));
92
93 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Property;
94
95 struct __ecereNameSpace__ecere__com__Property
96 {
97 struct __ecereNameSpace__ecere__com__Property * prev;
98 struct __ecereNameSpace__ecere__com__Property * next;
99 char *  name;
100 unsigned int isProperty;
101 int memberAccess;
102 int id;
103 struct __ecereNameSpace__ecere__com__Class * _class;
104 char *  dataTypeString;
105 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
106 struct Type * dataType;
107 void (*  Set)(void * , int);
108 int (*  Get)(void * );
109 unsigned int (*  IsSet)(void * );
110 void *  data;
111 void *  symbol;
112 int vid;
113 unsigned int conversion;
114 unsigned int watcherOffset;
115 char *  category;
116 unsigned int compiled;
117 unsigned int selfWatchable;
118 unsigned int isWatchable;
119 } __attribute__ ((gcc_struct));
120
121 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_CodePosition;
122
123 struct CodePosition
124 {
125 int line;
126 int charPos;
127 int pos;
128 unsigned int included;
129 } __attribute__ ((gcc_struct));
130
131 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Location;
132
133 struct Location
134 {
135 struct CodePosition start;
136 struct CodePosition end;
137 } __attribute__ ((gcc_struct));
138
139 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Attrib;
140
141 struct Attrib;
142
143 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ExtDecl;
144
145 struct ExtDecl
146 {
147 struct Location loc;
148 int type;
149 union
150 {
151 char * s;
152 struct Attrib * attr;
153 } __attribute__ ((gcc_struct));
154 } __attribute__ ((gcc_struct));
155
156 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassDefinition;
157
158 struct ClassDefinition
159 {
160 struct ClassDefinition * prev;
161 struct ClassDefinition * next;
162 struct Location loc;
163 struct Specifier * _class;
164 struct __ecereNameSpace__ecere__sys__OldList *  baseSpecs;
165 struct __ecereNameSpace__ecere__sys__OldList *  definitions;
166 struct Symbol * symbol;
167 struct Location blockStart;
168 struct Location nameLoc;
169 int endid;
170 int declMode;
171 unsigned int deleteWatchable;
172 } __attribute__ ((gcc_struct));
173
174 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Context;
175
176 struct Context
177 {
178 struct Context * parent;
179 struct __ecereNameSpace__ecere__sys__BinaryTree types;
180 struct __ecereNameSpace__ecere__sys__BinaryTree classes;
181 struct __ecereNameSpace__ecere__sys__BinaryTree symbols;
182 struct __ecereNameSpace__ecere__sys__BinaryTree structSymbols;
183 int nextID;
184 int simpleID;
185 struct __ecereNameSpace__ecere__sys__BinaryTree templateTypes;
186 struct ClassDefinition * classDef;
187 unsigned int templateTypesOnly;
188 unsigned int hasNameSpace;
189 } __attribute__ ((gcc_struct));
190
191 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Instantiation;
192
193 struct Instantiation
194 {
195 struct Instantiation * prev;
196 struct Instantiation * next;
197 struct Location loc;
198 struct Specifier * _class;
199 struct Expression * exp;
200 struct __ecereNameSpace__ecere__sys__OldList *  members;
201 struct Symbol * symbol;
202 unsigned int fullSet;
203 unsigned int isConstant;
204 unsigned char *  data;
205 struct Location nameLoc;
206 struct Location insideLoc;
207 unsigned int built;
208 } __attribute__ ((gcc_struct));
209
210 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Declaration;
211
212 struct Declaration
213 {
214 struct Declaration * prev;
215 struct Declaration * next;
216 struct Location loc;
217 int type;
218 union
219 {
220 struct
221 {
222 struct __ecereNameSpace__ecere__sys__OldList *  specifiers;
223 struct __ecereNameSpace__ecere__sys__OldList *  declarators;
224 } __attribute__ ((gcc_struct));
225 struct Instantiation * inst;
226 struct
227 {
228 struct Identifier * id;
229 struct Expression * exp;
230 } __attribute__ ((gcc_struct));
231 } __attribute__ ((gcc_struct));
232 struct Specifier * extStorage;
233 struct Symbol * symbol;
234 int declMode;
235 } __attribute__ ((gcc_struct));
236
237 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Statement;
238
239 struct Statement
240 {
241 struct Statement * prev;
242 struct Statement * next;
243 struct Location loc;
244 int type;
245 union
246 {
247 struct __ecereNameSpace__ecere__sys__OldList *  expressions;
248 struct
249 {
250 struct Identifier * id;
251 struct Statement * stmt;
252 } __attribute__ ((gcc_struct)) labeled;
253 struct
254 {
255 struct Expression * exp;
256 struct Statement * stmt;
257 } __attribute__ ((gcc_struct)) caseStmt;
258 struct
259 {
260 struct __ecereNameSpace__ecere__sys__OldList * declarations;
261 struct __ecereNameSpace__ecere__sys__OldList * statements;
262 struct Context * context;
263 unsigned int isSwitch;
264 } __attribute__ ((gcc_struct)) compound;
265 struct
266 {
267 struct __ecereNameSpace__ecere__sys__OldList * exp;
268 struct Statement * stmt;
269 struct Statement * elseStmt;
270 } __attribute__ ((gcc_struct)) ifStmt;
271 struct
272 {
273 struct __ecereNameSpace__ecere__sys__OldList * exp;
274 struct Statement * stmt;
275 } __attribute__ ((gcc_struct)) switchStmt;
276 struct
277 {
278 struct __ecereNameSpace__ecere__sys__OldList * exp;
279 struct Statement * stmt;
280 } __attribute__ ((gcc_struct)) whileStmt;
281 struct
282 {
283 struct __ecereNameSpace__ecere__sys__OldList * exp;
284 struct Statement * stmt;
285 } __attribute__ ((gcc_struct)) doWhile;
286 struct
287 {
288 struct Statement * init;
289 struct Statement * check;
290 struct __ecereNameSpace__ecere__sys__OldList * increment;
291 struct Statement * stmt;
292 } __attribute__ ((gcc_struct)) forStmt;
293 struct
294 {
295 struct Identifier * id;
296 } __attribute__ ((gcc_struct)) gotoStmt;
297 struct
298 {
299 struct Specifier * spec;
300 char * statements;
301 struct __ecereNameSpace__ecere__sys__OldList * inputFields;
302 struct __ecereNameSpace__ecere__sys__OldList * outputFields;
303 struct __ecereNameSpace__ecere__sys__OldList * clobberedFields;
304 } __attribute__ ((gcc_struct)) asmStmt;
305 struct
306 {
307 struct Expression * watcher;
308 struct Expression * object;
309 struct __ecereNameSpace__ecere__sys__OldList * watches;
310 } __attribute__ ((gcc_struct)) _watch;
311 struct
312 {
313 struct Identifier * id;
314 struct __ecereNameSpace__ecere__sys__OldList * exp;
315 struct __ecereNameSpace__ecere__sys__OldList * filter;
316 struct Statement * stmt;
317 } __attribute__ ((gcc_struct)) forEachStmt;
318 struct Declaration * decl;
319 } __attribute__ ((gcc_struct));
320 } __attribute__ ((gcc_struct));
321
322 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TypeName;
323
324 struct TypeName
325 {
326 struct TypeName * prev;
327 struct TypeName * next;
328 struct Location loc;
329 struct __ecereNameSpace__ecere__sys__OldList *  qualifiers;
330 struct Declarator * declarator;
331 int classObjectType;
332 struct Expression * bitCount;
333 } __attribute__ ((gcc_struct));
334
335 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Initializer;
336
337 struct Initializer
338 {
339 struct Initializer * prev;
340 struct Initializer * next;
341 struct Location loc;
342 int type;
343 union
344 {
345 struct Expression * exp;
346 struct __ecereNameSpace__ecere__sys__OldList *  list;
347 } __attribute__ ((gcc_struct));
348 unsigned int isConstant;
349 } __attribute__ ((gcc_struct));
350
351 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__DataValue;
352
353 struct __ecereNameSpace__ecere__com__DataValue
354 {
355 union
356 {
357 char c;
358 unsigned char uc;
359 short s;
360 unsigned short us;
361 int i;
362 unsigned int ui;
363 void *  p;
364 float f;
365 double d;
366 long long i64;
367 uint64 ui64;
368 } __attribute__ ((gcc_struct));
369 } __attribute__ ((gcc_struct));
370
371 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Expression;
372
373 struct Expression
374 {
375 struct Expression * prev;
376 struct Expression * next;
377 struct Location loc;
378 int type;
379 union
380 {
381 struct
382 {
383 char *  constant;
384 struct Identifier * identifier;
385 } __attribute__ ((gcc_struct));
386 struct Statement * compound;
387 struct Instantiation * instance;
388 char *  string;
389 struct __ecereNameSpace__ecere__sys__OldList *  list;
390 struct
391 {
392 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
393 struct Declarator * decl;
394 } __attribute__ ((gcc_struct)) _classExp;
395 struct
396 {
397 struct Identifier * id;
398 } __attribute__ ((gcc_struct)) classData;
399 struct
400 {
401 struct Expression * exp;
402 struct __ecereNameSpace__ecere__sys__OldList * arguments;
403 struct Location argLoc;
404 } __attribute__ ((gcc_struct)) call;
405 struct
406 {
407 struct Expression * exp;
408 struct __ecereNameSpace__ecere__sys__OldList * index;
409 } __attribute__ ((gcc_struct)) index;
410 struct
411 {
412 struct Expression * exp;
413 struct Identifier * member;
414 int memberType;
415 unsigned int thisPtr;
416 } __attribute__ ((gcc_struct)) member;
417 struct
418 {
419 int op;
420 struct Expression * exp1;
421 struct Expression * exp2;
422 } __attribute__ ((gcc_struct)) op;
423 struct TypeName * typeName;
424 struct Specifier * _class;
425 struct
426 {
427 struct TypeName * typeName;
428 struct Expression * exp;
429 } __attribute__ ((gcc_struct)) cast;
430 struct
431 {
432 struct Expression * cond;
433 struct __ecereNameSpace__ecere__sys__OldList * exp;
434 struct Expression * elseExp;
435 } __attribute__ ((gcc_struct)) cond;
436 struct
437 {
438 struct TypeName * typeName;
439 struct Expression * size;
440 } __attribute__ ((gcc_struct)) _new;
441 struct
442 {
443 struct TypeName * typeName;
444 struct Expression * size;
445 struct Expression * exp;
446 } __attribute__ ((gcc_struct)) _renew;
447 struct
448 {
449 char * table;
450 struct Identifier * id;
451 } __attribute__ ((gcc_struct)) db;
452 struct
453 {
454 struct Expression * ds;
455 struct Expression * name;
456 } __attribute__ ((gcc_struct)) dbopen;
457 struct
458 {
459 struct TypeName * typeName;
460 struct Initializer * initializer;
461 } __attribute__ ((gcc_struct)) initializer;
462 struct
463 {
464 struct Expression * exp;
465 struct TypeName * typeName;
466 } __attribute__ ((gcc_struct)) vaArg;
467 } __attribute__ ((gcc_struct));
468 unsigned int debugValue;
469 struct __ecereNameSpace__ecere__com__DataValue val;
470 uint64 address;
471 unsigned int hasAddress;
472 struct Type * expType;
473 struct Type * destType;
474 unsigned int usage;
475 int tempCount;
476 unsigned int byReference;
477 unsigned int isConstant;
478 unsigned int addedThis;
479 unsigned int needCast;
480 unsigned int thisPtr;
481 } __attribute__ ((gcc_struct));
482
483 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplateDatatype;
484
485 struct TemplateDatatype
486 {
487 struct __ecereNameSpace__ecere__sys__OldList *  specifiers;
488 struct Declarator * decl;
489 } __attribute__ ((gcc_struct));
490
491 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplateArgument;
492
493 struct TemplateArgument;
494
495 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplateParameter;
496
497 struct TemplateParameter
498 {
499 struct TemplateParameter * prev;
500 struct TemplateParameter * next;
501 struct Location loc;
502 int type;
503 struct Identifier * identifier;
504 union
505 {
506 struct TemplateDatatype * dataType;
507 int memberType;
508 } __attribute__ ((gcc_struct));
509 struct TemplateArgument * defaultArgument;
510 char *  dataTypeString;
511 struct Type * baseType;
512 } __attribute__ ((gcc_struct));
513
514 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Specifier;
515
516 struct Specifier
517 {
518 struct Specifier * prev;
519 struct Specifier * next;
520 struct Location loc;
521 int type;
522 union
523 {
524 int specifier;
525 struct
526 {
527 struct ExtDecl * extDecl;
528 char *  name;
529 struct Symbol * symbol;
530 struct __ecereNameSpace__ecere__sys__OldList *  templateArgs;
531 } __attribute__ ((gcc_struct));
532 struct
533 {
534 struct Identifier * id;
535 struct __ecereNameSpace__ecere__sys__OldList *  list;
536 struct __ecereNameSpace__ecere__sys__OldList *  baseSpecs;
537 struct __ecereNameSpace__ecere__sys__OldList *  definitions;
538 unsigned int addNameSpace;
539 struct Context * ctx;
540 struct ExtDecl * extDeclStruct;
541 } __attribute__ ((gcc_struct));
542 struct Expression * expression;
543 struct Specifier * _class;
544 struct TemplateParameter * templateParameter;
545 } __attribute__ ((gcc_struct));
546 } __attribute__ ((gcc_struct));
547
548 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Identifier;
549
550 struct Identifier
551 {
552 struct Identifier * prev;
553 struct Identifier * next;
554 struct Location loc;
555 struct Symbol * classSym;
556 struct Specifier * _class;
557 char *  string;
558 struct Identifier * badID;
559 } __attribute__ ((gcc_struct));
560
561 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Pointer;
562
563 struct Pointer;
564
565 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Declarator;
566
567 struct Declarator
568 {
569 struct Declarator * prev;
570 struct Declarator * next;
571 struct Location loc;
572 int type;
573 struct Symbol * symbol;
574 struct Declarator * declarator;
575 union
576 {
577 struct Identifier * identifier;
578 struct
579 {
580 struct Expression * exp;
581 struct Expression * posExp;
582 struct Attrib * attrib;
583 } __attribute__ ((gcc_struct)) structDecl;
584 struct
585 {
586 struct Expression * exp;
587 struct Specifier * enumClass;
588 } __attribute__ ((gcc_struct)) array;
589 struct
590 {
591 struct __ecereNameSpace__ecere__sys__OldList * parameters;
592 } __attribute__ ((gcc_struct)) function;
593 struct
594 {
595 struct Pointer * pointer;
596 } __attribute__ ((gcc_struct)) pointer;
597 struct
598 {
599 struct ExtDecl * extended;
600 } __attribute__ ((gcc_struct)) extended;
601 } __attribute__ ((gcc_struct));
602 } __attribute__ ((gcc_struct));
603
604 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_FunctionDefinition;
605
606 struct FunctionDefinition
607 {
608 struct FunctionDefinition * prev;
609 struct FunctionDefinition * next;
610 struct Location loc;
611 struct __ecereNameSpace__ecere__sys__OldList *  specifiers;
612 struct Declarator * declarator;
613 struct __ecereNameSpace__ecere__sys__OldList *  declarations;
614 struct Statement * body;
615 struct __ecereNameSpace__ecere__com__Class * _class;
616 struct __ecereNameSpace__ecere__sys__OldList attached;
617 int declMode;
618 struct Type * type;
619 struct Symbol * propSet;
620 int tempCount;
621 unsigned int propertyNoThis;
622 } __attribute__ ((gcc_struct));
623
624 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_DBTableDef;
625
626 struct DBTableDef;
627
628 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_External;
629
630 struct External
631 {
632 struct External * prev;
633 struct External * next;
634 struct Location loc;
635 int type;
636 struct Symbol * symbol;
637 union
638 {
639 struct FunctionDefinition * function;
640 struct ClassDefinition * _class;
641 struct Declaration * declaration;
642 char *  importString;
643 struct Identifier * id;
644 struct DBTableDef * table;
645 } __attribute__ ((gcc_struct));
646 int importType;
647 } __attribute__ ((gcc_struct));
648
649 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ModuleImport;
650
651 struct ModuleImport
652 {
653 struct ModuleImport * prev;
654 struct ModuleImport * next;
655 char *  name;
656 struct __ecereNameSpace__ecere__sys__OldList classes;
657 struct __ecereNameSpace__ecere__sys__OldList functions;
658 int importType;
659 int importAccess;
660 } __attribute__ ((gcc_struct));
661
662 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassImport;
663
664 struct ClassImport
665 {
666 struct ClassImport * prev;
667 struct ClassImport * next;
668 char *  name;
669 struct __ecereNameSpace__ecere__sys__OldList methods;
670 struct __ecereNameSpace__ecere__sys__OldList properties;
671 unsigned int itself;
672 unsigned int isRemote;
673 } __attribute__ ((gcc_struct));
674
675 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Symbol;
676
677 struct Symbol
678 {
679 char *  string;
680 struct Symbol * parent;
681 struct Symbol * left;
682 struct Symbol * right;
683 int depth;
684 struct Type * type;
685 union
686 {
687 struct __ecereNameSpace__ecere__com__Method * method;
688 struct __ecereNameSpace__ecere__com__Property * _property;
689 struct __ecereNameSpace__ecere__com__Class * registered;
690 } __attribute__ ((gcc_struct));
691 int id;
692 int idCode;
693 union
694 {
695 struct
696 {
697 struct External * pointerExternal;
698 struct External * structExternal;
699 } __attribute__ ((gcc_struct));
700 struct
701 {
702 struct External * externalGet;
703 struct External * externalSet;
704 struct External * externalPtr;
705 struct External * externalIsSet;
706 } __attribute__ ((gcc_struct));
707 struct
708 {
709 struct External * methodExternal;
710 struct External * methodCodeExternal;
711 } __attribute__ ((gcc_struct));
712 } __attribute__ ((gcc_struct));
713 unsigned int imported;
714 unsigned int declaredStructSym;
715 struct __ecereNameSpace__ecere__com__Class * _class;
716 unsigned int declaredStruct;
717 unsigned int needConstructor;
718 unsigned int needDestructor;
719 char *  constructorName;
720 char *  structName;
721 char *  className;
722 char *  destructorName;
723 struct ModuleImport * module;
724 struct ClassImport * _import;
725 struct Location nameLoc;
726 unsigned int isParam;
727 unsigned int isRemote;
728 unsigned int isStruct;
729 unsigned int fireWatchersDone;
730 int declaring;
731 unsigned int classData;
732 unsigned int isStatic;
733 char *  shortName;
734 struct __ecereNameSpace__ecere__sys__OldList *  templateParams;
735 struct __ecereNameSpace__ecere__sys__OldList templatedClasses;
736 struct Context * ctx;
737 int isIterator;
738 struct Expression * propCategory;
739 } __attribute__ ((gcc_struct));
740
741 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Type;
742
743 struct Type
744 {
745 struct Type * prev;
746 struct Type * next;
747 int refCount;
748 union
749 {
750 struct Symbol * _class;
751 struct
752 {
753 struct __ecereNameSpace__ecere__sys__OldList members;
754 char *  enumName;
755 } __attribute__ ((gcc_struct));
756 struct
757 {
758 struct Type * returnType;
759 struct __ecereNameSpace__ecere__sys__OldList params;
760 struct Symbol * thisClass;
761 unsigned int staticMethod;
762 struct TemplateParameter * thisClassTemplate;
763 } __attribute__ ((gcc_struct));
764 struct
765 {
766 struct __ecereNameSpace__ecere__com__Method * method;
767 struct __ecereNameSpace__ecere__com__Class * methodClass;
768 struct __ecereNameSpace__ecere__com__Class * usedClass;
769 } __attribute__ ((gcc_struct));
770 struct
771 {
772 struct Type * arrayType;
773 int arraySize;
774 struct Expression * arraySizeExp;
775 unsigned int freeExp;
776 struct Symbol * enumClass;
777 } __attribute__ ((gcc_struct));
778 struct Type * type;
779 struct TemplateParameter * templateParameter;
780 } __attribute__ ((gcc_struct));
781 unsigned int isSigned;
782 int kind;
783 unsigned int constant;
784 unsigned int size;
785 char *  name;
786 char *  typeName;
787 unsigned int count;
788 unsigned int truth;
789 int classObjectType;
790 unsigned int byReference;
791 unsigned int extraParam;
792 int alignment;
793 unsigned int directClassAccess;
794 unsigned int computing;
795 unsigned int dllExport;
796 unsigned int offset;
797 unsigned int keepCast;
798 unsigned int passAsTemplate;
799 int bitFieldCount;
800 } __attribute__ ((gcc_struct));
801
802 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Class;
803
804 struct __ecereNameSpace__ecere__com__Class
805 {
806 struct __ecereNameSpace__ecere__com__Class * prev;
807 struct __ecereNameSpace__ecere__com__Class * next;
808 char *  name;
809 int offset;
810 int structSize;
811 int (* *  _vTbl)();
812 int vTblSize;
813 int (*  Constructor)(struct __ecereNameSpace__ecere__com__Instance *);
814 void (*  Destructor)(struct __ecereNameSpace__ecere__com__Instance *);
815 int offsetClass;
816 int sizeClass;
817 struct __ecereNameSpace__ecere__com__Class * base;
818 struct __ecereNameSpace__ecere__sys__BinaryTree methods;
819 struct __ecereNameSpace__ecere__sys__BinaryTree members;
820 struct __ecereNameSpace__ecere__sys__BinaryTree prop;
821 struct __ecereNameSpace__ecere__sys__OldList membersAndProperties;
822 struct __ecereNameSpace__ecere__sys__BinaryTree classProperties;
823 struct __ecereNameSpace__ecere__sys__OldList derivatives;
824 int memberID;
825 int startMemberID;
826 int type;
827 struct __ecereNameSpace__ecere__com__Instance * module;
828 struct __ecereNameSpace__ecere__com__NameSpace *  nameSpace;
829 char *  dataTypeString;
830 struct Type * dataType;
831 int typeSize;
832 int defaultAlignment;
833 void (*  Initialize)();
834 int memberOffset;
835 struct __ecereNameSpace__ecere__sys__OldList selfWatchers;
836 char *  designerClass;
837 unsigned int noExpansion;
838 char *  defaultProperty;
839 unsigned int comRedefinition;
840 int count;
841 unsigned int isRemote;
842 unsigned int internalDecl;
843 void *  data;
844 unsigned int computeSize;
845 int structAlignment;
846 int destructionWatchOffset;
847 unsigned int fixed;
848 struct __ecereNameSpace__ecere__sys__OldList delayedCPValues;
849 int inheritanceAccess;
850 char *  fullName;
851 void *  symbol;
852 struct __ecereNameSpace__ecere__sys__OldList conversions;
853 struct __ecereNameSpace__ecere__sys__OldList templateParams;
854 struct __ecereNameSpace__ecere__com__ClassTemplateArgument *  templateArgs;
855 struct __ecereNameSpace__ecere__com__Class * templateClass;
856 struct __ecereNameSpace__ecere__sys__OldList templatized;
857 int numParams;
858 } __attribute__ ((gcc_struct));
859
860 extern long long __ecereNameSpace__ecere__com__eClass_GetProperty(struct __ecereNameSpace__ecere__com__Class * _class, char *  name);
861
862 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Instance;
863
864 struct __ecereNameSpace__ecere__com__Instance
865 {
866 int (* *  _vTbl)();
867 struct __ecereNameSpace__ecere__com__Class * _class;
868 int _refCount;
869 } __attribute__ ((gcc_struct));
870
871 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__DataMember;
872
873 struct __ecereNameSpace__ecere__com__DataMember
874 {
875 struct __ecereNameSpace__ecere__com__DataMember * prev;
876 struct __ecereNameSpace__ecere__com__DataMember * next;
877 char *  name;
878 unsigned int isProperty;
879 int memberAccess;
880 int id;
881 struct __ecereNameSpace__ecere__com__Class * _class;
882 char *  dataTypeString;
883 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
884 struct Type * dataType;
885 int type;
886 int offset;
887 int memberID;
888 struct __ecereNameSpace__ecere__sys__OldList members;
889 struct __ecereNameSpace__ecere__sys__BinaryTree membersAlpha;
890 int memberOffset;
891 int structAlignment;
892 } __attribute__ ((gcc_struct));
893
894 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__SerialBuffer;
895
896 struct __ecereNameSpace__ecere__com__SerialBuffer
897 {
898 unsigned char *  _buffer;
899 unsigned int count;
900 unsigned int _size;
901 unsigned int pos;
902 } __attribute__ ((gcc_struct));
903
904 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__ClassTemplateArgument;
905
906 struct __ecereNameSpace__ecere__com__ClassTemplateArgument
907 {
908 union
909 {
910 struct
911 {
912 char *  dataTypeString;
913 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
914 } __attribute__ ((gcc_struct));
915 struct __ecereNameSpace__ecere__com__DataValue expression;
916 struct
917 {
918 char *  memberString;
919 union
920 {
921 struct __ecereNameSpace__ecere__com__DataMember * member;
922 struct __ecereNameSpace__ecere__com__Property * prop;
923 struct __ecereNameSpace__ecere__com__Method * method;
924 } __attribute__ ((gcc_struct));
925 } __attribute__ ((gcc_struct));
926 } __attribute__ ((gcc_struct));
927 } __attribute__ ((gcc_struct));
928
929 typedef uintptr_t size_t;
930
931 void exit(int status);
932
933 void * calloc(size_t nmemb, size_t size);
934
935 void free(void * ptr);
936
937 void * malloc(size_t size);
938
939 void * realloc(void * ptr, size_t size);
940
941 long int strtol(const char * nptr, char ** endptr, int base);
942
943 long long int strtoll(const char * nptr, char ** endptr, int base);
944
945 unsigned long long int strtoull(const char * nptr, char ** endptr, int base);
946
947 enum yytokentype
948 {
949 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
950 };
951
952 typedef union YYSTYPE
953 {
954 int specifierType;
955 int i;
956 int declMode;
957 struct Identifier * id;
958 struct Expression * exp;
959 struct Specifier * specifier;
960 struct __ecereNameSpace__ecere__sys__OldList * list;
961 struct Enumerator * enumerator;
962 struct Declarator * declarator;
963 struct Pointer * pointer;
964 struct Initializer * initializer;
965 struct InitDeclarator * initDeclarator;
966 struct TypeName * typeName;
967 struct Declaration * declaration;
968 struct Statement * stmt;
969 struct FunctionDefinition * function;
970 struct External * external;
971 struct Context * context;
972 struct AsmField * asmField;
973 struct Attrib * attrib;
974 struct ExtDecl * extDecl;
975 struct Attribute * attribute;
976 struct Instantiation * instance;
977 struct MembersInit * membersInit;
978 struct MemberInit * memberInit;
979 struct ClassFunction * classFunction;
980 struct ClassDefinition * _class;
981 struct ClassDef * classDef;
982 struct PropertyDef * prop;
983 char * string;
984 struct Symbol * symbol;
985 struct PropertyWatch * propertyWatch;
986 struct TemplateParameter * templateParameter;
987 struct TemplateArgument * templateArgument;
988 struct TemplateDatatype * templateDatatype;
989 struct DBTableEntry * dbtableEntry;
990 struct DBIndexItem * dbindexItem;
991 struct DBTableDef * dbtableDef;
992 } __attribute__ ((gcc_struct)) YYSTYPE;
993
994 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Enumerator;
995
996 struct Enumerator
997 {
998 struct Enumerator * prev;
999 struct Enumerator * next;
1000 struct Location loc;
1001 struct Identifier * id;
1002 struct Expression * exp;
1003 } __attribute__ ((gcc_struct));
1004
1005 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_InitDeclarator;
1006
1007 struct InitDeclarator
1008 {
1009 struct InitDeclarator * prev;
1010 struct InitDeclarator * next;
1011 struct Location loc;
1012 struct Declarator * declarator;
1013 struct Initializer * initializer;
1014 } __attribute__ ((gcc_struct));
1015
1016 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_AsmField;
1017
1018 struct AsmField
1019 {
1020 struct AsmField * prev;
1021 struct AsmField * next;
1022 struct Location loc;
1023 char *  command;
1024 struct Expression * expression;
1025 } __attribute__ ((gcc_struct));
1026
1027 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Attribute;
1028
1029 struct Attribute;
1030
1031 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassFunction;
1032
1033 struct ClassFunction
1034 {
1035 struct ClassFunction * prev;
1036 struct ClassFunction * next;
1037 struct Location loc;
1038 struct __ecereNameSpace__ecere__sys__OldList *  specifiers;
1039 struct Declarator * declarator;
1040 struct __ecereNameSpace__ecere__sys__OldList *  declarations;
1041 struct Statement * body;
1042 struct __ecereNameSpace__ecere__com__Class * _class;
1043 struct __ecereNameSpace__ecere__sys__OldList attached;
1044 int declMode;
1045 struct Type * type;
1046 struct Symbol * propSet;
1047 unsigned int isVirtual;
1048 unsigned int isConstructor;
1049 unsigned int isDestructor;
1050 unsigned int dontMangle;
1051 int id;
1052 int idCode;
1053 } __attribute__ ((gcc_struct));
1054
1055 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_MembersInit;
1056
1057 struct MembersInit
1058 {
1059 struct MembersInit * prev;
1060 struct MembersInit * next;
1061 struct Location loc;
1062 int type;
1063 union
1064 {
1065 struct __ecereNameSpace__ecere__sys__OldList *  dataMembers;
1066 struct ClassFunction * function;
1067 } __attribute__ ((gcc_struct));
1068 } __attribute__ ((gcc_struct));
1069
1070 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_MemberInit;
1071
1072 struct MemberInit
1073 {
1074 struct MemberInit * prev;
1075 struct MemberInit * next;
1076 struct Location loc;
1077 struct Location realLoc;
1078 struct __ecereNameSpace__ecere__sys__OldList *  identifiers;
1079 struct Initializer * initializer;
1080 unsigned int used;
1081 unsigned int variable;
1082 unsigned int takeOutExp;
1083 } __attribute__ ((gcc_struct));
1084
1085 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_PropertyDef;
1086
1087 struct PropertyDef
1088 {
1089 struct PropertyDef * prev;
1090 struct PropertyDef * next;
1091 struct Location loc;
1092 struct __ecereNameSpace__ecere__sys__OldList *  specifiers;
1093 struct Declarator * declarator;
1094 struct Identifier * id;
1095 struct Statement * getStmt;
1096 struct Statement * setStmt;
1097 struct Statement * issetStmt;
1098 struct Symbol * symbol;
1099 unsigned int conversion;
1100 unsigned int isWatchable;
1101 struct Expression * category;
1102 } __attribute__ ((gcc_struct));
1103
1104 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_PropertyWatch;
1105
1106 struct PropertyWatch
1107 {
1108 struct PropertyWatch * prev;
1109 struct PropertyWatch * next;
1110 struct Location loc;
1111 struct Statement * compound;
1112 struct __ecereNameSpace__ecere__sys__OldList *  properties;
1113 unsigned int deleteWatch;
1114 } __attribute__ ((gcc_struct));
1115
1116 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassDef;
1117
1118 struct ClassDef
1119 {
1120 struct ClassDef * prev;
1121 struct ClassDef * next;
1122 struct Location loc;
1123 int type;
1124 union
1125 {
1126 struct Declaration * decl;
1127 struct ClassFunction * function;
1128 struct __ecereNameSpace__ecere__sys__OldList *  defProperties;
1129 struct PropertyDef * propertyDef;
1130 struct PropertyWatch * propertyWatch;
1131 char *  designer;
1132 struct Identifier * defaultProperty;
1133 struct
1134 {
1135 struct Identifier * id;
1136 struct Initializer * initializer;
1137 } __attribute__ ((gcc_struct));
1138 } __attribute__ ((gcc_struct));
1139 int memberAccess;
1140 void *  object;
1141 } __attribute__ ((gcc_struct));
1142
1143 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_DBTableEntry;
1144
1145 struct DBTableEntry;
1146
1147 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_DBIndexItem;
1148
1149 struct DBIndexItem;
1150
1151 extern YYSTYPE yylval;
1152
1153 extern struct Location yylloc;
1154
1155 extern struct __ecereNameSpace__ecere__sys__OldList * ast;
1156
1157 extern int returnCode;
1158
1159 extern struct Expression * parsedExpression;
1160
1161 extern unsigned int yydebug;
1162
1163 void SetYydebug(unsigned int b)
1164 {
1165 yydebug = b;
1166 }
1167
1168 extern unsigned int echoOn;
1169
1170 void resetScanner();
1171
1172 int propWatcherID;
1173
1174 int expression_yyparse();
1175
1176 static struct Statement * curCompound;
1177
1178 struct External * curExternal, * afterExternal;
1179
1180 static struct Type * curSwitchType;
1181
1182 static struct __ecereNameSpace__ecere__com__Class * currentClass;
1183
1184 struct __ecereNameSpace__ecere__com__Class * thisClass;
1185
1186 void SetThisClass(struct __ecereNameSpace__ecere__com__Class * c)
1187 {
1188 thisClass = c;
1189 }
1190
1191 struct __ecereNameSpace__ecere__com__Class * GetThisClass()
1192 {
1193 return thisClass;
1194 }
1195
1196 static char * thisNameSpace;
1197
1198 struct __ecereNameSpace__ecere__com__Class * containerClass;
1199
1200 unsigned int thisClassParams = 0x1;
1201
1202 unsigned int internalValueCounter;
1203
1204 extern void OutputExpression(struct Expression * exp, struct __ecereNameSpace__ecere__com__Instance * f);
1205
1206 extern int strlen(const char * );
1207
1208 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__TempFile;
1209
1210 extern void *  __ecereNameSpace__ecere__com__eInstance_New(struct __ecereNameSpace__ecere__com__Class * _class);
1211
1212 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek;
1213
1214 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Read;
1215
1216 extern void __ecereNameSpace__ecere__com__eInstance_DecRef(struct __ecereNameSpace__ecere__com__Instance * instance);
1217
1218 void PrintExpression(struct Expression * exp, char * string)
1219 {
1220 {
1221 struct __ecereNameSpace__ecere__com__Instance * f = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
1222 int count;
1223
1224 if(exp)
1225 OutputExpression(exp, f);
1226 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))f->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(f, 0, 0);
1227 count = strlen(string);
1228 count += ((int (*)(struct __ecereNameSpace__ecere__com__Instance *, void *  buffer, unsigned int size, unsigned int count))f->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Read])(f, string + count, 1, 1023);
1229 string[count] = '\0';
1230 (__ecereNameSpace__ecere__com__eInstance_DecRef(f), f = 0);
1231 }
1232 }
1233
1234 extern struct Type * ProcessTypeString(char *  string, unsigned int staticMethod);
1235
1236 extern struct Type * ProcessType(struct __ecereNameSpace__ecere__sys__OldList * specs, struct Declarator * decl);
1237
1238 struct Type * ProcessTemplateParameterType(struct TemplateParameter * param)
1239 {
1240 if(param && param->type == 0 && (param->dataType || param->dataTypeString))
1241 {
1242 if(!param->baseType)
1243 {
1244 if(param->dataTypeString)
1245 param->baseType = ProcessTypeString(param->dataTypeString, 0x0);
1246 else
1247 param->baseType = ProcessType(param->dataType->specifiers, param->dataType->decl);
1248 }
1249 return param->baseType;
1250 }
1251 return (((void *)0));
1252 }
1253
1254 unsigned int NeedCast(struct Type * type1, struct Type * type2)
1255 {
1256 if(!type1 || !type2 || type1->keepCast || type2->keepCast)
1257 return 0x1;
1258 if(type1->kind == 20 && type2->kind == 4 && type2->passAsTemplate == 0x0)
1259 {
1260 return 0x0;
1261 }
1262 if(type1->kind == type2->kind)
1263 {
1264 switch(type1->kind)
1265 {
1266 case 1:
1267 case 2:
1268 case 3:
1269 case 4:
1270 case 22:
1271 if(type1->passAsTemplate && !type2->passAsTemplate)
1272 return 0x1;
1273 return type1->isSigned != type2->isSigned;
1274 case 8:
1275 return type1->_class != type2->_class;
1276 case 13:
1277 return NeedCast(type1->type, type2->type);
1278 default:
1279 return 0x1;
1280 }
1281 }
1282 return 0x1;
1283 }
1284
1285 extern int strcmp(const char * , const char * );
1286
1287 extern struct Context * curContext;
1288
1289 extern struct Context * topContext;
1290
1291 extern unsigned int __ecereNameSpace__ecere__com__eClass_IsDerived(struct __ecereNameSpace__ecere__com__Class * _class, struct __ecereNameSpace__ecere__com__Class * from);
1292
1293 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);
1294
1295 extern struct __ecereNameSpace__ecere__com__Instance * privateModule;
1296
1297 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);
1298
1299 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);
1300
1301 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__ClassProperty;
1302
1303 struct __ecereNameSpace__ecere__com__ClassProperty
1304 {
1305 char *  name;
1306 struct __ecereNameSpace__ecere__com__ClassProperty * parent;
1307 struct __ecereNameSpace__ecere__com__ClassProperty * left;
1308 struct __ecereNameSpace__ecere__com__ClassProperty * right;
1309 int depth;
1310 void (*  Set)(struct __ecereNameSpace__ecere__com__Class *, long long);
1311 long long (*  Get)(struct __ecereNameSpace__ecere__com__Class *);
1312 char *  dataTypeString;
1313 struct Type * dataType;
1314 unsigned int constant;
1315 } __attribute__ ((gcc_struct));
1316
1317 extern struct __ecereNameSpace__ecere__com__ClassProperty * __ecereNameSpace__ecere__com__eClass_FindClassProperty(struct __ecereNameSpace__ecere__com__Class * _class, char *  name);
1318
1319 extern struct Expression * QMkExpId(char *  id);
1320
1321 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__ClassTemplateParameter;
1322
1323 struct __ecereNameSpace__ecere__com__ClassTemplateParameter
1324 {
1325 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * prev;
1326 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * next;
1327 char *  name;
1328 int type;
1329 union
1330 {
1331 char *  dataTypeString;
1332 int memberType;
1333 } __attribute__ ((gcc_struct));
1334 struct __ecereNameSpace__ecere__com__ClassTemplateArgument defaultArg;
1335 void *  param;
1336 } __attribute__ ((gcc_struct));
1337
1338 extern struct Expression * GetTemplateArgExpByName(char *  paramName, struct __ecereNameSpace__ecere__com__Class * curClass, int tplType);
1339
1340 extern struct __ecereNameSpace__ecere__sys__OldList *  MkList(void);
1341
1342 extern void FreeIdentifier(struct Identifier * id);
1343
1344 void ProcessExpressionType(struct Expression * exp);
1345
1346 extern struct Declarator * SpecDeclFromString(char *  string, struct __ecereNameSpace__ecere__sys__OldList *  specs, struct Declarator * baseDecl);
1347
1348 extern struct __ecereNameSpace__ecere__sys__OldList *  MkListOne(void *  item);
1349
1350 extern struct Expression * MkExpOp(struct Expression * exp1, int op, struct Expression * exp2);
1351
1352 extern struct Expression * MkExpCast(struct TypeName * typeName, struct Expression * expression);
1353
1354 extern struct TypeName * MkTypeName(struct __ecereNameSpace__ecere__sys__OldList * qualifiers, struct Declarator * declarator);
1355
1356 extern struct Declarator * MkDeclaratorPointer(struct Pointer * pointer, struct Declarator * declarator);
1357
1358 extern struct Pointer * MkPointer(struct __ecereNameSpace__ecere__sys__OldList * qualifiers, struct Pointer * pointer);
1359
1360 struct __ecereNameSpace__ecere__sys__BTNode * __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(struct __ecereNameSpace__ecere__sys__BinaryTree * this, char *  key);
1361
1362 static void ReplaceClassMembers(struct Expression * exp, struct __ecereNameSpace__ecere__com__Class * _class)
1363 {
1364 if(exp->type == 0 && exp->identifier)
1365 {
1366 struct Identifier * id = exp->identifier;
1367 struct Context * ctx;
1368 struct Symbol * symbol = (((void *)0));
1369
1370 if(!id->_class || !id->_class->name || strcmp(id->_class->name, "property"))
1371 {
1372 for(ctx = curContext; ctx != topContext->parent && !symbol; ctx = ctx->parent)
1373 {
1374 symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(&ctx->symbols, id->string);
1375 if(symbol)
1376 break;
1377 }
1378 }
1379 if(!symbol && ((!id->_class || (id->_class->name && !strcmp(id->_class->name, "property"))) || (id->classSym && __ecereNameSpace__ecere__com__eClass_IsDerived(_class, id->classSym->registered))))
1380 {
1381 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
1382 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
1383 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
1384 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
1385
1386 if(!prop)
1387 {
1388 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule);
1389 }
1390 if(!prop && !method)
1391 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
1392 if(!prop && !method && !member)
1393 {
1394 classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(_class, id->string);
1395 }
1396 if(prop || method || member || classProp)
1397 {
1398 exp->type = 8;
1399 exp->member.member = id;
1400 exp->member.memberType = 0;
1401 exp->member.exp = QMkExpId("this");
1402 exp->addedThis = 0x1;
1403 }
1404 else if(_class && _class->templateParams.first)
1405 {
1406 struct __ecereNameSpace__ecere__com__Class * sClass;
1407
1408 for(sClass = _class; sClass; sClass = sClass->base)
1409 {
1410 if(sClass->templateParams.first)
1411 {
1412 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
1413
1414 for(param = sClass->templateParams.first; param; param = param->next)
1415 {
1416 if(param->type == 2 && !strcmp(param->name, id->string))
1417 {
1418 struct Expression * argExp = GetTemplateArgExpByName(param->name, _class, 2);
1419
1420 if(argExp)
1421 {
1422 struct Declarator * decl;
1423 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
1424
1425 FreeIdentifier(exp->member.member);
1426 ProcessExpressionType(argExp);
1427 decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
1428 exp->expType = ProcessType(specs, decl);
1429 exp->type = 5;
1430 exp->list = MkListOne(MkExpOp((((void *)0)), '*', MkExpCast(MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl)), MkExpOp((((void *)0)), '&', argExp))));
1431 }
1432 }
1433 }
1434 }
1435 }
1436 }
1437 }
1438 }
1439 }
1440
1441 extern int sprintf(char * , char * , ...);
1442
1443 extern int __ecereNameSpace__ecere__com__GetRuntimePlatform(void);
1444
1445 extern char *  __ecereNameSpace__ecere__sys__CopyString(char *  string);
1446
1447 char * PrintInt(long long result)
1448 {
1449 char temp[100];
1450
1451 if(result > (((long long)0x7fffffffffffffffLL)))
1452 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1453 else
1454 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "%I64dLL" : "%lldLL"), result);
1455 return __ecereNameSpace__ecere__sys__CopyString(temp);
1456 }
1457
1458 char * PrintUInt(uint64 result)
1459 {
1460 char temp[100];
1461
1462 if(result > (0xffffffff))
1463 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1464 else if(result > (((int)0x7fffffff)))
1465 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64X" : "0x%llX"), result);
1466 else
1467 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "%I64d" : "%lld"), result);
1468 return __ecereNameSpace__ecere__sys__CopyString(temp);
1469 }
1470
1471 char * PrintInt64(long long result)
1472 {
1473 char temp[100];
1474
1475 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "%I64dLL" : "%lldLL"), result);
1476 return __ecereNameSpace__ecere__sys__CopyString(temp);
1477 }
1478
1479 char * PrintUInt64(uint64 result)
1480 {
1481 char temp[100];
1482
1483 if(result > (((long long)0x7fffffffffffffffLL)))
1484 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1485 else
1486 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "%I64dLL" : "%lldLL"), result);
1487 return __ecereNameSpace__ecere__sys__CopyString(temp);
1488 }
1489
1490 char * PrintHexUInt(uint64 result)
1491 {
1492 char temp[100];
1493
1494 if(result > (0xffffffff))
1495 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1496 else
1497 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64X" : "0x%llX"), result);
1498 return __ecereNameSpace__ecere__sys__CopyString(temp);
1499 }
1500
1501 char * PrintHexUInt64(uint64 result)
1502 {
1503 char temp[100];
1504
1505 if(result > (0xffffffff))
1506 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1507 else
1508 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64X" : "0x%llX"), result);
1509 return __ecereNameSpace__ecere__sys__CopyString(temp);
1510 }
1511
1512 char * PrintShort(short result)
1513 {
1514 char temp[100];
1515
1516 sprintf(temp, "%d", (unsigned short)result);
1517 return __ecereNameSpace__ecere__sys__CopyString(temp);
1518 }
1519
1520 char * PrintUShort(unsigned short result)
1521 {
1522 char temp[100];
1523
1524 if(result > (unsigned short)32767)
1525 sprintf(temp, "0x%X", (int)result);
1526 else
1527 sprintf(temp, "%d", result);
1528 return __ecereNameSpace__ecere__sys__CopyString(temp);
1529 }
1530
1531 extern int isprint(int c);
1532
1533 char * PrintChar(char result)
1534 {
1535 char temp[100];
1536
1537 if(result > (char)0 && isprint(result))
1538 sprintf(temp, "'%c'", result);
1539 else if(result < (char)0)
1540 sprintf(temp, "%d", result);
1541 else
1542 sprintf(temp, "0x%X", (unsigned char)result);
1543 return __ecereNameSpace__ecere__sys__CopyString(temp);
1544 }
1545
1546 char * PrintUChar(unsigned char result)
1547 {
1548 char temp[100];
1549
1550 sprintf(temp, "0x%X", result);
1551 return __ecereNameSpace__ecere__sys__CopyString(temp);
1552 }
1553
1554 char * PrintFloat(float result)
1555 {
1556 char temp[350];
1557
1558 sprintf(temp, "%.16ff", result);
1559 return __ecereNameSpace__ecere__sys__CopyString(temp);
1560 }
1561
1562 char * PrintDouble(double result)
1563 {
1564 char temp[350];
1565
1566 sprintf(temp, "%.16f", result);
1567 return __ecereNameSpace__ecere__sys__CopyString(temp);
1568 }
1569
1570 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_OpTable;
1571
1572 struct OpTable
1573 {
1574 unsigned int (*  Add)(struct Expression *, struct Operand *, struct Operand *);
1575 unsigned int (*  Sub)(struct Expression *, struct Operand *, struct Operand *);
1576 unsigned int (*  Mul)(struct Expression *, struct Operand *, struct Operand *);
1577 unsigned int (*  Div)(struct Expression *, struct Operand *, struct Operand *);
1578 unsigned int (*  Mod)(struct Expression *, struct Operand *, struct Operand *);
1579 unsigned int (*  Neg)(struct Expression *, struct Operand *);
1580 unsigned int (*  Inc)(struct Expression *, struct Operand *);
1581 unsigned int (*  Dec)(struct Expression *, struct Operand *);
1582 unsigned int (*  Asign)(struct Expression *, struct Operand *, struct Operand *);
1583 unsigned int (*  AddAsign)(struct Expression *, struct Operand *, struct Operand *);
1584 unsigned int (*  SubAsign)(struct Expression *, struct Operand *, struct Operand *);
1585 unsigned int (*  MulAsign)(struct Expression *, struct Operand *, struct Operand *);
1586 unsigned int (*  DivAsign)(struct Expression *, struct Operand *, struct Operand *);
1587 unsigned int (*  ModAsign)(struct Expression *, struct Operand *, struct Operand *);
1588 unsigned int (*  BitAnd)(struct Expression *, struct Operand *, struct Operand *);
1589 unsigned int (*  BitOr)(struct Expression *, struct Operand *, struct Operand *);
1590 unsigned int (*  BitXor)(struct Expression *, struct Operand *, struct Operand *);
1591 unsigned int (*  LShift)(struct Expression *, struct Operand *, struct Operand *);
1592 unsigned int (*  RShift)(struct Expression *, struct Operand *, struct Operand *);
1593 unsigned int (*  BitNot)(struct Expression *, struct Operand *);
1594 unsigned int (*  AndAsign)(struct Expression *, struct Operand *, struct Operand *);
1595 unsigned int (*  OrAsign)(struct Expression *, struct Operand *, struct Operand *);
1596 unsigned int (*  XorAsign)(struct Expression *, struct Operand *, struct Operand *);
1597 unsigned int (*  LShiftAsign)(struct Expression *, struct Operand *, struct Operand *);
1598 unsigned int (*  RShiftAsign)(struct Expression *, struct Operand *, struct Operand *);
1599 unsigned int (*  Not)(struct Expression *, struct Operand *);
1600 unsigned int (*  Equ)(struct Expression *, struct Operand *, struct Operand *);
1601 unsigned int (*  Nqu)(struct Expression *, struct Operand *, struct Operand *);
1602 unsigned int (*  And)(struct Expression *, struct Operand *, struct Operand *);
1603 unsigned int (*  Or)(struct Expression *, struct Operand *, struct Operand *);
1604 unsigned int (*  Grt)(struct Expression *, struct Operand *, struct Operand *);
1605 unsigned int (*  Sma)(struct Expression *, struct Operand *, struct Operand *);
1606 unsigned int (*  GrtEqu)(struct Expression *, struct Operand *, struct Operand *);
1607 unsigned int (*  SmaEqu)(struct Expression *, struct Operand *, struct Operand *);
1608 unsigned int (*  Cond)(struct Expression *, struct Operand *, struct Operand *, struct Operand *);
1609 } __attribute__ ((gcc_struct));
1610
1611 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Operand;
1612
1613 struct Operand
1614 {
1615 int kind;
1616 struct Type * type;
1617 unsigned int ptrSize;
1618 union
1619 {
1620 char c;
1621 unsigned char uc;
1622 short s;
1623 unsigned short us;
1624 int i;
1625 unsigned int ui;
1626 float f;
1627 double d;
1628 long long i64;
1629 uint64 ui64;
1630 } __attribute__ ((gcc_struct));
1631 struct OpTable ops;
1632 } __attribute__ ((gcc_struct));
1633
1634 struct Operand GetOperand(struct Expression * exp);
1635
1636 unsigned int GetInt(struct Expression * exp, int * value2)
1637 {
1638 struct Operand op2 = GetOperand(exp);
1639
1640 if(op2.kind == 3 && op2.type->isSigned)
1641 *value2 = op2.i;
1642 else if(op2.kind == 3)
1643 *value2 = (int)op2.ui;
1644 if(op2.kind == 4 && op2.type->isSigned)
1645 *value2 = (int)op2.i64;
1646 else if(op2.kind == 4)
1647 *value2 = (int)op2.ui64;
1648 else if(op2.kind == 22 && op2.type->isSigned)
1649 *value2 = (int)op2.i64;
1650 else if(op2.kind == 22)
1651 *value2 = (int)op2.ui64;
1652 else if(op2.kind == 2 && op2.type->isSigned)
1653 *value2 = (int)op2.s;
1654 else if(op2.kind == 2)
1655 *value2 = (int)op2.us;
1656 else if(op2.kind == 1 && op2.type->isSigned)
1657 *value2 = (int)op2.c;
1658 else if(op2.kind == 1)
1659 *value2 = (int)op2.uc;
1660 else if(op2.kind == 6)
1661 *value2 = (int)op2.f;
1662 else if(op2.kind == 7)
1663 *value2 = (int)op2.d;
1664 else if(op2.kind == 13)
1665 *value2 = (int)op2.ui64;
1666 else
1667 return 0x0;
1668 return 0x1;
1669 }
1670
1671 unsigned int GetUInt(struct Expression * exp, unsigned int * value2)
1672 {
1673 struct Operand op2 = GetOperand(exp);
1674
1675 if(op2.kind == 3 && op2.type->isSigned)
1676 *value2 = (unsigned int)op2.i;
1677 else if(op2.kind == 3)
1678 *value2 = op2.ui;
1679 if(op2.kind == 4 && op2.type->isSigned)
1680 *value2 = (unsigned int)op2.i64;
1681 else if(op2.kind == 4)
1682 *value2 = (unsigned int)op2.ui64;
1683 else if(op2.kind == 22 && op2.type->isSigned)
1684 *value2 = (unsigned int)op2.i64;
1685 else if(op2.kind == 22)
1686 *value2 = (unsigned int)op2.ui64;
1687 else if(op2.kind == 2 && op2.type->isSigned)
1688 *value2 = (unsigned int)op2.s;
1689 else if(op2.kind == 2)
1690 *value2 = (unsigned int)op2.us;
1691 else if(op2.kind == 1 && op2.type->isSigned)
1692 *value2 = (unsigned int)op2.c;
1693 else if(op2.kind == 1)
1694 *value2 = (unsigned int)op2.uc;
1695 else if(op2.kind == 6)
1696 *value2 = (unsigned int)op2.f;
1697 else if(op2.kind == 7)
1698 *value2 = (unsigned int)op2.d;
1699 else if(op2.kind == 13)
1700 *value2 = (unsigned int)op2.ui64;
1701 else
1702 return 0x0;
1703 return 0x1;
1704 }
1705
1706 unsigned int GetInt64(struct Expression * exp, long long * value2)
1707 {
1708 struct Operand op2 = GetOperand(exp);
1709
1710 if(op2.kind == 3 && op2.type->isSigned)
1711 *value2 = (long long)op2.i;
1712 else if(op2.kind == 3)
1713 *value2 = (long long)op2.ui;
1714 if(op2.kind == 4 && op2.type->isSigned)
1715 *value2 = op2.i64;
1716 else if(op2.kind == 4)
1717 *value2 = (long long)op2.ui64;
1718 else if(op2.kind == 22 && op2.type->isSigned)
1719 *value2 = op2.i64;
1720 else if(op2.kind == 22)
1721 *value2 = (long long)op2.ui64;
1722 else if(op2.kind == 2 && op2.type->isSigned)
1723 *value2 = (long long)op2.s;
1724 else if(op2.kind == 2)
1725 *value2 = (long long)op2.us;
1726 else if(op2.kind == 1 && op2.type->isSigned)
1727 *value2 = (long long)op2.c;
1728 else if(op2.kind == 1)
1729 *value2 = (long long)op2.uc;
1730 else if(op2.kind == 6)
1731 *value2 = (long long)op2.f;
1732 else if(op2.kind == 7)
1733 *value2 = (long long)op2.d;
1734 else if(op2.kind == 13)
1735 *value2 = (long long)op2.ui64;
1736 else
1737 return 0x0;
1738 return 0x1;
1739 }
1740
1741 unsigned int GetUInt64(struct Expression * exp, uint64 * value2)
1742 {
1743 struct Operand op2 = GetOperand(exp);
1744
1745 if(op2.kind == 3 && op2.type->isSigned)
1746 *value2 = (uint64)op2.i;
1747 else if(op2.kind == 3)
1748 *value2 = (uint64)op2.ui;
1749 if(op2.kind == 4 && op2.type->isSigned)
1750 *value2 = (uint64)op2.i64;
1751 else if(op2.kind == 4)
1752 *value2 = op2.ui64;
1753 else if(op2.kind == 22 && op2.type->isSigned)
1754 *value2 = (uint64)op2.i64;
1755 else if(op2.kind == 22)
1756 *value2 = op2.ui64;
1757 else if(op2.kind == 2 && op2.type->isSigned)
1758 *value2 = (uint64)op2.s;
1759 else if(op2.kind == 2)
1760 *value2 = (uint64)op2.us;
1761 else if(op2.kind == 1 && op2.type->isSigned)
1762 *value2 = (uint64)op2.c;
1763 else if(op2.kind == 1)
1764 *value2 = (uint64)op2.uc;
1765 else if(op2.kind == 6)
1766 *value2 = (uint64)op2.f;
1767 else if(op2.kind == 7)
1768 *value2 = (uint64)op2.d;
1769 else if(op2.kind == 13)
1770 *value2 = op2.ui64;
1771 else
1772 return 0x0;
1773 return 0x1;
1774 }
1775
1776 unsigned int GetIntPtr(struct Expression * exp, intptr_t * value2)
1777 {
1778 struct Operand op2 = GetOperand(exp);
1779
1780 if(op2.kind == 3 && op2.type->isSigned)
1781 *value2 = (intptr_t)op2.i;
1782 else if(op2.kind == 3)
1783 *value2 = (intptr_t)op2.ui;
1784 if(op2.kind == 4 && op2.type->isSigned)
1785 *value2 = (intptr_t)op2.i64;
1786 else if(op2.kind == 4)
1787 *value2 = (intptr_t)op2.ui64;
1788 else if(op2.kind == 22 && op2.type->isSigned)
1789 *value2 = (intptr_t)op2.i64;
1790 else if(op2.kind == 22)
1791 *value2 = (intptr_t)op2.ui64;
1792 else if(op2.kind == 2 && op2.type->isSigned)
1793 *value2 = (intptr_t)op2.s;
1794 else if(op2.kind == 2)
1795 *value2 = (intptr_t)op2.us;
1796 else if(op2.kind == 1 && op2.type->isSigned)
1797 *value2 = (intptr_t)op2.c;
1798 else if(op2.kind == 1)
1799 *value2 = (intptr_t)op2.uc;
1800 else if(op2.kind == 6)
1801 *value2 = (intptr_t)op2.f;
1802 else if(op2.kind == 7)
1803 *value2 = (intptr_t)op2.d;
1804 else if(op2.kind == 13)
1805 *value2 = (intptr_t)op2.ui64;
1806 else
1807 return 0x0;
1808 return 0x1;
1809 }
1810
1811 unsigned int GetUIntPtr(struct Expression * exp, uintptr_t * value2)
1812 {
1813 struct Operand op2 = GetOperand(exp);
1814
1815 if(op2.kind == 3 && op2.type->isSigned)
1816 *value2 = (uintptr_t)op2.i;
1817 else if(op2.kind == 3)
1818 *value2 = (uintptr_t)op2.ui;
1819 if(op2.kind == 4 && op2.type->isSigned)
1820 *value2 = (uintptr_t)op2.i64;
1821 else if(op2.kind == 4)
1822 *value2 = (uintptr_t)op2.ui64;
1823 else if(op2.kind == 22 && op2.type->isSigned)
1824 *value2 = (uintptr_t)op2.i64;
1825 else if(op2.kind == 22)
1826 *value2 = (uintptr_t)op2.ui64;
1827 else if(op2.kind == 2 && op2.type->isSigned)
1828 *value2 = (uintptr_t)op2.s;
1829 else if(op2.kind == 2)
1830 *value2 = (uintptr_t)op2.us;
1831 else if(op2.kind == 1 && op2.type->isSigned)
1832 *value2 = (uintptr_t)op2.c;
1833 else if(op2.kind == 1)
1834 *value2 = (uintptr_t)op2.uc;
1835 else if(op2.kind == 6)
1836 *value2 = (uintptr_t)op2.f;
1837 else if(op2.kind == 7)
1838 *value2 = (uintptr_t)op2.d;
1839 else if(op2.kind == 13)
1840 *value2 = (uintptr_t)op2.ui64;
1841 else
1842 return 0x0;
1843 return 0x1;
1844 }
1845
1846 unsigned int GetShort(struct Expression * exp, short * value2)
1847 {
1848 struct Operand op2 = GetOperand(exp);
1849
1850 if(op2.kind == 3 && op2.type->isSigned)
1851 *value2 = (short)op2.i;
1852 else if(op2.kind == 3)
1853 *value2 = (short)op2.ui;
1854 if(op2.kind == 4 && op2.type->isSigned)
1855 *value2 = (short)op2.i64;
1856 else if(op2.kind == 4)
1857 *value2 = (short)op2.ui64;
1858 else if(op2.kind == 22 && op2.type->isSigned)
1859 *value2 = (short)op2.i64;
1860 else if(op2.kind == 22)
1861 *value2 = (short)op2.ui64;
1862 else if(op2.kind == 2 && op2.type->isSigned)
1863 *value2 = op2.s;
1864 else if(op2.kind == 2)
1865 *value2 = (short)op2.us;
1866 else if(op2.kind == 1 && op2.type->isSigned)
1867 *value2 = (short)op2.c;
1868 else if(op2.kind == 1)
1869 *value2 = (short)op2.uc;
1870 else if(op2.kind == 6)
1871 *value2 = (short)op2.f;
1872 else if(op2.kind == 7)
1873 *value2 = (short)op2.d;
1874 else if(op2.kind == 13)
1875 *value2 = (short)op2.ui64;
1876 else
1877 return 0x0;
1878 return 0x1;
1879 }
1880
1881 unsigned int GetUShort(struct Expression * exp, unsigned short * value2)
1882 {
1883 struct Operand op2 = GetOperand(exp);
1884
1885 if(op2.kind == 3 && op2.type->isSigned)
1886 *value2 = (unsigned short)op2.i;
1887 else if(op2.kind == 3)
1888 *value2 = (unsigned short)op2.ui;
1889 if(op2.kind == 4 && op2.type->isSigned)
1890 *value2 = (unsigned short)op2.i64;
1891 else if(op2.kind == 4)
1892 *value2 = (unsigned short)op2.ui64;
1893 else if(op2.kind == 22 && op2.type->isSigned)
1894 *value2 = (unsigned short)op2.i64;
1895 else if(op2.kind == 22)
1896 *value2 = (unsigned short)op2.ui64;
1897 else if(op2.kind == 2 && op2.type->isSigned)
1898 *value2 = (unsigned short)op2.s;
1899 else if(op2.kind == 2)
1900 *value2 = op2.us;
1901 else if(op2.kind == 1 && op2.type->isSigned)
1902 *value2 = (unsigned short)op2.c;
1903 else if(op2.kind == 1)
1904 *value2 = (unsigned short)op2.uc;
1905 else if(op2.kind == 6)
1906 *value2 = (unsigned short)op2.f;
1907 else if(op2.kind == 7)
1908 *value2 = (unsigned short)op2.d;
1909 else if(op2.kind == 13)
1910 *value2 = (unsigned short)op2.ui64;
1911 else
1912 return 0x0;
1913 return 0x1;
1914 }
1915
1916 unsigned int GetChar(struct Expression * exp, char * value2)
1917 {
1918 struct Operand op2 = GetOperand(exp);
1919
1920 if(op2.kind == 3 && op2.type->isSigned)
1921 *value2 = (char)op2.i;
1922 else if(op2.kind == 3)
1923 *value2 = (char)op2.ui;
1924 if(op2.kind == 4 && op2.type->isSigned)
1925 *value2 = (char)op2.i64;
1926 else if(op2.kind == 4)
1927 *value2 = (char)op2.ui64;
1928 else if(op2.kind == 22 && op2.type->isSigned)
1929 *value2 = (char)op2.i64;
1930 else if(op2.kind == 22)
1931 *value2 = (char)op2.ui64;
1932 else if(op2.kind == 2 && op2.type->isSigned)
1933 *value2 = (char)op2.s;
1934 else if(op2.kind == 2)
1935 *value2 = (char)op2.us;
1936 else if(op2.kind == 1 && op2.type->isSigned)
1937 *value2 = op2.c;
1938 else if(op2.kind == 1)
1939 *value2 = (char)op2.uc;
1940 else if(op2.kind == 6)
1941 *value2 = (char)op2.f;
1942 else if(op2.kind == 7)
1943 *value2 = (char)op2.d;
1944 else if(op2.kind == 13)
1945 *value2 = (char)op2.ui64;
1946 else
1947 return 0x0;
1948 return 0x1;
1949 }
1950
1951 unsigned int GetUChar(struct Expression * exp, unsigned char * value2)
1952 {
1953 struct Operand op2 = GetOperand(exp);
1954
1955 if(op2.kind == 3 && op2.type->isSigned)
1956 *value2 = (unsigned char)op2.i;
1957 else if(op2.kind == 3)
1958 *value2 = (unsigned char)op2.ui;
1959 if(op2.kind == 4 && op2.type->isSigned)
1960 *value2 = (unsigned char)op2.i64;
1961 else if(op2.kind == 4)
1962 *value2 = (unsigned char)op2.ui64;
1963 else if(op2.kind == 22 && op2.type->isSigned)
1964 *value2 = (unsigned char)op2.i64;
1965 else if(op2.kind == 22)
1966 *value2 = (unsigned char)op2.ui64;
1967 else if(op2.kind == 2 && op2.type->isSigned)
1968 *value2 = (unsigned char)op2.s;
1969 else if(op2.kind == 2)
1970 *value2 = (unsigned char)op2.us;
1971 else if(op2.kind == 1 && op2.type->isSigned)
1972 *value2 = (unsigned char)op2.c;
1973 else if(op2.kind == 1)
1974 *value2 = op2.uc;
1975 else if(op2.kind == 6)
1976 *value2 = (unsigned char)op2.f;
1977 else if(op2.kind == 7)
1978 *value2 = (unsigned char)op2.d;
1979 else if(op2.kind == 13)
1980 *value2 = (unsigned char)op2.ui64;
1981 else
1982 return 0x0;
1983 return 0x1;
1984 }
1985
1986 unsigned int GetFloat(struct Expression * exp, float * value2)
1987 {
1988 struct Operand op2 = GetOperand(exp);
1989
1990 if(op2.kind == 3 && op2.type->isSigned)
1991 *value2 = (float)(float)op2.i;
1992 else if(op2.kind == 3)
1993 *value2 = (float)(float)op2.ui;
1994 if(op2.kind == 4 && op2.type->isSigned)
1995 *value2 = (float)(float)op2.i64;
1996 else if(op2.kind == 4)
1997 *value2 = (float)(float)op2.ui64;
1998 else if(op2.kind == 22 && op2.type->isSigned)
1999 *value2 = (float)(float)op2.i64;
2000 else if(op2.kind == 22)
2001 *value2 = (float)(float)op2.ui64;
2002 else if(op2.kind == 2 && op2.type->isSigned)
2003 *value2 = (float)(float)op2.s;
2004 else if(op2.kind == 2)
2005 *value2 = (float)(float)op2.us;
2006 else if(op2.kind == 1 && op2.type->isSigned)
2007 *value2 = (float)(float)op2.c;
2008 else if(op2.kind == 1)
2009 *value2 = (float)(float)op2.uc;
2010 else if(op2.kind == 6)
2011 *value2 = (float)op2.f;
2012 else if(op2.kind == 7)
2013 *value2 = (float)op2.d;
2014 else if(op2.kind == 13)
2015 *value2 = (float)(float)op2.ui64;
2016 else
2017 return 0x0;
2018 return 0x1;
2019 }
2020
2021 unsigned int GetDouble(struct Expression * exp, double * value2)
2022 {
2023 struct Operand op2 = GetOperand(exp);
2024
2025 if(op2.kind == 3 && op2.type->isSigned)
2026 *value2 = (double)(double)op2.i;
2027 else if(op2.kind == 3)
2028 *value2 = (double)(double)op2.ui;
2029 if(op2.kind == 4 && op2.type->isSigned)
2030 *value2 = (double)(double)op2.i64;
2031 else if(op2.kind == 4)
2032 *value2 = (double)(double)op2.ui64;
2033 else if(op2.kind == 22 && op2.type->isSigned)
2034 *value2 = (double)(double)op2.i64;
2035 else if(op2.kind == 22)
2036 *value2 = (double)(double)op2.ui64;
2037 else if(op2.kind == 2 && op2.type->isSigned)
2038 *value2 = (double)(double)op2.s;
2039 else if(op2.kind == 2)
2040 *value2 = (double)(double)op2.us;
2041 else if(op2.kind == 1 && op2.type->isSigned)
2042 *value2 = (double)(double)op2.c;
2043 else if(op2.kind == 1)
2044 *value2 = (double)(double)op2.uc;
2045 else if(op2.kind == 6)
2046 *value2 = (double)op2.f;
2047 else if(op2.kind == 7)
2048 *value2 = (double)op2.d;
2049 else if(op2.kind == 13)
2050 *value2 = (double)(double)op2.ui64;
2051 else
2052 return 0x0;
2053 return 0x1;
2054 }
2055
2056 void ComputeExpression(struct Expression * exp);
2057
2058 struct Context * SetupTemplatesContext(struct __ecereNameSpace__ecere__com__Class * _class);
2059
2060 extern int targetBits;
2061
2062 int ComputeTypeSize(struct Type * type);
2063
2064 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__BitMember;
2065
2066 struct __ecereNameSpace__ecere__com__BitMember
2067 {
2068 struct __ecereNameSpace__ecere__com__BitMember * prev;
2069 struct __ecereNameSpace__ecere__com__BitMember * next;
2070 char *  name;
2071 unsigned int isProperty;
2072 int memberAccess;
2073 int id;
2074 struct __ecereNameSpace__ecere__com__Class * _class;
2075 char *  dataTypeString;
2076 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
2077 struct Type * dataType;
2078 int type;
2079 int size;
2080 int pos;
2081 uint64 mask;
2082 } __attribute__ ((gcc_struct));
2083
2084 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__OldLink;
2085
2086 struct __ecereNameSpace__ecere__sys__OldLink
2087 {
2088 struct __ecereNameSpace__ecere__sys__OldLink * prev;
2089 struct __ecereNameSpace__ecere__sys__OldLink * next;
2090 void *  data;
2091 } __attribute__ ((gcc_struct));
2092
2093 void FinishTemplatesContext(struct Context * context);
2094
2095 void ComputeClassMembers(struct __ecereNameSpace__ecere__com__Class * _class, unsigned int isMember)
2096 {
2097 struct __ecereNameSpace__ecere__com__DataMember * member = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
2098 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
2099
2100 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))
2101 {
2102 int c;
2103 int unionMemberOffset = 0;
2104 int bitFields = 0;
2105
2106 if(member)
2107 {
2108 member->memberOffset = 0;
2109 if(targetBits < sizeof(void *) * 8)
2110 member->structAlignment = 0;
2111 }
2112 else if(targetBits < sizeof(void *) * 8)
2113 _class->structAlignment = 0;
2114 if(!member && ((_class->type == 0 || _class->type == 5) || (_class->type == 1 && _class->memberOffset && _class->memberOffset > _class->base->structSize)))
2115 _class->memberOffset = (_class->base && _class->type == 1) ? _class->base->structSize : 0;
2116 if(!member && _class->destructionWatchOffset)
2117 _class->memberOffset += sizeof(struct __ecereNameSpace__ecere__sys__OldList);
2118 {
2119 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
2120
2121 for(dataMember = member ? member->members.first : _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
2122 {
2123 if(!dataMember->isProperty)
2124 {
2125 if(dataMember->type == 0 && dataMember->dataTypeString && !dataMember->dataType)
2126 {
2127 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
2128 }
2129 }
2130 }
2131 }
2132 {
2133 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
2134
2135 for(dataMember = member ? member->members.first : _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
2136 {
2137 if(!dataMember->isProperty && (dataMember->type != 0 || dataMember->dataTypeString))
2138 {
2139 if(!isMember && _class->type == 2 && dataMember->dataType)
2140 {
2141 struct __ecereNameSpace__ecere__com__BitMember * bitMember = (struct __ecereNameSpace__ecere__com__BitMember *)dataMember;
2142 uint64 mask = 0;
2143 int d;
2144
2145 ComputeTypeSize(dataMember->dataType);
2146 if(bitMember->pos == -1)
2147 bitMember->pos = _class->memberOffset;
2148 if(!bitMember->size)
2149 bitMember->size = dataMember->dataType->size * 8;
2150 _class->memberOffset = bitMember->pos + bitMember->size;
2151 for(d = 0; d < bitMember->size; d++)
2152 {
2153 if(d)
2154 mask <<= 1;
2155 mask |= 1;
2156 }
2157 bitMember->mask = mask << bitMember->pos;
2158 }
2159 else if(dataMember->type == 0 && dataMember->dataType)
2160 {
2161 int size;
2162 int alignment = 0;
2163
2164 if(dataMember->dataType->kind != 8 || ((!dataMember->dataType->_class || !dataMember->dataType->_class->registered || dataMember->dataType->_class->registered != _class || _class->type != 1)))
2165 ComputeTypeSize(dataMember->dataType);
2166 if(dataMember->dataType->bitFieldCount)
2167 {
2168 bitFields += dataMember->dataType->bitFieldCount;
2169 size = 0;
2170 }
2171 else
2172 {
2173 if(bitFields)
2174 {
2175 int size = (bitFields + 7) / 8;
2176
2177 if(isMember)
2178 {
2179 int __simpleStruct0;
2180
2181 if(alignment)
2182 {
2183 int __simpleStruct0;
2184
2185 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2186 if(member->memberOffset % alignment)
2187 member->memberOffset += alignment - (member->memberOffset % alignment);
2188 }
2189 dataMember->offset = member->memberOffset;
2190 if(member->type == 1)
2191 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2192 else
2193 {
2194 member->memberOffset += size;
2195 }
2196 }
2197 else
2198 {
2199 if(alignment)
2200 {
2201 int __simpleStruct0;
2202
2203 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2204 if(_class->memberOffset % alignment)
2205 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2206 }
2207 dataMember->offset = _class->memberOffset;
2208 _class->memberOffset += size;
2209 }
2210 bitFields = 0;
2211 }
2212 size = dataMember->dataType->size;
2213 alignment = dataMember->dataType->alignment;
2214 }
2215 if(isMember)
2216 {
2217 int __simpleStruct0;
2218
2219 if(alignment)
2220 {
2221 int __simpleStruct0;
2222
2223 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2224 if(member->memberOffset % alignment)
2225 member->memberOffset += alignment - (member->memberOffset % alignment);
2226 }
2227 dataMember->offset = member->memberOffset;
2228 if(member->type == 1)
2229 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2230 else
2231 {
2232 member->memberOffset += size;
2233 }
2234 }
2235 else
2236 {
2237 if(alignment)
2238 {
2239 int __simpleStruct0;
2240
2241 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2242 if(_class->memberOffset % alignment)
2243 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2244 }
2245 dataMember->offset = _class->memberOffset;
2246 _class->memberOffset += size;
2247 }
2248 }
2249 else
2250 {
2251 int alignment;
2252
2253 ComputeClassMembers((struct __ecereNameSpace__ecere__com__Class *)dataMember, 0x1);
2254 alignment = dataMember->structAlignment;
2255 if(isMember)
2256 {
2257 int __simpleStruct0;
2258
2259 if(alignment)
2260 {
2261 int __simpleStruct0;
2262
2263 if(member->memberOffset % alignment)
2264 member->memberOffset += alignment - (member->memberOffset % alignment);
2265 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2266 }
2267 dataMember->offset = member->memberOffset;
2268 if(member->type == 1)
2269 unionMemberOffset = (__simpleStruct0 = dataMember->memberOffset, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2270 else
2271 member->memberOffset += dataMember->memberOffset;
2272 }
2273 else
2274 {
2275 if(alignment)
2276 {
2277 int __simpleStruct0;
2278
2279 if(_class->memberOffset % alignment)
2280 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2281 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2282 }
2283 dataMember->offset = _class->memberOffset;
2284 _class->memberOffset += dataMember->memberOffset;
2285 }
2286 }
2287 }
2288 }
2289 if(bitFields)
2290 {
2291 int alignment = 0;
2292 int size = (bitFields + 7) / 8;
2293
2294 if(isMember)
2295 {
2296 int __simpleStruct0;
2297
2298 if(alignment)
2299 {
2300 int __simpleStruct0;
2301
2302 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2303 if(member->memberOffset % alignment)
2304 member->memberOffset += alignment - (member->memberOffset % alignment);
2305 }
2306 if(member->type == 1)
2307 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2308 else
2309 {
2310 member->memberOffset += size;
2311 }
2312 }
2313 else
2314 {
2315 if(alignment)
2316 {
2317 int __simpleStruct0;
2318
2319 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2320 if(_class->memberOffset % alignment)
2321 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2322 }
2323 _class->memberOffset += size;
2324 }
2325 bitFields = 0;
2326 }
2327 }
2328 if(member && member->type == 1)
2329 {
2330 member->memberOffset = unionMemberOffset;
2331 }
2332 if(!isMember)
2333 {
2334 if(_class->type != 2)
2335 {
2336 int extra = 0;
2337
2338 if(_class->structAlignment)
2339 {
2340 if(_class->memberOffset % _class->structAlignment)
2341 extra += _class->structAlignment - (_class->memberOffset % _class->structAlignment);
2342 }
2343 _class->structSize = (_class->base ? (_class->base->templateClass ? _class->base->templateClass->structSize : _class->base->structSize) : 0) + _class->memberOffset + extra;
2344 if(!member)
2345 {
2346 struct __ecereNameSpace__ecere__com__Property * prop;
2347
2348 for(prop = _class->membersAndProperties.first; prop; prop = prop->next)
2349 {
2350 if(prop->isProperty && prop->isWatchable)
2351 {
2352 prop->watcherOffset = _class->structSize;
2353 _class->structSize += sizeof(struct __ecereNameSpace__ecere__sys__OldList);
2354 }
2355 }
2356 }
2357 {
2358 struct __ecereNameSpace__ecere__sys__OldLink * derivative;
2359
2360 for(derivative = _class->derivatives.first; derivative; derivative = derivative->next)
2361 {
2362 struct __ecereNameSpace__ecere__com__Class * deriv = derivative->data;
2363
2364 if(deriv->computeSize)
2365 {
2366 deriv->offset = _class->structSize;
2367 deriv->memberOffset = 0;
2368 deriv->structSize = deriv->offset;
2369 ComputeClassMembers(deriv, 0x0);
2370 }
2371 }
2372 }
2373 }
2374 }
2375 }
2376 if(context)
2377 FinishTemplatesContext(context);
2378 }
2379
2380 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__NameSpace;
2381
2382 struct __ecereNameSpace__ecere__com__NameSpace
2383 {
2384 char *  name;
2385 struct __ecereNameSpace__ecere__com__NameSpace *  btParent;
2386 struct __ecereNameSpace__ecere__com__NameSpace *  left;
2387 struct __ecereNameSpace__ecere__com__NameSpace *  right;
2388 int depth;
2389 struct __ecereNameSpace__ecere__com__NameSpace *  parent;
2390 struct __ecereNameSpace__ecere__sys__BinaryTree nameSpaces;
2391 struct __ecereNameSpace__ecere__sys__BinaryTree classes;
2392 struct __ecereNameSpace__ecere__sys__BinaryTree defines;
2393 struct __ecereNameSpace__ecere__sys__BinaryTree functions;
2394 } __attribute__ ((gcc_struct));
2395
2396 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Module;
2397
2398 struct __ecereNameSpace__ecere__com__Module
2399 {
2400 struct __ecereNameSpace__ecere__com__Instance * application;
2401 struct __ecereNameSpace__ecere__sys__OldList classes;
2402 struct __ecereNameSpace__ecere__sys__OldList defines;
2403 struct __ecereNameSpace__ecere__sys__OldList functions;
2404 struct __ecereNameSpace__ecere__sys__OldList modules;
2405 struct __ecereNameSpace__ecere__com__Instance * prev;
2406 struct __ecereNameSpace__ecere__com__Instance * next;
2407 char *  name;
2408 void *  library;
2409 void *  Unload;
2410 int importType;
2411 int origImportType;
2412 struct __ecereNameSpace__ecere__com__NameSpace privateNameSpace;
2413 struct __ecereNameSpace__ecere__com__NameSpace publicNameSpace;
2414 } __attribute__ ((gcc_struct));
2415
2416 void ComputeModuleClasses(struct __ecereNameSpace__ecere__com__Instance * module)
2417 {
2418 struct __ecereNameSpace__ecere__com__Class * _class;
2419 struct __ecereNameSpace__ecere__sys__OldLink * subModule;
2420
2421 for(subModule = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + 12)))->modules.first; subModule; subModule = subModule->next)
2422 ComputeModuleClasses(subModule->data);
2423 for(_class = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + 12)))->classes.first; _class; _class = _class->next)
2424 ComputeClassMembers(_class, 0x0);
2425 }
2426
2427 extern unsigned int inCompiler;
2428
2429 extern void Compiler_Error(char *  format, ...);
2430
2431 extern char *  __ecereNameSpace__ecere__GetTranslatedString(struct __ecereNameSpace__ecere__com__Instance * module, char *  string, char *  stringAndContext);
2432
2433 extern struct __ecereNameSpace__ecere__com__Instance * __thisModule;
2434
2435 int ComputeTypeSize(struct Type * type)
2436 {
2437 unsigned int size = type ? type->size : 0;
2438
2439 if(!size && type && !type->computing)
2440 {
2441 type->computing = 0x1;
2442 switch(type->kind)
2443 {
2444 case 1:
2445 type->alignment = size = sizeof(char);
2446 break;
2447 case 3:
2448 type->alignment = size = sizeof(int);
2449 break;
2450 case 4:
2451 type->alignment = size = sizeof(long long);
2452 break;
2453 case 22:
2454 type->alignment = size = targetBits / 8;
2455 break;
2456 case 5:
2457 type->alignment = size = sizeof(long);
2458 break;
2459 case 2:
2460 type->alignment = size = sizeof(short);
2461 break;
2462 case 6:
2463 type->alignment = size = sizeof(float);
2464 break;
2465 case 7:
2466 type->alignment = size = sizeof(double);
2467 break;
2468 case 8:
2469 {
2470 struct __ecereNameSpace__ecere__com__Class * _class = type->_class ? type->_class->registered : (((void *)0));
2471
2472 if(_class && _class->type == 1)
2473 {
2474 ComputeClassMembers(_class, 0x0);
2475 type->alignment = _class->structAlignment;
2476 size = _class->structSize;
2477 if(type->alignment && size % type->alignment)
2478 size += type->alignment - (size % type->alignment);
2479 }
2480 else if(_class && (_class->type == 3 || _class->type == 4 || _class->type == 2))
2481 {
2482 if(!_class->dataType)
2483 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
2484 size = type->alignment = ComputeTypeSize(_class->dataType);
2485 }
2486 else
2487 size = type->alignment = targetBits / 8;
2488 break;
2489 }
2490 case 13:
2491 case 19:
2492 size = type->alignment = targetBits / 8;
2493 break;
2494 case 12:
2495 if(type->arraySizeExp)
2496 {
2497 ProcessExpressionType(type->arraySizeExp);
2498 ComputeExpression(type->arraySizeExp);
2499 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)))
2500 {
2501 struct Location oldLoc = yylloc;
2502 char expression[10240];
2503
2504 expression[0] = '\0';
2505 type->arraySizeExp->expType = (((void *)0));
2506 yylloc = type->arraySizeExp->loc;
2507 if(inCompiler)
2508 PrintExpression(type->arraySizeExp, expression);
2509 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Array size not constant int (%s)\n", (((void *)0))), expression);
2510 yylloc = oldLoc;
2511 }
2512 GetInt(type->arraySizeExp, &type->arraySize);
2513 }
2514 else if(type->enumClass)
2515 {
2516 if(type->enumClass && type->enumClass->registered && type->enumClass->registered->type == 4)
2517 {
2518 type->arraySize = (int)__ecereNameSpace__ecere__com__eClass_GetProperty(type->enumClass->registered, "enumSize");
2519 }
2520 else
2521 type->arraySize = 0;
2522 }
2523 else
2524 {
2525 type->arraySize = 0;
2526 }
2527 size = ComputeTypeSize(type->type) * type->arraySize;
2528 type->alignment = type->type->alignment;
2529 break;
2530 case 9:
2531 {
2532 struct Type * member;
2533
2534 for(member = type->members.first; member; member = member->next)
2535 {
2536 int __simpleStruct0, __simpleStruct1;
2537 unsigned int addSize = ComputeTypeSize(member);
2538
2539 member->offset = size;
2540 if(member->alignment && size % member->alignment)
2541 member->offset += member->alignment - (size % member->alignment);
2542 size = member->offset;
2543 type->alignment = (__simpleStruct0 = type->alignment, __simpleStruct1 = member->alignment, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
2544 size += addSize;
2545 }
2546 if(type->alignment && size % type->alignment)
2547 size += type->alignment - (size % type->alignment);
2548 break;
2549 }
2550 case 10:
2551 {
2552 struct Type * member;
2553
2554 for(member = type->members.first; member; member = member->next)
2555 {
2556 int __simpleStruct0, __simpleStruct1;
2557 unsigned int addSize = ComputeTypeSize(member);
2558
2559 member->offset = size;
2560 if(member->alignment && size % member->alignment)
2561 member->offset += member->alignment - (size % member->alignment);
2562 size = member->offset;
2563 type->alignment = (__simpleStruct0 = type->alignment, __simpleStruct1 = member->alignment, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
2564 size = ((size > addSize) ? size : addSize);
2565 }
2566 if(type->alignment && size % type->alignment)
2567 size += type->alignment - (size % type->alignment);
2568 break;
2569 }
2570 case 20:
2571 {
2572 struct TemplateParameter * param = type->templateParameter;
2573 struct Type * baseType = ProcessTemplateParameterType(param);
2574
2575 if(baseType)
2576 {
2577 size = ComputeTypeSize(baseType);
2578 type->alignment = baseType->alignment;
2579 }
2580 else
2581 type->alignment = size = sizeof(uint64);
2582 break;
2583 }
2584 case 15:
2585 {
2586 type->alignment = size = sizeof(enum
2587 {
2588 test
2589 });
2590 break;
2591 }
2592 case 21:
2593 {
2594 type->alignment = size = targetBits / 8;
2595 break;
2596 }
2597 }
2598 type->size = size;
2599 type->computing = 0x0;
2600 }
2601 return size;
2602 }
2603
2604 extern struct Declarator * MkDeclaratorIdentifier(struct Identifier * id);
2605
2606 extern struct Identifier * MkIdentifier(char *  string);
2607
2608 extern void ListAdd(struct __ecereNameSpace__ecere__sys__OldList * list, void *  item);
2609
2610 extern struct Declarator * MkStructDeclarator(struct Declarator * declarator, struct Expression * exp);
2611
2612 extern struct ClassDef * MkClassDefDeclaration(struct Declaration * decl);
2613
2614 extern struct Declaration * MkStructDeclaration(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct __ecereNameSpace__ecere__sys__OldList * declarators, struct Specifier * extStorage);
2615
2616 void ReplaceThisClassSpecifiers(struct __ecereNameSpace__ecere__sys__OldList * specs, struct __ecereNameSpace__ecere__com__Class * _class);
2617
2618 static void DeclareType(struct Type * type, unsigned int declarePointers, unsigned int declareParams);
2619
2620 extern void FreeType(struct Type * type);
2621
2622 extern struct Specifier * MkStructOrUnion(int type, struct Identifier * id, struct __ecereNameSpace__ecere__sys__OldList * definitions);
2623
2624 extern struct Specifier * MkSpecifier(int specifier);
2625
2626 extern struct Declarator * MkDeclaratorArray(struct Declarator * declarator, struct Expression * exp);
2627
2628 extern struct Expression * MkExpConstant(char *  string);
2629
2630 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)
2631 {
2632 struct __ecereNameSpace__ecere__com__DataMember * topMember = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
2633 unsigned int totalSize = 0;
2634 unsigned int maxSize = 0;
2635 int alignment, size;
2636 struct __ecereNameSpace__ecere__com__DataMember * member;
2637 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
2638
2639 if(addedPadding)
2640 *addedPadding = 0x0;
2641 if(!isMember && _class->base)
2642 {
2643 maxSize = _class->structSize;
2644 {
2645 if(_class->type == 1 || _class->type == 5)
2646 AddMembers(declarations, _class->base, 0x0, &totalSize, topClass, (((void *)0)));
2647 else
2648 maxSize -= _class->base->templateClass ? _class->base->templateClass->structSize : _class->base->structSize;
2649 }
2650 }
2651 for(member = isMember ? topMember->members.first : _class->membersAndProperties.first; member; member = member->next)
2652 {
2653 if(!member->isProperty)
2654 {
2655 switch(member->type)
2656 {
2657 case 0:
2658 {
2659 if(member->dataTypeString)
2660 {
2661 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList(), * decls = MkList();
2662 struct Declarator * decl;
2663
2664 decl = SpecDeclFromString(member->dataTypeString, specs, MkDeclaratorIdentifier(MkIdentifier(member->name)));
2665 ListAdd(decls, MkStructDeclarator(decl, (((void *)0))));
2666 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(specs, decls, (((void *)0)))));
2667 if(!member->dataType)
2668 member->dataType = ProcessType(specs, decl);
2669 ReplaceThisClassSpecifiers(specs, topClass);
2670 {
2671 struct Type * type = ProcessType(specs, decl);
2672
2673 DeclareType(member->dataType, 0x0, 0x0);
2674 FreeType(type);
2675 }
2676 ComputeTypeSize(member->dataType);
2677 size = member->dataType->size;
2678 alignment = member->dataType->alignment;
2679 if(alignment)
2680 {
2681 if(totalSize % alignment)
2682 totalSize += alignment - (totalSize % alignment);
2683 }
2684 totalSize += size;
2685 }
2686 break;
2687 }
2688 case 1:
2689 case 2:
2690 {
2691 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList(), * list = MkList();
2692
2693 size = 0;
2694 AddMembers(list, (struct __ecereNameSpace__ecere__com__Class *)member, 0x1, &size, topClass, (((void *)0)));
2695 ListAdd(specs, MkStructOrUnion((member->type == 1) ? 4 : 3, (((void *)0)), list));
2696 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(specs, (((void *)0)), (((void *)0)))));
2697 alignment = member->structAlignment;
2698 if(alignment)
2699 {
2700 if(totalSize % alignment)
2701 totalSize += alignment - (totalSize % alignment);
2702 }
2703 totalSize += size;
2704 break;
2705 }
2706 }
2707 }
2708 }
2709 if(retSize)
2710 {
2711 unsigned int __simpleStruct0;
2712
2713 if(topMember && topMember->type == 1)
2714 *retSize = (__simpleStruct0 = *retSize, (__simpleStruct0 > totalSize) ? __simpleStruct0 : totalSize);
2715 else
2716 *retSize += totalSize;
2717 }
2718 else if(totalSize < maxSize && _class->type != 1000)
2719 {
2720 int autoPadding = 0;
2721
2722 if(!isMember && _class->structAlignment && totalSize % _class->structAlignment)
2723 autoPadding = _class->structAlignment - (totalSize % _class->structAlignment);
2724 if(totalSize + autoPadding < maxSize)
2725 {
2726 char sizeString[50];
2727
2728 sprintf(sizeString, "%d", maxSize - totalSize);
2729 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(CHAR)), MkListOne(MkDeclaratorArray(MkDeclaratorIdentifier(MkIdentifier("__ecere_padding")), MkExpConstant(sizeString))), (((void *)0)))));
2730 if(addedPadding)
2731 *addedPadding = 0x1;
2732 }
2733 }
2734 if(context)
2735 FinishTemplatesContext(context);
2736 return topMember ? topMember->memberID : _class->memberID;
2737 }
2738
2739 static int DeclareMembers(struct __ecereNameSpace__ecere__com__Class * _class, unsigned int isMember)
2740 {
2741 struct __ecereNameSpace__ecere__com__DataMember * topMember = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
2742 unsigned int totalSize = 0;
2743 struct __ecereNameSpace__ecere__com__DataMember * member;
2744 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
2745
2746 if(!isMember && (_class->type == 1 || _class->type == 5) && _class->base->type != 1000)
2747 DeclareMembers(_class->base, 0x0);
2748 for(member = isMember ? topMember->members.first : _class->membersAndProperties.first; member; member = member->next)
2749 {
2750 if(!member->isProperty)
2751 {
2752 switch(member->type)
2753 {
2754 case 0:
2755 {
2756 if(!member->dataType && member->dataTypeString)
2757 member->dataType = ProcessTypeString(member->dataTypeString, 0x0);
2758 if(member->dataType)
2759 DeclareType(member->dataType, 0x0, 0x0);
2760 break;
2761 }
2762 case 1:
2763 case 2:
2764 {
2765 DeclareMembers((struct __ecereNameSpace__ecere__com__Class *)member, 0x1);
2766 break;
2767 }
2768 }
2769 }
2770 }
2771 if(context)
2772 FinishTemplatesContext(context);
2773 return topMember ? topMember->memberID : _class->memberID;
2774 }
2775
2776 extern struct Symbol * FindClass(char *  name);
2777
2778 extern char *  strchr(char * , int);
2779
2780 extern void FullClassNameCat(char *  output, char *  className, unsigned int includeTemplateParams);
2781
2782 extern void FreeList(struct __ecereNameSpace__ecere__sys__OldList * list, void (* )(void * ));
2783
2784 extern void FreeClassDef(struct ClassDef * def);
2785
2786 extern struct External * MkExternalDeclaration(struct Declaration * declaration);
2787
2788 extern struct Declaration * MkDeclaration(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct __ecereNameSpace__ecere__sys__OldList * initDeclarators);
2789
2790 extern char *  strcpy(char * , const char * );
2791
2792 extern void MangleClassName(char *  className);
2793
2794 extern void DeclareClass(struct Symbol * classSym, char *  className);
2795
2796 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move(struct __ecereNameSpace__ecere__sys__OldList * this, void *  item, void *  prevItem);
2797
2798 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(struct __ecereNameSpace__ecere__sys__OldList * this, void *  prevItem, void *  item);
2799
2800 void DeclareStruct(char * name, unsigned int skipNoHead)
2801 {
2802 struct External * external = (((void *)0));
2803 struct Symbol * classSym = FindClass(name);
2804
2805 if(!inCompiler || !classSym)
2806 return ;
2807 if(classSym->registered && (classSym->registered->type == 2 || classSym->registered->type == 3 || classSym->registered->type == 4))
2808 return ;
2809 if(classSym->registered && classSym->imported && !classSym->declaredStructSym)
2810 {
2811 struct Declaration * decl;
2812 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
2813 struct __ecereNameSpace__ecere__sys__OldList * declarations = (((void *)0));
2814 char structName[1024];
2815
2816 external = (classSym->registered && classSym->registered->type == 1) ? classSym->pointerExternal : classSym->structExternal;
2817 classSym->declaring++;
2818 if(strchr(classSym->string, '<'))
2819 {
2820 if(classSym->registered->templateClass)
2821 {
2822 DeclareStruct(classSym->registered->templateClass->fullName, skipNoHead);
2823 classSym->declaring--;
2824 }
2825 return ;
2826 }
2827 DeclareMembers(classSym->registered, 0x0);
2828 structName[0] = (char)0;
2829 FullClassNameCat(structName, name, 0x0);
2830 if(!skipNoHead)
2831 {
2832 unsigned int addedPadding = 0x0;
2833
2834 classSym->declaredStructSym = 0x1;
2835 declarations = MkList();
2836 AddMembers(declarations, classSym->registered, 0x0, (((void *)0)), classSym->registered, &addedPadding);
2837 if(!(*declarations).count || ((*declarations).count == 1 && addedPadding))
2838 {
2839 FreeList(declarations, FreeClassDef);
2840 declarations = (((void *)0));
2841 }
2842 }
2843 if(skipNoHead || declarations)
2844 {
2845 if(external && external->declaration)
2846 {
2847 ((struct Specifier *)(*external->declaration->specifiers).first)->definitions = declarations;
2848 if(curExternal && curExternal->symbol && curExternal->symbol->idCode < classSym->id)
2849 {
2850 if(classSym->structExternal)
2851 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->structExternal, curExternal->prev);
2852 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->pointerExternal, curExternal->prev);
2853 classSym->id = curExternal->symbol->idCode;
2854 classSym->idCode = curExternal->symbol->idCode;
2855 }
2856 }
2857 else
2858 {
2859 if(!external)
2860 external = MkExternalDeclaration((((void *)0)));
2861 specifiers = MkList();
2862 declarators = MkList();
2863 ListAdd(specifiers, MkStructOrUnion(3, MkIdentifier(structName), declarations));
2864 external->declaration = decl = MkDeclaration(specifiers, declarators);
2865 if(decl->symbol && !decl->symbol->pointerExternal)
2866 decl->symbol->pointerExternal = external;
2867 if(classSym->registered && classSym->registered->type == 1)
2868 {
2869 char className[1024];
2870
2871 strcpy(className, "__ecereClass_");
2872 FullClassNameCat(className, classSym->string, 0x1);
2873 MangleClassName(className);
2874 DeclareClass(classSym, className);
2875 external->symbol = classSym;
2876 classSym->pointerExternal = external;
2877 classSym->id = (curExternal && curExternal->symbol) ? curExternal->symbol->idCode : 0;
2878 classSym->idCode = (curExternal && curExternal->symbol) ? curExternal->symbol->idCode : 0;
2879 }
2880 else
2881 {
2882 char className[1024];
2883
2884 strcpy(className, "__ecereClass_");
2885 FullClassNameCat(className, classSym->string, 0x1);
2886 MangleClassName(className);
2887 classSym->structExternal = external;
2888 DeclareClass(classSym, className);
2889 external->symbol = classSym;
2890 }
2891 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal ? curExternal->prev : (((void *)0)), external);
2892 }
2893 }
2894 classSym->declaring--;
2895 }
2896 else if(curExternal && curExternal->symbol && curExternal->symbol->idCode < classSym->id)
2897 {
2898 classSym->declaring++;
2899 {
2900 if(classSym->registered)
2901 DeclareMembers(classSym->registered, 0x0);
2902 }
2903 if(classSym->registered && (classSym->registered->type == 1 || classSym->registered->type == 5))
2904 {
2905 if(classSym->structExternal)
2906 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->structExternal, curExternal->prev);
2907 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->pointerExternal, curExternal->prev);
2908 classSym->id = curExternal->symbol->idCode;
2909 classSym->idCode = curExternal->symbol->idCode;
2910 }
2911 classSym->declaring--;
2912 }
2913 }
2914
2915 extern char *  strcat(char * , const char * );
2916
2917 extern struct ModuleImport * FindModule(struct __ecereNameSpace__ecere__com__Instance * moduleToFind);
2918
2919 extern struct ModuleImport * mainModule;
2920
2921 extern struct Specifier * MkSpecifierName(char *  name);
2922
2923 extern struct Declarator * MkDeclaratorBrackets(struct Declarator * declarator);
2924
2925 extern struct Declarator * PlugDeclarator(struct Declarator * decl, struct Declarator * baseDecl);
2926
2927 extern struct Declarator * MkDeclaratorFunction(struct Declarator * declarator, struct __ecereNameSpace__ecere__sys__OldList * parameters);
2928
2929 extern struct InitDeclarator * MkInitDeclarator(struct Declarator * declarator, struct Initializer * initializer);
2930
2931 extern void FreeDeclarator(struct Declarator * decl);
2932
2933 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_PropertyImport;
2934
2935 struct PropertyImport
2936 {
2937 struct PropertyImport * prev;
2938 struct PropertyImport * next;
2939 char *  name;
2940 unsigned int isVirtual;
2941 unsigned int hasSet;
2942 unsigned int hasGet;
2943 } __attribute__ ((gcc_struct));
2944
2945 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(struct __ecereNameSpace__ecere__sys__OldList * this, void *  item);
2946
2947 void DeclareProperty(struct __ecereNameSpace__ecere__com__Property * prop, char * setName, char * getName)
2948 {
2949 void * __ecereTemp1;
2950 struct Symbol * symbol = prop->symbol;
2951 char propName[1024];
2952
2953 strcpy(setName, "__ecereProp_");
2954 FullClassNameCat(setName, prop->_class->fullName, 0x0);
2955 strcat(setName, "_Set_");
2956 FullClassNameCat(setName, prop->name, 0x1);
2957 strcpy(getName, "__ecereProp_");
2958 FullClassNameCat(getName, prop->_class->fullName, 0x0);
2959 strcat(getName, "_Get_");
2960 FullClassNameCat(getName, prop->name, 0x1);
2961 strcpy(propName, "__ecereProp_");
2962 FullClassNameCat(propName, prop->_class->fullName, 0x0);
2963 strcat(propName, "_");
2964 FullClassNameCat(propName, prop->name, 0x1);
2965 MangleClassName(getName);
2966 MangleClassName(setName);
2967 MangleClassName(propName);
2968 if(prop->_class->type == 1)
2969 DeclareStruct(prop->_class->fullName, 0x0);
2970 if(!symbol || curExternal->symbol->idCode < symbol->id)
2971 {
2972 unsigned int imported = 0x0;
2973 unsigned int dllImport = 0x0;
2974
2975 if(!symbol || symbol->_import)
2976 {
2977 if(!symbol)
2978 {
2979 struct Symbol * classSym;
2980
2981 if(!prop->_class->symbol)
2982 prop->_class->symbol = FindClass(prop->_class->fullName);
2983 classSym = prop->_class->symbol;
2984 if(classSym && !classSym->_import)
2985 {
2986 struct ModuleImport * module;
2987
2988 if(prop->_class->module)
2989 module = FindModule(prop->_class->module);
2990 else
2991 module = mainModule;
2992 classSym->_import = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_ClassImport), ((struct ClassImport *)__ecereTemp1)->name = __ecereNameSpace__ecere__sys__CopyString(prop->_class->fullName), ((struct ClassImport *)__ecereTemp1)->isRemote = prop->_class->isRemote, ((struct ClassImport *)__ecereTemp1));
2993 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->classes, classSym->_import);
2994 }
2995 symbol = prop->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
2996 symbol->_import = (struct ClassImport *)(__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_PropertyImport), ((struct PropertyImport *)__ecereTemp1)->name = __ecereNameSpace__ecere__sys__CopyString(prop->name), ((struct PropertyImport *)__ecereTemp1)->isVirtual = 0x0, ((struct PropertyImport *)__ecereTemp1)->hasSet = prop->Set ? 0x1 : 0x0, ((struct PropertyImport *)__ecereTemp1)->hasGet = prop->Get ? 0x1 : 0x0, ((struct PropertyImport *)__ecereTemp1));
2997 if(classSym)
2998 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&classSym->_import->properties, symbol->_import);
2999 }
3000 imported = 0x1;
3001 if(prop->_class->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)prop->_class->module + 12)))->importType != 1)
3002 dllImport = 0x1;
3003 }
3004 if(!symbol->type)
3005 {
3006 struct Context * context = SetupTemplatesContext(prop->_class);
3007
3008 symbol->type = ProcessTypeString(prop->dataTypeString, 0x0);
3009 FinishTemplatesContext(context);
3010 }
3011 if(prop->Get)
3012 {
3013 if(!symbol->externalGet || symbol->externalGet->type == 0)
3014 {
3015 struct Declaration * decl;
3016 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
3017 struct Declarator * d;
3018 struct __ecereNameSpace__ecere__sys__OldList * params;
3019 struct Specifier * spec;
3020 struct External * external;
3021 struct Declarator * typeDecl;
3022 unsigned int simple = 0x0;
3023
3024 specifiers = MkList();
3025 declarators = MkList();
3026 params = MkList();
3027 ListAdd(params, MkTypeName(MkListOne(MkSpecifierName(prop->_class->fullName)), MkDeclaratorIdentifier(MkIdentifier("this"))));
3028 d = MkDeclaratorIdentifier(MkIdentifier(getName));
3029 if(dllImport)
3030 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
3031 {
3032 struct Context * context = SetupTemplatesContext(prop->_class);
3033
3034 typeDecl = SpecDeclFromString(prop->dataTypeString, specifiers, (((void *)0)));
3035 FinishTemplatesContext(context);
3036 }
3037 for(spec = (*specifiers).first; spec; spec = spec->next)
3038 {
3039 if(spec->type == 1)
3040 {
3041 if((!typeDecl || typeDecl->type == 1))
3042 {
3043 struct Symbol * classSym = spec->symbol;
3044
3045 symbol->_class = classSym->registered;
3046 if(classSym->registered && classSym->registered->type == 1)
3047 {
3048 DeclareStruct(spec->name, 0x0);
3049 simple = 0x1;
3050 }
3051 }
3052 }
3053 }
3054 if(!simple)
3055 d = PlugDeclarator(typeDecl, d);
3056 else
3057 {
3058 ListAdd(params, MkTypeName(specifiers, PlugDeclarator(typeDecl, MkDeclaratorIdentifier(MkIdentifier("value")))));
3059 specifiers = MkList();
3060 }
3061 d = MkDeclaratorFunction(d, params);
3062 if(dllImport)
3063 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
3064 else if(prop->_class->symbol && ((struct Symbol *)prop->_class->symbol)->isStatic)
3065 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
3066 if(simple)
3067 ListAdd(specifiers, MkSpecifier(VOID));
3068 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
3069 decl = MkDeclaration(specifiers, declarators);
3070 external = MkExternalDeclaration(decl);
3071 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
3072 external->symbol = symbol;
3073 symbol->externalGet = external;
3074 ReplaceThisClassSpecifiers(specifiers, prop->_class);
3075 if(typeDecl)
3076 FreeDeclarator(typeDecl);
3077 }
3078 else
3079 {
3080 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->externalGet, curExternal->prev);
3081 }
3082 }
3083 if(prop->Set)
3084 {
3085 if(!symbol->externalSet || symbol->externalSet->type == 0)
3086 {
3087 struct Declaration * decl;
3088 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
3089 struct Declarator * d;
3090 struct __ecereNameSpace__ecere__sys__OldList * params;
3091 struct Specifier * spec;
3092 struct External * external;
3093 struct Declarator * typeDecl;
3094
3095 declarators = MkList();
3096 params = MkList();
3097 if(!prop->conversion || prop->_class->type == 1)
3098 {
3099 ListAdd(params, MkTypeName(MkListOne(MkSpecifierName(prop->_class->fullName)), MkDeclaratorIdentifier(MkIdentifier("this"))));
3100 }
3101 specifiers = MkList();
3102 {
3103 struct Context * context = SetupTemplatesContext(prop->_class);
3104
3105 typeDecl = d = SpecDeclFromString(prop->dataTypeString, specifiers, MkDeclaratorIdentifier(MkIdentifier("value")));
3106 FinishTemplatesContext(context);
3107 }
3108 ListAdd(params, MkTypeName(specifiers, d));
3109 d = MkDeclaratorIdentifier(MkIdentifier(setName));
3110 if(dllImport)
3111 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
3112 d = MkDeclaratorFunction(d, params);
3113 for(spec = (*specifiers).first; spec; spec = spec->next)
3114 {
3115 if(spec->type == 1)
3116 {
3117 if((!typeDecl || typeDecl->type == 1))
3118 {
3119 struct Symbol * classSym = spec->symbol;
3120
3121 symbol->_class = classSym->registered;
3122 if(classSym->registered && classSym->registered->type == 1)
3123 DeclareStruct(spec->name, 0x0);
3124 }
3125 }
3126 }
3127 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
3128 specifiers = MkList();
3129 if(dllImport)
3130 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
3131 else if(prop->_class->symbol && ((struct Symbol *)prop->_class->symbol)->isStatic)
3132 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
3133 if(!prop->conversion || prop->_class->type == 1)
3134 ListAdd(specifiers, MkSpecifier(VOID));
3135 else
3136 ListAdd(specifiers, MkSpecifierName(prop->_class->fullName));
3137 decl = MkDeclaration(specifiers, declarators);
3138 external = MkExternalDeclaration(decl);
3139 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
3140 external->symbol = symbol;
3141 symbol->externalSet = external;
3142 ReplaceThisClassSpecifiers(specifiers, prop->_class);
3143 }
3144 else
3145 {
3146 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->externalSet, curExternal->prev);
3147 }
3148 }
3149 if(!symbol->externalPtr)
3150 {
3151 struct Declaration * decl;
3152 struct External * external;
3153 struct __ecereNameSpace__ecere__sys__OldList * specifiers = MkList();
3154
3155 if(imported)
3156 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
3157 else
3158 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
3159 ListAdd(specifiers, MkSpecifierName("Property"));
3160 {
3161 struct __ecereNameSpace__ecere__sys__OldList * list = MkList();
3162
3163 ListAdd(list, MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier(propName))), (((void *)0))));
3164 if(!imported)
3165 {
3166 strcpy(propName, "__ecerePropM_");
3167 FullClassNameCat(propName, prop->_class->fullName, 0x0);
3168 strcat(propName, "_");
3169 FullClassNameCat(propName, prop->name, 0x1);
3170 MangleClassName(propName);
3171 ListAdd(list, MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier(propName))), (((void *)0))));
3172 }
3173 decl = MkDeclaration(specifiers, list);
3174 }
3175 external = MkExternalDeclaration(decl);
3176 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
3177 external->symbol = symbol;
3178 symbol->externalPtr = external;
3179 }
3180 else
3181 {
3182 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->externalPtr, curExternal->prev);
3183 }
3184 symbol->id = curExternal->symbol->idCode;
3185 }
3186 }
3187
3188 struct Type * Dereference(struct Type * source)
3189 {
3190 void * __ecereTemp1;
3191 struct Type * type = (((void *)0));
3192
3193 if(source)
3194 {
3195 if(source->kind == 13 || source->kind == 12)
3196 {
3197 type = source->type;
3198 source->type->refCount++;
3199 }
3200 else if(source->kind == 8 && !strcmp(source->_class->string, "String"))
3201 {
3202 type = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->kind = 1, ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1));
3203 }
3204 else if(source->kind == 8 && source->_class && source->_class->registered && source->_class->registered->type == 5)
3205 {
3206 type = source;
3207 source->refCount++;
3208 }
3209 else
3210 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "cannot dereference type\n", (((void *)0))));
3211 }
3212 return type;
3213 }
3214
3215 static struct Type * Reference(struct Type * source)
3216 {
3217 void * __ecereTemp1;
3218 struct Type * type = (((void *)0));
3219
3220 if(source)
3221 {
3222 type = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->kind = 13, ((struct Type *)__ecereTemp1)->type = source, ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1));
3223 source->refCount++;
3224 }
3225 return type;
3226 }
3227
3228 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);
3229
3230 extern void *  memcpy(void * , const void * , unsigned int size);
3231
3232 void ProcessMethodType(struct __ecereNameSpace__ecere__com__Method * method);
3233
3234 extern void FreeExpression(struct Expression * exp);
3235
3236 extern void __ecereNameSpace__ecere__sys__ChangeCh(char *  string, char ch1, char ch2);
3237
3238 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);
3239
3240 static void ProcessInitializer(struct Initializer * init, struct Type * type);
3241
3242 extern struct Type * MkClassType(char *  name);
3243
3244 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);
3245
3246 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)
3247 {
3248 struct Identifier * ident = member->identifiers ? (*member->identifiers).first : (((void *)0));
3249 unsigned int found = 0x0;
3250 struct __ecereNameSpace__ecere__com__DataMember * dataMember = (((void *)0));
3251 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
3252 unsigned int freeType = 0x0;
3253
3254 yylloc = member->loc;
3255 if(!ident)
3256 {
3257 if(curMember)
3258 {
3259 __ecereNameSpace__ecere__com__eClass_FindNextMember(_class, curClass, curMember, subMemberStack, subMemberStackPos);
3260 if(*curMember)
3261 {
3262 found = 0x1;
3263 dataMember = *curMember;
3264 }
3265 }
3266 }
3267 else
3268 {
3269 struct __ecereNameSpace__ecere__com__DataMember * thisMember = (struct __ecereNameSpace__ecere__com__DataMember *)__ecereNameSpace__ecere__com__eClass_FindProperty(_class, ident->string, privateModule);
3270 struct __ecereNameSpace__ecere__com__DataMember * _subMemberStack[256];
3271 int _subMemberStackPos = 0;
3272
3273 if(!thisMember)
3274 thisMember = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, ident->string, privateModule, _subMemberStack, &_subMemberStackPos);
3275 if(thisMember)
3276 {
3277 dataMember = thisMember;
3278 if(curMember && thisMember->memberAccess == 1)
3279 {
3280 *curMember = thisMember;
3281 *curClass = thisMember->_class;
3282 memcpy(subMemberStack, _subMemberStack, sizeof(int) * _subMemberStackPos);
3283 *subMemberStackPos = _subMemberStackPos;
3284 }
3285 found = 0x1;
3286 }
3287 else
3288 {
3289 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, ident->string, privateModule);
3290 if(method && method->type == 1)
3291 found = 0x1;
3292 else
3293 method = (((void *)0));
3294 }
3295 }
3296 if(found)
3297 {
3298 struct Type * type = (((void *)0));
3299
3300 if(dataMember)
3301 {
3302 if(!dataMember->dataType && dataMember->dataTypeString)
3303 {
3304 struct Context * context = SetupTemplatesContext(_class);
3305
3306 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
3307 FinishTemplatesContext(context);
3308 }
3309 type = dataMember->dataType;
3310 }
3311 else if(method)
3312 {
3313 if(!method->dataType)
3314 ProcessMethodType(method);
3315 type = method->dataType;
3316 }
3317 if(ident && ident->next)
3318 {
3319 for(ident = ident->next; ident && type; ident = ident->next)
3320 {
3321 if(type->kind == 8)
3322 {
3323 dataMember = (struct __ecereNameSpace__ecere__com__DataMember *)__ecereNameSpace__ecere__com__eClass_FindProperty(type->_class->registered, ident->string, privateModule);
3324 if(!dataMember)
3325 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMember(type->_class->registered, ident->string, privateModule, (((void *)0)), (((void *)0)));
3326 if(dataMember)
3327 type = dataMember->dataType;
3328 }
3329 else if(type->kind == 9 || type->kind == 10)
3330 {
3331 struct Type * memberType;
3332
3333 for(memberType = type->members.first; memberType; memberType = memberType->next)
3334 {
3335 if(!strcmp(memberType->name, ident->string))
3336 {
3337 type = memberType;
3338 break;
3339 }
3340 }
3341 }
3342 }
3343 }
3344 if(type && type->kind == 20 && type->templateParameter->type == 0 && _class->templateArgs)
3345 {
3346 int id = 0;
3347 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
3348 struct __ecereNameSpace__ecere__com__Class * sClass;
3349
3350 for(sClass = _class; sClass; sClass = sClass->base)
3351 {
3352 id = 0;
3353 if(sClass->templateClass)
3354 sClass = sClass->templateClass;
3355 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
3356 {
3357 if(curParam->type == 0 && !strcmp(type->templateParameter->identifier->string, curParam->name))
3358 {
3359 for(sClass = sClass->base; sClass; sClass = sClass->base)
3360 {
3361 if(sClass->templateClass)
3362 sClass = sClass->templateClass;
3363 id += sClass->templateParams.count;
3364 }
3365 break;
3366 }
3367 id++;
3368 }
3369 if(curParam)
3370 break;
3371 }
3372 if(curParam)
3373 {
3374 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = _class->templateArgs[id];
3375
3376 if(arg.dataTypeString)
3377 {
3378 type = ProcessTypeString(arg.dataTypeString, 0x0);
3379 freeType = 0x1;
3380 if(type && _class->templateClass)
3381 type->passAsTemplate = 0x1;
3382 if(type)
3383 {
3384 }
3385 }
3386 }
3387 }
3388 if(type && type->kind == 8 && type->_class && type->_class->registered && strchr(type->_class->registered->fullName, '<'))
3389 {
3390 struct __ecereNameSpace__ecere__com__Class * expClass = type->_class->registered;
3391 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
3392 int c;
3393 int paramCount = 0;
3394 int lastParam = -1;
3395 char templateString[1024];
3396 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
3397
3398 sprintf(templateString, "%s<", expClass->templateClass->fullName);
3399 for(cClass = expClass; cClass; cClass = cClass->base)
3400 {
3401 int p = 0;
3402
3403 if(cClass->templateClass)
3404 cClass = cClass->templateClass;
3405 for(param = cClass->templateParams.first; param; param = param->next)
3406 {
3407 int id = p;
3408 struct __ecereNameSpace__ecere__com__Class * sClass;
3409 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
3410
3411 for(sClass = cClass->base; sClass; sClass = sClass->base)
3412 {
3413 if(sClass->templateClass)
3414 sClass = sClass->templateClass;
3415 id += sClass->templateParams.count;
3416 }
3417 arg = expClass->templateArgs[id];
3418 for(sClass = _class; sClass; sClass = sClass->base)
3419 {
3420 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * cParam;
3421 int p = 0;
3422 struct __ecereNameSpace__ecere__com__Class * nextClass;
3423
3424 if(sClass->templateClass)
3425 sClass = sClass->templateClass;
3426 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
3427 {
3428 if(nextClass->templateClass)
3429 nextClass = nextClass->templateClass;
3430 p += nextClass->templateParams.count;
3431 }
3432 for(cParam = sClass->templateParams.first; cParam; cParam = cParam->next, p++)
3433 {
3434 if(cParam->type == 0 && arg.dataTypeString && !strcmp(cParam->name, arg.dataTypeString))
3435 {
3436 if(_class->templateArgs && arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
3437 {
3438 arg.dataTypeString = _class->templateArgs[p].dataTypeString;
3439 arg.dataTypeClass = _class->templateArgs[p].dataTypeClass;
3440 break;
3441 }
3442 }
3443 }
3444 }
3445 {
3446 char argument[256];
3447
3448 argument[0] = '\0';
3449 switch(param->type)
3450 {
3451 case 2:
3452 {
3453 char expString[1024];
3454 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
3455 struct Declarator * decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
3456 struct Expression * exp;
3457 char * string = PrintHexUInt64(arg.expression.ui64);
3458
3459 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
3460 ProcessExpressionType(exp);
3461 ComputeExpression(exp);
3462 expString[0] = '\0';
3463 PrintExpression(exp, expString);
3464 strcat(argument, expString);
3465 FreeExpression(exp);
3466 break;
3467 }
3468 case 1:
3469 {
3470 strcat(argument, arg.member->name);
3471 break;
3472 }
3473 case 0:
3474 {
3475 if(arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
3476 strcat(argument, arg.dataTypeString);
3477 break;
3478 }
3479 }
3480 if(argument[0])
3481 {
3482 if(paramCount)
3483 strcat(templateString, ", ");
3484 if(lastParam != p - 1)
3485 {
3486 strcat(templateString, param->name);
3487 strcat(templateString, " = ");
3488 }
3489 strcat(templateString, argument);
3490 paramCount++;
3491 lastParam = p;
3492 }
3493 p++;
3494 }
3495 }
3496 }
3497 {
3498 int len = strlen(templateString);
3499
3500 if(templateString[len - 1] == '<')
3501 len--;
3502 else
3503 {
3504 if(templateString[len - 1] == '>')
3505 templateString[len++] = ' ';
3506 templateString[len++] = '>';
3507 }
3508 templateString[len++] = '\0';
3509 }
3510 {
3511 struct Context * context = SetupTemplatesContext(_class);
3512
3513 if(freeType)
3514 FreeType(type);
3515 type = ProcessTypeString(templateString, 0x0);
3516 freeType = 0x1;
3517 FinishTemplatesContext(context);
3518 }
3519 }
3520 if(method && member->initializer && member->initializer->type == 0 && member->initializer->exp)
3521 {
3522 ProcessExpressionType(member->initializer->exp);
3523 if(!member->initializer->exp->expType)
3524 {
3525 if(inCompiler)
3526 {
3527 char expString[10240];
3528
3529 expString[0] = '\0';
3530 PrintExpression(member->initializer->exp, expString);
3531 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
3532 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "unresolved symbol used as an instance method %s\n", (((void *)0))), expString);
3533 }
3534 }
3535 else if(!MatchTypes(member->initializer->exp->expType, type, (((void *)0)), (((void *)0)), _class, 0x1, 0x1, 0x0, 0x0))
3536 {
3537 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible instance method %s\n", (((void *)0))), ident->string);
3538 }
3539 }
3540 else if(member->initializer)
3541 {
3542 ProcessInitializer(member->initializer, type);
3543 }
3544 if(freeType)
3545 FreeType(type);
3546 }
3547 else
3548 {
3549 if(_class && _class->type == 3)
3550 {
3551 if(member->initializer)
3552 {
3553 struct Type * type = MkClassType(_class->fullName);
3554
3555 ProcessInitializer(member->initializer, type);
3556 FreeType(type);
3557 }
3558 }
3559 else
3560 {
3561 if(member->initializer)
3562 {
3563 ProcessInitializer(member->initializer, (((void *)0)));
3564 }
3565 if(ident)
3566 {
3567 if(method)
3568 {
3569 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't find virtual method %s in class %s\n", (((void *)0))), ident->string, _class->fullName);
3570 }
3571 else if(_class)
3572 {
3573 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't find member %s in class %s\n", (((void *)0))), ident->string, _class->fullName);
3574 if(inCompiler)
3575 __ecereNameSpace__ecere__com__eClass_AddDataMember(_class, ident->string, "int", 0, 0, 1);
3576 }
3577 }
3578 else if(_class)
3579 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "too many initializers for instantiation of class %s\n", (((void *)0))), _class->fullName);
3580 }
3581 }
3582 }
3583
3584 extern struct Identifier * GetDeclId(struct Declarator * decl);
3585
3586 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);
3587
3588 extern void FreeSpecifier(struct Specifier * spec);
3589
3590 static void ProcessFunction(struct FunctionDefinition * function);
3591
3592 extern struct __ecereNameSpace__ecere__sys__OldList *  CopyList(struct __ecereNameSpace__ecere__sys__OldList *  source, void *  (* )(void * ));
3593
3594 extern struct Specifier * CopySpecifier(struct Specifier * spec);
3595
3596 extern struct Declarator * CopyDeclarator(struct Declarator * declarator);
3597
3598 extern void FreeClassFunction(struct ClassFunction * func);
3599
3600 extern struct MemberInit * MkMemberInit(struct __ecereNameSpace__ecere__sys__OldList * ids, struct Initializer * initializer);
3601
3602 extern struct Initializer * MkInitializerAssignment(struct Expression * exp);
3603
3604 void ProcessInstantiationType(struct Instantiation * inst)
3605 {
3606 yylloc = inst->loc;
3607 if(inst->_class)
3608 {
3609 struct MembersInit * members;
3610 struct Symbol * classSym;
3611 struct __ecereNameSpace__ecere__com__Class * _class;
3612
3613 classSym = inst->_class->symbol;
3614 _class = classSym ? classSym->registered : (((void *)0));
3615 if(!_class || _class->type != 5)
3616 DeclareStruct(inst->_class->name, 0x0);
3617 afterExternal = afterExternal ? afterExternal : curExternal;
3618 if(inst->exp)
3619 ProcessExpressionType(inst->exp);
3620 inst->isConstant = 0x1;
3621 if(inst->members)
3622 {
3623 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
3624 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
3625 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
3626 int subMemberStackPos = 0;
3627
3628 for(members = (*inst->members).first; members; members = members->next)
3629 {
3630 switch(members->type)
3631 {
3632 case 1:
3633 {
3634 char name[1024];
3635 static unsigned int instMethodID = 0;
3636 struct External * external = curExternal;
3637 struct Context * context = curContext;
3638 struct Declarator * declarator = members->function->declarator;
3639 struct Identifier * nameID = GetDeclId(declarator);
3640 char * unmangled = nameID ? nameID->string : (((void *)0));
3641 struct Expression * exp;
3642 struct External * createdExternal = (((void *)0));
3643
3644 if(inCompiler)
3645 {
3646 char number[16];
3647
3648 strcpy(name, "__ecereInstMeth_");
3649 FullClassNameCat(name, _class ? _class->fullName : "_UNKNOWNCLASS", 0x0);
3650 strcat(name, "_");
3651 strcat(name, nameID->string);
3652 strcat(name, "_");
3653 sprintf(number, "_%08d", instMethodID++);
3654 strcat(name, number);
3655 nameID->string = __ecereNameSpace__ecere__sys__CopyString(name);
3656 }
3657 if(declarator)
3658 {
3659 struct Symbol * symbol = declarator->symbol;
3660 struct __ecereNameSpace__ecere__com__Method * method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, unmangled, privateModule);
3661
3662 if(method && method->type == 1)
3663 {
3664 symbol->method = method;
3665 ProcessMethodType(method);
3666 if(!symbol->type->thisClass)
3667 {
3668 if(method->dataType->thisClass && currentClass && __ecereNameSpace__ecere__com__eClass_IsDerived(currentClass, method->dataType->thisClass->registered))
3669 {
3670 if(!currentClass->symbol)
3671 currentClass->symbol = FindClass(currentClass->fullName);
3672 symbol->type->thisClass = currentClass->symbol;
3673 }
3674 else
3675 {
3676 if(!_class->symbol)
3677 _class->symbol = FindClass(_class->fullName);
3678 symbol->type->thisClass = _class->symbol;
3679 }
3680 }
3681 DeclareType(symbol->type, 0x1, 0x1);
3682 }
3683 else if(classSym)
3684 {
3685 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't find virtual method %s in class %s\n", (((void *)0))), unmangled, classSym->string);
3686 }
3687 }
3688 createdExternal = ProcessClassFunction(classSym ? classSym->registered : (((void *)0)), members->function, ast, afterExternal, 0x1);
3689 if(nameID)
3690 {
3691 FreeSpecifier(nameID->_class);
3692 nameID->_class = (((void *)0));
3693 }
3694 if(inCompiler)
3695 {
3696 struct Type * type = declarator->symbol->type;
3697 struct External * oldExternal = curExternal;
3698
3699 declarator->symbol->id = declarator->symbol->idCode = curExternal->symbol->idCode;
3700 {
3701 struct External * externalDecl;
3702
3703 externalDecl = MkExternalDeclaration((((void *)0)));
3704 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), oldExternal->prev, externalDecl);
3705 if(createdExternal->function)
3706 {
3707 ProcessFunction(createdExternal->function);
3708 {
3709 struct Declaration * decl = MkDeclaration(CopyList(createdExternal->function->specifiers, CopySpecifier), MkListOne(MkInitDeclarator(CopyDeclarator(declarator), (((void *)0)))));
3710
3711 externalDecl->declaration = decl;
3712 if(decl->symbol && !decl->symbol->pointerExternal)
3713 decl->symbol->pointerExternal = externalDecl;
3714 declarator->symbol->pointerExternal = externalDecl;
3715 }
3716 }
3717 }
3718 }
3719 else if(declarator)
3720 {
3721 curExternal = declarator->symbol->pointerExternal;
3722 ProcessFunction((struct FunctionDefinition *)members->function);
3723 }
3724 curExternal = external;
3725 curContext = context;
3726 if(inCompiler)
3727 {
3728 FreeClassFunction(members->function);
3729 exp = QMkExpId(name);
3730 members->type = 0;
3731 members->dataMembers = MkListOne(MkMemberInit(MkListOne(MkIdentifier(unmangled)), MkInitializerAssignment(exp)));
3732 (__ecereNameSpace__ecere__com__eSystem_Delete(unmangled), unmangled = 0);
3733 }
3734 break;
3735 }
3736 case 0:
3737 {
3738 if(members->dataMembers && classSym)
3739 {
3740 struct MemberInit * member;
3741 struct Location oldyyloc = yylloc;
3742
3743 for(member = (*members->dataMembers).first; member; member = member->next)
3744 {
3745 ProcessMemberInitData(member, classSym->registered, &curClass, &curMember, subMemberStack, &subMemberStackPos);
3746 if(member->initializer && !member->initializer->isConstant)
3747 inst->isConstant = 0x0;
3748 }
3749 yylloc = oldyyloc;
3750 }
3751 break;
3752 }
3753 }
3754 }
3755 }
3756 }
3757 }
3758
3759 static void DeclareType(struct Type * type, unsigned int declarePointers, unsigned int declareParams)
3760 {
3761 if(inCompiler)
3762 {
3763 if(type->kind == 11)
3764 {
3765 struct Type * param;
3766
3767 if(declareParams)
3768 {
3769 for(param = type->params.first; param; param = param->next)
3770 DeclareType(param, declarePointers, 0x1);
3771 }
3772 DeclareType(type->returnType, declarePointers, 0x1);
3773 }
3774 else if(type->kind == 13 && declarePointers)
3775 DeclareType(type->type, declarePointers, 0x0);
3776 else if(type->kind == 8)
3777 {
3778 if(type->_class->registered && (type->_class->registered->type == 1 || type->_class->registered->type == 5) && !type->_class->declaring)
3779 DeclareStruct(type->_class->registered->fullName, type->_class->registered->type == 5);
3780 }
3781 else if(type->kind == 9 || type->kind == 10)
3782 {
3783 struct Type * member;
3784
3785 for(member = type->members.first; member; member = member->next)
3786 DeclareType(member, 0x0, 0x0);
3787 }
3788 else if(type->kind == 12)
3789 DeclareType(type->arrayType, declarePointers, 0x0);
3790 }
3791 }
3792
3793 extern struct __ecereNameSpace__ecere__com__Class * __ecereNameSpace__ecere__com__eSystem_FindClass(struct __ecereNameSpace__ecere__com__Instance * module, char *  name);
3794
3795 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * FindTemplateArg(struct __ecereNameSpace__ecere__com__Class * _class, struct TemplateParameter * param)
3796 {
3797 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * arg = (((void *)0));
3798 int id = 0;
3799 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
3800 struct __ecereNameSpace__ecere__com__Class * sClass;
3801
3802 for(sClass = _class; sClass; sClass = sClass->base)
3803 {
3804 id = 0;
3805 if(sClass->templateClass)
3806 sClass = sClass->templateClass;
3807 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
3808 {
3809 if(curParam->type == 0 && !strcmp(param->identifier->string, curParam->name))
3810 {
3811 for(sClass = sClass->base; sClass; sClass = sClass->base)
3812 {
3813 if(sClass->templateClass)
3814 sClass = sClass->templateClass;
3815 id += sClass->templateParams.count;
3816 }
3817 break;
3818 }
3819 id++;
3820 }
3821 if(curParam)
3822 break;
3823 }
3824 if(curParam)
3825 {
3826 arg = &_class->templateArgs[id];
3827 if(arg && param->type == 0)
3828 (*arg).dataTypeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, (*arg).dataTypeString);
3829 }
3830 return arg;
3831 }
3832
3833 extern struct Context * PushContext(void);
3834
3835 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplatedType;
3836
3837 struct TemplatedType
3838 {
3839 uintptr_t key;
3840 struct __ecereNameSpace__ecere__sys__BTNode * parent;
3841 struct __ecereNameSpace__ecere__sys__BTNode * left;
3842 struct __ecereNameSpace__ecere__sys__BTNode * right;
3843 int depth;
3844 struct TemplateParameter * param;
3845 } __attribute__ ((gcc_struct));
3846
3847 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(struct __ecereNameSpace__ecere__sys__BinaryTree * this, struct __ecereNameSpace__ecere__sys__BTNode * node);
3848
3849 struct Context * SetupTemplatesContext(struct __ecereNameSpace__ecere__com__Class * _class)
3850 {
3851 void * __ecereTemp1;
3852 struct Context * context = PushContext();
3853
3854 context->templateTypesOnly = 0x1;
3855 if(_class->symbol && ((struct Symbol *)_class->symbol)->templateParams)
3856 {
3857 struct TemplateParameter * param = (*((struct Symbol *)_class->symbol)->templateParams).first;
3858
3859 for(; param; param = param->next)
3860 {
3861 if(param->type == 0 && param->identifier)
3862 {
3863 struct TemplatedType * type = (type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TemplatedType), type->key = (uintptr_t)param->identifier->string, type->param = param, type);
3864
3865 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&curContext->templateTypes, (struct __ecereNameSpace__ecere__sys__BTNode *)type);
3866 }
3867 }
3868 }
3869 else if(_class)
3870 {
3871 struct __ecereNameSpace__ecere__com__Class * sClass;
3872
3873 for(sClass = _class; sClass; sClass = sClass->base)
3874 {
3875 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * p;
3876
3877 for(p = sClass->templateParams.first; p; p = p->next)
3878 {
3879 if(p->type == 0)
3880 {
3881 struct TemplateParameter * param = p->param;
3882 struct TemplatedType * type;
3883
3884 if(!param)
3885 {
3886 p->param = param = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TemplateParameter), ((struct TemplateParameter *)__ecereTemp1)->identifier = MkIdentifier(p->name), ((struct TemplateParameter *)__ecereTemp1)->type = p->type, ((struct TemplateParameter *)__ecereTemp1)->dataTypeString = p->dataTypeString, ((struct TemplateParameter *)__ecereTemp1));
3887 }
3888 type = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TemplatedType), ((struct TemplatedType *)__ecereTemp1)->key = (uintptr_t)p->name, ((struct TemplatedType *)__ecereTemp1)->param = param, ((struct TemplatedType *)__ecereTemp1));
3889 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&curContext->templateTypes, (struct __ecereNameSpace__ecere__sys__BTNode *)type);
3890 }
3891 }
3892 }
3893 }
3894 return context;
3895 }
3896
3897 extern void PopContext(struct Context * ctx);
3898
3899 extern void FreeContext(struct Context * context);
3900
3901 void FinishTemplatesContext(struct Context * context)
3902 {
3903 PopContext(context);
3904 FreeContext(context);
3905 ((context ? (__ecereClass_Context->Destructor ? __ecereClass_Context->Destructor(context) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(context)) : 0), context = 0);
3906 }
3907
3908 void ProcessMethodType(struct __ecereNameSpace__ecere__com__Method * method)
3909 {
3910 if(!method->dataType)
3911 {
3912 struct Context * context = SetupTemplatesContext(method->_class);
3913
3914 method->dataType = ProcessTypeString(method->dataTypeString, 0x0);
3915 FinishTemplatesContext(context);
3916 if(method->type != 1 && method->dataType)
3917 {
3918 if(!method->dataType->thisClass && !method->dataType->staticMethod)
3919 {
3920 if(!method->_class->symbol)
3921 method->_class->symbol = FindClass(method->_class->fullName);
3922 method->dataType->thisClass = method->_class->symbol;
3923 }
3924 }
3925 }
3926 }
3927
3928 void ProcessPropertyType(struct __ecereNameSpace__ecere__com__Property * prop)
3929 {
3930 if(!prop->dataType)
3931 {
3932 struct Context * context = SetupTemplatesContext(prop->_class);
3933
3934 prop->dataType = ProcessTypeString(prop->dataTypeString, 0x0);
3935 FinishTemplatesContext(context);
3936 }
3937 }
3938
3939 extern struct Declarator * GetFuncDecl(struct Declarator * decl);
3940
3941 extern void FreeTypeName(struct TypeName * typeName);
3942
3943 static void ProcessDeclarator(struct Declarator * decl);
3944
3945 extern struct __ecereNameSpace__ecere__sys__OldList *  excludedSymbols;
3946
3947 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_MethodImport;
3948
3949 struct MethodImport
3950 {
3951 struct MethodImport * prev;
3952 struct MethodImport * next;
3953 char *  name;
3954 unsigned int isVirtual;
3955 } __attribute__ ((gcc_struct));
3956
3957 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(struct __ecereNameSpace__ecere__sys__OldList * this, void *  item);
3958
3959 void DeclareMethod(struct __ecereNameSpace__ecere__com__Method * method, char * name)
3960 {
3961 void * __ecereTemp1;
3962 struct Symbol * symbol = method->symbol;
3963
3964 if(!symbol || (!symbol->pointerExternal && method->type == 1) || symbol->id > (curExternal ? curExternal->symbol->idCode : -1))
3965 {
3966 unsigned int imported = 0x0;
3967 unsigned int dllImport = 0x0;
3968
3969 if(!method->dataType)
3970 method->dataType = ProcessTypeString(method->dataTypeString, 0x0);
3971 if(!symbol || symbol->_import || method->type == 1)
3972 {
3973 if(!symbol || method->type == 1)
3974 {
3975 struct Symbol * classSym;
3976
3977 if(!method->_class->symbol)
3978 method->_class->symbol = FindClass(method->_class->fullName);
3979 classSym = method->_class->symbol;
3980 if(!classSym->_import)
3981 {
3982 struct ModuleImport * module;
3983
3984 if(method->_class->module && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)method->_class->module + 12)))->name)
3985 module = FindModule(method->_class->module);
3986 else
3987 module = mainModule;
3988 classSym->_import = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_ClassImport), ((struct ClassImport *)__ecereTemp1)->name = __ecereNameSpace__ecere__sys__CopyString(method->_class->fullName), ((struct ClassImport *)__ecereTemp1)->isRemote = method->_class->isRemote, ((struct ClassImport *)__ecereTemp1));
3989 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->classes, classSym->_import);
3990 }
3991 if(!symbol)
3992 {
3993 symbol = method->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
3994 }
3995 if(!symbol->_import)
3996 {
3997 symbol->_import = (struct ClassImport *)(__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_MethodImport), ((struct MethodImport *)__ecereTemp1)->name = __ecereNameSpace__ecere__sys__CopyString(method->name), ((struct MethodImport *)__ecereTemp1)->isVirtual = method->type == 1, ((struct MethodImport *)__ecereTemp1));
3998 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&classSym->_import->methods, symbol->_import);
3999 }
4000 if(!symbol)
4001 {
4002 symbol->type = method->dataType;
4003 if(symbol->type)
4004 symbol->type->refCount++;
4005 }
4006 }
4007 if(!method->dataType->dllExport)
4008 {
4009 imported = 0x1;
4010 if(method->_class->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)method->_class->module + 12)))->importType != 1)
4011 dllImport = 0x1;
4012 }
4013 }
4014 if(method->type != 1 && method->dataType)
4015 DeclareType(method->dataType, 0x1, 0x1);
4016 if(!symbol->pointerExternal || symbol->pointerExternal->type == 0)
4017 {
4018 struct Declaration * decl;
4019 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
4020 struct Declarator * d;
4021 struct Declarator * funcDecl;
4022 struct External * external;
4023
4024 specifiers = MkList();
4025 declarators = MkList();
4026 if(dllImport)
4027 ListAdd(specifiers, MkSpecifier(EXTERN));
4028 else if(method->_class->symbol && ((struct Symbol *)method->_class->symbol)->isStatic)
4029 ListAdd(specifiers, MkSpecifier(STATIC));
4030 if(method->type == 1)
4031 {
4032 ListAdd(specifiers, MkSpecifier(INT));
4033 d = MkDeclaratorIdentifier(MkIdentifier(name));
4034 }
4035 else
4036 {
4037 d = MkDeclaratorIdentifier(MkIdentifier(name));
4038 if(dllImport)
4039 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
4040 {
4041 struct Context * context = SetupTemplatesContext(method->_class);
4042
4043 d = SpecDeclFromString(method->dataTypeString, specifiers, d);
4044 FinishTemplatesContext(context);
4045 }
4046 funcDecl = GetFuncDecl(d);
4047 if(dllImport)
4048 {
4049 struct Specifier * spec, * next;
4050
4051 for(spec = (*specifiers).first; spec; spec = next)
4052 {
4053 next = spec->next;
4054 if(spec->type == 5)
4055 {
4056 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*specifiers), spec);
4057 FreeSpecifier(spec);
4058 }
4059 }
4060 }
4061 if(method->dataType && !method->dataType->staticMethod)
4062 {
4063 if(funcDecl && funcDecl->function.parameters && (*funcDecl->function.parameters).count)
4064 {
4065 struct __ecereNameSpace__ecere__com__Class * _class = method->dataType->thisClass ? method->dataType->thisClass->registered : method->_class;
4066 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")));
4067 struct TypeName * firstParam = ((struct TypeName *)(*funcDecl->function.parameters).first);
4068 struct Specifier * firstSpec = firstParam->qualifiers ? (*firstParam->qualifiers).first : (((void *)0));
4069
4070 if(firstSpec && firstSpec->type == 0 && firstSpec->specifier == VOID && !firstParam->declarator)
4071 {
4072 struct TypeName * param = (*funcDecl->function.parameters).first;
4073
4074 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->function.parameters), param);
4075 FreeTypeName(param);
4076 }
4077 if(!funcDecl->function.parameters)
4078 funcDecl->function.parameters = MkList();
4079 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
4080 }
4081 }
4082 }
4083 ProcessDeclarator(d);
4084 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
4085 decl = MkDeclaration(specifiers, declarators);
4086 ReplaceThisClassSpecifiers(specifiers, method->_class);
4087 if(symbol->pointerExternal)
4088 {
4089 struct Symbol * functionSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4090
4091 {
4092 *functionSymbol = *symbol;
4093 functionSymbol->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
4094 if(functionSymbol->type)
4095 functionSymbol->type->refCount++;
4096 }
4097 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*excludedSymbols), functionSymbol);
4098 symbol->pointerExternal->symbol = functionSymbol;
4099 }
4100 external = MkExternalDeclaration(decl);
4101 if(curExternal)
4102 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal ? curExternal->prev : (((void *)0)), external);
4103 external->symbol = symbol;
4104 symbol->pointerExternal = external;
4105 }
4106 else if(ast)
4107 {
4108 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
4109 }
4110 symbol->id = curExternal ? curExternal->symbol->idCode : (((int)0x7fffffff));
4111 }
4112 }
4113
4114 char * ReplaceThisClass(struct __ecereNameSpace__ecere__com__Class * _class)
4115 {
4116 if(thisClassParams && _class->templateParams.count && !_class->templateClass)
4117 {
4118 unsigned int first = 0x1;
4119 int p = 0;
4120 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
4121 int lastParam = -1;
4122 char className[1024];
4123
4124 strcpy(className, _class->fullName);
4125 for(param = _class->templateParams.first; param; param = param->next)
4126 {
4127 {
4128 if(first)
4129 strcat(className, "<");
4130 if(!first)
4131 strcat(className, ", ");
4132 if(lastParam + 1 != p)
4133 {
4134 strcat(className, param->name);
4135 strcat(className, " = ");
4136 }
4137 strcat(className, param->name);
4138 first = 0x0;
4139 lastParam = p;
4140 }
4141 p++;
4142 }
4143 if(!first)
4144 {
4145 int len = strlen(className);
4146
4147 if(className[len - 1] == '>')
4148 className[len++] = ' ';
4149 className[len++] = '>';
4150 className[len++] = '\0';
4151 }
4152 return __ecereNameSpace__ecere__sys__CopyString(className);
4153 }
4154 else
4155 return __ecereNameSpace__ecere__sys__CopyString(_class->fullName);
4156 }
4157
4158 struct Type * ReplaceThisClassType(struct __ecereNameSpace__ecere__com__Class * _class)
4159 {
4160 if(thisClassParams && _class->templateParams.count && !_class->templateClass)
4161 {
4162 unsigned int first = 0x1;
4163 int p = 0;
4164 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
4165 int lastParam = -1;
4166 char className[1024];
4167
4168 strcpy(className, _class->fullName);
4169 for(param = _class->templateParams.first; param; param = param->next)
4170 {
4171 {
4172 if(first)
4173 strcat(className, "<");
4174 if(!first)
4175 strcat(className, ", ");
4176 if(lastParam + 1 != p)
4177 {
4178 strcat(className, param->name);
4179 strcat(className, " = ");
4180 }
4181 strcat(className, param->name);
4182 first = 0x0;
4183 lastParam = p;
4184 }
4185 p++;
4186 }
4187 if(!first)
4188 {
4189 int len = strlen(className);
4190
4191 if(className[len - 1] == '>')
4192 className[len++] = ' ';
4193 className[len++] = '>';
4194 className[len++] = '\0';
4195 }
4196 return MkClassType(className);
4197 }
4198 else
4199 {
4200 return MkClassType(_class->fullName);
4201 }
4202 }
4203
4204 void ReplaceThisClassSpecifiers(struct __ecereNameSpace__ecere__sys__OldList * specs, struct __ecereNameSpace__ecere__com__Class * _class)
4205 {
4206 if(specs != (((void *)0)) && _class)
4207 {
4208 struct Specifier * spec;
4209
4210 for(spec = specs->first; spec; spec = spec->next)
4211 {
4212 if(spec->type == 0 && spec->specifier == THISCLASS)
4213 {
4214 spec->type = 1;
4215 spec->name = ReplaceThisClass(_class);
4216 spec->symbol = FindClass(spec->name);
4217 }
4218 }
4219 }
4220 }
4221
4222 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__GlobalFunction;
4223
4224 struct __ecereNameSpace__ecere__com__GlobalFunction
4225 {
4226 struct __ecereNameSpace__ecere__com__GlobalFunction * prev;
4227 struct __ecereNameSpace__ecere__com__GlobalFunction * next;
4228 char *  name;
4229 int (*  function)();
4230 struct __ecereNameSpace__ecere__com__Instance * module;
4231 struct __ecereNameSpace__ecere__com__NameSpace *  nameSpace;
4232 char *  dataTypeString;
4233 struct Type * dataType;
4234 void *  symbol;
4235 } __attribute__ ((gcc_struct));
4236
4237 extern struct Context * globalContext;
4238
4239 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_FunctionImport;
4240
4241 struct FunctionImport
4242 {
4243 struct FunctionImport * prev;
4244 struct FunctionImport * next;
4245 char *  name;
4246 } __attribute__ ((gcc_struct));
4247
4248 unsigned int DeclareFunction(struct __ecereNameSpace__ecere__com__GlobalFunction * function, char * name)
4249 {
4250 void * __ecereTemp1;
4251 struct Symbol * symbol = function->symbol;
4252
4253 if(curExternal && (!symbol || symbol->id > curExternal->symbol->idCode))
4254 {
4255 unsigned int imported = 0x0;
4256 unsigned int dllImport = 0x0;
4257
4258 if(!function->dataType)
4259 {
4260 function->dataType = ProcessTypeString(function->dataTypeString, 0x0);
4261 if(!function->dataType->thisClass)
4262 function->dataType->staticMethod = 0x1;
4263 }
4264 if(inCompiler)
4265 {
4266 if(!symbol)
4267 {
4268 struct ModuleImport * module = FindModule(function->module);
4269
4270 symbol = function->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4271 if(module->name)
4272 {
4273 if(!function->dataType->dllExport)
4274 {
4275 symbol->_import = (struct ClassImport *)(__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_FunctionImport), ((struct FunctionImport *)__ecereTemp1)->name = __ecereNameSpace__ecere__sys__CopyString(function->name), ((struct FunctionImport *)__ecereTemp1));
4276 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->functions, symbol->_import);
4277 }
4278 }
4279 {
4280 symbol->type = ProcessTypeString(function->dataTypeString, 0x0);
4281 if(!symbol->type->thisClass)
4282 symbol->type->staticMethod = 0x1;
4283 }
4284 }
4285 imported = symbol->_import ? 0x1 : 0x0;
4286 if(imported && function->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + 12)))->importType != 1)
4287 dllImport = 0x1;
4288 }
4289 DeclareType(function->dataType, 0x1, 0x1);
4290 if(inCompiler)
4291 {
4292 if(!symbol->pointerExternal || symbol->pointerExternal->type == 0)
4293 {
4294 struct Declaration * decl;
4295 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
4296 struct Declarator * d;
4297 struct Declarator * funcDecl;
4298 struct External * external;
4299
4300 specifiers = MkList();
4301 declarators = MkList();
4302 ListAdd(specifiers, MkSpecifier(EXTERN));
4303 d = MkDeclaratorIdentifier(MkIdentifier(imported ? name : function->name));
4304 if(dllImport)
4305 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
4306 d = SpecDeclFromString(function->dataTypeString, specifiers, d);
4307 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + 12)))->importType == 1)
4308 {
4309 struct Specifier * spec;
4310
4311 for(spec = (*specifiers).first; spec; spec = spec->next)
4312 if(spec->type == 5 && spec->extDecl && spec->extDecl->type == 0 && !strcmp(spec->extDecl->s, "dllexport"))
4313 {
4314 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*specifiers), spec);
4315 FreeSpecifier(spec);
4316 break;
4317 }
4318 }
4319 funcDecl = GetFuncDecl(d);
4320 if(funcDecl && !funcDecl->function.parameters)
4321 {
4322 funcDecl->function.parameters = MkList();
4323 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), MkTypeName(MkListOne(MkSpecifier(VOID)), (((void *)0))));
4324 }
4325 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
4326 {
4327 struct Context * oldCtx = curContext;
4328
4329 curContext = globalContext;
4330 decl = MkDeclaration(specifiers, declarators);
4331 curContext = oldCtx;
4332 }
4333 if(symbol->pointerExternal)
4334 {
4335 struct Symbol * functionSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4336
4337 {
4338 *functionSymbol = *symbol;
4339 functionSymbol->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
4340 if(functionSymbol->type)
4341 functionSymbol->type->refCount++;
4342 }
4343 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*excludedSymbols), functionSymbol);
4344 symbol->pointerExternal->symbol = functionSymbol;
4345 }
4346 external = MkExternalDeclaration(decl);
4347 if(curExternal)
4348 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
4349 external->symbol = symbol;
4350 symbol->pointerExternal = external;
4351 }
4352 else
4353 {
4354 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
4355 }
4356 if(curExternal)
4357 symbol->id = curExternal->symbol->idCode;
4358 }
4359 }
4360 return (symbol && symbol->_import && function->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + 12)))->importType != 1) ? 0x1 : 0x0;
4361 }
4362
4363 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_GlobalData;
4364
4365 struct GlobalData
4366 {
4367 uintptr_t key;
4368 struct __ecereNameSpace__ecere__sys__BTNode * parent;
4369 struct __ecereNameSpace__ecere__sys__BTNode * left;
4370 struct __ecereNameSpace__ecere__sys__BTNode * right;
4371 int depth;
4372 struct __ecereNameSpace__ecere__com__Instance * module;
4373 char *  dataTypeString;
4374 struct Type * dataType;
4375 void *  symbol;
4376 char *  fullName;
4377 } __attribute__ ((gcc_struct));
4378
4379 void DeclareGlobalData(struct GlobalData * data)
4380 {
4381 struct Symbol * symbol = data->symbol;
4382
4383 if(curExternal && (!symbol || symbol->id > curExternal->symbol->idCode))
4384 {
4385 if(inCompiler)
4386 {
4387 if(!symbol)
4388 symbol = data->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4389 }
4390 if(!data->dataType)
4391 data->dataType = ProcessTypeString(data->dataTypeString, 0x0);
4392 DeclareType(data->dataType, 0x1, 0x1);
4393 if(inCompiler)
4394 {
4395 if(!symbol->pointerExternal)
4396 {
4397 struct Declaration * decl;
4398 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
4399 struct Declarator * d;
4400 struct External * external;
4401
4402 specifiers = MkList();
4403 declarators = MkList();
4404 ListAdd(specifiers, MkSpecifier(EXTERN));
4405 d = MkDeclaratorIdentifier(MkIdentifier(data->fullName));
4406 d = SpecDeclFromString(data->dataTypeString, specifiers, d);
4407 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
4408 decl = MkDeclaration(specifiers, declarators);
4409 external = MkExternalDeclaration(decl);
4410 if(curExternal)
4411 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
4412 external->symbol = symbol;
4413 symbol->pointerExternal = external;
4414 }
4415 else
4416 {
4417 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
4418 }
4419 if(curExternal)
4420 symbol->id = curExternal->symbol->idCode;
4421 }
4422 }
4423 }
4424
4425 struct Conversion
4426 {
4427 struct Conversion * prev, * next;
4428 struct __ecereNameSpace__ecere__com__Property * convert;
4429 unsigned int isGet;
4430 struct Type * resultType;
4431 } __attribute__ ((gcc_struct));
4432
4433 static struct __ecereNameSpace__ecere__com__Class * __ecereClass_Conversion;
4434
4435 extern void Compiler_Warning(char *  format, ...);
4436
4437 void PrintType(struct Type * type, char *  string, unsigned int printName, unsigned int fullName);
4438
4439 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)
4440 {
4441 if(source && dest)
4442 {
4443 if(source->kind == 20 && dest->kind != 20)
4444 {
4445 struct Type * type = ProcessTemplateParameterType(source->templateParameter);
4446
4447 if(type)
4448 source = type;
4449 }
4450 if(dest->kind == 20 && source->kind != 20)
4451 {
4452 struct Type * type = ProcessTemplateParameterType(dest->templateParameter);
4453
4454 if(type)
4455 dest = type;
4456 }
4457 if((dest->classObjectType == 2 && source->classObjectType != 3) || (dest->classObjectType == 3 && source->classObjectType != 2))
4458 {
4459 return 0x1;
4460 }
4461 if(source->classObjectType == 3 && dest->classObjectType != 2)
4462 {
4463 return 0x1;
4464 }
4465 if((dest->kind == 9 && source->kind == 9) || (dest->kind == 10 && source->kind == 10))
4466 {
4467 if((dest->enumName && source->enumName && !strcmp(dest->enumName, source->enumName)) || (source->members.first && source->members.first == dest->members.first))
4468 return 0x1;
4469 }
4470 if(dest->kind == 14 && source->kind != 0)
4471 return 0x1;
4472 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))
4473 return 0x1;
4474 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))
4475 return 0x1;
4476 if(((source->kind == 8 && dest->kind == 8) || (source->kind == 19 && dest->kind == 19)) && source->_class)
4477 {
4478 if(source->_class->registered && source->_class->registered->type == 3)
4479 {
4480 if(conversions != (((void *)0)))
4481 {
4482 if(source->_class->registered == dest->_class->registered)
4483 return 0x1;
4484 }
4485 else
4486 {
4487 struct __ecereNameSpace__ecere__com__Class * sourceBase, * destBase;
4488
4489 for(sourceBase = source->_class->registered; sourceBase && sourceBase->base->type != 1000; sourceBase = sourceBase->base)
4490 ;
4491 for(destBase = dest->_class->registered; destBase && destBase->base->type != 1000; destBase = destBase->base)
4492 ;
4493 if(sourceBase == destBase)
4494 return 0x1;
4495 }
4496 }
4497 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))
4498 return 0x1;
4499 else
4500 {
4501 if(enumBaseType && dest->_class && dest->_class->registered && dest->_class->registered->type == 4 && source->_class && source->_class->registered && source->_class->registered->type != 4)
4502 {
4503 if(__ecereNameSpace__ecere__com__eClass_IsDerived(dest->_class->registered, source->_class->registered))
4504 {
4505 return 0x1;
4506 }
4507 }
4508 }
4509 }
4510 if(source->kind == 19 && dest->kind == 8 && dest->_class && !strcmp(dest->_class->string, "ecere::com::Class"))
4511 return 0x1;
4512 if(doConversion)
4513 {
4514 if(source->kind == 8)
4515 {
4516 struct __ecereNameSpace__ecere__com__Class * _class;
4517
4518 for(_class = source->_class ? source->_class->registered : (((void *)0)); _class; _class = _class->base)
4519 {
4520 struct __ecereNameSpace__ecere__com__Property * convert;
4521
4522 for(convert = _class->conversions.first; convert; convert = convert->next)
4523 {
4524 if(convert->memberAccess == 1 || _class->module == privateModule)
4525 {
4526 struct Conversion * after = (conversions != (((void *)0))) ? conversions->last : (((void *)0));
4527
4528 if(!convert->dataType)
4529 convert->dataType = ProcessTypeString(convert->dataTypeString, 0x0);
4530 if(MatchTypes(convert->dataType, dest, conversions, (((void *)0)), (((void *)0)), 0x0, 0x1, 0x0, 0x1))
4531 {
4532 if(!conversions && !convert->Get)
4533 return 0x1;
4534 else if(conversions != (((void *)0)))
4535 {
4536 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))
4537 return 0x1;
4538 else
4539 {
4540 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv->isGet = 0x1, conv);
4541
4542 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(conversions, after, conv);
4543 return 0x1;
4544 }
4545 }
4546 }
4547 }
4548 }
4549 }
4550 }
4551 if(dest->kind == 8)
4552 {
4553 struct __ecereNameSpace__ecere__com__Class * _class;
4554
4555 for(_class = dest->_class ? dest->_class->registered : (((void *)0)); _class; _class = _class->base)
4556 {
4557 struct __ecereNameSpace__ecere__com__Property * convert;
4558
4559 for(convert = _class->conversions.first; convert; convert = convert->next)
4560 {
4561 if(convert->memberAccess == 1 || _class->module == privateModule)
4562 {
4563 if(!convert->dataType)
4564 convert->dataType = ProcessTypeString(convert->dataTypeString, 0x0);
4565 if(convert->dataType != dest && MatchTypes(source, convert->dataType, conversions, (((void *)0)), (((void *)0)), 0x1, 0x0, 0x0, 0x1))
4566 {
4567 if(!conversions && !convert->Set)
4568 return 0x1;
4569 else if(conversions != (((void *)0)))
4570 {
4571 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))
4572 return 0x1;
4573 else
4574 {
4575 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv);
4576
4577 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(conversions, conv);
4578 return 0x1;
4579 }
4580 }
4581 }
4582 }
4583 }
4584 }
4585 if(enumBaseType && dest->_class && dest->_class->registered && dest->_class->registered->type == 4)
4586 {
4587 if(!dest->_class->registered->dataType)
4588 dest->_class->registered->dataType = ProcessTypeString(dest->_class->registered->dataTypeString, 0x0);
4589 if(dest->_class->registered->dataType->kind == 8 || source->truth || dest->truth)
4590 {
4591 if(MatchTypes(source, dest->_class->registered->dataType, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
4592 {
4593 return 0x1;
4594 }
4595 }
4596 }
4597 }
4598 if(source->kind == 8)
4599 {
4600 struct __ecereNameSpace__ecere__com__Class * _class;
4601
4602 for(_class = source->_class ? source->_class->registered : (((void *)0)); _class; _class = _class->base)
4603 {
4604 struct __ecereNameSpace__ecere__com__Property * convert;
4605
4606 for(convert = _class->conversions.first; convert; convert = convert->next)
4607 {
4608 if(convert->memberAccess == 1 || _class->module == privateModule)
4609 {
4610 struct Conversion * after = (conversions != (((void *)0))) ? conversions->last : (((void *)0));
4611
4612 if(!convert->dataType)
4613 convert->dataType = ProcessTypeString(convert->dataTypeString, 0x0);
4614 if(convert->dataType != source && MatchTypes(convert->dataType, dest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x1))
4615 {
4616 if(!conversions && !convert->Get)
4617 return 0x1;
4618 else if(conversions != (((void *)0)))
4619 {
4620 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))
4621 return 0x1;
4622 else
4623 {
4624 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv->isGet = 0x1, conv);
4625
4626 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(conversions, after, conv);
4627 return 0x1;
4628 }
4629 }
4630 }
4631 }
4632 }
4633 }
4634 if(enumBaseType && source->_class && source->_class->registered && source->_class->registered->type == 4)
4635 {
4636 if(!source->_class->registered->dataType)
4637 source->_class->registered->dataType = ProcessTypeString(source->_class->registered->dataTypeString, 0x0);
4638 if(MatchTypes(source->_class->registered->dataType, dest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
4639 {
4640 return 0x1;
4641 }
4642 }
4643 }
4644 }
4645 if(source->kind == 8 || source->kind == 19)
4646 ;
4647 else if(dest->kind == source->kind && (dest->kind != 9 && dest->kind != 10 && dest->kind != 11 && dest->kind != 12 && dest->kind != 13 && dest->kind != 16))
4648 return 0x1;
4649 else if(dest->kind == 7 && source->kind == 6)
4650 return 0x1;
4651 else if(dest->kind == 2 && source->kind == 1)
4652 return 0x1;
4653 else if(dest->kind == 3 && (source->kind == 2 || source->kind == 1))
4654 return 0x1;
4655 else if(dest->kind == 4 && (source->kind == 2 || source->kind == 1 || source->kind == 3))
4656 return 0x1;
4657 else if(dest->kind == 22 && (source->kind == 2 || source->kind == 1 || source->kind == 3))
4658 return 0x1;
4659 else if(source->kind == 15 && (dest->kind == 3 || dest->kind == 2 || dest->kind == 1 || dest->kind == 5 || dest->kind == 4 || dest->kind == 22))
4660 return 0x1;
4661 else if(dest->kind == 15 && (source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 5 || source->kind == 4 || source->kind == 22))
4662 return 0x1;
4663 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)))
4664 {
4665 struct Type * paramSource, * paramDest;
4666
4667 if(dest->kind == 16)
4668 owningClassDest = dest->methodClass ? dest->methodClass : dest->method->_class;
4669 if(source->kind == 16)
4670 owningClassSource = source->methodClass ? source->methodClass : source->method->_class;
4671 if(dest->kind == 13 && dest->type->kind == 11)
4672 dest = dest->type;
4673 if(source->kind == 13 && source->type->kind == 11)
4674 source = source->type;
4675 if(dest->kind == 16)
4676 dest = dest->method->dataType;
4677 if(source->kind == 16)
4678 source = source->method->dataType;
4679 paramSource = source->params.first;
4680 if(paramSource && paramSource->kind == 0)
4681 paramSource = (((void *)0));
4682 paramDest = dest->params.first;
4683 if(paramDest && paramDest->kind == 0)
4684 paramDest = (((void *)0));
4685 if((dest->staticMethod || (!dest->thisClass && !owningClassDest)) && !(source->staticMethod || (!source->thisClass && !owningClassSource)))
4686 {
4687 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))))
4688 {
4689 if(paramDest && paramDest->kind == 8)
4690 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "method class must be derived from %s\n", (((void *)0))), paramDest->_class->string);
4691 else
4692 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "method class should not take an object\n", (((void *)0))));
4693 return 0x0;
4694 }
4695 paramDest = paramDest->next;
4696 }
4697 else if(!dest->staticMethod && (dest->thisClass || owningClassDest))
4698 {
4699 if((source->staticMethod || (!source->thisClass && !owningClassSource)))
4700 {
4701 if(dest->thisClass)
4702 {
4703 if(!paramSource || paramSource->kind != 8 || !__ecereNameSpace__ecere__com__eClass_IsDerived(paramSource->_class->registered, dest->thisClass->registered))
4704 {
4705 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "method class must be derived from %s\n", (((void *)0))), dest->thisClass->string);
4706 return 0x0;
4707 }
4708 }
4709 else
4710 {
4711 if(!paramSource || paramSource->kind != 8 || (owningClassDest && !__ecereNameSpace__ecere__com__eClass_IsDerived(paramSource->_class->registered, owningClassDest)))
4712 {
4713 if(owningClassDest)
4714 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "%s expected to be derived from method class\n", (((void *)0))), owningClassDest->fullName);
4715 else
4716 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "overriding class expected to be derived from method class\n", (((void *)0))));
4717 return 0x0;
4718 }
4719 }
4720 paramSource = paramSource->next;
4721 }
4722 else
4723 {
4724 if(dest->thisClass)
4725 {
4726 if(!__ecereNameSpace__ecere__com__eClass_IsDerived(source->thisClass ? source->thisClass->registered : owningClassSource, dest->thisClass->registered))
4727 {
4728 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "method class must be derived from %s\n", (((void *)0))), dest->thisClass->string);
4729 return 0x0;
4730 }
4731 }
4732 else
4733 {
4734 if(source->thisClass && source->thisClass->registered && owningClassDest && !__ecereNameSpace__ecere__com__eClass_IsDerived(source->thisClass->registered, owningClassDest))
4735 {
4736 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "%s expected to be derived from method class\n", (((void *)0))), source->thisClass->registered->fullName);
4737 return 0x0;
4738 }
4739 }
4740 }
4741 }
4742 if(!MatchTypes(source->returnType, dest->returnType, (((void *)0)), (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
4743 {
4744 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible return type for function\n", (((void *)0))));
4745 return 0x0;
4746 }
4747 for(; paramDest; paramDest = paramDest->next)
4748 {
4749 if(!paramSource)
4750 {
4751 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "not enough parameters\n", (((void *)0))));
4752 return 0x0;
4753 }
4754 {
4755 struct Type * paramDestType = paramDest;
4756 struct Type * paramSourceType = paramSource;
4757 struct Type * type = paramDestType;
4758
4759 if(paramDest->kind == 20 && paramDest->templateParameter->type == 0 && owningClassSource && paramSource->kind != 20)
4760 {
4761 int id = 0;
4762 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
4763 struct __ecereNameSpace__ecere__com__Class * sClass;
4764
4765 for(sClass = owningClassSource; sClass; sClass = sClass->base)
4766 {
4767 id = 0;
4768 if(sClass->templateClass)
4769 sClass = sClass->templateClass;
4770 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
4771 {
4772 if(curParam->type == 0 && !strcmp(type->templateParameter->identifier->string, curParam->name))
4773 {
4774 for(sClass = sClass->base; sClass; sClass = sClass->base)
4775 {
4776 if(sClass->templateClass)
4777 sClass = sClass->templateClass;
4778 id += sClass->templateParams.count;
4779 }
4780 break;
4781 }
4782 id++;
4783 }
4784 if(curParam)
4785 break;
4786 }
4787 if(curParam)
4788 {
4789 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = owningClassSource->templateArgs[id];
4790
4791 paramDestType = type = ProcessTypeString(arg.dataTypeString, 0x0);
4792 }
4793 }
4794 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)))
4795 {
4796 char type[1024];
4797
4798 type[0] = (char)0;
4799 PrintType(paramDest, type, 0x0, 0x1);
4800 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible parameter %s (expected %s)\n", (((void *)0))), paramSource->name, type);
4801 if(paramDestType != paramDest)
4802 FreeType(paramDestType);
4803 return 0x0;
4804 }
4805 if(paramDestType != paramDest)
4806 FreeType(paramDestType);
4807 }
4808 paramSource = paramSource->next;
4809 }
4810 if(paramSource)
4811 {
4812 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "too many parameters\n", (((void *)0))));
4813 return 0x0;
4814 }
4815 return 0x1;
4816 }
4817 else if((dest->kind == 11 || (dest->kind == 13 && dest->type->kind == 11) || dest->kind == 16) && (source->kind == 13 && source->type->kind == 0))
4818 {
4819 return 0x1;
4820 }
4821 else if((dest->kind == 13 || dest->kind == 12) && (source->kind == 12 || source->kind == 13))
4822 {
4823 if(MatchTypes(source->type, dest->type, (((void *)0)), (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
4824 return 0x1;
4825 }
4826 }
4827 return 0x0;
4828 }
4829
4830 static void FreeConvert(struct Conversion * convert)
4831 {
4832 if(convert->resultType)
4833 FreeType(convert->resultType);
4834 }
4835
4836 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__BTNamedLink;
4837
4838 struct __ecereNameSpace__ecere__com__BTNamedLink
4839 {
4840 char *  name;
4841 struct __ecereNameSpace__ecere__com__BTNamedLink * parent;
4842 struct __ecereNameSpace__ecere__com__BTNamedLink * left;
4843 struct __ecereNameSpace__ecere__com__BTNamedLink * right;
4844 int depth;
4845 void *  data;
4846 } __attribute__ ((gcc_struct));
4847
4848 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__EnumClassData;
4849
4850 struct __ecereNameSpace__ecere__com__EnumClassData
4851 {
4852 struct __ecereNameSpace__ecere__sys__OldList values;
4853 int largest;
4854 } __attribute__ ((gcc_struct));
4855
4856 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__NamedLink;
4857
4858 struct __ecereNameSpace__ecere__sys__NamedLink
4859 {
4860 struct __ecereNameSpace__ecere__sys__NamedLink * prev;
4861 struct __ecereNameSpace__ecere__sys__NamedLink * next;
4862 char *  name;
4863 void *  data;
4864 } __attribute__ ((gcc_struct));
4865
4866 extern void FreeExpContents(struct Expression * exp);
4867
4868 struct __ecereNameSpace__ecere__sys__BTNode * __ecereProp___ecereNameSpace__ecere__sys__BinaryTree_Get_first(struct __ecereNameSpace__ecere__sys__BinaryTree * this);
4869
4870 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp___ecereNameSpace__ecere__sys__BinaryTree_first;
4871
4872 struct __ecereNameSpace__ecere__sys__BTNode * __ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_next(struct __ecereNameSpace__ecere__sys__BTNode * this);
4873
4874 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp___ecereNameSpace__ecere__sys__BTNode_next;
4875
4876 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(struct __ecereNameSpace__ecere__sys__OldList * this, void (*  freeFn)(void * ));
4877
4878 unsigned int MatchWithEnums_NameSpace(struct __ecereNameSpace__ecere__com__NameSpace * nameSpace, struct Expression * sourceExp, struct Type * dest, char * string, struct __ecereNameSpace__ecere__sys__OldList * conversions)
4879 {
4880 struct __ecereNameSpace__ecere__com__BTNamedLink * link;
4881
4882 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)))
4883 {
4884 struct __ecereNameSpace__ecere__com__Class * _class = link->data;
4885
4886 if(_class->type == 4)
4887 {
4888 struct __ecereNameSpace__ecere__sys__OldList converts = 
4889 {
4890 0, 0, 0, 0, 0
4891 };
4892 struct Type * type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
4893
4894 type->kind = 8;
4895 if(!_class->symbol)
4896 _class->symbol = FindClass(_class->fullName);
4897 type->_class = _class->symbol;
4898 if(MatchTypes(type, dest, &converts, (((void *)0)), (((void *)0)), 0x1, 0x0, 0x0, 0x0))
4899 {
4900 struct __ecereNameSpace__ecere__sys__NamedLink * value;
4901 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
4902
4903 if(enumClass)
4904 {
4905 struct __ecereNameSpace__ecere__com__Class * baseClass;
4906
4907 for(baseClass = _class; baseClass && baseClass->type == 4; baseClass = baseClass->base)
4908 {
4909 struct __ecereNameSpace__ecere__com__EnumClassData * e = (baseClass ? ((void *)(((char *)baseClass->data) + enumClass->offsetClass)) : (((void *)0)));
4910
4911 for(value = e->values.first; value; value = value->next)
4912 {
4913 if(!strcmp(value->name, string))
4914 break;
4915 }
4916 if(value)
4917 {
4918 FreeExpContents(sourceExp);
4919 FreeType(sourceExp->expType);
4920 sourceExp->isConstant = 0x1;
4921 sourceExp->expType = MkClassType(baseClass->fullName);
4922 {
4923 char constant[256];
4924
4925 sourceExp->type = 2;
4926 if(!strcmp(baseClass->dataTypeString, "int"))
4927 sprintf(constant, "%d", value->data);
4928 else
4929 sprintf(constant, "0x%X", value->data);
4930 sourceExp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
4931 }
4932 while(converts.first)
4933 {
4934 struct Conversion * convert = converts.first;
4935
4936 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(&converts, convert);
4937 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(conversions, convert);
4938 }
4939 ((type ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(type) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(type)) : 0), type = 0);
4940 return 0x1;
4941 }
4942 }
4943 }
4944 }
4945 if(converts.first)
4946 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(&converts, FreeConvert);
4947 ((type ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(type) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(type)) : 0), type = 0);
4948 }
4949 }
4950 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)))
4951 if(MatchWithEnums_NameSpace(nameSpace, sourceExp, dest, string, conversions))
4952 return 0x1;
4953 return 0x0;
4954 }
4955
4956 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__SubModule;
4957
4958 struct __ecereNameSpace__ecere__com__SubModule
4959 {
4960 struct __ecereNameSpace__ecere__com__SubModule * prev;
4961 struct __ecereNameSpace__ecere__com__SubModule * next;
4962 struct __ecereNameSpace__ecere__com__Instance * module;
4963 int importMode;
4964 } __attribute__ ((gcc_struct));
4965
4966 unsigned int ModuleVisibility(struct __ecereNameSpace__ecere__com__Instance * searchIn, struct __ecereNameSpace__ecere__com__Instance * searchFor)
4967 {
4968 struct __ecereNameSpace__ecere__com__SubModule * subModule;
4969
4970 if(searchFor == searchIn)
4971 return 0x1;
4972 for(subModule = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)searchIn + 12)))->modules.first; subModule; subModule = subModule->next)
4973 {
4974 if(subModule->importMode == 1 || searchIn == ((struct __ecereNameSpace__ecere__com__Module *)(((char *)searchIn + 12)))->application)
4975 {
4976 if(ModuleVisibility(subModule->module, searchFor))
4977 return 0x1;
4978 }
4979 }
4980 return 0x0;
4981 }
4982
4983 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Application;
4984
4985 struct __ecereNameSpace__ecere__com__Application
4986 {
4987 int argc;
4988 char * *  argv;
4989 int exitCode;
4990 unsigned int isGUIApp;
4991 struct __ecereNameSpace__ecere__sys__OldList allModules;
4992 char *  parsedCommand;
4993 struct __ecereNameSpace__ecere__com__NameSpace systemNameSpace;
4994 } __attribute__ ((gcc_struct));
4995
4996 unsigned int MatchWithEnums_Module(struct __ecereNameSpace__ecere__com__Instance * mainModule, struct Expression * sourceExp, struct Type * dest, char * string, struct __ecereNameSpace__ecere__sys__OldList * conversions)
4997 {
4998 struct __ecereNameSpace__ecere__com__Instance * module;
4999
5000 if(MatchWithEnums_NameSpace(&((struct __ecereNameSpace__ecere__com__Application *)(((char *)((struct __ecereNameSpace__ecere__com__Module *)(((char *)mainModule + 12)))->application + 300)))->systemNameSpace, sourceExp, dest, string, conversions))
5001 return 0x1;
5002 if(MatchWithEnums_NameSpace(&((struct __ecereNameSpace__ecere__com__Module *)(((char *)((struct __ecereNameSpace__ecere__com__Module *)(((char *)mainModule + 12)))->application + 12)))->privateNameSpace, sourceExp, dest, string, conversions))
5003 return 0x1;
5004 if(MatchWithEnums_NameSpace(&((struct __ecereNameSpace__ecere__com__Module *)(((char *)((struct __ecereNameSpace__ecere__com__Module *)(((char *)mainModule + 12)))->application + 12)))->publicNameSpace, sourceExp, dest, string, conversions))
5005 return 0x1;
5006 for(module = ((struct __ecereNameSpace__ecere__com__Application *)(((char *)((struct __ecereNameSpace__ecere__com__Module *)(((char *)mainModule + 12)))->application + 300)))->allModules.first; module; module = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + 12)))->next)
5007 {
5008 if(ModuleVisibility(mainModule, module) && MatchWithEnums_NameSpace(&((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + 12)))->publicNameSpace, sourceExp, dest, string, conversions))
5009 return 0x1;
5010 }
5011 return 0x0;
5012 }
5013
5014 extern unsigned long strtoul(const char *  nptr, char * *  endptr, int base);
5015
5016 void ReadString(char *  output, char *  string);
5017
5018 extern struct Specifier * MkEnum(struct Identifier * id, struct __ecereNameSpace__ecere__sys__OldList * list);
5019
5020 extern struct TypeName * QMkClass(char *  spec, struct Declarator * decl);
5021
5022 extern struct Expression * MkExpBrackets(struct __ecereNameSpace__ecere__sys__OldList * expressions);
5023
5024 unsigned int MatchTypeExpression(struct Expression * sourceExp, struct Type * dest, struct __ecereNameSpace__ecere__sys__OldList * conversions, unsigned int skipUnitBla)
5025 {
5026 void * __ecereTemp1;
5027 struct Type * source = sourceExp->expType;
5028 struct Type * realDest = dest;
5029
5030 if(dest->kind == 13 && sourceExp->type == 2 && !strtoul(sourceExp->constant, (((void *)0)), 0))
5031 return 0x1;
5032 if(!skipUnitBla && source && dest && source->kind == 8 && dest->kind == 8)
5033 {
5034 if(source->_class && source->_class->registered && source->_class->registered->type == 3)
5035 {
5036 struct __ecereNameSpace__ecere__com__Class * sourceBase, * destBase;
5037
5038 for(sourceBase = source->_class->registered; sourceBase && sourceBase->base && sourceBase->base->type != 1000; sourceBase = sourceBase->base)
5039 ;
5040 for(destBase = dest->_class->registered; destBase && destBase->base && destBase->base->type != 1000; destBase = destBase->base)
5041 ;
5042 if(sourceBase == destBase)
5043 return 0x1;
5044 }
5045 }
5046 if(source)
5047 {
5048 struct __ecereNameSpace__ecere__sys__OldList * specs;
5049 unsigned int flag = 0x0;
5050 long long value = (((int)0x7fffffff));
5051
5052 source->refCount++;
5053 dest->refCount++;
5054 if(sourceExp->type == 2)
5055 {
5056 if(source->isSigned)
5057 value = strtoll(sourceExp->constant, (((void *)0)), 0);
5058 else
5059 value = strtoull(sourceExp->constant, (((void *)0)), 0);
5060 }
5061 else if(sourceExp->type == 4 && sourceExp->op.op == '-' && !sourceExp->op.exp1 && sourceExp->op.exp2 && sourceExp->op.exp2->type == 2)
5062 {
5063 if(source->isSigned)
5064 value = -strtoll(sourceExp->op.exp2->constant, (((void *)0)), 0);
5065 else
5066 value = -strtoull(sourceExp->op.exp2->constant, (((void *)0)), 0);
5067 }
5068 if(dest->kind != 8 && source->kind == 8 && source->_class && source->_class->registered && !strcmp(source->_class->registered->fullName, "ecere::com::unichar"))
5069 {
5070 FreeType(source);
5071 source = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->kind = 3, ((struct Type *)__ecereTemp1)->isSigned = 0x0, ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1));
5072 }
5073 if(dest->kind == 8)
5074 {
5075 struct __ecereNameSpace__ecere__com__Class * _class = dest->_class ? dest->_class->registered : (((void *)0));
5076
5077 if(_class && _class->type == 3)
5078 {
5079 if(source->kind != 8)
5080 {
5081 struct Type * tempType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5082 struct Type * tempDest, * tempSource;
5083
5084 for(; _class->base->type != 1000; _class = _class->base)
5085 ;
5086 tempSource = dest;
5087 tempDest = tempType;
5088 tempType->kind = 8;
5089 if(!_class->symbol)
5090 _class->symbol = FindClass(_class->fullName);
5091 tempType->_class = _class->symbol;
5092 tempType->truth = dest->truth;
5093 if(tempType->_class)
5094 MatchTypes(tempSource, tempDest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0);
5095 FreeType(sourceExp->expType);
5096 sourceExp->expType = dest;
5097 dest->refCount++;
5098 flag = 0x1;
5099 ((tempType ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(tempType) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(tempType)) : 0), tempType = 0);
5100 }
5101 }
5102 if(_class && _class->type == 2 && source->kind != 8)
5103 {
5104 if(!dest->_class->registered->dataType)
5105 dest->_class->registered->dataType = ProcessTypeString(dest->_class->registered->dataTypeString, 0x0);
5106 if(MatchTypes(source, dest->_class->registered->dataType, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
5107 {
5108 FreeType(source);
5109 FreeType(sourceExp->expType);
5110 source = sourceExp->expType = MkClassType(dest->_class->string);
5111 source->refCount++;
5112 }
5113 }
5114 if(_class && !strcmp(_class->fullName, "ecere::com::Class") && source->kind == 13 && source->type && source->type->kind == 1 && sourceExp->type == 3)
5115 {
5116 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
5117 struct Declarator * decl;
5118 char string[1024];
5119
5120 ReadString(string, sourceExp->string);
5121 decl = SpecDeclFromString(string, specs, (((void *)0)));
5122 FreeExpContents(sourceExp);
5123 FreeType(sourceExp->expType);
5124 sourceExp->type = 26;
5125 sourceExp->_classExp.specifiers = specs;
5126 sourceExp->_classExp.decl = decl;
5127 sourceExp->expType = dest;
5128 dest->refCount++;
5129 FreeType(source);
5130 FreeType(dest);
5131 return 0x1;
5132 }
5133 }
5134 else if(source->kind == 8)
5135 {
5136 struct __ecereNameSpace__ecere__com__Class * _class = source->_class ? source->_class->registered : (((void *)0));
5137
5138 if(_class && (_class->type == 3 || !strcmp(_class->fullName, "bool") || _class->type == 2))
5139 {
5140 if(dest->kind != 8)
5141 {
5142 struct Type * tempType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5143 struct Type * tempDest, * tempSource;
5144
5145 if(!source->_class->registered->dataType)
5146 source->_class->registered->dataType = ProcessTypeString(source->_class->registered->dataTypeString, 0x0);
5147 for(; _class->base->type != 1000; _class = _class->base)
5148 ;
5149 tempDest = source;
5150 tempSource = tempType;
5151 tempType->kind = 8;
5152 tempType->_class = FindClass(_class->fullName);
5153 tempType->truth = source->truth;
5154 tempType->classObjectType = source->classObjectType;
5155 if(tempType->_class)
5156 MatchTypes(tempSource, tempDest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0);
5157 if(conversions->last)
5158 {
5159 ((struct Conversion *)conversions->last)->resultType = dest;
5160 dest->refCount++;
5161 }
5162 FreeType(sourceExp->expType);
5163 sourceExp->expType = MkClassType(_class->fullName);
5164 sourceExp->expType->truth = source->truth;
5165 sourceExp->expType->classObjectType = source->classObjectType;
5166 if(!sourceExp->destType)
5167 {
5168 FreeType(sourceExp->destType);
5169 sourceExp->destType = sourceExp->expType;
5170 if(sourceExp->expType)
5171 sourceExp->expType->refCount++;
5172 }
5173 if(!_class->dataType)
5174 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
5175 FreeType(dest);
5176 dest = MkClassType(source->_class->string);
5177 dest->truth = source->truth;
5178 dest->classObjectType = source->classObjectType;
5179 FreeType(source);
5180 source = _class->dataType;
5181 source->refCount++;
5182 ((tempType ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(tempType) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(tempType)) : 0), tempType = 0);
5183 }
5184 }
5185 }
5186 if(!flag)
5187 {
5188 if(MatchTypes(source, dest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
5189 {
5190 FreeType(source);
5191 FreeType(dest);
5192 return 0x1;
5193 }
5194 }
5195 if(dest->kind == 8)
5196 {
5197 struct __ecereNameSpace__ecere__com__Class * _class = dest->_class ? dest->_class->registered : (((void *)0));
5198
5199 if(_class && !dest->truth && (_class->type == 3 || !strcmp(_class->fullName, "bool") || (_class->type != 1 && !value && source->kind == 3) || _class->type == 2))
5200 {
5201 if(_class->type == 0 || _class->type == 5)
5202 {
5203 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
5204
5205 *newExp = *sourceExp;
5206 if(sourceExp->destType)
5207 sourceExp->destType->refCount++;
5208 if(sourceExp->expType)
5209 sourceExp->expType->refCount++;
5210 sourceExp->type = 11;
5211 sourceExp->cast.typeName = MkTypeName(MkListOne(MkSpecifier(VOID)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0))));
5212 sourceExp->cast.exp = newExp;
5213 FreeType(sourceExp->expType);
5214 sourceExp->expType = (((void *)0));
5215 ProcessExpressionType(sourceExp);
5216 if(!inCompiler)
5217 {
5218 FreeType(sourceExp->expType);
5219 sourceExp->expType = dest;
5220 }
5221 FreeType(source);
5222 if(inCompiler)
5223 FreeType(dest);
5224 return 0x1;
5225 }
5226 if(!_class->dataType)
5227 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
5228 FreeType(dest);
5229 dest = _class->dataType;
5230 dest->refCount++;
5231 }
5232 if(dest->kind == 7 && (source->kind == 7 || source->kind == 6 || dest->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 1))
5233 {
5234 specs = MkListOne(MkSpecifier(DOUBLE));
5235 }
5236 else if(dest->kind == 6 && (source->kind == 6 || dest->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 7))
5237 {
5238 specs = MkListOne(MkSpecifier(FLOAT));
5239 }
5240 else if(dest->kind == 4 && (source->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 6 || source->kind == 7))
5241 {
5242 specs = MkList();
5243 if(!dest->isSigned)
5244 ListAdd(specs, MkSpecifier(UNSIGNED));
5245 ListAdd(specs, MkSpecifier(INT64));
5246 }
5247 else if(dest->kind == 3 && (source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 6 || source->kind == 7))
5248 {
5249 specs = MkList();
5250 if(!dest->isSigned)
5251 ListAdd(specs, MkSpecifier(UNSIGNED));
5252 ListAdd(specs, MkSpecifier(INT));
5253 }
5254 else if(dest->kind == 2 && (source->kind == 2 || source->kind == 1 || source->kind == 3 || source->kind == 6 || source->kind == 7))
5255 {
5256 specs = MkList();
5257 if(!dest->isSigned)
5258 ListAdd(specs, MkSpecifier(UNSIGNED));
5259 ListAdd(specs, MkSpecifier(SHORT));
5260 }
5261 else if(dest->kind == 1 && (source->kind == 1 || source->kind == 2 || source->kind == 3 || source->kind == 6 || source->kind == 7))
5262 {
5263 specs = MkList();
5264 if(!dest->isSigned)
5265 ListAdd(specs, MkSpecifier(UNSIGNED));
5266 ListAdd(specs, MkSpecifier(CHAR));
5267 }
5268 else
5269 {
5270 FreeType(source);
5271 FreeType(dest);
5272 return 0x0;
5273 }
5274 }
5275 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 == 1))
5276 {
5277 specs = MkListOne(MkSpecifier(DOUBLE));
5278 }
5279 else if(dest->kind == 6 && (source->kind == 6 || source->kind == 15 || source->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 1))
5280 {
5281 specs = MkListOne(MkSpecifier(FLOAT));
5282 }
5283 else if(dest->kind == 1 && (source->kind == 1 || source->kind == 15 || source->kind == 2 || source->kind == 3) && (dest->isSigned ? (value >= -128 && value <= 127) : (value >= 0 && value <= 255)))
5284 {
5285 specs = MkList();
5286 if(!dest->isSigned)
5287 ListAdd(specs, MkSpecifier(UNSIGNED));
5288 ListAdd(specs, MkSpecifier(CHAR));
5289 }
5290 else if(dest->kind == 2 && (source->kind == 15 || source->kind == 1 || source->kind == 2 || (source->kind == 3 && (dest->isSigned ? (value >= -32768 && value <= 32767) : (value >= 0 && value <= 65535)))))
5291 {
5292 specs = MkList();
5293 if(!dest->isSigned)
5294 ListAdd(specs, MkSpecifier(UNSIGNED));
5295 ListAdd(specs, MkSpecifier(SHORT));
5296 }
5297 else if(dest->kind == 3 && (source->kind == 15 || source->kind == 2 || source->kind == 1 || source->kind == 3))
5298 {
5299 specs = MkList();
5300 if(!dest->isSigned)
5301 ListAdd(specs, MkSpecifier(UNSIGNED));
5302 ListAdd(specs, MkSpecifier(INT));
5303 }
5304 else if(dest->kind == 4 && (source->kind == 15 || source->kind == 2 || source->kind == 1 || source->kind == 3 || source->kind == 4))
5305 {
5306 specs = MkList();
5307 if(!dest->isSigned)
5308 ListAdd(specs, MkSpecifier(UNSIGNED));
5309 ListAdd(specs, MkSpecifier(INT64));
5310 }
5311 else if(dest->kind == 15 && (source->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 1))
5312 {
5313 specs = MkListOne(MkEnum(MkIdentifier(dest->enumName), (((void *)0))));
5314 }
5315 else
5316 {
5317 FreeType(source);
5318 FreeType(dest);
5319 return 0x0;
5320 }
5321 if(!flag)
5322 {
5323 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
5324
5325 *newExp = *sourceExp;
5326 newExp->prev = (((void *)0));
5327 newExp->next = (((void *)0));
5328 if(sourceExp->destType)
5329 sourceExp->destType->refCount++;
5330 if(sourceExp->expType)
5331 sourceExp->expType->refCount++;
5332 sourceExp->type = 11;
5333 if(realDest->kind == 8)
5334 {
5335 sourceExp->cast.typeName = QMkClass(realDest->_class->string, (((void *)0)));
5336 FreeList(specs, FreeSpecifier);
5337 }
5338 else
5339 sourceExp->cast.typeName = MkTypeName(specs, (((void *)0)));
5340 if(newExp->type == 4)
5341 {
5342 sourceExp->cast.exp = MkExpBrackets(MkListOne(newExp));
5343 }
5344 else
5345 sourceExp->cast.exp = newExp;
5346 FreeType(sourceExp->expType);
5347 sourceExp->expType = (((void *)0));
5348 ProcessExpressionType(sourceExp);
5349 }
5350 else
5351 FreeList(specs, FreeSpecifier);
5352 FreeType(dest);
5353 FreeType(source);
5354 return 0x1;
5355 }
5356 else
5357 {
5358 while((sourceExp->type == 5 || sourceExp->type == 34) && sourceExp->list)
5359 sourceExp = (*sourceExp->list).last;
5360 if(sourceExp->type == 0)
5361 {
5362 struct Identifier * id = sourceExp->identifier;
5363
5364 if(dest->kind == 8)
5365 {
5366 if(dest->_class && dest->_class->registered && dest->_class->registered->type == 4)
5367 {
5368 struct __ecereNameSpace__ecere__com__Class * _class = dest->_class->registered;
5369 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
5370
5371 if(enumClass)
5372 {
5373 for(; _class && _class->type == 4; _class = _class->base)
5374 {
5375 struct __ecereNameSpace__ecere__sys__NamedLink * value;
5376 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
5377
5378 for(value = e->values.first; value; value = value->next)
5379 {
5380 if(!strcmp(value->name, id->string))
5381 break;
5382 }
5383 if(value)
5384 {
5385 FreeExpContents(sourceExp);
5386 FreeType(sourceExp->expType);
5387 sourceExp->isConstant = 0x1;
5388 sourceExp->expType = MkClassType(_class->fullName);
5389 {
5390 char constant[256];
5391
5392 sourceExp->type = 2;
5393 if(_class->dataTypeString && !strcmp(_class->dataTypeString, "int"))
5394 sprintf(constant, "%d", value->data);
5395 else
5396 sprintf(constant, "0x%X", value->data);
5397 sourceExp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
5398 }
5399 return 0x1;
5400 }
5401 }
5402 }
5403 }
5404 }
5405 if(dest->classObjectType != 2 && dest->kind == 8 && MatchWithEnums_Module(privateModule, sourceExp, dest, id->string, conversions))
5406 return 0x1;
5407 }
5408 }
5409 return 0x0;
5410 }
5411
5412 static unsigned int IntAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5413 {
5414 int value2 = op2->i;
5415
5416 exp->type = 2;
5417 exp->string = PrintInt(op1->i + value2);
5418 if(!exp->expType)
5419 {
5420 exp->expType = op1->type;
5421 if(op1->type)
5422 op1->type->refCount++;
5423 }
5424 return 0x1;
5425 }
5426
5427 static unsigned int UIntAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5428 {
5429 unsigned int value2 = op2->ui;
5430
5431 exp->type = 2;
5432 exp->string = PrintUInt(op1->ui + value2);
5433 if(!exp->expType)
5434 {
5435 exp->expType = op1->type;
5436 if(op1->type)
5437 op1->type->refCount++;
5438 }
5439 return 0x1;
5440 }
5441
5442 static unsigned int ShortAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5443 {
5444 short value2 = op2->s;
5445
5446 exp->type = 2;
5447 exp->string = PrintShort(op1->s + value2);
5448 if(!exp->expType)
5449 {
5450 exp->expType = op1->type;
5451 if(op1->type)
5452 op1->type->refCount++;
5453 }
5454 return 0x1;
5455 }
5456
5457 static unsigned int UShortAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5458 {
5459 unsigned short value2 = op2->us;
5460
5461 exp->type = 2;
5462 exp->string = PrintUShort(op1->us + value2);
5463 if(!exp->expType)
5464 {
5465 exp->expType = op1->type;
5466 if(op1->type)
5467 op1->type->refCount++;
5468 }
5469 return 0x1;
5470 }
5471
5472 static unsigned int CharAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5473 {
5474 char value2 = op2->c;
5475
5476 exp->type = 2;
5477 exp->string = PrintChar(op1->c + value2);
5478 if(!exp->expType)
5479 {
5480 exp->expType = op1->type;
5481 if(op1->type)
5482 op1->type->refCount++;
5483 }
5484 return 0x1;
5485 }
5486
5487 static unsigned int UCharAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5488 {
5489 unsigned char value2 = op2->uc;
5490
5491 exp->type = 2;
5492 exp->string = PrintUChar(op1->uc + value2);
5493 if(!exp->expType)
5494 {
5495 exp->expType = op1->type;
5496 if(op1->type)
5497 op1->type->refCount++;
5498 }
5499 return 0x1;
5500 }
5501
5502 static unsigned int FloatAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5503 {
5504 float value2 = op2->f;
5505
5506 exp->type = 2;
5507 exp->string = PrintFloat(op1->f + value2);
5508 if(!exp->expType)
5509 {
5510 exp->expType = op1->type;
5511 if(op1->type)
5512 op1->type->refCount++;
5513 }
5514 return 0x1;
5515 }
5516
5517 static unsigned int DoubleAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5518 {
5519 double value2 = op2->d;
5520
5521 exp->type = 2;
5522 exp->string = PrintDouble(op1->d + value2);
5523 if(!exp->expType)
5524 {
5525 exp->expType = op1->type;
5526 if(op1->type)
5527 op1->type->refCount++;
5528 }
5529 return 0x1;
5530 }
5531
5532 static unsigned int IntSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5533 {
5534 int value2 = op2->i;
5535
5536 exp->type = 2;
5537 exp->string = PrintInt(op1->i - value2);
5538 if(!exp->expType)
5539 {
5540 exp->expType = op1->type;
5541 if(op1->type)
5542 op1->type->refCount++;
5543 }
5544 return 0x1;
5545 }
5546
5547 static unsigned int UIntSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5548 {
5549 unsigned int value2 = op2->ui;
5550
5551 exp->type = 2;
5552 exp->string = PrintUInt(op1->ui - value2);
5553 if(!exp->expType)
5554 {
5555 exp->expType = op1->type;
5556 if(op1->type)
5557 op1->type->refCount++;
5558 }
5559 return 0x1;
5560 }
5561
5562 static unsigned int ShortSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5563 {
5564 short value2 = op2->s;
5565
5566 exp->type = 2;
5567 exp->string = PrintShort(op1->s - value2);
5568 if(!exp->expType)
5569 {
5570 exp->expType = op1->type;
5571 if(op1->type)
5572 op1->type->refCount++;
5573 }
5574 return 0x1;
5575 }
5576
5577 static unsigned int UShortSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5578 {
5579 unsigned short value2 = op2->us;
5580
5581 exp->type = 2;
5582 exp->string = PrintUShort(op1->us - value2);
5583 if(!exp->expType)
5584 {
5585 exp->expType = op1->type;
5586 if(op1->type)
5587 op1->type->refCount++;
5588 }
5589 return 0x1;
5590 }
5591
5592 static unsigned int CharSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5593 {
5594 char value2 = op2->c;
5595
5596 exp->type = 2;
5597 exp->string = PrintChar(op1->c - value2);
5598 if(!exp->expType)
5599 {
5600 exp->expType = op1->type;
5601 if(op1->type)
5602 op1->type->refCount++;
5603 }
5604 return 0x1;
5605 }
5606
5607 static unsigned int UCharSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5608 {
5609 unsigned char value2 = op2->uc;
5610
5611 exp->type = 2;
5612 exp->string = PrintUChar(op1->uc - value2);
5613 if(!exp->expType)
5614 {
5615 exp->expType = op1->type;
5616 if(op1->type)
5617 op1->type->refCount++;
5618 }
5619 return 0x1;
5620 }
5621
5622 static unsigned int FloatSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5623 {
5624 float value2 = op2->f;
5625
5626 exp->type = 2;
5627 exp->string = PrintFloat(op1->f - value2);
5628 if(!exp->expType)
5629 {
5630 exp->expType = op1->type;
5631 if(op1->type)
5632 op1->type->refCount++;
5633 }
5634 return 0x1;
5635 }
5636
5637 static unsigned int DoubleSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5638 {
5639 double value2 = op2->d;
5640
5641 exp->type = 2;
5642 exp->string = PrintDouble(op1->d - value2);
5643 if(!exp->expType)
5644 {
5645 exp->expType = op1->type;
5646 if(op1->type)
5647 op1->type->refCount++;
5648 }
5649 return 0x1;
5650 }
5651
5652 static unsigned int IntMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5653 {
5654 int value2 = op2->i;
5655
5656 exp->type = 2;
5657 exp->string = PrintInt(op1->i * value2);
5658 if(!exp->expType)
5659 {
5660 exp->expType = op1->type;
5661 if(op1->type)
5662 op1->type->refCount++;
5663 }
5664 return 0x1;
5665 }
5666
5667 static unsigned int UIntMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5668 {
5669 unsigned int value2 = op2->ui;
5670
5671 exp->type = 2;
5672 exp->string = PrintUInt(op1->ui * value2);
5673 if(!exp->expType)
5674 {
5675 exp->expType = op1->type;
5676 if(op1->type)
5677 op1->type->refCount++;
5678 }
5679 return 0x1;
5680 }
5681
5682 static unsigned int ShortMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5683 {
5684 short value2 = op2->s;
5685
5686 exp->type = 2;
5687 exp->string = PrintShort(op1->s * value2);
5688 if(!exp->expType)
5689 {
5690 exp->expType = op1->type;
5691 if(op1->type)
5692 op1->type->refCount++;
5693 }
5694 return 0x1;
5695 }
5696
5697 static unsigned int UShortMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5698 {
5699 unsigned short value2 = op2->us;
5700
5701 exp->type = 2;
5702 exp->string = PrintUShort(op1->us * value2);
5703 if(!exp->expType)
5704 {
5705 exp->expType = op1->type;
5706 if(op1->type)
5707 op1->type->refCount++;
5708 }
5709 return 0x1;
5710 }
5711
5712 static unsigned int CharMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5713 {
5714 char value2 = op2->c;
5715
5716 exp->type = 2;
5717 exp->string = PrintChar(op1->c * value2);
5718 if(!exp->expType)
5719 {
5720 exp->expType = op1->type;
5721 if(op1->type)
5722 op1->type->refCount++;
5723 }
5724 return 0x1;
5725 }
5726
5727 static unsigned int UCharMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5728 {
5729 unsigned char value2 = op2->uc;
5730
5731 exp->type = 2;
5732 exp->string = PrintUChar(op1->uc * value2);
5733 if(!exp->expType)
5734 {
5735 exp->expType = op1->type;
5736 if(op1->type)
5737 op1->type->refCount++;
5738 }
5739 return 0x1;
5740 }
5741
5742 static unsigned int FloatMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5743 {
5744 float value2 = op2->f;
5745
5746 exp->type = 2;
5747 exp->string = PrintFloat(op1->f * value2);
5748 if(!exp->expType)
5749 {
5750 exp->expType = op1->type;
5751 if(op1->type)
5752 op1->type->refCount++;
5753 }
5754 return 0x1;
5755 }
5756
5757 static unsigned int DoubleMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5758 {
5759 double value2 = op2->d;
5760
5761 exp->type = 2;
5762 exp->string = PrintDouble(op1->d * value2);
5763 if(!exp->expType)
5764 {
5765 exp->expType = op1->type;
5766 if(op1->type)
5767 op1->type->refCount++;
5768 }
5769 return 0x1;
5770 }
5771
5772 static unsigned int IntDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5773 {
5774 int value2 = op2->i;
5775
5776 exp->type = 2;
5777 exp->string = PrintInt(value2 ? (op1->i / value2) : 0);
5778 if(!exp->expType)
5779 {
5780 exp->expType = op1->type;
5781 if(op1->type)
5782 op1->type->refCount++;
5783 }
5784 return 0x1;
5785 }
5786
5787 static unsigned int UIntDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5788 {
5789 unsigned int value2 = op2->ui;
5790
5791 exp->type = 2;
5792 exp->string = PrintUInt(value2 ? (op1->ui / value2) : 0);
5793 if(!exp->expType)
5794 {
5795 exp->expType = op1->type;
5796 if(op1->type)
5797 op1->type->refCount++;
5798 }
5799 return 0x1;
5800 }
5801
5802 static unsigned int ShortDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5803 {
5804 short value2 = op2->s;
5805
5806 exp->type = 2;
5807 exp->string = PrintShort(value2 ? (op1->s / value2) : (short)0);
5808 if(!exp->expType)
5809 {
5810 exp->expType = op1->type;
5811 if(op1->type)
5812 op1->type->refCount++;
5813 }
5814 return 0x1;
5815 }
5816
5817 static unsigned int UShortDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5818 {
5819 unsigned short value2 = op2->us;
5820
5821 exp->type = 2;
5822 exp->string = PrintUShort(value2 ? (op1->us / value2) : (unsigned short)0);
5823 if(!exp->expType)
5824 {
5825 exp->expType = op1->type;
5826 if(op1->type)
5827 op1->type->refCount++;
5828 }
5829 return 0x1;
5830 }
5831
5832 static unsigned int CharDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5833 {
5834 char value2 = op2->c;
5835
5836 exp->type = 2;
5837 exp->string = PrintChar(value2 ? (op1->c / value2) : (char)0);
5838 if(!exp->expType)
5839 {
5840 exp->expType = op1->type;
5841 if(op1->type)
5842 op1->type->refCount++;
5843 }
5844 return 0x1;
5845 }
5846
5847 static unsigned int UCharDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5848 {
5849 unsigned char value2 = op2->uc;
5850
5851 exp->type = 2;
5852 exp->string = PrintUChar(value2 ? (op1->uc / value2) : (unsigned char)0);
5853 if(!exp->expType)
5854 {
5855 exp->expType = op1->type;
5856 if(op1->type)
5857 op1->type->refCount++;
5858 }
5859 return 0x1;
5860 }
5861
5862 static unsigned int FloatDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5863 {
5864 float value2 = op2->f;
5865
5866 exp->type = 2;
5867 exp->string = PrintFloat(value2 ? (op1->f / value2) : (float)0);
5868 if(!exp->expType)
5869 {
5870 exp->expType = op1->type;
5871 if(op1->type)
5872 op1->type->refCount++;
5873 }
5874 return 0x1;
5875 }
5876
5877 static unsigned int DoubleDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5878 {
5879 double value2 = op2->d;
5880
5881 exp->type = 2;
5882 exp->string = PrintDouble(value2 ? (op1->d / value2) : (double)0);
5883 if(!exp->expType)
5884 {
5885 exp->expType = op1->type;
5886 if(op1->type)
5887 op1->type->refCount++;
5888 }
5889 return 0x1;
5890 }
5891
5892 static unsigned int IntMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5893 {
5894 int value2 = op2->i;
5895
5896 exp->type = 2;
5897 exp->string = PrintInt(value2 ? (op1->i % value2) : 0);
5898 if(!exp->expType)
5899 {
5900 exp->expType = op1->type;
5901 if(op1->type)
5902 op1->type->refCount++;
5903 }
5904 return 0x1;
5905 }
5906
5907 static unsigned int UIntMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5908 {
5909 unsigned int value2 = op2->ui;
5910
5911 exp->type = 2;
5912 exp->string = PrintUInt(value2 ? (op1->ui % value2) : 0);
5913 if(!exp->expType)
5914 {
5915 exp->expType = op1->type;
5916 if(op1->type)
5917 op1->type->refCount++;
5918 }
5919 return 0x1;
5920 }
5921
5922 static unsigned int ShortMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5923 {
5924 short value2 = op2->s;
5925
5926 exp->type = 2;
5927 exp->string = PrintShort(value2 ? (op1->s % value2) : (short)0);
5928 if(!exp->expType)
5929 {
5930 exp->expType = op1->type;
5931 if(op1->type)
5932 op1->type->refCount++;
5933 }
5934 return 0x1;
5935 }
5936
5937 static unsigned int UShortMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5938 {
5939 unsigned short value2 = op2->us;
5940
5941 exp->type = 2;
5942 exp->string = PrintUShort(value2 ? (op1->us % value2) : (unsigned short)0);
5943 if(!exp->expType)
5944 {
5945 exp->expType = op1->type;
5946 if(op1->type)
5947 op1->type->refCount++;
5948 }
5949 return 0x1;
5950 }
5951
5952 static unsigned int CharMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5953 {
5954 char value2 = op2->c;
5955
5956 exp->type = 2;
5957 exp->string = PrintChar(value2 ? (op1->c % value2) : (char)0);
5958 if(!exp->expType)
5959 {
5960 exp->expType = op1->type;
5961 if(op1->type)
5962 op1->type->refCount++;
5963 }
5964 return 0x1;
5965 }
5966
5967 static unsigned int UCharMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5968 {
5969 unsigned char value2 = op2->uc;
5970
5971 exp->type = 2;
5972 exp->string = PrintUChar(value2 ? (op1->uc % value2) : (unsigned char)0);
5973 if(!exp->expType)
5974 {
5975 exp->expType = op1->type;
5976 if(op1->type)
5977 op1->type->refCount++;
5978 }
5979 return 0x1;
5980 }
5981
5982 static unsigned int IntNeg(struct Expression * exp, struct Operand * op1)
5983 {
5984 exp->type = 2;
5985 exp->string = PrintInt(-op1->i);
5986 if(!exp->expType)
5987 {
5988 exp->expType = op1->type;
5989 if(op1->type)
5990 op1->type->refCount++;
5991 }
5992 return 0x1;
5993 }
5994
5995 static unsigned int UIntNeg(struct Expression * exp, struct Operand * op1)
5996 {
5997 exp->type = 2;
5998 exp->string = PrintUInt(-op1->ui);
5999 if(!exp->expType)
6000 {
6001 exp->expType = op1->type;
6002 if(op1->type)
6003 op1->type->refCount++;
6004 }
6005 return 0x1;
6006 }
6007
6008 static unsigned int ShortNeg(struct Expression * exp, struct Operand * op1)
6009 {
6010 exp->type = 2;
6011 exp->string = PrintShort(-op1->s);
6012 if(!exp->expType)
6013 {
6014 exp->expType = op1->type;
6015 if(op1->type)
6016 op1->type->refCount++;
6017 }
6018 return 0x1;
6019 }
6020
6021 static unsigned int UShortNeg(struct Expression * exp, struct Operand * op1)
6022 {
6023 exp->type = 2;
6024 exp->string = PrintUShort(-op1->us);
6025 if(!exp->expType)
6026 {
6027 exp->expType = op1->type;
6028 if(op1->type)
6029 op1->type->refCount++;
6030 }
6031 return 0x1;
6032 }
6033
6034 static unsigned int CharNeg(struct Expression * exp, struct Operand * op1)
6035 {
6036 exp->type = 2;
6037 exp->string = PrintChar(-op1->c);
6038 if(!exp->expType)
6039 {
6040 exp->expType = op1->type;
6041 if(op1->type)
6042 op1->type->refCount++;
6043 }
6044 return 0x1;
6045 }
6046
6047 static unsigned int UCharNeg(struct Expression * exp, struct Operand * op1)
6048 {
6049 exp->type = 2;
6050 exp->string = PrintUChar(-op1->uc);
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 FloatNeg(struct Expression * exp, struct Operand * op1)
6061 {
6062 exp->type = 2;
6063 exp->string = PrintFloat(-op1->f);
6064 if(!exp->expType)
6065 {
6066 exp->expType = op1->type;
6067 if(op1->type)
6068 op1->type->refCount++;
6069 }
6070 return 0x1;
6071 }
6072
6073 static unsigned int DoubleNeg(struct Expression * exp, struct Operand * op1)
6074 {
6075 exp->type = 2;
6076 exp->string = PrintDouble(-op1->d);
6077 if(!exp->expType)
6078 {
6079 exp->expType = op1->type;
6080 if(op1->type)
6081 op1->type->refCount++;
6082 }
6083 return 0x1;
6084 }
6085
6086 static unsigned int IntInc(struct Expression * exp, struct Operand * op1)
6087 {
6088 exp->type = 2;
6089 exp->string = PrintInt(++op1->i);
6090 if(!exp->expType)
6091 {
6092 exp->expType = op1->type;
6093 if(op1->type)
6094 op1->type->refCount++;
6095 }
6096 return 0x1;
6097 }
6098
6099 static unsigned int UIntInc(struct Expression * exp, struct Operand * op1)
6100 {
6101 exp->type = 2;
6102 exp->string = PrintUInt(++op1->ui);
6103 if(!exp->expType)
6104 {
6105 exp->expType = op1->type;
6106 if(op1->type)
6107 op1->type->refCount++;
6108 }
6109 return 0x1;
6110 }
6111
6112 static unsigned int ShortInc(struct Expression * exp, struct Operand * op1)
6113 {
6114 exp->type = 2;
6115 exp->string = PrintShort(++op1->s);
6116 if(!exp->expType)
6117 {
6118 exp->expType = op1->type;
6119 if(op1->type)
6120 op1->type->refCount++;
6121 }
6122 return 0x1;
6123 }
6124
6125 static unsigned int UShortInc(struct Expression * exp, struct Operand * op1)
6126 {
6127 exp->type = 2;
6128 exp->string = PrintUShort(++op1->us);
6129 if(!exp->expType)
6130 {
6131 exp->expType = op1->type;
6132 if(op1->type)
6133 op1->type->refCount++;
6134 }
6135 return 0x1;
6136 }
6137
6138 static unsigned int CharInc(struct Expression * exp, struct Operand * op1)
6139 {
6140 exp->type = 2;
6141 exp->string = PrintChar(++op1->c);
6142 if(!exp->expType)
6143 {
6144 exp->expType = op1->type;
6145 if(op1->type)
6146 op1->type->refCount++;
6147 }
6148 return 0x1;
6149 }
6150
6151 static unsigned int UCharInc(struct Expression * exp, struct Operand * op1)
6152 {
6153 exp->type = 2;
6154 exp->string = PrintUChar(++op1->uc);
6155 if(!exp->expType)
6156 {
6157 exp->expType = op1->type;
6158 if(op1->type)
6159 op1->type->refCount++;
6160 }
6161 return 0x1;
6162 }
6163
6164 static unsigned int FloatInc(struct Expression * exp, struct Operand * op1)
6165 {
6166 exp->type = 2;
6167 exp->string = PrintFloat(++op1->f);
6168 if(!exp->expType)
6169 {
6170 exp->expType = op1->type;
6171 if(op1->type)
6172 op1->type->refCount++;
6173 }
6174 return 0x1;
6175 }
6176
6177 static unsigned int DoubleInc(struct Expression * exp, struct Operand * op1)
6178 {
6179 exp->type = 2;
6180 exp->string = PrintDouble(++op1->d);
6181 if(!exp->expType)
6182 {
6183 exp->expType = op1->type;
6184 if(op1->type)
6185 op1->type->refCount++;
6186 }
6187 return 0x1;
6188 }
6189
6190 static unsigned int IntDec(struct Expression * exp, struct Operand * op1)
6191 {
6192 exp->type = 2;
6193 exp->string = PrintInt(--op1->i);
6194 if(!exp->expType)
6195 {
6196 exp->expType = op1->type;
6197 if(op1->type)
6198 op1->type->refCount++;
6199 }
6200 return 0x1;
6201 }
6202
6203 static unsigned int UIntDec(struct Expression * exp, struct Operand * op1)
6204 {
6205 exp->type = 2;
6206 exp->string = PrintUInt(--op1->ui);
6207 if(!exp->expType)
6208 {
6209 exp->expType = op1->type;
6210 if(op1->type)
6211 op1->type->refCount++;
6212 }
6213 return 0x1;
6214 }
6215
6216 static unsigned int ShortDec(struct Expression * exp, struct Operand * op1)
6217 {
6218 exp->type = 2;
6219 exp->string = PrintShort(--op1->s);
6220 if(!exp->expType)
6221 {
6222 exp->expType = op1->type;
6223 if(op1->type)
6224 op1->type->refCount++;
6225 }
6226 return 0x1;
6227 }
6228
6229 static unsigned int UShortDec(struct Expression * exp, struct Operand * op1)
6230 {
6231 exp->type = 2;
6232 exp->string = PrintUShort(--op1->us);
6233 if(!exp->expType)
6234 {
6235 exp->expType = op1->type;
6236 if(op1->type)
6237 op1->type->refCount++;
6238 }
6239 return 0x1;
6240 }
6241
6242 static unsigned int CharDec(struct Expression * exp, struct Operand * op1)
6243 {
6244 exp->type = 2;
6245 exp->string = PrintChar(--op1->c);
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 UCharDec(struct Expression * exp, struct Operand * op1)
6256 {
6257 exp->type = 2;
6258 exp->string = PrintUChar(--op1->uc);
6259 if(!exp->expType)
6260 {
6261 exp->expType = op1->type;
6262 if(op1->type)
6263 op1->type->refCount++;
6264 }
6265 return 0x1;
6266 }
6267
6268 static unsigned int FloatDec(struct Expression * exp, struct Operand * op1)
6269 {
6270 exp->type = 2;
6271 exp->string = PrintFloat(--op1->f);
6272 if(!exp->expType)
6273 {
6274 exp->expType = op1->type;
6275 if(op1->type)
6276 op1->type->refCount++;
6277 }
6278 return 0x1;
6279 }
6280
6281 static unsigned int DoubleDec(struct Expression * exp, struct Operand * op1)
6282 {
6283 exp->type = 2;
6284 exp->string = PrintDouble(--op1->d);
6285 if(!exp->expType)
6286 {
6287 exp->expType = op1->type;
6288 if(op1->type)
6289 op1->type->refCount++;
6290 }
6291 return 0x1;
6292 }
6293
6294 static unsigned int IntAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6295 {
6296 int value2 = op2->i;
6297
6298 exp->type = 2;
6299 exp->string = PrintInt(op1->i = value2);
6300 if(!exp->expType)
6301 {
6302 exp->expType = op1->type;
6303 if(op1->type)
6304 op1->type->refCount++;
6305 }
6306 return 0x1;
6307 }
6308
6309 static unsigned int UIntAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6310 {
6311 unsigned int value2 = op2->ui;
6312
6313 exp->type = 2;
6314 exp->string = PrintUInt(op1->ui = value2);
6315 if(!exp->expType)
6316 {
6317 exp->expType = op1->type;
6318 if(op1->type)
6319 op1->type->refCount++;
6320 }
6321 return 0x1;
6322 }
6323
6324 static unsigned int ShortAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6325 {
6326 short value2 = op2->s;
6327
6328 exp->type = 2;
6329 exp->string = PrintShort(op1->s = value2);
6330 if(!exp->expType)
6331 {
6332 exp->expType = op1->type;
6333 if(op1->type)
6334 op1->type->refCount++;
6335 }
6336 return 0x1;
6337 }
6338
6339 static unsigned int UShortAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6340 {
6341 unsigned short value2 = op2->us;
6342
6343 exp->type = 2;
6344 exp->string = PrintUShort(op1->us = value2);
6345 if(!exp->expType)
6346 {
6347 exp->expType = op1->type;
6348 if(op1->type)
6349 op1->type->refCount++;
6350 }
6351 return 0x1;
6352 }
6353
6354 static unsigned int CharAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6355 {
6356 char value2 = op2->c;
6357
6358 exp->type = 2;
6359 exp->string = PrintChar(op1->c = value2);
6360 if(!exp->expType)
6361 {
6362 exp->expType = op1->type;
6363 if(op1->type)
6364 op1->type->refCount++;
6365 }
6366 return 0x1;
6367 }
6368
6369 static unsigned int UCharAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6370 {
6371 unsigned char value2 = op2->uc;
6372
6373 exp->type = 2;
6374 exp->string = PrintUChar(op1->uc = value2);
6375 if(!exp->expType)
6376 {
6377 exp->expType = op1->type;
6378 if(op1->type)
6379 op1->type->refCount++;
6380 }
6381 return 0x1;
6382 }
6383
6384 static unsigned int FloatAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6385 {
6386 float value2 = op2->f;
6387
6388 exp->type = 2;
6389 exp->string = PrintFloat(op1->f = value2);
6390 if(!exp->expType)
6391 {
6392 exp->expType = op1->type;
6393 if(op1->type)
6394 op1->type->refCount++;
6395 }
6396 return 0x1;
6397 }
6398
6399 static unsigned int DoubleAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6400 {
6401 double value2 = op2->d;
6402
6403 exp->type = 2;
6404 exp->string = PrintDouble(op1->d = value2);
6405 if(!exp->expType)
6406 {
6407 exp->expType = op1->type;
6408 if(op1->type)
6409 op1->type->refCount++;
6410 }
6411 return 0x1;
6412 }
6413
6414 static unsigned int IntAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6415 {
6416 int value2 = op2->i;
6417
6418 exp->type = 2;
6419 exp->string = PrintInt(op1->i += value2);
6420 if(!exp->expType)
6421 {
6422 exp->expType = op1->type;
6423 if(op1->type)
6424 op1->type->refCount++;
6425 }
6426 return 0x1;
6427 }
6428
6429 static unsigned int UIntAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6430 {
6431 unsigned int value2 = op2->ui;
6432
6433 exp->type = 2;
6434 exp->string = PrintUInt(op1->ui += value2);
6435 if(!exp->expType)
6436 {
6437 exp->expType = op1->type;
6438 if(op1->type)
6439 op1->type->refCount++;
6440 }
6441 return 0x1;
6442 }
6443
6444 static unsigned int ShortAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6445 {
6446 short value2 = op2->s;
6447
6448 exp->type = 2;
6449 exp->string = PrintShort(op1->s += value2);
6450 if(!exp->expType)
6451 {
6452 exp->expType = op1->type;
6453 if(op1->type)
6454 op1->type->refCount++;
6455 }
6456 return 0x1;
6457 }
6458
6459 static unsigned int UShortAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6460 {
6461 unsigned short value2 = op2->us;
6462
6463 exp->type = 2;
6464 exp->string = PrintUShort(op1->us += value2);
6465 if(!exp->expType)
6466 {
6467 exp->expType = op1->type;
6468 if(op1->type)
6469 op1->type->refCount++;
6470 }
6471 return 0x1;
6472 }
6473
6474 static unsigned int CharAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6475 {
6476 char value2 = op2->c;
6477
6478 exp->type = 2;
6479 exp->string = PrintChar(op1->c += value2);
6480 if(!exp->expType)
6481 {
6482 exp->expType = op1->type;
6483 if(op1->type)
6484 op1->type->refCount++;
6485 }
6486 return 0x1;
6487 }
6488
6489 static unsigned int UCharAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6490 {
6491 unsigned char value2 = op2->uc;
6492
6493 exp->type = 2;
6494 exp->string = PrintUChar(op1->uc += value2);
6495 if(!exp->expType)
6496 {
6497 exp->expType = op1->type;
6498 if(op1->type)
6499 op1->type->refCount++;
6500 }
6501 return 0x1;
6502 }
6503
6504 static unsigned int FloatAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6505 {
6506 float value2 = op2->f;
6507
6508 exp->type = 2;
6509 exp->string = PrintFloat(op1->f += value2);
6510 if(!exp->expType)
6511 {
6512 exp->expType = op1->type;
6513 if(op1->type)
6514 op1->type->refCount++;
6515 }
6516 return 0x1;
6517 }
6518
6519 static unsigned int DoubleAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6520 {
6521 double value2 = op2->d;
6522
6523 exp->type = 2;
6524 exp->string = PrintDouble(op1->d += value2);
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 IntSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6535 {
6536 int value2 = op2->i;
6537
6538 exp->type = 2;
6539 exp->string = PrintInt(op1->i -= value2);
6540 if(!exp->expType)
6541 {
6542 exp->expType = op1->type;
6543 if(op1->type)
6544 op1->type->refCount++;
6545 }
6546 return 0x1;
6547 }
6548
6549 static unsigned int UIntSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6550 {
6551 unsigned int value2 = op2->ui;
6552
6553 exp->type = 2;
6554 exp->string = PrintUInt(op1->ui -= value2);
6555 if(!exp->expType)
6556 {
6557 exp->expType = op1->type;
6558 if(op1->type)
6559 op1->type->refCount++;
6560 }
6561 return 0x1;
6562 }
6563
6564 static unsigned int ShortSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6565 {
6566 short value2 = op2->s;
6567
6568 exp->type = 2;
6569 exp->string = PrintShort(op1->s -= value2);
6570 if(!exp->expType)
6571 {
6572 exp->expType = op1->type;
6573 if(op1->type)
6574 op1->type->refCount++;
6575 }
6576 return 0x1;
6577 }
6578
6579 static unsigned int UShortSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6580 {
6581 unsigned short value2 = op2->us;
6582
6583 exp->type = 2;
6584 exp->string = PrintUShort(op1->us -= value2);
6585 if(!exp->expType)
6586 {
6587 exp->expType = op1->type;
6588 if(op1->type)
6589 op1->type->refCount++;
6590 }
6591 return 0x1;
6592 }
6593
6594 static unsigned int CharSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6595 {
6596 char value2 = op2->c;
6597
6598 exp->type = 2;
6599 exp->string = PrintChar(op1->c -= value2);
6600 if(!exp->expType)
6601 {
6602 exp->expType = op1->type;
6603 if(op1->type)
6604 op1->type->refCount++;
6605 }
6606 return 0x1;
6607 }
6608
6609 static unsigned int UCharSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6610 {
6611 unsigned char value2 = op2->uc;
6612
6613 exp->type = 2;
6614 exp->string = PrintUChar(op1->uc -= value2);
6615 if(!exp->expType)
6616 {
6617 exp->expType = op1->type;
6618 if(op1->type)
6619 op1->type->refCount++;
6620 }
6621 return 0x1;
6622 }
6623
6624 static unsigned int FloatSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6625 {
6626 float value2 = op2->f;
6627
6628 exp->type = 2;
6629 exp->string = PrintFloat(op1->f -= value2);
6630 if(!exp->expType)
6631 {
6632 exp->expType = op1->type;
6633 if(op1->type)
6634 op1->type->refCount++;
6635 }
6636 return 0x1;
6637 }
6638
6639 static unsigned int DoubleSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6640 {
6641 double value2 = op2->d;
6642
6643 exp->type = 2;
6644 exp->string = PrintDouble(op1->d -= value2);
6645 if(!exp->expType)
6646 {
6647 exp->expType = op1->type;
6648 if(op1->type)
6649 op1->type->refCount++;
6650 }
6651 return 0x1;
6652 }
6653
6654 static unsigned int IntMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6655 {
6656 int value2 = op2->i;
6657
6658 exp->type = 2;
6659 exp->string = PrintInt(op1->i *= value2);
6660 if(!exp->expType)
6661 {
6662 exp->expType = op1->type;
6663 if(op1->type)
6664 op1->type->refCount++;
6665 }
6666 return 0x1;
6667 }
6668
6669 static unsigned int UIntMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6670 {
6671 unsigned int value2 = op2->ui;
6672
6673 exp->type = 2;
6674 exp->string = PrintUInt(op1->ui *= value2);
6675 if(!exp->expType)
6676 {
6677 exp->expType = op1->type;
6678 if(op1->type)
6679 op1->type->refCount++;
6680 }
6681 return 0x1;
6682 }
6683
6684 static unsigned int ShortMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6685 {
6686 short value2 = op2->s;
6687
6688 exp->type = 2;
6689 exp->string = PrintShort(op1->s *= value2);
6690 if(!exp->expType)
6691 {
6692 exp->expType = op1->type;
6693 if(op1->type)
6694 op1->type->refCount++;
6695 }
6696 return 0x1;
6697 }
6698
6699 static unsigned int UShortMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6700 {
6701 unsigned short value2 = op2->us;
6702
6703 exp->type = 2;
6704 exp->string = PrintUShort(op1->us *= value2);
6705 if(!exp->expType)
6706 {
6707 exp->expType = op1->type;
6708 if(op1->type)
6709 op1->type->refCount++;
6710 }
6711 return 0x1;
6712 }
6713
6714 static unsigned int CharMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6715 {
6716 char value2 = op2->c;
6717
6718 exp->type = 2;
6719 exp->string = PrintChar(op1->c *= value2);
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 UCharMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6730 {
6731 unsigned char value2 = op2->uc;
6732
6733 exp->type = 2;
6734 exp->string = PrintUChar(op1->uc *= value2);
6735 if(!exp->expType)
6736 {
6737 exp->expType = op1->type;
6738 if(op1->type)
6739 op1->type->refCount++;
6740 }
6741 return 0x1;
6742 }
6743
6744 static unsigned int FloatMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6745 {
6746 float value2 = op2->f;
6747
6748 exp->type = 2;
6749 exp->string = PrintFloat(op1->f *= value2);
6750 if(!exp->expType)
6751 {
6752 exp->expType = op1->type;
6753 if(op1->type)
6754 op1->type->refCount++;
6755 }
6756 return 0x1;
6757 }
6758
6759 static unsigned int DoubleMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6760 {
6761 double value2 = op2->d;
6762
6763 exp->type = 2;
6764 exp->string = PrintDouble(op1->d *= value2);
6765 if(!exp->expType)
6766 {
6767 exp->expType = op1->type;
6768 if(op1->type)
6769 op1->type->refCount++;
6770 }
6771 return 0x1;
6772 }
6773
6774 static unsigned int IntDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6775 {
6776 int value2 = op2->i;
6777
6778 exp->type = 2;
6779 exp->string = PrintInt(value2 ? (op1->i /= value2) : 0);
6780 if(!exp->expType)
6781 {
6782 exp->expType = op1->type;
6783 if(op1->type)
6784 op1->type->refCount++;
6785 }
6786 return 0x1;
6787 }
6788
6789 static unsigned int UIntDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6790 {
6791 unsigned int value2 = op2->ui;
6792
6793 exp->type = 2;
6794 exp->string = PrintUInt(value2 ? (op1->ui /= value2) : 0);
6795 if(!exp->expType)
6796 {
6797 exp->expType = op1->type;
6798 if(op1->type)
6799 op1->type->refCount++;
6800 }
6801 return 0x1;
6802 }
6803
6804 static unsigned int ShortDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6805 {
6806 short value2 = op2->s;
6807
6808 exp->type = 2;
6809 exp->string = PrintShort(value2 ? (op1->s /= value2) : (short)0);
6810 if(!exp->expType)
6811 {
6812 exp->expType = op1->type;
6813 if(op1->type)
6814 op1->type->refCount++;
6815 }
6816 return 0x1;
6817 }
6818
6819 static unsigned int UShortDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6820 {
6821 unsigned short value2 = op2->us;
6822
6823 exp->type = 2;
6824 exp->string = PrintUShort(value2 ? (op1->us /= value2) : (unsigned short)0);
6825 if(!exp->expType)
6826 {
6827 exp->expType = op1->type;
6828 if(op1->type)
6829 op1->type->refCount++;
6830 }
6831 return 0x1;
6832 }
6833
6834 static unsigned int CharDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6835 {
6836 char value2 = op2->c;
6837
6838 exp->type = 2;
6839 exp->string = PrintChar(value2 ? (op1->c /= value2) : (char)0);
6840 if(!exp->expType)
6841 {
6842 exp->expType = op1->type;
6843 if(op1->type)
6844 op1->type->refCount++;
6845 }
6846 return 0x1;
6847 }
6848
6849 static unsigned int UCharDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6850 {
6851 unsigned char value2 = op2->uc;
6852
6853 exp->type = 2;
6854 exp->string = PrintUChar(value2 ? (op1->uc /= value2) : (unsigned char)0);
6855 if(!exp->expType)
6856 {
6857 exp->expType = op1->type;
6858 if(op1->type)
6859 op1->type->refCount++;
6860 }
6861 return 0x1;
6862 }
6863
6864 static unsigned int FloatDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6865 {
6866 float value2 = op2->f;
6867
6868 exp->type = 2;
6869 exp->string = PrintFloat(value2 ? (op1->f /= value2) : (float)0);
6870 if(!exp->expType)
6871 {
6872 exp->expType = op1->type;
6873 if(op1->type)
6874 op1->type->refCount++;
6875 }
6876 return 0x1;
6877 }
6878
6879 static unsigned int DoubleDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6880 {
6881 double value2 = op2->d;
6882
6883 exp->type = 2;
6884 exp->string = PrintDouble(value2 ? (op1->d /= value2) : (double)0);
6885 if(!exp->expType)
6886 {
6887 exp->expType = op1->type;
6888 if(op1->type)
6889 op1->type->refCount++;
6890 }
6891 return 0x1;
6892 }
6893
6894 static unsigned int IntModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6895 {
6896 int value2 = op2->i;
6897
6898 exp->type = 2;
6899 exp->string = PrintInt(value2 ? (op1->i %= value2) : 0);
6900 if(!exp->expType)
6901 {
6902 exp->expType = op1->type;
6903 if(op1->type)
6904 op1->type->refCount++;
6905 }
6906 return 0x1;
6907 }
6908
6909 static unsigned int UIntModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6910 {
6911 unsigned int value2 = op2->ui;
6912
6913 exp->type = 2;
6914 exp->string = PrintUInt(value2 ? (op1->ui %= value2) : 0);
6915 if(!exp->expType)
6916 {
6917 exp->expType = op1->type;
6918 if(op1->type)
6919 op1->type->refCount++;
6920 }
6921 return 0x1;
6922 }
6923
6924 static unsigned int ShortModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6925 {
6926 short value2 = op2->s;
6927
6928 exp->type = 2;
6929 exp->string = PrintShort(value2 ? (op1->s %= value2) : (short)0);
6930 if(!exp->expType)
6931 {
6932 exp->expType = op1->type;
6933 if(op1->type)
6934 op1->type->refCount++;
6935 }
6936 return 0x1;
6937 }
6938
6939 static unsigned int UShortModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6940 {
6941 unsigned short value2 = op2->us;
6942
6943 exp->type = 2;
6944 exp->string = PrintUShort(value2 ? (op1->us %= value2) : (unsigned short)0);
6945 if(!exp->expType)
6946 {
6947 exp->expType = op1->type;
6948 if(op1->type)
6949 op1->type->refCount++;
6950 }
6951 return 0x1;
6952 }
6953
6954 static unsigned int CharModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6955 {
6956 char value2 = op2->c;
6957
6958 exp->type = 2;
6959 exp->string = PrintChar(value2 ? (op1->c %= value2) : (char)0);
6960 if(!exp->expType)
6961 {
6962 exp->expType = op1->type;
6963 if(op1->type)
6964 op1->type->refCount++;
6965 }
6966 return 0x1;
6967 }
6968
6969 static unsigned int UCharModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6970 {
6971 unsigned char value2 = op2->uc;
6972
6973 exp->type = 2;
6974 exp->string = PrintUChar(value2 ? (op1->uc %= value2) : (unsigned char)0);
6975 if(!exp->expType)
6976 {
6977 exp->expType = op1->type;
6978 if(op1->type)
6979 op1->type->refCount++;
6980 }
6981 return 0x1;
6982 }
6983
6984 static unsigned int IntBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6985 {
6986 int value2 = op2->i;
6987
6988 exp->type = 2;
6989 exp->string = PrintInt(op1->i & value2);
6990 if(!exp->expType)
6991 {
6992 exp->expType = op1->type;
6993 if(op1->type)
6994 op1->type->refCount++;
6995 }
6996 return 0x1;
6997 }
6998
6999 static unsigned int UIntBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7000 {
7001 unsigned int value2 = op2->ui;
7002
7003 exp->type = 2;
7004 exp->string = PrintUInt(op1->ui & value2);
7005 if(!exp->expType)
7006 {
7007 exp->expType = op1->type;
7008 if(op1->type)
7009 op1->type->refCount++;
7010 }
7011 return 0x1;
7012 }
7013
7014 static unsigned int ShortBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7015 {
7016 short value2 = op2->s;
7017
7018 exp->type = 2;
7019 exp->string = PrintShort(op1->s & value2);
7020 if(!exp->expType)
7021 {
7022 exp->expType = op1->type;
7023 if(op1->type)
7024 op1->type->refCount++;
7025 }
7026 return 0x1;
7027 }
7028
7029 static unsigned int UShortBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7030 {
7031 unsigned short value2 = op2->us;
7032
7033 exp->type = 2;
7034 exp->string = PrintUShort(op1->us & value2);
7035 if(!exp->expType)
7036 {
7037 exp->expType = op1->type;
7038 if(op1->type)
7039 op1->type->refCount++;
7040 }
7041 return 0x1;
7042 }
7043
7044 static unsigned int CharBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7045 {
7046 char value2 = op2->c;
7047
7048 exp->type = 2;
7049 exp->string = PrintChar(op1->c & value2);
7050 if(!exp->expType)
7051 {
7052 exp->expType = op1->type;
7053 if(op1->type)
7054 op1->type->refCount++;
7055 }
7056 return 0x1;
7057 }
7058
7059 static unsigned int UCharBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7060 {
7061 unsigned char value2 = op2->uc;
7062
7063 exp->type = 2;
7064 exp->string = PrintUChar(op1->uc & value2);
7065 if(!exp->expType)
7066 {
7067 exp->expType = op1->type;
7068 if(op1->type)
7069 op1->type->refCount++;
7070 }
7071 return 0x1;
7072 }
7073
7074 static unsigned int IntBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7075 {
7076 int value2 = op2->i;
7077
7078 exp->type = 2;
7079 exp->string = PrintInt(op1->i | value2);
7080 if(!exp->expType)
7081 {
7082 exp->expType = op1->type;
7083 if(op1->type)
7084 op1->type->refCount++;
7085 }
7086 return 0x1;
7087 }
7088
7089 static unsigned int UIntBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7090 {
7091 unsigned int value2 = op2->ui;
7092
7093 exp->type = 2;
7094 exp->string = PrintUInt(op1->ui | value2);
7095 if(!exp->expType)
7096 {
7097 exp->expType = op1->type;
7098 if(op1->type)
7099 op1->type->refCount++;
7100 }
7101 return 0x1;
7102 }
7103
7104 static unsigned int ShortBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7105 {
7106 short value2 = op2->s;
7107
7108 exp->type = 2;
7109 exp->string = PrintShort(op1->s | value2);
7110 if(!exp->expType)
7111 {
7112 exp->expType = op1->type;
7113 if(op1->type)
7114 op1->type->refCount++;
7115 }
7116 return 0x1;
7117 }
7118
7119 static unsigned int UShortBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7120 {
7121 unsigned short value2 = op2->us;
7122
7123 exp->type = 2;
7124 exp->string = PrintUShort(op1->us | value2);
7125 if(!exp->expType)
7126 {
7127 exp->expType = op1->type;
7128 if(op1->type)
7129 op1->type->refCount++;
7130 }
7131 return 0x1;
7132 }
7133
7134 static unsigned int CharBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7135 {
7136 char value2 = op2->c;
7137
7138 exp->type = 2;
7139 exp->string = PrintChar(op1->c | value2);
7140 if(!exp->expType)
7141 {
7142 exp->expType = op1->type;
7143 if(op1->type)
7144 op1->type->refCount++;
7145 }
7146 return 0x1;
7147 }
7148
7149 static unsigned int UCharBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7150 {
7151 unsigned char value2 = op2->uc;
7152
7153 exp->type = 2;
7154 exp->string = PrintUChar(op1->uc | value2);
7155 if(!exp->expType)
7156 {
7157 exp->expType = op1->type;
7158 if(op1->type)
7159 op1->type->refCount++;
7160 }
7161 return 0x1;
7162 }
7163
7164 static unsigned int IntBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7165 {
7166 int value2 = op2->i;
7167
7168 exp->type = 2;
7169 exp->string = PrintInt(op1->i ^ value2);
7170 if(!exp->expType)
7171 {
7172 exp->expType = op1->type;
7173 if(op1->type)
7174 op1->type->refCount++;
7175 }
7176 return 0x1;
7177 }
7178
7179 static unsigned int UIntBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7180 {
7181 unsigned int value2 = op2->ui;
7182
7183 exp->type = 2;
7184 exp->string = PrintUInt(op1->ui ^ value2);
7185 if(!exp->expType)
7186 {
7187 exp->expType = op1->type;
7188 if(op1->type)
7189 op1->type->refCount++;
7190 }
7191 return 0x1;
7192 }
7193
7194 static unsigned int ShortBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7195 {
7196 short value2 = op2->s;
7197
7198 exp->type = 2;
7199 exp->string = PrintShort(op1->s ^ value2);
7200 if(!exp->expType)
7201 {
7202 exp->expType = op1->type;
7203 if(op1->type)
7204 op1->type->refCount++;
7205 }
7206 return 0x1;
7207 }
7208
7209 static unsigned int UShortBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7210 {
7211 unsigned short value2 = op2->us;
7212
7213 exp->type = 2;
7214 exp->string = PrintUShort(op1->us ^ value2);
7215 if(!exp->expType)
7216 {
7217 exp->expType = op1->type;
7218 if(op1->type)
7219 op1->type->refCount++;
7220 }
7221 return 0x1;
7222 }
7223
7224 static unsigned int CharBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7225 {
7226 char value2 = op2->c;
7227
7228 exp->type = 2;
7229 exp->string = PrintChar(op1->c ^ value2);
7230 if(!exp->expType)
7231 {
7232 exp->expType = op1->type;
7233 if(op1->type)
7234 op1->type->refCount++;
7235 }
7236 return 0x1;
7237 }
7238
7239 static unsigned int UCharBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7240 {
7241 unsigned char value2 = op2->uc;
7242
7243 exp->type = 2;
7244 exp->string = PrintUChar(op1->uc ^ value2);
7245 if(!exp->expType)
7246 {
7247 exp->expType = op1->type;
7248 if(op1->type)
7249 op1->type->refCount++;
7250 }
7251 return 0x1;
7252 }
7253
7254 static unsigned int IntLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7255 {
7256 int value2 = op2->i;
7257
7258 exp->type = 2;
7259 exp->string = PrintInt(op1->i << value2);
7260 if(!exp->expType)
7261 {
7262 exp->expType = op1->type;
7263 if(op1->type)
7264 op1->type->refCount++;
7265 }
7266 return 0x1;
7267 }
7268
7269 static unsigned int UIntLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7270 {
7271 unsigned int value2 = op2->ui;
7272
7273 exp->type = 2;
7274 exp->string = PrintUInt(op1->ui << value2);
7275 if(!exp->expType)
7276 {
7277 exp->expType = op1->type;
7278 if(op1->type)
7279 op1->type->refCount++;
7280 }
7281 return 0x1;
7282 }
7283
7284 static unsigned int ShortLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7285 {
7286 short value2 = op2->s;
7287
7288 exp->type = 2;
7289 exp->string = PrintShort(op1->s << value2);
7290 if(!exp->expType)
7291 {
7292 exp->expType = op1->type;
7293 if(op1->type)
7294 op1->type->refCount++;
7295 }
7296 return 0x1;
7297 }
7298
7299 static unsigned int UShortLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7300 {
7301 unsigned short value2 = op2->us;
7302
7303 exp->type = 2;
7304 exp->string = PrintUShort(op1->us << value2);
7305 if(!exp->expType)
7306 {
7307 exp->expType = op1->type;
7308 if(op1->type)
7309 op1->type->refCount++;
7310 }
7311 return 0x1;
7312 }
7313
7314 static unsigned int CharLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7315 {
7316 char value2 = op2->c;
7317
7318 exp->type = 2;
7319 exp->string = PrintChar(op1->c << value2);
7320 if(!exp->expType)
7321 {
7322 exp->expType = op1->type;
7323 if(op1->type)
7324 op1->type->refCount++;
7325 }
7326 return 0x1;
7327 }
7328
7329 static unsigned int UCharLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7330 {
7331 unsigned char value2 = op2->uc;
7332
7333 exp->type = 2;
7334 exp->string = PrintUChar(op1->uc << value2);
7335 if(!exp->expType)
7336 {
7337 exp->expType = op1->type;
7338 if(op1->type)
7339 op1->type->refCount++;
7340 }
7341 return 0x1;
7342 }
7343
7344 static unsigned int IntRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7345 {
7346 int value2 = op2->i;
7347
7348 exp->type = 2;
7349 exp->string = PrintInt(op1->i >> value2);
7350 if(!exp->expType)
7351 {
7352 exp->expType = op1->type;
7353 if(op1->type)
7354 op1->type->refCount++;
7355 }
7356 return 0x1;
7357 }
7358
7359 static unsigned int UIntRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7360 {
7361 unsigned int value2 = op2->ui;
7362
7363 exp->type = 2;
7364 exp->string = PrintUInt(op1->ui >> value2);
7365 if(!exp->expType)
7366 {
7367 exp->expType = op1->type;
7368 if(op1->type)
7369 op1->type->refCount++;
7370 }
7371 return 0x1;
7372 }
7373
7374 static unsigned int ShortRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7375 {
7376 short value2 = op2->s;
7377
7378 exp->type = 2;
7379 exp->string = PrintShort(op1->s >> value2);
7380 if(!exp->expType)
7381 {
7382 exp->expType = op1->type;
7383 if(op1->type)
7384 op1->type->refCount++;
7385 }
7386 return 0x1;
7387 }
7388
7389 static unsigned int UShortRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7390 {
7391 unsigned short value2 = op2->us;
7392
7393 exp->type = 2;
7394 exp->string = PrintUShort(op1->us >> value2);
7395 if(!exp->expType)
7396 {
7397 exp->expType = op1->type;
7398 if(op1->type)
7399 op1->type->refCount++;
7400 }
7401 return 0x1;
7402 }
7403
7404 static unsigned int CharRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7405 {
7406 char value2 = op2->c;
7407
7408 exp->type = 2;
7409 exp->string = PrintChar(op1->c >> value2);
7410 if(!exp->expType)
7411 {
7412 exp->expType = op1->type;
7413 if(op1->type)
7414 op1->type->refCount++;
7415 }
7416 return 0x1;
7417 }
7418
7419 static unsigned int UCharRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7420 {
7421 unsigned char value2 = op2->uc;
7422
7423 exp->type = 2;
7424 exp->string = PrintUChar(op1->uc >> value2);
7425 if(!exp->expType)
7426 {
7427 exp->expType = op1->type;
7428 if(op1->type)
7429 op1->type->refCount++;
7430 }
7431 return 0x1;
7432 }
7433
7434 static unsigned int IntBitNot(struct Expression * exp, struct Operand * op1)
7435 {
7436 exp->type = 2;
7437 exp->string = PrintInt(~op1->i);
7438 if(!exp->expType)
7439 {
7440 exp->expType = op1->type;
7441 if(op1->type)
7442 op1->type->refCount++;
7443 }
7444 return 0x1;
7445 }
7446
7447 static unsigned int UIntBitNot(struct Expression * exp, struct Operand * op1)
7448 {
7449 exp->type = 2;
7450 exp->string = PrintUInt(~op1->ui);
7451 if(!exp->expType)
7452 {
7453 exp->expType = op1->type;
7454 if(op1->type)
7455 op1->type->refCount++;
7456 }
7457 return 0x1;
7458 }
7459
7460 static unsigned int ShortBitNot(struct Expression * exp, struct Operand * op1)
7461 {
7462 exp->type = 2;
7463 exp->string = PrintShort(~op1->s);
7464 if(!exp->expType)
7465 {
7466 exp->expType = op1->type;
7467 if(op1->type)
7468 op1->type->refCount++;
7469 }
7470 return 0x1;
7471 }
7472
7473 static unsigned int UShortBitNot(struct Expression * exp, struct Operand * op1)
7474 {
7475 exp->type = 2;
7476 exp->string = PrintUShort(~op1->us);
7477 if(!exp->expType)
7478 {
7479 exp->expType = op1->type;
7480 if(op1->type)
7481 op1->type->refCount++;
7482 }
7483 return 0x1;
7484 }
7485
7486 static unsigned int CharBitNot(struct Expression * exp, struct Operand * op1)
7487 {
7488 exp->type = 2;
7489 exp->string = PrintChar(~op1->c);
7490 if(!exp->expType)
7491 {
7492 exp->expType = op1->type;
7493 if(op1->type)
7494 op1->type->refCount++;
7495 }
7496 return 0x1;
7497 }
7498
7499 static unsigned int UCharBitNot(struct Expression * exp, struct Operand * op1)
7500 {
7501 exp->type = 2;
7502 exp->string = PrintUChar(~op1->uc);
7503 if(!exp->expType)
7504 {
7505 exp->expType = op1->type;
7506 if(op1->type)
7507 op1->type->refCount++;
7508 }
7509 return 0x1;
7510 }
7511
7512 static unsigned int IntAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7513 {
7514 int value2 = op2->i;
7515
7516 exp->type = 2;
7517 exp->string = PrintInt(op1->i &= value2);
7518 if(!exp->expType)
7519 {
7520 exp->expType = op1->type;
7521 if(op1->type)
7522 op1->type->refCount++;
7523 }
7524 return 0x1;
7525 }
7526
7527 static unsigned int UIntAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7528 {
7529 unsigned int value2 = op2->ui;
7530
7531 exp->type = 2;
7532 exp->string = PrintUInt(op1->ui &= value2);
7533 if(!exp->expType)
7534 {
7535 exp->expType = op1->type;
7536 if(op1->type)
7537 op1->type->refCount++;
7538 }
7539 return 0x1;
7540 }
7541
7542 static unsigned int ShortAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7543 {
7544 short value2 = op2->s;
7545
7546 exp->type = 2;
7547 exp->string = PrintShort(op1->s &= value2);
7548 if(!exp->expType)
7549 {
7550 exp->expType = op1->type;
7551 if(op1->type)
7552 op1->type->refCount++;
7553 }
7554 return 0x1;
7555 }
7556
7557 static unsigned int UShortAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7558 {
7559 unsigned short value2 = op2->us;
7560
7561 exp->type = 2;
7562 exp->string = PrintUShort(op1->us &= value2);
7563 if(!exp->expType)
7564 {
7565 exp->expType = op1->type;
7566 if(op1->type)
7567 op1->type->refCount++;
7568 }
7569 return 0x1;
7570 }
7571
7572 static unsigned int CharAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7573 {
7574 char value2 = op2->c;
7575
7576 exp->type = 2;
7577 exp->string = PrintChar(op1->c &= value2);
7578 if(!exp->expType)
7579 {
7580 exp->expType = op1->type;
7581 if(op1->type)
7582 op1->type->refCount++;
7583 }
7584 return 0x1;
7585 }
7586
7587 static unsigned int UCharAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7588 {
7589 unsigned char value2 = op2->uc;
7590
7591 exp->type = 2;
7592 exp->string = PrintUChar(op1->uc &= value2);
7593 if(!exp->expType)
7594 {
7595 exp->expType = op1->type;
7596 if(op1->type)
7597 op1->type->refCount++;
7598 }
7599 return 0x1;
7600 }
7601
7602 static unsigned int IntOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7603 {
7604 int value2 = op2->i;
7605
7606 exp->type = 2;
7607 exp->string = PrintInt(op1->i |= value2);
7608 if(!exp->expType)
7609 {
7610 exp->expType = op1->type;
7611 if(op1->type)
7612 op1->type->refCount++;
7613 }
7614 return 0x1;
7615 }
7616
7617 static unsigned int UIntOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7618 {
7619 unsigned int value2 = op2->ui;
7620
7621 exp->type = 2;
7622 exp->string = PrintUInt(op1->ui |= value2);
7623 if(!exp->expType)
7624 {
7625 exp->expType = op1->type;
7626 if(op1->type)
7627 op1->type->refCount++;
7628 }
7629 return 0x1;
7630 }
7631
7632 static unsigned int ShortOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7633 {
7634 short value2 = op2->s;
7635
7636 exp->type = 2;
7637 exp->string = PrintShort(op1->s |= value2);
7638 if(!exp->expType)
7639 {
7640 exp->expType = op1->type;
7641 if(op1->type)
7642 op1->type->refCount++;
7643 }
7644 return 0x1;
7645 }
7646
7647 static unsigned int UShortOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7648 {
7649 unsigned short value2 = op2->us;
7650
7651 exp->type = 2;
7652 exp->string = PrintUShort(op1->us |= value2);
7653 if(!exp->expType)
7654 {
7655 exp->expType = op1->type;
7656 if(op1->type)
7657 op1->type->refCount++;
7658 }
7659 return 0x1;
7660 }
7661
7662 static unsigned int CharOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7663 {
7664 char value2 = op2->c;
7665
7666 exp->type = 2;
7667 exp->string = PrintChar(op1->c |= value2);
7668 if(!exp->expType)
7669 {
7670 exp->expType = op1->type;
7671 if(op1->type)
7672 op1->type->refCount++;
7673 }
7674 return 0x1;
7675 }
7676
7677 static unsigned int UCharOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7678 {
7679 unsigned char value2 = op2->uc;
7680
7681 exp->type = 2;
7682 exp->string = PrintUChar(op1->uc |= value2);
7683 if(!exp->expType)
7684 {
7685 exp->expType = op1->type;
7686 if(op1->type)
7687 op1->type->refCount++;
7688 }
7689 return 0x1;
7690 }
7691
7692 static unsigned int IntXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7693 {
7694 int value2 = op2->i;
7695
7696 exp->type = 2;
7697 exp->string = PrintInt(op1->i ^= value2);
7698 if(!exp->expType)
7699 {
7700 exp->expType = op1->type;
7701 if(op1->type)
7702 op1->type->refCount++;
7703 }
7704 return 0x1;
7705 }
7706
7707 static unsigned int UIntXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7708 {
7709 unsigned int value2 = op2->ui;
7710
7711 exp->type = 2;
7712 exp->string = PrintUInt(op1->ui ^= value2);
7713 if(!exp->expType)
7714 {
7715 exp->expType = op1->type;
7716 if(op1->type)
7717 op1->type->refCount++;
7718 }
7719 return 0x1;
7720 }
7721
7722 static unsigned int ShortXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7723 {
7724 short value2 = op2->s;
7725
7726 exp->type = 2;
7727 exp->string = PrintShort(op1->s ^= value2);
7728 if(!exp->expType)
7729 {
7730 exp->expType = op1->type;
7731 if(op1->type)
7732 op1->type->refCount++;
7733 }
7734 return 0x1;
7735 }
7736
7737 static unsigned int UShortXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7738 {
7739 unsigned short value2 = op2->us;
7740
7741 exp->type = 2;
7742 exp->string = PrintUShort(op1->us ^= value2);
7743 if(!exp->expType)
7744 {
7745 exp->expType = op1->type;
7746 if(op1->type)
7747 op1->type->refCount++;
7748 }
7749 return 0x1;
7750 }
7751
7752 static unsigned int CharXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7753 {
7754 char value2 = op2->c;
7755
7756 exp->type = 2;
7757 exp->string = PrintChar(op1->c ^= value2);
7758 if(!exp->expType)
7759 {
7760 exp->expType = op1->type;
7761 if(op1->type)
7762 op1->type->refCount++;
7763 }
7764 return 0x1;
7765 }
7766
7767 static unsigned int UCharXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7768 {
7769 unsigned char value2 = op2->uc;
7770
7771 exp->type = 2;
7772 exp->string = PrintUChar(op1->uc ^= value2);
7773 if(!exp->expType)
7774 {
7775 exp->expType = op1->type;
7776 if(op1->type)
7777 op1->type->refCount++;
7778 }
7779 return 0x1;
7780 }
7781
7782 static unsigned int IntLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7783 {
7784 int value2 = op2->i;
7785
7786 exp->type = 2;
7787 exp->string = PrintInt(op1->i <<= value2);
7788 if(!exp->expType)
7789 {
7790 exp->expType = op1->type;
7791 if(op1->type)
7792 op1->type->refCount++;
7793 }
7794 return 0x1;
7795 }
7796
7797 static unsigned int UIntLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7798 {
7799 unsigned int value2 = op2->ui;
7800
7801 exp->type = 2;
7802 exp->string = PrintUInt(op1->ui <<= value2);
7803 if(!exp->expType)
7804 {
7805 exp->expType = op1->type;
7806 if(op1->type)
7807 op1->type->refCount++;
7808 }
7809 return 0x1;
7810 }
7811
7812 static unsigned int ShortLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7813 {
7814 short value2 = op2->s;
7815
7816 exp->type = 2;
7817 exp->string = PrintShort(op1->s <<= value2);
7818 if(!exp->expType)
7819 {
7820 exp->expType = op1->type;
7821 if(op1->type)
7822 op1->type->refCount++;
7823 }
7824 return 0x1;
7825 }
7826
7827 static unsigned int UShortLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7828 {
7829 unsigned short value2 = op2->us;
7830
7831 exp->type = 2;
7832 exp->string = PrintUShort(op1->us <<= value2);
7833 if(!exp->expType)
7834 {
7835 exp->expType = op1->type;
7836 if(op1->type)
7837 op1->type->refCount++;
7838 }
7839 return 0x1;
7840 }
7841
7842 static unsigned int CharLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7843 {
7844 char value2 = op2->c;
7845
7846 exp->type = 2;
7847 exp->string = PrintChar(op1->c <<= value2);
7848 if(!exp->expType)
7849 {
7850 exp->expType = op1->type;
7851 if(op1->type)
7852 op1->type->refCount++;
7853 }
7854 return 0x1;
7855 }
7856
7857 static unsigned int UCharLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7858 {
7859 unsigned char value2 = op2->uc;
7860
7861 exp->type = 2;
7862 exp->string = PrintUChar(op1->uc <<= value2);
7863 if(!exp->expType)
7864 {
7865 exp->expType = op1->type;
7866 if(op1->type)
7867 op1->type->refCount++;
7868 }
7869 return 0x1;
7870 }
7871
7872 static unsigned int IntRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7873 {
7874 int value2 = op2->i;
7875
7876 exp->type = 2;
7877 exp->string = PrintInt(op1->i >>= value2);
7878 if(!exp->expType)
7879 {
7880 exp->expType = op1->type;
7881 if(op1->type)
7882 op1->type->refCount++;
7883 }
7884 return 0x1;
7885 }
7886
7887 static unsigned int UIntRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7888 {
7889 unsigned int value2 = op2->ui;
7890
7891 exp->type = 2;
7892 exp->string = PrintUInt(op1->ui >>= value2);
7893 if(!exp->expType)
7894 {
7895 exp->expType = op1->type;
7896 if(op1->type)
7897 op1->type->refCount++;
7898 }
7899 return 0x1;
7900 }
7901
7902 static unsigned int ShortRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7903 {
7904 short value2 = op2->s;
7905
7906 exp->type = 2;
7907 exp->string = PrintShort(op1->s >>= value2);
7908 if(!exp->expType)
7909 {
7910 exp->expType = op1->type;
7911 if(op1->type)
7912 op1->type->refCount++;
7913 }
7914 return 0x1;
7915 }
7916
7917 static unsigned int UShortRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7918 {
7919 unsigned short value2 = op2->us;
7920
7921 exp->type = 2;
7922 exp->string = PrintUShort(op1->us >>= value2);
7923 if(!exp->expType)
7924 {
7925 exp->expType = op1->type;
7926 if(op1->type)
7927 op1->type->refCount++;
7928 }
7929 return 0x1;
7930 }
7931
7932 static unsigned int CharRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7933 {
7934 char value2 = op2->c;
7935
7936 exp->type = 2;
7937 exp->string = PrintChar(op1->c >>= value2);
7938 if(!exp->expType)
7939 {
7940 exp->expType = op1->type;
7941 if(op1->type)
7942 op1->type->refCount++;
7943 }
7944 return 0x1;
7945 }
7946
7947 static unsigned int UCharRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7948 {
7949 unsigned char value2 = op2->uc;
7950
7951 exp->type = 2;
7952 exp->string = PrintUChar(op1->uc >>= value2);
7953 if(!exp->expType)
7954 {
7955 exp->expType = op1->type;
7956 if(op1->type)
7957 op1->type->refCount++;
7958 }
7959 return 0x1;
7960 }
7961
7962 static unsigned int IntNot(struct Expression * exp, struct Operand * op1)
7963 {
7964 exp->type = 2;
7965 exp->string = PrintInt(!op1->i);
7966 if(!exp->expType)
7967 {
7968 exp->expType = op1->type;
7969 if(op1->type)
7970 op1->type->refCount++;
7971 }
7972 return 0x1;
7973 }
7974
7975 static unsigned int UIntNot(struct Expression * exp, struct Operand * op1)
7976 {
7977 exp->type = 2;
7978 exp->string = PrintUInt(!op1->ui);
7979 if(!exp->expType)
7980 {
7981 exp->expType = op1->type;
7982 if(op1->type)
7983 op1->type->refCount++;
7984 }
7985 return 0x1;
7986 }
7987
7988 static unsigned int ShortNot(struct Expression * exp, struct Operand * op1)
7989 {
7990 exp->type = 2;
7991 exp->string = PrintShort(!op1->s);
7992 if(!exp->expType)
7993 {
7994 exp->expType = op1->type;
7995 if(op1->type)
7996 op1->type->refCount++;
7997 }
7998 return 0x1;
7999 }
8000
8001 static unsigned int UShortNot(struct Expression * exp, struct Operand * op1)
8002 {
8003 exp->type = 2;
8004 exp->string = PrintUShort(!op1->us);
8005 if(!exp->expType)
8006 {
8007 exp->expType = op1->type;
8008 if(op1->type)
8009 op1->type->refCount++;
8010 }
8011 return 0x1;
8012 }
8013
8014 static unsigned int CharNot(struct Expression * exp, struct Operand * op1)
8015 {
8016 exp->type = 2;
8017 exp->string = PrintChar(!op1->c);
8018 if(!exp->expType)
8019 {
8020 exp->expType = op1->type;
8021 if(op1->type)
8022 op1->type->refCount++;
8023 }
8024 return 0x1;
8025 }
8026
8027 static unsigned int UCharNot(struct Expression * exp, struct Operand * op1)
8028 {
8029 exp->type = 2;
8030 exp->string = PrintUChar(!op1->uc);
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 IntEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8041 {
8042 int value2 = op2->i;
8043
8044 exp->type = 2;
8045 exp->string = PrintInt(op1->i == 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 UIntEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8056 {
8057 unsigned int value2 = op2->ui;
8058
8059 exp->type = 2;
8060 exp->string = PrintUInt(op1->ui == 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 ShortEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8071 {
8072 short value2 = op2->s;
8073
8074 exp->type = 2;
8075 exp->string = PrintShort(op1->s == 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 UShortEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8086 {
8087 unsigned short value2 = op2->us;
8088
8089 exp->type = 2;
8090 exp->string = PrintUShort(op1->us == 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 CharEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8101 {
8102 char value2 = op2->c;
8103
8104 exp->type = 2;
8105 exp->string = PrintChar(op1->c == 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 UCharEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8116 {
8117 unsigned char value2 = op2->uc;
8118
8119 exp->type = 2;
8120 exp->string = PrintUChar(op1->uc == 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 FloatEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8131 {
8132 float value2 = op2->f;
8133
8134 exp->type = 2;
8135 exp->string = PrintFloat(op1->f == 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 DoubleEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8146 {
8147 double value2 = op2->d;
8148
8149 exp->type = 2;
8150 exp->string = PrintDouble(op1->d == 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 IntNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8161 {
8162 int value2 = op2->i;
8163
8164 exp->type = 2;
8165 exp->string = PrintInt(op1->i != 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 UIntNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8176 {
8177 unsigned int value2 = op2->ui;
8178
8179 exp->type = 2;
8180 exp->string = PrintUInt(op1->ui != 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 ShortNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8191 {
8192 short value2 = op2->s;
8193
8194 exp->type = 2;
8195 exp->string = PrintShort(op1->s != 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 UShortNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8206 {
8207 unsigned short value2 = op2->us;
8208
8209 exp->type = 2;
8210 exp->string = PrintUShort(op1->us != 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 CharNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8221 {
8222 char value2 = op2->c;
8223
8224 exp->type = 2;
8225 exp->string = PrintChar(op1->c != 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 UCharNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8236 {
8237 unsigned char value2 = op2->uc;
8238
8239 exp->type = 2;
8240 exp->string = PrintUChar(op1->uc != 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 FloatNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8251 {
8252 float value2 = op2->f;
8253
8254 exp->type = 2;
8255 exp->string = PrintFloat(op1->f != 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 DoubleNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8266 {
8267 double value2 = op2->d;
8268
8269 exp->type = 2;
8270 exp->string = PrintDouble(op1->d != 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 IntAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8281 {
8282 int value2 = op2->i;
8283
8284 exp->type = 2;
8285 exp->string = PrintInt(op1->i && 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 UIntAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8296 {
8297 unsigned int value2 = op2->ui;
8298
8299 exp->type = 2;
8300 exp->string = PrintUInt(op1->ui && 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 ShortAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8311 {
8312 short value2 = op2->s;
8313
8314 exp->type = 2;
8315 exp->string = PrintShort(op1->s && 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 UShortAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8326 {
8327 unsigned short value2 = op2->us;
8328
8329 exp->type = 2;
8330 exp->string = PrintUShort(op1->us && 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 CharAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8341 {
8342 char value2 = op2->c;
8343
8344 exp->type = 2;
8345 exp->string = PrintChar(op1->c && 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 UCharAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8356 {
8357 unsigned char value2 = op2->uc;
8358
8359 exp->type = 2;
8360 exp->string = PrintUChar(op1->uc && value2);
8361 if(!exp->expType)
8362 {
8363 exp->expType = op1->type;
8364 if(op1->type)
8365 op1->type->refCount++;
8366 }
8367 return 0x1;
8368 }
8369
8370 static unsigned int FloatAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8371 {
8372 float value2 = op2->f;
8373
8374 exp->type = 2;
8375 exp->string = PrintFloat(op1->f && value2);
8376 if(!exp->expType)
8377 {
8378 exp->expType = op1->type;
8379 if(op1->type)
8380 op1->type->refCount++;
8381 }
8382 return 0x1;
8383 }
8384
8385 static unsigned int DoubleAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8386 {
8387 double value2 = op2->d;
8388
8389 exp->type = 2;
8390 exp->string = PrintDouble(op1->d && value2);
8391 if(!exp->expType)
8392 {
8393 exp->expType = op1->type;
8394 if(op1->type)
8395 op1->type->refCount++;
8396 }
8397 return 0x1;
8398 }
8399
8400 static unsigned int IntOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8401 {
8402 int value2 = op2->i;
8403
8404 exp->type = 2;
8405 exp->string = PrintInt(op1->i || value2);
8406 if(!exp->expType)
8407 {
8408 exp->expType = op1->type;
8409 if(op1->type)
8410 op1->type->refCount++;
8411 }
8412 return 0x1;
8413 }
8414
8415 static unsigned int UIntOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8416 {
8417 unsigned int value2 = op2->ui;
8418
8419 exp->type = 2;
8420 exp->string = PrintUInt(op1->ui || value2);
8421 if(!exp->expType)
8422 {
8423 exp->expType = op1->type;
8424 if(op1->type)
8425 op1->type->refCount++;
8426 }
8427 return 0x1;
8428 }
8429
8430 static unsigned int ShortOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8431 {
8432 short value2 = op2->s;
8433
8434 exp->type = 2;
8435 exp->string = PrintShort(op1->s || value2);
8436 if(!exp->expType)
8437 {
8438 exp->expType = op1->type;
8439 if(op1->type)
8440 op1->type->refCount++;
8441 }
8442 return 0x1;
8443 }
8444
8445 static unsigned int UShortOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8446 {
8447 unsigned short value2 = op2->us;
8448
8449 exp->type = 2;
8450 exp->string = PrintUShort(op1->us || value2);
8451 if(!exp->expType)
8452 {
8453 exp->expType = op1->type;
8454 if(op1->type)
8455 op1->type->refCount++;
8456 }
8457 return 0x1;
8458 }
8459
8460 static unsigned int CharOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8461 {
8462 char value2 = op2->c;
8463
8464 exp->type = 2;
8465 exp->string = PrintChar(op1->c || value2);
8466 if(!exp->expType)
8467 {
8468 exp->expType = op1->type;
8469 if(op1->type)
8470 op1->type->refCount++;
8471 }
8472 return 0x1;
8473 }
8474
8475 static unsigned int UCharOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8476 {
8477 unsigned char value2 = op2->uc;
8478
8479 exp->type = 2;
8480 exp->string = PrintUChar(op1->uc || value2);
8481 if(!exp->expType)
8482 {
8483 exp->expType = op1->type;
8484 if(op1->type)
8485 op1->type->refCount++;
8486 }
8487 return 0x1;
8488 }
8489
8490 static unsigned int FloatOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8491 {
8492 float value2 = op2->f;
8493
8494 exp->type = 2;
8495 exp->string = PrintFloat(op1->f || value2);
8496 if(!exp->expType)
8497 {
8498 exp->expType = op1->type;
8499 if(op1->type)
8500 op1->type->refCount++;
8501 }
8502 return 0x1;
8503 }
8504
8505 static unsigned int DoubleOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8506 {
8507 double value2 = op2->d;
8508
8509 exp->type = 2;
8510 exp->string = PrintDouble(op1->d || value2);
8511 if(!exp->expType)
8512 {
8513 exp->expType = op1->type;
8514 if(op1->type)
8515 op1->type->refCount++;
8516 }
8517 return 0x1;
8518 }
8519
8520 static unsigned int IntGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8521 {
8522 int value2 = op2->i;
8523
8524 exp->type = 2;
8525 exp->string = PrintInt(op1->i > value2);
8526 if(!exp->expType)
8527 {
8528 exp->expType = op1->type;
8529 if(op1->type)
8530 op1->type->refCount++;
8531 }
8532 return 0x1;
8533 }
8534
8535 static unsigned int UIntGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8536 {
8537 unsigned int value2 = op2->ui;
8538
8539 exp->type = 2;
8540 exp->string = PrintUInt(op1->ui > value2);
8541 if(!exp->expType)
8542 {
8543 exp->expType = op1->type;
8544 if(op1->type)
8545 op1->type->refCount++;
8546 }
8547 return 0x1;
8548 }
8549
8550 static unsigned int ShortGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8551 {
8552 short value2 = op2->s;
8553
8554 exp->type = 2;
8555 exp->string = PrintShort(op1->s > value2);
8556 if(!exp->expType)
8557 {
8558 exp->expType = op1->type;
8559 if(op1->type)
8560 op1->type->refCount++;
8561 }
8562 return 0x1;
8563 }
8564
8565 static unsigned int UShortGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8566 {
8567 unsigned short value2 = op2->us;
8568
8569 exp->type = 2;
8570 exp->string = PrintUShort(op1->us > value2);
8571 if(!exp->expType)
8572 {
8573 exp->expType = op1->type;
8574 if(op1->type)
8575 op1->type->refCount++;
8576 }
8577 return 0x1;
8578 }
8579
8580 static unsigned int CharGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8581 {
8582 char value2 = op2->c;
8583
8584 exp->type = 2;
8585 exp->string = PrintChar(op1->c > value2);
8586 if(!exp->expType)
8587 {
8588 exp->expType = op1->type;
8589 if(op1->type)
8590 op1->type->refCount++;
8591 }
8592 return 0x1;
8593 }
8594
8595 static unsigned int UCharGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8596 {
8597 unsigned char value2 = op2->uc;
8598
8599 exp->type = 2;
8600 exp->string = PrintUChar(op1->uc > value2);
8601 if(!exp->expType)
8602 {
8603 exp->expType = op1->type;
8604 if(op1->type)
8605 op1->type->refCount++;
8606 }
8607 return 0x1;
8608 }
8609
8610 static unsigned int FloatGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8611 {
8612 float value2 = op2->f;
8613
8614 exp->type = 2;
8615 exp->string = PrintFloat(op1->f > value2);
8616 if(!exp->expType)
8617 {
8618 exp->expType = op1->type;
8619 if(op1->type)
8620 op1->type->refCount++;
8621 }
8622 return 0x1;
8623 }
8624
8625 static unsigned int DoubleGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8626 {
8627 double value2 = op2->d;
8628
8629 exp->type = 2;
8630 exp->string = PrintDouble(op1->d > value2);
8631 if(!exp->expType)
8632 {
8633 exp->expType = op1->type;
8634 if(op1->type)
8635 op1->type->refCount++;
8636 }
8637 return 0x1;
8638 }
8639
8640 static unsigned int IntSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8641 {
8642 int value2 = op2->i;
8643
8644 exp->type = 2;
8645 exp->string = PrintInt(op1->i < value2);
8646 if(!exp->expType)
8647 {
8648 exp->expType = op1->type;
8649 if(op1->type)
8650 op1->type->refCount++;
8651 }
8652 return 0x1;
8653 }
8654
8655 static unsigned int UIntSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8656 {
8657 unsigned int value2 = op2->ui;
8658
8659 exp->type = 2;
8660 exp->string = PrintUInt(op1->ui < value2);
8661 if(!exp->expType)
8662 {
8663 exp->expType = op1->type;
8664 if(op1->type)
8665 op1->type->refCount++;
8666 }
8667 return 0x1;
8668 }
8669
8670 static unsigned int ShortSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8671 {
8672 short value2 = op2->s;
8673
8674 exp->type = 2;
8675 exp->string = PrintShort(op1->s < value2);
8676 if(!exp->expType)
8677 {
8678 exp->expType = op1->type;
8679 if(op1->type)
8680 op1->type->refCount++;
8681 }
8682 return 0x1;
8683 }
8684
8685 static unsigned int UShortSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8686 {
8687 unsigned short value2 = op2->us;
8688
8689 exp->type = 2;
8690 exp->string = PrintUShort(op1->us < value2);
8691 if(!exp->expType)
8692 {
8693 exp->expType = op1->type;
8694 if(op1->type)
8695 op1->type->refCount++;
8696 }
8697 return 0x1;
8698 }
8699
8700 static unsigned int CharSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8701 {
8702 char value2 = op2->c;
8703
8704 exp->type = 2;
8705 exp->string = PrintChar(op1->c < value2);
8706 if(!exp->expType)
8707 {
8708 exp->expType = op1->type;
8709 if(op1->type)
8710 op1->type->refCount++;
8711 }
8712 return 0x1;
8713 }
8714
8715 static unsigned int UCharSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8716 {
8717 unsigned char value2 = op2->uc;
8718
8719 exp->type = 2;
8720 exp->string = PrintUChar(op1->uc < value2);
8721 if(!exp->expType)
8722 {
8723 exp->expType = op1->type;
8724 if(op1->type)
8725 op1->type->refCount++;
8726 }
8727 return 0x1;
8728 }
8729
8730 static unsigned int FloatSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8731 {
8732 float value2 = op2->f;
8733
8734 exp->type = 2;
8735 exp->string = PrintFloat(op1->f < value2);
8736 if(!exp->expType)
8737 {
8738 exp->expType = op1->type;
8739 if(op1->type)
8740 op1->type->refCount++;
8741 }
8742 return 0x1;
8743 }
8744
8745 static unsigned int DoubleSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8746 {
8747 double value2 = op2->d;
8748
8749 exp->type = 2;
8750 exp->string = PrintDouble(op1->d < value2);
8751 if(!exp->expType)
8752 {
8753 exp->expType = op1->type;
8754 if(op1->type)
8755 op1->type->refCount++;
8756 }
8757 return 0x1;
8758 }
8759
8760 static unsigned int IntGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8761 {
8762 int value2 = op2->i;
8763
8764 exp->type = 2;
8765 exp->string = PrintInt(op1->i >= value2);
8766 if(!exp->expType)
8767 {
8768 exp->expType = op1->type;
8769 if(op1->type)
8770 op1->type->refCount++;
8771 }
8772 return 0x1;
8773 }
8774
8775 static unsigned int UIntGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8776 {
8777 unsigned int value2 = op2->ui;
8778
8779 exp->type = 2;
8780 exp->string = PrintUInt(op1->ui >= value2);
8781 if(!exp->expType)
8782 {
8783 exp->expType = op1->type;
8784 if(op1->type)
8785 op1->type->refCount++;
8786 }
8787 return 0x1;
8788 }
8789
8790 static unsigned int ShortGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8791 {
8792 short value2 = op2->s;
8793
8794 exp->type = 2;
8795 exp->string = PrintShort(op1->s >= value2);
8796 if(!exp->expType)
8797 {
8798 exp->expType = op1->type;
8799 if(op1->type)
8800 op1->type->refCount++;
8801 }
8802 return 0x1;
8803 }
8804
8805 static unsigned int UShortGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8806 {
8807 unsigned short value2 = op2->us;
8808
8809 exp->type = 2;
8810 exp->string = PrintUShort(op1->us >= value2);
8811 if(!exp->expType)
8812 {
8813 exp->expType = op1->type;
8814 if(op1->type)
8815 op1->type->refCount++;
8816 }
8817 return 0x1;
8818 }
8819
8820 static unsigned int CharGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8821 {
8822 char value2 = op2->c;
8823
8824 exp->type = 2;
8825 exp->string = PrintChar(op1->c >= value2);
8826 if(!exp->expType)
8827 {
8828 exp->expType = op1->type;
8829 if(op1->type)
8830 op1->type->refCount++;
8831 }
8832 return 0x1;
8833 }
8834
8835 static unsigned int UCharGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8836 {
8837 unsigned char value2 = op2->uc;
8838
8839 exp->type = 2;
8840 exp->string = PrintUChar(op1->uc >= value2);
8841 if(!exp->expType)
8842 {
8843 exp->expType = op1->type;
8844 if(op1->type)
8845 op1->type->refCount++;
8846 }
8847 return 0x1;
8848 }
8849
8850 static unsigned int FloatGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8851 {
8852 float value2 = op2->f;
8853
8854 exp->type = 2;
8855 exp->string = PrintFloat(op1->f >= value2);
8856 if(!exp->expType)
8857 {
8858 exp->expType = op1->type;
8859 if(op1->type)
8860 op1->type->refCount++;
8861 }
8862 return 0x1;
8863 }
8864
8865 static unsigned int DoubleGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8866 {
8867 double value2 = op2->d;
8868
8869 exp->type = 2;
8870 exp->string = PrintDouble(op1->d >= value2);
8871 if(!exp->expType)
8872 {
8873 exp->expType = op1->type;
8874 if(op1->type)
8875 op1->type->refCount++;
8876 }
8877 return 0x1;
8878 }
8879
8880 static unsigned int IntSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8881 {
8882 int value2 = op2->i;
8883
8884 exp->type = 2;
8885 exp->string = PrintInt(op1->i <= value2);
8886 if(!exp->expType)
8887 {
8888 exp->expType = op1->type;
8889 if(op1->type)
8890 op1->type->refCount++;
8891 }
8892 return 0x1;
8893 }
8894
8895 static unsigned int UIntSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8896 {
8897 unsigned int value2 = op2->ui;
8898
8899 exp->type = 2;
8900 exp->string = PrintUInt(op1->ui <= value2);
8901 if(!exp->expType)
8902 {
8903 exp->expType = op1->type;
8904 if(op1->type)
8905 op1->type->refCount++;
8906 }
8907 return 0x1;
8908 }
8909
8910 static unsigned int ShortSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8911 {
8912 short value2 = op2->s;
8913
8914 exp->type = 2;
8915 exp->string = PrintShort(op1->s <= value2);
8916 if(!exp->expType)
8917 {
8918 exp->expType = op1->type;
8919 if(op1->type)
8920 op1->type->refCount++;
8921 }
8922 return 0x1;
8923 }
8924
8925 static unsigned int UShortSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8926 {
8927 unsigned short value2 = op2->us;
8928
8929 exp->type = 2;
8930 exp->string = PrintUShort(op1->us <= value2);
8931 if(!exp->expType)
8932 {
8933 exp->expType = op1->type;
8934 if(op1->type)
8935 op1->type->refCount++;
8936 }
8937 return 0x1;
8938 }
8939
8940 static unsigned int CharSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8941 {
8942 char value2 = op2->c;
8943
8944 exp->type = 2;
8945 exp->string = PrintChar(op1->c <= value2);
8946 if(!exp->expType)
8947 {
8948 exp->expType = op1->type;
8949 if(op1->type)
8950 op1->type->refCount++;
8951 }
8952 return 0x1;
8953 }
8954
8955 static unsigned int UCharSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8956 {
8957 unsigned char value2 = op2->uc;
8958
8959 exp->type = 2;
8960 exp->string = PrintUChar(op1->uc <= value2);
8961 if(!exp->expType)
8962 {
8963 exp->expType = op1->type;
8964 if(op1->type)
8965 op1->type->refCount++;
8966 }
8967 return 0x1;
8968 }
8969
8970 static unsigned int FloatSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8971 {
8972 float value2 = op2->f;
8973
8974 exp->type = 2;
8975 exp->string = PrintFloat(op1->f <= value2);
8976 if(!exp->expType)
8977 {
8978 exp->expType = op1->type;
8979 if(op1->type)
8980 op1->type->refCount++;
8981 }
8982 return 0x1;
8983 }
8984
8985 static unsigned int DoubleSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8986 {
8987 double value2 = op2->d;
8988
8989 exp->type = 2;
8990 exp->string = PrintDouble(op1->d <= value2);
8991 if(!exp->expType)
8992 {
8993 exp->expType = op1->type;
8994 if(op1->type)
8995 op1->type->refCount++;
8996 }
8997 return 0x1;
8998 }
8999
9000 static unsigned int IntCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
9001 {
9002 exp->type = 2;
9003 exp->string = PrintInt(op1->i ? op2->i : op3->i);
9004 if(!exp->expType)
9005 {
9006 exp->expType = op1->type;
9007 if(op1->type)
9008 op1->type->refCount++;
9009 }
9010 return 0x1;
9011 }
9012
9013 static unsigned int UIntCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
9014 {
9015 exp->type = 2;
9016 exp->string = PrintUInt(op1->ui ? op2->ui : op3->ui);
9017 if(!exp->expType)
9018 {
9019 exp->expType = op1->type;
9020 if(op1->type)
9021 op1->type->refCount++;
9022 }
9023 return 0x1;
9024 }
9025
9026 static unsigned int ShortCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
9027 {
9028 exp->type = 2;
9029 exp->string = PrintShort(op1->s ? op2->s : op3->s);
9030 if(!exp->expType)
9031 {
9032 exp->expType = op1->type;
9033 if(op1->type)
9034 op1->type->refCount++;
9035 }
9036 return 0x1;
9037 }
9038
9039 static unsigned int UShortCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
9040 {
9041 exp->type = 2;
9042 exp->string = PrintUShort(op1->us ? op2->us : op3->us);
9043 if(!exp->expType)
9044 {
9045 exp->expType = op1->type;
9046 if(op1->type)
9047 op1->type->refCount++;
9048 }
9049 return 0x1;
9050 }
9051
9052 static unsigned int CharCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
9053 {
9054 exp->type = 2;
9055 exp->string = PrintChar(op1->c ? op2->c : op3->c);
9056 if(!exp->expType)
9057 {
9058 exp->expType = op1->type;
9059 if(op1->type)
9060 op1->type->refCount++;
9061 }
9062 return 0x1;
9063 }
9064
9065 static unsigned int UCharCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
9066 {
9067 exp->type = 2;
9068 exp->string = PrintUChar(op1->uc ? op2->uc : op3->uc);
9069 if(!exp->expType)
9070 {
9071 exp->expType = op1->type;
9072 if(op1->type)
9073 op1->type->refCount++;
9074 }
9075 return 0x1;
9076 }
9077
9078 static unsigned int FloatCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
9079 {
9080 exp->type = 2;
9081 exp->string = PrintFloat(op1->f ? op2->f : op3->f);
9082 if(!exp->expType)
9083 {
9084 exp->expType = op1->type;
9085 if(op1->type)
9086 op1->type->refCount++;
9087 }
9088 return 0x1;
9089 }
9090
9091 static unsigned int DoubleCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
9092 {
9093 exp->type = 2;
9094 exp->string = PrintDouble(op1->d ? op2->d : op3->d);
9095 if(!exp->expType)
9096 {
9097 exp->expType = op1->type;
9098 if(op1->type)
9099 op1->type->refCount++;
9100 }
9101 return 0x1;
9102 }
9103
9104 struct OpTable intOps = 
9105 {
9106 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
9107 };
9108
9109 struct OpTable uintOps = 
9110 {
9111 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
9112 };
9113
9114 struct OpTable shortOps = 
9115 {
9116 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
9117 };
9118
9119 struct OpTable ushortOps = 
9120 {
9121 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
9122 };
9123
9124 struct OpTable floatOps = 
9125 {
9126 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
9127 };
9128
9129 struct OpTable doubleOps = 
9130 {
9131 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
9132 };
9133
9134 struct OpTable charOps = 
9135 {
9136 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
9137 };
9138
9139 struct OpTable ucharOps = 
9140 {
9141 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
9142 };
9143
9144 void ReadString(char * output, char * string)
9145 {
9146 int len = strlen(string);
9147 int c, d = 0;
9148 unsigned int quoted = 0x0, escaped = 0x0;
9149
9150 for(c = 0; c < len; c++)
9151 {
9152 char ch = string[c];
9153
9154 if(escaped)
9155 {
9156 switch(ch)
9157 {
9158 case 'n':
9159 output[d] = '\n';
9160 break;
9161 case 't':
9162 output[d] = '\t';
9163 break;
9164 case 'a':
9165 output[d] = '\a';
9166 break;
9167 case 'b':
9168 output[d] = '\b';
9169 break;
9170 case 'f':
9171 output[d] = '\f';
9172 break;
9173 case 'r':
9174 output[d] = '\r';
9175 break;
9176 case 'v':
9177 output[d] = '\v';
9178 break;
9179 case '\\':
9180 output[d] = '\\';
9181 break;
9182 case '\"':
9183 output[d] = '\"';
9184 break;
9185 default:
9186 output[d++] = '\\';
9187 output[d] = ch;
9188 }
9189 d++;
9190 escaped = 0x0;
9191 }
9192 else
9193 {
9194 if(ch == '\"')
9195 quoted ^= 0x1;
9196 else if(quoted)
9197 {
9198 if(ch == '\\')
9199 escaped = 0x1;
9200 else
9201 output[d++] = ch;
9202 }
9203 }
9204 }
9205 output[d] = '\0';
9206 }
9207
9208 extern long long __ecereNameSpace__ecere__com___strtoi64(char *  string, char * *  endString, int base);
9209
9210 extern uint64 __ecereNameSpace__ecere__com___strtoui64(char *  string, char * *  endString, int base);
9211
9212 extern double strtod(char * , char * * );
9213
9214 struct Operand GetOperand(struct Expression * exp)
9215 {
9216 struct Operand op = 
9217 {
9218 0, 0, 0, 0, 
9219 {
9220 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
9221 }
9222 };
9223 struct Type * type = exp->expType;
9224
9225 if(type)
9226 {
9227 while(type->kind == 8 && type->_class->registered && (type->_class->registered->type == 2 || type->_class->registered->type == 3 || type->_class->registered->type == 4))
9228 {
9229 if(!type->_class->registered->dataType)
9230 type->_class->registered->dataType = ProcessTypeString(type->_class->registered->dataTypeString, 0x0);
9231 type = type->_class->registered->dataType;
9232 }
9233 op.kind = type->kind;
9234 op.type = exp->expType;
9235 if(exp->isConstant && exp->type == 2)
9236 {
9237 switch(op.kind)
9238 {
9239 case 1:
9240 {
9241 if(exp->constant[0] == '\'')
9242 op.c = exp->constant[1];
9243 else if(type->isSigned)
9244 {
9245 op.c = (char)strtol(exp->constant, (((void *)0)), 0);
9246 op.ops = charOps;
9247 }
9248 else
9249 {
9250 op.uc = (unsigned char)strtoul(exp->constant, (((void *)0)), 0);
9251 op.ops = ucharOps;
9252 }
9253 break;
9254 }
9255 case 2:
9256 if(type->isSigned)
9257 {
9258 op.s = (short)strtol(exp->constant, (((void *)0)), 0);
9259 op.ops = shortOps;
9260 }
9261 else
9262 {
9263 op.us = (unsigned short)strtoul(exp->constant, (((void *)0)), 0);
9264 op.ops = ushortOps;
9265 }
9266 break;
9267 case 3:
9268 case 5:
9269 if(type->isSigned)
9270 {
9271 op.i = strtol(exp->constant, (((void *)0)), 0);
9272 op.ops = intOps;
9273 }
9274 else
9275 {
9276 op.ui = strtoul(exp->constant, (((void *)0)), 0);
9277 op.ops = uintOps;
9278 }
9279 op.kind = 3;
9280 break;
9281 case 4:
9282 if(type->isSigned)
9283 {
9284 op.i64 = __ecereNameSpace__ecere__com___strtoi64(exp->constant, (((void *)0)), 0);
9285 op.ops = intOps;
9286 }
9287 else
9288 {
9289 op.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->constant, (((void *)0)), 0);
9290 op.ops = uintOps;
9291 }
9292 op.kind = 3;
9293 break;
9294 case 22:
9295 if(type->isSigned)
9296 {
9297 op.i64 = __ecereNameSpace__ecere__com___strtoi64(exp->constant, (((void *)0)), 0);
9298 op.ops = intOps;
9299 }
9300 else
9301 {
9302 op.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->constant, (((void *)0)), 0);
9303 op.ops = uintOps;
9304 }
9305 op.kind = 3;
9306 break;
9307 case 6:
9308 op.f = (float)strtod(exp->constant, (((void *)0)));
9309 op.ops = floatOps;
9310 break;
9311 case 7:
9312 op.d = (double)strtod(exp->constant, (((void *)0)));
9313 op.ops = doubleOps;
9314 break;
9315 case 12:
9316 case 13:
9317 case 8:
9318 op.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->constant, (((void *)0)), 0);
9319 op.kind = 13;
9320 op.ops = uintOps;
9321 break;
9322 }
9323 }
9324 }
9325 return op;
9326 }
9327
9328 int __ecereVMethodID_class_OnGetString;
9329
9330 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_int;
9331
9332 static void UnusedFunction()
9333 {
9334 int a;
9335
9336 ((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);
9337 }
9338
9339 extern int __ecereVMethodID_class_OnGetString;
9340
9341 static void PopulateInstanceProcessMember(struct Instantiation * inst, struct __ecereNameSpace__ecere__sys__OldList * memberList, struct __ecereNameSpace__ecere__com__DataMember * parentDataMember, unsigned int offset)
9342 {
9343 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
9344
9345 for(dataMember = parentDataMember->members.first; dataMember; dataMember = dataMember->next)
9346 {
9347 if(!dataMember->name && (dataMember->type == 2 || dataMember->type == 1))
9348 PopulateInstanceProcessMember(inst, memberList, dataMember, offset + dataMember->offset);
9349 else
9350 {
9351 struct Expression * exp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
9352 struct MemberInit * member = MkMemberInit(MkListOne(MkIdentifier(dataMember->name)), MkInitializerAssignment(exp));
9353 struct Type * type;
9354 void * ptr = inst->data + dataMember->offset + offset;
9355 char * result = (((void *)0));
9356
9357 exp->loc = member->loc = inst->loc;
9358 ((struct Identifier *)(*member->identifiers).first)->loc = inst->loc;
9359 if(!dataMember->dataType)
9360 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
9361 type = dataMember->dataType;
9362 if(type->kind == 8)
9363 {
9364 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
9365
9366 if(_class->type == 4)
9367 {
9368 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
9369
9370 if(enumClass)
9371 {
9372 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
9373 struct __ecereNameSpace__ecere__sys__NamedLink * item;
9374
9375 for(item = e->values.first; item; item = item->next)
9376 {
9377 if((int)item->data == *(int *)ptr)
9378 {
9379 result = item->name;
9380 break;
9381 }
9382 }
9383 if(result)
9384 {
9385 exp->identifier = MkIdentifier(result);
9386 exp->type = 0;
9387 exp->destType = MkClassType(_class->fullName);
9388 ProcessExpressionType(exp);
9389 }
9390 }
9391 }
9392 if(_class->type == 4 || _class->type == 3 || _class->type == 2)
9393 {
9394 if(!_class->dataType)
9395 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
9396 type = _class->dataType;
9397 }
9398 }
9399 if(!result)
9400 {
9401 switch(type->kind)
9402 {
9403 case 6:
9404 {
9405 FreeExpContents(exp);
9406 exp->constant = PrintFloat(*(float *)ptr);
9407 exp->type = 2;
9408 break;
9409 }
9410 case 7:
9411 {
9412 FreeExpContents(exp);
9413 exp->constant = PrintDouble(*(double *)ptr);
9414 exp->type = 2;
9415 break;
9416 }
9417 case 3:
9418 {
9419 FreeExpContents(exp);
9420 exp->constant = PrintInt(*(int *)ptr);
9421 exp->type = 2;
9422 break;
9423 }
9424 case 4:
9425 {
9426 FreeExpContents(exp);
9427 exp->constant = PrintInt64(*(long long *)ptr);
9428 exp->type = 2;
9429 break;
9430 }
9431 case 22:
9432 {
9433 FreeExpContents(exp);
9434 exp->constant = PrintInt64((long long)*(intptr_t *)ptr);
9435 exp->type = 2;
9436 break;
9437 }
9438 default:
9439 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Unhandled type populating instance\n", (((void *)0))));
9440 }
9441 }
9442 ListAdd(memberList, member);
9443 }
9444 if(parentDataMember->type == 1)
9445 break;
9446 }
9447 }
9448
9449 extern struct MembersInit * MkMembersInitList(struct __ecereNameSpace__ecere__sys__OldList * dataMembers);
9450
9451 void PopulateInstance(struct Instantiation * inst)
9452 {
9453 struct Symbol * classSym = inst->_class->symbol;
9454 struct __ecereNameSpace__ecere__com__Class * _class = classSym->registered;
9455 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
9456 struct __ecereNameSpace__ecere__sys__OldList * memberList = MkList();
9457
9458 inst->members = MkListOne(MkMembersInitList(memberList));
9459 for(dataMember = _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
9460 {
9461 if(!dataMember->isProperty)
9462 {
9463 if(!dataMember->name && (dataMember->type == 2 || dataMember->type == 1))
9464 PopulateInstanceProcessMember(inst, memberList, dataMember, dataMember->offset);
9465 else
9466 {
9467 struct Expression * exp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
9468 struct MemberInit * member = MkMemberInit(MkListOne(MkIdentifier(dataMember->name)), MkInitializerAssignment(exp));
9469 struct Type * type;
9470 void * ptr = inst->data + dataMember->offset;
9471 char * result = (((void *)0));
9472
9473 exp->loc = member->loc = inst->loc;
9474 ((struct Identifier *)(*member->identifiers).first)->loc = inst->loc;
9475 if(!dataMember->dataType)
9476 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
9477 type = dataMember->dataType;
9478 if(type->kind == 8)
9479 {
9480 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
9481
9482 if(_class->type == 4)
9483 {
9484 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
9485
9486 if(enumClass)
9487 {
9488 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
9489 struct __ecereNameSpace__ecere__sys__NamedLink * item;
9490
9491 for(item = e->values.first; item; item = item->next)
9492 {
9493 if((int)item->data == *(int *)ptr)
9494 {
9495 result = item->name;
9496 break;
9497 }
9498 }
9499 }
9500 if(result)
9501 {
9502 exp->identifier = MkIdentifier(result);
9503 exp->type = 0;
9504 exp->destType = MkClassType(_class->fullName);
9505 ProcessExpressionType(exp);
9506 }
9507 }
9508 if(_class->type == 4 || _class->type == 3 || _class->type == 2)
9509 {
9510 if(!_class->dataType)
9511 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
9512 type = _class->dataType;
9513 }
9514 }
9515 if(!result)
9516 {
9517 switch(type->kind)
9518 {
9519 case 6:
9520 {
9521 exp->constant = PrintFloat(*(float *)ptr);
9522 exp->type = 2;
9523 break;
9524 }
9525 case 7:
9526 {
9527 exp->constant = PrintDouble(*(double *)ptr);
9528 exp->type = 2;
9529 break;
9530 }
9531 case 3:
9532 {
9533 exp->constant = PrintInt(*(int *)ptr);
9534 exp->type = 2;
9535 break;
9536 }
9537 case 4:
9538 {
9539 exp->constant = PrintInt64(*(long long *)ptr);
9540 exp->type = 2;
9541 break;
9542 }
9543 case 22:
9544 {
9545 exp->constant = PrintInt64((long long)*(intptr_t *)ptr);
9546 exp->type = 2;
9547 break;
9548 }
9549 default:
9550 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Unhandled type populating instance\n", (((void *)0))));
9551 }
9552 }
9553 ListAdd(memberList, member);
9554 }
9555 }
9556 }
9557 }
9558
9559 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);
9560
9561 extern void FreeInstance(struct Instantiation * inst);
9562
9563 void ComputeInstantiation(struct Expression * exp)
9564 {
9565 struct Instantiation * inst = exp->instance;
9566 struct MembersInit * members;
9567 struct Symbol * classSym = inst->_class ? inst->_class->symbol : (((void *)0));
9568 struct __ecereNameSpace__ecere__com__Class * _class = classSym ? classSym->registered : (((void *)0));
9569 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
9570 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
9571 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
9572 int subMemberStackPos = 0;
9573 uint64 bits = 0;
9574
9575 if(_class && (_class->type == 1 || _class->type == 0 || _class->type == 5))
9576 {
9577 if(inst->data)
9578 return ;
9579 if(_class->type == 0 || _class->type == 5)
9580 inst->data = (unsigned char *)__ecereNameSpace__ecere__com__eInstance_New(_class);
9581 else
9582 inst->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
9583 }
9584 if(inst->members)
9585 {
9586 for(members = (*inst->members).first; members; members = members->next)
9587 {
9588 switch(members->type)
9589 {
9590 case 0:
9591 {
9592 if(members->dataMembers)
9593 {
9594 struct MemberInit * member;
9595
9596 for(member = (*members->dataMembers).first; member; member = member->next)
9597 {
9598 struct Identifier * ident = member->identifiers ? (*member->identifiers).first : (((void *)0));
9599 unsigned int found = 0x0;
9600 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
9601 struct __ecereNameSpace__ecere__com__DataMember * dataMember = (((void *)0));
9602 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
9603 unsigned int dataMemberOffset;
9604
9605 if(!ident)
9606 {
9607 __ecereNameSpace__ecere__com__eClass_FindNextMember(_class, &curClass, &curMember, subMemberStack, &subMemberStackPos);
9608 if(curMember)
9609 {
9610 if(curMember->isProperty)
9611 prop = (struct __ecereNameSpace__ecere__com__Property *)curMember;
9612 else
9613 {
9614 dataMember = curMember;
9615 __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(_class, dataMember->name, &dataMemberOffset, privateModule, (((void *)0)), (((void *)0)));
9616 }
9617 found = 0x1;
9618 }
9619 }
9620 else
9621 {
9622 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, ident->string, privateModule);
9623 if(prop)
9624 {
9625 found = 0x1;
9626 if(prop->memberAccess == 1)
9627 {
9628 curMember = (struct __ecereNameSpace__ecere__com__DataMember *)prop;
9629 curClass = prop->_class;
9630 }
9631 }
9632 else
9633 {
9634 struct __ecereNameSpace__ecere__com__DataMember * _subMemberStack[256];
9635 int _subMemberStackPos = 0;
9636
9637 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(_class, ident->string, &dataMemberOffset, privateModule, _subMemberStack, &_subMemberStackPos);
9638 if(dataMember)
9639 {
9640 found = 0x1;
9641 if(dataMember->memberAccess == 1)
9642 {
9643 curMember = dataMember;
9644 curClass = dataMember->_class;
9645 memcpy(subMemberStack, _subMemberStack, sizeof(int) * _subMemberStackPos);
9646 subMemberStackPos = _subMemberStackPos;
9647 }
9648 }
9649 }
9650 }
9651 if(found && member->initializer && member->initializer->type == 0)
9652 {
9653 struct Expression * value = member->initializer->exp;
9654 struct Type * type = (((void *)0));
9655
9656 if(prop)
9657 {
9658 type = prop->dataType;
9659 }
9660 else if(dataMember)
9661 {
9662 if(!dataMember->dataType)
9663 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
9664 type = dataMember->dataType;
9665 }
9666 if(ident && ident->next)
9667 {
9668 for(ident = ident->next; ident && type; ident = ident->next)
9669 {
9670 if(type->kind == 8)
9671 {
9672 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(type->_class->registered, ident->string, privateModule);
9673 if(prop)
9674 type = prop->dataType;
9675 else
9676 {
9677 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(type->_class->registered, ident->string, &dataMemberOffset, privateModule, (((void *)0)), (((void *)0)));
9678 if(dataMember)
9679 type = dataMember->dataType;
9680 }
9681 }
9682 else if(type->kind == 9 || type->kind == 10)
9683 {
9684 struct Type * memberType;
9685
9686 for(memberType = type->members.first; memberType; memberType = memberType->next)
9687 {
9688 if(!strcmp(memberType->name, ident->string))
9689 {
9690 type = memberType;
9691 break;
9692 }
9693 }
9694 }
9695 }
9696 }
9697 if(value)
9698 {
9699 FreeType(value->destType);
9700 value->destType = type;
9701 if(type)
9702 type->refCount++;
9703 ComputeExpression(value);
9704 }
9705 if(value && (_class->type == 1 || _class->type == 0 || _class->type == 5))
9706 {
9707 if(type->kind == 8)
9708 {
9709 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
9710
9711 if(_class->type == 2 || _class->type == 3 || _class->type == 4)
9712 {
9713 if(!_class->dataType)
9714 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
9715 type = _class->dataType;
9716 }
9717 }
9718 if(dataMember)
9719 {
9720 void * ptr = inst->data + dataMemberOffset;
9721
9722 if(value->type == 2)
9723 {
9724 switch(type->kind)
9725 {
9726 case 3:
9727 {
9728 GetInt(value, (int *)ptr);
9729 break;
9730 }
9731 case 4:
9732 {
9733 GetInt64(value, (long long *)ptr);
9734 break;
9735 }
9736 case 22:
9737 {
9738 GetIntPtr(value, (intptr_t *)ptr);
9739 break;
9740 }
9741 case 6:
9742 {
9743 GetFloat(value, (float *)ptr);
9744 break;
9745 }
9746 case 7:
9747 {
9748 GetDouble(value, (double *)ptr);
9749 break;
9750 }
9751 }
9752 }
9753 else if(value->type == 1)
9754 {
9755 if(type->kind == 8)
9756 {
9757 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
9758
9759 if(_class->type == 1)
9760 {
9761 ComputeTypeSize(type);
9762 if(value->instance->data)
9763 memcpy(ptr, value->instance->data, type->size);
9764 }
9765 }
9766 }
9767 }
9768 else if(prop)
9769 {
9770 if(value->type == 1 && value->instance->data)
9771 {
9772 void (* Set)(void *, void *) = (void *)prop->Set;
9773
9774 Set(inst->data, value->instance->data);
9775 PopulateInstance(inst);
9776 }
9777 else if(value->type == 2)
9778 {
9779 switch(type->kind)
9780 {
9781 case 7:
9782 {
9783 void (* Set)(void *, double) = (void *)prop->Set;
9784
9785 Set(inst->data, strtod(value->constant, (((void *)0))));
9786 break;
9787 }
9788 case 6:
9789 {
9790 void (* Set)(void *, float) = (void *)prop->Set;
9791
9792 Set(inst->data, (float)(strtod(value->constant, (((void *)0)))));
9793 break;
9794 }
9795 case 3:
9796 {
9797 void (* Set)(void *, int) = (void *)prop->Set;
9798
9799 Set(inst->data, strtol(value->constant, (((void *)0)), 0));
9800 break;
9801 }
9802 case 4:
9803 {
9804 void (* Set)(void *, long long) = (void *)prop->Set;
9805
9806 Set(inst->data, __ecereNameSpace__ecere__com___strtoi64(value->constant, (((void *)0)), 0));
9807 break;
9808 }
9809 case 22:
9810 {
9811 void (* Set)(void *, intptr_t) = (void *)prop->Set;
9812
9813 Set(inst->data, (intptr_t)__ecereNameSpace__ecere__com___strtoi64(value->constant, (((void *)0)), 0));
9814 break;
9815 }
9816 }
9817 }
9818 else if(value->type == 3)
9819 {
9820 char temp[1024];
9821
9822 ReadString(temp, value->string);
9823 ((void (*)(void *, void *))(void *)prop->Set)(inst->data, temp);
9824 }
9825 }
9826 }
9827 else if(_class->type == 3)
9828 {
9829 if(prop)
9830 {
9831 if(value->type == 2)
9832 {
9833 if(type->kind == 8)
9834 {
9835 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
9836
9837 if(_class->type == 3)
9838 {
9839 if(!_class->dataType)
9840 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
9841 type = _class->dataType;
9842 }
9843 }
9844 switch(type->kind)
9845 {
9846 case 6:
9847 {
9848 float fValue;
9849 float (* Set)(float) = (void *)prop->Set;
9850
9851 GetFloat(member->initializer->exp, &fValue);
9852 exp->constant = PrintFloat(Set(fValue));
9853 exp->type = 2;
9854 break;
9855 }
9856 case 7:
9857 {
9858 double dValue;
9859 double (* Set)(double) = (void *)prop->Set;
9860
9861 GetDouble(member->initializer->exp, &dValue);
9862 exp->constant = PrintDouble(Set(dValue));
9863 exp->type = 2;
9864 break;
9865 }
9866 }
9867 }
9868 }
9869 }
9870 else if(_class->type == 2)
9871 {
9872 if(prop)
9873 {
9874 if(value->type == 1 && value->instance->data)
9875 {
9876 unsigned int (* Set)(void *) = (void *)prop->Set;
9877
9878 bits = Set(value->instance->data);
9879 }
9880 else if(value->type == 2)
9881 {
9882 }
9883 }
9884 else if(dataMember)
9885 {
9886 struct __ecereNameSpace__ecere__com__BitMember * bitMember = (struct __ecereNameSpace__ecere__com__BitMember *)dataMember;
9887 struct Type * type;
9888 int part = 0;
9889
9890 GetInt(value, &part);
9891 bits = (bits & ~bitMember->mask);
9892 if(!bitMember->dataType)
9893 bitMember->dataType = ProcessTypeString(bitMember->dataTypeString, 0x0);
9894 type = bitMember->dataType;
9895 if(type->kind == 8 && type->_class && type->_class->registered)
9896 {
9897 if(!type->_class->registered->dataType)
9898 type->_class->registered->dataType = ProcessTypeString(type->_class->registered->dataTypeString, 0x0);
9899 type = type->_class->registered->dataType;
9900 }
9901 switch(type->kind)
9902 {
9903 case 1:
9904 if(type->isSigned)
9905 bits |= ((char)part << bitMember->pos);
9906 else
9907 bits |= ((unsigned char)part << bitMember->pos);
9908 break;
9909 case 2:
9910 if(type->isSigned)
9911 bits |= ((short)part << bitMember->pos);
9912 else
9913 bits |= ((unsigned short)part << bitMember->pos);
9914 break;
9915 case 3:
9916 case 5:
9917 if(type->isSigned)
9918 bits |= (part << bitMember->pos);
9919 else
9920 bits |= ((unsigned int)part << bitMember->pos);
9921 break;
9922 case 4:
9923 if(type->isSigned)
9924 bits |= ((long long)part << bitMember->pos);
9925 else
9926 bits |= ((uint64)part << bitMember->pos);
9927 break;
9928 case 22:
9929 if(type->isSigned)
9930 bits |= ((intptr_t)part << bitMember->pos);
9931 else
9932 bits |= ((uintptr_t)part << bitMember->pos);
9933 break;
9934 }
9935 }
9936 }
9937 }
9938 else
9939 {
9940 if(_class && _class->type == 3)
9941 {
9942 ComputeExpression(member->initializer->exp);
9943 exp->constant = member->initializer->exp->constant;
9944 exp->type = 2;
9945 member->initializer->exp->constant = (((void *)0));
9946 }
9947 }
9948 }
9949 }
9950 break;
9951 }
9952 }
9953 }
9954 }
9955 if(_class && _class->type == 2)
9956 {
9957 exp->constant = PrintHexUInt(bits);
9958 exp->type = 2;
9959 }
9960 if(exp->type != 1)
9961 {
9962 FreeInstance(inst);
9963 }
9964 }
9965
9966 void CallOperator(struct Expression * exp, struct Expression * exp1, struct Expression * exp2, struct Operand * op1, struct Operand * op2)
9967 {
9968 if(exp->op.op == SIZEOF)
9969 {
9970 FreeExpContents(exp);
9971 exp->type = 2;
9972 exp->constant = PrintUInt(ComputeTypeSize(op1->type));
9973 }
9974 else
9975 {
9976 if(!exp->op.exp1)
9977 {
9978 switch(exp->op.op)
9979 {
9980 case '+':
9981 {
9982 struct Expression * exp2 = exp->op.exp2;
9983
9984 exp->op.exp2 = (((void *)0));
9985 FreeExpContents(exp);
9986 FreeType(exp->expType);
9987 FreeType(exp->destType);
9988 *exp = *exp2;
9989 ((exp2 ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(exp2) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(exp2)) : 0), exp2 = 0);
9990 break;
9991 }
9992 case '-':
9993 if(op1->ops.Neg)
9994 {
9995 FreeExpContents(exp);
9996 op1->ops.Neg(exp, op1);
9997 }
9998 break;
9999 case '~':
10000 if(op1->ops.BitNot)
10001 {
10002 FreeExpContents(exp);
10003 op1->ops.BitNot(exp, op1);
10004 }
10005 break;
10006 case '!':
10007 if(op1->ops.Not)
10008 {
10009 FreeExpContents(exp);
10010 op1->ops.Not(exp, op1);
10011 }
10012 break;
10013 }
10014 }
10015 else
10016 {
10017 switch(exp->op.op)
10018 {
10019 case '+':
10020 if(op1->ops.Add)
10021 {
10022 FreeExpContents(exp);
10023 op1->ops.Add(exp, op1, op2);
10024 }
10025 break;
10026 case '-':
10027 if(op1->ops.Sub)
10028 {
10029 FreeExpContents(exp);
10030 op1->ops.Sub(exp, op1, op2);
10031 }
10032 break;
10033 case '*':
10034 if(op1->ops.Mul)
10035 {
10036 FreeExpContents(exp);
10037 op1->ops.Mul(exp, op1, op2);
10038 }
10039 break;
10040 case '/':
10041 if(op1->ops.Div)
10042 {
10043 FreeExpContents(exp);
10044 op1->ops.Div(exp, op1, op2);
10045 }
10046 break;
10047 case '%':
10048 if(op1->ops.Mod)
10049 {
10050 FreeExpContents(exp);
10051 op1->ops.Mod(exp, op1, op2);
10052 }
10053 break;
10054 case '&':
10055 if(exp->op.exp2)
10056 {
10057 if(op1->ops.BitAnd)
10058 {
10059 FreeExpContents(exp);
10060 op1->ops.BitAnd(exp, op1, op2);
10061 }
10062 }
10063 break;
10064 case '|':
10065 if(op1->ops.BitOr)
10066 {
10067 FreeExpContents(exp);
10068 op1->ops.BitOr(exp, op1, op2);
10069 }
10070 break;
10071 case '^':
10072 if(op1->ops.BitXor)
10073 {
10074 FreeExpContents(exp);
10075 op1->ops.BitXor(exp, op1, op2);
10076 }
10077 break;
10078 case LEFT_OP:
10079 if(op1->ops.LShift)
10080 {
10081 FreeExpContents(exp);
10082 op1->ops.LShift(exp, op1, op2);
10083 }
10084 break;
10085 case RIGHT_OP:
10086 if(op1->ops.RShift)
10087 {
10088 FreeExpContents(exp);
10089 op1->ops.RShift(exp, op1, op2);
10090 }
10091 break;
10092 case EQ_OP:
10093 if(op1->ops.Equ)
10094 {
10095 FreeExpContents(exp);
10096 op1->ops.Equ(exp, op1, op2);
10097 }
10098 break;
10099 case NE_OP:
10100 if(op1->ops.Nqu)
10101 {
10102 FreeExpContents(exp);
10103 op1->ops.Nqu(exp, op1, op2);
10104 }
10105 break;
10106 case AND_OP:
10107 if(op1->ops.And)
10108 {
10109 FreeExpContents(exp);
10110 op1->ops.And(exp, op1, op2);
10111 }
10112 break;
10113 case OR_OP:
10114 if(op1->ops.Or)
10115 {
10116 FreeExpContents(exp);
10117 op1->ops.Or(exp, op1, op2);
10118 }
10119 break;
10120 case '>':
10121 if(op1->ops.Grt)
10122 {
10123 FreeExpContents(exp);
10124 op1->ops.Grt(exp, op1, op2);
10125 }
10126 break;
10127 case '<':
10128 if(op1->ops.Sma)
10129 {
10130 FreeExpContents(exp);
10131 op1->ops.Sma(exp, op1, op2);
10132 }
10133 break;
10134 case GE_OP:
10135 if(op1->ops.GrtEqu)
10136 {
10137 FreeExpContents(exp);
10138 op1->ops.GrtEqu(exp, op1, op2);
10139 }
10140 break;
10141 case LE_OP:
10142 if(op1->ops.SmaEqu)
10143 {
10144 FreeExpContents(exp);
10145 op1->ops.SmaEqu(exp, op1, op2);
10146 }
10147 break;
10148 }
10149 }
10150 }
10151 }
10152
10153 extern struct Expression * MkExpIdentifier(struct Identifier * id);
10154
10155 void ComputeExpression(struct Expression * exp)
10156 {
10157 char expString[10240];
10158
10159 expString[0] = '\0';
10160 switch(exp->type)
10161 {
10162 case 1:
10163 {
10164 ComputeInstantiation(exp);
10165 break;
10166 }
10167 case 4:
10168 {
10169 struct Expression * exp1, * exp2 = (((void *)0));
10170 struct Operand op1 = 
10171 {
10172 0, 0, 0, 0, 
10173 {
10174 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
10175 }
10176 };
10177 struct Operand op2 = 
10178 {
10179 0, 0, 0, 0, 
10180 {
10181 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
10182 }
10183 };
10184
10185 if(exp->op.exp2)
10186 ComputeExpression(exp->op.exp2);
10187 if(exp->op.exp1)
10188 {
10189 ComputeExpression(exp->op.exp1);
10190 exp1 = exp->op.exp1;
10191 exp2 = exp->op.exp2;
10192 op1 = GetOperand(exp1);
10193 if(op1.type)
10194 op1.type->refCount++;
10195 if(exp2)
10196 {
10197 op2 = GetOperand(exp2);
10198 if(op2.type)
10199 op2.type->refCount++;
10200 }
10201 }
10202 else
10203 {
10204 exp1 = exp->op.exp2;
10205 op1 = GetOperand(exp1);
10206 if(op1.type)
10207 op1.type->refCount++;
10208 }
10209 CallOperator(exp, exp1, exp2, &op1, &op2);
10210 if(op1.type)
10211 FreeType(op1.type);
10212 if(op2.type)
10213 FreeType(op2.type);
10214 break;
10215 }
10216 case 5:
10217 case 34:
10218 {
10219 struct Expression * e, * n;
10220
10221 for(e = (*exp->list).first; e; e = n)
10222 {
10223 n = e->next;
10224 if(!n)
10225 {
10226 struct __ecereNameSpace__ecere__sys__OldList * list = exp->list;
10227
10228 ComputeExpression(e);
10229 FreeType(exp->expType);
10230 FreeType(exp->destType);
10231 *exp = *e;
10232 ((e ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(e) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(e)) : 0), e = 0);
10233 (__ecereNameSpace__ecere__com__eSystem_Delete(list), list = 0);
10234 }
10235 else
10236 {
10237 FreeExpression(e);
10238 }
10239 }
10240 break;
10241 }
10242 case 8:
10243 {
10244 struct Expression * memberExp = exp->member.exp;
10245 struct Identifier * memberID = exp->member.member;
10246 struct Type * type;
10247
10248 ComputeExpression(exp->member.exp);
10249 type = exp->member.exp->expType;
10250 if(type)
10251 {
10252 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)));
10253 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
10254 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
10255 struct __ecereNameSpace__ecere__com__Class * convertTo = (((void *)0));
10256
10257 if(type->kind == 19 && exp->member.exp->type == 26)
10258 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "ecere::com::Class");
10259 if(!_class)
10260 {
10261 char string[256];
10262 struct Symbol * classSym;
10263
10264 string[0] = '\0';
10265 PrintType(type, string, 0x0, 0x1);
10266 classSym = FindClass(string);
10267 _class = classSym ? classSym->registered : (((void *)0));
10268 }
10269 if(exp->member.member)
10270 {
10271 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, exp->member.member->string, privateModule);
10272 if(!prop)
10273 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, exp->member.member->string, privateModule, (((void *)0)), (((void *)0)));
10274 }
10275 if(!prop && !member && _class && exp->member.member)
10276 {
10277 struct Symbol * classSym = FindClass(exp->member.member->string);
10278
10279 convertTo = _class;
10280 _class = classSym ? classSym->registered : (((void *)0));
10281 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, convertTo->fullName, privateModule);
10282 }
10283 if(prop)
10284 {
10285 if(prop->compiled)
10286 {
10287 struct Type * type = prop->dataType;
10288
10289 if(_class->type == 3)
10290 {
10291 if(type->kind == 8)
10292 {
10293 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
10294
10295 if(_class->type == 3)
10296 {
10297 if(!_class->dataType)
10298 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
10299 type = _class->dataType;
10300 }
10301 }
10302 switch(type->kind)
10303 {
10304 case 6:
10305 {
10306 float value;
10307 float (* Get)(float) = (void *)prop->Get;
10308
10309 GetFloat(exp->member.exp, &value);
10310 exp->constant = PrintFloat(Get ? Get(value) : value);
10311 exp->type = 2;
10312 break;
10313 }
10314 case 7:
10315 {
10316 double value;
10317 double (* Get)(double);
10318
10319 GetDouble(exp->member.exp, &value);
10320 if(convertTo)
10321 Get = (void *)prop->Set;
10322 else
10323 Get = (void *)prop->Get;
10324 exp->constant = PrintDouble(Get ? Get(value) : value);
10325 exp->type = 2;
10326 break;
10327 }
10328 }
10329 }
10330 else
10331 {
10332 if(convertTo)
10333 {
10334 struct Expression * value = exp->member.exp;
10335 struct Type * type;
10336
10337 if(!prop->dataType)
10338 ProcessPropertyType(prop);
10339 type = prop->dataType;
10340 if(!type)
10341 {
10342 }
10343 else if(_class->type == 1)
10344 {
10345 switch(type->kind)
10346 {
10347 case 8:
10348 {
10349 struct __ecereNameSpace__ecere__com__Class * propertyClass = type->_class->registered;
10350
10351 if(propertyClass->type == 1 && value->type == 1)
10352 {
10353 void (* Set)(void *, void *) = (void *)prop->Set;
10354
10355 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10356 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10357 exp->instance->_class = MkSpecifierName(_class->fullName);
10358 exp->instance->loc = exp->loc;
10359 exp->type = 1;
10360 Set(exp->instance->data, value->instance->data);
10361 PopulateInstance(exp->instance);
10362 }
10363 break;
10364 }
10365 case 3:
10366 {
10367 int intValue;
10368 void (* Set)(void *, int) = (void *)prop->Set;
10369
10370 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10371 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10372 exp->instance->_class = MkSpecifierName(_class->fullName);
10373 exp->instance->loc = exp->loc;
10374 exp->type = 1;
10375 GetInt(value, &intValue);
10376 Set(exp->instance->data, intValue);
10377 PopulateInstance(exp->instance);
10378 break;
10379 }
10380 case 4:
10381 {
10382 long long intValue;
10383 void (* Set)(void *, long long) = (void *)prop->Set;
10384
10385 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10386 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10387 exp->instance->_class = MkSpecifierName(_class->fullName);
10388 exp->instance->loc = exp->loc;
10389 exp->type = 1;
10390 GetInt64(value, &intValue);
10391 Set(exp->instance->data, intValue);
10392 PopulateInstance(exp->instance);
10393 break;
10394 }
10395 case 22:
10396 {
10397 intptr_t intValue;
10398 void (* Set)(void *, intptr_t) = (void *)prop->Set;
10399
10400 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10401 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10402 exp->instance->_class = MkSpecifierName(_class->fullName);
10403 exp->instance->loc = exp->loc;
10404 exp->type = 1;
10405 GetIntPtr(value, &intValue);
10406 Set(exp->instance->data, intValue);
10407 PopulateInstance(exp->instance);
10408 break;
10409 }
10410 case 7:
10411 {
10412 double doubleValue;
10413 void (* Set)(void *, double) = (void *)prop->Set;
10414
10415 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10416 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10417 exp->instance->_class = MkSpecifierName(_class->fullName);
10418 exp->instance->loc = exp->loc;
10419 exp->type = 1;
10420 GetDouble(value, &doubleValue);
10421 Set(exp->instance->data, doubleValue);
10422 PopulateInstance(exp->instance);
10423 break;
10424 }
10425 }
10426 }
10427 else if(_class->type == 2)
10428 {
10429 switch(type->kind)
10430 {
10431 case 8:
10432 {
10433 struct __ecereNameSpace__ecere__com__Class * propertyClass = type->_class->registered;
10434
10435 if(propertyClass->type == 1 && value->instance->data)
10436 {
10437 unsigned int (* Set)(void *) = (void *)prop->Set;
10438 unsigned int bits = Set(value->instance->data);
10439
10440 exp->constant = PrintHexUInt(bits);
10441 exp->type = 2;
10442 break;
10443 }
10444 else if(_class->type == 2)
10445 {
10446 unsigned int value;
10447 unsigned int (* Set)(unsigned int) = (void *)prop->Set;
10448 unsigned int bits;
10449
10450 GetUInt(exp->member.exp, &value);
10451 bits = Set(value);
10452 exp->constant = PrintHexUInt(bits);
10453 exp->type = 2;
10454 }
10455 }
10456 }
10457 }
10458 }
10459 else
10460 {
10461 if(_class->type == 2)
10462 {
10463 unsigned int value;
10464
10465 GetUInt(exp->member.exp, &value);
10466 switch(type->kind)
10467 {
10468 case 8:
10469 {
10470 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
10471
10472 if(_class->type == 1)
10473 {
10474 void (* Get)(unsigned int, void *) = (void *)prop->Get;
10475
10476 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10477 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10478 exp->instance->_class = MkSpecifierName(_class->fullName);
10479 exp->instance->loc = exp->loc;
10480 exp->type = 1;
10481 Get(value, exp->instance->data);
10482 PopulateInstance(exp->instance);
10483 }
10484 else if(_class->type == 2)
10485 {
10486 unsigned int (* Get)(unsigned int) = (void *)prop->Get;
10487 uint64 bits = Get(value);
10488
10489 exp->constant = PrintHexUInt64(bits);
10490 exp->type = 2;
10491 }
10492 break;
10493 }
10494 }
10495 }
10496 else if(_class->type == 1)
10497 {
10498 char * value = (exp->member.exp->type == 1) ? exp->member.exp->instance->data : (((void *)0));
10499
10500 switch(type->kind)
10501 {
10502 case 8:
10503 {
10504 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
10505
10506 if(_class->type == 1 && value)
10507 {
10508 void (* Get)(void *, void *) = (void *)prop->Get;
10509
10510 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10511 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10512 exp->instance->_class = MkSpecifierName(_class->fullName);
10513 exp->instance->loc = exp->loc;
10514 exp->type = 1;
10515 Get(value, exp->instance->data);
10516 PopulateInstance(exp->instance);
10517 }
10518 break;
10519 }
10520 }
10521 }
10522 }
10523 }
10524 }
10525 else
10526 {
10527 exp->isConstant = 0x0;
10528 }
10529 }
10530 else if(member)
10531 {
10532 }
10533 }
10534 if(exp->type != 8)
10535 {
10536 FreeExpression(memberExp);
10537 FreeIdentifier(memberID);
10538 }
10539 break;
10540 }
10541 case 10:
10542 {
10543 struct Type * type = ProcessType(exp->typeName->qualifiers, exp->typeName->declarator);
10544
10545 FreeExpContents(exp);
10546 exp->constant = PrintUInt(ComputeTypeSize(type));
10547 exp->type = 2;
10548 FreeType(type);
10549 break;
10550 }
10551 case 15:
10552 {
10553 struct Symbol * classSym = exp->_class->symbol;
10554
10555 if(classSym && classSym->registered)
10556 {
10557 if(classSym->registered->fixed)
10558 {
10559 FreeSpecifier(exp->_class);
10560 exp->constant = PrintUInt(classSym->registered->templateClass ? classSym->registered->templateClass->structSize : classSym->registered->structSize);
10561 exp->type = 2;
10562 }
10563 else
10564 {
10565 char className[1024];
10566
10567 strcpy(className, "__ecereClass_");
10568 FullClassNameCat(className, classSym->string, 0x1);
10569 MangleClassName(className);
10570 FreeExpContents(exp);
10571 exp->type = 9;
10572 exp->member.exp = MkExpIdentifier(MkIdentifier(className));
10573 exp->member.member = MkIdentifier("structSize");
10574 }
10575 }
10576 break;
10577 }
10578 case 11:
10579 {
10580 struct Type * type;
10581 struct Expression * e = exp;
10582
10583 if(exp->type == 11)
10584 {
10585 if(exp->cast.exp)
10586 ComputeExpression(exp->cast.exp);
10587 e = exp->cast.exp;
10588 }
10589 if(e && exp->expType)
10590 {
10591 type = exp->expType;
10592 if(type->kind == 8)
10593 {
10594 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
10595
10596 if(_class && (_class->type == 3 || _class->type == 2))
10597 {
10598 if(!_class->dataType)
10599 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
10600 type = _class->dataType;
10601 }
10602 }
10603 switch(type->kind)
10604 {
10605 case 1:
10606 if(type->isSigned)
10607 {
10608 char value;
10609
10610 GetChar(e, &value);
10611 FreeExpContents(exp);
10612 exp->constant = PrintChar(value);
10613 exp->type = 2;
10614 }
10615 else
10616 {
10617 unsigned char value;
10618
10619 GetUChar(e, &value);
10620 FreeExpContents(exp);
10621 exp->constant = PrintUChar(value);
10622 exp->type = 2;
10623 }
10624 break;
10625 case 2:
10626 if(type->isSigned)
10627 {
10628 short value;
10629
10630 GetShort(e, &value);
10631 FreeExpContents(exp);
10632 exp->constant = PrintShort(value);
10633 exp->type = 2;
10634 }
10635 else
10636 {
10637 unsigned short value;
10638
10639 GetUShort(e, &value);
10640 FreeExpContents(exp);
10641 exp->constant = PrintUShort(value);
10642 exp->type = 2;
10643 }
10644 break;
10645 case 3:
10646 if(type->isSigned)
10647 {
10648 int value;
10649
10650 GetInt(e, &value);
10651 FreeExpContents(exp);
10652 exp->constant = PrintInt(value);
10653 exp->type = 2;
10654 }
10655 else
10656 {
10657 unsigned int value;
10658
10659 GetUInt(e, &value);
10660 FreeExpContents(exp);
10661 exp->constant = PrintUInt(value);
10662 exp->type = 2;
10663 }
10664 break;
10665 case 4:
10666 if(type->isSigned)
10667 {
10668 long long value;
10669
10670 GetInt64(e, &value);
10671 FreeExpContents(exp);
10672 exp->constant = PrintInt64(value);
10673 exp->type = 2;
10674 }
10675 else
10676 {
10677 uint64 value;
10678
10679 GetUInt64(e, &value);
10680 FreeExpContents(exp);
10681 exp->constant = PrintUInt64(value);
10682 exp->type = 2;
10683 }
10684 break;
10685 case 22:
10686 if(type->isSigned)
10687 {
10688 intptr_t value;
10689
10690 GetIntPtr(e, &value);
10691 FreeExpContents(exp);
10692 exp->constant = PrintInt64((long long)value);
10693 exp->type = 2;
10694 }
10695 else
10696 {
10697 uintptr_t value;
10698
10699 GetUIntPtr(e, &value);
10700 FreeExpContents(exp);
10701 exp->constant = PrintUInt64((uint64)value);
10702 exp->type = 2;
10703 }
10704 break;
10705 case 6:
10706 {
10707 float value;
10708
10709 GetFloat(e, &value);
10710 FreeExpContents(exp);
10711 exp->constant = PrintFloat(value);
10712 exp->type = 2;
10713 break;
10714 }
10715 case 7:
10716 {
10717 double value;
10718
10719 GetDouble(e, &value);
10720 FreeExpContents(exp);
10721 exp->constant = PrintDouble(value);
10722 exp->type = 2;
10723 break;
10724 }
10725 }
10726 }
10727 break;
10728 }
10729 case 12:
10730 {
10731 struct Operand op1 = 
10732 {
10733 0, 0, 0, 0, 
10734 {
10735 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
10736 }
10737 };
10738 struct Operand op2 = 
10739 {
10740 0, 0, 0, 0, 
10741 {
10742 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
10743 }
10744 };
10745 struct Operand op3 = 
10746 {
10747 0, 0, 0, 0, 
10748 {
10749 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
10750 }
10751 };
10752
10753 if(exp->cond.exp)
10754 ComputeExpression((*exp->cond.exp).last);
10755 if(exp->cond.elseExp)
10756 ComputeExpression(exp->cond.elseExp);
10757 if(exp->cond.cond)
10758 ComputeExpression(exp->cond.cond);
10759 op1 = GetOperand(exp->cond.cond);
10760 if(op1.type)
10761 op1.type->refCount++;
10762 op2 = GetOperand((*exp->cond.exp).last);
10763 if(op2.type)
10764 op2.type->refCount++;
10765 op3 = GetOperand(exp->cond.elseExp);
10766 if(op3.type)
10767 op3.type->refCount++;
10768 if(op1.ops.Cond)
10769 {
10770 FreeExpContents(exp);
10771 op1.ops.Cond(exp, &op1, &op2, &op3);
10772 }
10773 if(op1.type)
10774 FreeType(op1.type);
10775 if(op2.type)
10776 FreeType(op2.type);
10777 if(op3.type)
10778 FreeType(op3.type);
10779 break;
10780 }
10781 }
10782 }
10783
10784 void ApplyAnyObjectLogic(struct Expression * e);
10785
10786 extern void CopyTypeInto(struct Type * type, struct Type * src);
10787
10788 static unsigned int CheckExpressionType(struct Expression * exp, struct Type * destType, unsigned int skipUnitBla)
10789 {
10790 unsigned int result = 0x1;
10791
10792 if(destType)
10793 {
10794 struct __ecereNameSpace__ecere__sys__OldList converts = 
10795 {
10796 0, 0, 0, 0, 0
10797 };
10798 struct Conversion * convert;
10799
10800 if(destType->kind == 0)
10801 return 0x0;
10802 if(!MatchTypeExpression(exp, destType, &converts, skipUnitBla))
10803 result = 0x0;
10804 if(converts.count)
10805 {
10806 for(convert = converts.first; convert; convert = convert->next)
10807 {
10808 unsigned int empty = !(convert->isGet ? (void *)convert->convert->Get : (void *)convert->convert->Set);
10809
10810 if(!empty)
10811 {
10812 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
10813 int objectType = exp->expType ? exp->expType->classObjectType : 0;
10814
10815 *newExp = *exp;
10816 newExp->destType = (((void *)0));
10817 if(convert->isGet)
10818 {
10819 exp->type = 8;
10820 exp->addedThis = 0x1;
10821 exp->member.exp = newExp;
10822 FreeType(exp->member.exp->expType);
10823 exp->member.exp->expType = MkClassType(convert->convert->_class->fullName);
10824 exp->member.exp->expType->classObjectType = objectType;
10825 exp->member.member = MkIdentifier(convert->convert->dataTypeString);
10826 exp->member.memberType = 1;
10827 exp->expType = convert->resultType ? convert->resultType : convert->convert->dataType;
10828 exp->needCast = 0x1;
10829 if(exp->expType)
10830 exp->expType->refCount++;
10831 ApplyAnyObjectLogic(exp->member.exp);
10832 }
10833 else
10834 {
10835 {
10836 exp->type = 8;
10837 exp->addedThis = 0x1;
10838 exp->member.exp = newExp;
10839 if(newExp->expType && newExp->expType->kind == 8 && newExp->expType->_class && newExp->expType->_class->registered && newExp->expType->_class->registered->type == 5)
10840 {
10841 newExp->byReference = 0x1;
10842 }
10843 FreeType(exp->member.exp->expType);
10844 exp->member.exp->expType = (((void *)0));
10845 if(convert->convert->dataType)
10846 {
10847 exp->member.exp->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
10848 CopyTypeInto(exp->member.exp->expType, convert->convert->dataType);
10849 exp->member.exp->expType->refCount = 1;
10850 exp->member.exp->expType->classObjectType = objectType;
10851 ApplyAnyObjectLogic(exp->member.exp);
10852 }
10853 exp->member.member = MkIdentifier(convert->convert->_class->fullName);
10854 exp->member.memberType = 4;
10855 exp->expType = convert->resultType ? convert->resultType : MkClassType(convert->convert->_class->fullName);
10856 exp->needCast = 0x1;
10857 if(convert->resultType)
10858 convert->resultType->refCount++;
10859 }
10860 }
10861 }
10862 else
10863 {
10864 FreeType(exp->expType);
10865 if(convert->isGet)
10866 {
10867 exp->expType = convert->resultType ? convert->resultType : convert->convert->dataType;
10868 exp->needCast = 0x1;
10869 if(exp->expType)
10870 exp->expType->refCount++;
10871 }
10872 else
10873 {
10874 exp->expType = convert->resultType ? convert->resultType : MkClassType(convert->convert->_class->fullName);
10875 exp->needCast = 0x1;
10876 if(convert->resultType)
10877 convert->resultType->refCount++;
10878 }
10879 }
10880 }
10881 if(exp->isConstant && inCompiler)
10882 ComputeExpression(exp);
10883 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(&converts, FreeConvert);
10884 }
10885 if(!result && exp->expType && converts.count)
10886 {
10887 result = MatchTypes(exp->expType, exp->destType, (((void *)0)), (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0);
10888 }
10889 if(!result && exp->expType && exp->destType)
10890 {
10891 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))
10892 result = 0x1;
10893 }
10894 }
10895 return result;
10896 }
10897
10898 extern struct Statement * MkCompoundStmt(struct __ecereNameSpace__ecere__sys__OldList * declarations, struct __ecereNameSpace__ecere__sys__OldList * statements);
10899
10900 extern struct Statement * MkExpressionStmt(struct __ecereNameSpace__ecere__sys__OldList * expressions);
10901
10902 extern struct Expression * MkExpMember(struct Expression * expression, struct Identifier * member);
10903
10904 void CheckTemplateTypes(struct Expression * exp)
10905 {
10906 if(exp->destType && exp->destType->passAsTemplate && exp->expType && exp->expType->kind != 20 && !exp->expType->passAsTemplate)
10907 {
10908 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
10909 struct Statement * compound;
10910 struct Context * context;
10911
10912 *newExp = *exp;
10913 if(exp->destType)
10914 exp->destType->refCount++;
10915 if(exp->expType)
10916 exp->expType->refCount++;
10917 newExp->prev = (((void *)0));
10918 newExp->next = (((void *)0));
10919 switch(exp->expType->kind)
10920 {
10921 case 7:
10922 if(exp->destType->classObjectType)
10923 {
10924 if(exp->destType)
10925 exp->destType->refCount--;
10926 if(exp->expType)
10927 exp->expType->refCount--;
10928 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
10929 }
10930 else
10931 {
10932 struct __ecereNameSpace__ecere__sys__OldList * specs;
10933 struct __ecereNameSpace__ecere__sys__OldList * unionDefs = MkList();
10934 struct __ecereNameSpace__ecere__sys__OldList * statements = MkList();
10935
10936 context = PushContext();
10937 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(DOUBLE)), MkListOne(MkDeclaratorIdentifier(MkIdentifier("d"))), (((void *)0)))));
10938 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifierName("uint64")), MkListOne(MkDeclaratorIdentifier(MkIdentifier("i"))), (((void *)0)))));
10939 specs = MkListOne(MkStructOrUnion(4, (((void *)0)), unionDefs));
10940 exp->type = 25;
10941 exp->compound = MkCompoundStmt(MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internal_union")), (((void *)0)))))), statements);
10942 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("d")), '=', newExp))));
10943 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("i")))));
10944 exp->compound->compound.context = context;
10945 PopContext(context);
10946 }
10947 break;
10948 default:
10949 exp->type = 11;
10950 exp->cast.typeName = MkTypeName(MkListOne(MkSpecifierName("uint64")), (((void *)0)));
10951 exp->cast.exp = MkExpBrackets(MkListOne(newExp));
10952 break;
10953 }
10954 }
10955 else if(exp->expType && exp->expType->passAsTemplate && exp->destType && ((unsigned int)((exp->usage & 0x1) >> 0)) && exp->destType->kind != 20 && !exp->destType->passAsTemplate)
10956 {
10957 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
10958 struct Statement * compound;
10959 struct Context * context;
10960
10961 *newExp = *exp;
10962 if(exp->destType)
10963 exp->destType->refCount++;
10964 if(exp->expType)
10965 exp->expType->refCount++;
10966 newExp->prev = (((void *)0));
10967 newExp->next = (((void *)0));
10968 switch(exp->expType->kind)
10969 {
10970 case 7:
10971 if(exp->destType->classObjectType)
10972 {
10973 if(exp->destType)
10974 exp->destType->refCount--;
10975 if(exp->expType)
10976 exp->expType->refCount--;
10977 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
10978 }
10979 else
10980 {
10981 struct __ecereNameSpace__ecere__sys__OldList * specs;
10982 struct __ecereNameSpace__ecere__sys__OldList * unionDefs = MkList();
10983 struct __ecereNameSpace__ecere__sys__OldList * statements = MkList();
10984
10985 context = PushContext();
10986 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(DOUBLE)), MkListOne(MkDeclaratorIdentifier(MkIdentifier("d"))), (((void *)0)))));
10987 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifierName("uint64")), MkListOne(MkDeclaratorIdentifier(MkIdentifier("i"))), (((void *)0)))));
10988 specs = MkListOne(MkStructOrUnion(4, (((void *)0)), unionDefs));
10989 exp->type = 25;
10990 exp->compound = MkCompoundStmt(MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internal_union")), (((void *)0)))))), statements);
10991 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("i")), '=', newExp))));
10992 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("d")))));
10993 exp->compound->compound.context = context;
10994 PopContext(context);
10995 }
10996 break;
10997 case 8:
10998 {
10999 if(exp->expType->_class && exp->expType->_class->registered && exp->expType->_class->registered->type == 1)
11000 {
11001 exp->type = 5;
11002 exp->list = MkListOne(MkExpOp((((void *)0)), '*', MkExpCast(MkTypeName(MkListOne(MkSpecifierName(exp->expType->_class->string)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), newExp)));
11003 ProcessExpressionType((*exp->list).first);
11004 break;
11005 }
11006 else
11007 {
11008 exp->type = 5;
11009 exp->list = MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName(exp->expType->_class->string)), (((void *)0))), newExp));
11010 newExp->needCast = 0x1;
11011 ProcessExpressionType((*exp->list).first);
11012 break;
11013 }
11014 }
11015 default:
11016 {
11017 if(exp->expType->kind == 20)
11018 {
11019 struct Type * type = ProcessTemplateParameterType(exp->expType->templateParameter);
11020
11021 if(type)
11022 {
11023 FreeType(exp->destType);
11024 FreeType(exp->expType);
11025 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
11026 break;
11027 }
11028 }
11029 if(newExp->type == 8 && newExp->member.memberType == 3)
11030 {
11031 exp->type = 4;
11032 exp->op.op = '*';
11033 exp->op.exp1 = (((void *)0));
11034 exp->op.exp2 = MkExpCast(MkTypeName(MkListOne(MkSpecifierName("uint64")), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), MkExpBrackets(MkListOne(MkExpOp((((void *)0)), '&', newExp))));
11035 }
11036 else
11037 {
11038 char typeString[1024];
11039 struct Declarator * decl;
11040 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
11041
11042 typeString[0] = '\0';
11043 PrintType(exp->expType, typeString, 0x0, 0x0);
11044 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
11045 exp->type = 11;
11046 exp->cast.typeName = MkTypeName(specs, decl);
11047 exp->cast.exp = MkExpBrackets(MkListOne(newExp));
11048 exp->cast.exp->needCast = 0x1;
11049 }
11050 break;
11051 }
11052 }
11053 }
11054 }
11055
11056 extern int strncmp(const char * , const char * , int n);
11057
11058 struct __ecereNameSpace__ecere__sys__BTNode * __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindPrefix(struct __ecereNameSpace__ecere__sys__BinaryTree * this, char *  key);
11059
11060 static struct Symbol * ScanWithNameSpace(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, char * nameSpace, char * name)
11061 {
11062 int nsLen = strlen(nameSpace);
11063 struct Symbol * symbol;
11064
11065 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)))
11066 {
11067 char * s = symbol->string;
11068
11069 if(!strncmp(s, nameSpace, nsLen))
11070 {
11071 int c;
11072 char * namePart;
11073
11074 for(c = strlen(s) - 1; c >= 0; c--)
11075 if(s[c] == ':')
11076 break;
11077 namePart = s + c + 1;
11078 if(!strcmp(namePart, name))
11079 {
11080 return symbol;
11081 }
11082 }
11083 else
11084 break;
11085 }
11086 return (((void *)0));
11087 }
11088
11089 static struct Symbol * FindWithNameSpace(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, char * name)
11090 {
11091 int c;
11092 char nameSpace[1024];
11093 char * namePart;
11094 unsigned int gotColon = 0x0;
11095
11096 nameSpace[0] = '\0';
11097 for(c = strlen(name) - 1; c >= 0; c--)
11098 if(name[c] == ':')
11099 {
11100 gotColon = 0x1;
11101 break;
11102 }
11103 namePart = name + c + 1;
11104 while(c >= 0 && name[c] == ':')
11105 c--;
11106 if(c >= 0)
11107 {
11108 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, name);
11109
11110 if(symbol)
11111 return symbol;
11112 memcpy(nameSpace, name, c + 1);
11113 nameSpace[c + 1] = (char)0;
11114 return ScanWithNameSpace(tree, nameSpace, namePart);
11115 }
11116 else if(gotColon)
11117 {
11118 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, namePart);
11119
11120 return symbol;
11121 }
11122 else
11123 {
11124 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, namePart);
11125
11126 if(symbol)
11127 return symbol;
11128 return ScanWithNameSpace(tree, "", namePart);
11129 }
11130 return (((void *)0));
11131 }
11132
11133 static void ProcessDeclaration(struct Declaration * decl);
11134
11135 struct Symbol * FindSymbol(char * name, struct Context * startContext, struct Context * endContext, unsigned int isStruct, unsigned int globalNameSpace)
11136 {
11137 struct Context * ctx;
11138 struct Symbol * symbol = (((void *)0));
11139
11140 for(ctx = startContext; ctx && !symbol; ctx = ctx->parent)
11141 {
11142 if(ctx == globalContext && !globalNameSpace && ctx->hasNameSpace)
11143 {
11144 symbol = (((void *)0));
11145 if(thisNameSpace)
11146 {
11147 char curName[1024];
11148
11149 strcpy(curName, thisNameSpace);
11150 strcat(curName, "::");
11151 strcat(curName, name);
11152 symbol = FindWithNameSpace(isStruct ? &ctx->structSymbols : &ctx->symbols, curName);
11153 }
11154 if(!symbol)
11155 symbol = FindWithNameSpace(isStruct ? &ctx->structSymbols : &ctx->symbols, name);
11156 }
11157 else
11158 symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString((isStruct ? &ctx->structSymbols : &ctx->symbols), name);
11159 if(symbol || ctx == endContext)
11160 break;
11161 }
11162 if(inCompiler && curExternal && symbol && ctx == globalContext && curExternal->symbol && symbol->id > curExternal->symbol->idCode && symbol->pointerExternal)
11163 {
11164 if(symbol->pointerExternal->type == 0)
11165 {
11166 struct FunctionDefinition * function = symbol->pointerExternal->function;
11167 struct Context * tmpContext = curContext;
11168
11169 curContext = (((void *)0));
11170 symbol->pointerExternal = MkExternalDeclaration(MkDeclaration(CopyList(function->specifiers, CopySpecifier), MkListOne(MkInitDeclarator(CopyDeclarator(function->declarator), (((void *)0))))));
11171 curContext = tmpContext;
11172 symbol->pointerExternal->symbol = symbol;
11173 DeclareType(symbol->type, 0x1, 0x1);
11174 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, symbol->pointerExternal);
11175 symbol->id = curExternal->symbol->idCode;
11176 }
11177 else if(symbol->pointerExternal->type == 1 && curExternal->symbol->idCode < symbol->pointerExternal->symbol->id)
11178 {
11179 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
11180 symbol->id = curExternal->symbol->idCode;
11181 }
11182 }
11183 return symbol;
11184 }
11185
11186 static void GetTypeSpecs(struct Type * type, struct __ecereNameSpace__ecere__sys__OldList * specs)
11187 {
11188 if(!type->isSigned && type->kind != 22)
11189 ListAdd(specs, MkSpecifier(UNSIGNED));
11190 switch(type->kind)
11191 {
11192 case 8:
11193 {
11194 if(type->_class->registered)
11195 {
11196 if(!type->_class->registered->dataType)
11197 type->_class->registered->dataType = ProcessTypeString(type->_class->registered->dataTypeString, 0x0);
11198 GetTypeSpecs(type->_class->registered->dataType, specs);
11199 }
11200 break;
11201 }
11202 case 7:
11203 ListAdd(specs, MkSpecifier(DOUBLE));
11204 break;
11205 case 6:
11206 ListAdd(specs, MkSpecifier(FLOAT));
11207 break;
11208 case 1:
11209 ListAdd(specs, MkSpecifier(CHAR));
11210 break;
11211 case 2:
11212 ListAdd(specs, MkSpecifier(SHORT));
11213 break;
11214 case 4:
11215 ListAdd(specs, MkSpecifier(INT64));
11216 break;
11217 case 22:
11218 ListAdd(specs, MkSpecifierName(type->isSigned ? "intptr" : "uintptr"));
11219 break;
11220 case 3:
11221 default:
11222 ListAdd(specs, MkSpecifier(INT));
11223 break;
11224 }
11225 }
11226
11227 extern char *  __ecereNameSpace__ecere__sys__RSearchString(char *  buffer, char *  subStr, int maxLen, unsigned int matchCase, unsigned int matchWord);
11228
11229 static void _PrintType(struct Type * type, char * string, unsigned int printName, unsigned int printFunction, unsigned int fullName)
11230 {
11231 if(type)
11232 {
11233 switch(type->kind)
11234 {
11235 case 8:
11236 if(type->_class && type->_class->string)
11237 {
11238 if(type->classObjectType == 2)
11239 strcat(string, "typed_object");
11240 else if(fullName)
11241 strcat(string, type->_class->string);
11242 else
11243 {
11244 if(type->_class->registered)
11245 strcat(string, type->_class->registered->name);
11246 else
11247 strcat(string, type->_class->string);
11248 }
11249 }
11250 break;
11251 case 13:
11252 {
11253 {
11254 _PrintType(type->type, string, 0x0, printFunction, fullName);
11255 strcat(string, " *");
11256 }
11257 break;
11258 }
11259 case 0:
11260 strcat(string, "void");
11261 break;
11262 case 3:
11263 strcat(string, type->isSigned ? "int" : "uint");
11264 break;
11265 case 4:
11266 strcat(string, type->isSigned ? "int64" : "uint64");
11267 break;
11268 case 22:
11269 strcat(string, type->isSigned ? "intptr" : "uintptr");
11270 break;
11271 case 1:
11272 strcat(string, type->isSigned ? "char" : "byte");
11273 break;
11274 case 2:
11275 strcat(string, type->isSigned ? "short" : "uint16");
11276 break;
11277 case 6:
11278 strcat(string, "float");
11279 break;
11280 case 7:
11281 strcat(string, "double");
11282 break;
11283 case 9:
11284 if(type->enumName)
11285 {
11286 strcat(string, "struct ");
11287 strcat(string, type->enumName);
11288 }
11289 else if(type->typeName)
11290 {
11291 strcat(string, type->typeName);
11292 }
11293 else
11294 {
11295 struct Type * member;
11296
11297 strcat(string, "struct {");
11298 for(member = type->members.first; member; member = member->next)
11299 {
11300 PrintType(member, string, 0x1, fullName);
11301 strcat(string, "; ");
11302 }
11303 strcat(string, "}");
11304 }
11305 break;
11306 case 10:
11307 if(type->enumName)
11308 {
11309 strcat(string, "union ");
11310 strcat(string, type->enumName);
11311 }
11312 else if(type->typeName)
11313 {
11314 strcat(string, type->typeName);
11315 }
11316 else
11317 {
11318 strcat(string, "union ");
11319 strcat(string, "(unnamed)");
11320 }
11321 break;
11322 case 15:
11323 if(type->enumName)
11324 {
11325 strcat(string, "enum ");
11326 strcat(string, type->enumName);
11327 }
11328 else if(type->typeName)
11329 {
11330 strcat(string, type->typeName);
11331 }
11332 else
11333 strcat(string, "enum");
11334 break;
11335 case 11:
11336 {
11337 if(printFunction)
11338 {
11339 if(type->dllExport)
11340 strcat(string, "dllexport ");
11341 PrintType(type->returnType, string, 0x0, fullName);
11342 strcat(string, " ");
11343 }
11344 if(printName)
11345 {
11346 if(type->name)
11347 {
11348 if(fullName)
11349 strcat(string, type->name);
11350 else
11351 {
11352 char * name = __ecereNameSpace__ecere__sys__RSearchString(type->name, "::", strlen(type->name), 0x1, 0x0);
11353
11354 if(name)
11355 name += 2;
11356 else
11357 name = type->name;
11358 strcat(string, name);
11359 }
11360 }
11361 }
11362 if(printFunction)
11363 {
11364 struct Type * param;
11365
11366 strcat(string, "(");
11367 for(param = type->params.first; param; param = param->next)
11368 {
11369 PrintType(param, string, 0x1, fullName);
11370 if(param->next)
11371 strcat(string, ", ");
11372 }
11373 strcat(string, ")");
11374 }
11375 break;
11376 }
11377 case 12:
11378 {
11379 {
11380 char baseType[1024], size[256];
11381 struct Type * arrayType = type;
11382
11383 baseType[0] = '\0';
11384 size[0] = '\0';
11385 while(arrayType->kind == 12)
11386 {
11387 strcat(size, "[");
11388 if(arrayType->enumClass)
11389 strcat(size, arrayType->enumClass->string);
11390 else if(arrayType->arraySizeExp)
11391 PrintExpression(arrayType->arraySizeExp, size);
11392 strcat(size, "]");
11393 arrayType = arrayType->arrayType;
11394 }
11395 _PrintType(arrayType, baseType, printName, printFunction, fullName);
11396 strcat(string, baseType);
11397 strcat(string, size);
11398 }
11399 printName = 0x0;
11400 break;
11401 }
11402 case 14:
11403 strcat(string, "...");
11404 break;
11405 case 16:
11406 _PrintType(type->method->dataType, string, 0x0, printFunction, fullName);
11407 break;
11408 case 19:
11409 strcat(string, "subclass(");
11410 strcat(string, type->_class ? type->_class->string : "int");
11411 strcat(string, ")");
11412 break;
11413 case 20:
11414 strcat(string, type->templateParameter->identifier->string);
11415 break;
11416 case 21:
11417 strcat(string, "thisclass");
11418 break;
11419 case 17:
11420 strcat(string, "__builtin_va_list");
11421 break;
11422 }
11423 if(type->name && printName && type->kind != 11 && (type->kind != 13 || type->type->kind != 11))
11424 {
11425 strcat(string, " ");
11426 strcat(string, type->name);
11427 }
11428 }
11429 }
11430
11431 void PrintType(struct Type * type, char * string, unsigned int printName, unsigned int fullName)
11432 {
11433 struct Type * funcType;
11434
11435 for(funcType = type; funcType && (funcType->kind == 13 || funcType->kind == 12); funcType = funcType->type)
11436 ;
11437 if(funcType && funcType->kind == 11 && type != funcType)
11438 {
11439 char typeString[1024];
11440 struct Type * param;
11441
11442 PrintType(funcType->returnType, string, 0x0, fullName);
11443 strcat(string, "(");
11444 _PrintType(type, string, printName, 0x0, fullName);
11445 strcat(string, ")");
11446 strcat(string, "(");
11447 for(param = funcType->params.first; param; param = param->next)
11448 {
11449 PrintType(param, string, 0x1, fullName);
11450 if(param->next)
11451 strcat(string, ", ");
11452 }
11453 strcat(string, ")");
11454 }
11455 else
11456 _PrintType(type, string, printName, 0x1, fullName);
11457 if(type->bitFieldCount)
11458 {
11459 char count[100];
11460
11461 sprintf(count, ":%d", type->bitFieldCount);
11462 strcat(string, count);
11463 }
11464 }
11465
11466 static struct Type * FindMember(struct Type * type, char * string)
11467 {
11468 struct Type * memberType;
11469
11470 for(memberType = type->members.first; memberType; memberType = memberType->next)
11471 {
11472 if(!memberType->name)
11473 {
11474 struct Type * subType = FindMember(memberType, string);
11475
11476 if(subType)
11477 return subType;
11478 }
11479 else if(!strcmp(memberType->name, string))
11480 return memberType;
11481 }
11482 return (((void *)0));
11483 }
11484
11485 struct Type * FindMemberAndOffset(struct Type * type, char * string, unsigned int * offset)
11486 {
11487 struct Type * memberType;
11488
11489 for(memberType = type->members.first; memberType; memberType = memberType->next)
11490 {
11491 if(!memberType->name)
11492 {
11493 struct Type * subType = FindMember(memberType, string);
11494
11495 if(subType)
11496 {
11497 *offset += memberType->offset;
11498 return subType;
11499 }
11500 }
11501 else if(!strcmp(memberType->name, string))
11502 {
11503 *offset += memberType->offset;
11504 return memberType;
11505 }
11506 }
11507 return (((void *)0));
11508 }
11509
11510 extern struct __ecereNameSpace__ecere__com__Instance * fileInput;
11511
11512 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Write;
11513
11514 struct Expression * ParseExpressionString(char * expression)
11515 {
11516 fileInput = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
11517 ((int (*)(struct __ecereNameSpace__ecere__com__Instance *, void *  buffer, unsigned int size, unsigned int count))fileInput->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Write])(fileInput, expression, 1, strlen(expression));
11518 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))fileInput->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(fileInput, 0, 0);
11519 echoOn = 0x0;
11520 parsedExpression = (((void *)0));
11521 resetScanner();
11522 expression_yyparse();
11523 (__ecereNameSpace__ecere__com__eInstance_DecRef(fileInput), fileInput = 0);
11524 return parsedExpression;
11525 }
11526
11527 extern char *  QMkString(char *  source);
11528
11529 static unsigned int ResolveIdWithClass(struct Expression * exp, struct __ecereNameSpace__ecere__com__Class * _class, unsigned int skipIDClassCheck)
11530 {
11531 void * __ecereTemp1;
11532 struct Identifier * id = exp->identifier;
11533 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
11534 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
11535 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
11536 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
11537
11538 if(_class && _class->type == 4)
11539 {
11540 struct __ecereNameSpace__ecere__sys__NamedLink * value = (((void *)0));
11541 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
11542
11543 if(enumClass)
11544 {
11545 struct __ecereNameSpace__ecere__com__Class * baseClass;
11546
11547 for(baseClass = _class; baseClass && baseClass->type == 4; baseClass = baseClass->base)
11548 {
11549 struct __ecereNameSpace__ecere__com__EnumClassData * e = (baseClass ? ((void *)(((char *)baseClass->data) + enumClass->offsetClass)) : (((void *)0)));
11550
11551 for(value = e->values.first; value; value = value->next)
11552 {
11553 if(!strcmp(value->name, id->string))
11554 break;
11555 }
11556 if(value)
11557 {
11558 char constant[256];
11559
11560 FreeExpContents(exp);
11561 exp->type = 2;
11562 exp->isConstant = 0x1;
11563 if(!strcmp(baseClass->dataTypeString, "int"))
11564 sprintf(constant, "%d", value->data);
11565 else
11566 sprintf(constant, "0x%X", value->data);
11567 exp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
11568 exp->expType = MkClassType(baseClass->fullName);
11569 break;
11570 }
11571 }
11572 }
11573 if(value)
11574 return 0x1;
11575 }
11576 if((method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule)))
11577 {
11578 ProcessMethodType(method);
11579 exp->expType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1)->kind = 16, ((struct Type *)__ecereTemp1)->method = method, ((struct Type *)__ecereTemp1)->methodClass = (skipIDClassCheck || (id && id->_class)) ? _class : (((void *)0)), ((struct Type *)__ecereTemp1));
11580 return 0x1;
11581 }
11582 else if((prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule)))
11583 {
11584 if(!prop->dataType)
11585 ProcessPropertyType(prop);
11586 exp->expType = prop->dataType;
11587 if(prop->dataType)
11588 prop->dataType->refCount++;
11589 return 0x1;
11590 }
11591 else if((member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)))))
11592 {
11593 if(!member->dataType)
11594 member->dataType = ProcessTypeString(member->dataTypeString, 0x0);
11595 exp->expType = member->dataType;
11596 if(member->dataType)
11597 member->dataType->refCount++;
11598 return 0x1;
11599 }
11600 else if((classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(_class, id->string)))
11601 {
11602 if(!classProp->dataType)
11603 classProp->dataType = ProcessTypeString(classProp->dataTypeString, 0x0);
11604 if(classProp->constant)
11605 {
11606 FreeExpContents(exp);
11607 exp->isConstant = 0x1;
11608 if(classProp->dataType->kind == 13 && classProp->dataType->type->kind == 1)
11609 {
11610 exp->type = 3;
11611 exp->constant = QMkString((char *)classProp->Get(_class));
11612 }
11613 else
11614 {
11615 char constant[256];
11616
11617 exp->type = 2;
11618 sprintf(constant, "%d", (int)classProp->Get(_class));
11619 exp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
11620 }
11621 }
11622 else
11623 {
11624 }
11625 exp->expType = classProp->dataType;
11626 if(classProp->dataType)
11627 classProp->dataType->refCount++;
11628 return 0x1;
11629 }
11630 return 0x0;
11631 }
11632
11633 static struct GlobalData * ScanGlobalData(struct __ecereNameSpace__ecere__com__NameSpace * nameSpace, char * name)
11634 {
11635 struct __ecereNameSpace__ecere__sys__BinaryTree * tree = &nameSpace->functions;
11636 struct GlobalData * data = (struct GlobalData *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString((&*tree), name);
11637 struct __ecereNameSpace__ecere__com__NameSpace * child;
11638
11639 if(!data)
11640 {
11641 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)))
11642 {
11643 data = ScanGlobalData(child, name);
11644 if(data)
11645 break;
11646 }
11647 }
11648 return data;
11649 }
11650
11651 extern struct __ecereNameSpace__ecere__com__NameSpace *  globalData;
11652
11653 extern char *  strncpy(char * , const char * , int n);
11654
11655 static struct GlobalData * FindGlobalData(char * name)
11656 {
11657 int start = 0, c;
11658 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
11659
11660 nameSpace = globalData;
11661 for(c = 0; name[c]; c++)
11662 {
11663 if(name[c] == '.' || (name[c] == ':' && name[c + 1] == ':'))
11664 {
11665 struct __ecereNameSpace__ecere__com__NameSpace * newSpace;
11666 char * spaceName = __ecereNameSpace__ecere__com__eSystem_New(sizeof(char) * (c - start + 1));
11667
11668 strncpy(spaceName, name + start, c - start);
11669 spaceName[c - start] = '\0';
11670 newSpace = (struct __ecereNameSpace__ecere__com__NameSpace *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(&(*nameSpace).nameSpaces, spaceName);
11671 (__ecereNameSpace__ecere__com__eSystem_Delete(spaceName), spaceName = 0);
11672 if(!newSpace)
11673 return (((void *)0));
11674 nameSpace = newSpace;
11675 if(name[c] == ':')
11676 c++;
11677 start = c + 1;
11678 }
11679 }
11680 if(c - start)
11681 {
11682 return ScanGlobalData(nameSpace, name + start);
11683 }
11684 return (((void *)0));
11685 }
11686
11687 static int definedExpStackPos;
11688
11689 static void * definedExpStack[512];
11690
11691 void ReplaceExpContents(struct Expression * checkedExp, struct Expression * newExp)
11692 {
11693 struct Expression * prev = checkedExp->prev, * next = checkedExp->next;
11694
11695 FreeExpContents(checkedExp);
11696 FreeType(checkedExp->expType);
11697 FreeType(checkedExp->destType);
11698 *checkedExp = *newExp;
11699 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
11700 checkedExp->prev = prev;
11701 checkedExp->next = next;
11702 }
11703
11704 extern struct Expression * MkExpCall(struct Expression * expression, struct __ecereNameSpace__ecere__sys__OldList * arguments);
11705
11706 extern int printf(char * , ...);
11707
11708 void __ecereMethod_Expression_Clear();
11709
11710 void ApplyAnyObjectLogic(struct Expression * e)
11711 {
11712 struct Type * destType = e->destType;
11713
11714 if(destType && (destType->classObjectType == 3))
11715 {
11716 if(e && e->expType)
11717 {
11718 struct Type * type = e->expType;
11719 struct __ecereNameSpace__ecere__com__Class * _class = (((void *)0));
11720
11721 if(type->kind == 8 && type->_class && type->_class->registered)
11722 {
11723 _class = type->_class->registered;
11724 }
11725 else if(type->kind == 19)
11726 {
11727 _class = FindClass("ecere::com::Class")->registered;
11728 }
11729 else
11730 {
11731 char string[1024] = "";
11732 struct Symbol * classSym;
11733
11734 PrintType(type, string, 0x0, 0x1);
11735 classSym = FindClass(string);
11736 if(classSym)
11737 _class = classSym->registered;
11738 }
11739 if((_class && (_class->type == 4 || _class->type == 3 || _class->type == 2 || _class->type == 1000) && strcmp(_class->fullName, "class") && strcmp(_class->fullName, "ecere::com::Class")) || (!e->expType->classObjectType && (((type->kind != 13 && type->kind != 19 && (type->kind != 8 || !type->_class || !type->_class->registered || type->_class->registered->type == 1))) || destType->byReference)))
11740 {
11741 if(!_class || strcmp(_class->fullName, "char *"))
11742 {
11743 struct Expression * checkedExp = e, * newExp;
11744
11745 while(((checkedExp->type == 5 || checkedExp->type == 34 || checkedExp->type == 25) && checkedExp->list) || checkedExp->type == 11)
11746 {
11747 if(checkedExp->type == 5 || checkedExp->type == 34 || checkedExp->type == 25)
11748 {
11749 if(checkedExp->type == 25)
11750 {
11751 checkedExp = (*((struct Statement *)(*checkedExp->compound->compound.statements).last)->expressions).last;
11752 }
11753 else
11754 checkedExp = (*checkedExp->list).last;
11755 }
11756 else if(checkedExp->type == 11)
11757 checkedExp = checkedExp->cast.exp;
11758 }
11759 if(checkedExp && checkedExp->type == 4 && checkedExp->op.op == '*' && !checkedExp->op.exp1)
11760 {
11761 newExp = checkedExp->op.exp2;
11762 checkedExp->op.exp2 = (((void *)0));
11763 FreeExpContents(checkedExp);
11764 if(e->expType && e->expType->passAsTemplate)
11765 {
11766 char size[100];
11767
11768 ComputeTypeSize(e->expType);
11769 sprintf(size, "%d", e->expType->size);
11770 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))))));
11771 }
11772 ReplaceExpContents(checkedExp, newExp);
11773 e->byReference = 0x1;
11774 }
11775 else if(!e->byReference || (_class && _class->type == 5))
11776 {
11777 struct Expression * checkedExp, * newExp;
11778
11779 {
11780 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;
11781
11782 if(_class && _class->type != 5 && _class->type != 0 && _class->type != 1 && !hasAddress)
11783 {
11784 struct Context * context = PushContext();
11785 struct Declarator * decl;
11786 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
11787 char typeString[1024];
11788 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
11789
11790 typeString[0] = '\0';
11791 *newExp = *e;
11792 newExp->prev = (((void *)0));
11793 newExp->next = (((void *)0));
11794 newExp->expType = (((void *)0));
11795 PrintType(e->expType, typeString, 0x0, 0x1);
11796 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
11797 newExp->destType = ProcessType(specs, decl);
11798 curContext = context;
11799 e->type = 25;
11800 if(curCompound)
11801 {
11802 char name[100];
11803 struct __ecereNameSpace__ecere__sys__OldList * stmts = MkList();
11804
11805 sprintf(name, "__internalValue%03X", internalValueCounter++);
11806 if(!curCompound->compound.declarations)
11807 curCompound->compound.declarations = MkList();
11808 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*curCompound->compound.declarations), (((void *)0)), MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(name)), (((void *)0))))));
11809 ListAdd(stmts, MkExpressionStmt(MkListOne(MkExpOp(MkExpIdentifier(MkIdentifier(name)), '=', newExp))));
11810 ListAdd(stmts, MkExpressionStmt(MkListOne(MkExpIdentifier(MkIdentifier(name)))));
11811 e->compound = MkCompoundStmt((((void *)0)), stmts);
11812 }
11813 else
11814 printf("libec: compiler error, curCompound is null in ApplyAnyObjectLogic\n");
11815 {
11816 struct Type * type = e->destType;
11817
11818 e->destType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
11819 CopyTypeInto(e->destType, type);
11820 e->destType->refCount = 1;
11821 e->destType->classObjectType = 0;
11822 FreeType(type);
11823 }
11824 e->compound->compound.context = context;
11825 PopContext(context);
11826 curContext = context->parent;
11827 }
11828 }
11829 checkedExp = e;
11830 while(((checkedExp->type == 5 || checkedExp->type == 34 || checkedExp->type == 25) && checkedExp->list) || checkedExp->type == 11)
11831 {
11832 if(checkedExp->type == 5 || checkedExp->type == 34 || checkedExp->type == 25)
11833 {
11834 if(checkedExp->type == 25)
11835 {
11836 checkedExp = (*((struct Statement *)(*checkedExp->compound->compound.statements).last)->expressions).last;
11837 }
11838 else
11839 checkedExp = (*checkedExp->list).last;
11840 }
11841 else if(checkedExp->type == 11)
11842 checkedExp = checkedExp->cast.exp;
11843 }
11844 {
11845 struct Expression * operand = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
11846
11847 *operand = *checkedExp;
11848 checkedExp->destType = (((void *)0));
11849 checkedExp->expType = (((void *)0));
11850 __ecereMethod_Expression_Clear(checkedExp);
11851 checkedExp->type = 4;
11852 checkedExp->op.op = '&';
11853 checkedExp->op.exp1 = (((void *)0));
11854 checkedExp->op.exp2 = operand;
11855 }
11856 }
11857 }
11858 }
11859 }
11860 }
11861 {
11862 }
11863 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))))
11864 {
11865 if(e->expType->kind == 8 && e->expType->_class && e->expType->_class->registered && !strcmp(e->expType->_class->registered->name, "class"))
11866 {
11867 return ;
11868 }
11869 else
11870 {
11871 struct Expression * thisExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
11872
11873 *thisExp = *e;
11874 thisExp->prev = (((void *)0));
11875 thisExp->next = (((void *)0));
11876 __ecereMethod_Expression_Clear(e);
11877 e->type = 5;
11878 e->list = MkListOne(MkExpOp((((void *)0)), '*', MkExpBrackets(MkListOne(thisExp))));
11879 if(thisExp->expType->kind == 8 && thisExp->expType->_class && thisExp->expType->_class->registered && thisExp->expType->_class->registered->type == 5)
11880 ((struct Expression *)(*e->list).first)->byReference = 0x1;
11881 {
11882 e->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
11883 CopyTypeInto(e->expType, thisExp->expType);
11884 e->expType->byReference = 0x0;
11885 e->expType->refCount = 1;
11886 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))
11887 {
11888 e->expType->classObjectType = 0;
11889 }
11890 }
11891 }
11892 }
11893 else if(destType && e->expType && (e->expType->classObjectType == 3 || e->expType->classObjectType == 2) && !destType->classObjectType && destType->kind != 0)
11894 {
11895 if(destType->kind == 14)
11896 {
11897 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Unspecified type\n", (((void *)0))));
11898 }
11899 else if(!(destType->truth && e->expType->kind == 8 && e->expType->_class && e->expType->_class->registered && e->expType->_class->registered->type == 1))
11900 {
11901 unsigned int byReference = e->expType->byReference;
11902 struct Expression * thisExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
11903 struct Declarator * decl;
11904 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
11905 char typeString[1024];
11906 struct Type * type;
11907 int backupClassObjectType;
11908
11909 if(e->expType->kind == 8 && e->expType->_class && e->expType->_class->registered && strcmp(e->expType->_class->registered->name, "class"))
11910 type = e->expType;
11911 else
11912 type = destType;
11913 backupClassObjectType = type->classObjectType;
11914 type->classObjectType = 0;
11915 typeString[0] = '\0';
11916 PrintType(type, typeString, 0x0, 0x1);
11917 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
11918 type->classObjectType = backupClassObjectType;
11919 *thisExp = *e;
11920 thisExp->prev = (((void *)0));
11921 thisExp->next = (((void *)0));
11922 __ecereMethod_Expression_Clear(e);
11923 if((type->kind == 8 && type->_class && type->_class->registered && strcmp(type->_class->registered->fullName, "ecere::com::Instance") && (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 != 12 && type->kind != 8) || (!destType->byReference && byReference && (destType->kind != 13 || type->kind != 13)))
11924 {
11925 e->type = 4;
11926 e->op.op = '*';
11927 e->op.exp1 = (((void *)0));
11928 e->op.exp2 = MkExpCast(MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl)), thisExp);
11929 }
11930 else
11931 {
11932 e->type = 11;
11933 e->cast.typeName = MkTypeName(specs, decl);
11934 e->cast.exp = thisExp;
11935 e->byReference = 0x1;
11936 }
11937 e->expType = type;
11938 e->destType = destType;
11939 type->refCount++;
11940 destType->refCount++;
11941 }
11942 }
11943 }
11944
11945 extern char *  strstr(char * , const char * );
11946
11947 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__DefinedExpression;
11948
11949 struct __ecereNameSpace__ecere__com__DefinedExpression
11950 {
11951 struct __ecereNameSpace__ecere__com__DefinedExpression * prev;
11952 struct __ecereNameSpace__ecere__com__DefinedExpression * next;
11953 char *  name;
11954 char *  value;
11955 struct __ecereNameSpace__ecere__com__NameSpace *  nameSpace;
11956 } __attribute__ ((gcc_struct));
11957
11958 extern struct __ecereNameSpace__ecere__com__DefinedExpression * __ecereNameSpace__ecere__com__eSystem_FindDefine(struct __ecereNameSpace__ecere__com__Instance * module, char *  name);
11959
11960 extern struct __ecereNameSpace__ecere__com__GlobalFunction * __ecereNameSpace__ecere__com__eSystem_FindFunction(struct __ecereNameSpace__ecere__com__Instance * module, char *  name);
11961
11962 extern unsigned int __ecereNameSpace__ecere__sys__UTF8GetChar(char *  string, int *  numBytes);
11963
11964 extern struct Expression * GetTemplateArgExp(struct TemplateParameter * param, struct __ecereNameSpace__ecere__com__Class * curClass, unsigned int pointer);
11965
11966 extern struct Expression * MkExpCondition(struct Expression * cond, struct __ecereNameSpace__ecere__sys__OldList * expressions, struct Expression * elseExp);
11967
11968 extern struct Expression * CopyExpression(struct Expression * exp);
11969
11970 extern struct Expression * MkExpTypeSize(struct TypeName * typeName);
11971
11972 extern struct Expression * MkExpClass(struct __ecereNameSpace__ecere__sys__OldList *  specifiers, struct Declarator * decl);
11973
11974 static void ProcessStatement(struct Statement * stmt);
11975
11976 extern struct Expression * MkExpExtensionInitializer(struct TypeName * typeName, struct Initializer * initializer);
11977
11978 extern struct Initializer * MkInitializerList(struct __ecereNameSpace__ecere__sys__OldList * list);
11979
11980 extern char *  __ecereNameSpace__ecere__com__PrintString(struct __ecereNameSpace__ecere__com__Class * class, void * object, ...);
11981
11982 extern char *  sourceFile;
11983
11984 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear(struct __ecereNameSpace__ecere__sys__OldList * this);
11985
11986 void ProcessExpressionType(struct Expression * exp)
11987 {
11988 void * __ecereTemp2;
11989 void * __ecereTemp1;
11990 unsigned int unresolved = 0x0;
11991 struct Location oldyylloc = yylloc;
11992 unsigned int notByReference = 0x0;
11993
11994 if(!exp || exp->expType)
11995 return ;
11996 yylloc = exp->loc;
11997 switch(exp->type)
11998 {
11999 case 0:
12000 {
12001 struct Identifier * id = exp->identifier;
12002
12003 if(!id)
12004 return ;
12005 if(id->_class && id->_class->name)
12006 {
12007 id->classSym = id->_class->symbol;
12008 }
12009 if(strstr(id->string, "__ecereClass") == id->string)
12010 {
12011 exp->expType = ProcessTypeString("ecere::com::Class", 0x1);
12012 break;
12013 }
12014 else if(id->_class && (id->classSym || (id->_class->name && !strcmp(id->_class->name, "property"))))
12015 {
12016 ReplaceClassMembers(exp, thisClass);
12017 if(exp->type != 0)
12018 {
12019 ProcessExpressionType(exp);
12020 break;
12021 }
12022 if(id->classSym && ResolveIdWithClass(exp, id->classSym->registered, 0x0))
12023 break;
12024 }
12025 else
12026 {
12027 struct Symbol * symbol = FindSymbol(id->string, curContext, topContext, 0x0, id->_class && id->_class->name == (((void *)0)));
12028
12029 if(!symbol)
12030 {
12031 if(exp->destType && CheckExpressionType(exp, exp->destType, 0x0))
12032 break;
12033 else
12034 {
12035 if(thisClass)
12036 {
12037 ReplaceClassMembers(exp, thisClass ? thisClass : currentClass);
12038 if(exp->type != 0)
12039 {
12040 ProcessExpressionType(exp);
12041 break;
12042 }
12043 }
12044 else if(currentClass && !id->_class)
12045 {
12046 if(ResolveIdWithClass(exp, currentClass, 0x1))
12047 break;
12048 }
12049 symbol = FindSymbol(id->string, topContext->parent, globalContext, 0x0, id->_class && id->_class->name == (((void *)0)));
12050 }
12051 }
12052 if(symbol)
12053 {
12054 struct Type * type = symbol->type;
12055 struct __ecereNameSpace__ecere__com__Class * _class = (type && type->kind == 8 && type->_class) ? type->_class->registered : (((void *)0));
12056
12057 if(_class && !strcmp(id->string, "this") && !type->classObjectType)
12058 {
12059 struct Context * context = SetupTemplatesContext(_class);
12060
12061 type = ReplaceThisClassType(_class);
12062 FinishTemplatesContext(context);
12063 if(type)
12064 type->refCount = 0;
12065 }
12066 FreeSpecifier(id->_class);
12067 id->_class = (((void *)0));
12068 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
12069 id->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
12070 id->classSym = (((void *)0));
12071 exp->expType = type;
12072 if(type)
12073 type->refCount++;
12074 if(type && (type->kind == 15 || (_class && _class->type == 4)))
12075 exp->isConstant = 0x1;
12076 if(symbol->isParam || !strcmp(id->string, "this"))
12077 {
12078 if(_class && _class->type == 1)
12079 exp->byReference = 0x1;
12080 }
12081 if(symbol->isIterator)
12082 {
12083 if(symbol->isIterator == 3)
12084 {
12085 exp->type = 5;
12086 exp->list = MkListOne(MkExpOp((((void *)0)), '*', MkExpIdentifier(exp->identifier)));
12087 ((struct Expression *)(*exp->list).first)->op.exp2->expType = exp->expType;
12088 exp->expType = (((void *)0));
12089 ProcessExpressionType(exp);
12090 }
12091 else if(symbol->isIterator != 4)
12092 {
12093 exp->type = 8;
12094 exp->member.exp = MkExpIdentifier(exp->identifier);
12095 exp->member.exp->expType = exp->expType;
12096 exp->member.member = MkIdentifier("data");
12097 exp->expType = (((void *)0));
12098 ProcessExpressionType(exp);
12099 }
12100 }
12101 break;
12102 }
12103 else
12104 {
12105 struct __ecereNameSpace__ecere__com__DefinedExpression * definedExp = (((void *)0));
12106
12107 if(thisNameSpace && !(id->_class && !id->_class->name))
12108 {
12109 char name[1024];
12110
12111 strcpy(name, thisNameSpace);
12112 strcat(name, "::");
12113 strcat(name, id->string);
12114 definedExp = __ecereNameSpace__ecere__com__eSystem_FindDefine(privateModule, name);
12115 }
12116 if(!definedExp)
12117 definedExp = __ecereNameSpace__ecere__com__eSystem_FindDefine(privateModule, id->string);
12118 if(definedExp)
12119 {
12120 int c;
12121
12122 for(c = 0; c < definedExpStackPos; c++)
12123 if(definedExpStack[c] == definedExp)
12124 break;
12125 if(c == definedExpStackPos && c < sizeof definedExpStack / sizeof(void *))
12126 {
12127 struct Location backupYylloc = yylloc;
12128
12129 definedExpStack[definedExpStackPos++] = definedExp;
12130 fileInput = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
12131 ((int (*)(struct __ecereNameSpace__ecere__com__Instance *, void *  buffer, unsigned int size, unsigned int count))fileInput->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Write])(fileInput, definedExp->value, 1, strlen(definedExp->value));
12132 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))fileInput->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(fileInput, 0, 0);
12133 echoOn = 0x0;
12134 parsedExpression = (((void *)0));
12135 resetScanner();
12136 expression_yyparse();
12137 (__ecereNameSpace__ecere__com__eInstance_DecRef(fileInput), fileInput = 0);
12138 yylloc = backupYylloc;
12139 if(parsedExpression)
12140 {
12141 FreeIdentifier(id);
12142 exp->type = 5;
12143 exp->list = MkListOne(parsedExpression);
12144 parsedExpression->loc = yylloc;
12145 ProcessExpressionType(exp);
12146 definedExpStackPos--;
12147 return ;
12148 }
12149 definedExpStackPos--;
12150 }
12151 else
12152 {
12153 if(inCompiler)
12154 {
12155 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Recursion in defined expression %s\n", (((void *)0))), id->string);
12156 }
12157 }
12158 }
12159 else
12160 {
12161 struct GlobalData * data = (((void *)0));
12162
12163 if(thisNameSpace && !(id->_class && !id->_class->name))
12164 {
12165 char name[1024];
12166
12167 strcpy(name, thisNameSpace);
12168 strcat(name, "::");
12169 strcat(name, id->string);
12170 data = FindGlobalData(name);
12171 }
12172 if(!data)
12173 data = FindGlobalData(id->string);
12174 if(data)
12175 {
12176 DeclareGlobalData(data);
12177 exp->expType = data->dataType;
12178 if(data->dataType)
12179 data->dataType->refCount++;
12180 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
12181 id->string = __ecereNameSpace__ecere__sys__CopyString(data->fullName);
12182 FreeSpecifier(id->_class);
12183 id->_class = (((void *)0));
12184 break;
12185 }
12186 else
12187 {
12188 struct __ecereNameSpace__ecere__com__GlobalFunction * function = (((void *)0));
12189
12190 if(thisNameSpace && !(id->_class && !id->_class->name))
12191 {
12192 char name[1024];
12193
12194 strcpy(name, thisNameSpace);
12195 strcat(name, "::");
12196 strcat(name, id->string);
12197 function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, name);
12198 }
12199 if(!function)
12200 function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, id->string);
12201 if(function)
12202 {
12203 char name[1024];
12204
12205 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
12206 id->string = __ecereNameSpace__ecere__sys__CopyString(function->name);
12207 name[0] = (char)0;
12208 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + 12)))->importType != 1 && (!function->dataType || !function->dataType->dllExport))
12209 strcpy(name, "__ecereFunction_");
12210 FullClassNameCat(name, id->string, 0x0);
12211 if(DeclareFunction(function, name))
12212 {
12213 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
12214 id->string = __ecereNameSpace__ecere__sys__CopyString(name);
12215 }
12216 exp->expType = function->dataType;
12217 if(function->dataType)
12218 function->dataType->refCount++;
12219 FreeSpecifier(id->_class);
12220 id->_class = (((void *)0));
12221 break;
12222 }
12223 }
12224 }
12225 }
12226 }
12227 unresolved = 0x1;
12228 break;
12229 }
12230 case 1:
12231 {
12232 struct __ecereNameSpace__ecere__com__Class * _class;
12233
12234 if(!exp->instance->_class)
12235 {
12236 if(exp->destType && exp->destType->kind == 8 && exp->destType->_class)
12237 {
12238 exp->instance->_class = MkSpecifierName(exp->destType->_class->string);
12239 }
12240 }
12241 ProcessInstantiationType(exp->instance);
12242 exp->isConstant = exp->instance->isConstant;
12243 if(exp->instance->_class)
12244 {
12245 exp->expType = MkClassType(exp->instance->_class->name);
12246 }
12247 break;
12248 }
12249 case 2:
12250 {
12251 if(!exp->expType)
12252 {
12253 struct Type * type = (type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), type->refCount = 1, type->constant = 0x1, type);
12254
12255 exp->expType = type;
12256 if(exp->constant[0] == '\'')
12257 {
12258 if((int)((unsigned char *)exp->constant)[1] > 127)
12259 {
12260 int nb;
12261 unsigned int ch = __ecereNameSpace__ecere__sys__UTF8GetChar(exp->constant + 1, &nb);
12262
12263 if(nb < 2)
12264 ch = exp->constant[1];
12265 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->constant), exp->constant = 0);
12266 exp->constant = PrintUInt(ch);
12267 type->kind = 8;
12268 type->_class = FindClass("unichar");
12269 type->isSigned = 0x0;
12270 }
12271 else
12272 {
12273 type->kind = 1;
12274 type->isSigned = 0x1;
12275 }
12276 }
12277 else if(strchr(exp->constant, '.'))
12278 {
12279 char ch = exp->constant[strlen(exp->constant) - 1];
12280
12281 if(ch == 'f')
12282 type->kind = 6;
12283 else
12284 type->kind = 7;
12285 type->isSigned = 0x1;
12286 }
12287 else
12288 {
12289 if(exp->constant[0] == '0' && exp->constant[1])
12290 type->isSigned = 0x0;
12291 else if(strchr(exp->constant, 'L') || strchr(exp->constant, 'l'))
12292 type->isSigned = 0x0;
12293 else if(strtoll(exp->constant, (((void *)0)), 0) > (((int)0x7fffffff)))
12294 type->isSigned = 0x0;
12295 else
12296 type->isSigned = 0x1;
12297 type->kind = 3;
12298 }
12299 exp->isConstant = 0x1;
12300 }
12301 break;
12302 }
12303 case 3:
12304 {
12305 exp->isConstant = 0x1;
12306 exp->expType = (__ecereTemp2 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp2)->refCount = 1, ((struct Type *)__ecereTemp2)->kind = 13, ((struct Type *)__ecereTemp2)->type = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1)->kind = 1, ((struct Type *)__ecereTemp1)->constant = 0x1, ((struct Type *)__ecereTemp1)), ((struct Type *)__ecereTemp2));
12307 break;
12308 }
12309 case 13:
12310 case 28:
12311 ProcessExpressionType(exp->_new.size);
12312 exp->expType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1)->kind = 13, ((struct Type *)__ecereTemp1)->type = ProcessType(exp->_new.typeName->qualifiers, exp->_new.typeName->declarator), ((struct Type *)__ecereTemp1));
12313 DeclareType(exp->expType->type, 0x0, 0x0);
12314 break;
12315 case 14:
12316 case 29:
12317 ProcessExpressionType(exp->_renew.size);
12318 ProcessExpressionType(exp->_renew.exp);
12319 exp->expType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1)->kind = 13, ((struct Type *)__ecereTemp1)->type = ProcessType(exp->_renew.typeName->qualifiers, exp->_renew.typeName->declarator), ((struct Type *)__ecereTemp1));
12320 DeclareType(exp->expType->type, 0x0, 0x0);
12321 break;
12322 case 4:
12323 {
12324 unsigned int assign = 0x0, boolResult = 0x0, boolOps = 0x0;
12325 struct Type * type1 = (((void *)0)), * type2 = (((void *)0));
12326 unsigned int useDestType = 0x0, useSideType = 0x0;
12327 struct Location oldyylloc = yylloc;
12328 unsigned int useSideUnit = 0x0;
12329 struct Type * dummy = (dummy = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), dummy->count = (unsigned int)1, dummy->refCount = 1, dummy);
12330
12331 switch(exp->op.op)
12332 {
12333 case '=':
12334 case MUL_ASSIGN:
12335 case DIV_ASSIGN:
12336 case MOD_ASSIGN:
12337 case ADD_ASSIGN:
12338 case SUB_ASSIGN:
12339 case LEFT_ASSIGN:
12340 case RIGHT_ASSIGN:
12341 case AND_ASSIGN:
12342 case XOR_ASSIGN:
12343 case OR_ASSIGN:
12344 assign = 0x1;
12345 break;
12346 case '!':
12347 break;
12348 case AND_OP:
12349 case OR_OP:
12350 boolOps = 0x1;
12351 boolResult = 0x1;
12352 break;
12353 case EQ_OP:
12354 case '<':
12355 case '>':
12356 case LE_OP:
12357 case GE_OP:
12358 case NE_OP:
12359 boolResult = 0x1;
12360 useSideType = 0x1;
12361 break;
12362 case '+':
12363 case '-':
12364 useSideUnit = 0x1;
12365 case '|':
12366 case '&':
12367 case '^':
12368 case '/':
12369 case '%':
12370 case '*':
12371 if(exp->op.op != '*' || exp->op.exp1)
12372 {
12373 useSideType = 0x1;
12374 useDestType = 0x1;
12375 }
12376 break;
12377 }
12378 if(exp->op.op == '&')
12379 {
12380 if(!exp->op.exp1 && exp->op.exp2 && exp->op.exp2->type == 0 && exp->op.exp2->identifier)
12381 {
12382 struct Identifier * id = exp->op.exp2->identifier;
12383 struct Symbol * symbol = FindSymbol(id->string, curContext, topContext, 0x0, id->_class && id->_class->name == (((void *)0)));
12384
12385 if(symbol && symbol->isIterator == 2)
12386 {
12387 exp->type = 8;
12388 exp->member.exp = exp->op.exp2;
12389 exp->member.member = MkIdentifier("key");
12390 exp->expType = (((void *)0));
12391 exp->op.exp2->expType = symbol->type;
12392 symbol->type->refCount++;
12393 ProcessExpressionType(exp);
12394 FreeType(dummy);
12395 break;
12396 }
12397 }
12398 }
12399 if(exp->op.exp1)
12400 {
12401 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))
12402 {
12403 if(exp->op.exp1->destType)
12404 FreeType(exp->op.exp1->destType);
12405 exp->op.exp1->destType = exp->destType;
12406 if(exp->destType)
12407 exp->destType->refCount++;
12408 }
12409 else if(!assign)
12410 {
12411 if(exp->op.exp1->destType)
12412 FreeType(exp->op.exp1->destType);
12413 exp->op.exp1->destType = dummy;
12414 dummy->refCount++;
12415 }
12416 if(exp->op.exp1->destType && exp->op.op != '=')
12417 exp->op.exp1->destType->count++;
12418 ProcessExpressionType(exp->op.exp1);
12419 if(exp->op.exp1->destType && exp->op.op != '=')
12420 exp->op.exp1->destType->count--;
12421 if(exp->op.exp1->destType == dummy)
12422 {
12423 FreeType(dummy);
12424 exp->op.exp1->destType = (((void *)0));
12425 }
12426 type1 = exp->op.exp1->expType;
12427 }
12428 if(exp->op.exp2)
12429 {
12430 char expString[10240];
12431
12432 expString[0] = '\0';
12433 if(exp->op.exp2->type == 1 && !exp->op.exp2->instance->_class)
12434 {
12435 if(exp->op.exp1)
12436 {
12437 exp->op.exp2->destType = exp->op.exp1->expType;
12438 if(exp->op.exp1->expType)
12439 exp->op.exp1->expType->refCount++;
12440 }
12441 else
12442 {
12443 exp->op.exp2->destType = exp->destType;
12444 if(exp->destType)
12445 exp->destType->refCount++;
12446 }
12447 if(type1)
12448 type1->refCount++;
12449 exp->expType = type1;
12450 }
12451 else if(assign)
12452 {
12453 if(inCompiler)
12454 PrintExpression(exp->op.exp2, expString);
12455 if(type1 && type1->kind == 13)
12456 {
12457 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)
12458 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "operator %s illegal on pointer\n", (((void *)0))), exp->op.op);
12459 else if(exp->op.op == '=')
12460 {
12461 if(exp->op.exp2->destType)
12462 FreeType(exp->op.exp2->destType);
12463 exp->op.exp2->destType = type1;
12464 if(type1)
12465 type1->refCount++;
12466 }
12467 }
12468 else
12469 {
12470 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)
12471 ;
12472 else
12473 {
12474 if(exp->op.exp2->destType)
12475 FreeType(exp->op.exp2->destType);
12476 exp->op.exp2->destType = type1;
12477 if(type1)
12478 type1->refCount++;
12479 }
12480 }
12481 if(type1)
12482 type1->refCount++;
12483 exp->expType = type1;
12484 }
12485 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)))
12486 {
12487 if(exp->op.exp2->destType)
12488 FreeType(exp->op.exp2->destType);
12489 exp->op.exp2->destType = exp->destType;
12490 if(exp->destType)
12491 exp->destType->refCount++;
12492 }
12493 else
12494 {
12495 if(exp->op.exp2->destType)
12496 FreeType(exp->op.exp2->destType);
12497 exp->op.exp2->destType = dummy;
12498 dummy->refCount++;
12499 }
12500 if(type1 && boolResult && useSideType && type1->kind == 8 && type1->_class && type1->_class->registered && (type1->_class->registered->type == 2 || type1->_class->registered->type == 4))
12501 {
12502 FreeType(exp->op.exp2->destType);
12503 exp->op.exp2->destType = type1;
12504 type1->refCount++;
12505 }
12506 if(exp->op.exp2->destType && exp->op.op != '=')
12507 exp->op.exp2->destType->count++;
12508 ProcessExpressionType(exp->op.exp2);
12509 if(exp->op.exp2->destType && exp->op.op != '=')
12510 exp->op.exp2->destType->count--;
12511 if(assign && type1 && type1->kind == 13 && exp->op.exp2->expType)
12512 {
12513 if(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)
12514 {
12515 if(exp->op.op != '=' && type1->type->kind == 0)
12516 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "void *: unknown size\n", (((void *)0))));
12517 }
12518 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)))
12519 {
12520 if(exp->op.op == ADD_ASSIGN)
12521 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "cannot add two pointers\n", (((void *)0))));
12522 }
12523 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))
12524 {
12525 if(exp->op.op == ADD_ASSIGN)
12526 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "cannot add two pointers\n", (((void *)0))));
12527 }
12528 else if(inCompiler)
12529 {
12530 char type1String[1024];
12531 char type2String[1024];
12532
12533 type1String[0] = '\0';
12534 type2String[0] = '\0';
12535 PrintType(exp->op.exp2->expType, type1String, 0x0, 0x1);
12536 PrintType(type1, type2String, 0x0, 0x1);
12537 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
12538 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible expression %s (%s); expected %s\n", (((void *)0))), expString, type1String, type2String);
12539 }
12540 }
12541 if(exp->op.exp2->destType == dummy)
12542 {
12543 FreeType(dummy);
12544 exp->op.exp2->destType = (((void *)0));
12545 }
12546 type2 = exp->op.exp2->expType;
12547 }
12548 dummy->kind = 0;
12549 if(exp->op.op == SIZEOF)
12550 {
12551 exp->expType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1)->kind = 3, ((struct Type *)__ecereTemp1));
12552 exp->isConstant = 0x1;
12553 }
12554 else if(exp->op.op == '*' && !exp->op.exp1)
12555 {
12556 exp->expType = Dereference(type2);
12557 if(type2 && type2->kind == 8)
12558 notByReference = 0x1;
12559 }
12560 else if(exp->op.op == '&' && !exp->op.exp1)
12561 exp->expType = Reference(type2);
12562 else if(!assign)
12563 {
12564 if(boolOps)
12565 {
12566 if(exp->op.exp1)
12567 {
12568 if(exp->op.exp1->destType)
12569 FreeType(exp->op.exp1->destType);
12570 exp->op.exp1->destType = MkClassType("bool");
12571 exp->op.exp1->destType->truth = 0x1;
12572 if(!exp->op.exp1->expType)
12573 ProcessExpressionType(exp->op.exp1);
12574 else
12575 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
12576 FreeType(exp->op.exp1->expType);
12577 exp->op.exp1->expType = MkClassType("bool");
12578 exp->op.exp1->expType->truth = 0x1;
12579 }
12580 if(exp->op.exp2)
12581 {
12582 if(exp->op.exp2->destType)
12583 FreeType(exp->op.exp2->destType);
12584 exp->op.exp2->destType = MkClassType("bool");
12585 exp->op.exp2->destType->truth = 0x1;
12586 if(!exp->op.exp2->expType)
12587 ProcessExpressionType(exp->op.exp2);
12588 else
12589 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
12590 FreeType(exp->op.exp2->expType);
12591 exp->op.exp2->expType = MkClassType("bool");
12592 exp->op.exp2->expType->truth = 0x1;
12593 }
12594 }
12595 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")))))
12596 {
12597 if(type1 && type2 && ((type1->kind == 8 && type1->_class && strcmp(type1->_class->string, "String")) == (type2->kind == 8 && type2->_class && strcmp(type2->_class->string, "String"))))
12598 {
12599 if(exp->op.exp2->destType)
12600 FreeType(exp->op.exp2->destType);
12601 exp->op.exp2->destType = type1;
12602 type1->refCount++;
12603 if(exp->op.exp1->destType)
12604 FreeType(exp->op.exp1->destType);
12605 exp->op.exp1->destType = type2;
12606 type2->refCount++;
12607 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)
12608 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "operating on %s and %s with an untyped result, assuming %s\n", (((void *)0))), type1->_class->string, type2->_class->string, type1->_class->string);
12609 if(type1->kind == 13 && type1->type->kind == 20 && type2->kind != 13)
12610 {
12611 struct Expression * argExp = GetTemplateArgExp(type1->type->templateParameter, thisClass, 0x1);
12612
12613 if(argExp)
12614 {
12615 struct Expression * classExp = MkExpMember(argExp, MkIdentifier("dataTypeClass"));
12616
12617 exp->op.exp1 = MkExpBrackets(MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName("byte")), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), exp->op.exp1)));
12618 ProcessExpressionType(exp->op.exp1);
12619 if(type2->kind != 13)
12620 {
12621 ProcessExpressionType(classExp);
12622 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"))))))));
12623 if(!exp->op.exp2->expType)
12624 type2 = exp->op.exp2->expType = ProcessTypeString("int", 0x0);
12625 ProcessExpressionType(exp->op.exp2);
12626 }
12627 }
12628 }
12629 if(!boolResult && ((type1->kind == 13 || type1->kind == 12 || (type1->kind == 8 && !strcmp(type1->_class->string, "String"))) && (type2->kind == 22 || type2->kind == 4 || type2->kind == 3 || type2->kind == 2 || type2->kind == 1)))
12630 {
12631 if(type1->kind != 8 && type1->type->kind == 0)
12632 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "void *: unknown size\n", (((void *)0))));
12633 exp->expType = type1;
12634 if(type1)
12635 type1->refCount++;
12636 }
12637 else if(!boolResult && ((type2->kind == 13 || type2->kind == 12 || (type2->kind == 8 && !strcmp(type2->_class->string, "String"))) && (type1->kind == 22 || type1->kind == 4 || type1->kind == 3 || type1->kind == 2 || type1->kind == 1)))
12638 {
12639 if(type2->kind != 8 && type2->type->kind == 0)
12640 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "void *: unknown size\n", (((void *)0))));
12641 exp->expType = type2;
12642 if(type2)
12643 type2->refCount++;
12644 }
12645 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))
12646 {
12647 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "different levels of indirection\n", (((void *)0))));
12648 }
12649 else
12650 {
12651 unsigned int success = 0x0;
12652
12653 if(type1->kind == 13 && type2->kind == 13)
12654 {
12655 if(exp->op.op == '+')
12656 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "cannot add two pointers\n", (((void *)0))));
12657 else if(exp->op.op == '-')
12658 {
12659 if(MatchTypes(type1->type, type2->type, (((void *)0)), (((void *)0)), (((void *)0)), 0x0, 0x0, 0x0, 0x0))
12660 {
12661 exp->expType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->kind = 3, ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1));
12662 success = 0x1;
12663 if(type1->type->kind == 20)
12664 {
12665 struct Expression * argExp = GetTemplateArgExp(type1->type->templateParameter, thisClass, 0x1);
12666
12667 if(argExp)
12668 {
12669 struct Expression * classExp = MkExpMember(argExp, MkIdentifier("dataTypeClass"));
12670
12671 ProcessExpressionType(classExp);
12672 exp->type = 5;
12673 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")))))));
12674 ProcessExpressionType(((struct Expression *)(*exp->list).first)->op.exp2);
12675 FreeType(dummy);
12676 return ;
12677 }
12678 }
12679 }
12680 }
12681 }
12682 if(!success && exp->op.exp1->type == 2)
12683 {
12684 if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
12685 {
12686 if(exp->expType)
12687 FreeType(exp->expType);
12688 exp->expType = exp->op.exp1->destType;
12689 if(exp->op.exp1->destType)
12690 exp->op.exp1->destType->refCount++;
12691 success = 0x1;
12692 }
12693 else if(CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0))
12694 {
12695 if(exp->expType)
12696 FreeType(exp->expType);
12697 exp->expType = exp->op.exp2->destType;
12698 if(exp->op.exp2->destType)
12699 exp->op.exp2->destType->refCount++;
12700 success = 0x1;
12701 }
12702 }
12703 else if(!success)
12704 {
12705 if(CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0))
12706 {
12707 if(exp->expType)
12708 FreeType(exp->expType);
12709 exp->expType = exp->op.exp2->destType;
12710 if(exp->op.exp2->destType)
12711 exp->op.exp2->destType->refCount++;
12712 success = 0x1;
12713 }
12714 else if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
12715 {
12716 if(exp->expType)
12717 FreeType(exp->expType);
12718 exp->expType = exp->op.exp1->destType;
12719 if(exp->op.exp1->destType)
12720 exp->op.exp1->destType->refCount++;
12721 success = 0x1;
12722 }
12723 }
12724 if(!success)
12725 {
12726 char expString1[10240];
12727 char expString2[10240];
12728 char type1[1024];
12729 char type2[1024];
12730
12731 expString1[0] = '\0';
12732 expString2[0] = '\0';
12733 type1[0] = '\0';
12734 type2[0] = '\0';
12735 if(inCompiler)
12736 {
12737 PrintExpression(exp->op.exp1, expString1);
12738 __ecereNameSpace__ecere__sys__ChangeCh(expString1, '\n', ' ');
12739 PrintExpression(exp->op.exp2, expString2);
12740 __ecereNameSpace__ecere__sys__ChangeCh(expString2, '\n', ' ');
12741 PrintType(exp->op.exp1->expType, type1, 0x0, 0x1);
12742 PrintType(exp->op.exp2->expType, type2, 0x0, 0x1);
12743 }
12744 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible expressions %s (%s) and %s (%s)\n", (((void *)0))), expString1, type1, expString2, type2);
12745 }
12746 }
12747 }
12748 else if(!boolResult && (!useSideUnit) && type2 && type1 && type2->kind == 8 && type1->kind != 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 3)
12749 {
12750 if(exp->op.exp1->destType)
12751 FreeType(exp->op.exp1->destType);
12752 exp->op.exp1->destType = type2->_class->registered->dataType;
12753 if(type2->_class->registered->dataType)
12754 type2->_class->registered->dataType->refCount++;
12755 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
12756 exp->expType = type2;
12757 if(type2)
12758 type2->refCount++;
12759 }
12760 else if(!boolResult && (!useSideUnit) && type1 && type2 && type1->kind == 8 && type2->kind != 8 && type1->_class && type1->_class->registered && type1->_class->registered->type == 3)
12761 {
12762 if(exp->op.exp2->destType)
12763 FreeType(exp->op.exp2->destType);
12764 exp->op.exp2->destType = type1->_class->registered->dataType;
12765 if(type1->_class->registered->dataType)
12766 type1->_class->registered->dataType->refCount++;
12767 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
12768 exp->expType = type1;
12769 if(type1)
12770 type1->refCount++;
12771 }
12772 else if(type1)
12773 {
12774 unsigned int valid = 0x0;
12775
12776 if(!boolResult && useSideUnit && type1 && type1->kind == 8 && type1->_class->registered && type1->_class->registered->type == 3 && type2 && type2->kind != 8)
12777 {
12778 if(exp->op.exp2->destType)
12779 FreeType(exp->op.exp2->destType);
12780 if(!type1->_class->registered->dataType)
12781 type1->_class->registered->dataType = ProcessTypeString(type1->_class->registered->dataTypeString, 0x0);
12782 exp->op.exp2->destType = type1->_class->registered->dataType;
12783 exp->op.exp2->destType->refCount++;
12784 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
12785 type2 = exp->op.exp2->destType;
12786 exp->expType = type2;
12787 type2->refCount++;
12788 }
12789 if(!boolResult && useSideUnit && type2 && type2->kind == 8 && type2->_class->registered && type2->_class->registered->type == 3 && type1 && type1->kind != 8)
12790 {
12791 if(exp->op.exp1->destType)
12792 FreeType(exp->op.exp1->destType);
12793 if(!type2->_class->registered->dataType)
12794 type2->_class->registered->dataType = ProcessTypeString(type2->_class->registered->dataTypeString, 0x0);
12795 exp->op.exp1->destType = type2->_class->registered->dataType;
12796 exp->op.exp1->destType->refCount++;
12797 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
12798 type1 = exp->op.exp1->destType;
12799 exp->expType = type1;
12800 type1->refCount++;
12801 }
12802 if(!boolResult || exp->op.op == '>' || exp->op.op == '<')
12803 {
12804 if(type1->kind == 8 && type1->_class && type1->_class->registered && type1->_class->registered->type == 4 && exp->op.exp2->expType)
12805 {
12806 if(CheckExpressionType(exp->op.exp1, exp->op.exp2->expType, 0x0))
12807 {
12808 if(exp->expType)
12809 FreeType(exp->expType);
12810 exp->expType = exp->op.exp1->expType;
12811 if(exp->op.exp2->expType)
12812 exp->op.exp1->expType->refCount++;
12813 valid = 0x1;
12814 }
12815 }
12816 else if(type2 && (type2->kind == 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 4 && exp->op.exp1->expType))
12817 {
12818 if(CheckExpressionType(exp->op.exp2, exp->op.exp1->expType, 0x0))
12819 {
12820 if(exp->expType)
12821 FreeType(exp->expType);
12822 exp->expType = exp->op.exp2->expType;
12823 if(exp->op.exp2->expType)
12824 exp->op.exp2->expType->refCount++;
12825 valid = 0x1;
12826 }
12827 }
12828 }
12829 if(!valid)
12830 {
12831 if(exp->op.exp2->destType)
12832 FreeType(exp->op.exp2->destType);
12833 exp->op.exp2->destType = type1;
12834 type1->refCount++;
12835 if(CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0))
12836 {
12837 if(exp->expType)
12838 FreeType(exp->expType);
12839 exp->expType = exp->op.exp2->destType;
12840 if(exp->op.exp2->destType)
12841 exp->op.exp2->destType->refCount++;
12842 }
12843 else if(type1 && type2)
12844 {
12845 char expString1[10240];
12846 char expString2[10240];
12847 char type1String[1024];
12848 char type2String[1024];
12849
12850 expString1[0] = '\0';
12851 expString2[0] = '\0';
12852 type1String[0] = '\0';
12853 type2String[0] = '\0';
12854 if(inCompiler)
12855 {
12856 PrintExpression(exp->op.exp1, expString1);
12857 __ecereNameSpace__ecere__sys__ChangeCh(expString1, '\n', ' ');
12858 PrintExpression(exp->op.exp2, expString2);
12859 __ecereNameSpace__ecere__sys__ChangeCh(expString2, '\n', ' ');
12860 PrintType(exp->op.exp1->expType, type1String, 0x0, 0x1);
12861 PrintType(exp->op.exp2->expType, type2String, 0x0, 0x1);
12862 }
12863 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible expressions %s (%s) and %s (%s)\n", (((void *)0))), expString1, type1String, expString2, type2String);
12864 if(type1->kind == 8 && type1->_class && type1->_class->registered && type1->_class->registered->type == 4)
12865 {
12866 exp->expType = exp->op.exp1->expType;
12867 if(exp->op.exp1->expType)
12868 exp->op.exp1->expType->refCount++;
12869 }
12870 else if(type2->kind == 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 4)
12871 {
12872 exp->expType = exp->op.exp2->expType;
12873 if(exp->op.exp2->expType)
12874 exp->op.exp2->expType->refCount++;
12875 }
12876 }
12877 }
12878 }
12879 else if(type2)
12880 {
12881 if(type2->kind == 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 4)
12882 {
12883 struct Type * oldType = exp->op.exp1->expType;
12884
12885 exp->op.exp1->expType = (((void *)0));
12886 if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
12887 FreeType(oldType);
12888 else
12889 exp->op.exp1->expType = oldType;
12890 }
12891 if(exp->op.exp1->destType)
12892 FreeType(exp->op.exp1->destType);
12893 exp->op.exp1->destType = type2;
12894 type2->refCount++;
12895 if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
12896 {
12897 if(exp->expType)
12898 FreeType(exp->expType);
12899 exp->expType = exp->op.exp1->destType;
12900 if(exp->op.exp1->destType)
12901 exp->op.exp1->destType->refCount++;
12902 }
12903 }
12904 }
12905 else if(type2 && (!type1 || (type2->kind == 8 && type1->kind != 8)))
12906 {
12907 if(type1 && type2->_class && type2->_class->registered && type2->_class->registered->type == 3)
12908 {
12909 if(exp->op.exp1->destType)
12910 FreeType(exp->op.exp1->destType);
12911 exp->op.exp1->destType = type2->_class->registered->dataType;
12912 if(type2->_class->registered->dataType)
12913 type2->_class->registered->dataType->refCount++;
12914 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
12915 }
12916 if(exp->op.op == '!')
12917 {
12918 exp->expType = MkClassType("bool");
12919 exp->expType->truth = 0x1;
12920 }
12921 else
12922 {
12923 exp->expType = type2;
12924 if(type2)
12925 type2->refCount++;
12926 }
12927 }
12928 else if(type1 && (!type2 || (type1->kind == 8 && type2->kind != 8)))
12929 {
12930 if(type2 && type1->_class && type1->_class->registered && type1->_class->registered->type == 3)
12931 {
12932 if(exp->op.exp2->destType)
12933 FreeType(exp->op.exp2->destType);
12934 exp->op.exp2->destType = type1->_class->registered->dataType;
12935 if(type1->_class->registered->dataType)
12936 type1->_class->registered->dataType->refCount++;
12937 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
12938 }
12939 exp->expType = type1;
12940 if(type1)
12941 type1->refCount++;
12942 }
12943 }
12944 yylloc = exp->loc;
12945 if(exp->op.exp1 && !exp->op.exp1->expType)
12946 {
12947 char expString[10000];
12948
12949 expString[0] = '\0';
12950 if(inCompiler)
12951 {
12952 PrintExpression(exp->op.exp1, expString);
12953 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
12954 }
12955 if(expString[0])
12956 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't determine type of %s\n", (((void *)0))), expString);
12957 }
12958 if(exp->op.exp2 && !exp->op.exp2->expType)
12959 {
12960 char expString[10240];
12961
12962 expString[0] = '\0';
12963 if(inCompiler)
12964 {
12965 PrintExpression(exp->op.exp2, expString);
12966 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
12967 }
12968 if(expString[0])
12969 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't determine type of %s\n", (((void *)0))), expString);
12970 }
12971 if(boolResult)
12972 {
12973 FreeType(exp->expType);
12974 exp->expType = MkClassType("bool");
12975 exp->expType->truth = 0x1;
12976 }
12977 if(exp->op.op != SIZEOF)
12978 exp->isConstant = (!exp->op.exp1 || exp->op.exp1->isConstant) && (!exp->op.exp2 || exp->op.exp2->isConstant);
12979 if(exp->op.op == SIZEOF && exp->op.exp2->expType)
12980 {
12981 DeclareType(exp->op.exp2->expType, 0x0, 0x0);
12982 }
12983 yylloc = oldyylloc;
12984 FreeType(dummy);
12985 break;
12986 }
12987 case 5:
12988 case 34:
12989 {
12990 struct Expression * e;
12991
12992 exp->isConstant = 0x1;
12993 for(e = (*exp->list).first; e; e = e->next)
12994 {
12995 unsigned int inced = 0x0;
12996
12997 if(!e->next)
12998 {
12999 FreeType(e->destType);
13000 e->destType = exp->destType;
13001 if(e->destType)
13002 {
13003 exp->destType->refCount++;
13004 e->destType->count++;
13005 inced = 0x1;
13006 }
13007 }
13008 ProcessExpressionType(e);
13009 if(inced)
13010 exp->destType->count--;
13011 if(!exp->expType && !e->next)
13012 {
13013 exp->expType = e->expType;
13014 if(e->expType)
13015 e->expType->refCount++;
13016 }
13017 if(!e->isConstant)
13018 exp->isConstant = 0x0;
13019 }
13020 e = (*exp->list).first;
13021 if(!e->next && e->type == 8)
13022 {
13023 struct Expression * next = exp->next, * prev = exp->prev;
13024
13025 FreeType(exp->expType);
13026 FreeType(exp->destType);
13027 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->list), exp->list = 0);
13028 *exp = *e;
13029 exp->prev = prev;
13030 exp->next = next;
13031 ((e ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(e) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(e)) : 0), e = 0);
13032 ProcessExpressionType(exp);
13033 }
13034 break;
13035 }
13036 case 6:
13037 {
13038 struct Expression * e;
13039
13040 exp->isConstant = 0x1;
13041 ProcessExpressionType(exp->index.exp);
13042 if(!exp->index.exp->isConstant)
13043 exp->isConstant = 0x0;
13044 if(exp->index.exp->expType)
13045 {
13046 struct Type * source = exp->index.exp->expType;
13047
13048 if(source->kind == 8 && source->_class && source->_class->registered && source->_class->registered != containerClass && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, containerClass) && source->_class->registered->templateArgs)
13049 {
13050 struct __ecereNameSpace__ecere__com__Class * _class = source->_class->registered;
13051
13052 exp->expType = ProcessTypeString(_class->templateArgs[2].dataTypeString, 0x0);
13053 if(exp->index.index && (*exp->index.index).last)
13054 {
13055 ((struct Expression *)(*exp->index.index).last)->destType = ProcessTypeString(_class->templateArgs[1].dataTypeString, 0x0);
13056 }
13057 }
13058 }
13059 for(e = (*exp->index.index).first; e; e = e->next)
13060 {
13061 if(!e->next && exp->index.exp->expType && exp->index.exp->expType->kind == 12 && exp->index.exp->expType->enumClass)
13062 {
13063 if(e->destType)
13064 FreeType(e->destType);
13065 e->destType = MkClassType(exp->index.exp->expType->enumClass->string);
13066 }
13067 ProcessExpressionType(e);
13068 if(!e->next)
13069 {
13070 }
13071 if(!e->isConstant)
13072 exp->isConstant = 0x0;
13073 }
13074 if(!exp->expType)
13075 exp->expType = Dereference(exp->index.exp->expType);
13076 if(exp->expType)
13077 DeclareType(exp->expType, 0x0, 0x0);
13078 break;
13079 }
13080 case 7:
13081 {
13082 struct Expression * e;
13083 struct Type * functionType;
13084 struct Type * methodType = (((void *)0));
13085 char name[1024];
13086
13087 name[0] = '\0';
13088 if(inCompiler)
13089 {
13090 PrintExpression(exp->call.exp, name);
13091 if(exp->call.exp->expType && !exp->call.exp->expType->returnType)
13092 {
13093 PrintExpression(exp->call.exp, name);
13094 }
13095 }
13096 if(exp->call.exp->type == 0)
13097 {
13098 struct Expression * idExp = exp->call.exp;
13099 struct Identifier * id = idExp->identifier;
13100
13101 if(!strcmp(id->string, "__builtin_frame_address"))
13102 {
13103 exp->expType = ProcessTypeString("void *", 0x1);
13104 if(exp->call.arguments && (*exp->call.arguments).first)
13105 ProcessExpressionType((*exp->call.arguments).first);
13106 break;
13107 }
13108 else if(!strcmp(id->string, "__ENDIAN_PAD"))
13109 {
13110 exp->expType = ProcessTypeString("int", 0x1);
13111 if(exp->call.arguments && (*exp->call.arguments).first)
13112 ProcessExpressionType((*exp->call.arguments).first);
13113 break;
13114 }
13115 else if(!strcmp(id->string, "Max") || !strcmp(id->string, "Min") || !strcmp(id->string, "Sgn") || !strcmp(id->string, "Abs"))
13116 {
13117 struct Expression * a = (((void *)0));
13118 struct Expression * b = (((void *)0));
13119 struct Expression * tempExp1 = (((void *)0)), * tempExp2 = (((void *)0));
13120
13121 if((!strcmp(id->string, "Max") || !strcmp(id->string, "Min")) && (*exp->call.arguments).count == 2)
13122 {
13123 a = (*exp->call.arguments).first;
13124 b = (*exp->call.arguments).last;
13125 tempExp1 = a;
13126 tempExp2 = b;
13127 }
13128 else if((*exp->call.arguments).count == 1)
13129 {
13130 a = (*exp->call.arguments).first;
13131 tempExp1 = a;
13132 }
13133 if(a)
13134 {
13135 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear((&*exp->call.arguments));
13136 idExp->identifier = (((void *)0));
13137 FreeExpContents(exp);
13138 ProcessExpressionType(a);
13139 if(b)
13140 ProcessExpressionType(b);
13141 exp->type = 5;
13142 exp->list = MkList();
13143 if(a->expType && (!b || b->expType))
13144 {
13145 if((!a->isConstant && a->type != 0) || (b && !b->isConstant && b->type != 0))
13146 {
13147 if(inCompiler)
13148 {
13149 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13150 struct __ecereNameSpace__ecere__sys__OldList * decls = MkList();
13151 struct Declaration * decl;
13152 char temp1[1024], temp2[1024];
13153
13154 GetTypeSpecs(a->expType, specs);
13155 if(a && !a->isConstant && a->type != 0)
13156 {
13157 sprintf(temp1, "__simpleStruct%d", curContext->simpleID++);
13158 ListAdd(decls, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(temp1)), (((void *)0))));
13159 tempExp1 = QMkExpId(temp1);
13160 tempExp1->expType = a->expType;
13161 if(a->expType)
13162 a->expType->refCount++;
13163 ListAdd(exp->list, MkExpOp(CopyExpression(tempExp1), '=', a));
13164 }
13165 if(b && !b->isConstant && b->type != 0)
13166 {
13167 sprintf(temp2, "__simpleStruct%d", curContext->simpleID++);
13168 ListAdd(decls, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(temp2)), (((void *)0))));
13169 tempExp2 = QMkExpId(temp2);
13170 tempExp2->expType = b->expType;
13171 if(b->expType)
13172 b->expType->refCount++;
13173 ListAdd(exp->list, MkExpOp(CopyExpression(tempExp2), '=', b));
13174 }
13175 decl = MkDeclaration(specs, decls);
13176 if(!curCompound->compound.declarations)
13177 curCompound->compound.declarations = MkList();
13178 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*curCompound->compound.declarations), (((void *)0)), decl);
13179 }
13180 }
13181 }
13182 if(!strcmp(id->string, "Max") || !strcmp(id->string, "Min"))
13183 {
13184 int op = (!strcmp(id->string, "Max")) ? '>' : '<';
13185
13186 ListAdd(exp->list, MkExpCondition(MkExpBrackets(MkListOne(MkExpOp(CopyExpression(tempExp1), op, CopyExpression(tempExp2)))), MkListOne(CopyExpression(tempExp1)), CopyExpression(tempExp2)));
13187 exp->expType = a->expType;
13188 if(a->expType)
13189 a->expType->refCount++;
13190 }
13191 else if(!strcmp(id->string, "Abs"))
13192 {
13193 ListAdd(exp->list, MkExpCondition(MkExpBrackets(MkListOne(MkExpOp(CopyExpression(tempExp1), '<', MkExpConstant("0")))), MkListOne(MkExpOp((((void *)0)), '-', CopyExpression(tempExp1))), CopyExpression(tempExp1)));
13194 exp->expType = a->expType;
13195 if(a->expType)
13196 a->expType->refCount++;
13197 }
13198 else if(!strcmp(id->string, "Sgn"))
13199 {
13200 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"))))));
13201 exp->expType = ProcessTypeString("int", 0x0);
13202 }
13203 FreeExpression(tempExp1);
13204 if(tempExp2)
13205 FreeExpression(tempExp2);
13206 FreeIdentifier(id);
13207 break;
13208 }
13209 }
13210 }
13211 {
13212 struct Type * dummy = (dummy = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), dummy->count = (unsigned int)1, dummy->refCount = 1, dummy);
13213
13214 if(!exp->call.exp->destType)
13215 {
13216 exp->call.exp->destType = dummy;
13217 dummy->refCount++;
13218 }
13219 ProcessExpressionType(exp->call.exp);
13220 if(exp->call.exp->destType == dummy)
13221 {
13222 FreeType(dummy);
13223 exp->call.exp->destType = (((void *)0));
13224 }
13225 FreeType(dummy);
13226 }
13227 functionType = exp->call.exp->expType;
13228 if(functionType && functionType->kind == 16)
13229 {
13230 methodType = functionType;
13231 functionType = methodType->method->dataType;
13232 if(exp->call.exp->expType->usedClass)
13233 {
13234 char typeString[1024];
13235
13236 typeString[0] = '\0';
13237 PrintType(functionType, typeString, 0x1, 0x1);
13238 if(strstr(typeString, "thisclass"))
13239 {
13240 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13241 struct Declarator * decl;
13242
13243 {
13244 struct Context * context = SetupTemplatesContext(exp->call.exp->expType->usedClass);
13245
13246 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
13247 if(thisClass != (exp->call.exp->expType->usedClass->templateClass ? exp->call.exp->expType->usedClass->templateClass : exp->call.exp->expType->usedClass))
13248 thisClassParams = 0x0;
13249 ReplaceThisClassSpecifiers(specs, exp->call.exp->expType->usedClass);
13250 {
13251 struct __ecereNameSpace__ecere__com__Class * backupThisClass = thisClass;
13252
13253 thisClass = exp->call.exp->expType->usedClass;
13254 ProcessDeclarator(decl);
13255 thisClass = backupThisClass;
13256 }
13257 thisClassParams = 0x1;
13258 functionType = ProcessType(specs, decl);
13259 functionType->refCount = 0;
13260 FinishTemplatesContext(context);
13261 }
13262 FreeList(specs, FreeSpecifier);
13263 FreeDeclarator(decl);
13264 }
13265 }
13266 }
13267 if(functionType && functionType->kind == 13 && functionType->type && functionType->type->kind == 11)
13268 {
13269 struct Type * type = functionType->type;
13270
13271 if(!functionType->refCount)
13272 {
13273 functionType->type = (((void *)0));
13274 FreeType(functionType);
13275 }
13276 functionType = type;
13277 }
13278 if(functionType && functionType->kind != 11)
13279 {
13280 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "called object %s is not a function\n", (((void *)0))), name);
13281 }
13282 else if(functionType)
13283 {
13284 unsigned int emptyParams = 0x0, noParams = 0x0;
13285 struct Expression * e = exp->call.arguments ? (*exp->call.arguments).first : (((void *)0));
13286 struct Type * type = functionType->params.first;
13287 struct Expression * memberExp = (exp->call.exp->type == 8) ? exp->call.exp : (((void *)0));
13288 int extra = 0;
13289 struct Location oldyylloc = yylloc;
13290
13291 if(!type)
13292 emptyParams = 0x1;
13293 if(functionType->extraParam && e)
13294 {
13295 e->destType = MkClassType(functionType->thisClass->string);
13296 e = e->next;
13297 }
13298 if(!functionType->staticMethod)
13299 {
13300 if(memberExp && memberExp->member.exp && memberExp->member.exp->expType && memberExp->member.exp->expType->kind == 19 && memberExp->member.exp->expType->_class)
13301 {
13302 type = MkClassType(memberExp->member.exp->expType->_class->string);
13303 if(e)
13304 {
13305 e->destType = type;
13306 e = e->next;
13307 type = functionType->params.first;
13308 }
13309 else
13310 type->refCount = 0;
13311 }
13312 else if(!memberExp && (functionType->thisClass || (methodType && methodType->methodClass)))
13313 {
13314 type = MkClassType(functionType->thisClass ? functionType->thisClass->string : (methodType ? methodType->methodClass->fullName : (((void *)0))));
13315 if(e)
13316 {
13317 e->destType = type;
13318 e = e->next;
13319 type = functionType->params.first;
13320 }
13321 else
13322 type->refCount = 0;
13323 }
13324 }
13325 if(type && type->kind == 0)
13326 {
13327 noParams = 0x1;
13328 if(!type->refCount)
13329 FreeType(type);
13330 type = (((void *)0));
13331 }
13332 for(; e; e = e->next)
13333 {
13334 if(!type && !emptyParams)
13335 {
13336 yylloc = e->loc;
13337 if(methodType && methodType->methodClass)
13338 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "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);
13339 else
13340 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "too many arguments for function %s (%d given, expected %d)\n", (((void *)0))), name, (*exp->call.arguments).count, noParams ? 0 : functionType->params.count);
13341 break;
13342 }
13343 if(methodType && type && type->kind == 20 && type->templateParameter->type == 0)
13344 {
13345 struct Type * templatedType = (((void *)0));
13346 struct __ecereNameSpace__ecere__com__Class * _class = methodType->usedClass;
13347 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
13348 int id = 0;
13349
13350 if(_class && _class->templateArgs)
13351 {
13352 struct __ecereNameSpace__ecere__com__Class * sClass;
13353
13354 for(sClass = _class; sClass; sClass = sClass->base)
13355 {
13356 if(sClass->templateClass)
13357 sClass = sClass->templateClass;
13358 id = 0;
13359 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
13360 {
13361 if(curParam->type == 0 && !strcmp(type->templateParameter->identifier->string, curParam->name))
13362 {
13363 struct __ecereNameSpace__ecere__com__Class * nextClass;
13364
13365 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
13366 {
13367 if(nextClass->templateClass)
13368 nextClass = nextClass->templateClass;
13369 id += nextClass->templateParams.count;
13370 }
13371 break;
13372 }
13373 id++;
13374 }
13375 if(curParam)
13376 break;
13377 }
13378 }
13379 if(curParam && _class->templateArgs[id].dataTypeString)
13380 {
13381 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = _class->templateArgs[id];
13382
13383 {
13384 struct Context * context = SetupTemplatesContext(_class);
13385
13386 templatedType = ProcessTypeString(arg.dataTypeString, 0x0);
13387 FinishTemplatesContext(context);
13388 }
13389 e->destType = templatedType;
13390 if(templatedType)
13391 {
13392 templatedType->passAsTemplate = 0x1;
13393 }
13394 }
13395 else
13396 {
13397 e->destType = type;
13398 if(type)
13399 type->refCount++;
13400 }
13401 }
13402 else
13403 {
13404 e->destType = type;
13405 if(type)
13406 type->refCount++;
13407 }
13408 if(type && type->kind != 14)
13409 {
13410 struct Type * next = type->next;
13411
13412 if(!type->refCount)
13413 FreeType(type);
13414 type = next;
13415 }
13416 }
13417 if(type && type->kind != 14)
13418 {
13419 if(methodType && methodType->methodClass)
13420 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "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);
13421 else
13422 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "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);
13423 }
13424 yylloc = oldyylloc;
13425 if(type && !type->refCount)
13426 FreeType(type);
13427 }
13428 else
13429 {
13430 functionType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->refCount = 0, ((struct Type *)__ecereTemp1)->kind = 11, ((struct Type *)__ecereTemp1));
13431 if(exp->call.exp->type == 0)
13432 {
13433 char * string = exp->call.exp->identifier->string;
13434
13435 if(inCompiler)
13436 {
13437 struct Symbol * symbol;
13438 struct Location oldyylloc = yylloc;
13439
13440 yylloc = exp->call.exp->identifier->loc;
13441 if(strstr(string, "__builtin_") == string)
13442 ;
13443 else
13444 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "%s undefined; assuming extern returning int\n", (((void *)0))), string);
13445 symbol = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), ((struct Symbol *)__ecereTemp1)->string = __ecereNameSpace__ecere__sys__CopyString(string), ((struct Symbol *)__ecereTemp1)->type = ProcessTypeString("int()", 0x1), ((struct Symbol *)__ecereTemp1));
13446 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)symbol);
13447 if(strstr(symbol->string, "::"))
13448 globalContext->hasNameSpace = 0x1;
13449 yylloc = oldyylloc;
13450 }
13451 }
13452 else if(exp->call.exp->type == 8)
13453 {
13454 }
13455 else
13456 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "callable object undefined; extern assuming returning int\n", (((void *)0))));
13457 if(!functionType->returnType)
13458 {
13459 functionType->returnType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1)->kind = 3, ((struct Type *)__ecereTemp1));
13460 }
13461 }
13462 if(functionType && functionType->kind == 11)
13463 {
13464 exp->expType = functionType->returnType;
13465 if(functionType->returnType)
13466 functionType->returnType->refCount++;
13467 if(!functionType->refCount)
13468 FreeType(functionType);
13469 }
13470 if(exp->call.arguments)
13471 {
13472 for(e = (*exp->call.arguments).first; e; e = e->next)
13473 {
13474 struct Type * destType = e->destType;
13475
13476 ProcessExpressionType(e);
13477 }
13478 }
13479 break;
13480 }
13481 case 8:
13482 {
13483 struct Type * type;
13484 struct Location oldyylloc = yylloc;
13485 unsigned int thisPtr = (exp->member.exp && exp->member.exp->type == 0 && !strcmp(exp->member.exp->identifier->string, "this"));
13486
13487 exp->thisPtr = thisPtr;
13488 if(exp->member.member && exp->member.member->_class && exp->member.member->_class->name)
13489 {
13490 exp->member.member->classSym = exp->member.member->_class->symbol;
13491 }
13492 ProcessExpressionType(exp->member.exp);
13493 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)
13494 {
13495 exp->isConstant = 0x0;
13496 }
13497 else
13498 exp->isConstant = exp->member.exp->isConstant;
13499 type = exp->member.exp->expType;
13500 yylloc = exp->loc;
13501 if(type && (type->kind == 20))
13502 {
13503 struct __ecereNameSpace__ecere__com__Class * _class = thisClass ? thisClass : currentClass;
13504 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param = (((void *)0));
13505
13506 if(_class)
13507 {
13508 for(param = _class->templateParams.first; param; param = param->next)
13509 {
13510 if(param->type == 1 && exp->member.member && exp->member.member->string && !strcmp(param->name, exp->member.member->string))
13511 break;
13512 }
13513 }
13514 if(param && param->defaultArg.member)
13515 {
13516 struct Expression * argExp = GetTemplateArgExpByName(param->name, thisClass, 1);
13517
13518 if(argExp)
13519 {
13520 struct Expression * expMember = exp->member.exp;
13521 struct Declarator * decl;
13522 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13523 char thisClassTypeString[1024];
13524
13525 FreeIdentifier(exp->member.member);
13526 ProcessExpressionType(argExp);
13527 {
13528 char * colon = strstr(param->defaultArg.memberString, "::");
13529
13530 if(colon)
13531 {
13532 char className[1024];
13533 struct __ecereNameSpace__ecere__com__Class * sClass;
13534
13535 memcpy(thisClassTypeString, param->defaultArg.memberString, colon - param->defaultArg.memberString);
13536 thisClassTypeString[colon - param->defaultArg.memberString] = '\0';
13537 }
13538 else
13539 strcpy(thisClassTypeString, _class->fullName);
13540 }
13541 decl = SpecDeclFromString(param->defaultArg.member->dataTypeString, specs, (((void *)0)));
13542 exp->expType = ProcessType(specs, decl);
13543 if(exp->expType->kind == 8 && exp->expType->_class && exp->expType->_class->registered && exp->expType->_class->registered->templateClass)
13544 {
13545 struct __ecereNameSpace__ecere__com__Class * expClass = exp->expType->_class->registered;
13546 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
13547 int c;
13548 int paramCount = 0;
13549 int lastParam = -1;
13550 char templateString[1024];
13551 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
13552
13553 sprintf(templateString, "%s<", expClass->templateClass->fullName);
13554 for(cClass = expClass; cClass; cClass = cClass->base)
13555 {
13556 int p = 0;
13557
13558 for(param = cClass->templateParams.first; param; param = param->next)
13559 {
13560 int id = p;
13561 struct __ecereNameSpace__ecere__com__Class * sClass;
13562 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
13563
13564 for(sClass = cClass->base; sClass; sClass = sClass->base)
13565 id += sClass->templateParams.count;
13566 arg = expClass->templateArgs[id];
13567 for(sClass = _class; sClass; sClass = sClass->base)
13568 {
13569 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * cParam;
13570 int p = 0;
13571 struct __ecereNameSpace__ecere__com__Class * nextClass;
13572
13573 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
13574 p += nextClass->templateParams.count;
13575 for(cParam = sClass->templateParams.first; cParam; cParam = cParam->next, p++)
13576 {
13577 if(cParam->type == 0 && arg.dataTypeString && !strcmp(cParam->name, arg.dataTypeString))
13578 {
13579 if(_class->templateArgs && arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
13580 {
13581 arg.dataTypeString = _class->templateArgs[p].dataTypeString;
13582 arg.dataTypeClass = _class->templateArgs[p].dataTypeClass;
13583 break;
13584 }
13585 }
13586 }
13587 }
13588 {
13589 char argument[256];
13590
13591 argument[0] = '\0';
13592 switch(param->type)
13593 {
13594 case 2:
13595 {
13596 char expString[1024];
13597 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13598 struct Declarator * decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
13599 struct Expression * exp;
13600 char * string = PrintHexUInt64(arg.expression.ui64);
13601
13602 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
13603 ProcessExpressionType(exp);
13604 ComputeExpression(exp);
13605 expString[0] = '\0';
13606 PrintExpression(exp, expString);
13607 strcat(argument, expString);
13608 FreeExpression(exp);
13609 break;
13610 }
13611 case 1:
13612 {
13613 strcat(argument, arg.member->name);
13614 break;
13615 }
13616 case 0:
13617 {
13618 if(arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
13619 {
13620 if(!strcmp(arg.dataTypeString, "thisclass"))
13621 strcat(argument, thisClassTypeString);
13622 else
13623 strcat(argument, arg.dataTypeString);
13624 }
13625 break;
13626 }
13627 }
13628 if(argument[0])
13629 {
13630 if(paramCount)
13631 strcat(templateString, ", ");
13632 if(lastParam != p - 1)
13633 {
13634 strcat(templateString, param->name);
13635 strcat(templateString, " = ");
13636 }
13637 strcat(templateString, argument);
13638 paramCount++;
13639 lastParam = p;
13640 }
13641 p++;
13642 }
13643 }
13644 }
13645 {
13646 int len = strlen(templateString);
13647
13648 if(templateString[len - 1] == '>')
13649 templateString[len++] = ' ';
13650 templateString[len++] = '>';
13651 templateString[len++] = '\0';
13652 }
13653 {
13654 struct Context * context = SetupTemplatesContext(_class);
13655
13656 FreeType(exp->expType);
13657 exp->expType = ProcessTypeString(templateString, 0x0);
13658 FinishTemplatesContext(context);
13659 }
13660 }
13661 exp->type = 5;
13662 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")))))))));
13663 }
13664 }
13665 else if(type->templateParameter && type->templateParameter->type == 0 && (type->templateParameter->dataType || type->templateParameter->dataTypeString))
13666 {
13667 type = ProcessTemplateParameterType(type->templateParameter);
13668 }
13669 }
13670 if(type && (type->kind == 20))
13671 ;
13672 else if(type && (type->kind == 8 || type->kind == 19 || type->kind == 3 || type->kind == 15))
13673 {
13674 struct Identifier * id = exp->member.member;
13675 int typeKind = type->kind;
13676 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));
13677
13678 if(typeKind == 19 && exp->member.exp->type == 26)
13679 {
13680 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "ecere::com::Class");
13681 typeKind = 8;
13682 }
13683 if(id && (typeKind == 3 || typeKind == 15))
13684 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "int");
13685 if(_class && id)
13686 {
13687 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
13688 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
13689 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
13690 struct __ecereNameSpace__ecere__com__Property * revConvert = (((void *)0));
13691 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
13692
13693 if(id && id->_class && id->_class->name && !strcmp(id->_class->name, "property"))
13694 exp->member.memberType = 1;
13695 if(id && id->_class && type->_class && !__ecereNameSpace__ecere__com__eClass_IsDerived(type->_class->registered, _class))
13696 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "invalid class specifier %s for object of class %s\n", (((void *)0))), _class->fullName, type->_class->string);
13697 if(typeKind != 19)
13698 {
13699 if((exp->member.memberType == 0 && thisPtr) || exp->member.memberType == 3)
13700 {
13701 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
13702 if(member && member->_class != (_class->templateClass ? _class->templateClass : _class) && exp->member.memberType != 3)
13703 {
13704 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
13705 if(prop)
13706 member = (((void *)0));
13707 }
13708 if(!member && !prop)
13709 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
13710 if((member && member->_class == (_class->templateClass ? _class->templateClass : _class)) || (prop && prop->_class == (_class->templateClass ? _class->templateClass : _class)))
13711 exp->member.thisPtr = 0x1;
13712 }
13713 else
13714 {
13715 if(!id->classSym)
13716 {
13717 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, (((void *)0)));
13718 if(!id->_class || !id->_class->name || strcmp(id->_class->name, "property"))
13719 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, (((void *)0)), (((void *)0)), (((void *)0)));
13720 }
13721 if(!prop && !member)
13722 {
13723 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, (((void *)0)));
13724 if(!method)
13725 {
13726 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
13727 if(!id->_class || !id->_class->name || strcmp(id->_class->name, "property"))
13728 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
13729 }
13730 }
13731 if(member && prop)
13732 {
13733 if(member->_class != prop->_class && !id->_class && __ecereNameSpace__ecere__com__eClass_IsDerived(member->_class, prop->_class))
13734 prop = (((void *)0));
13735 else
13736 member = (((void *)0));
13737 }
13738 }
13739 }
13740 if(!prop && !member)
13741 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule);
13742 if(!prop && !member && !method)
13743 {
13744 if(typeKind == 19)
13745 {
13746 classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(type->_class->registered, exp->member.member->string);
13747 if(classProp)
13748 {
13749 exp->member.memberType = 5;
13750 exp->expType = ProcessTypeString(classProp->dataTypeString, 0x0);
13751 }
13752 else
13753 {
13754 char structName[1024];
13755 struct Identifier * id = exp->member.member;
13756 struct Expression * classExp = exp->member.exp;
13757
13758 type->refCount++;
13759 FreeType(classExp->expType);
13760 classExp->expType = ProcessTypeString("ecere::com::Class", 0x0);
13761 strcpy(structName, "__ecereClassData_");
13762 FullClassNameCat(structName, type->_class->string, 0x0);
13763 exp->type = 9;
13764 exp->member.member = id;
13765 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"))))))));
13766 FreeType(type);
13767 ProcessExpressionType(exp);
13768 return ;
13769 }
13770 }
13771 else
13772 {
13773 struct Symbol * classSym = FindClass(id->string);
13774
13775 if(classSym)
13776 {
13777 struct __ecereNameSpace__ecere__com__Class * convertClass = classSym->registered;
13778
13779 if(convertClass)
13780 revConvert = __ecereNameSpace__ecere__com__eClass_FindProperty(convertClass, _class->fullName, privateModule);
13781 }
13782 }
13783 }
13784 if(prop)
13785 {
13786 exp->member.memberType = 1;
13787 if(!prop->dataType)
13788 ProcessPropertyType(prop);
13789 exp->expType = prop->dataType;
13790 if(prop->dataType)
13791 prop->dataType->refCount++;
13792 }
13793 else if(member)
13794 {
13795 if(exp->member.exp->expType->classObjectType == 2 && !strcmp(exp->member.member->string, "_class"))
13796 {
13797 FreeExpContents(exp);
13798 exp->type = 0;
13799 exp->identifier = MkIdentifier("class");
13800 ProcessExpressionType(exp);
13801 return ;
13802 }
13803 exp->member.memberType = 3;
13804 DeclareStruct(_class->fullName, 0x0);
13805 if(!member->dataType)
13806 {
13807 struct Context * context = SetupTemplatesContext(_class);
13808
13809 member->dataType = ProcessTypeString(member->dataTypeString, 0x0);
13810 FinishTemplatesContext(context);
13811 }
13812 exp->expType = member->dataType;
13813 if(member->dataType)
13814 member->dataType->refCount++;
13815 }
13816 else if(revConvert)
13817 {
13818 exp->member.memberType = 4;
13819 exp->expType = MkClassType(revConvert->_class->fullName);
13820 }
13821 else if(method)
13822 {
13823 if(inCompiler)
13824 {
13825 exp->member.memberType = 2;
13826 }
13827 if(!method->dataType)
13828 ProcessMethodType(method);
13829 exp->expType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1)->kind = 16, ((struct Type *)__ecereTemp1)->method = method, ((struct Type *)__ecereTemp1));
13830 exp->expType->methodClass = (id && id->_class) ? _class : (((void *)0));
13831 exp->expType->usedClass = _class;
13832 }
13833 else if(!classProp)
13834 {
13835 if(exp->member.exp->expType->classObjectType == 2 && !strcmp(exp->member.member->string, "_class"))
13836 {
13837 FreeExpContents(exp);
13838 exp->type = 0;
13839 exp->identifier = MkIdentifier("class");
13840 ProcessExpressionType(exp);
13841 return ;
13842 }
13843 yylloc = exp->member.member->loc;
13844 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't find member %s in class %s\n", (((void *)0))), id->string, _class->fullName);
13845 if(inCompiler)
13846 __ecereNameSpace__ecere__com__eClass_AddDataMember(_class, id->string, "int", 0, 0, 1);
13847 }
13848 if(_class && exp->expType)
13849 {
13850 struct __ecereNameSpace__ecere__com__Class * tClass;
13851
13852 tClass = _class;
13853 while(tClass && !tClass->templateClass)
13854 tClass = tClass->base;
13855 if(tClass && exp->expType->kind == 20 && exp->expType->templateParameter->type == 0)
13856 {
13857 int id = 0;
13858 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
13859 struct __ecereNameSpace__ecere__com__Class * sClass;
13860
13861 for(sClass = tClass; sClass; sClass = sClass->base)
13862 {
13863 id = 0;
13864 if(sClass->templateClass)
13865 sClass = sClass->templateClass;
13866 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
13867 {
13868 if(curParam->type == 0 && !strcmp(exp->expType->templateParameter->identifier->string, curParam->name))
13869 {
13870 for(sClass = sClass->base; sClass; sClass = sClass->base)
13871 id += sClass->templateParams.count;
13872 break;
13873 }
13874 id++;
13875 }
13876 if(curParam)
13877 break;
13878 }
13879 if(curParam && tClass->templateArgs[id].dataTypeString)
13880 {
13881 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = tClass->templateArgs[id];
13882 struct Context * context = SetupTemplatesContext(tClass);
13883
13884 FreeType(exp->expType);
13885 exp->expType = ProcessTypeString(arg.dataTypeString, 0x0);
13886 if(exp->expType)
13887 {
13888 if(exp->expType->kind == 21)
13889 {
13890 FreeType(exp->expType);
13891 exp->expType = ReplaceThisClassType(_class);
13892 }
13893 if(tClass->templateClass)
13894 exp->expType->passAsTemplate = 0x1;
13895 if(!exp->destType)
13896 {
13897 exp->destType = ProcessTypeString(arg.dataTypeString, 0x0);
13898 if(exp->destType->kind == 21)
13899 {
13900 FreeType(exp->destType);
13901 exp->destType = ReplaceThisClassType(_class);
13902 }
13903 }
13904 }
13905 FinishTemplatesContext(context);
13906 }
13907 }
13908 else if(tClass && exp->expType->kind == 13 && exp->expType->type && exp->expType->type->kind == 20 && exp->expType->type->templateParameter->type == 0)
13909 {
13910 int id = 0;
13911 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
13912 struct __ecereNameSpace__ecere__com__Class * sClass;
13913
13914 for(sClass = tClass; sClass; sClass = sClass->base)
13915 {
13916 id = 0;
13917 if(sClass->templateClass)
13918 sClass = sClass->templateClass;
13919 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
13920 {
13921 if(curParam->type == 0 && !strcmp(exp->expType->type->templateParameter->identifier->string, curParam->name))
13922 {
13923 for(sClass = sClass->base; sClass; sClass = sClass->base)
13924 id += sClass->templateParams.count;
13925 break;
13926 }
13927 id++;
13928 }
13929 if(curParam)
13930 break;
13931 }
13932 if(curParam)
13933 {
13934 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = tClass->templateArgs[id];
13935 struct Context * context = SetupTemplatesContext(tClass);
13936 struct Type * basicType;
13937
13938 basicType = ProcessTypeString(arg.dataTypeString, 0x0);
13939 if(basicType)
13940 {
13941 if(basicType->kind == 21)
13942 {
13943 FreeType(basicType);
13944 basicType = ReplaceThisClassType(_class);
13945 }
13946 FreeType(exp->expType);
13947 exp->expType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1)->kind = 13, ((struct Type *)__ecereTemp1)->type = basicType, ((struct Type *)__ecereTemp1));
13948 if(!exp->destType)
13949 {
13950 exp->destType = exp->expType;
13951 exp->destType->refCount++;
13952 }
13953 {
13954 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
13955 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13956 struct Declarator * decl;
13957
13958 decl = SpecDeclFromString(arg.dataTypeString, specs, (((void *)0)));
13959 *newExp = *exp;
13960 if(exp->destType)
13961 exp->destType->refCount++;
13962 if(exp->expType)
13963 exp->expType->refCount++;
13964 exp->type = 11;
13965 exp->cast.typeName = MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl));
13966 exp->cast.exp = newExp;
13967 }
13968 }
13969 FinishTemplatesContext(context);
13970 }
13971 }
13972 else if(tClass && exp->expType->kind == 8 && exp->expType->_class && strchr(exp->expType->_class->string, '<'))
13973 {
13974 struct __ecereNameSpace__ecere__com__Class * expClass = exp->expType->_class->registered;
13975
13976 if(expClass)
13977 {
13978 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
13979 int c;
13980 int p = 0;
13981 int paramCount = 0;
13982 int lastParam = -1;
13983 char templateString[1024];
13984 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
13985
13986 sprintf(templateString, "%s<", expClass->templateClass->fullName);
13987 while(cClass != expClass)
13988 {
13989 struct __ecereNameSpace__ecere__com__Class * sClass;
13990
13991 for(sClass = expClass; sClass && sClass->base != cClass; sClass = sClass->base)
13992 ;
13993 cClass = sClass;
13994 for(param = cClass->templateParams.first; param; param = param->next)
13995 {
13996 struct __ecereNameSpace__ecere__com__Class * cClassCur = (((void *)0));
13997 int c;
13998 int cp = 0;
13999 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * paramCur = (((void *)0));
14000 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
14001
14002 while(cClassCur != tClass && !paramCur)
14003 {
14004 struct __ecereNameSpace__ecere__com__Class * sClassCur;
14005
14006 for(sClassCur = tClass; sClassCur && sClassCur->base != cClassCur; sClassCur = sClassCur->base)
14007 ;
14008 cClassCur = sClassCur;
14009 for(paramCur = cClassCur->templateParams.first; paramCur; paramCur = paramCur->next)
14010 {
14011 if(!strcmp(paramCur->name, param->name))
14012 {
14013 break;
14014 }
14015 cp++;
14016 }
14017 }
14018 if(paramCur && paramCur->type == 0)
14019 arg = tClass->templateArgs[cp];
14020 else
14021 arg = expClass->templateArgs[p];
14022 {
14023 char argument[256];
14024
14025 argument[0] = '\0';
14026 switch(param->type)
14027 {
14028 case 2:
14029 {
14030 char expString[1024];
14031 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
14032 struct Declarator * decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
14033 struct Expression * exp;
14034 char * string = PrintHexUInt64(arg.expression.ui64);
14035
14036 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
14037 ProcessExpressionType(exp);
14038 ComputeExpression(exp);
14039 expString[0] = '\0';
14040 PrintExpression(exp, expString);
14041 strcat(argument, expString);
14042 FreeExpression(exp);
14043 break;
14044 }
14045 case 1:
14046 {
14047 strcat(argument, arg.member->name);
14048 break;
14049 }
14050 case 0:
14051 {
14052 if(arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
14053 strcat(argument, arg.dataTypeString);
14054 break;
14055 }
14056 }
14057 if(argument[0])
14058 {
14059 if(paramCount)
14060 strcat(templateString, ", ");
14061 if(lastParam != p - 1)
14062 {
14063 strcat(templateString, param->name);
14064 strcat(templateString, " = ");
14065 }
14066 strcat(templateString, argument);
14067 paramCount++;
14068 lastParam = p;
14069 }
14070 }
14071 p++;
14072 }
14073 }
14074 {
14075 int len = strlen(templateString);
14076
14077 if(templateString[len - 1] == '>')
14078 templateString[len++] = ' ';
14079 templateString[len++] = '>';
14080 templateString[len++] = '\0';
14081 }
14082 FreeType(exp->expType);
14083 {
14084 struct Context * context = SetupTemplatesContext(tClass);
14085
14086 exp->expType = ProcessTypeString(templateString, 0x0);
14087 FinishTemplatesContext(context);
14088 }
14089 }
14090 }
14091 }
14092 }
14093 else
14094 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "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)");
14095 }
14096 else if(type && (type->kind == 9 || type->kind == 10))
14097 {
14098 struct Type * memberType = exp->member.member ? FindMember(type, exp->member.member->string) : (((void *)0));
14099
14100 if(memberType)
14101 {
14102 exp->expType = memberType;
14103 if(memberType)
14104 memberType->refCount++;
14105 }
14106 }
14107 else
14108 {
14109 char expString[10240];
14110
14111 expString[0] = '\0';
14112 if(inCompiler)
14113 {
14114 PrintExpression(exp, expString);
14115 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14116 }
14117 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "member operator on non-structure type expression %s\n", (((void *)0))), expString);
14118 }
14119 if(exp->expType && exp->expType->kind == 21 && (!exp->destType || exp->destType->kind != 21))
14120 {
14121 if(type && (type->kind == 8 || type->kind == 19 || type->kind == 3 || type->kind == 15))
14122 {
14123 struct Identifier * id = exp->member.member;
14124 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));
14125
14126 if(_class)
14127 {
14128 FreeType(exp->expType);
14129 exp->expType = ReplaceThisClassType(_class);
14130 }
14131 }
14132 }
14133 yylloc = oldyylloc;
14134 break;
14135 }
14136 case 9:
14137 {
14138 struct Type * destType = exp->destType;
14139
14140 if(exp->member.member && exp->member.member->_class && exp->member.member->_class->name)
14141 {
14142 exp->member.member->classSym = exp->member.member->_class->symbol;
14143 }
14144 exp->member.exp = MkExpBrackets(MkListOne(MkExpOp((((void *)0)), '*', exp->member.exp)));
14145 exp->type = 8;
14146 if(destType)
14147 destType->count++;
14148 ProcessExpressionType(exp);
14149 if(destType)
14150 destType->count--;
14151 break;
14152 }
14153 case 15:
14154 {
14155 struct Symbol * classSym = exp->_class->symbol;
14156
14157 if(classSym && classSym->registered)
14158 {
14159 if(classSym->registered->type == 5)
14160 {
14161 char name[1024];
14162
14163 name[0] = '\0';
14164 DeclareStruct(classSym->string, 0x0);
14165 FreeSpecifier(exp->_class);
14166 exp->type = 10;
14167 FullClassNameCat(name, classSym->string, 0x0);
14168 exp->typeName = MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(name), (((void *)0)))), (((void *)0)));
14169 }
14170 else
14171 {
14172 if(classSym->registered->fixed)
14173 {
14174 FreeSpecifier(exp->_class);
14175 exp->constant = PrintUInt(classSym->registered->templateClass ? classSym->registered->templateClass->structSize : classSym->registered->structSize);
14176 exp->type = 2;
14177 }
14178 else
14179 {
14180 char className[1024];
14181
14182 strcpy(className, "__ecereClass_");
14183 FullClassNameCat(className, classSym->string, 0x1);
14184 MangleClassName(className);
14185 DeclareClass(classSym, className);
14186 FreeExpContents(exp);
14187 exp->type = 9;
14188 exp->member.exp = MkExpIdentifier(MkIdentifier(className));
14189 exp->member.member = MkIdentifier("structSize");
14190 }
14191 }
14192 }
14193 exp->expType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1)->kind = 3, ((struct Type *)__ecereTemp1));
14194 break;
14195 }
14196 case 10:
14197 {
14198 struct Type * type = ProcessType(exp->typeName->qualifiers, exp->typeName->declarator);
14199
14200 exp->expType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1)->kind = 3, ((struct Type *)__ecereTemp1));
14201 exp->isConstant = 0x1;
14202 DeclareType(type, 0x0, 0x0);
14203 FreeType(type);
14204 break;
14205 }
14206 case 11:
14207 {
14208 struct Type * type = ProcessType(exp->cast.typeName->qualifiers, exp->cast.typeName->declarator);
14209
14210 type->count = (unsigned int)1;
14211 FreeType(exp->cast.exp->destType);
14212 exp->cast.exp->destType = type;
14213 type->refCount++;
14214 ProcessExpressionType(exp->cast.exp);
14215 type->count = (unsigned int)0;
14216 exp->expType = type;
14217 if(!exp->cast.exp->needCast && !NeedCast(exp->cast.exp->expType, type))
14218 {
14219 void * prev = exp->prev, * next = exp->next;
14220 struct Type * expType = exp->cast.exp->destType;
14221 struct Expression * castExp = exp->cast.exp;
14222 struct Type * destType = exp->destType;
14223
14224 if(expType)
14225 expType->refCount++;
14226 FreeType(exp->expType);
14227 FreeTypeName(exp->cast.typeName);
14228 *exp = *castExp;
14229 FreeType(exp->expType);
14230 FreeType(exp->destType);
14231 exp->expType = expType;
14232 exp->destType = destType;
14233 ((castExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(castExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(castExp)) : 0), castExp = 0);
14234 exp->prev = prev;
14235 exp->next = next;
14236 }
14237 else
14238 {
14239 exp->isConstant = exp->cast.exp->isConstant;
14240 }
14241 break;
14242 }
14243 case 35:
14244 {
14245 struct Type * type = ProcessType(exp->initializer.typeName->qualifiers, exp->initializer.typeName->declarator);
14246
14247 type->refCount++;
14248 exp->expType = type;
14249 break;
14250 }
14251 case 36:
14252 {
14253 struct Type * type = ProcessType(exp->vaArg.typeName->qualifiers, exp->vaArg.typeName->declarator);
14254
14255 ProcessExpressionType(exp->vaArg.exp);
14256 type->refCount++;
14257 exp->expType = type;
14258 break;
14259 }
14260 case 12:
14261 {
14262 struct Expression * e;
14263
14264 exp->isConstant = 0x1;
14265 FreeType(exp->cond.cond->destType);
14266 exp->cond.cond->destType = MkClassType("bool");
14267 exp->cond.cond->destType->truth = 0x1;
14268 ProcessExpressionType(exp->cond.cond);
14269 if(!exp->cond.cond->isConstant)
14270 exp->isConstant = 0x0;
14271 for(e = (*exp->cond.exp).first; e; e = e->next)
14272 {
14273 if(!e->next)
14274 {
14275 FreeType(e->destType);
14276 e->destType = exp->destType;
14277 if(e->destType)
14278 e->destType->refCount++;
14279 }
14280 ProcessExpressionType(e);
14281 if(!e->next)
14282 {
14283 exp->expType = e->expType;
14284 if(e->expType)
14285 e->expType->refCount++;
14286 }
14287 if(!e->isConstant)
14288 exp->isConstant = 0x0;
14289 }
14290 FreeType(exp->cond.elseExp->destType);
14291 exp->cond.elseExp->destType = exp->destType ? exp->destType : exp->expType;
14292 if(exp->cond.elseExp->destType)
14293 exp->cond.elseExp->destType->refCount++;
14294 ProcessExpressionType(exp->cond.elseExp);
14295 if(!exp->cond.elseExp->isConstant)
14296 exp->isConstant = 0x0;
14297 break;
14298 }
14299 case 25:
14300 {
14301 if(exp->compound && exp->compound->compound.statements && (*exp->compound->compound.statements).last)
14302 {
14303 struct Statement * last = (*exp->compound->compound.statements).last;
14304
14305 if(last->type == 3 && last->expressions && (*last->expressions).last)
14306 {
14307 ((struct Expression *)(*last->expressions).last)->destType = exp->destType;
14308 if(exp->destType)
14309 exp->destType->refCount++;
14310 }
14311 ProcessStatement(exp->compound);
14312 exp->expType = ((struct Expression *)(*last->expressions).last)->expType;
14313 if(((struct Expression *)(*last->expressions).last)->expType)
14314 exp->expType->refCount++;
14315 }
14316 break;
14317 }
14318 case 26:
14319 {
14320 struct Specifier * spec = (*exp->_classExp.specifiers).first;
14321
14322 if(spec && spec->type == 1)
14323 {
14324 exp->expType = MkClassType(spec->name);
14325 exp->expType->kind = 19;
14326 exp->byReference = 0x1;
14327 }
14328 else
14329 {
14330 exp->expType = MkClassType("ecere::com::Class");
14331 exp->byReference = 0x1;
14332 }
14333 break;
14334 }
14335 case 27:
14336 {
14337 struct __ecereNameSpace__ecere__com__Class * _class = thisClass ? thisClass : currentClass;
14338
14339 if(_class)
14340 {
14341 struct Identifier * id = exp->classData.id;
14342 char structName[1024];
14343 struct Expression * classExp;
14344
14345 strcpy(structName, "__ecereClassData_");
14346 FullClassNameCat(structName, _class->fullName, 0x0);
14347 exp->type = 9;
14348 exp->member.member = id;
14349 if(curCompound && FindSymbol("this", curContext, curCompound->compound.context, 0x0, 0x0))
14350 classExp = MkExpMember(MkExpIdentifier(MkIdentifier("this")), MkIdentifier("_class"));
14351 else
14352 classExp = MkExpIdentifier(MkIdentifier("class"));
14353 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"))))))));
14354 ProcessExpressionType(exp);
14355 return ;
14356 }
14357 break;
14358 }
14359 case 37:
14360 {
14361 struct Type * type = (((void *)0));
14362 char * typeString = (((void *)0));
14363 char typeStringBuf[1024];
14364
14365 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))
14366 {
14367 struct __ecereNameSpace__ecere__com__Class * templateClass = exp->destType->_class->registered;
14368
14369 typeString = templateClass->templateArgs[2].dataTypeString;
14370 }
14371 else if(exp->list)
14372 {
14373 struct Expression * e;
14374
14375 for(e = (*exp->list).first; e; e = e->next)
14376 {
14377 ProcessExpressionType(e);
14378 if(e->expType)
14379 {
14380 if(!type)
14381 {
14382 type = e->expType;
14383 type->refCount++;
14384 }
14385 else
14386 {
14387 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
14388 {
14389 FreeType(type);
14390 type = e->expType;
14391 e->expType = (((void *)0));
14392 e = (*exp->list).first;
14393 ProcessExpressionType(e);
14394 if(e->expType)
14395 {
14396 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
14397 {
14398 FreeType(e->expType);
14399 e->expType = (((void *)0));
14400 FreeType(type);
14401 type = (((void *)0));
14402 break;
14403 }
14404 }
14405 }
14406 }
14407 if(e->expType)
14408 {
14409 FreeType(e->expType);
14410 e->expType = (((void *)0));
14411 }
14412 }
14413 }
14414 if(type)
14415 {
14416 typeStringBuf[0] = '\0';
14417 PrintType(type, typeStringBuf, 0x0, 0x1);
14418 typeString = typeStringBuf;
14419 FreeType(type);
14420 type = (((void *)0));
14421 }
14422 }
14423 if(typeString)
14424 {
14425 char templateString[1024];
14426 struct __ecereNameSpace__ecere__sys__OldList * initializers = MkList();
14427 struct __ecereNameSpace__ecere__sys__OldList * structInitializers = MkList();
14428 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
14429 struct Expression * expExt;
14430 struct Declarator * decl = SpecDeclFromString(typeString, specs, (((void *)0)));
14431
14432 sprintf(templateString, "Container<%s>", typeString);
14433 if(exp->list)
14434 {
14435 struct Expression * e;
14436
14437 type = ProcessTypeString(typeString, 0x0);
14438 while(e = (*exp->list).first)
14439 {
14440 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*exp->list), e);
14441 e->destType = type;
14442 type->refCount++;
14443 ProcessExpressionType(e);
14444 ListAdd(initializers, MkInitializerAssignment(e));
14445 }
14446 FreeType(type);
14447 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->list), exp->list = 0);
14448 }
14449 DeclareStruct("ecere::com::BuiltInContainer", 0x0);
14450 ListAdd(structInitializers, MkInitializerAssignment(MkExpMember(MkExpClass(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0))), MkIdentifier("_vTbl"))));
14451 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
14452 ListAdd(structInitializers, MkInitializerAssignment(MkExpClass(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0)))));
14453 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
14454 ListAdd(structInitializers, MkInitializerAssignment(MkExpConstant("0")));
14455 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
14456 ListAdd(structInitializers, MkInitializerAssignment(MkExpExtensionInitializer(MkTypeName(specs, MkDeclaratorArray(decl, (((void *)0)))), MkInitializerList(initializers))));
14457 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
14458 ListAdd(structInitializers, MkInitializerAssignment((__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression), ((struct Expression *)__ecereTemp1)->type = 2, ((struct Expression *)__ecereTemp1)->constant = __ecereNameSpace__ecere__com__PrintString(__ecereClass_int, &(*initializers).count, (void *)0), ((struct Expression *)__ecereTemp1))));
14459 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
14460 ListAdd(structInitializers, MkInitializerAssignment(MkExpClass(CopyList(specs, CopySpecifier), CopyDeclarator(decl))));
14461 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
14462 exp->expType = ProcessTypeString(templateString, 0x0);
14463 exp->type = 5;
14464 exp->list = MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName(templateString)), (((void *)0))), MkExpOp((((void *)0)), '&', expExt = MkExpExtensionInitializer(MkTypeName(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0))), MkInitializerList(structInitializers)))));
14465 ProcessExpressionType(expExt);
14466 }
14467 else
14468 {
14469 exp->expType = ProcessTypeString("Container", 0x0);
14470 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Couldn't determine type of array elements\n", (((void *)0))));
14471 }
14472 break;
14473 }
14474 }
14475 if(exp->expType && exp->expType->kind == 21 && thisClass && (!exp->destType || exp->destType->kind != 21))
14476 {
14477 FreeType(exp->expType);
14478 exp->expType = ReplaceThisClassType(thisClass);
14479 }
14480 if(exp->expType && (exp->expType->kind == 9 || exp->expType->kind == 10 || exp->expType->kind == 15) && !exp->expType->members.first && exp->expType->enumName)
14481 {
14482 struct Symbol * symbol = FindSymbol(exp->expType->enumName, curContext, globalContext, 0x1, 0x0);
14483
14484 if(symbol)
14485 {
14486 if(exp->expType->kind != 15)
14487 {
14488 struct Type * member;
14489 char * enumName = __ecereNameSpace__ecere__sys__CopyString(exp->expType->enumName);
14490
14491 FreeType(exp->expType);
14492 exp->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14493 exp->expType->kind = symbol->type->kind;
14494 exp->expType->refCount++;
14495 exp->expType->enumName = enumName;
14496 exp->expType->members = symbol->type->members;
14497 for(member = symbol->type->members.first; member; member = member->next)
14498 member->refCount++;
14499 }
14500 else
14501 {
14502 struct __ecereNameSpace__ecere__sys__NamedLink * member;
14503
14504 for(member = symbol->type->members.first; member; member = member->next)
14505 {
14506 struct __ecereNameSpace__ecere__sys__NamedLink * value = (value = __ecereNameSpace__ecere__com__eSystem_New0(16), value->name = __ecereNameSpace__ecere__sys__CopyString(member->name), value);
14507
14508 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&exp->expType->members, value);
14509 }
14510 }
14511 }
14512 }
14513 yylloc = exp->loc;
14514 if(exp->destType && (exp->destType->kind == 0 || exp->destType->kind == 18))
14515 ;
14516 else if(exp->destType && !exp->destType->keepCast)
14517 {
14518 if(!CheckExpressionType(exp, exp->destType, 0x0))
14519 {
14520 if(!exp->destType->count || unresolved)
14521 {
14522 if(!exp->expType)
14523 {
14524 yylloc = exp->loc;
14525 if(exp->destType->kind != 14)
14526 {
14527 char type2[1024];
14528
14529 type2[0] = '\0';
14530 if(inCompiler)
14531 {
14532 char expString[10240];
14533
14534 expString[0] = '\0';
14535 PrintType(exp->destType, type2, 0x0, 0x1);
14536 if(inCompiler)
14537 {
14538 PrintExpression(exp, expString);
14539 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14540 }
14541 if(unresolved)
14542 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "unresolved identifier %s; expected %s\n", (((void *)0))), expString, type2);
14543 else if(exp->type != 16)
14544 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't determine type of %s; expected %s\n", (((void *)0))), expString, type2);
14545 }
14546 }
14547 else
14548 {
14549 char expString[10240];
14550
14551 expString[0] = '\0';
14552 if(inCompiler)
14553 {
14554 PrintExpression(exp, expString);
14555 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14556 }
14557 if(unresolved)
14558 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "unresolved identifier %s\n", (((void *)0))), expString);
14559 else if(exp->type != 16)
14560 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't determine type of %s\n", (((void *)0))), expString);
14561 }
14562 }
14563 else
14564 {
14565 char type1[1024];
14566 char type2[1024];
14567
14568 type1[0] = '\0';
14569 type2[0] = '\0';
14570 if(inCompiler)
14571 {
14572 PrintType(exp->expType, type1, 0x0, 0x1);
14573 PrintType(exp->destType, type2, 0x0, 0x1);
14574 }
14575 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)))
14576 ;
14577 else
14578 {
14579 char expString[10240];
14580
14581 expString[0] = '\0';
14582 if(inCompiler)
14583 {
14584 PrintExpression(exp, expString);
14585 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14586 }
14587 if(!sourceFile || (strcmp(sourceFile, "src\\lexer.ec") && strcmp(sourceFile, "src/lexer.ec") && strcmp(sourceFile, "src\\grammar.ec") && strcmp(sourceFile, "src/grammar.ec")))
14588 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible expression %s (%s); expected %s\n", (((void *)0))), expString, type1, type2);
14589 FreeType(exp->expType);
14590 exp->destType->refCount++;
14591 exp->expType = exp->destType;
14592 }
14593 }
14594 }
14595 }
14596 else if(exp->destType && exp->destType->kind == 14 && exp->expType && exp->expType->passAsTemplate)
14597 {
14598 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
14599 char typeString[1024];
14600 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
14601 struct Declarator * decl;
14602
14603 typeString[0] = '\0';
14604 *newExp = *exp;
14605 if(exp->expType)
14606 exp->expType->refCount++;
14607 if(exp->expType)
14608 exp->expType->refCount++;
14609 exp->type = 11;
14610 newExp->destType = exp->expType;
14611 PrintType(exp->expType, typeString, 0x0, 0x0);
14612 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
14613 exp->cast.typeName = MkTypeName(specs, decl);
14614 exp->cast.exp = newExp;
14615 }
14616 }
14617 else if(unresolved)
14618 {
14619 if(exp->identifier->_class && exp->identifier->_class->name)
14620 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "unresolved identifier %s::%s\n", (((void *)0))), exp->identifier->_class->name, exp->identifier->string);
14621 else if(exp->identifier->string && exp->identifier->string[0])
14622 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "unresolved identifier %s\n", (((void *)0))), exp->identifier->string);
14623 }
14624 else if(!exp->expType && exp->type != 16)
14625 {
14626 char expString[10240];
14627
14628 expString[0] = '\0';
14629 if(inCompiler)
14630 {
14631 PrintExpression(exp, expString);
14632 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14633 }
14634 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't determine type of %s\n", (((void *)0))), expString);
14635 }
14636 ApplyAnyObjectLogic(exp);
14637 if(!notByReference && exp->expType && exp->expType->kind == 8 && exp->expType->_class && exp->expType->_class->registered && exp->expType->_class->registered->type == 5)
14638 {
14639 exp->byReference = 0x1;
14640 }
14641 yylloc = oldyylloc;
14642 }
14643
14644 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)
14645 {
14646 if(*curMember)
14647 {
14648 *curMember = (*curMember)->next;
14649 if(subMemberStackPos && *subMemberStackPos > 0 && subMemberStack[*subMemberStackPos - 1]->type == 1)
14650 {
14651 *curMember = subMemberStack[--(*subMemberStackPos)];
14652 *curMember = (*curMember)->next;
14653 }
14654 while((*curMember) && (*curMember)->isProperty)
14655 *curMember = (*curMember)->next;
14656 if(subMemberStackPos)
14657 {
14658 while((*curMember) && !(*curMember)->isProperty && !(*curMember)->name && ((*curMember)->type == 2 || (*curMember)->type == 1))
14659 {
14660 subMemberStack[(*subMemberStackPos)++] = *curMember;
14661 *curMember = (*curMember)->members.first;
14662 while(*curMember && (*curMember)->isProperty)
14663 *curMember = (*curMember)->next;
14664 }
14665 }
14666 }
14667 while(!*curMember)
14668 {
14669 if(!*curMember)
14670 {
14671 if(subMemberStackPos && *subMemberStackPos)
14672 {
14673 *curMember = subMemberStack[--(*subMemberStackPos)];
14674 *curMember = (*curMember)->next;
14675 }
14676 else
14677 {
14678 struct __ecereNameSpace__ecere__com__Class * lastCurClass = *curClass;
14679
14680 if(*curClass == _class)
14681 break;
14682 for(*curClass = _class; (*curClass)->base != lastCurClass && (*curClass)->base->type != 1000; *curClass = (*curClass)->base)
14683 ;
14684 *curMember = (*curClass)->membersAndProperties.first;
14685 }
14686 while((*curMember) && (*curMember)->isProperty)
14687 *curMember = (*curMember)->next;
14688 if(subMemberStackPos)
14689 {
14690 while((*curMember) && !(*curMember)->isProperty && !(*curMember)->name && ((*curMember)->type == 2 || (*curMember)->type == 1))
14691 {
14692 subMemberStack[(*subMemberStackPos)++] = *curMember;
14693 *curMember = (*curMember)->members.first;
14694 while(*curMember && (*curMember)->isProperty)
14695 *curMember = (*curMember)->next;
14696 }
14697 }
14698 }
14699 }
14700 }
14701
14702 static void ProcessInitializer(struct Initializer * init, struct Type * type)
14703 {
14704 switch(init->type)
14705 {
14706 case 0:
14707 if(!init->exp || init->exp->type != 1 || !init->exp->instance || init->exp->instance->_class || !type || type->kind == 8)
14708 {
14709 if(init->exp && !init->exp->destType)
14710 {
14711 FreeType(init->exp->destType);
14712 init->exp->destType = type;
14713 if(type)
14714 type->refCount++;
14715 }
14716 if(init->exp)
14717 {
14718 ProcessExpressionType(init->exp);
14719 init->isConstant = init->exp->isConstant;
14720 }
14721 break;
14722 }
14723 else
14724 {
14725 struct Expression * exp = init->exp;
14726 struct Instantiation * inst = exp->instance;
14727 struct MembersInit * members;
14728
14729 init->type = 1;
14730 init->list = MkList();
14731 if(inst->members)
14732 {
14733 for(members = (*inst->members).first; members; members = members->next)
14734 {
14735 if(members->type == 0)
14736 {
14737 struct MemberInit * member;
14738
14739 for(member = (*members->dataMembers).first; member; member = member->next)
14740 {
14741 ListAdd(init->list, member->initializer);
14742 member->initializer = (((void *)0));
14743 }
14744 }
14745 }
14746 }
14747 FreeExpression(exp);
14748 }
14749 case 1:
14750 {
14751 struct Initializer * i;
14752 struct Type * initializerType = (((void *)0));
14753 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
14754 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
14755 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
14756 int subMemberStackPos = 0;
14757
14758 if(type && type->kind == 12)
14759 initializerType = Dereference(type);
14760 else if(type && (type->kind == 9 || type->kind == 10))
14761 initializerType = type->members.first;
14762 for(i = (*init->list).first; i; i = i->next)
14763 {
14764 if(type && type->kind == 8 && type->_class && type->_class->registered)
14765 {
14766 FindNextDataMember(type->_class->registered, &curClass, &curMember, subMemberStack, &subMemberStackPos);
14767 if(curMember)
14768 {
14769 if(!curMember->dataType)
14770 curMember->dataType = ProcessTypeString(curMember->dataTypeString, 0x0);
14771 initializerType = curMember->dataType;
14772 }
14773 }
14774 ProcessInitializer(i, initializerType);
14775 if(initializerType && type && (type->kind == 9 || type->kind == 10))
14776 initializerType = initializerType->next;
14777 if(!i->isConstant)
14778 init->isConstant = 0x0;
14779 }
14780 if(type && type->kind == 12)
14781 FreeType(initializerType);
14782 if(type && type->kind != 12 && type->kind != 9 && type->kind != 10 && (type->kind != 8 || !type->_class->registered || type->_class->registered->type != 1))
14783 {
14784 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Assigning list initializer to non list\n", (((void *)0))));
14785 }
14786 break;
14787 }
14788 }
14789 }
14790
14791 extern struct Symbol * FindType(struct Context * ctx, char *  name);
14792
14793 static void ProcessClass(struct __ecereNameSpace__ecere__sys__OldList * definitions, struct Symbol * symbol);
14794
14795 static void ProcessSpecifier(struct Specifier * spec, unsigned int declareStruct)
14796 {
14797 switch(spec->type)
14798 {
14799 case 0:
14800 {
14801 if(spec->specifier == THISCLASS)
14802 {
14803 if(thisClass)
14804 {
14805 spec->type = 1;
14806 spec->name = ReplaceThisClass(thisClass);
14807 spec->symbol = FindClass(spec->name);
14808 ProcessSpecifier(spec, declareStruct);
14809 }
14810 }
14811 break;
14812 }
14813 case 1:
14814 {
14815 struct Symbol * symbol = FindType(curContext, spec->name);
14816
14817 if(symbol)
14818 DeclareType(symbol->type, 0x1, 0x1);
14819 else if((symbol = spec->symbol) && symbol->registered && symbol->registered->type == 1 && declareStruct)
14820 DeclareStruct(spec->name, 0x0);
14821 break;
14822 }
14823 case 2:
14824 {
14825 struct Enumerator * e;
14826
14827 if(spec->list)
14828 {
14829 for(e = (*spec->list).first; e; e = e->next)
14830 {
14831 if(e->exp)
14832 ProcessExpressionType(e->exp);
14833 }
14834 }
14835 break;
14836 }
14837 case 3:
14838 case 4:
14839 {
14840 if(spec->definitions)
14841 {
14842 struct ClassDef * def;
14843 struct Symbol * symbol = spec->id ? FindClass(spec->id->string) : (((void *)0));
14844
14845 ProcessClass(spec->definitions, symbol);
14846 }
14847 break;
14848 }
14849 }
14850 }
14851
14852 static void ProcessDeclarator(struct Declarator * decl)
14853 {
14854 switch(decl->type)
14855 {
14856 case 1:
14857 if(decl->identifier->classSym)
14858 {
14859 FreeSpecifier(decl->identifier->_class);
14860 decl->identifier->_class = (((void *)0));
14861 }
14862 break;
14863 case 3:
14864 if(decl->array.exp)
14865 ProcessExpressionType(decl->array.exp);
14866 case 0:
14867 case 2:
14868 case 4:
14869 case 5:
14870 case 6:
14871 case 7:
14872 if(decl->declarator)
14873 ProcessDeclarator(decl->declarator);
14874 if(decl->type == 4)
14875 {
14876 struct Identifier * id = GetDeclId(decl);
14877
14878 if(id && id->_class)
14879 {
14880 struct TypeName * param = (param = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TypeName), param->qualifiers = MkListOne(id->_class), param->declarator = (((void *)0)), param);
14881
14882 if(!decl->function.parameters)
14883 decl->function.parameters = MkList();
14884 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*decl->function.parameters), (((void *)0)), param);
14885 id->_class = (((void *)0));
14886 }
14887 if(decl->function.parameters)
14888 {
14889 struct TypeName * param;
14890
14891 for(param = (*decl->function.parameters).first; param; param = param->next)
14892 {
14893 if(param->qualifiers && (*param->qualifiers).first)
14894 {
14895 struct Specifier * spec = (*param->qualifiers).first;
14896
14897 if(spec && spec->specifier == TYPED_OBJECT)
14898 {
14899 struct Declarator * d = param->declarator;
14900 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);
14901
14902 FreeList(param->qualifiers, FreeSpecifier);
14903 param->qualifiers = MkListOne(MkStructOrUnion(3, MkIdentifier("__ecereNameSpace__ecere__com__Class"), (((void *)0))));
14904 param->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier("class")));
14905 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*decl->function.parameters), param, newParam);
14906 param = newParam;
14907 }
14908 else if(spec && spec->specifier == ANY_OBJECT)
14909 {
14910 struct Declarator * d = param->declarator;
14911
14912 FreeList(param->qualifiers, FreeSpecifier);
14913 param->qualifiers = MkListOne(MkSpecifier(VOID));
14914 param->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d);
14915 }
14916 else if(spec->specifier == THISCLASS)
14917 {
14918 if(thisClass)
14919 {
14920 spec->type = 1;
14921 spec->name = ReplaceThisClass(thisClass);
14922 spec->symbol = FindClass(spec->name);
14923 ProcessSpecifier(spec, 0x0);
14924 }
14925 }
14926 }
14927 if(param->declarator)
14928 ProcessDeclarator(param->declarator);
14929 }
14930 }
14931 }
14932 break;
14933 }
14934 }
14935
14936 extern struct Identifier * CopyIdentifier(struct Identifier * id);
14937
14938 extern void FreeInitDeclarator(struct InitDeclarator * decl);
14939
14940 static void ProcessDeclaration(struct Declaration * decl)
14941 {
14942 yylloc = decl->loc;
14943 switch(decl->type)
14944 {
14945 case 1:
14946 {
14947 unsigned int declareStruct = 0x0;
14948
14949 if(decl->declarators)
14950 {
14951 struct InitDeclarator * d;
14952
14953 for(d = (*decl->declarators).first; d; d = d->next)
14954 {
14955 struct Type * type, * subType;
14956
14957 ProcessDeclarator(d->declarator);
14958 type = ProcessType(decl->specifiers, d->declarator);
14959 if(d->initializer)
14960 {
14961 ProcessInitializer(d->initializer, type);
14962 if((*decl->declarators).count == 1 && d->initializer->type == 0 && d->initializer->exp->type == 1)
14963 {
14964 if(type->kind == 8 && type->_class == d->initializer->exp->expType->_class)
14965 {
14966 struct Instantiation * inst = d->initializer->exp->instance;
14967
14968 inst->exp = MkExpIdentifier(CopyIdentifier(GetDeclId(d->declarator)));
14969 d->initializer->exp->instance = (((void *)0));
14970 if(decl->specifiers)
14971 FreeList(decl->specifiers, FreeSpecifier);
14972 FreeList(decl->declarators, FreeInitDeclarator);
14973 d = (((void *)0));
14974 decl->type = 2;
14975 decl->inst = inst;
14976 }
14977 }
14978 }
14979 for(subType = type; subType; )
14980 {
14981 if(subType->kind == 8)
14982 {
14983 declareStruct = 0x1;
14984 break;
14985 }
14986 else if(subType->kind == 13)
14987 break;
14988 else if(subType->kind == 12)
14989 subType = subType->arrayType;
14990 else
14991 break;
14992 }
14993 FreeType(type);
14994 if(!d)
14995 break;
14996 }
14997 }
14998 if(decl->specifiers)
14999 {
15000 struct Specifier * s;
15001
15002 for(s = (*decl->specifiers).first; s; s = s->next)
15003 {
15004 ProcessSpecifier(s, declareStruct);
15005 }
15006 }
15007 break;
15008 }
15009 case 2:
15010 {
15011 ProcessInstantiationType(decl->inst);
15012 break;
15013 }
15014 case 0:
15015 {
15016 struct Specifier * spec;
15017 struct Declarator * d;
15018 unsigned int declareStruct = 0x0;
15019
15020 if(decl->declarators)
15021 {
15022 for(d = (*decl->declarators).first; d; d = d->next)
15023 {
15024 struct Type * type = ProcessType(decl->specifiers, d->declarator);
15025 struct Type * subType;
15026
15027 ProcessDeclarator(d);
15028 for(subType = type; subType; )
15029 {
15030 if(subType->kind == 8)
15031 {
15032 declareStruct = 0x1;
15033 break;
15034 }
15035 else if(subType->kind == 13)
15036 break;
15037 else if(subType->kind == 12)
15038 subType = subType->arrayType;
15039 else
15040 break;
15041 }
15042 FreeType(type);
15043 }
15044 }
15045 if(decl->specifiers)
15046 {
15047 for(spec = (*decl->specifiers).first; spec; spec = spec->next)
15048 ProcessSpecifier(spec, declareStruct);
15049 }
15050 break;
15051 }
15052 }
15053 }
15054
15055 static struct FunctionDefinition * curFunction;
15056
15057 static void CreateFireWatcher(struct __ecereNameSpace__ecere__com__Property * prop, struct Expression * object, struct Statement * stmt)
15058 {
15059 char propName[1024], propNameM[1024];
15060 char getName[1024], setName[1024];
15061 struct __ecereNameSpace__ecere__sys__OldList * args;
15062
15063 DeclareProperty(prop, setName, getName);
15064 strcpy(propName, "__ecereProp_");
15065 FullClassNameCat(propName, prop->_class->fullName, 0x0);
15066 strcat(propName, "_");
15067 FullClassNameCat(propName, prop->name, 0x1);
15068 MangleClassName(propName);
15069 strcpy(propNameM, "__ecerePropM_");
15070 FullClassNameCat(propNameM, prop->_class->fullName, 0x0);
15071 strcat(propNameM, "_");
15072 FullClassNameCat(propNameM, prop->name, 0x1);
15073 MangleClassName(propNameM);
15074 if(prop->isWatchable)
15075 {
15076 args = MkList();
15077 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
15078 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
15079 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireWatchers")), args));
15080 args = MkList();
15081 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
15082 ListAdd(args, MkExpIdentifier(MkIdentifier(propNameM)));
15083 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireWatchers")), args));
15084 }
15085 {
15086 args = MkList();
15087 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
15088 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
15089 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireSelfWatchers")), args));
15090 args = MkList();
15091 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
15092 ListAdd(args, MkExpIdentifier(MkIdentifier(propNameM)));
15093 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireSelfWatchers")), args));
15094 }
15095 if(curFunction->propSet && !strcmp(curFunction->propSet->string, prop->name) && (!object || (object->type == 0 && !strcmp(object->identifier->string, "this"))))
15096 curFunction->propSet->fireWatchersDone = 0x1;
15097 }
15098
15099 extern struct Declaration * MkDeclarationInst(struct Instantiation * inst);
15100
15101 extern struct Instantiation * MkInstantiationNamed(struct __ecereNameSpace__ecere__sys__OldList * specs, struct Expression * exp, struct __ecereNameSpace__ecere__sys__OldList * members);
15102
15103 extern struct Statement * MkIfStmt(struct __ecereNameSpace__ecere__sys__OldList * exp, struct Statement * statement, struct Statement * elseStmt);
15104
15105 extern struct Statement * MkForStmt(struct Statement * init, struct Statement * check, struct __ecereNameSpace__ecere__sys__OldList * inc, struct Statement * statement);
15106
15107 extern struct Statement * MkWhileStmt(struct __ecereNameSpace__ecere__sys__OldList * exp, struct Statement * statement);
15108
15109 extern struct ClassFunction * MkClassFunction(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct Specifier * _class, struct Declarator * decl, struct __ecereNameSpace__ecere__sys__OldList * declList);
15110
15111 extern void ProcessClassFunctionBody(struct ClassFunction * func, struct Statement * body);
15112
15113 extern void FreePropertyWatch(struct PropertyWatch * watcher);
15114
15115 static void ProcessStatement(struct Statement * stmt)
15116 {
15117 yylloc = stmt->loc;
15118 switch(stmt->type)
15119 {
15120 case 0:
15121 ProcessStatement(stmt->labeled.stmt);
15122 break;
15123 case 1:
15124 if(stmt->caseStmt.exp)
15125 {
15126 FreeType(stmt->caseStmt.exp->destType);
15127 stmt->caseStmt.exp->destType = curSwitchType;
15128 if(curSwitchType)
15129 curSwitchType->refCount++;
15130 ProcessExpressionType(stmt->caseStmt.exp);
15131 ComputeExpression(stmt->caseStmt.exp);
15132 }
15133 if(stmt->caseStmt.stmt)
15134 ProcessStatement(stmt->caseStmt.stmt);
15135 break;
15136 case 2:
15137 {
15138 if(stmt->compound.context)
15139 {
15140 struct Declaration * decl;
15141 struct Statement * s;
15142 struct Statement * prevCompound = curCompound;
15143 struct Context * prevContext = curContext;
15144
15145 if(!stmt->compound.isSwitch)
15146 {
15147 curCompound = stmt;
15148 curContext = stmt->compound.context;
15149 }
15150 if(stmt->compound.declarations)
15151 {
15152 for(decl = (*stmt->compound.declarations).first; decl; decl = decl->next)
15153 ProcessDeclaration(decl);
15154 }
15155 if(stmt->compound.statements)
15156 {
15157 for(s = (*stmt->compound.statements).first; s; s = s->next)
15158 ProcessStatement(s);
15159 }
15160 curContext = prevContext;
15161 curCompound = prevCompound;
15162 }
15163 break;
15164 }
15165 case 3:
15166 {
15167 struct Expression * exp;
15168
15169 if(stmt->expressions)
15170 {
15171 for(exp = (*stmt->expressions).first; exp; exp = exp->next)
15172 ProcessExpressionType(exp);
15173 }
15174 break;
15175 }
15176 case 4:
15177 {
15178 struct Expression * exp;
15179
15180 FreeType(((struct Expression *)(*stmt->ifStmt.exp).last)->destType);
15181 ((struct Expression *)(*stmt->ifStmt.exp).last)->destType = MkClassType("bool");
15182 ((struct Expression *)(*stmt->ifStmt.exp).last)->destType->truth = 0x1;
15183 for(exp = (*stmt->ifStmt.exp).first; exp; exp = exp->next)
15184 {
15185 ProcessExpressionType(exp);
15186 }
15187 if(stmt->ifStmt.stmt)
15188 ProcessStatement(stmt->ifStmt.stmt);
15189 if(stmt->ifStmt.elseStmt)
15190 ProcessStatement(stmt->ifStmt.elseStmt);
15191 break;
15192 }
15193 case 5:
15194 {
15195 struct Type * oldSwitchType = curSwitchType;
15196
15197 if(stmt->switchStmt.exp)
15198 {
15199 struct Expression * exp;
15200
15201 for(exp = (*stmt->switchStmt.exp).first; exp; exp = exp->next)
15202 {
15203 if(!exp->next)
15204 {
15205 ProcessExpressionType(exp);
15206 }
15207 if(!exp->next)
15208 curSwitchType = exp->expType;
15209 }
15210 }
15211 ProcessStatement(stmt->switchStmt.stmt);
15212 curSwitchType = oldSwitchType;
15213 break;
15214 }
15215 case 6:
15216 {
15217 if(stmt->whileStmt.exp)
15218 {
15219 struct Expression * exp;
15220
15221 FreeType(((struct Expression *)(*stmt->whileStmt.exp).last)->destType);
15222 ((struct Expression *)(*stmt->whileStmt.exp).last)->destType = MkClassType("bool");
15223 ((struct Expression *)(*stmt->whileStmt.exp).last)->destType->truth = 0x1;
15224 for(exp = (*stmt->whileStmt.exp).first; exp; exp = exp->next)
15225 {
15226 ProcessExpressionType(exp);
15227 }
15228 }
15229 if(stmt->whileStmt.stmt)
15230 ProcessStatement(stmt->whileStmt.stmt);
15231 break;
15232 }
15233 case 7:
15234 {
15235 if(stmt->doWhile.exp)
15236 {
15237 struct Expression * exp;
15238
15239 if((*stmt->doWhile.exp).last)
15240 {
15241 FreeType(((struct Expression *)(*stmt->doWhile.exp).last)->destType);
15242 ((struct Expression *)(*stmt->doWhile.exp).last)->destType = MkClassType("bool");
15243 ((struct Expression *)(*stmt->doWhile.exp).last)->destType->truth = 0x1;
15244 }
15245 for(exp = (*stmt->doWhile.exp).first; exp; exp = exp->next)
15246 {
15247 ProcessExpressionType(exp);
15248 }
15249 }
15250 if(stmt->doWhile.stmt)
15251 ProcessStatement(stmt->doWhile.stmt);
15252 break;
15253 }
15254 case 8:
15255 {
15256 struct Expression * exp;
15257
15258 if(stmt->forStmt.init)
15259 ProcessStatement(stmt->forStmt.init);
15260 if(stmt->forStmt.check && stmt->forStmt.check->expressions)
15261 {
15262 FreeType(((struct Expression *)(*stmt->forStmt.check->expressions).last)->destType);
15263 ((struct Expression *)(*stmt->forStmt.check->expressions).last)->destType = MkClassType("bool");
15264 ((struct Expression *)(*stmt->forStmt.check->expressions).last)->destType->truth = 0x1;
15265 }
15266 if(stmt->forStmt.check)
15267 ProcessStatement(stmt->forStmt.check);
15268 if(stmt->forStmt.increment)
15269 {
15270 for(exp = (*stmt->forStmt.increment).first; exp; exp = exp->next)
15271 ProcessExpressionType(exp);
15272 }
15273 if(stmt->forStmt.stmt)
15274 ProcessStatement(stmt->forStmt.stmt);
15275 break;
15276 }
15277 case 18:
15278 {
15279 struct Identifier * id = stmt->forEachStmt.id;
15280 struct __ecereNameSpace__ecere__sys__OldList * exp = stmt->forEachStmt.exp;
15281 struct __ecereNameSpace__ecere__sys__OldList * filter = stmt->forEachStmt.filter;
15282 struct Statement * block = stmt->forEachStmt.stmt;
15283 char iteratorType[1024];
15284 struct Type * source;
15285 struct Expression * e;
15286 unsigned int isBuiltin = exp && (*exp).last && (((struct Expression *)(*exp).last)->type == 37 || (((struct Expression *)(*exp).last)->type == 11 && ((struct Expression *)(*exp).last)->cast.exp->type == 37));
15287 struct Expression * arrayExp;
15288 char * typeString = (((void *)0));
15289 int builtinCount = 0;
15290
15291 for(e = exp ? (*exp).first : (((void *)0)); e; e = e->next)
15292 {
15293 if(!e->next)
15294 {
15295 FreeType(e->destType);
15296 e->destType = ProcessTypeString("Container", 0x0);
15297 }
15298 if(!isBuiltin || e->next)
15299 ProcessExpressionType(e);
15300 }
15301 source = (exp && (*exp).last) ? ((struct Expression *)(*exp).last)->expType : (((void *)0));
15302 if(isBuiltin || (source && source->kind == 8 && source->_class && source->_class->registered && source->_class->registered != containerClass && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, containerClass)))
15303 {
15304 struct __ecereNameSpace__ecere__com__Class * _class = source ? source->_class->registered : (((void *)0));
15305 struct Symbol * symbol;
15306 struct Expression * expIt = (((void *)0));
15307 unsigned int isMap = 0x0, isArray = 0x0, isLinkList = 0x0, isList = 0x0, isCustomAVLTree = 0x0, isAVLTree = 0x0;
15308 struct __ecereNameSpace__ecere__com__Class * arrayClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "Array");
15309 struct __ecereNameSpace__ecere__com__Class * linkListClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "LinkList");
15310 struct __ecereNameSpace__ecere__com__Class * customAVLTreeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "CustomAVLTree");
15311
15312 stmt->type = 2;
15313 stmt->compound.context = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Context);
15314 stmt->compound.context->parent = curContext;
15315 curContext = stmt->compound.context;
15316 if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, customAVLTreeClass))
15317 {
15318 struct __ecereNameSpace__ecere__com__Class * mapClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "Map");
15319 struct __ecereNameSpace__ecere__com__Class * avlTreeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "AVLTree");
15320
15321 isCustomAVLTree = 0x1;
15322 if(__ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, avlTreeClass))
15323 isAVLTree = 0x1;
15324 else if(__ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, mapClass))
15325 isMap = 0x1;
15326 }
15327 else if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, arrayClass))
15328 isArray = 0x1;
15329 else if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, linkListClass))
15330 {
15331 struct __ecereNameSpace__ecere__com__Class * listClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "List");
15332
15333 isLinkList = 0x1;
15334 isList = __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, listClass);
15335 }
15336 if(isArray)
15337 {
15338 struct Declarator * decl;
15339 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15340
15341 decl = SpecDeclFromString(_class->templateArgs[2].dataTypeString, specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(id)));
15342 stmt->compound.declarations = MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(decl, (((void *)0))))));
15343 ListAdd(stmt->compound.declarations, MkDeclaration(MkListOne(MkSpecifierName(source->_class->registered->fullName)), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internalArray")), MkInitializerAssignment(MkExpBrackets(exp))))));
15344 }
15345 else if(isBuiltin)
15346 {
15347 struct Type * type = (((void *)0));
15348 char typeStringBuf[1024];
15349
15350 arrayExp = (((struct Expression *)(*exp).last)->type == 37) ? (struct Expression *)(*exp).last : ((struct Expression *)(*exp).last)->cast.exp;
15351 if(((struct Expression *)(*exp).last)->type == 11)
15352 {
15353 struct TypeName * typeName = ((struct Expression *)(*exp).last)->cast.typeName;
15354
15355 if(typeName)
15356 arrayExp->destType = ProcessType(typeName->qualifiers, typeName->declarator);
15357 }
15358 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)
15359 {
15360 struct __ecereNameSpace__ecere__com__Class * templateClass = arrayExp->destType->_class->registered;
15361
15362 typeString = templateClass->templateArgs[2].dataTypeString;
15363 }
15364 else if(arrayExp->list)
15365 {
15366 struct Expression * e;
15367
15368 for(e = (*arrayExp->list).first; e; e = e->next)
15369 {
15370 ProcessExpressionType(e);
15371 if(e->expType)
15372 {
15373 if(!type)
15374 {
15375 type = e->expType;
15376 type->refCount++;
15377 }
15378 else
15379 {
15380 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
15381 {
15382 FreeType(type);
15383 type = e->expType;
15384 e->expType = (((void *)0));
15385 e = (*arrayExp->list).first;
15386 ProcessExpressionType(e);
15387 if(e->expType)
15388 {
15389 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
15390 {
15391 FreeType(e->expType);
15392 e->expType = (((void *)0));
15393 FreeType(type);
15394 type = (((void *)0));
15395 break;
15396 }
15397 }
15398 }
15399 }
15400 if(e->expType)
15401 {
15402 FreeType(e->expType);
15403 e->expType = (((void *)0));
15404 }
15405 }
15406 }
15407 if(type)
15408 {
15409 typeStringBuf[0] = '\0';
15410 PrintType(type, typeStringBuf, 0x0, 0x1);
15411 typeString = typeStringBuf;
15412 FreeType(type);
15413 }
15414 }
15415 if(typeString)
15416 {
15417 struct __ecereNameSpace__ecere__sys__OldList * initializers = MkList();
15418 struct Declarator * decl;
15419 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15420
15421 if(arrayExp->list)
15422 {
15423 struct Expression * e;
15424
15425 builtinCount = (*arrayExp->list).count;
15426 type = ProcessTypeString(typeString, 0x0);
15427 while(e = (*arrayExp->list).first)
15428 {
15429 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*arrayExp->list), e);
15430 e->destType = type;
15431 type->refCount++;
15432 ProcessExpressionType(e);
15433 ListAdd(initializers, MkInitializerAssignment(e));
15434 }
15435 FreeType(type);
15436 (__ecereNameSpace__ecere__com__eSystem_Delete(arrayExp->list), arrayExp->list = 0);
15437 }
15438 decl = SpecDeclFromString(typeString, specs, MkDeclaratorIdentifier(id));
15439 stmt->compound.declarations = MkListOne(MkDeclaration(CopyList(specs, CopySpecifier), MkListOne(MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl), (((void *)0))))));
15440 ListAdd(stmt->compound.declarations, MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorArray(PlugDeclarator(decl, MkDeclaratorIdentifier(MkIdentifier("__internalArray"))), (((void *)0))), MkInitializerList(initializers)))));
15441 FreeList(exp, FreeExpression);
15442 }
15443 else
15444 {
15445 arrayExp->expType = ProcessTypeString("Container", 0x0);
15446 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Couldn't determine type of array elements\n", (((void *)0))));
15447 }
15448 }
15449 else if(isLinkList && !isList)
15450 {
15451 struct Declarator * decl;
15452 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15453
15454 decl = SpecDeclFromString(_class->templateArgs[3].dataTypeString, specs, MkDeclaratorIdentifier(id));
15455 stmt->compound.declarations = MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(decl, (((void *)0))))));
15456 ListAdd(stmt->compound.declarations, MkDeclaration(MkListOne(MkSpecifierName(source->_class->registered->fullName)), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internalLinkList")), MkInitializerAssignment(MkExpBrackets(exp))))));
15457 }
15458 else if(_class->templateArgs)
15459 {
15460 if(isMap)
15461 sprintf(iteratorType, "MapIterator<%s, %s >", _class->templateArgs[5].dataTypeString, _class->templateArgs[6].dataTypeString);
15462 else
15463 sprintf(iteratorType, "Iterator<%s, %s >", _class->templateArgs[2].dataTypeString, _class->templateArgs[1].dataTypeString);
15464 stmt->compound.declarations = MkListOne(MkDeclarationInst(MkInstantiationNamed(MkListOne(MkSpecifierName(iteratorType)), MkExpIdentifier(id), MkListOne(MkMembersInitList(MkListOne(MkMemberInit(isMap ? MkListOne(MkIdentifier("map")) : (((void *)0)), MkInitializerAssignment(MkExpBrackets(exp)))))))));
15465 }
15466 symbol = FindSymbol(id->string, curContext, curContext, 0x0, 0x0);
15467 if(block && block->type == 2 && block->compound.context)
15468 {
15469 block->compound.context->parent = stmt->compound.context;
15470 }
15471 if(filter)
15472 {
15473 block = MkIfStmt(filter, block, (((void *)0)));
15474 }
15475 if(isArray)
15476 {
15477 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));
15478 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.init);
15479 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.check);
15480 ProcessExpressionType((*((struct Statement *)(*stmt->compound.statements).first)->forStmt.increment).first);
15481 }
15482 else if(isBuiltin)
15483 {
15484 char count[128];
15485
15486 sprintf(count, "%d", builtinCount);
15487 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));
15488 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.init);
15489 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.check);
15490 ProcessExpressionType((*((struct Statement *)(*stmt->compound.statements).first)->forStmt.increment).first);
15491 }
15492 else if(isLinkList && !isList)
15493 {
15494 struct __ecereNameSpace__ecere__com__Class * typeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, _class->templateArgs[3].dataTypeString);
15495 struct __ecereNameSpace__ecere__com__Class * listItemClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, "ListItem");
15496
15497 if(typeClass && __ecereNameSpace__ecere__com__eClass_IsDerived(typeClass, listItemClass) && _class->templateArgs[5].dataTypeString && !strcmp(_class->templateArgs[5].dataTypeString, "LT::link"))
15498 {
15499 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));
15500 }
15501 else
15502 {
15503 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15504 struct Declarator * decl = SpecDeclFromString(_class->templateArgs[3].dataTypeString, specs, (((void *)0)));
15505
15506 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));
15507 }
15508 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.init);
15509 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.check);
15510 ProcessExpressionType((*((struct Statement *)(*stmt->compound.statements).first)->forStmt.increment).first);
15511 }
15512 else
15513 {
15514 stmt->compound.statements = MkListOne(MkWhileStmt(MkListOne(MkExpCall(MkExpMember(expIt = MkExpIdentifier(CopyIdentifier(id)), MkIdentifier("Next")), (((void *)0)))), block));
15515 }
15516 ProcessExpressionType(expIt);
15517 if((*stmt->compound.declarations).first)
15518 ProcessDeclaration((*stmt->compound.declarations).first);
15519 if(symbol)
15520 symbol->isIterator = isMap ? 2 : ((isArray || isBuiltin) ? 3 : (isLinkList ? (isList ? 5 : 4) : (isCustomAVLTree ? 6 : 1)));
15521 ProcessStatement(stmt);
15522 curContext = stmt->compound.context->parent;
15523 break;
15524 }
15525 else
15526 {
15527 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Expression is not a container\n", (((void *)0))));
15528 }
15529 break;
15530 }
15531 case 9:
15532 break;
15533 case 10:
15534 break;
15535 case 11:
15536 break;
15537 case 12:
15538 {
15539 struct Expression * exp;
15540
15541 if(stmt->expressions)
15542 {
15543 for(exp = (*stmt->expressions).first; exp; exp = exp->next)
15544 {
15545 if(!exp->next)
15546 {
15547 if(curFunction && !curFunction->type)
15548 curFunction->type = ProcessType(curFunction->specifiers, curFunction->declarator);
15549 FreeType(exp->destType);
15550 exp->destType = (curFunction && curFunction->type && curFunction->type->kind == 11) ? curFunction->type->returnType : (((void *)0));
15551 if(exp->destType)
15552 exp->destType->refCount++;
15553 }
15554 ProcessExpressionType(exp);
15555 }
15556 }
15557 break;
15558 }
15559 case 14:
15560 {
15561 ProcessDeclaration(stmt->decl);
15562 break;
15563 }
15564 case 13:
15565 {
15566 struct AsmField * field;
15567
15568 if(stmt->asmStmt.inputFields)
15569 {
15570 for(field = (*stmt->asmStmt.inputFields).first; field; field = field->next)
15571 if(field->expression)
15572 ProcessExpressionType(field->expression);
15573 }
15574 if(stmt->asmStmt.outputFields)
15575 {
15576 for(field = (*stmt->asmStmt.outputFields).first; field; field = field->next)
15577 if(field->expression)
15578 ProcessExpressionType(field->expression);
15579 }
15580 if(stmt->asmStmt.clobberedFields)
15581 {
15582 for(field = (*stmt->asmStmt.clobberedFields).first; field; field = field->next)
15583 {
15584 if(field->expression)
15585 ProcessExpressionType(field->expression);
15586 }
15587 }
15588 break;
15589 }
15590 case 17:
15591 {
15592 struct PropertyWatch * propWatch;
15593 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->_watch.watches;
15594 struct Expression * object = stmt->_watch.object;
15595 struct Expression * watcher = stmt->_watch.watcher;
15596
15597 if(watcher)
15598 ProcessExpressionType(watcher);
15599 if(object)
15600 ProcessExpressionType(object);
15601 if(inCompiler)
15602 {
15603 if(watcher || thisClass)
15604 {
15605 struct External * external = curExternal;
15606 struct Context * context = curContext;
15607
15608 stmt->type = 3;
15609 stmt->expressions = MkList();
15610 curExternal = external->prev;
15611 for(propWatch = (*watches).first; propWatch; propWatch = propWatch->next)
15612 {
15613 struct ClassFunction * func;
15614 char watcherName[1024];
15615 struct __ecereNameSpace__ecere__com__Class * watcherClass = watcher ? ((watcher->expType && watcher->expType->kind == 8 && watcher->expType->_class) ? watcher->expType->_class->registered : (((void *)0))) : thisClass;
15616 struct External * createdExternal;
15617 struct External * externalDecl = MkExternalDeclaration((((void *)0)));
15618
15619 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, externalDecl);
15620 sprintf(watcherName, "__ecerePropertyWatcher_%d", propWatcherID++);
15621 if(propWatch->deleteWatch)
15622 strcat(watcherName, "_delete");
15623 else
15624 {
15625 struct Identifier * propID;
15626
15627 for(propID = (*propWatch->properties).first; propID; propID = propID->next)
15628 {
15629 strcat(watcherName, "_");
15630 strcat(watcherName, propID->string);
15631 }
15632 }
15633 if(object && object->expType && object->expType->kind == 8 && object->expType->_class && object->expType->_class->registered)
15634 {
15635 func = MkClassFunction(MkListOne(MkSpecifier(VOID)), (((void *)0)), MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(watcherName)), MkListOne(MkTypeName(MkListOne(MkSpecifierName(object->expType->_class->string)), MkDeclaratorIdentifier(MkIdentifier("value"))))), (((void *)0)));
15636 ProcessClassFunctionBody(func, propWatch->compound);
15637 propWatch->compound = (((void *)0));
15638 createdExternal = ProcessClassFunction(watcherClass, func, ast, curExternal, 0x1);
15639 createdExternal->symbol->idCode = external->symbol->idCode;
15640 curExternal = createdExternal;
15641 ProcessFunction(createdExternal->function);
15642 {
15643 struct Declaration * decl = MkDeclaration(CopyList(createdExternal->function->specifiers, CopySpecifier), MkListOne(MkInitDeclarator(CopyDeclarator(createdExternal->function->declarator), (((void *)0)))));
15644
15645 externalDecl->declaration = decl;
15646 if(decl->symbol && !decl->symbol->pointerExternal)
15647 decl->symbol->pointerExternal = externalDecl;
15648 }
15649 if(propWatch->deleteWatch)
15650 {
15651 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
15652
15653 ListAdd(args, CopyExpression(object));
15654 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
15655 ListAdd(args, MkExpIdentifier(MkIdentifier(watcherName)));
15656 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_WatchDestruction")), args));
15657 }
15658 else
15659 {
15660 struct __ecereNameSpace__ecere__com__Class * _class = object->expType->_class->registered;
15661 struct Identifier * propID;
15662
15663 for(propID = (*propWatch->properties).first; propID; propID = propID->next)
15664 {
15665 char propName[1024];
15666 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
15667
15668 if(prop)
15669 {
15670 char getName[1024], setName[1024];
15671 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
15672
15673 DeclareProperty(prop, setName, getName);
15674 strcpy(propName, "__ecereProp_");
15675 FullClassNameCat(propName, prop->_class->fullName, 0x0);
15676 strcat(propName, "_");
15677 FullClassNameCat(propName, prop->name, 0x1);
15678 ListAdd(args, CopyExpression(object));
15679 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
15680 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
15681 ListAdd(args, MkExpIdentifier(MkIdentifier(watcherName)));
15682 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_Watch")), args));
15683 }
15684 else
15685 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Property %s not found in class %s\n", (((void *)0))), prop->name, _class->fullName);
15686 }
15687 }
15688 }
15689 else
15690 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Invalid watched object\n", (((void *)0))));
15691 }
15692 curExternal = external;
15693 curContext = context;
15694 if(watcher)
15695 FreeExpression(watcher);
15696 if(object)
15697 FreeExpression(object);
15698 FreeList(watches, FreePropertyWatch);
15699 }
15700 else
15701 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "No observer specified and not inside a _class\n", (((void *)0))));
15702 }
15703 else
15704 {
15705 for(propWatch = (*watches).first; propWatch; propWatch = propWatch->next)
15706 {
15707 ProcessStatement(propWatch->compound);
15708 }
15709 }
15710 break;
15711 }
15712 case 15:
15713 {
15714 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->_watch.watches;
15715 struct Expression * object = stmt->_watch.object;
15716 struct __ecereNameSpace__ecere__com__Class * _class;
15717
15718 if(object)
15719 ProcessExpressionType(object);
15720 if(inCompiler)
15721 {
15722 _class = object ? ((object->expType && object->expType->kind == 8 && object->expType->_class) ? object->expType->_class->registered : (((void *)0))) : thisClass;
15723 if(_class)
15724 {
15725 struct Identifier * propID;
15726
15727 stmt->type = 3;
15728 stmt->expressions = MkList();
15729 if(!watches && curFunction->propSet && (!object || (object->type == 0 && !strcmp(object->identifier->string, "this"))))
15730 {
15731 watches = MkListOne(MkIdentifier(curFunction->propSet->string));
15732 }
15733 else if(!watches)
15734 {
15735 }
15736 if(watches)
15737 {
15738 for(propID = (*watches).first; propID; propID = propID->next)
15739 {
15740 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
15741
15742 if(prop)
15743 {
15744 CreateFireWatcher(prop, object, stmt);
15745 }
15746 else
15747 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Property %s not found in class %s\n", (((void *)0))), propID->string, _class->fullName);
15748 }
15749 }
15750 else
15751 {
15752 struct __ecereNameSpace__ecere__com__Property * prop;
15753 struct __ecereNameSpace__ecere__com__Class * base;
15754
15755 for(base = _class; base; base = base->base)
15756 {
15757 for(prop = base->membersAndProperties.first; prop; prop = prop->next)
15758 {
15759 if(prop->isProperty && prop->isWatchable)
15760 {
15761 CreateFireWatcher(prop, object, stmt);
15762 }
15763 }
15764 }
15765 }
15766 if(object)
15767 FreeExpression(object);
15768 FreeList(watches, FreeIdentifier);
15769 }
15770 else
15771 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Invalid object specified and not inside a class\n", (((void *)0))));
15772 }
15773 break;
15774 }
15775 case 16:
15776 {
15777 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->_watch.watches;
15778 struct Expression * object = stmt->_watch.object;
15779 struct Expression * watcher = stmt->_watch.watcher;
15780 struct __ecereNameSpace__ecere__com__Class * _class;
15781
15782 if(object)
15783 ProcessExpressionType(object);
15784 if(watcher)
15785 ProcessExpressionType(watcher);
15786 if(inCompiler)
15787 {
15788 _class = (object && object->expType && object->expType->kind == 8 && object->expType->_class) ? object->expType->_class->registered : (((void *)0));
15789 if(watcher || thisClass)
15790 {
15791 if(_class)
15792 {
15793 struct Identifier * propID;
15794
15795 stmt->type = 3;
15796 stmt->expressions = MkList();
15797 if(!watches)
15798 {
15799 struct __ecereNameSpace__ecere__sys__OldList * args;
15800
15801 args = MkList();
15802 ListAdd(args, CopyExpression(object));
15803 ListAdd(args, MkExpConstant("0"));
15804 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
15805 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_StopWatching")), args));
15806 }
15807 else
15808 {
15809 for(propID = (*watches).first; propID; propID = propID->next)
15810 {
15811 char propName[1024];
15812 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
15813
15814 if(prop)
15815 {
15816 char getName[1024], setName[1024];
15817 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
15818
15819 DeclareProperty(prop, setName, getName);
15820 strcpy(propName, "__ecereProp_");
15821 FullClassNameCat(propName, prop->_class->fullName, 0x0);
15822 strcat(propName, "_");
15823 FullClassNameCat(propName, prop->name, 0x1);
15824 MangleClassName(propName);
15825 ListAdd(args, CopyExpression(object));
15826 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
15827 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
15828 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_StopWatching")), args));
15829 }
15830 else
15831 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Property %s not found in class %s\n", (((void *)0))), prop->name, _class->fullName);
15832 }
15833 }
15834 if(object)
15835 FreeExpression(object);
15836 if(watcher)
15837 FreeExpression(watcher);
15838 FreeList(watches, FreeIdentifier);
15839 }
15840 else
15841 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Invalid object specified and not inside a class\n", (((void *)0))));
15842 }
15843 else
15844 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "No observer specified and not inside a class\n", (((void *)0))));
15845 }
15846 break;
15847 }
15848 }
15849 }
15850
15851 extern struct Expression * QBrackets(struct Expression * exp);
15852
15853 extern struct TypeName * QMkType(char *  spec, struct Declarator * decl);
15854
15855 extern struct Declarator * QMkPtrDecl(char *  id);
15856
15857 extern struct Expression * MkExpPointer(struct Expression * expression, struct Identifier * member);
15858
15859 extern struct Expression * QMkExpCond(struct Expression * cond, struct Expression * exp, struct Expression * elseExp);
15860
15861 extern struct Statement * MkFireWatchersStmt(struct Expression * object, struct __ecereNameSpace__ecere__sys__OldList * watches);
15862
15863 static void ProcessFunction(struct FunctionDefinition * function)
15864 {
15865 void * __ecereTemp2;
15866 void * __ecereTemp1;
15867 struct Identifier * id = GetDeclId(function->declarator);
15868 struct Symbol * symbol = function->declarator ? function->declarator->symbol : (((void *)0));
15869 struct Type * type = symbol ? symbol->type : (((void *)0));
15870 struct __ecereNameSpace__ecere__com__Class * oldThisClass = thisClass;
15871 struct Context * oldTopContext = topContext;
15872
15873 yylloc = function->loc;
15874 if(type && type->thisClass)
15875 {
15876 struct Symbol * classSym = type->thisClass;
15877 struct __ecereNameSpace__ecere__com__Class * _class = type->thisClass->registered;
15878 char className[1024];
15879 char structName[1024];
15880 struct Declarator * funcDecl;
15881 struct Symbol * thisSymbol;
15882 unsigned int typedObject = 0x0;
15883
15884 if(_class && !_class->base)
15885 {
15886 _class = currentClass;
15887 if(_class && !_class->symbol)
15888 _class->symbol = FindClass(_class->fullName);
15889 classSym = _class ? _class->symbol : (((void *)0));
15890 typedObject = 0x1;
15891 }
15892 thisClass = _class;
15893 if(inCompiler && _class)
15894 {
15895 if(type->kind == 11)
15896 {
15897 if(symbol->type->params.count == 1 && ((struct Type *)symbol->type->params.first)->kind == 0)
15898 {
15899 struct Type * param = symbol->type->params.first;
15900
15901 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(&symbol->type->params, param);
15902 FreeType(param);
15903 }
15904 if(type->classObjectType != 1)
15905 {
15906 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(&symbol->type->params, (((void *)0)), MkClassType(_class->fullName));
15907 symbol->type->staticMethod = 0x1;
15908 symbol->type->thisClass = (((void *)0));
15909 symbol->type->extraParam = 0x0;
15910 }
15911 }
15912 strcpy(className, "__ecereClass_");
15913 FullClassNameCat(className, _class->fullName, 0x1);
15914 MangleClassName(className);
15915 structName[0] = (char)0;
15916 FullClassNameCat(structName, _class->fullName, 0x0);
15917 funcDecl = GetFuncDecl(function->declarator);
15918 if(funcDecl)
15919 {
15920 if(funcDecl->function.parameters && (*funcDecl->function.parameters).count == 1)
15921 {
15922 struct TypeName * param = (*funcDecl->function.parameters).first;
15923
15924 if(param->qualifiers && (*param->qualifiers).count == 1 && ((struct Specifier *)(*param->qualifiers).first)->specifier == VOID && !param->declarator)
15925 {
15926 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->function.parameters), param);
15927 FreeTypeName(param);
15928 }
15929 }
15930 if(!function->propertyNoThis)
15931 {
15932 struct TypeName * thisParam;
15933
15934 if(type->classObjectType != 1)
15935 {
15936 thisParam = QMkClass(_class->fullName, MkDeclaratorIdentifier(MkIdentifier("this")));
15937 if(!funcDecl->function.parameters)
15938 funcDecl->function.parameters = MkList();
15939 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
15940 }
15941 if(typedObject)
15942 {
15943 if(type->classObjectType != 1)
15944 {
15945 if(type->byReference || _class->type == 3 || _class->type == 1000 || _class->type == 4 || _class->type == 2)
15946 thisParam->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), thisParam->declarator);
15947 }
15948 thisParam = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TypeName), ((struct TypeName *)__ecereTemp1)->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier("class"))), ((struct TypeName *)__ecereTemp1)->qualifiers = MkListOne(MkStructOrUnion(3, MkIdentifier("__ecereNameSpace__ecere__com__Class"), (((void *)0)))), ((struct TypeName *)__ecereTemp1));
15949 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
15950 }
15951 }
15952 }
15953 if(symbol && symbol->pointerExternal && symbol->pointerExternal->type == 1)
15954 {
15955 struct InitDeclarator * initDecl = (*symbol->pointerExternal->declaration->declarators).first;
15956
15957 funcDecl = GetFuncDecl(initDecl->declarator);
15958 if(funcDecl)
15959 {
15960 if(funcDecl->function.parameters && (*funcDecl->function.parameters).count == 1)
15961 {
15962 struct TypeName * param = (*funcDecl->function.parameters).first;
15963
15964 if(param->qualifiers && (*param->qualifiers).count == 1 && ((struct Specifier *)(*param->qualifiers).first)->specifier == VOID && !param->declarator)
15965 {
15966 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->function.parameters), param);
15967 FreeTypeName(param);
15968 }
15969 }
15970 if(type->classObjectType != 1)
15971 {
15972 if((_class->type != 2 && _class->type != 3 && _class->type != 4) || function != (struct FunctionDefinition *)symbol->externalSet)
15973 {
15974 struct TypeName * thisParam = QMkClass(_class->fullName, MkDeclaratorIdentifier(MkIdentifier("this")));
15975
15976 if(!funcDecl->function.parameters)
15977 funcDecl->function.parameters = MkList();
15978 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
15979 }
15980 }
15981 }
15982 }
15983 }
15984 if(function->body)
15985 {
15986 if(type->classObjectType != 1)
15987 {
15988 thisSymbol = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), ((struct Symbol *)__ecereTemp1)->string = __ecereNameSpace__ecere__sys__CopyString("this"), ((struct Symbol *)__ecereTemp1)->type = classSym ? MkClassType(classSym->string) : (((void *)0)), ((struct Symbol *)__ecereTemp1));
15989 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&function->body->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
15990 if(typedObject && thisSymbol->type)
15991 {
15992 thisSymbol->type->classObjectType = 2;
15993 thisSymbol->type->byReference = type->byReference;
15994 }
15995 }
15996 }
15997 if(inCompiler && _class && (_class->type == 0) && type->classObjectType != 1)
15998 {
15999 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
16000
16001 {
16002 struct __ecereNameSpace__ecere__com__Class * base;
16003
16004 for(base = _class; base && base->type != 1000; base = base->next)
16005 {
16006 for(member = base->membersAndProperties.first; member; member = member->next)
16007 if(!member->isProperty)
16008 break;
16009 if(member)
16010 break;
16011 }
16012 }
16013 for(member = _class->membersAndProperties.first; member; member = member->next)
16014 if(!member->isProperty)
16015 break;
16016 if(member)
16017 {
16018 char pointerName[1024];
16019 struct Declaration * decl;
16020 struct Initializer * initializer;
16021 struct Expression * exp, * bytePtr;
16022
16023 strcpy(pointerName, "__ecerePointer_");
16024 FullClassNameCat(pointerName, _class->fullName, 0x0);
16025 {
16026 char className[1024];
16027
16028 strcpy(className, "__ecereClass_");
16029 FullClassNameCat(className, classSym->string, 0x1);
16030 MangleClassName(className);
16031 DeclareClass(classSym, className);
16032 }
16033 bytePtr = QBrackets(MkExpCast(QMkType("char", QMkPtrDecl((((void *)0)))), QMkExpId("this")));
16034 if(_class->fixed)
16035 {
16036 char string[256];
16037
16038 sprintf(string, "%d", _class->offset);
16039 exp = QBrackets(MkExpOp(bytePtr, '+', MkExpConstant(string)));
16040 }
16041 else
16042 {
16043 exp = QBrackets(MkExpOp(bytePtr, '+', MkExpPointer(QMkExpId(className), MkIdentifier("offset"))));
16044 }
16045 exp = QBrackets(QMkExpCond(QMkExpId("this"), exp, MkExpConstant("0")));
16046 exp->expType = (__ecereTemp2 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp2)->refCount = 1, ((struct Type *)__ecereTemp2)->kind = 13, ((struct Type *)__ecereTemp2)->type = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1)->kind = 0, ((struct Type *)__ecereTemp1)), ((struct Type *)__ecereTemp2));
16047 if(function->body)
16048 {
16049 yylloc = function->body->loc;
16050 initializer = MkInitializerAssignment(MkExpCast(MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(structName), (((void *)0)))), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), exp));
16051 {
16052 struct Context * prevContext = curContext;
16053
16054 curContext = function->body->compound.context;
16055 decl = MkDeclaration(MkListOne(MkStructOrUnion(3, MkIdentifier(structName), (((void *)0)))), MkListOne(MkInitDeclarator(QMkPtrDecl(pointerName), initializer)));
16056 curContext = prevContext;
16057 }
16058 decl->symbol = (((void *)0));
16059 if(!function->body->compound.declarations)
16060 function->body->compound.declarations = MkList();
16061 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*function->body->compound.declarations), (((void *)0)), decl);
16062 }
16063 }
16064 }
16065 }
16066 else
16067 thisClass = (((void *)0));
16068 if(id)
16069 {
16070 FreeSpecifier(id->_class);
16071 id->_class = (((void *)0));
16072 if(symbol && symbol->pointerExternal && symbol->pointerExternal->type == 1)
16073 {
16074 struct InitDeclarator * initDecl = (*symbol->pointerExternal->declaration->declarators).first;
16075
16076 id = GetDeclId(initDecl->declarator);
16077 FreeSpecifier(id->_class);
16078 id->_class = (((void *)0));
16079 }
16080 }
16081 if(function->body)
16082 topContext = function->body->compound.context;
16083 {
16084 struct FunctionDefinition * oldFunction = curFunction;
16085
16086 curFunction = function;
16087 if(function->body)
16088 ProcessStatement(function->body);
16089 if(inCompiler && function->propSet && !function->propSet->fireWatchersDone)
16090 {
16091 struct Statement * prevCompound = curCompound;
16092 struct Context * prevContext = curContext;
16093 struct Statement * fireWatchers = MkFireWatchersStmt((((void *)0)), (((void *)0)));
16094
16095 if(!function->body->compound.statements)
16096 function->body->compound.statements = MkList();
16097 ListAdd(function->body->compound.statements, fireWatchers);
16098 curCompound = function->body;
16099 curContext = function->body->compound.context;
16100 ProcessStatement(fireWatchers);
16101 curContext = prevContext;
16102 curCompound = prevCompound;
16103 }
16104 curFunction = oldFunction;
16105 }
16106 if(function->declarator)
16107 {
16108 ProcessDeclarator(function->declarator);
16109 }
16110 topContext = oldTopContext;
16111 thisClass = oldThisClass;
16112 }
16113
16114 extern void FreeSymbol(struct Symbol * symbol);
16115
16116 void __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Remove(struct __ecereNameSpace__ecere__sys__BinaryTree * this, struct __ecereNameSpace__ecere__sys__BTNode * node);
16117
16118 static void ProcessClass(struct __ecereNameSpace__ecere__sys__OldList * definitions, struct Symbol * symbol)
16119 {
16120 struct ClassDef * def;
16121 struct External * external = curExternal;
16122 struct __ecereNameSpace__ecere__com__Class * regClass = symbol ? symbol->registered : (((void *)0));
16123
16124 for(def = definitions->first; def; def = def->next)
16125 {
16126 if(def->type == 0)
16127 {
16128 if(def->function->declarator)
16129 curExternal = def->function->declarator->symbol->pointerExternal;
16130 else
16131 curExternal = external;
16132 ProcessFunction((struct FunctionDefinition *)def->function);
16133 }
16134 else if(def->type == 2)
16135 {
16136 if(def->decl->type == 2)
16137 {
16138 thisClass = regClass;
16139 ProcessInstantiationType(def->decl->inst);
16140 thisClass = (((void *)0));
16141 }
16142 else
16143 {
16144 struct __ecereNameSpace__ecere__com__Class * backThisClass = thisClass;
16145
16146 if(regClass)
16147 thisClass = regClass;
16148 ProcessDeclaration(def->decl);
16149 thisClass = backThisClass;
16150 }
16151 }
16152 else if(def->type == 1 && def->defProperties)
16153 {
16154 struct MemberInit * defProperty;
16155 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);
16156
16157 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
16158 for(defProperty = (*def->defProperties).first; defProperty; defProperty = defProperty->next)
16159 {
16160 thisClass = regClass;
16161 ProcessMemberInitData(defProperty, regClass, (((void *)0)), (((void *)0)), (((void *)0)), (((void *)0)));
16162 thisClass = (((void *)0));
16163 }
16164 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Remove(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
16165 FreeSymbol(thisSymbol);
16166 }
16167 else if(def->type == 3 && def->propertyDef)
16168 {
16169 struct PropertyDef * prop = def->propertyDef;
16170
16171 thisClass = regClass;
16172 if(prop->setStmt)
16173 {
16174 if(regClass)
16175 {
16176 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
16177
16178 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->setStmt->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
16179 }
16180 curExternal = prop->symbol ? prop->symbol->externalSet : (((void *)0));
16181 ProcessStatement(prop->setStmt);
16182 }
16183 if(prop->getStmt)
16184 {
16185 if(regClass)
16186 {
16187 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
16188
16189 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->getStmt->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
16190 }
16191 curExternal = prop->symbol ? prop->symbol->externalGet : (((void *)0));
16192 ProcessStatement(prop->getStmt);
16193 }
16194 if(prop->issetStmt)
16195 {
16196 if(regClass)
16197 {
16198 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
16199
16200 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->issetStmt->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
16201 }
16202 curExternal = prop->symbol ? prop->symbol->externalIsSet : (((void *)0));
16203 ProcessStatement(prop->issetStmt);
16204 }
16205 thisClass = (((void *)0));
16206 }
16207 else if(def->type == 4 && def->propertyWatch)
16208 {
16209 struct PropertyWatch * propertyWatch = def->propertyWatch;
16210
16211 thisClass = regClass;
16212 if(propertyWatch->compound)
16213 {
16214 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);
16215
16216 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&propertyWatch->compound->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
16217 curExternal = (((void *)0));
16218 ProcessStatement(propertyWatch->compound);
16219 }
16220 thisClass = (((void *)0));
16221 }
16222 }
16223 }
16224
16225 void DeclareFunctionUtil(char * s)
16226 {
16227 struct __ecereNameSpace__ecere__com__GlobalFunction * function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, s);
16228
16229 if(function)
16230 {
16231 char name[1024];
16232
16233 name[0] = (char)0;
16234 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + 12)))->importType != 1 && (!function->dataType || !function->dataType->dllExport))
16235 strcpy(name, "__ecereFunction_");
16236 FullClassNameCat(name, s, 0x0);
16237 DeclareFunction(function, name);
16238 }
16239 }
16240
16241 extern struct __ecereNameSpace__ecere__com__Instance * GetPrivateModule(void);
16242
16243 void ComputeDataTypes()
16244 {
16245 void * __ecereTemp1;
16246 struct External * external;
16247 struct External * temp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_External);
16248
16249 currentClass = (((void *)0));
16250 containerClass = __ecereNameSpace__ecere__com__eSystem_FindClass(GetPrivateModule(), "Container");
16251 temp->symbol = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), ((struct Symbol *)__ecereTemp1)->id = -1000, ((struct Symbol *)__ecereTemp1)->idCode = -1000, ((struct Symbol *)__ecereTemp1));
16252 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), (((void *)0)), temp);
16253 curExternal = temp;
16254 DeclareFunctionUtil("eSystem_New");
16255 DeclareFunctionUtil("eSystem_New0");
16256 DeclareFunctionUtil("eSystem_Renew");
16257 DeclareFunctionUtil("eSystem_Renew0");
16258 DeclareFunctionUtil("eClass_GetProperty");
16259 DeclareStruct("ecere::com::Class", 0x0);
16260 DeclareStruct("ecere::com::Instance", 0x0);
16261 DeclareStruct("ecere::com::Property", 0x0);
16262 DeclareStruct("ecere::com::DataMember", 0x0);
16263 DeclareStruct("ecere::com::Method", 0x0);
16264 DeclareStruct("ecere::com::SerialBuffer", 0x0);
16265 DeclareStruct("ecere::com::ClassTemplateArgument", 0x0);
16266 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*ast), temp);
16267 for(external = (*ast).first; external; external = external->next)
16268 {
16269 afterExternal = curExternal = external;
16270 if(external->type == 0)
16271 {
16272 currentClass = external->function->_class;
16273 ProcessFunction(external->function);
16274 }
16275 else if(external->type == 1)
16276 {
16277 currentClass = (((void *)0));
16278 ProcessDeclaration(external->declaration);
16279 }
16280 else if(external->type == 2)
16281 {
16282 struct ClassDefinition * _class = external->_class;
16283
16284 currentClass = external->symbol->registered;
16285 if(_class->definitions)
16286 {
16287 ProcessClass(_class->definitions, _class->symbol);
16288 }
16289 if(inCompiler)
16290 {
16291 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*ast), external);
16292 ((external ? (__ecereClass_External->Destructor ? __ecereClass_External->Destructor(external) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(external)) : 0), external = 0);
16293 }
16294 }
16295 else if(external->type == 4)
16296 {
16297 thisNameSpace = external->id->string;
16298 }
16299 }
16300 currentClass = (((void *)0));
16301 thisNameSpace = (((void *)0));
16302 ((temp->symbol ? (__ecereClass_Symbol->Destructor ? __ecereClass_Symbol->Destructor(temp->symbol) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(temp->symbol)) : 0), temp->symbol = 0);
16303 ((temp ? (__ecereClass_External->Destructor ? __ecereClass_External->Destructor(temp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(temp)) : 0), temp = 0);
16304 }
16305
16306 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);
16307
16308 extern struct __ecereNameSpace__ecere__com__Class * __ecereNameSpace__ecere__com__eSystem_RegisterClass(int type, char *  name, char *  baseName, int size, int sizeClass, unsigned int (* )(void * ), void (* )(void * ), struct __ecereNameSpace__ecere__com__Instance * module, int declMode, int inheritanceAccess);
16309
16310 void __ecereRegisterModule_pass15(struct __ecereNameSpace__ecere__com__Instance * module)
16311 {
16312 struct __ecereNameSpace__ecere__com__Class * class;
16313
16314 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetYydebug", "void SetYydebug(bool b)", SetYydebug, module, 1);
16315 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetThisClass", "void SetThisClass(ecere::com::Class c)", SetThisClass, module, 1);
16316 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetThisClass", "ecere::com::Class GetThisClass(void)", GetThisClass, module, 1);
16317 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintExpression", "void PrintExpression(Expression exp, char * string)", PrintExpression, module, 1);
16318 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessTemplateParameterType", "Type ProcessTemplateParameterType(TemplateParameter param)", ProcessTemplateParameterType, module, 2);
16319 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("NeedCast", "bool NeedCast(Type type1, Type type2)", NeedCast, module, 2);
16320 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintInt", "char * PrintInt(int64 result)", PrintInt, module, 1);
16321 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUInt", "char * PrintUInt(uint64 result)", PrintUInt, module, 1);
16322 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintInt64", "char * PrintInt64(int64 result)", PrintInt64, module, 1);
16323 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUInt64", "char * PrintUInt64(uint64 result)", PrintUInt64, module, 1);
16324 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintHexUInt", "char * PrintHexUInt(uint64 result)", PrintHexUInt, module, 1);
16325 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintHexUInt64", "char * PrintHexUInt64(uint64 result)", PrintHexUInt64, module, 1);
16326 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintShort", "char * PrintShort(short result)", PrintShort, module, 1);
16327 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUShort", "char * PrintUShort(uint16 result)", PrintUShort, module, 1);
16328 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintChar", "char * PrintChar(char result)", PrintChar, module, 1);
16329 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUChar", "char * PrintUChar(byte result)", PrintUChar, module, 1);
16330 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintFloat", "char * PrintFloat(float result)", PrintFloat, module, 1);
16331 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintDouble", "char * PrintDouble(double result)", PrintDouble, module, 1);
16332 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetInt", "bool GetInt(Expression exp, int * value2)", GetInt, module, 1);
16333 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUInt", "bool GetUInt(Expression exp, uint * value2)", GetUInt, module, 1);
16334 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetInt64", "bool GetInt64(Expression exp, int64 * value2)", GetInt64, module, 1);
16335 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUInt64", "bool GetUInt64(Expression exp, uint64 * value2)", GetUInt64, module, 1);
16336 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetIntPtr", "bool GetIntPtr(Expression exp, intptr * value2)", GetIntPtr, module, 1);
16337 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUIntPtr", "bool GetUIntPtr(Expression exp, uintptr * value2)", GetUIntPtr, module, 1);
16338 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetShort", "bool GetShort(Expression exp, short * value2)", GetShort, module, 1);
16339 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUShort", "bool GetUShort(Expression exp, uint16 * value2)", GetUShort, module, 1);
16340 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetChar", "bool GetChar(Expression exp, char * value2)", GetChar, module, 1);
16341 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUChar", "bool GetUChar(Expression exp, byte * value2)", GetUChar, module, 1);
16342 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetFloat", "bool GetFloat(Expression exp, float * value2)", GetFloat, module, 1);
16343 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetDouble", "bool GetDouble(Expression exp, double * value2)", GetDouble, module, 1);
16344 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeClassMembers", "void ComputeClassMembers(ecere::com::Class _class, bool isMember)", ComputeClassMembers, module, 2);
16345 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeModuleClasses", "void ComputeModuleClasses(ecere::com::Module module)", ComputeModuleClasses, module, 1);
16346 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeTypeSize", "int ComputeTypeSize(Type type)", ComputeTypeSize, module, 1);
16347 __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);
16348 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareStruct", "void DeclareStruct(char * name, bool skipNoHead)", DeclareStruct, module, 2);
16349 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareProperty", "void DeclareProperty(ecere::com::Property prop, char * setName, char * getName)", DeclareProperty, module, 2);
16350 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("Dereference", "Type Dereference(Type source)", Dereference, module, 1);
16351 __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);
16352 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessInstantiationType", "void ProcessInstantiationType(Instantiation inst)", ProcessInstantiationType, module, 2);
16353 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindTemplateArg", "ecere::com::ClassTemplateArgument * FindTemplateArg(ecere::com::Class _class, TemplateParameter param)", FindTemplateArg, module, 2);
16354 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetupTemplatesContext", "Context SetupTemplatesContext(ecere::com::Class _class)", SetupTemplatesContext, module, 1);
16355 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FinishTemplatesContext", "void FinishTemplatesContext(Context context)", FinishTemplatesContext, module, 1);
16356 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessMethodType", "void ProcessMethodType(ecere::com::Method method)", ProcessMethodType, module, 1);
16357 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessPropertyType", "void ProcessPropertyType(ecere::com::Property prop)", ProcessPropertyType, module, 1);
16358 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareMethod", "void DeclareMethod(ecere::com::Method method, char * name)", DeclareMethod, module, 1);
16359 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClass", "char * ReplaceThisClass(ecere::com::Class _class)", ReplaceThisClass, module, 2);
16360 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClassType", "Type ReplaceThisClassType(ecere::com::Class _class)", ReplaceThisClassType, module, 2);
16361 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClassSpecifiers", "void ReplaceThisClassSpecifiers(ecere::sys::OldList specs, ecere::com::Class _class)", ReplaceThisClassSpecifiers, module, 2);
16362 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareFunction", "bool DeclareFunction(ecere::com::GlobalFunction function, char * name)", DeclareFunction, module, 2);
16363 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareGlobalData", "void DeclareGlobalData(GlobalData data)", DeclareGlobalData, module, 2);
16364 class = __ecereNameSpace__ecere__com__eSystem_RegisterClass(5, "Conversion", 0, sizeof(struct Conversion), 0, 0, 0, module, 2, 1);
16365 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + 12)))->application == ((struct __ecereNameSpace__ecere__com__Module *)(((char *)__thisModule + 12)))->application && class)
16366 __ecereClass_Conversion = class;
16367 __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);
16368 __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);
16369 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ModuleVisibility", "bool ModuleVisibility(ecere::com::Module searchIn, ecere::com::Module searchFor)", ModuleVisibility, module, 1);
16370 __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);
16371 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("MatchTypeExpression", "bool MatchTypeExpression(Expression sourceExp, Type dest, ecere::sys::OldList conversions, bool skipUnitBla)", MatchTypeExpression, module, 2);
16372 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReadString", "void ReadString(char * output, char * string)", ReadString, module, 1);
16373 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOperand", "Operand GetOperand(Expression exp)", GetOperand, module, 1);
16374 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PopulateInstance", "void PopulateInstance(Instantiation inst)", PopulateInstance, module, 1);
16375 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeInstantiation", "void ComputeInstantiation(Expression exp)", ComputeInstantiation, module, 1);
16376 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CallOperator", "void CallOperator(Expression exp, Expression exp1, Expression exp2, Operand op1, Operand op2)", CallOperator, module, 1);
16377 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeExpression", "void ComputeExpression(Expression exp)", ComputeExpression, module, 1);
16378 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CheckTemplateTypes", "void CheckTemplateTypes(Expression exp)", CheckTemplateTypes, module, 1);
16379 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindSymbol", "Symbol FindSymbol(char * name, Context startContext, Context endContext, bool isStruct, bool globalNameSpace)", FindSymbol, module, 1);
16380 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintType", "void PrintType(Type type, char * string, bool printName, bool fullName)", PrintType, module, 1);
16381 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindMemberAndOffset", "Type FindMemberAndOffset(Type type, char * string, uint * offset)", FindMemberAndOffset, module, 1);
16382 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ParseExpressionString", "Expression ParseExpressionString(char * expression)", ParseExpressionString, module, 1);
16383 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceExpContents", "void ReplaceExpContents(Expression checkedExp, Expression newExp)", ReplaceExpContents, module, 1);
16384 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ApplyAnyObjectLogic", "void ApplyAnyObjectLogic(Expression e)", ApplyAnyObjectLogic, module, 1);
16385 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessExpressionType", "void ProcessExpressionType(Expression exp)", ProcessExpressionType, module, 1);
16386 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareFunctionUtil", "void DeclareFunctionUtil(String s)", DeclareFunctionUtil, module, 1);
16387 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeDataTypes", "void ComputeDataTypes(void)", ComputeDataTypes, module, 1);
16388 }
16389
16390 void __ecereUnregisterModule_pass15(struct __ecereNameSpace__ecere__com__Instance * module)
16391 {
16392
16393 }
16394