compiler/bootstrap: Further updates
[sdk] / compiler / bootstrap / libec / bootstrap / pass15.c
1 #if defined(__GNUC__)
2 typedef long long int64;
3 typedef unsigned long long uint64;
4 #elif defined(__TINYC__)
5 #include <stdarg.h>
6 #define __builtin_va_list va_list
7 #define __builtin_va_start va_start
8 #define __builtin_va_end va_end
9 #ifdef _WIN32
10 #define strcasecmp stricmp
11 #define strncasecmp strnicmp
12 #define __declspec(x) __attribute__((x))
13 #endif
14 typedef long long int64;
15 typedef unsigned long long uint64;
16 #else
17 typedef __int64 int64;
18 typedef unsigned __int64 uint64;
19 #endif
20 #ifdef __BIG_ENDIAN__
21 #define __ENDIAN_PAD(x) (8 - (x))
22 #else
23 #define __ENDIAN_PAD(x) 0
24 #endif
25 #include <stdint.h>
26 extern void *  __ecereNameSpace__ecere__com__eSystem_New(unsigned int size);
27
28 extern void *  __ecereNameSpace__ecere__com__eSystem_New0(unsigned int size);
29
30 extern void *  __ecereNameSpace__ecere__com__eSystem_Renew(void *  memory, unsigned int size);
31
32 extern void *  __ecereNameSpace__ecere__com__eSystem_Renew0(void *  memory, unsigned int size);
33
34 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__BTNode;
35
36 struct __ecereNameSpace__ecere__sys__BTNode;
37
38 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__BinaryTree;
39
40 struct __ecereNameSpace__ecere__sys__BinaryTree
41 {
42 struct __ecereNameSpace__ecere__sys__BTNode * root;
43 int count;
44 int (*  CompareKey)(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, uintptr_t a, uintptr_t b);
45 void (*  FreeKey)(void *  key);
46 } __attribute__ ((gcc_struct));
47
48 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__OldList;
49
50 struct __ecereNameSpace__ecere__sys__OldList
51 {
52 void *  first;
53 void *  last;
54 int count;
55 unsigned int offset;
56 unsigned int circ;
57 } __attribute__ ((gcc_struct));
58
59 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Method;
60
61 struct __ecereNameSpace__ecere__com__Method
62 {
63 char *  name;
64 struct __ecereNameSpace__ecere__com__Method * parent;
65 struct __ecereNameSpace__ecere__com__Method * left;
66 struct __ecereNameSpace__ecere__com__Method * right;
67 int depth;
68 int (*  function)();
69 int vid;
70 int type;
71 struct __ecereNameSpace__ecere__com__Class * _class;
72 void *  symbol;
73 char *  dataTypeString;
74 struct Type * dataType;
75 int memberAccess;
76 } __attribute__ ((gcc_struct));
77
78 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Property;
79
80 struct __ecereNameSpace__ecere__com__Property
81 {
82 struct __ecereNameSpace__ecere__com__Property * prev;
83 struct __ecereNameSpace__ecere__com__Property * next;
84 char *  name;
85 unsigned int isProperty;
86 int memberAccess;
87 int id;
88 struct __ecereNameSpace__ecere__com__Class * _class;
89 char *  dataTypeString;
90 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
91 struct Type * dataType;
92 void (*  Set)();
93 int (*  Get)();
94 unsigned int (*  IsSet)();
95 void *  data;
96 void *  symbol;
97 int vid;
98 unsigned int conversion;
99 unsigned int watcherOffset;
100 char *  category;
101 unsigned int compiled;
102 unsigned int selfWatchable;
103 unsigned int isWatchable;
104 } __attribute__ ((gcc_struct));
105
106 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_CodePosition;
107
108 struct CodePosition
109 {
110 int line;
111 int charPos;
112 int pos;
113 unsigned int included;
114 } __attribute__ ((gcc_struct));
115
116 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Location;
117
118 struct Location
119 {
120 struct CodePosition start;
121 struct CodePosition end;
122 } __attribute__ ((gcc_struct));
123
124 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Attrib;
125
126 struct Attrib;
127
128 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ExtDecl;
129
130 struct ExtDecl
131 {
132 struct Location loc;
133 int type;
134 union
135 {
136 char * s;
137 struct Attrib * attr;
138 } __attribute__ ((gcc_struct));
139 } __attribute__ ((gcc_struct));
140
141 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassDefinition;
142
143 struct ClassDefinition
144 {
145 struct ClassDefinition * prev;
146 struct ClassDefinition * next;
147 struct Location loc;
148 struct Specifier * _class;
149 struct __ecereNameSpace__ecere__sys__OldList *  baseSpecs;
150 struct __ecereNameSpace__ecere__sys__OldList *  definitions;
151 struct Symbol * symbol;
152 struct Location blockStart;
153 struct Location nameLoc;
154 int endid;
155 int declMode;
156 unsigned int deleteWatchable;
157 } __attribute__ ((gcc_struct));
158
159 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Context;
160
161 struct Context
162 {
163 struct Context * parent;
164 struct __ecereNameSpace__ecere__sys__BinaryTree types;
165 struct __ecereNameSpace__ecere__sys__BinaryTree classes;
166 struct __ecereNameSpace__ecere__sys__BinaryTree symbols;
167 struct __ecereNameSpace__ecere__sys__BinaryTree structSymbols;
168 int nextID;
169 int simpleID;
170 struct __ecereNameSpace__ecere__sys__BinaryTree templateTypes;
171 struct ClassDefinition * classDef;
172 unsigned int templateTypesOnly;
173 unsigned int hasNameSpace;
174 } __attribute__ ((gcc_struct));
175
176 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Instantiation;
177
178 struct Instantiation
179 {
180 struct Instantiation * prev;
181 struct Instantiation * next;
182 struct Location loc;
183 struct Specifier * _class;
184 struct Expression * exp;
185 struct __ecereNameSpace__ecere__sys__OldList *  members;
186 struct Symbol * symbol;
187 unsigned int fullSet;
188 unsigned int isConstant;
189 unsigned char *  data;
190 struct Location nameLoc;
191 struct Location insideLoc;
192 unsigned int built;
193 } __attribute__ ((gcc_struct));
194
195 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Declaration;
196
197 struct Declaration
198 {
199 struct Declaration * prev;
200 struct Declaration * next;
201 struct Location loc;
202 int type;
203 union
204 {
205 struct
206 {
207 struct __ecereNameSpace__ecere__sys__OldList *  specifiers;
208 struct __ecereNameSpace__ecere__sys__OldList *  declarators;
209 } __attribute__ ((gcc_struct));
210 struct Instantiation * inst;
211 struct
212 {
213 struct Identifier * id;
214 struct Expression * exp;
215 } __attribute__ ((gcc_struct));
216 } __attribute__ ((gcc_struct));
217 struct Specifier * extStorage;
218 struct Symbol * symbol;
219 int declMode;
220 } __attribute__ ((gcc_struct));
221
222 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Statement;
223
224 struct Statement
225 {
226 struct Statement * prev;
227 struct Statement * next;
228 struct Location loc;
229 int type;
230 union
231 {
232 struct __ecereNameSpace__ecere__sys__OldList *  expressions;
233 struct
234 {
235 struct Identifier * id;
236 struct Statement * stmt;
237 } __attribute__ ((gcc_struct)) labeled;
238 struct
239 {
240 struct Expression * exp;
241 struct Statement * stmt;
242 } __attribute__ ((gcc_struct)) caseStmt;
243 struct
244 {
245 struct __ecereNameSpace__ecere__sys__OldList * declarations;
246 struct __ecereNameSpace__ecere__sys__OldList * statements;
247 struct Context * context;
248 unsigned int isSwitch;
249 } __attribute__ ((gcc_struct)) compound;
250 struct
251 {
252 struct __ecereNameSpace__ecere__sys__OldList * exp;
253 struct Statement * stmt;
254 struct Statement * elseStmt;
255 } __attribute__ ((gcc_struct)) ifStmt;
256 struct
257 {
258 struct __ecereNameSpace__ecere__sys__OldList * exp;
259 struct Statement * stmt;
260 } __attribute__ ((gcc_struct)) switchStmt;
261 struct
262 {
263 struct __ecereNameSpace__ecere__sys__OldList * exp;
264 struct Statement * stmt;
265 } __attribute__ ((gcc_struct)) whileStmt;
266 struct
267 {
268 struct __ecereNameSpace__ecere__sys__OldList * exp;
269 struct Statement * stmt;
270 } __attribute__ ((gcc_struct)) doWhile;
271 struct
272 {
273 struct Statement * init;
274 struct Statement * check;
275 struct __ecereNameSpace__ecere__sys__OldList * increment;
276 struct Statement * stmt;
277 } __attribute__ ((gcc_struct)) forStmt;
278 struct
279 {
280 struct Identifier * id;
281 } __attribute__ ((gcc_struct)) gotoStmt;
282 struct
283 {
284 struct Specifier * spec;
285 char * statements;
286 struct __ecereNameSpace__ecere__sys__OldList * inputFields;
287 struct __ecereNameSpace__ecere__sys__OldList * outputFields;
288 struct __ecereNameSpace__ecere__sys__OldList * clobberedFields;
289 } __attribute__ ((gcc_struct)) asmStmt;
290 struct
291 {
292 struct Expression * watcher;
293 struct Expression * object;
294 struct __ecereNameSpace__ecere__sys__OldList * watches;
295 } __attribute__ ((gcc_struct)) _watch;
296 struct
297 {
298 struct Identifier * id;
299 struct __ecereNameSpace__ecere__sys__OldList * exp;
300 struct __ecereNameSpace__ecere__sys__OldList * filter;
301 struct Statement * stmt;
302 } __attribute__ ((gcc_struct)) forEachStmt;
303 struct Declaration * decl;
304 } __attribute__ ((gcc_struct));
305 } __attribute__ ((gcc_struct));
306
307 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TypeName;
308
309 struct TypeName
310 {
311 struct TypeName * prev;
312 struct TypeName * next;
313 struct Location loc;
314 struct __ecereNameSpace__ecere__sys__OldList *  qualifiers;
315 struct Declarator * declarator;
316 int classObjectType;
317 struct Expression * bitCount;
318 } __attribute__ ((gcc_struct));
319
320 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Initializer;
321
322 struct Initializer
323 {
324 struct Initializer * prev;
325 struct Initializer * next;
326 struct Location loc;
327 int type;
328 union
329 {
330 struct Expression * exp;
331 struct __ecereNameSpace__ecere__sys__OldList *  list;
332 } __attribute__ ((gcc_struct));
333 unsigned int isConstant;
334 } __attribute__ ((gcc_struct));
335
336 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__DataValue;
337
338 struct __ecereNameSpace__ecere__com__DataValue
339 {
340 union
341 {
342 char c;
343 unsigned char uc;
344 short s;
345 unsigned short us;
346 int i;
347 unsigned int ui;
348 void *  p;
349 float f;
350 double d;
351 long long i64;
352 uint64 ui64;
353 } __attribute__ ((gcc_struct));
354 } __attribute__ ((gcc_struct));
355
356 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Expression;
357
358 struct Expression
359 {
360 struct Expression * prev;
361 struct Expression * next;
362 struct Location loc;
363 int type;
364 union
365 {
366 struct
367 {
368 char *  constant;
369 struct Identifier * identifier;
370 } __attribute__ ((gcc_struct));
371 struct Statement * compound;
372 struct Instantiation * instance;
373 char *  string;
374 struct __ecereNameSpace__ecere__sys__OldList *  list;
375 struct
376 {
377 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
378 struct Declarator * decl;
379 } __attribute__ ((gcc_struct)) _classExp;
380 struct
381 {
382 struct Identifier * id;
383 } __attribute__ ((gcc_struct)) classData;
384 struct
385 {
386 struct Expression * exp;
387 struct __ecereNameSpace__ecere__sys__OldList * arguments;
388 struct Location argLoc;
389 } __attribute__ ((gcc_struct)) call;
390 struct
391 {
392 struct Expression * exp;
393 struct __ecereNameSpace__ecere__sys__OldList * index;
394 } __attribute__ ((gcc_struct)) index;
395 struct
396 {
397 struct Expression * exp;
398 struct Identifier * member;
399 int memberType;
400 unsigned int thisPtr;
401 } __attribute__ ((gcc_struct)) member;
402 struct
403 {
404 int op;
405 struct Expression * exp1;
406 struct Expression * exp2;
407 } __attribute__ ((gcc_struct)) op;
408 struct TypeName * typeName;
409 struct Specifier * _class;
410 struct
411 {
412 struct TypeName * typeName;
413 struct Expression * exp;
414 } __attribute__ ((gcc_struct)) cast;
415 struct
416 {
417 struct Expression * cond;
418 struct __ecereNameSpace__ecere__sys__OldList * exp;
419 struct Expression * elseExp;
420 } __attribute__ ((gcc_struct)) cond;
421 struct
422 {
423 struct TypeName * typeName;
424 struct Expression * size;
425 } __attribute__ ((gcc_struct)) _new;
426 struct
427 {
428 struct TypeName * typeName;
429 struct Expression * size;
430 struct Expression * exp;
431 } __attribute__ ((gcc_struct)) _renew;
432 struct
433 {
434 char * table;
435 struct Identifier * id;
436 } __attribute__ ((gcc_struct)) db;
437 struct
438 {
439 struct Expression * ds;
440 struct Expression * name;
441 } __attribute__ ((gcc_struct)) dbopen;
442 struct
443 {
444 struct TypeName * typeName;
445 struct Initializer * initializer;
446 } __attribute__ ((gcc_struct)) initializer;
447 struct
448 {
449 struct Expression * exp;
450 struct TypeName * typeName;
451 } __attribute__ ((gcc_struct)) vaArg;
452 } __attribute__ ((gcc_struct));
453 unsigned int debugValue;
454 struct __ecereNameSpace__ecere__com__DataValue val;
455 unsigned int address;
456 unsigned int hasAddress;
457 struct Type * expType;
458 struct Type * destType;
459 unsigned int usage;
460 int tempCount;
461 unsigned int byReference;
462 unsigned int isConstant;
463 unsigned int addedThis;
464 unsigned int needCast;
465 unsigned int thisPtr;
466 } __attribute__ ((gcc_struct));
467
468 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplateDatatype;
469
470 struct TemplateDatatype
471 {
472 struct __ecereNameSpace__ecere__sys__OldList *  specifiers;
473 struct Declarator * decl;
474 } __attribute__ ((gcc_struct));
475
476 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplateArgument;
477
478 struct TemplateArgument;
479
480 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplateParameter;
481
482 struct TemplateParameter
483 {
484 struct TemplateParameter * prev;
485 struct TemplateParameter * next;
486 struct Location loc;
487 int type;
488 struct Identifier * identifier;
489 union
490 {
491 struct TemplateDatatype * dataType;
492 int memberType;
493 } __attribute__ ((gcc_struct));
494 struct TemplateArgument * defaultArgument;
495 char *  dataTypeString;
496 struct Type * baseType;
497 } __attribute__ ((gcc_struct));
498
499 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Specifier;
500
501 struct Specifier
502 {
503 struct Specifier * prev;
504 struct Specifier * next;
505 struct Location loc;
506 int type;
507 union
508 {
509 int specifier;
510 struct
511 {
512 struct ExtDecl * extDecl;
513 char *  name;
514 struct Symbol * symbol;
515 struct __ecereNameSpace__ecere__sys__OldList *  templateArgs;
516 } __attribute__ ((gcc_struct));
517 struct
518 {
519 struct Identifier * id;
520 struct __ecereNameSpace__ecere__sys__OldList *  list;
521 struct __ecereNameSpace__ecere__sys__OldList *  baseSpecs;
522 struct __ecereNameSpace__ecere__sys__OldList *  definitions;
523 unsigned int addNameSpace;
524 struct Context * ctx;
525 } __attribute__ ((gcc_struct));
526 struct Expression * expression;
527 struct Specifier * _class;
528 struct TemplateParameter * templateParameter;
529 } __attribute__ ((gcc_struct));
530 } __attribute__ ((gcc_struct));
531
532 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Identifier;
533
534 struct Identifier
535 {
536 struct Identifier * prev;
537 struct Identifier * next;
538 struct Location loc;
539 struct Symbol * classSym;
540 struct Specifier * _class;
541 char *  string;
542 struct Identifier * badID;
543 } __attribute__ ((gcc_struct));
544
545 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Pointer;
546
547 struct Pointer;
548
549 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Declarator;
550
551 struct Declarator
552 {
553 struct Declarator * prev;
554 struct Declarator * next;
555 struct Location loc;
556 int type;
557 struct Symbol * symbol;
558 struct Declarator * declarator;
559 union
560 {
561 struct Identifier * identifier;
562 struct
563 {
564 struct Expression * exp;
565 struct Expression * posExp;
566 struct Attrib * attrib;
567 } __attribute__ ((gcc_struct)) structDecl;
568 struct
569 {
570 struct Expression * exp;
571 struct Specifier * enumClass;
572 } __attribute__ ((gcc_struct)) array;
573 struct
574 {
575 struct __ecereNameSpace__ecere__sys__OldList * parameters;
576 } __attribute__ ((gcc_struct)) function;
577 struct
578 {
579 struct Pointer * pointer;
580 } __attribute__ ((gcc_struct)) pointer;
581 struct
582 {
583 struct ExtDecl * extended;
584 } __attribute__ ((gcc_struct)) extended;
585 } __attribute__ ((gcc_struct));
586 } __attribute__ ((gcc_struct));
587
588 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_FunctionDefinition;
589
590 struct FunctionDefinition
591 {
592 struct FunctionDefinition * prev;
593 struct FunctionDefinition * next;
594 struct Location loc;
595 struct __ecereNameSpace__ecere__sys__OldList *  specifiers;
596 struct Declarator * declarator;
597 struct __ecereNameSpace__ecere__sys__OldList *  declarations;
598 struct Statement * body;
599 struct __ecereNameSpace__ecere__com__Class * _class;
600 struct __ecereNameSpace__ecere__sys__OldList attached;
601 int declMode;
602 struct Type * type;
603 struct Symbol * propSet;
604 int tempCount;
605 unsigned int propertyNoThis;
606 } __attribute__ ((gcc_struct));
607
608 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_DBTableDef;
609
610 struct DBTableDef;
611
612 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_External;
613
614 struct External
615 {
616 struct External * prev;
617 struct External * next;
618 struct Location loc;
619 int type;
620 struct Symbol * symbol;
621 union
622 {
623 struct FunctionDefinition * function;
624 struct ClassDefinition * _class;
625 struct Declaration * declaration;
626 char *  importString;
627 struct Identifier * id;
628 struct DBTableDef * table;
629 } __attribute__ ((gcc_struct));
630 int importType;
631 } __attribute__ ((gcc_struct));
632
633 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ModuleImport;
634
635 struct ModuleImport
636 {
637 struct ModuleImport * prev;
638 struct ModuleImport * next;
639 char *  name;
640 struct __ecereNameSpace__ecere__sys__OldList classes;
641 struct __ecereNameSpace__ecere__sys__OldList functions;
642 int importType;
643 int importAccess;
644 } __attribute__ ((gcc_struct));
645
646 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassImport;
647
648 struct ClassImport
649 {
650 struct ClassImport * prev;
651 struct ClassImport * next;
652 char *  name;
653 struct __ecereNameSpace__ecere__sys__OldList methods;
654 struct __ecereNameSpace__ecere__sys__OldList properties;
655 unsigned int itself;
656 unsigned int isRemote;
657 } __attribute__ ((gcc_struct));
658
659 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Symbol;
660
661 struct Symbol
662 {
663 char *  string;
664 struct Symbol * parent;
665 struct Symbol * left;
666 struct Symbol * right;
667 int depth;
668 struct Type * type;
669 union
670 {
671 struct __ecereNameSpace__ecere__com__Method * method;
672 struct __ecereNameSpace__ecere__com__Property * _property;
673 struct __ecereNameSpace__ecere__com__Class * registered;
674 } __attribute__ ((gcc_struct));
675 int id;
676 int idCode;
677 union
678 {
679 struct
680 {
681 struct External * pointerExternal;
682 struct External * structExternal;
683 } __attribute__ ((gcc_struct));
684 struct
685 {
686 struct External * externalGet;
687 struct External * externalSet;
688 struct External * externalPtr;
689 struct External * externalIsSet;
690 } __attribute__ ((gcc_struct));
691 struct
692 {
693 struct External * methodExternal;
694 struct External * methodCodeExternal;
695 } __attribute__ ((gcc_struct));
696 } __attribute__ ((gcc_struct));
697 unsigned int imported;
698 unsigned int declaredStructSym;
699 struct __ecereNameSpace__ecere__com__Class * _class;
700 unsigned int declaredStruct;
701 unsigned int needConstructor;
702 unsigned int needDestructor;
703 char *  constructorName;
704 char *  structName;
705 char *  className;
706 char *  destructorName;
707 struct ModuleImport * module;
708 struct ClassImport * _import;
709 struct Location nameLoc;
710 unsigned int isParam;
711 unsigned int isRemote;
712 unsigned int isStruct;
713 unsigned int fireWatchersDone;
714 int declaring;
715 unsigned int classData;
716 unsigned int isStatic;
717 char *  shortName;
718 struct __ecereNameSpace__ecere__sys__OldList *  templateParams;
719 struct __ecereNameSpace__ecere__sys__OldList templatedClasses;
720 struct Context * ctx;
721 int isIterator;
722 struct Expression * propCategory;
723 } __attribute__ ((gcc_struct));
724
725 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Type;
726
727 struct Type
728 {
729 struct Type * prev;
730 struct Type * next;
731 int refCount;
732 union
733 {
734 struct Symbol * _class;
735 struct
736 {
737 struct __ecereNameSpace__ecere__sys__OldList members;
738 char *  enumName;
739 } __attribute__ ((gcc_struct));
740 struct
741 {
742 struct Type * returnType;
743 struct __ecereNameSpace__ecere__sys__OldList params;
744 struct Symbol * thisClass;
745 unsigned int staticMethod;
746 struct TemplateParameter * thisClassTemplate;
747 } __attribute__ ((gcc_struct));
748 struct
749 {
750 struct __ecereNameSpace__ecere__com__Method * method;
751 struct __ecereNameSpace__ecere__com__Class * methodClass;
752 struct __ecereNameSpace__ecere__com__Class * usedClass;
753 } __attribute__ ((gcc_struct));
754 struct
755 {
756 struct Type * arrayType;
757 int arraySize;
758 struct Expression * arraySizeExp;
759 unsigned int freeExp;
760 struct Symbol * enumClass;
761 } __attribute__ ((gcc_struct));
762 struct Type * type;
763 struct TemplateParameter * templateParameter;
764 } __attribute__ ((gcc_struct));
765 unsigned int isSigned;
766 int kind;
767 unsigned int constant;
768 unsigned int size;
769 char *  name;
770 char *  typeName;
771 unsigned int count;
772 unsigned int truth;
773 int classObjectType;
774 unsigned int byReference;
775 unsigned int extraParam;
776 int alignment;
777 unsigned int directClassAccess;
778 unsigned int computing;
779 unsigned int dllExport;
780 unsigned int offset;
781 unsigned int keepCast;
782 unsigned int passAsTemplate;
783 int bitFieldCount;
784 } __attribute__ ((gcc_struct));
785
786 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Class;
787
788 struct __ecereNameSpace__ecere__com__Class
789 {
790 struct __ecereNameSpace__ecere__com__Class * prev;
791 struct __ecereNameSpace__ecere__com__Class * next;
792 char *  name;
793 int offset;
794 int structSize;
795 int (* *  _vTbl)();
796 int vTblSize;
797 int (*  Constructor)(struct __ecereNameSpace__ecere__com__Instance *);
798 void (*  Destructor)(struct __ecereNameSpace__ecere__com__Instance *);
799 int offsetClass;
800 int sizeClass;
801 struct __ecereNameSpace__ecere__com__Class * base;
802 struct __ecereNameSpace__ecere__sys__BinaryTree methods;
803 struct __ecereNameSpace__ecere__sys__BinaryTree members;
804 struct __ecereNameSpace__ecere__sys__BinaryTree prop;
805 struct __ecereNameSpace__ecere__sys__OldList membersAndProperties;
806 struct __ecereNameSpace__ecere__sys__BinaryTree classProperties;
807 struct __ecereNameSpace__ecere__sys__OldList derivatives;
808 int memberID;
809 int startMemberID;
810 int type;
811 struct __ecereNameSpace__ecere__com__Instance * module;
812 struct __ecereNameSpace__ecere__com__NameSpace *  nameSpace;
813 char *  dataTypeString;
814 struct Type * dataType;
815 int typeSize;
816 int defaultAlignment;
817 void (*  Initialize)();
818 int memberOffset;
819 struct __ecereNameSpace__ecere__sys__OldList selfWatchers;
820 char *  designerClass;
821 unsigned int noExpansion;
822 char *  defaultProperty;
823 unsigned int comRedefinition;
824 int count;
825 unsigned int isRemote;
826 unsigned int internalDecl;
827 void *  data;
828 unsigned int computeSize;
829 int structAlignment;
830 int destructionWatchOffset;
831 unsigned int fixed;
832 struct __ecereNameSpace__ecere__sys__OldList delayedCPValues;
833 int inheritanceAccess;
834 char *  fullName;
835 void *  symbol;
836 struct __ecereNameSpace__ecere__sys__OldList conversions;
837 struct __ecereNameSpace__ecere__sys__OldList templateParams;
838 struct __ecereNameSpace__ecere__com__ClassTemplateArgument *  templateArgs;
839 struct __ecereNameSpace__ecere__com__Class * templateClass;
840 struct __ecereNameSpace__ecere__sys__OldList templatized;
841 int numParams;
842 } __attribute__ ((gcc_struct));
843
844 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Instance;
845
846 struct __ecereNameSpace__ecere__com__Instance
847 {
848 int (* *  _vTbl)();
849 struct __ecereNameSpace__ecere__com__Class * _class;
850 int _refCount;
851 } __attribute__ ((gcc_struct));
852
853 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__DataMember;
854
855 struct __ecereNameSpace__ecere__com__DataMember
856 {
857 struct __ecereNameSpace__ecere__com__DataMember * prev;
858 struct __ecereNameSpace__ecere__com__DataMember * next;
859 char *  name;
860 unsigned int isProperty;
861 int memberAccess;
862 int id;
863 struct __ecereNameSpace__ecere__com__Class * _class;
864 char *  dataTypeString;
865 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
866 struct Type * dataType;
867 int type;
868 int offset;
869 int memberID;
870 struct __ecereNameSpace__ecere__sys__OldList members;
871 struct __ecereNameSpace__ecere__sys__BinaryTree membersAlpha;
872 int memberOffset;
873 int structAlignment;
874 } __attribute__ ((gcc_struct));
875
876 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__SerialBuffer;
877
878 struct __ecereNameSpace__ecere__com__SerialBuffer
879 {
880 unsigned char *  _buffer;
881 unsigned int count;
882 unsigned int _size;
883 unsigned int pos;
884 } __attribute__ ((gcc_struct));
885
886 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__ClassTemplateArgument;
887
888 struct __ecereNameSpace__ecere__com__ClassTemplateArgument
889 {
890 union
891 {
892 struct
893 {
894 char *  dataTypeString;
895 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
896 } __attribute__ ((gcc_struct));
897 struct __ecereNameSpace__ecere__com__DataValue expression;
898 struct
899 {
900 char *  memberString;
901 union
902 {
903 struct __ecereNameSpace__ecere__com__DataMember * member;
904 struct __ecereNameSpace__ecere__com__Property * prop;
905 struct __ecereNameSpace__ecere__com__Method * method;
906 } __attribute__ ((gcc_struct));
907 } __attribute__ ((gcc_struct));
908 } __attribute__ ((gcc_struct));
909 } __attribute__ ((gcc_struct));
910
911 typedef unsigned int size_t;
912
913 void exit(int status);
914
915 void * calloc(size_t nmemb, size_t size);
916
917 void free(void * ptr);
918
919 void * malloc(size_t size);
920
921 void * realloc(void * ptr, size_t size);
922
923 long int strtol(const char * nptr, char ** endptr, int base);
924
925 long long int strtoll(const char * nptr, char ** endptr, int base);
926
927 unsigned long long int strtoull(const char * nptr, char ** endptr, int base);
928
929 enum yytokentype
930 {
931 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
932 };
933
934 typedef union YYSTYPE
935 {
936 int specifierType;
937 int i;
938 int declMode;
939 struct Identifier * id;
940 struct Expression * exp;
941 struct Specifier * specifier;
942 struct __ecereNameSpace__ecere__sys__OldList * list;
943 struct Enumerator * enumerator;
944 struct Declarator * declarator;
945 struct Pointer * pointer;
946 struct Initializer * initializer;
947 struct InitDeclarator * initDeclarator;
948 struct TypeName * typeName;
949 struct Declaration * declaration;
950 struct Statement * stmt;
951 struct FunctionDefinition * function;
952 struct External * external;
953 struct Context * context;
954 struct AsmField * asmField;
955 struct Attrib * attrib;
956 struct ExtDecl * extDecl;
957 struct Attribute * attribute;
958 struct Instantiation * instance;
959 struct MembersInit * membersInit;
960 struct MemberInit * memberInit;
961 struct ClassFunction * classFunction;
962 struct ClassDefinition * _class;
963 struct ClassDef * classDef;
964 struct PropertyDef * prop;
965 char * string;
966 struct Symbol * symbol;
967 struct PropertyWatch * propertyWatch;
968 struct TemplateParameter * templateParameter;
969 struct TemplateArgument * templateArgument;
970 struct TemplateDatatype * templateDatatype;
971 struct DBTableEntry * dbtableEntry;
972 struct DBIndexItem * dbindexItem;
973 struct DBTableDef * dbtableDef;
974 } __attribute__ ((gcc_struct)) YYSTYPE;
975
976 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Enumerator;
977
978 struct Enumerator
979 {
980 struct Enumerator * prev;
981 struct Enumerator * next;
982 struct Location loc;
983 struct Identifier * id;
984 struct Expression * exp;
985 } __attribute__ ((gcc_struct));
986
987 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_InitDeclarator;
988
989 struct InitDeclarator
990 {
991 struct InitDeclarator * prev;
992 struct InitDeclarator * next;
993 struct Location loc;
994 struct Declarator * declarator;
995 struct Initializer * initializer;
996 } __attribute__ ((gcc_struct));
997
998 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_AsmField;
999
1000 struct AsmField
1001 {
1002 struct AsmField * prev;
1003 struct AsmField * next;
1004 struct Location loc;
1005 char *  command;
1006 struct Expression * expression;
1007 } __attribute__ ((gcc_struct));
1008
1009 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Attribute;
1010
1011 struct Attribute;
1012
1013 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassFunction;
1014
1015 struct ClassFunction
1016 {
1017 struct ClassFunction * prev;
1018 struct ClassFunction * next;
1019 struct Location loc;
1020 struct __ecereNameSpace__ecere__sys__OldList *  specifiers;
1021 struct Declarator * declarator;
1022 struct __ecereNameSpace__ecere__sys__OldList *  declarations;
1023 struct Statement * body;
1024 struct __ecereNameSpace__ecere__com__Class * _class;
1025 struct __ecereNameSpace__ecere__sys__OldList attached;
1026 int declMode;
1027 struct Type * type;
1028 struct Symbol * propSet;
1029 unsigned int isVirtual;
1030 unsigned int isConstructor;
1031 unsigned int isDestructor;
1032 unsigned int dontMangle;
1033 int id;
1034 int idCode;
1035 } __attribute__ ((gcc_struct));
1036
1037 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_MembersInit;
1038
1039 struct MembersInit
1040 {
1041 struct MembersInit * prev;
1042 struct MembersInit * next;
1043 struct Location loc;
1044 int type;
1045 union
1046 {
1047 struct __ecereNameSpace__ecere__sys__OldList *  dataMembers;
1048 struct ClassFunction * function;
1049 } __attribute__ ((gcc_struct));
1050 } __attribute__ ((gcc_struct));
1051
1052 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_MemberInit;
1053
1054 struct MemberInit
1055 {
1056 struct MemberInit * prev;
1057 struct MemberInit * next;
1058 struct Location loc;
1059 struct Location realLoc;
1060 struct __ecereNameSpace__ecere__sys__OldList *  identifiers;
1061 struct Initializer * initializer;
1062 unsigned int used;
1063 unsigned int variable;
1064 unsigned int takeOutExp;
1065 } __attribute__ ((gcc_struct));
1066
1067 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_PropertyDef;
1068
1069 struct PropertyDef
1070 {
1071 struct PropertyDef * prev;
1072 struct PropertyDef * next;
1073 struct Location loc;
1074 struct __ecereNameSpace__ecere__sys__OldList *  specifiers;
1075 struct Declarator * declarator;
1076 struct Identifier * id;
1077 struct Statement * getStmt;
1078 struct Statement * setStmt;
1079 struct Statement * issetStmt;
1080 struct Symbol * symbol;
1081 unsigned int conversion;
1082 unsigned int isWatchable;
1083 struct Expression * category;
1084 } __attribute__ ((gcc_struct));
1085
1086 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_PropertyWatch;
1087
1088 struct PropertyWatch
1089 {
1090 struct PropertyWatch * prev;
1091 struct PropertyWatch * next;
1092 struct Location loc;
1093 struct Statement * compound;
1094 struct __ecereNameSpace__ecere__sys__OldList *  properties;
1095 unsigned int deleteWatch;
1096 } __attribute__ ((gcc_struct));
1097
1098 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassDef;
1099
1100 struct ClassDef
1101 {
1102 struct ClassDef * prev;
1103 struct ClassDef * next;
1104 struct Location loc;
1105 int type;
1106 union
1107 {
1108 struct Declaration * decl;
1109 struct ClassFunction * function;
1110 struct __ecereNameSpace__ecere__sys__OldList *  defProperties;
1111 struct PropertyDef * propertyDef;
1112 struct PropertyWatch * propertyWatch;
1113 char *  designer;
1114 struct Identifier * defaultProperty;
1115 struct
1116 {
1117 struct Identifier * id;
1118 struct Initializer * initializer;
1119 } __attribute__ ((gcc_struct));
1120 } __attribute__ ((gcc_struct));
1121 int memberAccess;
1122 void *  object;
1123 } __attribute__ ((gcc_struct));
1124
1125 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_DBTableEntry;
1126
1127 struct DBTableEntry;
1128
1129 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_DBIndexItem;
1130
1131 struct DBIndexItem;
1132
1133 extern YYSTYPE yylval;
1134
1135 extern struct Location yylloc;
1136
1137 extern struct __ecereNameSpace__ecere__sys__OldList * ast;
1138
1139 extern int returnCode;
1140
1141 extern struct Expression * parsedExpression;
1142
1143 extern unsigned int yydebug;
1144
1145 void SetYydebug(unsigned int b)
1146 {
1147 yydebug = b;
1148 }
1149
1150 extern unsigned int echoOn;
1151
1152 void resetScanner();
1153
1154 int propWatcherID;
1155
1156 int expression_yyparse();
1157
1158 static struct Statement * curCompound;
1159
1160 struct External * curExternal, * afterExternal;
1161
1162 static struct Type * curSwitchType;
1163
1164 static struct __ecereNameSpace__ecere__com__Class * currentClass;
1165
1166 struct __ecereNameSpace__ecere__com__Class * thisClass;
1167
1168 void SetThisClass(struct __ecereNameSpace__ecere__com__Class * c)
1169 {
1170 thisClass = c;
1171 }
1172
1173 struct __ecereNameSpace__ecere__com__Class * GetThisClass()
1174 {
1175 return thisClass;
1176 }
1177
1178 static char * thisNameSpace;
1179
1180 struct __ecereNameSpace__ecere__com__Class * containerClass;
1181
1182 unsigned int thisClassParams = 0x1;
1183
1184 unsigned int internalValueCounter;
1185
1186 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__TempFile;
1187
1188 struct __ecereNameSpace__ecere__sys__TempFile
1189 {
1190 char __ecere_padding[24];
1191 } __attribute__ ((gcc_struct));
1192
1193 extern void OutputExpression(struct Expression * exp, struct __ecereNameSpace__ecere__com__Instance * f);
1194
1195 extern int strlen(const char * );
1196
1197 extern void *  __ecereNameSpace__ecere__com__eInstance_New(struct __ecereNameSpace__ecere__com__Class * _class);
1198
1199 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek;
1200
1201 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Read;
1202
1203 extern void __ecereNameSpace__ecere__com__eInstance_DecRef(struct __ecereNameSpace__ecere__com__Instance * instance);
1204
1205 void PrintExpression(struct Expression * exp, char * string)
1206 {
1207 {
1208 struct __ecereNameSpace__ecere__com__Instance * f = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
1209 int count;
1210
1211 if(exp)
1212 OutputExpression(exp, f);
1213 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))f->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(f, 0, 0);
1214 count = strlen(string);
1215 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);
1216 string[count] = '\0';
1217 (__ecereNameSpace__ecere__com__eInstance_DecRef(f), f = 0);
1218 }
1219 }
1220
1221 extern int isspace(int c);
1222
1223 long long _strtoi64(char * string, char ** endString, int base)
1224 {
1225 long long value = 0;
1226 int sign = 1;
1227 int c;
1228 char ch;
1229
1230 for(c = 0; (ch = string[c]) && isspace(ch); c++)
1231 ;
1232 if(ch == '+')
1233 c++;
1234 else if(ch == '-')
1235 {
1236 sign = -1;
1237 c++;
1238 }
1239 ;
1240 if(!base)
1241 {
1242 if(ch == (char)0 && string[c + 1] == 'x')
1243 {
1244 base = 16;
1245 c += 2;
1246 }
1247 else if(ch == '0')
1248 {
1249 base = 8;
1250 c++;
1251 }
1252 else
1253 base = 10;
1254 }
1255 for(; (ch = string[c]); c++)
1256 {
1257 if(ch == '0')
1258 ch = (char)0;
1259 else if(ch >= '1' && ch <= '9')
1260 ch -= '1';
1261 else if(ch >= 'a' && ch <= 'z')
1262 ch -= 'a';
1263 else if(ch >= 'A' && ch <= 'Z')
1264 ch -= 'A';
1265 else
1266 {
1267 if(endString)
1268 *endString = string + c;
1269 break;
1270 }
1271 if(ch < base)
1272 {
1273 value *= base;
1274 value += ch;
1275 }
1276 else
1277 {
1278 if(endString)
1279 *endString = string + c;
1280 break;
1281 }
1282 }
1283 return sign * value;
1284 }
1285
1286 uint64 _strtoui64(char * string, char ** endString, int base)
1287 {
1288 uint64 value = 0;
1289 int sign = 1;
1290 int c;
1291 char ch;
1292
1293 for(c = 0; (ch = string[c]) && isspace(ch); c++)
1294 ;
1295 if(ch == '+')
1296 c++;
1297 else if(ch == '-')
1298 {
1299 sign = -1;
1300 c++;
1301 }
1302 ;
1303 if(!base)
1304 {
1305 if(ch == (char)0 && string[c + 1] == 'x')
1306 {
1307 base = 16;
1308 c += 2;
1309 }
1310 else if(ch == '0')
1311 {
1312 base = 8;
1313 c++;
1314 }
1315 else
1316 base = 10;
1317 }
1318 for(; (ch = string[c]); c++)
1319 {
1320 if(ch == '0')
1321 ch = (char)0;
1322 else if(ch >= '1' && ch <= '9')
1323 ch -= '1';
1324 else if(ch >= 'a' && ch <= 'z')
1325 ch -= 'a';
1326 else if(ch >= 'A' && ch <= 'Z')
1327 ch -= 'A';
1328 else
1329 {
1330 if(endString)
1331 *endString = string + c;
1332 break;
1333 }
1334 if(ch < base)
1335 {
1336 value *= base;
1337 value += ch;
1338 }
1339 else
1340 {
1341 if(endString)
1342 *endString = string + c;
1343 break;
1344 }
1345 }
1346 return sign * value;
1347 }
1348
1349 extern struct Type * ProcessTypeString(char *  string, unsigned int staticMethod);
1350
1351 extern struct Type * ProcessType(struct __ecereNameSpace__ecere__sys__OldList * specs, struct Declarator * decl);
1352
1353 struct Type * ProcessTemplateParameterType(struct TemplateParameter * param)
1354 {
1355 if(param && param->type == 0 && (param->dataType || param->dataTypeString))
1356 {
1357 if(!param->baseType)
1358 {
1359 if(param->dataTypeString)
1360 param->baseType = ProcessTypeString(param->dataTypeString, 0x0);
1361 else
1362 param->baseType = ProcessType(param->dataType->specifiers, param->dataType->decl);
1363 }
1364 return param->baseType;
1365 }
1366 return (((void *)0));
1367 }
1368
1369 unsigned int NeedCast(struct Type * type1, struct Type * type2)
1370 {
1371 if(!type1 || !type2 || type1->keepCast || type2->keepCast)
1372 return 0x1;
1373 if(type1->kind == 20 && type2->kind == 4 && type2->passAsTemplate == 0x0)
1374 {
1375 return 0x0;
1376 }
1377 if(type1->kind == type2->kind)
1378 {
1379 switch(type1->kind)
1380 {
1381 case 1:
1382 case 2:
1383 case 3:
1384 case 4:
1385 case 22:
1386 if(type1->passAsTemplate && !type2->passAsTemplate)
1387 return 0x1;
1388 return type1->isSigned != type2->isSigned;
1389 case 8:
1390 return type1->_class != type2->_class;
1391 case 13:
1392 return NeedCast(type1->type, type2->type);
1393 default:
1394 return 0x1;
1395 }
1396 }
1397 return 0x1;
1398 }
1399
1400 extern int strcmp(const char * , const char * );
1401
1402 extern struct Context * curContext;
1403
1404 extern struct Context * topContext;
1405
1406 extern unsigned int __ecereNameSpace__ecere__com__eClass_IsDerived(struct __ecereNameSpace__ecere__com__Class * _class, struct __ecereNameSpace__ecere__com__Class * from);
1407
1408 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);
1409
1410 extern struct __ecereNameSpace__ecere__com__Instance * privateModule;
1411
1412 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);
1413
1414 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);
1415
1416 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__ClassProperty;
1417
1418 struct __ecereNameSpace__ecere__com__ClassProperty
1419 {
1420 char *  name;
1421 struct __ecereNameSpace__ecere__com__ClassProperty * parent;
1422 struct __ecereNameSpace__ecere__com__ClassProperty * left;
1423 struct __ecereNameSpace__ecere__com__ClassProperty * right;
1424 int depth;
1425 void (*  Set)(struct __ecereNameSpace__ecere__com__Class *, int);
1426 int (*  Get)(struct __ecereNameSpace__ecere__com__Class *);
1427 char *  dataTypeString;
1428 struct Type * dataType;
1429 unsigned int constant;
1430 } __attribute__ ((gcc_struct));
1431
1432 extern struct __ecereNameSpace__ecere__com__ClassProperty * __ecereNameSpace__ecere__com__eClass_FindClassProperty(struct __ecereNameSpace__ecere__com__Class * _class, char *  name);
1433
1434 extern struct Expression * QMkExpId(char *  id);
1435
1436 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__ClassTemplateParameter;
1437
1438 struct __ecereNameSpace__ecere__com__ClassTemplateParameter
1439 {
1440 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * prev;
1441 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * next;
1442 char *  name;
1443 int type;
1444 union
1445 {
1446 char *  dataTypeString;
1447 int memberType;
1448 } __attribute__ ((gcc_struct));
1449 struct __ecereNameSpace__ecere__com__ClassTemplateArgument defaultArg;
1450 void *  param;
1451 char __ecere_padding[4];
1452 } __attribute__ ((gcc_struct));
1453
1454 extern struct Expression * GetTemplateArgExpByName(char *  paramName, struct __ecereNameSpace__ecere__com__Class * curClass, int tplType);
1455
1456 extern struct __ecereNameSpace__ecere__sys__OldList *  MkList(void);
1457
1458 extern void FreeIdentifier(struct Identifier * id);
1459
1460 void ProcessExpressionType(struct Expression * exp);
1461
1462 extern struct Declarator * SpecDeclFromString(char *  string, struct __ecereNameSpace__ecere__sys__OldList *  specs, struct Declarator * baseDecl);
1463
1464 extern struct __ecereNameSpace__ecere__sys__OldList *  MkListOne(void *  item);
1465
1466 extern struct Expression * MkExpOp(struct Expression * exp1, int op, struct Expression * exp2);
1467
1468 extern struct Expression * MkExpCast(struct TypeName * typeName, struct Expression * expression);
1469
1470 extern struct TypeName * MkTypeName(struct __ecereNameSpace__ecere__sys__OldList * qualifiers, struct Declarator * declarator);
1471
1472 extern struct Declarator * MkDeclaratorPointer(struct Pointer * pointer, struct Declarator * declarator);
1473
1474 extern struct Pointer * MkPointer(struct __ecereNameSpace__ecere__sys__OldList * qualifiers, struct Pointer * pointer);
1475
1476 struct __ecereNameSpace__ecere__sys__BTNode * __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(struct __ecereNameSpace__ecere__sys__BinaryTree * this, char *  key);
1477
1478 static void ReplaceClassMembers(struct Expression * exp, struct __ecereNameSpace__ecere__com__Class * _class)
1479 {
1480 if(exp->type == 0 && exp->identifier)
1481 {
1482 struct Identifier * id = exp->identifier;
1483 struct Context * ctx;
1484 struct Symbol * symbol = (((void *)0));
1485
1486 if(!id->_class || !id->_class->name || strcmp(id->_class->name, "property"))
1487 {
1488 for(ctx = curContext; ctx != topContext->parent && !symbol; ctx = ctx->parent)
1489 {
1490 symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(&ctx->symbols, id->string);
1491 if(symbol)
1492 break;
1493 }
1494 }
1495 if(!symbol && ((!id->_class || (id->_class->name && !strcmp(id->_class->name, "property"))) || (id->classSym && __ecereNameSpace__ecere__com__eClass_IsDerived(_class, id->classSym->registered))))
1496 {
1497 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
1498 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
1499 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
1500 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
1501
1502 if(!prop)
1503 {
1504 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule);
1505 }
1506 if(!prop && !method)
1507 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
1508 if(!prop && !method && !member)
1509 {
1510 classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(_class, id->string);
1511 }
1512 if(prop || method || member || classProp)
1513 {
1514 exp->type = 8;
1515 exp->member.member = id;
1516 exp->member.memberType = 0;
1517 exp->member.exp = QMkExpId("this");
1518 exp->addedThis = 0x1;
1519 }
1520 else if(_class && _class->templateParams.first)
1521 {
1522 struct __ecereNameSpace__ecere__com__Class * sClass;
1523
1524 for(sClass = _class; sClass; sClass = sClass->base)
1525 {
1526 if(sClass->templateParams.first)
1527 {
1528 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
1529
1530 for(param = sClass->templateParams.first; param; param = param->next)
1531 {
1532 if(param->type == 2 && !strcmp(param->name, id->string))
1533 {
1534 struct Expression * argExp = GetTemplateArgExpByName(param->name, _class, 2);
1535
1536 if(argExp)
1537 {
1538 struct Declarator * decl;
1539 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
1540
1541 FreeIdentifier(exp->member.member);
1542 ProcessExpressionType(argExp);
1543 decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
1544 exp->expType = ProcessType(specs, decl);
1545 exp->type = 5;
1546 exp->list = MkListOne(MkExpOp((((void *)0)), '*', MkExpCast(MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl)), MkExpOp((((void *)0)), '&', argExp))));
1547 }
1548 }
1549 }
1550 }
1551 }
1552 }
1553 }
1554 }
1555 }
1556
1557 extern int sprintf(char * , char * , ...);
1558
1559 extern int __ecereNameSpace__ecere__com__GetRuntimePlatform(void);
1560
1561 extern char *  __ecereNameSpace__ecere__sys__CopyString(char *  string);
1562
1563 char * PrintInt(long long result)
1564 {
1565 char temp[100];
1566
1567 if(result > (((long long)0x7fffffffffffffffLL)))
1568 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1569 else
1570 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "%I64dLL" : "%lldLL"), result);
1571 return __ecereNameSpace__ecere__sys__CopyString(temp);
1572 }
1573
1574 char * PrintUInt(uint64 result)
1575 {
1576 char temp[100];
1577
1578 if(result > (0xffffffff))
1579 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1580 else if(result > (((int)0x7fffffff)))
1581 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64X" : "0x%llX"), result);
1582 else
1583 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "%I64d" : "%lld"), result);
1584 return __ecereNameSpace__ecere__sys__CopyString(temp);
1585 }
1586
1587 char * PrintInt64(long long result)
1588 {
1589 char temp[100];
1590
1591 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "%I64dLL" : "%lldLL"), result);
1592 return __ecereNameSpace__ecere__sys__CopyString(temp);
1593 }
1594
1595 char * PrintUInt64(uint64 result)
1596 {
1597 char temp[100];
1598
1599 if(result > (((long long)0x7fffffffffffffffLL)))
1600 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1601 else
1602 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "%I64dLL" : "%lldLL"), result);
1603 return __ecereNameSpace__ecere__sys__CopyString(temp);
1604 }
1605
1606 char * PrintHexUInt(uint64 result)
1607 {
1608 char temp[100];
1609
1610 if(result > (0xffffffff))
1611 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1612 else
1613 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64X" : "0x%llX"), result);
1614 return __ecereNameSpace__ecere__sys__CopyString(temp);
1615 }
1616
1617 char * PrintHexUInt64(uint64 result)
1618 {
1619 char temp[100];
1620
1621 if(result > (0xffffffff))
1622 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1623 else
1624 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64X" : "0x%llX"), result);
1625 return __ecereNameSpace__ecere__sys__CopyString(temp);
1626 }
1627
1628 char * PrintShort(short result)
1629 {
1630 char temp[100];
1631
1632 sprintf(temp, "%d", (unsigned short)result);
1633 return __ecereNameSpace__ecere__sys__CopyString(temp);
1634 }
1635
1636 char * PrintUShort(unsigned short result)
1637 {
1638 char temp[100];
1639
1640 if(result > (unsigned short)32767)
1641 sprintf(temp, "0x%X", (int)result);
1642 else
1643 sprintf(temp, "%d", result);
1644 return __ecereNameSpace__ecere__sys__CopyString(temp);
1645 }
1646
1647 extern int isprint(int c);
1648
1649 char * PrintChar(char result)
1650 {
1651 char temp[100];
1652
1653 if(result > (char)0 && isprint(result))
1654 sprintf(temp, "'%c'", result);
1655 else if(result < (char)0)
1656 sprintf(temp, "%d", result);
1657 else
1658 sprintf(temp, "0x%X", (unsigned char)result);
1659 return __ecereNameSpace__ecere__sys__CopyString(temp);
1660 }
1661
1662 char * PrintUChar(unsigned char result)
1663 {
1664 char temp[100];
1665
1666 sprintf(temp, "0x%X", result);
1667 return __ecereNameSpace__ecere__sys__CopyString(temp);
1668 }
1669
1670 char * PrintFloat(float result)
1671 {
1672 char temp[350];
1673
1674 sprintf(temp, "%.16ff", result);
1675 return __ecereNameSpace__ecere__sys__CopyString(temp);
1676 }
1677
1678 char * PrintDouble(double result)
1679 {
1680 char temp[350];
1681
1682 sprintf(temp, "%.16f", result);
1683 return __ecereNameSpace__ecere__sys__CopyString(temp);
1684 }
1685
1686 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_OpTable;
1687
1688 struct OpTable
1689 {
1690 unsigned int (*  Add)(struct Expression *, struct Operand *, struct Operand *);
1691 unsigned int (*  Sub)(struct Expression *, struct Operand *, struct Operand *);
1692 unsigned int (*  Mul)(struct Expression *, struct Operand *, struct Operand *);
1693 unsigned int (*  Div)(struct Expression *, struct Operand *, struct Operand *);
1694 unsigned int (*  Mod)(struct Expression *, struct Operand *, struct Operand *);
1695 unsigned int (*  Neg)(struct Expression *, struct Operand *);
1696 unsigned int (*  Inc)(struct Expression *, struct Operand *);
1697 unsigned int (*  Dec)(struct Expression *, struct Operand *);
1698 unsigned int (*  Asign)(struct Expression *, struct Operand *, struct Operand *);
1699 unsigned int (*  AddAsign)(struct Expression *, struct Operand *, struct Operand *);
1700 unsigned int (*  SubAsign)(struct Expression *, struct Operand *, struct Operand *);
1701 unsigned int (*  MulAsign)(struct Expression *, struct Operand *, struct Operand *);
1702 unsigned int (*  DivAsign)(struct Expression *, struct Operand *, struct Operand *);
1703 unsigned int (*  ModAsign)(struct Expression *, struct Operand *, struct Operand *);
1704 unsigned int (*  BitAnd)(struct Expression *, struct Operand *, struct Operand *);
1705 unsigned int (*  BitOr)(struct Expression *, struct Operand *, struct Operand *);
1706 unsigned int (*  BitXor)(struct Expression *, struct Operand *, struct Operand *);
1707 unsigned int (*  LShift)(struct Expression *, struct Operand *, struct Operand *);
1708 unsigned int (*  RShift)(struct Expression *, struct Operand *, struct Operand *);
1709 unsigned int (*  BitNot)(struct Expression *, struct Operand *);
1710 unsigned int (*  AndAsign)(struct Expression *, struct Operand *, struct Operand *);
1711 unsigned int (*  OrAsign)(struct Expression *, struct Operand *, struct Operand *);
1712 unsigned int (*  XorAsign)(struct Expression *, struct Operand *, struct Operand *);
1713 unsigned int (*  LShiftAsign)(struct Expression *, struct Operand *, struct Operand *);
1714 unsigned int (*  RShiftAsign)(struct Expression *, struct Operand *, struct Operand *);
1715 unsigned int (*  Not)(struct Expression *, struct Operand *);
1716 unsigned int (*  Equ)(struct Expression *, struct Operand *, struct Operand *);
1717 unsigned int (*  Nqu)(struct Expression *, struct Operand *, struct Operand *);
1718 unsigned int (*  And)(struct Expression *, struct Operand *, struct Operand *);
1719 unsigned int (*  Or)(struct Expression *, struct Operand *, struct Operand *);
1720 unsigned int (*  Grt)(struct Expression *, struct Operand *, struct Operand *);
1721 unsigned int (*  Sma)(struct Expression *, struct Operand *, struct Operand *);
1722 unsigned int (*  GrtEqu)(struct Expression *, struct Operand *, struct Operand *);
1723 unsigned int (*  SmaEqu)(struct Expression *, struct Operand *, struct Operand *);
1724 unsigned int (*  Cond)(struct Expression *, struct Operand *, struct Operand *, struct Operand *);
1725 } __attribute__ ((gcc_struct));
1726
1727 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Operand;
1728
1729 struct Operand
1730 {
1731 int kind;
1732 struct Type * type;
1733 unsigned int ptrSize;
1734 union
1735 {
1736 char c;
1737 unsigned char uc;
1738 short s;
1739 unsigned short us;
1740 int i;
1741 unsigned int ui;
1742 float f;
1743 double d;
1744 unsigned char *  p;
1745 long long i64;
1746 uint64 ui64;
1747 intptr_t iptr;
1748 uintptr_t uiptr;
1749 } __attribute__ ((gcc_struct));
1750 struct OpTable ops;
1751 } __attribute__ ((gcc_struct));
1752
1753 struct Operand GetOperand(struct Expression * exp);
1754
1755 unsigned int GetInt(struct Expression * exp, int * value2)
1756 {
1757 struct Operand op2 = GetOperand(exp);
1758
1759 if(op2.kind == 3 && op2.type->isSigned)
1760 *value2 = op2.i;
1761 else if(op2.kind == 3)
1762 *value2 = (int)op2.ui;
1763 if(op2.kind == 4 && op2.type->isSigned)
1764 *value2 = (int)op2.i64;
1765 else if(op2.kind == 4)
1766 *value2 = (int)op2.ui64;
1767 else if(op2.kind == 22 && op2.type->isSigned)
1768 *value2 = (int)op2.iptr;
1769 else if(op2.kind == 22)
1770 *value2 = (int)op2.uiptr;
1771 else if(op2.kind == 2 && op2.type->isSigned)
1772 *value2 = (int)op2.s;
1773 else if(op2.kind == 2)
1774 *value2 = (int)op2.us;
1775 else if(op2.kind == 1 && op2.type->isSigned)
1776 *value2 = (int)op2.c;
1777 else if(op2.kind == 1)
1778 *value2 = (int)op2.uc;
1779 else if(op2.kind == 6)
1780 *value2 = (int)op2.f;
1781 else if(op2.kind == 7)
1782 *value2 = (int)op2.d;
1783 else if(op2.kind == 13)
1784 *value2 = (int)op2.ui;
1785 else
1786 return 0x0;
1787 return 0x1;
1788 }
1789
1790 unsigned int GetUInt(struct Expression * exp, unsigned int * value2)
1791 {
1792 struct Operand op2 = GetOperand(exp);
1793
1794 if(op2.kind == 3 && op2.type->isSigned)
1795 *value2 = (unsigned int)op2.i;
1796 else if(op2.kind == 3)
1797 *value2 = op2.ui;
1798 if(op2.kind == 4 && op2.type->isSigned)
1799 *value2 = (unsigned int)op2.i64;
1800 else if(op2.kind == 4)
1801 *value2 = (unsigned int)op2.ui64;
1802 else if(op2.kind == 22 && op2.type->isSigned)
1803 *value2 = (unsigned int)op2.iptr;
1804 else if(op2.kind == 22)
1805 *value2 = (unsigned int)op2.uiptr;
1806 else if(op2.kind == 2 && op2.type->isSigned)
1807 *value2 = (unsigned int)op2.s;
1808 else if(op2.kind == 2)
1809 *value2 = (unsigned int)op2.us;
1810 else if(op2.kind == 1 && op2.type->isSigned)
1811 *value2 = (unsigned int)op2.c;
1812 else if(op2.kind == 1)
1813 *value2 = (unsigned int)op2.uc;
1814 else if(op2.kind == 6)
1815 *value2 = (unsigned int)op2.f;
1816 else if(op2.kind == 7)
1817 *value2 = (unsigned int)op2.d;
1818 else if(op2.kind == 13)
1819 *value2 = op2.ui;
1820 else
1821 return 0x0;
1822 return 0x1;
1823 }
1824
1825 unsigned int GetInt64(struct Expression * exp, long long * value2)
1826 {
1827 struct Operand op2 = GetOperand(exp);
1828
1829 if(op2.kind == 3 && op2.type->isSigned)
1830 *value2 = (long long)op2.i;
1831 else if(op2.kind == 3)
1832 *value2 = (long long)op2.ui;
1833 if(op2.kind == 4 && op2.type->isSigned)
1834 *value2 = op2.i64;
1835 else if(op2.kind == 4)
1836 *value2 = (long long)op2.ui64;
1837 else if(op2.kind == 22 && op2.type->isSigned)
1838 *value2 = (long long)op2.iptr;
1839 else if(op2.kind == 22)
1840 *value2 = (long long)op2.uiptr;
1841 else if(op2.kind == 2 && op2.type->isSigned)
1842 *value2 = (long long)op2.s;
1843 else if(op2.kind == 2)
1844 *value2 = (long long)op2.us;
1845 else if(op2.kind == 1 && op2.type->isSigned)
1846 *value2 = (long long)op2.c;
1847 else if(op2.kind == 1)
1848 *value2 = (long long)op2.uc;
1849 else if(op2.kind == 6)
1850 *value2 = (long long)op2.f;
1851 else if(op2.kind == 7)
1852 *value2 = (long long)op2.d;
1853 else if(op2.kind == 13)
1854 *value2 = (long long)op2.ui;
1855 else
1856 return 0x0;
1857 return 0x1;
1858 }
1859
1860 unsigned int GetUInt64(struct Expression * exp, uint64 * value2)
1861 {
1862 struct Operand op2 = GetOperand(exp);
1863
1864 if(op2.kind == 3 && op2.type->isSigned)
1865 *value2 = (uint64)op2.i;
1866 else if(op2.kind == 3)
1867 *value2 = (uint64)op2.ui;
1868 if(op2.kind == 4 && op2.type->isSigned)
1869 *value2 = (uint64)op2.i64;
1870 else if(op2.kind == 4)
1871 *value2 = op2.ui64;
1872 else if(op2.kind == 22 && op2.type->isSigned)
1873 *value2 = (uint64)op2.iptr;
1874 else if(op2.kind == 22)
1875 *value2 = (uint64)op2.uiptr;
1876 else if(op2.kind == 2 && op2.type->isSigned)
1877 *value2 = (uint64)op2.s;
1878 else if(op2.kind == 2)
1879 *value2 = (uint64)op2.us;
1880 else if(op2.kind == 1 && op2.type->isSigned)
1881 *value2 = (uint64)op2.c;
1882 else if(op2.kind == 1)
1883 *value2 = (uint64)op2.uc;
1884 else if(op2.kind == 6)
1885 *value2 = (uint64)op2.f;
1886 else if(op2.kind == 7)
1887 *value2 = (uint64)op2.d;
1888 else if(op2.kind == 13)
1889 *value2 = (uint64)op2.ui;
1890 else
1891 return 0x0;
1892 return 0x1;
1893 }
1894
1895 unsigned int GetIntPtr(struct Expression * exp, intptr_t * value2)
1896 {
1897 struct Operand op2 = GetOperand(exp);
1898
1899 if(op2.kind == 3 && op2.type->isSigned)
1900 *value2 = (intptr_t)op2.i;
1901 else if(op2.kind == 3)
1902 *value2 = (intptr_t)op2.ui;
1903 if(op2.kind == 4 && op2.type->isSigned)
1904 *value2 = (intptr_t)op2.i64;
1905 else if(op2.kind == 4)
1906 *value2 = (intptr_t)op2.ui64;
1907 else if(op2.kind == 22 && op2.type->isSigned)
1908 *value2 = op2.iptr;
1909 else if(op2.kind == 22)
1910 *value2 = (intptr_t)op2.uiptr;
1911 else if(op2.kind == 2 && op2.type->isSigned)
1912 *value2 = (intptr_t)op2.s;
1913 else if(op2.kind == 2)
1914 *value2 = (intptr_t)op2.us;
1915 else if(op2.kind == 1 && op2.type->isSigned)
1916 *value2 = (intptr_t)op2.c;
1917 else if(op2.kind == 1)
1918 *value2 = (intptr_t)op2.uc;
1919 else if(op2.kind == 6)
1920 *value2 = (intptr_t)op2.f;
1921 else if(op2.kind == 7)
1922 *value2 = (intptr_t)op2.d;
1923 else if(op2.kind == 13)
1924 *value2 = (intptr_t)op2.ui;
1925 else
1926 return 0x0;
1927 return 0x1;
1928 }
1929
1930 unsigned int GetUIntPtr(struct Expression * exp, uintptr_t * value2)
1931 {
1932 struct Operand op2 = GetOperand(exp);
1933
1934 if(op2.kind == 3 && op2.type->isSigned)
1935 *value2 = (uintptr_t)op2.i;
1936 else if(op2.kind == 3)
1937 *value2 = (uintptr_t)op2.ui;
1938 if(op2.kind == 4 && op2.type->isSigned)
1939 *value2 = (uintptr_t)op2.i64;
1940 else if(op2.kind == 4)
1941 *value2 = (uintptr_t)op2.ui64;
1942 else if(op2.kind == 22 && op2.type->isSigned)
1943 *value2 = (uintptr_t)op2.iptr;
1944 else if(op2.kind == 22)
1945 *value2 = op2.uiptr;
1946 else if(op2.kind == 2 && op2.type->isSigned)
1947 *value2 = (uintptr_t)op2.s;
1948 else if(op2.kind == 2)
1949 *value2 = (uintptr_t)op2.us;
1950 else if(op2.kind == 1 && op2.type->isSigned)
1951 *value2 = (uintptr_t)op2.c;
1952 else if(op2.kind == 1)
1953 *value2 = (uintptr_t)op2.uc;
1954 else if(op2.kind == 6)
1955 *value2 = (uintptr_t)op2.f;
1956 else if(op2.kind == 7)
1957 *value2 = (uintptr_t)op2.d;
1958 else if(op2.kind == 13)
1959 *value2 = (uintptr_t)op2.ui;
1960 else
1961 return 0x0;
1962 return 0x1;
1963 }
1964
1965 unsigned int GetShort(struct Expression * exp, short * value2)
1966 {
1967 struct Operand op2 = GetOperand(exp);
1968
1969 if(op2.kind == 3 && op2.type->isSigned)
1970 *value2 = (short)op2.i;
1971 else if(op2.kind == 3)
1972 *value2 = (short)op2.ui;
1973 if(op2.kind == 4 && op2.type->isSigned)
1974 *value2 = (short)op2.i64;
1975 else if(op2.kind == 4)
1976 *value2 = (short)op2.ui64;
1977 else if(op2.kind == 22 && op2.type->isSigned)
1978 *value2 = (short)op2.iptr;
1979 else if(op2.kind == 22)
1980 *value2 = (short)op2.uiptr;
1981 else if(op2.kind == 2 && op2.type->isSigned)
1982 *value2 = op2.s;
1983 else if(op2.kind == 2)
1984 *value2 = (short)op2.us;
1985 else if(op2.kind == 1 && op2.type->isSigned)
1986 *value2 = (short)op2.c;
1987 else if(op2.kind == 1)
1988 *value2 = (short)op2.uc;
1989 else if(op2.kind == 6)
1990 *value2 = (short)op2.f;
1991 else if(op2.kind == 7)
1992 *value2 = (short)op2.d;
1993 else if(op2.kind == 13)
1994 *value2 = (short)op2.ui;
1995 else
1996 return 0x0;
1997 return 0x1;
1998 }
1999
2000 unsigned int GetUShort(struct Expression * exp, unsigned short * value2)
2001 {
2002 struct Operand op2 = GetOperand(exp);
2003
2004 if(op2.kind == 3 && op2.type->isSigned)
2005 *value2 = (unsigned short)op2.i;
2006 else if(op2.kind == 3)
2007 *value2 = (unsigned short)op2.ui;
2008 if(op2.kind == 4 && op2.type->isSigned)
2009 *value2 = (unsigned short)op2.i64;
2010 else if(op2.kind == 4)
2011 *value2 = (unsigned short)op2.ui64;
2012 else if(op2.kind == 22 && op2.type->isSigned)
2013 *value2 = (unsigned short)op2.iptr;
2014 else if(op2.kind == 22)
2015 *value2 = (unsigned short)op2.uiptr;
2016 else if(op2.kind == 2 && op2.type->isSigned)
2017 *value2 = (unsigned short)op2.s;
2018 else if(op2.kind == 2)
2019 *value2 = op2.us;
2020 else if(op2.kind == 1 && op2.type->isSigned)
2021 *value2 = (unsigned short)op2.c;
2022 else if(op2.kind == 1)
2023 *value2 = (unsigned short)op2.uc;
2024 else if(op2.kind == 6)
2025 *value2 = (unsigned short)op2.f;
2026 else if(op2.kind == 7)
2027 *value2 = (unsigned short)op2.d;
2028 else if(op2.kind == 13)
2029 *value2 = (unsigned short)op2.ui;
2030 else
2031 return 0x0;
2032 return 0x1;
2033 }
2034
2035 unsigned int GetChar(struct Expression * exp, char * value2)
2036 {
2037 struct Operand op2 = GetOperand(exp);
2038
2039 if(op2.kind == 3 && op2.type->isSigned)
2040 *value2 = (char)op2.i;
2041 else if(op2.kind == 3)
2042 *value2 = (char)op2.ui;
2043 if(op2.kind == 4 && op2.type->isSigned)
2044 *value2 = (char)op2.i64;
2045 else if(op2.kind == 4)
2046 *value2 = (char)op2.ui64;
2047 else if(op2.kind == 22 && op2.type->isSigned)
2048 *value2 = (char)op2.iptr;
2049 else if(op2.kind == 22)
2050 *value2 = (char)op2.uiptr;
2051 else if(op2.kind == 2 && op2.type->isSigned)
2052 *value2 = (char)op2.s;
2053 else if(op2.kind == 2)
2054 *value2 = (char)op2.us;
2055 else if(op2.kind == 1 && op2.type->isSigned)
2056 *value2 = op2.c;
2057 else if(op2.kind == 1)
2058 *value2 = (char)op2.uc;
2059 else if(op2.kind == 6)
2060 *value2 = (char)op2.f;
2061 else if(op2.kind == 7)
2062 *value2 = (char)op2.d;
2063 else if(op2.kind == 13)
2064 *value2 = (char)op2.ui;
2065 else
2066 return 0x0;
2067 return 0x1;
2068 }
2069
2070 unsigned int GetUChar(struct Expression * exp, unsigned char * value2)
2071 {
2072 struct Operand op2 = GetOperand(exp);
2073
2074 if(op2.kind == 3 && op2.type->isSigned)
2075 *value2 = (unsigned char)op2.i;
2076 else if(op2.kind == 3)
2077 *value2 = (unsigned char)op2.ui;
2078 if(op2.kind == 4 && op2.type->isSigned)
2079 *value2 = (unsigned char)op2.i64;
2080 else if(op2.kind == 4)
2081 *value2 = (unsigned char)op2.ui64;
2082 else if(op2.kind == 22 && op2.type->isSigned)
2083 *value2 = (unsigned char)op2.iptr;
2084 else if(op2.kind == 22)
2085 *value2 = (unsigned char)op2.uiptr;
2086 else if(op2.kind == 2 && op2.type->isSigned)
2087 *value2 = (unsigned char)op2.s;
2088 else if(op2.kind == 2)
2089 *value2 = (unsigned char)op2.us;
2090 else if(op2.kind == 1 && op2.type->isSigned)
2091 *value2 = (unsigned char)op2.c;
2092 else if(op2.kind == 1)
2093 *value2 = op2.uc;
2094 else if(op2.kind == 6)
2095 *value2 = (unsigned char)op2.f;
2096 else if(op2.kind == 7)
2097 *value2 = (unsigned char)op2.d;
2098 else if(op2.kind == 13)
2099 *value2 = (unsigned char)op2.ui;
2100 else
2101 return 0x0;
2102 return 0x1;
2103 }
2104
2105 unsigned int GetFloat(struct Expression * exp, float * value2)
2106 {
2107 struct Operand op2 = GetOperand(exp);
2108
2109 if(op2.kind == 3 && op2.type->isSigned)
2110 *value2 = (float)(float)op2.i;
2111 else if(op2.kind == 3)
2112 *value2 = (float)(float)op2.ui;
2113 if(op2.kind == 4 && op2.type->isSigned)
2114 *value2 = (float)(float)op2.i64;
2115 else if(op2.kind == 4)
2116 *value2 = (float)(float)op2.ui64;
2117 else if(op2.kind == 22 && op2.type->isSigned)
2118 *value2 = (float)op2.iptr;
2119 else if(op2.kind == 22)
2120 *value2 = (float)op2.uiptr;
2121 else if(op2.kind == 2 && op2.type->isSigned)
2122 *value2 = (float)(float)op2.s;
2123 else if(op2.kind == 2)
2124 *value2 = (float)(float)op2.us;
2125 else if(op2.kind == 1 && op2.type->isSigned)
2126 *value2 = (float)(float)op2.c;
2127 else if(op2.kind == 1)
2128 *value2 = (float)(float)op2.uc;
2129 else if(op2.kind == 6)
2130 *value2 = (float)op2.f;
2131 else if(op2.kind == 7)
2132 *value2 = (float)op2.d;
2133 else if(op2.kind == 13)
2134 *value2 = (float)(float)op2.ui;
2135 else
2136 return 0x0;
2137 return 0x1;
2138 }
2139
2140 unsigned int GetDouble(struct Expression * exp, double * value2)
2141 {
2142 struct Operand op2 = GetOperand(exp);
2143
2144 if(op2.kind == 3 && op2.type->isSigned)
2145 *value2 = (double)(double)op2.i;
2146 else if(op2.kind == 3)
2147 *value2 = (double)(double)op2.ui;
2148 if(op2.kind == 4 && op2.type->isSigned)
2149 *value2 = (double)(double)op2.i64;
2150 else if(op2.kind == 4)
2151 *value2 = (double)(double)op2.ui64;
2152 else if(op2.kind == 22 && op2.type->isSigned)
2153 *value2 = (double)op2.iptr;
2154 else if(op2.kind == 22)
2155 *value2 = (double)op2.uiptr;
2156 else if(op2.kind == 2 && op2.type->isSigned)
2157 *value2 = (double)(double)op2.s;
2158 else if(op2.kind == 2)
2159 *value2 = (double)(double)op2.us;
2160 else if(op2.kind == 1 && op2.type->isSigned)
2161 *value2 = (double)(double)op2.c;
2162 else if(op2.kind == 1)
2163 *value2 = (double)(double)op2.uc;
2164 else if(op2.kind == 6)
2165 *value2 = (double)op2.f;
2166 else if(op2.kind == 7)
2167 *value2 = (double)op2.d;
2168 else if(op2.kind == 13)
2169 *value2 = (double)(double)op2.ui;
2170 else
2171 return 0x0;
2172 return 0x1;
2173 }
2174
2175 void ComputeExpression(struct Expression * exp);
2176
2177 struct Context * SetupTemplatesContext(struct __ecereNameSpace__ecere__com__Class * _class);
2178
2179 int ComputeTypeSize(struct Type * type);
2180
2181 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__BitMember;
2182
2183 struct __ecereNameSpace__ecere__com__BitMember
2184 {
2185 struct __ecereNameSpace__ecere__com__BitMember * prev;
2186 struct __ecereNameSpace__ecere__com__BitMember * next;
2187 char *  name;
2188 unsigned int isProperty;
2189 int memberAccess;
2190 int id;
2191 struct __ecereNameSpace__ecere__com__Class * _class;
2192 char *  dataTypeString;
2193 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
2194 struct Type * dataType;
2195 int type;
2196 int size;
2197 int pos;
2198 uint64 mask;
2199 } __attribute__ ((gcc_struct));
2200
2201 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__OldLink;
2202
2203 struct __ecereNameSpace__ecere__sys__OldLink
2204 {
2205 struct __ecereNameSpace__ecere__sys__OldLink * prev;
2206 struct __ecereNameSpace__ecere__sys__OldLink * next;
2207 void *  data;
2208 } __attribute__ ((gcc_struct));
2209
2210 void FinishTemplatesContext(struct Context * context);
2211
2212 void ComputeClassMembers(struct __ecereNameSpace__ecere__com__Class * _class, unsigned int isMember)
2213 {
2214 struct __ecereNameSpace__ecere__com__DataMember * member = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
2215 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
2216
2217 if(member || ((_class->type == 2 || _class->type == 0 || _class->type == 1 || _class->type == 5) && (_class->type == 2 || _class->structSize == _class->offset) && _class->computeSize))
2218 {
2219 int c;
2220 int unionMemberOffset = 0;
2221 int bitFields = 0;
2222
2223 if(!member && _class->destructionWatchOffset)
2224 _class->memberOffset += sizeof(struct __ecereNameSpace__ecere__sys__OldList);
2225 {
2226 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
2227
2228 for(dataMember = member ? member->members.first : _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
2229 {
2230 if(!dataMember->isProperty)
2231 {
2232 if(dataMember->type == 0 && dataMember->dataTypeString && !dataMember->dataType)
2233 {
2234 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
2235 }
2236 }
2237 }
2238 }
2239 {
2240 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
2241
2242 for(dataMember = member ? member->members.first : _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
2243 {
2244 if(!dataMember->isProperty && (dataMember->type != 0 || dataMember->dataTypeString))
2245 {
2246 if(!isMember && _class->type == 2 && dataMember->dataType)
2247 {
2248 struct __ecereNameSpace__ecere__com__BitMember * bitMember = (struct __ecereNameSpace__ecere__com__BitMember *)dataMember;
2249 uint64 mask = 0;
2250 int d;
2251
2252 ComputeTypeSize(dataMember->dataType);
2253 if(bitMember->pos == -1)
2254 bitMember->pos = _class->memberOffset;
2255 if(!bitMember->size)
2256 bitMember->size = dataMember->dataType->size * 8;
2257 _class->memberOffset = bitMember->pos + bitMember->size;
2258 for(d = 0; d < bitMember->size; d++)
2259 {
2260 if(d)
2261 mask <<= 1;
2262 mask |= 1;
2263 }
2264 bitMember->mask = mask << bitMember->pos;
2265 }
2266 else if(dataMember->type == 0 && dataMember->dataType)
2267 {
2268 int size;
2269 int alignment = 0;
2270
2271 if(dataMember->dataType->kind != 8 || ((!dataMember->dataType->_class || !dataMember->dataType->_class->registered || dataMember->dataType->_class->registered != _class || _class->type != 1)))
2272 ComputeTypeSize(dataMember->dataType);
2273 if(dataMember->dataType->bitFieldCount)
2274 {
2275 bitFields += dataMember->dataType->bitFieldCount;
2276 size = 0;
2277 }
2278 else
2279 {
2280 if(bitFields)
2281 {
2282 int size = (bitFields + 7) / 8;
2283
2284 if(isMember)
2285 {
2286 int __simpleStruct0;
2287
2288 if(alignment)
2289 {
2290 int __simpleStruct0;
2291
2292 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2293 if(member->memberOffset % alignment)
2294 member->memberOffset += alignment - (member->memberOffset % alignment);
2295 }
2296 dataMember->offset = member->memberOffset;
2297 if(member->type == 1)
2298 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2299 else
2300 {
2301 member->memberOffset += size;
2302 }
2303 }
2304 else
2305 {
2306 if(alignment)
2307 {
2308 int __simpleStruct0;
2309
2310 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2311 if(_class->memberOffset % alignment)
2312 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2313 }
2314 dataMember->offset = _class->memberOffset;
2315 _class->memberOffset += size;
2316 }
2317 bitFields = 0;
2318 }
2319 size = dataMember->dataType->size;
2320 alignment = dataMember->dataType->alignment;
2321 }
2322 if(isMember)
2323 {
2324 int __simpleStruct0;
2325
2326 if(alignment)
2327 {
2328 int __simpleStruct0;
2329
2330 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2331 if(member->memberOffset % alignment)
2332 member->memberOffset += alignment - (member->memberOffset % alignment);
2333 }
2334 dataMember->offset = member->memberOffset;
2335 if(member->type == 1)
2336 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2337 else
2338 {
2339 member->memberOffset += size;
2340 }
2341 }
2342 else
2343 {
2344 if(alignment)
2345 {
2346 int __simpleStruct0;
2347
2348 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2349 if(_class->memberOffset % alignment)
2350 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2351 }
2352 dataMember->offset = _class->memberOffset;
2353 _class->memberOffset += size;
2354 }
2355 }
2356 else
2357 {
2358 ComputeClassMembers((struct __ecereNameSpace__ecere__com__Class *)dataMember, 0x1);
2359 if(isMember)
2360 {
2361 int __simpleStruct2;
2362 int __simpleStruct0, __simpleStruct1;
2363
2364 member->structAlignment = (__simpleStruct0 = member->structAlignment, __simpleStruct1 = dataMember->structAlignment, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
2365 dataMember->offset = member->memberOffset;
2366 if(member->type == 1)
2367 unionMemberOffset = (__simpleStruct2 = dataMember->memberOffset, (unionMemberOffset > __simpleStruct2) ? unionMemberOffset : __simpleStruct2);
2368 else
2369 member->memberOffset += dataMember->memberOffset;
2370 }
2371 else
2372 {
2373 int __simpleStruct0, __simpleStruct1;
2374
2375 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, __simpleStruct1 = dataMember->structAlignment, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
2376 dataMember->offset = _class->memberOffset;
2377 _class->memberOffset += dataMember->memberOffset;
2378 }
2379 }
2380 }
2381 }
2382 if(bitFields)
2383 {
2384 int alignment = 0;
2385 int size = (bitFields + 7) / 8;
2386
2387 if(isMember)
2388 {
2389 int __simpleStruct0;
2390
2391 if(alignment)
2392 {
2393 int __simpleStruct0;
2394
2395 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2396 if(member->memberOffset % alignment)
2397 member->memberOffset += alignment - (member->memberOffset % alignment);
2398 }
2399 if(member->type == 1)
2400 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2401 else
2402 {
2403 member->memberOffset += size;
2404 }
2405 }
2406 else
2407 {
2408 if(alignment)
2409 {
2410 int __simpleStruct0;
2411
2412 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2413 if(_class->memberOffset % alignment)
2414 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2415 }
2416 _class->memberOffset += size;
2417 }
2418 bitFields = 0;
2419 }
2420 }
2421 if(member && member->type == 1)
2422 {
2423 member->memberOffset = unionMemberOffset;
2424 }
2425 if(!isMember)
2426 {
2427 if(_class->type != 2)
2428 {
2429 _class->structSize = (_class->base ? (_class->base->templateClass ? _class->base->templateClass->structSize : _class->base->structSize) : 0) + _class->memberOffset;
2430 if(!member)
2431 {
2432 struct __ecereNameSpace__ecere__com__Property * prop;
2433
2434 for(prop = _class->membersAndProperties.first; prop; prop = prop->next)
2435 {
2436 if(prop->isProperty && prop->isWatchable)
2437 {
2438 prop->watcherOffset = _class->structSize;
2439 _class->structSize += sizeof(struct __ecereNameSpace__ecere__sys__OldList);
2440 }
2441 }
2442 }
2443 {
2444 struct __ecereNameSpace__ecere__sys__OldLink * derivative;
2445
2446 for(derivative = _class->derivatives.first; derivative; derivative = derivative->next)
2447 {
2448 struct __ecereNameSpace__ecere__com__Class * deriv = derivative->data;
2449
2450 if(deriv->computeSize)
2451 {
2452 deriv->offset = _class->structSize;
2453 deriv->memberOffset = 0;
2454 deriv->structSize = deriv->offset;
2455 ComputeClassMembers(deriv, 0x0);
2456 }
2457 }
2458 }
2459 }
2460 }
2461 }
2462 if(context)
2463 FinishTemplatesContext(context);
2464 }
2465
2466 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__NameSpace;
2467
2468 struct __ecereNameSpace__ecere__com__NameSpace
2469 {
2470 char *  name;
2471 struct __ecereNameSpace__ecere__com__NameSpace *  btParent;
2472 struct __ecereNameSpace__ecere__com__NameSpace *  left;
2473 struct __ecereNameSpace__ecere__com__NameSpace *  right;
2474 int depth;
2475 struct __ecereNameSpace__ecere__com__NameSpace *  parent;
2476 struct __ecereNameSpace__ecere__sys__BinaryTree nameSpaces;
2477 struct __ecereNameSpace__ecere__sys__BinaryTree classes;
2478 struct __ecereNameSpace__ecere__sys__BinaryTree defines;
2479 struct __ecereNameSpace__ecere__sys__BinaryTree functions;
2480 } __attribute__ ((gcc_struct));
2481
2482 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Module;
2483
2484 struct __ecereNameSpace__ecere__com__Module
2485 {
2486 struct __ecereNameSpace__ecere__com__Instance * application;
2487 struct __ecereNameSpace__ecere__sys__OldList classes;
2488 struct __ecereNameSpace__ecere__sys__OldList defines;
2489 struct __ecereNameSpace__ecere__sys__OldList functions;
2490 struct __ecereNameSpace__ecere__sys__OldList modules;
2491 struct __ecereNameSpace__ecere__com__Instance * prev;
2492 struct __ecereNameSpace__ecere__com__Instance * next;
2493 char *  name;
2494 void *  library;
2495 void *  Unload;
2496 int importType;
2497 int origImportType;
2498 struct __ecereNameSpace__ecere__com__NameSpace privateNameSpace;
2499 struct __ecereNameSpace__ecere__com__NameSpace publicNameSpace;
2500 } __attribute__ ((gcc_struct));
2501
2502 void ComputeModuleClasses(struct __ecereNameSpace__ecere__com__Instance * module)
2503 {
2504 struct __ecereNameSpace__ecere__com__Class * _class;
2505 struct __ecereNameSpace__ecere__sys__OldLink * subModule;
2506
2507 for(subModule = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + 12)))->modules.first; subModule; subModule = subModule->next)
2508 ComputeModuleClasses(subModule->data);
2509 for(_class = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + 12)))->classes.first; _class; _class = _class->next)
2510 ComputeClassMembers(_class, 0x0);
2511 }
2512
2513 extern int targetBits;
2514
2515 extern unsigned int inCompiler;
2516
2517 extern void Compiler_Error(char *  format, ...);
2518
2519 extern char *  __ecereNameSpace__ecere__GetTranslatedString(struct __ecereNameSpace__ecere__com__Instance * module, char *  string, char *  stringAndContext);
2520
2521 extern struct __ecereNameSpace__ecere__com__Instance * __thisModule;
2522
2523 extern int __ecereNameSpace__ecere__com__eClass_GetProperty(struct __ecereNameSpace__ecere__com__Class * _class, char *  name);
2524
2525 int ComputeTypeSize(struct Type * type)
2526 {
2527 unsigned int size = type ? type->size : 0;
2528
2529 if(!size && type && !type->computing)
2530 {
2531 type->computing = 0x1;
2532 switch(type->kind)
2533 {
2534 case 1:
2535 type->alignment = size = sizeof(char);
2536 break;
2537 case 3:
2538 type->alignment = size = sizeof(int);
2539 break;
2540 case 4:
2541 type->alignment = size = sizeof(long long);
2542 break;
2543 case 22:
2544 type->alignment = size = targetBits / 8;
2545 break;
2546 case 5:
2547 type->alignment = size = sizeof(long);
2548 break;
2549 case 2:
2550 type->alignment = size = sizeof(short);
2551 break;
2552 case 6:
2553 type->alignment = size = sizeof(float);
2554 break;
2555 case 7:
2556 type->alignment = size = sizeof(double);
2557 break;
2558 case 8:
2559 {
2560 struct __ecereNameSpace__ecere__com__Class * _class = type->_class ? type->_class->registered : (((void *)0));
2561
2562 if(_class && _class->type == 1)
2563 {
2564 ComputeClassMembers(_class, 0x0);
2565 type->alignment = _class->structAlignment;
2566 size = _class->structSize;
2567 if(type->alignment && size % type->alignment)
2568 size += type->alignment - (size % type->alignment);
2569 }
2570 else if(_class && (_class->type == 3 || _class->type == 4 || _class->type == 2))
2571 {
2572 if(!_class->dataType)
2573 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
2574 size = type->alignment = ComputeTypeSize(_class->dataType);
2575 }
2576 else
2577 size = type->alignment = targetBits / 8;
2578 break;
2579 }
2580 case 13:
2581 case 19:
2582 size = type->alignment = targetBits / 8;
2583 break;
2584 case 12:
2585 if(type->arraySizeExp)
2586 {
2587 ProcessExpressionType(type->arraySizeExp);
2588 ComputeExpression(type->arraySizeExp);
2589 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)))
2590 {
2591 struct Location oldLoc = yylloc;
2592 char expression[10240];
2593
2594 expression[0] = '\0';
2595 type->arraySizeExp->expType = (((void *)0));
2596 yylloc = type->arraySizeExp->loc;
2597 if(inCompiler)
2598 PrintExpression(type->arraySizeExp, expression);
2599 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Array size not constant int (%s)\n", (((void *)0))), expression);
2600 yylloc = oldLoc;
2601 }
2602 GetInt(type->arraySizeExp, &type->arraySize);
2603 }
2604 else if(type->enumClass)
2605 {
2606 if(type->enumClass && type->enumClass->registered && type->enumClass->registered->type == 4)
2607 {
2608 type->arraySize = __ecereNameSpace__ecere__com__eClass_GetProperty(type->enumClass->registered, "enumSize");
2609 }
2610 else
2611 type->arraySize = 0;
2612 }
2613 else
2614 {
2615 type->arraySize = 0;
2616 }
2617 size = ComputeTypeSize(type->type) * type->arraySize;
2618 type->alignment = type->type->alignment;
2619 break;
2620 case 9:
2621 {
2622 struct Type * member;
2623
2624 for(member = type->members.first; member; member = member->next)
2625 {
2626 int __simpleStruct0, __simpleStruct1;
2627 unsigned int addSize = ComputeTypeSize(member);
2628
2629 member->offset = size;
2630 if(member->alignment && size % member->alignment)
2631 member->offset += member->alignment - (size % member->alignment);
2632 size = member->offset;
2633 type->alignment = (__simpleStruct0 = type->alignment, __simpleStruct1 = member->alignment, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
2634 size += addSize;
2635 }
2636 if(type->alignment && size % type->alignment)
2637 size += type->alignment - (size % type->alignment);
2638 break;
2639 }
2640 case 10:
2641 {
2642 struct Type * member;
2643
2644 for(member = type->members.first; member; member = member->next)
2645 {
2646 int __simpleStruct0, __simpleStruct1;
2647 unsigned int addSize = ComputeTypeSize(member);
2648
2649 member->offset = size;
2650 if(member->alignment && size % member->alignment)
2651 member->offset += member->alignment - (size % member->alignment);
2652 size = member->offset;
2653 type->alignment = (__simpleStruct0 = type->alignment, __simpleStruct1 = member->alignment, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
2654 size = ((size > addSize) ? size : addSize);
2655 }
2656 if(type->alignment && size % type->alignment)
2657 size += type->alignment - (size % type->alignment);
2658 break;
2659 }
2660 case 20:
2661 {
2662 struct TemplateParameter * param = type->templateParameter;
2663 struct Type * baseType = ProcessTemplateParameterType(param);
2664
2665 if(baseType)
2666 size = ComputeTypeSize(baseType);
2667 else
2668 size = sizeof(uint64);
2669 break;
2670 }
2671 case 15:
2672 {
2673 size = sizeof(enum
2674 {
2675 test
2676 });
2677 break;
2678 }
2679 case 21:
2680 {
2681 size = targetBits / 8;
2682 break;
2683 }
2684 }
2685 type->size = size;
2686 type->computing = 0x0;
2687 }
2688 return size;
2689 }
2690
2691 extern struct Declarator * MkDeclaratorIdentifier(struct Identifier * id);
2692
2693 extern struct Identifier * MkIdentifier(char *  string);
2694
2695 extern void ListAdd(struct __ecereNameSpace__ecere__sys__OldList * list, void *  item);
2696
2697 extern struct Declarator * MkStructDeclarator(struct Declarator * declarator, struct Expression * exp);
2698
2699 extern struct ClassDef * MkClassDefDeclaration(struct Declaration * decl);
2700
2701 extern struct Declaration * MkStructDeclaration(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct __ecereNameSpace__ecere__sys__OldList * declarators, struct Specifier * extStorage);
2702
2703 void ReplaceThisClassSpecifiers(struct __ecereNameSpace__ecere__sys__OldList * specs, struct __ecereNameSpace__ecere__com__Class * _class);
2704
2705 static void DeclareType(struct Type * type, unsigned int declarePointers, unsigned int declareParams);
2706
2707 extern void FreeType(struct Type * type);
2708
2709 extern struct Specifier * MkStructOrUnion(int type, struct Identifier * id, struct __ecereNameSpace__ecere__sys__OldList * definitions);
2710
2711 extern struct Specifier * MkSpecifier(int specifier);
2712
2713 extern struct Declarator * MkDeclaratorArray(struct Declarator * declarator, struct Expression * exp);
2714
2715 extern struct Expression * MkExpConstant(char *  string);
2716
2717 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)
2718 {
2719 struct __ecereNameSpace__ecere__com__DataMember * topMember = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
2720 unsigned int totalSize = 0;
2721 unsigned int maxSize = 0;
2722 int alignment, size;
2723 struct __ecereNameSpace__ecere__com__DataMember * member;
2724 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
2725
2726 if(!isMember && _class->base)
2727 {
2728 maxSize = _class->structSize;
2729 {
2730 if(_class->type == 1 || _class->type == 5)
2731 AddMembers(declarations, _class->base, 0x0, &totalSize, topClass);
2732 else
2733 maxSize -= _class->base->templateClass ? _class->base->templateClass->structSize : _class->base->structSize;
2734 }
2735 }
2736 for(member = isMember ? topMember->members.first : _class->membersAndProperties.first; member; member = member->next)
2737 {
2738 if(!member->isProperty)
2739 {
2740 switch(member->type)
2741 {
2742 case 0:
2743 {
2744 if(member->dataTypeString)
2745 {
2746 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList(), * decls = MkList();
2747 struct Declarator * decl;
2748
2749 decl = SpecDeclFromString(member->dataTypeString, specs, MkDeclaratorIdentifier(MkIdentifier(member->name)));
2750 ListAdd(decls, MkStructDeclarator(decl, (((void *)0))));
2751 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(specs, decls, (((void *)0)))));
2752 if(!member->dataType)
2753 member->dataType = ProcessType(specs, decl);
2754 ReplaceThisClassSpecifiers(specs, topClass);
2755 {
2756 struct Type * type = ProcessType(specs, decl);
2757
2758 DeclareType(member->dataType, 0x0, 0x0);
2759 FreeType(type);
2760 }
2761 ComputeTypeSize(member->dataType);
2762 size = member->dataType->size;
2763 alignment = member->dataType->alignment;
2764 if(alignment)
2765 {
2766 if(totalSize % alignment)
2767 totalSize += alignment - (totalSize % alignment);
2768 }
2769 totalSize += size;
2770 }
2771 break;
2772 }
2773 case 1:
2774 case 2:
2775 {
2776 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList(), * list = MkList();
2777
2778 size = 0;
2779 AddMembers(list, (struct __ecereNameSpace__ecere__com__Class *)member, 0x1, &size, topClass);
2780 ListAdd(specs, MkStructOrUnion((member->type == 1) ? 4 : 3, (((void *)0)), list));
2781 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(specs, (((void *)0)), (((void *)0)))));
2782 alignment = member->structAlignment;
2783 if(alignment)
2784 {
2785 if(totalSize % alignment)
2786 totalSize += alignment - (totalSize % alignment);
2787 }
2788 totalSize += size;
2789 break;
2790 }
2791 }
2792 }
2793 }
2794 if(retSize)
2795 {
2796 unsigned int __simpleStruct0;
2797
2798 if(topMember && topMember->type == 1)
2799 *retSize = (__simpleStruct0 = *retSize, (__simpleStruct0 > totalSize) ? __simpleStruct0 : totalSize);
2800 else
2801 *retSize += totalSize;
2802 }
2803 else if(totalSize < maxSize && _class->type != 1000)
2804 {
2805 char sizeString[50];
2806
2807 sprintf(sizeString, "%d", maxSize - totalSize);
2808 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(CHAR)), MkListOne(MkDeclaratorArray(MkDeclaratorIdentifier(MkIdentifier("__ecere_padding")), MkExpConstant(sizeString))), (((void *)0)))));
2809 }
2810 if(context)
2811 FinishTemplatesContext(context);
2812 return topMember ? topMember->memberID : _class->memberID;
2813 }
2814
2815 static int DeclareMembers(struct __ecereNameSpace__ecere__com__Class * _class, unsigned int isMember)
2816 {
2817 struct __ecereNameSpace__ecere__com__DataMember * topMember = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
2818 unsigned int totalSize = 0;
2819 struct __ecereNameSpace__ecere__com__DataMember * member;
2820 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
2821
2822 if(!isMember && (_class->type == 1 || _class->type == 5) && _class->base->type != 1000)
2823 DeclareMembers(_class->base, 0x0);
2824 for(member = isMember ? topMember->members.first : _class->membersAndProperties.first; member; member = member->next)
2825 {
2826 if(!member->isProperty)
2827 {
2828 switch(member->type)
2829 {
2830 case 0:
2831 {
2832 if(!member->dataType && member->dataTypeString)
2833 member->dataType = ProcessTypeString(member->dataTypeString, 0x0);
2834 if(member->dataType)
2835 DeclareType(member->dataType, 0x0, 0x0);
2836 break;
2837 }
2838 case 1:
2839 case 2:
2840 {
2841 DeclareMembers((struct __ecereNameSpace__ecere__com__Class *)member, 0x1);
2842 break;
2843 }
2844 }
2845 }
2846 }
2847 if(context)
2848 FinishTemplatesContext(context);
2849 return topMember ? topMember->memberID : _class->memberID;
2850 }
2851
2852 extern struct Symbol * FindClass(char *  name);
2853
2854 extern char *  strchr(char * , int);
2855
2856 extern void FullClassNameCat(char *  output, char *  className, unsigned int includeTemplateParams);
2857
2858 extern void FreeList(struct __ecereNameSpace__ecere__sys__OldList * list, void (* )(void * ));
2859
2860 extern struct External * MkExternalDeclaration(struct Declaration * declaration);
2861
2862 extern struct Declaration * MkDeclaration(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct __ecereNameSpace__ecere__sys__OldList * initDeclarators);
2863
2864 extern char *  strcpy(char * , const char * );
2865
2866 extern void MangleClassName(char *  className);
2867
2868 extern void DeclareClass(struct Symbol * classSym, char *  className);
2869
2870 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move(struct __ecereNameSpace__ecere__sys__OldList * this, void *  item, void *  prevItem);
2871
2872 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(struct __ecereNameSpace__ecere__sys__OldList * this, void *  prevItem, void *  item);
2873
2874 void DeclareStruct(char * name, unsigned int skipNoHead)
2875 {
2876 struct External * external = (((void *)0));
2877 struct Symbol * classSym = FindClass(name);
2878
2879 if(!inCompiler || !classSym)
2880 return (((void *)0));
2881 if(classSym->registered && (classSym->registered->type == 2 || classSym->registered->type == 3 || classSym->registered->type == 4))
2882 return (((void *)0));
2883 if(classSym->registered && classSym->imported && !classSym->declaredStructSym)
2884 {
2885 struct Declaration * decl;
2886 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
2887 struct __ecereNameSpace__ecere__sys__OldList * declarations = (((void *)0));
2888 char structName[1024];
2889
2890 external = (classSym->registered && classSym->registered->type == 1) ? classSym->pointerExternal : classSym->structExternal;
2891 classSym->declaring++;
2892 if(strchr(classSym->string, '<'))
2893 {
2894 if(classSym->registered->templateClass)
2895 {
2896 DeclareStruct(classSym->registered->templateClass->fullName, skipNoHead);
2897 classSym->declaring--;
2898 }
2899 return (((void *)0));
2900 }
2901 DeclareMembers(classSym->registered, 0x0);
2902 structName[0] = (char)0;
2903 FullClassNameCat(structName, name, 0x0);
2904 if(!skipNoHead)
2905 {
2906 classSym->declaredStructSym = 0x1;
2907 declarations = MkList();
2908 AddMembers(declarations, classSym->registered, 0x0, (((void *)0)), classSym->registered);
2909 if(!(*declarations).count)
2910 {
2911 FreeList(declarations, (((void *)0)));
2912 declarations = (((void *)0));
2913 }
2914 }
2915 if(skipNoHead || declarations)
2916 {
2917 if(external && external->declaration)
2918 {
2919 ((struct Specifier *)(*external->declaration->specifiers).first)->definitions = declarations;
2920 if(curExternal && curExternal->symbol && curExternal->symbol->idCode < classSym->id)
2921 {
2922 if(classSym->structExternal)
2923 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->structExternal, curExternal->prev);
2924 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->pointerExternal, curExternal->prev);
2925 classSym->id = curExternal->symbol->idCode;
2926 classSym->idCode = curExternal->symbol->idCode;
2927 }
2928 }
2929 else
2930 {
2931 if(!external)
2932 external = MkExternalDeclaration((((void *)0)));
2933 specifiers = MkList();
2934 declarators = MkList();
2935 ListAdd(specifiers, MkStructOrUnion(3, MkIdentifier(structName), declarations));
2936 external->declaration = decl = MkDeclaration(specifiers, declarators);
2937 if(decl->symbol && !decl->symbol->pointerExternal)
2938 decl->symbol->pointerExternal = external;
2939 if(classSym->registered && classSym->registered->type == 1)
2940 {
2941 char className[1024];
2942
2943 strcpy(className, "__ecereClass_");
2944 FullClassNameCat(className, classSym->string, 0x1);
2945 MangleClassName(className);
2946 DeclareClass(classSym, className);
2947 external->symbol = classSym;
2948 classSym->pointerExternal = external;
2949 classSym->id = (curExternal && curExternal->symbol) ? curExternal->symbol->idCode : 0;
2950 classSym->idCode = (curExternal && curExternal->symbol) ? curExternal->symbol->idCode : 0;
2951 }
2952 else
2953 {
2954 char className[1024];
2955
2956 strcpy(className, "__ecereClass_");
2957 FullClassNameCat(className, classSym->string, 0x1);
2958 MangleClassName(className);
2959 classSym->structExternal = external;
2960 DeclareClass(classSym, className);
2961 external->symbol = classSym;
2962 }
2963 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal ? curExternal->prev : (((void *)0)), external);
2964 }
2965 }
2966 classSym->declaring--;
2967 }
2968 else if(curExternal && curExternal->symbol && curExternal->symbol->idCode < classSym->id)
2969 {
2970 classSym->declaring++;
2971 {
2972 if(classSym->registered)
2973 DeclareMembers(classSym->registered, 0x0);
2974 }
2975 if(classSym->registered && (classSym->registered->type == 1 || classSym->registered->type == 5))
2976 {
2977 if(classSym->structExternal)
2978 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->structExternal, curExternal->prev);
2979 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->pointerExternal, curExternal->prev);
2980 classSym->id = curExternal->symbol->idCode;
2981 classSym->idCode = curExternal->symbol->idCode;
2982 }
2983 classSym->declaring--;
2984 }
2985 }
2986
2987 extern char *  strcat(char * , const char * );
2988
2989 extern struct ModuleImport * FindModule(struct __ecereNameSpace__ecere__com__Instance * moduleToFind);
2990
2991 extern struct ModuleImport * mainModule;
2992
2993 extern struct Specifier * MkSpecifierName(char *  name);
2994
2995 extern struct Declarator * MkDeclaratorBrackets(struct Declarator * declarator);
2996
2997 extern struct Declarator * PlugDeclarator(struct Declarator * decl, struct Declarator * baseDecl);
2998
2999 extern struct Declarator * MkDeclaratorFunction(struct Declarator * declarator, struct __ecereNameSpace__ecere__sys__OldList * parameters);
3000
3001 extern struct InitDeclarator * MkInitDeclarator(struct Declarator * declarator, struct Initializer * initializer);
3002
3003 extern void FreeDeclarator(struct Declarator * decl);
3004
3005 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_PropertyImport;
3006
3007 struct PropertyImport
3008 {
3009 struct PropertyImport * prev;
3010 struct PropertyImport * next;
3011 char *  name;
3012 unsigned int isVirtual;
3013 unsigned int hasSet;
3014 unsigned int hasGet;
3015 } __attribute__ ((gcc_struct));
3016
3017 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(struct __ecereNameSpace__ecere__sys__OldList * this, void *  item);
3018
3019 void DeclareProperty(struct __ecereNameSpace__ecere__com__Property * prop, char * setName, char * getName)
3020 {
3021 void * __ecereTemp1;
3022 struct Symbol * symbol = prop->symbol;
3023 char propName[1024];
3024
3025 strcpy(setName, "__ecereProp_");
3026 FullClassNameCat(setName, prop->_class->fullName, 0x0);
3027 strcat(setName, "_Set_");
3028 FullClassNameCat(setName, prop->name, 0x1);
3029 strcpy(getName, "__ecereProp_");
3030 FullClassNameCat(getName, prop->_class->fullName, 0x0);
3031 strcat(getName, "_Get_");
3032 FullClassNameCat(getName, prop->name, 0x1);
3033 strcpy(propName, "__ecereProp_");
3034 FullClassNameCat(propName, prop->_class->fullName, 0x0);
3035 strcat(propName, "_");
3036 FullClassNameCat(propName, prop->name, 0x1);
3037 MangleClassName(getName);
3038 MangleClassName(setName);
3039 MangleClassName(propName);
3040 if(prop->_class->type == 1)
3041 DeclareStruct(prop->_class->fullName, 0x0);
3042 if(!symbol || curExternal->symbol->idCode < symbol->id)
3043 {
3044 unsigned int imported = 0x0;
3045 unsigned int dllImport = 0x0;
3046
3047 if(!symbol || symbol->_import)
3048 {
3049 if(!symbol)
3050 {
3051 struct Symbol * classSym;
3052
3053 if(!prop->_class->symbol)
3054 prop->_class->symbol = FindClass(prop->_class->fullName);
3055 classSym = prop->_class->symbol;
3056 if(classSym && !classSym->_import)
3057 {
3058 struct ModuleImport * module;
3059
3060 if(prop->_class->module)
3061 module = FindModule(prop->_class->module);
3062 else
3063 module = mainModule;
3064 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));
3065 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->classes, classSym->_import);
3066 }
3067 symbol = prop->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
3068 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));
3069 if(classSym)
3070 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&classSym->_import->properties, symbol->_import);
3071 }
3072 imported = 0x1;
3073 if(prop->_class->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)prop->_class->module + 12)))->importType != 1)
3074 dllImport = 0x1;
3075 }
3076 if(!symbol->type)
3077 {
3078 struct Context * context = SetupTemplatesContext(prop->_class);
3079
3080 symbol->type = ProcessTypeString(prop->dataTypeString, 0x0);
3081 FinishTemplatesContext(context);
3082 }
3083 if(prop->Get)
3084 {
3085 if(!symbol->externalGet || symbol->externalGet->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 unsigned int simple = 0x0;
3095
3096 specifiers = MkList();
3097 declarators = MkList();
3098 params = MkList();
3099 ListAdd(params, MkTypeName(MkListOne(MkSpecifierName(prop->_class->fullName)), MkDeclaratorIdentifier(MkIdentifier("this"))));
3100 d = MkDeclaratorIdentifier(MkIdentifier(getName));
3101 if(dllImport)
3102 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
3103 {
3104 struct Context * context = SetupTemplatesContext(prop->_class);
3105
3106 typeDecl = SpecDeclFromString(prop->dataTypeString, specifiers, (((void *)0)));
3107 FinishTemplatesContext(context);
3108 }
3109 for(spec = (*specifiers).first; spec; spec = spec->next)
3110 {
3111 if(spec->type == 1)
3112 {
3113 if((!typeDecl || typeDecl->type == 1))
3114 {
3115 struct Symbol * classSym = spec->symbol;
3116
3117 symbol->_class = classSym->registered;
3118 if(classSym->registered && classSym->registered->type == 1)
3119 {
3120 DeclareStruct(spec->name, 0x0);
3121 simple = 0x1;
3122 }
3123 }
3124 }
3125 }
3126 if(!simple)
3127 d = PlugDeclarator(typeDecl, d);
3128 else
3129 {
3130 ListAdd(params, MkTypeName(specifiers, PlugDeclarator(typeDecl, MkDeclaratorIdentifier(MkIdentifier("value")))));
3131 specifiers = MkList();
3132 }
3133 d = MkDeclaratorFunction(d, params);
3134 if(dllImport)
3135 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
3136 else if(prop->_class->symbol && ((struct Symbol *)prop->_class->symbol)->isStatic)
3137 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
3138 if(simple)
3139 ListAdd(specifiers, MkSpecifier(VOID));
3140 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
3141 decl = MkDeclaration(specifiers, declarators);
3142 external = MkExternalDeclaration(decl);
3143 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
3144 external->symbol = symbol;
3145 symbol->externalGet = external;
3146 ReplaceThisClassSpecifiers(specifiers, prop->_class);
3147 if(typeDecl)
3148 FreeDeclarator(typeDecl);
3149 }
3150 else
3151 {
3152 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->externalGet, curExternal->prev);
3153 }
3154 }
3155 if(prop->Set)
3156 {
3157 if(!symbol->externalSet || symbol->externalSet->type == 0)
3158 {
3159 struct Declaration * decl;
3160 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
3161 struct Declarator * d;
3162 struct __ecereNameSpace__ecere__sys__OldList * params;
3163 struct Specifier * spec;
3164 struct External * external;
3165 struct Declarator * typeDecl;
3166
3167 declarators = MkList();
3168 params = MkList();
3169 if(!prop->conversion || prop->_class->type == 1)
3170 {
3171 ListAdd(params, MkTypeName(MkListOne(MkSpecifierName(prop->_class->fullName)), MkDeclaratorIdentifier(MkIdentifier("this"))));
3172 }
3173 specifiers = MkList();
3174 {
3175 struct Context * context = SetupTemplatesContext(prop->_class);
3176
3177 typeDecl = d = SpecDeclFromString(prop->dataTypeString, specifiers, MkDeclaratorIdentifier(MkIdentifier("value")));
3178 FinishTemplatesContext(context);
3179 }
3180 ListAdd(params, MkTypeName(specifiers, d));
3181 d = MkDeclaratorIdentifier(MkIdentifier(setName));
3182 if(dllImport)
3183 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
3184 d = MkDeclaratorFunction(d, params);
3185 for(spec = (*specifiers).first; spec; spec = spec->next)
3186 {
3187 if(spec->type == 1)
3188 {
3189 if((!typeDecl || typeDecl->type == 1))
3190 {
3191 struct Symbol * classSym = spec->symbol;
3192
3193 symbol->_class = classSym->registered;
3194 if(classSym->registered && classSym->registered->type == 1)
3195 DeclareStruct(spec->name, 0x0);
3196 }
3197 }
3198 }
3199 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
3200 specifiers = MkList();
3201 if(dllImport)
3202 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
3203 else if(prop->_class->symbol && ((struct Symbol *)prop->_class->symbol)->isStatic)
3204 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
3205 if(!prop->conversion || prop->_class->type == 1)
3206 ListAdd(specifiers, MkSpecifier(VOID));
3207 else
3208 ListAdd(specifiers, MkSpecifierName(prop->_class->fullName));
3209 decl = MkDeclaration(specifiers, declarators);
3210 external = MkExternalDeclaration(decl);
3211 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
3212 external->symbol = symbol;
3213 symbol->externalSet = external;
3214 ReplaceThisClassSpecifiers(specifiers, prop->_class);
3215 }
3216 else
3217 {
3218 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->externalSet, curExternal->prev);
3219 }
3220 }
3221 if(!symbol->externalPtr)
3222 {
3223 struct Declaration * decl;
3224 struct External * external;
3225 struct __ecereNameSpace__ecere__sys__OldList * specifiers = MkList();
3226
3227 if(imported)
3228 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
3229 else
3230 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
3231 ListAdd(specifiers, MkSpecifierName("Property"));
3232 {
3233 struct __ecereNameSpace__ecere__sys__OldList * list = MkList();
3234
3235 ListAdd(list, MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier(propName))), (((void *)0))));
3236 if(!imported)
3237 {
3238 strcpy(propName, "__ecerePropM_");
3239 FullClassNameCat(propName, prop->_class->fullName, 0x0);
3240 strcat(propName, "_");
3241 FullClassNameCat(propName, prop->name, 0x1);
3242 MangleClassName(propName);
3243 ListAdd(list, MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier(propName))), (((void *)0))));
3244 }
3245 decl = MkDeclaration(specifiers, list);
3246 }
3247 external = MkExternalDeclaration(decl);
3248 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
3249 external->symbol = symbol;
3250 symbol->externalPtr = external;
3251 }
3252 else
3253 {
3254 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->externalPtr, curExternal->prev);
3255 }
3256 symbol->id = curExternal->symbol->idCode;
3257 }
3258 }
3259
3260 struct Type * Dereference(struct Type * source)
3261 {
3262 void * __ecereTemp1;
3263 struct Type * type = (((void *)0));
3264
3265 if(source)
3266 {
3267 if(source->kind == 13 || source->kind == 12)
3268 {
3269 type = source->type;
3270 source->type->refCount++;
3271 }
3272 else if(source->kind == 8 && !strcmp(source->_class->string, "String"))
3273 {
3274 type = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->kind = 1, ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1));
3275 }
3276 else if(source->kind == 8 && source->_class && source->_class->registered && source->_class->registered->type == 5)
3277 {
3278 type = source;
3279 source->refCount++;
3280 }
3281 else
3282 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "cannot dereference type\n", (((void *)0))));
3283 }
3284 return type;
3285 }
3286
3287 static struct Type * Reference(struct Type * source)
3288 {
3289 void * __ecereTemp1;
3290 struct Type * type = (((void *)0));
3291
3292 if(source)
3293 {
3294 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));
3295 source->refCount++;
3296 }
3297 return type;
3298 }
3299
3300 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);
3301
3302 extern void *  memcpy(void * , const void * , unsigned int size);
3303
3304 void ProcessMethodType(struct __ecereNameSpace__ecere__com__Method * method);
3305
3306 extern void FreeExpression(struct Expression * exp);
3307
3308 extern void __ecereNameSpace__ecere__sys__ChangeCh(char *  string, char ch1, char ch2);
3309
3310 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);
3311
3312 static void ProcessInitializer(struct Initializer * init, struct Type * type);
3313
3314 extern struct Type * MkClassType(char *  name);
3315
3316 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);
3317
3318 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)
3319 {
3320 struct Identifier * ident = member->identifiers ? (*member->identifiers).first : (((void *)0));
3321 unsigned int found = 0x0;
3322 struct __ecereNameSpace__ecere__com__DataMember * dataMember = (((void *)0));
3323 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
3324 unsigned int freeType = 0x0;
3325
3326 yylloc = member->loc;
3327 if(!ident)
3328 {
3329 if(curMember)
3330 {
3331 __ecereNameSpace__ecere__com__eClass_FindNextMember(_class, curClass, curMember, subMemberStack, subMemberStackPos);
3332 if(*curMember)
3333 {
3334 found = 0x1;
3335 dataMember = *curMember;
3336 }
3337 }
3338 }
3339 else
3340 {
3341 struct __ecereNameSpace__ecere__com__DataMember * thisMember = (struct __ecereNameSpace__ecere__com__DataMember *)__ecereNameSpace__ecere__com__eClass_FindProperty(_class, ident->string, privateModule);
3342 struct __ecereNameSpace__ecere__com__DataMember * _subMemberStack[256];
3343 int _subMemberStackPos = 0;
3344
3345 if(!thisMember)
3346 thisMember = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, ident->string, privateModule, _subMemberStack, &_subMemberStackPos);
3347 if(thisMember)
3348 {
3349 dataMember = thisMember;
3350 if(curMember && thisMember->memberAccess == 1)
3351 {
3352 *curMember = thisMember;
3353 *curClass = thisMember->_class;
3354 memcpy(subMemberStack, _subMemberStack, sizeof(int) * _subMemberStackPos);
3355 *subMemberStackPos = _subMemberStackPos;
3356 }
3357 found = 0x1;
3358 }
3359 else
3360 {
3361 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, ident->string, privateModule);
3362 if(method && method->type == 1)
3363 found = 0x1;
3364 else
3365 method = (((void *)0));
3366 }
3367 }
3368 if(found)
3369 {
3370 struct Type * type = (((void *)0));
3371
3372 if(dataMember)
3373 {
3374 if(!dataMember->dataType && dataMember->dataTypeString)
3375 {
3376 struct Context * context = SetupTemplatesContext(_class);
3377
3378 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
3379 FinishTemplatesContext(context);
3380 }
3381 type = dataMember->dataType;
3382 }
3383 else if(method)
3384 {
3385 if(!method->dataType)
3386 ProcessMethodType(method);
3387 type = method->dataType;
3388 }
3389 if(ident && ident->next)
3390 {
3391 for(ident = ident->next; ident && type; ident = ident->next)
3392 {
3393 if(type->kind == 8)
3394 {
3395 dataMember = (struct __ecereNameSpace__ecere__com__DataMember *)__ecereNameSpace__ecere__com__eClass_FindProperty(type->_class->registered, ident->string, privateModule);
3396 if(!dataMember)
3397 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMember(type->_class->registered, ident->string, privateModule, (((void *)0)), (((void *)0)));
3398 if(dataMember)
3399 type = dataMember->dataType;
3400 }
3401 else if(type->kind == 9 || type->kind == 10)
3402 {
3403 struct Type * memberType;
3404
3405 for(memberType = type->members.first; memberType; memberType = memberType->next)
3406 {
3407 if(!strcmp(memberType->name, ident->string))
3408 {
3409 type = memberType;
3410 break;
3411 }
3412 }
3413 }
3414 }
3415 }
3416 if(type && type->kind == 20 && type->templateParameter->type == 0 && _class->templateArgs)
3417 {
3418 int id = 0;
3419 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
3420 struct __ecereNameSpace__ecere__com__Class * sClass;
3421
3422 for(sClass = _class; sClass; sClass = sClass->base)
3423 {
3424 id = 0;
3425 if(sClass->templateClass)
3426 sClass = sClass->templateClass;
3427 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
3428 {
3429 if(curParam->type == 0 && !strcmp(type->templateParameter->identifier->string, curParam->name))
3430 {
3431 for(sClass = sClass->base; sClass; sClass = sClass->base)
3432 {
3433 if(sClass->templateClass)
3434 sClass = sClass->templateClass;
3435 id += sClass->templateParams.count;
3436 }
3437 break;
3438 }
3439 id++;
3440 }
3441 if(curParam)
3442 break;
3443 }
3444 if(curParam)
3445 {
3446 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = _class->templateArgs[id];
3447
3448 if(arg.dataTypeString)
3449 {
3450 type = ProcessTypeString(arg.dataTypeString, 0x0);
3451 freeType = 0x1;
3452 if(type && _class->templateClass)
3453 type->passAsTemplate = 0x1;
3454 if(type)
3455 {
3456 }
3457 }
3458 }
3459 }
3460 if(type && type->kind == 8 && type->_class && type->_class->registered && strchr(type->_class->registered->fullName, '<'))
3461 {
3462 struct __ecereNameSpace__ecere__com__Class * expClass = type->_class->registered;
3463 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
3464 int c;
3465 int paramCount = 0;
3466 int lastParam = -1;
3467 char templateString[1024];
3468 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
3469
3470 sprintf(templateString, "%s<", expClass->templateClass->fullName);
3471 for(cClass = expClass; cClass; cClass = cClass->base)
3472 {
3473 int p = 0;
3474
3475 if(cClass->templateClass)
3476 cClass = cClass->templateClass;
3477 for(param = cClass->templateParams.first; param; param = param->next)
3478 {
3479 int id = p;
3480 struct __ecereNameSpace__ecere__com__Class * sClass;
3481 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
3482
3483 for(sClass = cClass->base; sClass; sClass = sClass->base)
3484 {
3485 if(sClass->templateClass)
3486 sClass = sClass->templateClass;
3487 id += sClass->templateParams.count;
3488 }
3489 arg = expClass->templateArgs[id];
3490 for(sClass = _class; sClass; sClass = sClass->base)
3491 {
3492 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * cParam;
3493 int p = 0;
3494 struct __ecereNameSpace__ecere__com__Class * nextClass;
3495
3496 if(sClass->templateClass)
3497 sClass = sClass->templateClass;
3498 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
3499 {
3500 if(nextClass->templateClass)
3501 nextClass = nextClass->templateClass;
3502 p += nextClass->templateParams.count;
3503 }
3504 for(cParam = sClass->templateParams.first; cParam; cParam = cParam->next, p++)
3505 {
3506 if(cParam->type == 0 && arg.dataTypeString && !strcmp(cParam->name, arg.dataTypeString))
3507 {
3508 if(_class->templateArgs && arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
3509 {
3510 arg.dataTypeString = _class->templateArgs[p].dataTypeString;
3511 arg.dataTypeClass = _class->templateArgs[p].dataTypeClass;
3512 break;
3513 }
3514 }
3515 }
3516 }
3517 {
3518 char argument[256];
3519
3520 argument[0] = '\0';
3521 switch(param->type)
3522 {
3523 case 2:
3524 {
3525 char expString[1024];
3526 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
3527 struct Declarator * decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
3528 struct Expression * exp;
3529 char * string = PrintHexUInt64(arg.expression.ui64);
3530
3531 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
3532 ProcessExpressionType(exp);
3533 ComputeExpression(exp);
3534 expString[0] = '\0';
3535 PrintExpression(exp, expString);
3536 strcat(argument, expString);
3537 FreeExpression(exp);
3538 break;
3539 }
3540 case 1:
3541 {
3542 strcat(argument, arg.member->name);
3543 break;
3544 }
3545 case 0:
3546 {
3547 if(arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
3548 strcat(argument, arg.dataTypeString);
3549 break;
3550 }
3551 }
3552 if(argument[0])
3553 {
3554 if(paramCount)
3555 strcat(templateString, ", ");
3556 if(lastParam != p - 1)
3557 {
3558 strcat(templateString, param->name);
3559 strcat(templateString, " = ");
3560 }
3561 strcat(templateString, argument);
3562 paramCount++;
3563 lastParam = p;
3564 }
3565 p++;
3566 }
3567 }
3568 }
3569 {
3570 int len = strlen(templateString);
3571
3572 if(templateString[len - 1] == '<')
3573 len--;
3574 else
3575 {
3576 if(templateString[len - 1] == '>')
3577 templateString[len++] = ' ';
3578 templateString[len++] = '>';
3579 }
3580 templateString[len++] = '\0';
3581 }
3582 {
3583 struct Context * context = SetupTemplatesContext(_class);
3584
3585 if(freeType)
3586 FreeType(type);
3587 type = ProcessTypeString(templateString, 0x0);
3588 freeType = 0x1;
3589 FinishTemplatesContext(context);
3590 }
3591 }
3592 if(method && member->initializer && member->initializer->type == 0 && member->initializer->exp)
3593 {
3594 ProcessExpressionType(member->initializer->exp);
3595 if(!member->initializer->exp->expType)
3596 {
3597 if(inCompiler)
3598 {
3599 char expString[10240];
3600
3601 expString[0] = '\0';
3602 PrintExpression(member->initializer->exp, expString);
3603 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
3604 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "unresolved symbol used as an instance method %s\n", (((void *)0))), expString);
3605 }
3606 }
3607 else if(!MatchTypes(member->initializer->exp->expType, type, (((void *)0)), (((void *)0)), _class, 0x1, 0x1, 0x0, 0x0))
3608 {
3609 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible instance method %s\n", (((void *)0))), ident->string);
3610 }
3611 }
3612 else if(member->initializer)
3613 {
3614 ProcessInitializer(member->initializer, type);
3615 }
3616 if(freeType)
3617 FreeType(type);
3618 }
3619 else
3620 {
3621 if(_class && _class->type == 3)
3622 {
3623 if(member->initializer)
3624 {
3625 struct Type * type = MkClassType(_class->fullName);
3626
3627 ProcessInitializer(member->initializer, type);
3628 FreeType(type);
3629 }
3630 }
3631 else
3632 {
3633 if(member->initializer)
3634 {
3635 ProcessInitializer(member->initializer, (((void *)0)));
3636 }
3637 if(ident)
3638 {
3639 if(method)
3640 {
3641 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't find virtual method %s in class %s\n", (((void *)0))), ident->string, _class->fullName);
3642 }
3643 else if(_class)
3644 {
3645 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't find member %s in class %s\n", (((void *)0))), ident->string, _class->fullName);
3646 if(inCompiler)
3647 __ecereNameSpace__ecere__com__eClass_AddDataMember(_class, ident->string, "int", 0, 0, 1);
3648 }
3649 }
3650 else if(_class)
3651 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "too many initializers for instantiation of class %s\n", (((void *)0))), _class->fullName);
3652 }
3653 }
3654 }
3655
3656 extern struct Identifier * GetDeclId(struct Declarator * decl);
3657
3658 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);
3659
3660 extern void FreeSpecifier(struct Specifier * spec);
3661
3662 static void ProcessFunction(struct FunctionDefinition * function);
3663
3664 extern struct __ecereNameSpace__ecere__sys__OldList *  CopyList(struct __ecereNameSpace__ecere__sys__OldList *  source, void *  (* )(void * ));
3665
3666 extern struct Specifier * CopySpecifier(struct Specifier * spec);
3667
3668 extern struct Declarator * CopyDeclarator(struct Declarator * declarator);
3669
3670 extern void FreeClassFunction(struct ClassFunction * func);
3671
3672 extern struct MemberInit * MkMemberInit(struct __ecereNameSpace__ecere__sys__OldList * ids, struct Initializer * initializer);
3673
3674 extern struct Initializer * MkInitializerAssignment(struct Expression * exp);
3675
3676 void ProcessInstantiationType(struct Instantiation * inst)
3677 {
3678 yylloc = inst->loc;
3679 if(inst->_class)
3680 {
3681 struct MembersInit * members;
3682 struct Symbol * classSym;
3683 struct __ecereNameSpace__ecere__com__Class * _class;
3684
3685 classSym = inst->_class->symbol;
3686 _class = classSym ? classSym->registered : (((void *)0));
3687 if(!_class || _class->type != 5)
3688 DeclareStruct(inst->_class->name, 0x0);
3689 afterExternal = afterExternal ? afterExternal : curExternal;
3690 if(inst->exp)
3691 ProcessExpressionType(inst->exp);
3692 inst->isConstant = 0x1;
3693 if(inst->members)
3694 {
3695 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
3696 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
3697 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
3698 int subMemberStackPos = 0;
3699
3700 for(members = (*inst->members).first; members; members = members->next)
3701 {
3702 switch(members->type)
3703 {
3704 case 1:
3705 {
3706 char name[1024];
3707 static unsigned int instMethodID = 0;
3708 struct External * external = curExternal;
3709 struct Context * context = curContext;
3710 struct Declarator * declarator = members->function->declarator;
3711 struct Identifier * nameID = GetDeclId(declarator);
3712 char * unmangled = nameID ? nameID->string : (((void *)0));
3713 struct Expression * exp;
3714 struct External * createdExternal = (((void *)0));
3715
3716 if(inCompiler)
3717 {
3718 char number[16];
3719
3720 strcpy(name, "__ecereInstMeth_");
3721 FullClassNameCat(name, _class ? _class->fullName : "_UNKNOWNCLASS", 0x0);
3722 strcat(name, "_");
3723 strcat(name, nameID->string);
3724 strcat(name, "_");
3725 sprintf(number, "_%08d", instMethodID++);
3726 strcat(name, number);
3727 nameID->string = __ecereNameSpace__ecere__sys__CopyString(name);
3728 }
3729 if(declarator)
3730 {
3731 struct Symbol * symbol = declarator->symbol;
3732 struct __ecereNameSpace__ecere__com__Method * method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, unmangled, privateModule);
3733
3734 if(method && method->type == 1)
3735 {
3736 symbol->method = method;
3737 ProcessMethodType(method);
3738 if(!symbol->type->thisClass)
3739 {
3740 if(method->dataType->thisClass && currentClass && __ecereNameSpace__ecere__com__eClass_IsDerived(currentClass, method->dataType->thisClass->registered))
3741 {
3742 if(!currentClass->symbol)
3743 currentClass->symbol = FindClass(currentClass->fullName);
3744 symbol->type->thisClass = currentClass->symbol;
3745 }
3746 else
3747 {
3748 if(!_class->symbol)
3749 _class->symbol = FindClass(_class->fullName);
3750 symbol->type->thisClass = _class->symbol;
3751 }
3752 }
3753 DeclareType(symbol->type, 0x1, 0x1);
3754 }
3755 else if(classSym)
3756 {
3757 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't find virtual method %s in class %s\n", (((void *)0))), unmangled, classSym->string);
3758 }
3759 }
3760 createdExternal = ProcessClassFunction(classSym ? classSym->registered : (((void *)0)), members->function, ast, afterExternal, 0x1);
3761 if(nameID)
3762 {
3763 FreeSpecifier(nameID->_class);
3764 nameID->_class = (((void *)0));
3765 }
3766 if(inCompiler)
3767 {
3768 struct Type * type = declarator->symbol->type;
3769 struct External * oldExternal = curExternal;
3770
3771 declarator->symbol->id = declarator->symbol->idCode = curExternal->symbol->idCode;
3772 {
3773 struct External * externalDecl;
3774
3775 externalDecl = MkExternalDeclaration((((void *)0)));
3776 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), oldExternal->prev, externalDecl);
3777 if(createdExternal->function)
3778 {
3779 ProcessFunction(createdExternal->function);
3780 {
3781 struct Declaration * decl = MkDeclaration(CopyList(createdExternal->function->specifiers, CopySpecifier), MkListOne(MkInitDeclarator(CopyDeclarator(declarator), (((void *)0)))));
3782
3783 externalDecl->declaration = decl;
3784 if(decl->symbol && !decl->symbol->pointerExternal)
3785 decl->symbol->pointerExternal = externalDecl;
3786 declarator->symbol->pointerExternal = externalDecl;
3787 }
3788 }
3789 }
3790 }
3791 else if(declarator)
3792 {
3793 curExternal = declarator->symbol->pointerExternal;
3794 ProcessFunction((struct FunctionDefinition *)members->function);
3795 }
3796 curExternal = external;
3797 curContext = context;
3798 if(inCompiler)
3799 {
3800 FreeClassFunction(members->function);
3801 exp = QMkExpId(name);
3802 members->type = 0;
3803 members->dataMembers = MkListOne(MkMemberInit(MkListOne(MkIdentifier(unmangled)), MkInitializerAssignment(exp)));
3804 (__ecereNameSpace__ecere__com__eSystem_Delete(unmangled), unmangled = 0);
3805 }
3806 break;
3807 }
3808 case 0:
3809 {
3810 if(members->dataMembers && classSym)
3811 {
3812 struct MemberInit * member;
3813 struct Location oldyyloc = yylloc;
3814
3815 for(member = (*members->dataMembers).first; member; member = member->next)
3816 {
3817 ProcessMemberInitData(member, classSym->registered, &curClass, &curMember, subMemberStack, &subMemberStackPos);
3818 if(member->initializer && !member->initializer->isConstant)
3819 inst->isConstant = 0x0;
3820 }
3821 yylloc = oldyyloc;
3822 }
3823 break;
3824 }
3825 }
3826 }
3827 }
3828 }
3829 }
3830
3831 static void DeclareType(struct Type * type, unsigned int declarePointers, unsigned int declareParams)
3832 {
3833 if(inCompiler)
3834 {
3835 if(type->kind == 11)
3836 {
3837 struct Type * param;
3838
3839 if(declareParams)
3840 {
3841 for(param = type->params.first; param; param = param->next)
3842 DeclareType(param, declarePointers, 0x1);
3843 }
3844 DeclareType(type->returnType, declarePointers, 0x1);
3845 }
3846 else if(type->kind == 13 && declarePointers)
3847 DeclareType(type->type, declarePointers, 0x0);
3848 else if(type->kind == 8)
3849 {
3850 if(type->_class->registered && (type->_class->registered->type == 1 || type->_class->registered->type == 5) && !type->_class->declaring)
3851 DeclareStruct(type->_class->registered->fullName, type->_class->registered->type == 5);
3852 }
3853 else if(type->kind == 9 || type->kind == 10)
3854 {
3855 struct Type * member;
3856
3857 for(member = type->members.first; member; member = member->next)
3858 DeclareType(member, 0x0, 0x0);
3859 }
3860 else if(type->kind == 12)
3861 DeclareType(type->arrayType, declarePointers, 0x0);
3862 }
3863 }
3864
3865 extern struct __ecereNameSpace__ecere__com__Class * __ecereNameSpace__ecere__com__eSystem_FindClass(struct __ecereNameSpace__ecere__com__Instance * module, char *  name);
3866
3867 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * FindTemplateArg(struct __ecereNameSpace__ecere__com__Class * _class, struct TemplateParameter * param)
3868 {
3869 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * arg = (((void *)0));
3870 int id = 0;
3871 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
3872 struct __ecereNameSpace__ecere__com__Class * sClass;
3873
3874 for(sClass = _class; sClass; sClass = sClass->base)
3875 {
3876 id = 0;
3877 if(sClass->templateClass)
3878 sClass = sClass->templateClass;
3879 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
3880 {
3881 if(curParam->type == 0 && !strcmp(param->identifier->string, curParam->name))
3882 {
3883 for(sClass = sClass->base; sClass; sClass = sClass->base)
3884 {
3885 if(sClass->templateClass)
3886 sClass = sClass->templateClass;
3887 id += sClass->templateParams.count;
3888 }
3889 break;
3890 }
3891 id++;
3892 }
3893 if(curParam)
3894 break;
3895 }
3896 if(curParam)
3897 {
3898 arg = &_class->templateArgs[id];
3899 if(arg && param->type == 0)
3900 (*arg).dataTypeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, (*arg).dataTypeString);
3901 }
3902 return arg;
3903 }
3904
3905 extern struct Context * PushContext(void);
3906
3907 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplatedType;
3908
3909 struct TemplatedType
3910 {
3911 uintptr_t key;
3912 struct __ecereNameSpace__ecere__sys__BTNode * parent;
3913 struct __ecereNameSpace__ecere__sys__BTNode * left;
3914 struct __ecereNameSpace__ecere__sys__BTNode * right;
3915 int depth;
3916 struct TemplateParameter * param;
3917 } __attribute__ ((gcc_struct));
3918
3919 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(struct __ecereNameSpace__ecere__sys__BinaryTree * this, struct __ecereNameSpace__ecere__sys__BTNode * node);
3920
3921 struct Context * SetupTemplatesContext(struct __ecereNameSpace__ecere__com__Class * _class)
3922 {
3923 void * __ecereTemp1;
3924 struct Context * context = PushContext();
3925
3926 context->templateTypesOnly = 0x1;
3927 if(_class->symbol && ((struct Symbol *)_class->symbol)->templateParams)
3928 {
3929 struct TemplateParameter * param = (*((struct Symbol *)_class->symbol)->templateParams).first;
3930
3931 for(; param; param = param->next)
3932 {
3933 if(param->type == 0 && param->identifier)
3934 {
3935 struct TemplatedType * type = (type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TemplatedType), type->key = (uintptr_t)param->identifier->string, type->param = param, type);
3936
3937 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&curContext->templateTypes, (struct __ecereNameSpace__ecere__sys__BTNode *)type);
3938 }
3939 }
3940 }
3941 else if(_class)
3942 {
3943 struct __ecereNameSpace__ecere__com__Class * sClass;
3944
3945 for(sClass = _class; sClass; sClass = sClass->base)
3946 {
3947 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * p;
3948
3949 for(p = sClass->templateParams.first; p; p = p->next)
3950 {
3951 if(p->type == 0)
3952 {
3953 struct TemplateParameter * param = p->param;
3954 struct TemplatedType * type;
3955
3956 if(!param)
3957 {
3958 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));
3959 }
3960 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));
3961 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&curContext->templateTypes, (struct __ecereNameSpace__ecere__sys__BTNode *)type);
3962 }
3963 }
3964 }
3965 }
3966 return context;
3967 }
3968
3969 extern void PopContext(struct Context * ctx);
3970
3971 extern void FreeContext(struct Context * context);
3972
3973 void FinishTemplatesContext(struct Context * context)
3974 {
3975 PopContext(context);
3976 FreeContext(context);
3977 ((context ? (__ecereClass_Context->Destructor ? __ecereClass_Context->Destructor(context) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(context)) : 0), context = 0);
3978 }
3979
3980 void ProcessMethodType(struct __ecereNameSpace__ecere__com__Method * method)
3981 {
3982 if(!method->dataType)
3983 {
3984 struct Context * context = SetupTemplatesContext(method->_class);
3985
3986 method->dataType = ProcessTypeString(method->dataTypeString, 0x0);
3987 FinishTemplatesContext(context);
3988 if(method->type != 1 && method->dataType)
3989 {
3990 if(!method->dataType->thisClass && !method->dataType->staticMethod)
3991 {
3992 if(!method->_class->symbol)
3993 method->_class->symbol = FindClass(method->_class->fullName);
3994 method->dataType->thisClass = method->_class->symbol;
3995 }
3996 }
3997 }
3998 }
3999
4000 void ProcessPropertyType(struct __ecereNameSpace__ecere__com__Property * prop)
4001 {
4002 if(!prop->dataType)
4003 {
4004 struct Context * context = SetupTemplatesContext(prop->_class);
4005
4006 prop->dataType = ProcessTypeString(prop->dataTypeString, 0x0);
4007 FinishTemplatesContext(context);
4008 }
4009 }
4010
4011 extern struct Declarator * GetFuncDecl(struct Declarator * decl);
4012
4013 extern void FreeTypeName(struct TypeName * typeName);
4014
4015 static void ProcessDeclarator(struct Declarator * decl);
4016
4017 extern struct __ecereNameSpace__ecere__sys__OldList *  excludedSymbols;
4018
4019 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_MethodImport;
4020
4021 struct MethodImport
4022 {
4023 struct MethodImport * prev;
4024 struct MethodImport * next;
4025 char *  name;
4026 unsigned int isVirtual;
4027 } __attribute__ ((gcc_struct));
4028
4029 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(struct __ecereNameSpace__ecere__sys__OldList * this, void *  item);
4030
4031 void DeclareMethod(struct __ecereNameSpace__ecere__com__Method * method, char * name)
4032 {
4033 void * __ecereTemp1;
4034 struct Symbol * symbol = method->symbol;
4035
4036 if(!symbol || (!symbol->pointerExternal && method->type == 1) || symbol->id > (curExternal ? curExternal->symbol->idCode : -1))
4037 {
4038 unsigned int imported = 0x0;
4039 unsigned int dllImport = 0x0;
4040
4041 if(!method->dataType)
4042 method->dataType = ProcessTypeString(method->dataTypeString, 0x0);
4043 if(!symbol || symbol->_import || method->type == 1)
4044 {
4045 if(!symbol || method->type == 1)
4046 {
4047 struct Symbol * classSym;
4048
4049 if(!method->_class->symbol)
4050 method->_class->symbol = FindClass(method->_class->fullName);
4051 classSym = method->_class->symbol;
4052 if(!classSym->_import)
4053 {
4054 struct ModuleImport * module;
4055
4056 if(method->_class->module && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)method->_class->module + 12)))->name)
4057 module = FindModule(method->_class->module);
4058 else
4059 module = mainModule;
4060 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));
4061 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->classes, classSym->_import);
4062 }
4063 if(!symbol)
4064 {
4065 symbol = method->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4066 }
4067 if(!symbol->_import)
4068 {
4069 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));
4070 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&classSym->_import->methods, symbol->_import);
4071 }
4072 if(!symbol)
4073 {
4074 symbol->type = method->dataType;
4075 if(symbol->type)
4076 symbol->type->refCount++;
4077 }
4078 }
4079 if(!method->dataType->dllExport)
4080 {
4081 imported = 0x1;
4082 if(method->_class->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)method->_class->module + 12)))->importType != 1)
4083 dllImport = 0x1;
4084 }
4085 }
4086 if(method->type != 1 && method->dataType)
4087 DeclareType(method->dataType, 0x1, 0x1);
4088 if(!symbol->pointerExternal || symbol->pointerExternal->type == 0)
4089 {
4090 struct Declaration * decl;
4091 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
4092 struct Declarator * d;
4093 struct Declarator * funcDecl;
4094 struct External * external;
4095
4096 specifiers = MkList();
4097 declarators = MkList();
4098 if(dllImport)
4099 ListAdd(specifiers, MkSpecifier(EXTERN));
4100 else if(method->_class->symbol && ((struct Symbol *)method->_class->symbol)->isStatic)
4101 ListAdd(specifiers, MkSpecifier(STATIC));
4102 if(method->type == 1)
4103 {
4104 ListAdd(specifiers, MkSpecifier(INT));
4105 d = MkDeclaratorIdentifier(MkIdentifier(name));
4106 }
4107 else
4108 {
4109 d = MkDeclaratorIdentifier(MkIdentifier(name));
4110 if(dllImport)
4111 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
4112 {
4113 struct Context * context = SetupTemplatesContext(method->_class);
4114
4115 d = SpecDeclFromString(method->dataTypeString, specifiers, d);
4116 FinishTemplatesContext(context);
4117 }
4118 funcDecl = GetFuncDecl(d);
4119 if(dllImport)
4120 {
4121 struct Specifier * spec, * next;
4122
4123 for(spec = (*specifiers).first; spec; spec = next)
4124 {
4125 next = spec->next;
4126 if(spec->type == 5)
4127 {
4128 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*specifiers), spec);
4129 FreeSpecifier(spec);
4130 }
4131 }
4132 }
4133 if(method->dataType && !method->dataType->staticMethod)
4134 {
4135 if(funcDecl && funcDecl->function.parameters && (*funcDecl->function.parameters).count)
4136 {
4137 struct __ecereNameSpace__ecere__com__Class * _class = method->dataType->thisClass ? method->dataType->thisClass->registered : method->_class;
4138 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")));
4139 struct TypeName * firstParam = ((struct TypeName *)(*funcDecl->function.parameters).first);
4140 struct Specifier * firstSpec = firstParam->qualifiers ? (*firstParam->qualifiers).first : (((void *)0));
4141
4142 if(firstSpec && firstSpec->type == 0 && firstSpec->specifier == VOID && !firstParam->declarator)
4143 {
4144 struct TypeName * param = (*funcDecl->function.parameters).first;
4145
4146 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->function.parameters), param);
4147 FreeTypeName(param);
4148 }
4149 if(!funcDecl->function.parameters)
4150 funcDecl->function.parameters = MkList();
4151 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
4152 }
4153 }
4154 }
4155 ProcessDeclarator(d);
4156 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
4157 decl = MkDeclaration(specifiers, declarators);
4158 ReplaceThisClassSpecifiers(specifiers, method->_class);
4159 if(symbol->pointerExternal)
4160 {
4161 struct Symbol * functionSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4162
4163 {
4164 *functionSymbol = *symbol;
4165 functionSymbol->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
4166 if(functionSymbol->type)
4167 functionSymbol->type->refCount++;
4168 }
4169 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*excludedSymbols), functionSymbol);
4170 symbol->pointerExternal->symbol = functionSymbol;
4171 }
4172 external = MkExternalDeclaration(decl);
4173 if(curExternal)
4174 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal ? curExternal->prev : (((void *)0)), external);
4175 external->symbol = symbol;
4176 symbol->pointerExternal = external;
4177 }
4178 else if(ast)
4179 {
4180 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
4181 }
4182 symbol->id = curExternal ? curExternal->symbol->idCode : (((int)0x7fffffff));
4183 }
4184 }
4185
4186 char * ReplaceThisClass(struct __ecereNameSpace__ecere__com__Class * _class)
4187 {
4188 if(thisClassParams && _class->templateParams.count && !_class->templateClass)
4189 {
4190 unsigned int first = 0x1;
4191 int p = 0;
4192 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
4193 int lastParam = -1;
4194 char className[1024];
4195
4196 strcpy(className, _class->fullName);
4197 for(param = _class->templateParams.first; param; param = param->next)
4198 {
4199 {
4200 if(first)
4201 strcat(className, "<");
4202 if(!first)
4203 strcat(className, ", ");
4204 if(lastParam + 1 != p)
4205 {
4206 strcat(className, param->name);
4207 strcat(className, " = ");
4208 }
4209 strcat(className, param->name);
4210 first = 0x0;
4211 lastParam = p;
4212 }
4213 p++;
4214 }
4215 if(!first)
4216 {
4217 int len = strlen(className);
4218
4219 if(className[len - 1] == '>')
4220 className[len++] = ' ';
4221 className[len++] = '>';
4222 className[len++] = '\0';
4223 }
4224 return __ecereNameSpace__ecere__sys__CopyString(className);
4225 }
4226 else
4227 return __ecereNameSpace__ecere__sys__CopyString(_class->fullName);
4228 }
4229
4230 struct Type * ReplaceThisClassType(struct __ecereNameSpace__ecere__com__Class * _class)
4231 {
4232 if(thisClassParams && _class->templateParams.count && !_class->templateClass)
4233 {
4234 unsigned int first = 0x1;
4235 int p = 0;
4236 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
4237 int lastParam = -1;
4238 char className[1024];
4239
4240 strcpy(className, _class->fullName);
4241 for(param = _class->templateParams.first; param; param = param->next)
4242 {
4243 {
4244 if(first)
4245 strcat(className, "<");
4246 if(!first)
4247 strcat(className, ", ");
4248 if(lastParam + 1 != p)
4249 {
4250 strcat(className, param->name);
4251 strcat(className, " = ");
4252 }
4253 strcat(className, param->name);
4254 first = 0x0;
4255 lastParam = p;
4256 }
4257 p++;
4258 }
4259 if(!first)
4260 {
4261 int len = strlen(className);
4262
4263 if(className[len - 1] == '>')
4264 className[len++] = ' ';
4265 className[len++] = '>';
4266 className[len++] = '\0';
4267 }
4268 return MkClassType(className);
4269 }
4270 else
4271 {
4272 return MkClassType(_class->fullName);
4273 }
4274 }
4275
4276 void ReplaceThisClassSpecifiers(struct __ecereNameSpace__ecere__sys__OldList * specs, struct __ecereNameSpace__ecere__com__Class * _class)
4277 {
4278 if(specs != (((void *)0)) && _class)
4279 {
4280 struct Specifier * spec;
4281
4282 for(spec = specs->first; spec; spec = spec->next)
4283 {
4284 if(spec->type == 0 && spec->specifier == THISCLASS)
4285 {
4286 spec->type = 1;
4287 spec->name = ReplaceThisClass(_class);
4288 spec->symbol = FindClass(spec->name);
4289 }
4290 }
4291 }
4292 }
4293
4294 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__GlobalFunction;
4295
4296 struct __ecereNameSpace__ecere__com__GlobalFunction
4297 {
4298 struct __ecereNameSpace__ecere__com__GlobalFunction * prev;
4299 struct __ecereNameSpace__ecere__com__GlobalFunction * next;
4300 char *  name;
4301 int (*  function)();
4302 struct __ecereNameSpace__ecere__com__Instance * module;
4303 struct __ecereNameSpace__ecere__com__NameSpace *  nameSpace;
4304 char *  dataTypeString;
4305 struct Type * dataType;
4306 void *  symbol;
4307 } __attribute__ ((gcc_struct));
4308
4309 extern struct Context * globalContext;
4310
4311 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_FunctionImport;
4312
4313 struct FunctionImport
4314 {
4315 struct FunctionImport * prev;
4316 struct FunctionImport * next;
4317 char *  name;
4318 } __attribute__ ((gcc_struct));
4319
4320 unsigned int DeclareFunction(struct __ecereNameSpace__ecere__com__GlobalFunction * function, char * name)
4321 {
4322 void * __ecereTemp1;
4323 struct Symbol * symbol = function->symbol;
4324
4325 if(curExternal && (!symbol || symbol->id > curExternal->symbol->idCode))
4326 {
4327 unsigned int imported = 0x0;
4328 unsigned int dllImport = 0x0;
4329
4330 if(!function->dataType)
4331 {
4332 function->dataType = ProcessTypeString(function->dataTypeString, 0x0);
4333 if(!function->dataType->thisClass)
4334 function->dataType->staticMethod = 0x1;
4335 }
4336 if(inCompiler)
4337 {
4338 if(!symbol)
4339 {
4340 struct ModuleImport * module = FindModule(function->module);
4341
4342 symbol = function->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4343 if(module->name)
4344 {
4345 if(!function->dataType->dllExport)
4346 {
4347 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));
4348 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->functions, symbol->_import);
4349 }
4350 }
4351 {
4352 symbol->type = ProcessTypeString(function->dataTypeString, 0x0);
4353 if(!symbol->type->thisClass)
4354 symbol->type->staticMethod = 0x1;
4355 }
4356 }
4357 imported = symbol->_import ? 0x1 : 0x0;
4358 if(imported && function->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + 12)))->importType != 1)
4359 dllImport = 0x1;
4360 }
4361 DeclareType(function->dataType, 0x1, 0x1);
4362 if(inCompiler)
4363 {
4364 if(!symbol->pointerExternal || symbol->pointerExternal->type == 0)
4365 {
4366 struct Declaration * decl;
4367 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
4368 struct Declarator * d;
4369 struct Declarator * funcDecl;
4370 struct External * external;
4371
4372 specifiers = MkList();
4373 declarators = MkList();
4374 ListAdd(specifiers, MkSpecifier(EXTERN));
4375 d = MkDeclaratorIdentifier(MkIdentifier(imported ? name : function->name));
4376 if(dllImport)
4377 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
4378 d = SpecDeclFromString(function->dataTypeString, specifiers, d);
4379 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + 12)))->importType == 1)
4380 {
4381 struct Specifier * spec;
4382
4383 for(spec = (*specifiers).first; spec; spec = spec->next)
4384 if(spec->type == 5 && spec->extDecl && spec->extDecl->type == 0 && !strcmp(spec->extDecl->s, "dllexport"))
4385 {
4386 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*specifiers), spec);
4387 FreeSpecifier(spec);
4388 break;
4389 }
4390 }
4391 funcDecl = GetFuncDecl(d);
4392 if(funcDecl && !funcDecl->function.parameters)
4393 {
4394 funcDecl->function.parameters = MkList();
4395 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), MkTypeName(MkListOne(MkSpecifier(VOID)), (((void *)0))));
4396 }
4397 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
4398 {
4399 struct Context * oldCtx = curContext;
4400
4401 curContext = globalContext;
4402 decl = MkDeclaration(specifiers, declarators);
4403 curContext = oldCtx;
4404 }
4405 if(symbol->pointerExternal)
4406 {
4407 struct Symbol * functionSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4408
4409 {
4410 *functionSymbol = *symbol;
4411 functionSymbol->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
4412 if(functionSymbol->type)
4413 functionSymbol->type->refCount++;
4414 }
4415 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*excludedSymbols), functionSymbol);
4416 symbol->pointerExternal->symbol = functionSymbol;
4417 }
4418 external = MkExternalDeclaration(decl);
4419 if(curExternal)
4420 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
4421 external->symbol = symbol;
4422 symbol->pointerExternal = external;
4423 }
4424 else
4425 {
4426 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
4427 }
4428 if(curExternal)
4429 symbol->id = curExternal->symbol->idCode;
4430 }
4431 }
4432 return (symbol && symbol->_import && function->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + 12)))->importType != 1) ? 0x1 : 0x0;
4433 }
4434
4435 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_GlobalData;
4436
4437 struct GlobalData
4438 {
4439 uintptr_t key;
4440 struct __ecereNameSpace__ecere__sys__BTNode * parent;
4441 struct __ecereNameSpace__ecere__sys__BTNode * left;
4442 struct __ecereNameSpace__ecere__sys__BTNode * right;
4443 int depth;
4444 struct __ecereNameSpace__ecere__com__Instance * module;
4445 char *  dataTypeString;
4446 struct Type * dataType;
4447 void *  symbol;
4448 char *  fullName;
4449 } __attribute__ ((gcc_struct));
4450
4451 void DeclareGlobalData(struct GlobalData * data)
4452 {
4453 struct Symbol * symbol = data->symbol;
4454
4455 if(curExternal && (!symbol || symbol->id > curExternal->symbol->idCode))
4456 {
4457 if(inCompiler)
4458 {
4459 if(!symbol)
4460 symbol = data->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4461 }
4462 if(!data->dataType)
4463 data->dataType = ProcessTypeString(data->dataTypeString, 0x0);
4464 DeclareType(data->dataType, 0x1, 0x1);
4465 if(inCompiler)
4466 {
4467 if(!symbol->pointerExternal)
4468 {
4469 struct Declaration * decl;
4470 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
4471 struct Declarator * d;
4472 struct External * external;
4473
4474 specifiers = MkList();
4475 declarators = MkList();
4476 ListAdd(specifiers, MkSpecifier(EXTERN));
4477 d = MkDeclaratorIdentifier(MkIdentifier(data->fullName));
4478 d = SpecDeclFromString(data->dataTypeString, specifiers, d);
4479 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
4480 decl = MkDeclaration(specifiers, declarators);
4481 external = MkExternalDeclaration(decl);
4482 if(curExternal)
4483 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
4484 external->symbol = symbol;
4485 symbol->pointerExternal = external;
4486 }
4487 else
4488 {
4489 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
4490 }
4491 if(curExternal)
4492 symbol->id = curExternal->symbol->idCode;
4493 }
4494 }
4495 }
4496
4497 struct Conversion
4498 {
4499 struct Conversion * prev, * next;
4500 struct __ecereNameSpace__ecere__com__Property * convert;
4501 unsigned int isGet;
4502 struct Type * resultType;
4503 } __attribute__ ((gcc_struct));
4504
4505 static struct __ecereNameSpace__ecere__com__Class * __ecereClass_Conversion;
4506
4507 extern void Compiler_Warning(char *  format, ...);
4508
4509 void PrintType(struct Type * type, char *  string, unsigned int printName, unsigned int fullName);
4510
4511 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)
4512 {
4513 if(source && dest)
4514 {
4515 if(source->kind == 20 && dest->kind != 20)
4516 {
4517 struct Type * type = ProcessTemplateParameterType(source->templateParameter);
4518
4519 if(type)
4520 source = type;
4521 }
4522 if(dest->kind == 20 && source->kind != 20)
4523 {
4524 struct Type * type = ProcessTemplateParameterType(dest->templateParameter);
4525
4526 if(type)
4527 dest = type;
4528 }
4529 if((dest->classObjectType == 2 && source->classObjectType != 3) || (dest->classObjectType == 3 && source->classObjectType != 2))
4530 {
4531 return 0x1;
4532 }
4533 if(source->classObjectType == 3 && dest->classObjectType != 2)
4534 {
4535 return 0x1;
4536 }
4537 if((dest->kind == 9 && source->kind == 9) || (dest->kind == 10 && source->kind == 10))
4538 {
4539 if((dest->enumName && source->enumName && !strcmp(dest->enumName, source->enumName)) || (source->members.first && source->members.first == dest->members.first))
4540 return 0x1;
4541 }
4542 if(dest->kind == 14 && source->kind != 0)
4543 return 0x1;
4544 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))
4545 return 0x1;
4546 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))
4547 return 0x1;
4548 if(((source->kind == 8 && dest->kind == 8) || (source->kind == 19 && dest->kind == 19)) && source->_class)
4549 {
4550 if(source->_class->registered && source->_class->registered->type == 3)
4551 {
4552 if(conversions != (((void *)0)))
4553 {
4554 if(source->_class->registered == dest->_class->registered)
4555 return 0x1;
4556 }
4557 else
4558 {
4559 struct __ecereNameSpace__ecere__com__Class * sourceBase, * destBase;
4560
4561 for(sourceBase = source->_class->registered; sourceBase && sourceBase->base->type != 1000; sourceBase = sourceBase->base)
4562 ;
4563 for(destBase = dest->_class->registered; destBase && destBase->base->type != 1000; destBase = destBase->base)
4564 ;
4565 if(sourceBase == destBase)
4566 return 0x1;
4567 }
4568 }
4569 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))
4570 return 0x1;
4571 else
4572 {
4573 if(enumBaseType && dest->_class && dest->_class->registered && dest->_class->registered->type == 4 && source->_class && source->_class->registered && source->_class->registered->type != 4)
4574 {
4575 if(__ecereNameSpace__ecere__com__eClass_IsDerived(dest->_class->registered, source->_class->registered))
4576 {
4577 return 0x1;
4578 }
4579 }
4580 }
4581 }
4582 if(source->kind == 19 && dest->kind == 8 && dest->_class && !strcmp(dest->_class->string, "ecere::com::Class"))
4583 return 0x1;
4584 if(doConversion)
4585 {
4586 if(source->kind == 8)
4587 {
4588 struct __ecereNameSpace__ecere__com__Class * _class;
4589
4590 for(_class = source->_class ? source->_class->registered : (((void *)0)); _class; _class = _class->base)
4591 {
4592 struct __ecereNameSpace__ecere__com__Property * convert;
4593
4594 for(convert = _class->conversions.first; convert; convert = convert->next)
4595 {
4596 if(convert->memberAccess == 1 || _class->module == privateModule)
4597 {
4598 struct Conversion * after = (conversions != (((void *)0))) ? conversions->last : (((void *)0));
4599
4600 if(!convert->dataType)
4601 convert->dataType = ProcessTypeString(convert->dataTypeString, 0x0);
4602 if(MatchTypes(convert->dataType, dest, conversions, (((void *)0)), (((void *)0)), 0x0, 0x1, 0x0, 0x1))
4603 {
4604 if(!conversions && !convert->Get)
4605 return 0x1;
4606 else if(conversions != (((void *)0)))
4607 {
4608 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))
4609 return 0x1;
4610 else
4611 {
4612 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv->isGet = 0x1, conv);
4613
4614 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(conversions, after, conv);
4615 return 0x1;
4616 }
4617 }
4618 }
4619 }
4620 }
4621 }
4622 }
4623 if(dest->kind == 8)
4624 {
4625 struct __ecereNameSpace__ecere__com__Class * _class;
4626
4627 for(_class = dest->_class ? dest->_class->registered : (((void *)0)); _class; _class = _class->base)
4628 {
4629 struct __ecereNameSpace__ecere__com__Property * convert;
4630
4631 for(convert = _class->conversions.first; convert; convert = convert->next)
4632 {
4633 if(convert->memberAccess == 1 || _class->module == privateModule)
4634 {
4635 if(!convert->dataType)
4636 convert->dataType = ProcessTypeString(convert->dataTypeString, 0x0);
4637 if(convert->dataType != dest && MatchTypes(source, convert->dataType, conversions, (((void *)0)), (((void *)0)), 0x1, 0x0, 0x0, 0x1))
4638 {
4639 if(!conversions && !convert->Set)
4640 return 0x1;
4641 else if(conversions != (((void *)0)))
4642 {
4643 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))
4644 return 0x1;
4645 else
4646 {
4647 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv);
4648
4649 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(conversions, conv);
4650 return 0x1;
4651 }
4652 }
4653 }
4654 }
4655 }
4656 }
4657 if(enumBaseType && dest->_class && dest->_class->registered && dest->_class->registered->type == 4)
4658 {
4659 if(!dest->_class->registered->dataType)
4660 dest->_class->registered->dataType = ProcessTypeString(dest->_class->registered->dataTypeString, 0x0);
4661 if(dest->_class->registered->dataType->kind == 8 || source->truth || dest->truth)
4662 {
4663 if(MatchTypes(source, dest->_class->registered->dataType, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
4664 {
4665 return 0x1;
4666 }
4667 }
4668 }
4669 }
4670 if(source->kind == 8)
4671 {
4672 struct __ecereNameSpace__ecere__com__Class * _class;
4673
4674 for(_class = source->_class ? source->_class->registered : (((void *)0)); _class; _class = _class->base)
4675 {
4676 struct __ecereNameSpace__ecere__com__Property * convert;
4677
4678 for(convert = _class->conversions.first; convert; convert = convert->next)
4679 {
4680 if(convert->memberAccess == 1 || _class->module == privateModule)
4681 {
4682 struct Conversion * after = (conversions != (((void *)0))) ? conversions->last : (((void *)0));
4683
4684 if(!convert->dataType)
4685 convert->dataType = ProcessTypeString(convert->dataTypeString, 0x0);
4686 if(convert->dataType != source && MatchTypes(convert->dataType, dest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x1))
4687 {
4688 if(!conversions && !convert->Get)
4689 return 0x1;
4690 else if(conversions != (((void *)0)))
4691 {
4692 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))
4693 return 0x1;
4694 else
4695 {
4696 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv->isGet = 0x1, conv);
4697
4698 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(conversions, after, conv);
4699 return 0x1;
4700 }
4701 }
4702 }
4703 }
4704 }
4705 }
4706 if(enumBaseType && source->_class && source->_class->registered && source->_class->registered->type == 4)
4707 {
4708 if(!source->_class->registered->dataType)
4709 source->_class->registered->dataType = ProcessTypeString(source->_class->registered->dataTypeString, 0x0);
4710 if(MatchTypes(source->_class->registered->dataType, dest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
4711 {
4712 return 0x1;
4713 }
4714 }
4715 }
4716 }
4717 if(source->kind == 8 || source->kind == 19)
4718 ;
4719 else if(dest->kind == source->kind && (dest->kind != 9 && dest->kind != 10 && dest->kind != 11 && dest->kind != 12 && dest->kind != 13 && dest->kind != 16))
4720 return 0x1;
4721 else if(dest->kind == 7 && source->kind == 6)
4722 return 0x1;
4723 else if(dest->kind == 2 && source->kind == 1)
4724 return 0x1;
4725 else if(dest->kind == 3 && (source->kind == 2 || source->kind == 1))
4726 return 0x1;
4727 else if(dest->kind == 4 && (source->kind == 2 || source->kind == 1 || source->kind == 3))
4728 return 0x1;
4729 else if(dest->kind == 22 && (source->kind == 2 || source->kind == 1 || source->kind == 3))
4730 return 0x1;
4731 else if(source->kind == 15 && (dest->kind == 3 || dest->kind == 2 || dest->kind == 1 || dest->kind == 5 || dest->kind == 4 || dest->kind == 22))
4732 return 0x1;
4733 else if(dest->kind == 15 && (source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 5 || source->kind == 4 || source->kind == 22))
4734 return 0x1;
4735 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)))
4736 {
4737 struct Type * paramSource, * paramDest;
4738
4739 if(dest->kind == 16)
4740 owningClassDest = dest->methodClass ? dest->methodClass : dest->method->_class;
4741 if(source->kind == 16)
4742 owningClassSource = source->methodClass ? source->methodClass : source->method->_class;
4743 if(dest->kind == 13 && dest->type->kind == 11)
4744 dest = dest->type;
4745 if(source->kind == 13 && source->type->kind == 11)
4746 source = source->type;
4747 if(dest->kind == 16)
4748 dest = dest->method->dataType;
4749 if(source->kind == 16)
4750 source = source->method->dataType;
4751 paramSource = source->params.first;
4752 if(paramSource && paramSource->kind == 0)
4753 paramSource = (((void *)0));
4754 paramDest = dest->params.first;
4755 if(paramDest && paramDest->kind == 0)
4756 paramDest = (((void *)0));
4757 if((dest->staticMethod || (!dest->thisClass && !owningClassDest)) && !(source->staticMethod || (!source->thisClass && !owningClassSource)))
4758 {
4759 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))))
4760 {
4761 if(paramDest && paramDest->kind == 8)
4762 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "method class must be derived from %s\n", (((void *)0))), paramDest->_class->string);
4763 else
4764 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "method class should not take an object\n", (((void *)0))));
4765 return 0x0;
4766 }
4767 paramDest = paramDest->next;
4768 }
4769 else if(!dest->staticMethod && (dest->thisClass || owningClassDest))
4770 {
4771 if((source->staticMethod || (!source->thisClass && !owningClassSource)))
4772 {
4773 if(dest->thisClass)
4774 {
4775 if(!paramSource || paramSource->kind != 8 || !__ecereNameSpace__ecere__com__eClass_IsDerived(paramSource->_class->registered, dest->thisClass->registered))
4776 {
4777 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "method class must be derived from %s\n", (((void *)0))), dest->thisClass->string);
4778 return 0x0;
4779 }
4780 }
4781 else
4782 {
4783 if(!paramSource || paramSource->kind != 8 || (owningClassDest && !__ecereNameSpace__ecere__com__eClass_IsDerived(paramSource->_class->registered, owningClassDest)))
4784 {
4785 if(owningClassDest)
4786 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "%s expected to be derived from method class\n", (((void *)0))), owningClassDest->fullName);
4787 else
4788 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "overriding class expected to be derived from method class\n", (((void *)0))));
4789 return 0x0;
4790 }
4791 }
4792 paramSource = paramSource->next;
4793 }
4794 else
4795 {
4796 if(dest->thisClass)
4797 {
4798 if(!__ecereNameSpace__ecere__com__eClass_IsDerived(source->thisClass ? source->thisClass->registered : owningClassSource, dest->thisClass->registered))
4799 {
4800 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "method class must be derived from %s\n", (((void *)0))), dest->thisClass->string);
4801 return 0x0;
4802 }
4803 }
4804 else
4805 {
4806 if(source->thisClass && source->thisClass->registered && owningClassDest && !__ecereNameSpace__ecere__com__eClass_IsDerived(source->thisClass->registered, owningClassDest))
4807 {
4808 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "%s expected to be derived from method class\n", (((void *)0))), source->thisClass->registered->fullName);
4809 return 0x0;
4810 }
4811 }
4812 }
4813 }
4814 if(!MatchTypes(source->returnType, dest->returnType, (((void *)0)), (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
4815 {
4816 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible return type for function\n", (((void *)0))));
4817 return 0x0;
4818 }
4819 for(; paramDest; paramDest = paramDest->next)
4820 {
4821 if(!paramSource)
4822 {
4823 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "not enough parameters\n", (((void *)0))));
4824 return 0x0;
4825 }
4826 {
4827 struct Type * paramDestType = paramDest;
4828 struct Type * paramSourceType = paramSource;
4829 struct Type * type = paramDestType;
4830
4831 if(paramDest->kind == 20 && paramDest->templateParameter->type == 0 && owningClassSource && paramSource->kind != 20)
4832 {
4833 int id = 0;
4834 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
4835 struct __ecereNameSpace__ecere__com__Class * sClass;
4836
4837 for(sClass = owningClassSource; sClass; sClass = sClass->base)
4838 {
4839 id = 0;
4840 if(sClass->templateClass)
4841 sClass = sClass->templateClass;
4842 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
4843 {
4844 if(curParam->type == 0 && !strcmp(type->templateParameter->identifier->string, curParam->name))
4845 {
4846 for(sClass = sClass->base; sClass; sClass = sClass->base)
4847 {
4848 if(sClass->templateClass)
4849 sClass = sClass->templateClass;
4850 id += sClass->templateParams.count;
4851 }
4852 break;
4853 }
4854 id++;
4855 }
4856 if(curParam)
4857 break;
4858 }
4859 if(curParam)
4860 {
4861 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = owningClassSource->templateArgs[id];
4862
4863 paramDestType = type = ProcessTypeString(arg.dataTypeString, 0x0);
4864 }
4865 }
4866 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)))
4867 {
4868 char type[1024];
4869
4870 type[0] = (char)0;
4871 PrintType(paramDest, type, 0x0, 0x1);
4872 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible parameter %s (expected %s)\n", (((void *)0))), paramSource->name, type);
4873 if(paramDestType != paramDest)
4874 FreeType(paramDestType);
4875 return 0x0;
4876 }
4877 if(paramDestType != paramDest)
4878 FreeType(paramDestType);
4879 }
4880 paramSource = paramSource->next;
4881 }
4882 if(paramSource)
4883 {
4884 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "too many parameters\n", (((void *)0))));
4885 return 0x0;
4886 }
4887 return 0x1;
4888 }
4889 else if((dest->kind == 11 || (dest->kind == 13 && dest->type->kind == 11) || dest->kind == 16) && (source->kind == 13 && source->type->kind == 0))
4890 {
4891 return 0x1;
4892 }
4893 else if((dest->kind == 13 || dest->kind == 12) && (source->kind == 12 || source->kind == 13))
4894 {
4895 if(MatchTypes(source->type, dest->type, (((void *)0)), (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
4896 return 0x1;
4897 }
4898 }
4899 return 0x0;
4900 }
4901
4902 static void FreeConvert(struct Conversion * convert)
4903 {
4904 if(convert->resultType)
4905 FreeType(convert->resultType);
4906 }
4907
4908 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__BTNamedLink;
4909
4910 struct __ecereNameSpace__ecere__com__BTNamedLink
4911 {
4912 char *  name;
4913 struct __ecereNameSpace__ecere__com__BTNamedLink * parent;
4914 struct __ecereNameSpace__ecere__com__BTNamedLink * left;
4915 struct __ecereNameSpace__ecere__com__BTNamedLink * right;
4916 int depth;
4917 void *  data;
4918 } __attribute__ ((gcc_struct));
4919
4920 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__EnumClassData;
4921
4922 struct __ecereNameSpace__ecere__com__EnumClassData
4923 {
4924 struct __ecereNameSpace__ecere__sys__OldList values;
4925 int largest;
4926 } __attribute__ ((gcc_struct));
4927
4928 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__NamedLink;
4929
4930 struct __ecereNameSpace__ecere__sys__NamedLink
4931 {
4932 struct __ecereNameSpace__ecere__sys__NamedLink * prev;
4933 struct __ecereNameSpace__ecere__sys__NamedLink * next;
4934 char *  name;
4935 void *  data;
4936 } __attribute__ ((gcc_struct));
4937
4938 extern void FreeExpContents(struct Expression * exp);
4939
4940 struct __ecereNameSpace__ecere__sys__BTNode * __ecereProp___ecereNameSpace__ecere__sys__BinaryTree_Get_first(struct __ecereNameSpace__ecere__sys__BinaryTree * this);
4941
4942 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp___ecereNameSpace__ecere__sys__BinaryTree_first;
4943
4944 struct __ecereNameSpace__ecere__sys__BTNode * __ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_next(struct __ecereNameSpace__ecere__sys__BTNode * this);
4945
4946 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp___ecereNameSpace__ecere__sys__BTNode_next;
4947
4948 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(struct __ecereNameSpace__ecere__sys__OldList * this, void (*  freeFn)(void * ));
4949
4950 unsigned int MatchWithEnums_NameSpace(struct __ecereNameSpace__ecere__com__NameSpace * nameSpace, struct Expression * sourceExp, struct Type * dest, char * string, struct __ecereNameSpace__ecere__sys__OldList * conversions)
4951 {
4952 struct __ecereNameSpace__ecere__com__BTNamedLink * link;
4953
4954 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)))
4955 {
4956 struct __ecereNameSpace__ecere__com__Class * _class = link->data;
4957
4958 if(_class->type == 4)
4959 {
4960 struct __ecereNameSpace__ecere__sys__OldList converts = 
4961 {
4962 0, 0, 0, 0, 0
4963 };
4964 struct Type * type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
4965
4966 type->kind = 8;
4967 if(!_class->symbol)
4968 _class->symbol = FindClass(_class->fullName);
4969 type->_class = _class->symbol;
4970 if(MatchTypes(type, dest, &converts, (((void *)0)), (((void *)0)), 0x1, 0x0, 0x0, 0x0))
4971 {
4972 struct __ecereNameSpace__ecere__sys__NamedLink * value;
4973 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
4974
4975 if(enumClass)
4976 {
4977 struct __ecereNameSpace__ecere__com__Class * baseClass;
4978
4979 for(baseClass = _class; baseClass && baseClass->type == 4; baseClass = baseClass->base)
4980 {
4981 struct __ecereNameSpace__ecere__com__EnumClassData * e = (baseClass ? ((void *)(((char *)baseClass->data) + enumClass->offsetClass)) : (((void *)0)));
4982
4983 for(value = e->values.first; value; value = value->next)
4984 {
4985 if(!strcmp(value->name, string))
4986 break;
4987 }
4988 if(value)
4989 {
4990 FreeExpContents(sourceExp);
4991 FreeType(sourceExp->expType);
4992 sourceExp->isConstant = 0x1;
4993 sourceExp->expType = MkClassType(baseClass->fullName);
4994 {
4995 char constant[256];
4996
4997 sourceExp->type = 2;
4998 if(!strcmp(baseClass->dataTypeString, "int"))
4999 sprintf(constant, "%d", value->data);
5000 else
5001 sprintf(constant, "0x%X", value->data);
5002 sourceExp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
5003 }
5004 while(converts.first)
5005 {
5006 struct Conversion * convert = converts.first;
5007
5008 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(&converts, convert);
5009 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(conversions, convert);
5010 }
5011 ((type ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(type) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(type)) : 0), type = 0);
5012 return 0x1;
5013 }
5014 }
5015 }
5016 }
5017 if(converts.first)
5018 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(&converts, FreeConvert);
5019 ((type ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(type) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(type)) : 0), type = 0);
5020 }
5021 }
5022 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)))
5023 if(MatchWithEnums_NameSpace(nameSpace, sourceExp, dest, string, conversions))
5024 return 0x1;
5025 return 0x0;
5026 }
5027
5028 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__SubModule;
5029
5030 struct __ecereNameSpace__ecere__com__SubModule
5031 {
5032 struct __ecereNameSpace__ecere__com__SubModule * prev;
5033 struct __ecereNameSpace__ecere__com__SubModule * next;
5034 struct __ecereNameSpace__ecere__com__Instance * module;
5035 int importMode;
5036 } __attribute__ ((gcc_struct));
5037
5038 unsigned int ModuleVisibility(struct __ecereNameSpace__ecere__com__Instance * searchIn, struct __ecereNameSpace__ecere__com__Instance * searchFor)
5039 {
5040 struct __ecereNameSpace__ecere__com__SubModule * subModule;
5041
5042 if(searchFor == searchIn)
5043 return 0x1;
5044 for(subModule = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)searchIn + 12)))->modules.first; subModule; subModule = subModule->next)
5045 {
5046 if(subModule->importMode == 1 || searchIn == ((struct __ecereNameSpace__ecere__com__Module *)(((char *)searchIn + 12)))->application)
5047 {
5048 if(ModuleVisibility(subModule->module, searchFor))
5049 return 0x1;
5050 }
5051 }
5052 return 0x0;
5053 }
5054
5055 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Application;
5056
5057 struct __ecereNameSpace__ecere__com__Application
5058 {
5059 int argc;
5060 char * *  argv;
5061 int exitCode;
5062 unsigned int isGUIApp;
5063 struct __ecereNameSpace__ecere__sys__OldList allModules;
5064 char *  parsedCommand;
5065 struct __ecereNameSpace__ecere__com__NameSpace systemNameSpace;
5066 } __attribute__ ((gcc_struct));
5067
5068 unsigned int MatchWithEnums_Module(struct __ecereNameSpace__ecere__com__Instance * mainModule, struct Expression * sourceExp, struct Type * dest, char * string, struct __ecereNameSpace__ecere__sys__OldList * conversions)
5069 {
5070 struct __ecereNameSpace__ecere__com__Instance * module;
5071
5072 if(MatchWithEnums_NameSpace(&((struct __ecereNameSpace__ecere__com__Application *)(((char *)((struct __ecereNameSpace__ecere__com__Module *)(((char *)mainModule + 12)))->application + 300)))->systemNameSpace, sourceExp, dest, string, conversions))
5073 return 0x1;
5074 if(MatchWithEnums_NameSpace(&((struct __ecereNameSpace__ecere__com__Module *)(((char *)((struct __ecereNameSpace__ecere__com__Module *)(((char *)mainModule + 12)))->application + 12)))->privateNameSpace, sourceExp, dest, string, conversions))
5075 return 0x1;
5076 if(MatchWithEnums_NameSpace(&((struct __ecereNameSpace__ecere__com__Module *)(((char *)((struct __ecereNameSpace__ecere__com__Module *)(((char *)mainModule + 12)))->application + 12)))->publicNameSpace, sourceExp, dest, string, conversions))
5077 return 0x1;
5078 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)
5079 {
5080 if(ModuleVisibility(mainModule, module) && MatchWithEnums_NameSpace(&((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + 12)))->publicNameSpace, sourceExp, dest, string, conversions))
5081 return 0x1;
5082 }
5083 return 0x0;
5084 }
5085
5086 extern unsigned long strtoul(const char *  nptr, char * *  endptr, int base);
5087
5088 void ReadString(char *  output, char *  string);
5089
5090 extern struct Specifier * MkEnum(struct Identifier * id, struct __ecereNameSpace__ecere__sys__OldList * list);
5091
5092 extern struct TypeName * QMkClass(char *  spec, struct Declarator * decl);
5093
5094 extern struct Expression * MkExpBrackets(struct __ecereNameSpace__ecere__sys__OldList * expressions);
5095
5096 unsigned int MatchTypeExpression(struct Expression * sourceExp, struct Type * dest, struct __ecereNameSpace__ecere__sys__OldList * conversions, unsigned int skipUnitBla)
5097 {
5098 void * __ecereTemp1;
5099 struct Type * source = sourceExp->expType;
5100 struct Type * realDest = dest;
5101
5102 if(dest->kind == 13 && sourceExp->type == 2 && !strtoul(sourceExp->constant, (((void *)0)), 0))
5103 return 0x1;
5104 if(!skipUnitBla && source && dest && source->kind == 8 && dest->kind == 8)
5105 {
5106 if(source->_class && source->_class->registered && source->_class->registered->type == 3)
5107 {
5108 struct __ecereNameSpace__ecere__com__Class * sourceBase, * destBase;
5109
5110 for(sourceBase = source->_class->registered; sourceBase && sourceBase->base && sourceBase->base->type != 1000; sourceBase = sourceBase->base)
5111 ;
5112 for(destBase = dest->_class->registered; destBase && destBase->base && destBase->base->type != 1000; destBase = destBase->base)
5113 ;
5114 if(sourceBase == destBase)
5115 return 0x1;
5116 }
5117 }
5118 if(source)
5119 {
5120 struct __ecereNameSpace__ecere__sys__OldList * specs;
5121 unsigned int flag = 0x0;
5122 long long value = (((int)0x7fffffff));
5123
5124 source->refCount++;
5125 dest->refCount++;
5126 if(sourceExp->type == 2)
5127 {
5128 if(source->isSigned)
5129 value = strtoll(sourceExp->constant, (((void *)0)), 0);
5130 else
5131 value = strtoull(sourceExp->constant, (((void *)0)), 0);
5132 }
5133 else if(sourceExp->type == 4 && sourceExp->op.op == '-' && !sourceExp->op.exp1 && sourceExp->op.exp2 && sourceExp->op.exp2->type == 2)
5134 {
5135 if(source->isSigned)
5136 value = -strtoll(sourceExp->op.exp2->constant, (((void *)0)), 0);
5137 else
5138 value = -strtoull(sourceExp->op.exp2->constant, (((void *)0)), 0);
5139 }
5140 if(dest->kind != 8 && source->kind == 8 && source->_class && source->_class->registered && !strcmp(source->_class->registered->fullName, "ecere::com::unichar"))
5141 {
5142 FreeType(source);
5143 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));
5144 }
5145 if(dest->kind == 8)
5146 {
5147 struct __ecereNameSpace__ecere__com__Class * _class = dest->_class ? dest->_class->registered : (((void *)0));
5148
5149 if(_class && _class->type == 3)
5150 {
5151 if(source->kind != 8)
5152 {
5153 struct Type * tempType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5154 struct Type * tempDest, * tempSource;
5155
5156 for(; _class->base->type != 1000; _class = _class->base)
5157 ;
5158 tempSource = dest;
5159 tempDest = tempType;
5160 tempType->kind = 8;
5161 if(!_class->symbol)
5162 _class->symbol = FindClass(_class->fullName);
5163 tempType->_class = _class->symbol;
5164 tempType->truth = dest->truth;
5165 if(tempType->_class)
5166 MatchTypes(tempSource, tempDest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0);
5167 FreeType(sourceExp->expType);
5168 sourceExp->expType = dest;
5169 dest->refCount++;
5170 flag = 0x1;
5171 ((tempType ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(tempType) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(tempType)) : 0), tempType = 0);
5172 }
5173 }
5174 if(_class && _class->type == 2 && source->kind != 8)
5175 {
5176 if(!dest->_class->registered->dataType)
5177 dest->_class->registered->dataType = ProcessTypeString(dest->_class->registered->dataTypeString, 0x0);
5178 if(MatchTypes(source, dest->_class->registered->dataType, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
5179 {
5180 FreeType(source);
5181 FreeType(sourceExp->expType);
5182 source = sourceExp->expType = MkClassType(dest->_class->string);
5183 source->refCount++;
5184 }
5185 }
5186 if(_class && !strcmp(_class->fullName, "ecere::com::Class") && source->kind == 13 && source->type && source->type->kind == 1 && sourceExp->type == 3)
5187 {
5188 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
5189 struct Declarator * decl;
5190 char string[1024];
5191
5192 ReadString(string, sourceExp->string);
5193 decl = SpecDeclFromString(string, specs, (((void *)0)));
5194 FreeExpContents(sourceExp);
5195 FreeType(sourceExp->expType);
5196 sourceExp->type = 26;
5197 sourceExp->_classExp.specifiers = specs;
5198 sourceExp->_classExp.decl = decl;
5199 sourceExp->expType = dest;
5200 dest->refCount++;
5201 FreeType(source);
5202 FreeType(dest);
5203 return 0x1;
5204 }
5205 }
5206 else if(source->kind == 8)
5207 {
5208 struct __ecereNameSpace__ecere__com__Class * _class = source->_class ? source->_class->registered : (((void *)0));
5209
5210 if(_class && (_class->type == 3 || !strcmp(_class->fullName, "bool") || _class->type == 2))
5211 {
5212 if(dest->kind != 8)
5213 {
5214 struct Type * tempType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5215 struct Type * tempDest, * tempSource;
5216
5217 if(!source->_class->registered->dataType)
5218 source->_class->registered->dataType = ProcessTypeString(source->_class->registered->dataTypeString, 0x0);
5219 for(; _class->base->type != 1000; _class = _class->base)
5220 ;
5221 tempDest = source;
5222 tempSource = tempType;
5223 tempType->kind = 8;
5224 tempType->_class = FindClass(_class->fullName);
5225 tempType->truth = source->truth;
5226 tempType->classObjectType = source->classObjectType;
5227 if(tempType->_class)
5228 MatchTypes(tempSource, tempDest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0);
5229 if(conversions->last)
5230 {
5231 ((struct Conversion *)conversions->last)->resultType = dest;
5232 dest->refCount++;
5233 }
5234 FreeType(sourceExp->expType);
5235 sourceExp->expType = MkClassType(_class->fullName);
5236 sourceExp->expType->truth = source->truth;
5237 sourceExp->expType->classObjectType = source->classObjectType;
5238 if(!sourceExp->destType)
5239 {
5240 FreeType(sourceExp->destType);
5241 sourceExp->destType = sourceExp->expType;
5242 if(sourceExp->expType)
5243 sourceExp->expType->refCount++;
5244 }
5245 if(!_class->dataType)
5246 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
5247 FreeType(dest);
5248 dest = MkClassType(source->_class->string);
5249 dest->truth = source->truth;
5250 dest->classObjectType = source->classObjectType;
5251 FreeType(source);
5252 source = _class->dataType;
5253 source->refCount++;
5254 ((tempType ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(tempType) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(tempType)) : 0), tempType = 0);
5255 }
5256 }
5257 }
5258 if(!flag)
5259 {
5260 if(MatchTypes(source, dest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
5261 {
5262 FreeType(source);
5263 FreeType(dest);
5264 return 0x1;
5265 }
5266 }
5267 if(dest->kind == 8)
5268 {
5269 struct __ecereNameSpace__ecere__com__Class * _class = dest->_class ? dest->_class->registered : (((void *)0));
5270
5271 if(_class && !dest->truth && (_class->type == 3 || !strcmp(_class->fullName, "bool") || (_class->type != 1 && !value && source->kind == 3) || _class->type == 2))
5272 {
5273 if(_class->type == 0 || _class->type == 5)
5274 {
5275 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
5276
5277 *newExp = *sourceExp;
5278 if(sourceExp->destType)
5279 sourceExp->destType->refCount++;
5280 if(sourceExp->expType)
5281 sourceExp->expType->refCount++;
5282 sourceExp->type = 11;
5283 sourceExp->cast.typeName = MkTypeName(MkListOne(MkSpecifier(VOID)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0))));
5284 sourceExp->cast.exp = newExp;
5285 FreeType(sourceExp->expType);
5286 sourceExp->expType = (((void *)0));
5287 ProcessExpressionType(sourceExp);
5288 if(!inCompiler)
5289 {
5290 FreeType(sourceExp->expType);
5291 sourceExp->expType = dest;
5292 }
5293 FreeType(source);
5294 if(inCompiler)
5295 FreeType(dest);
5296 return 0x1;
5297 }
5298 if(!_class->dataType)
5299 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
5300 FreeType(dest);
5301 dest = _class->dataType;
5302 dest->refCount++;
5303 }
5304 if(dest->kind == 7 && (source->kind == 7 || source->kind == 6 || dest->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 1))
5305 {
5306 specs = MkListOne(MkSpecifier(DOUBLE));
5307 }
5308 else if(dest->kind == 6 && (source->kind == 6 || dest->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 7))
5309 {
5310 specs = MkListOne(MkSpecifier(FLOAT));
5311 }
5312 else if(dest->kind == 4 && (source->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 6 || source->kind == 7))
5313 {
5314 specs = MkList();
5315 if(!dest->isSigned)
5316 ListAdd(specs, MkSpecifier(UNSIGNED));
5317 ListAdd(specs, MkSpecifier(INT64));
5318 }
5319 else if(dest->kind == 3 && (source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 6 || source->kind == 7))
5320 {
5321 specs = MkList();
5322 if(!dest->isSigned)
5323 ListAdd(specs, MkSpecifier(UNSIGNED));
5324 ListAdd(specs, MkSpecifier(INT));
5325 }
5326 else if(dest->kind == 2 && (source->kind == 2 || source->kind == 1 || source->kind == 3 || source->kind == 6 || source->kind == 7))
5327 {
5328 specs = MkList();
5329 if(!dest->isSigned)
5330 ListAdd(specs, MkSpecifier(UNSIGNED));
5331 ListAdd(specs, MkSpecifier(SHORT));
5332 }
5333 else if(dest->kind == 1 && (source->kind == 1 || source->kind == 2 || source->kind == 3 || source->kind == 6 || source->kind == 7))
5334 {
5335 specs = MkList();
5336 if(!dest->isSigned)
5337 ListAdd(specs, MkSpecifier(UNSIGNED));
5338 ListAdd(specs, MkSpecifier(CHAR));
5339 }
5340 else
5341 {
5342 FreeType(source);
5343 FreeType(dest);
5344 return 0x0;
5345 }
5346 }
5347 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))
5348 {
5349 specs = MkListOne(MkSpecifier(DOUBLE));
5350 }
5351 else if(dest->kind == 6 && (source->kind == 6 || source->kind == 15 || source->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 1))
5352 {
5353 specs = MkListOne(MkSpecifier(FLOAT));
5354 }
5355 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)))
5356 {
5357 specs = MkList();
5358 if(!dest->isSigned)
5359 ListAdd(specs, MkSpecifier(UNSIGNED));
5360 ListAdd(specs, MkSpecifier(CHAR));
5361 }
5362 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)))))
5363 {
5364 specs = MkList();
5365 if(!dest->isSigned)
5366 ListAdd(specs, MkSpecifier(UNSIGNED));
5367 ListAdd(specs, MkSpecifier(SHORT));
5368 }
5369 else if(dest->kind == 3 && (source->kind == 15 || source->kind == 2 || source->kind == 1 || source->kind == 3))
5370 {
5371 specs = MkList();
5372 if(!dest->isSigned)
5373 ListAdd(specs, MkSpecifier(UNSIGNED));
5374 ListAdd(specs, MkSpecifier(INT));
5375 }
5376 else if(dest->kind == 4 && (source->kind == 15 || source->kind == 2 || source->kind == 1 || source->kind == 3 || source->kind == 4))
5377 {
5378 specs = MkList();
5379 if(!dest->isSigned)
5380 ListAdd(specs, MkSpecifier(UNSIGNED));
5381 ListAdd(specs, MkSpecifier(INT64));
5382 }
5383 else if(dest->kind == 15 && (source->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 1))
5384 {
5385 specs = MkListOne(MkEnum(MkIdentifier(dest->enumName), (((void *)0))));
5386 }
5387 else
5388 {
5389 FreeType(source);
5390 FreeType(dest);
5391 return 0x0;
5392 }
5393 if(!flag)
5394 {
5395 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
5396
5397 *newExp = *sourceExp;
5398 newExp->prev = (((void *)0));
5399 newExp->next = (((void *)0));
5400 if(sourceExp->destType)
5401 sourceExp->destType->refCount++;
5402 if(sourceExp->expType)
5403 sourceExp->expType->refCount++;
5404 sourceExp->type = 11;
5405 if(realDest->kind == 8)
5406 {
5407 sourceExp->cast.typeName = QMkClass(realDest->_class->string, (((void *)0)));
5408 FreeList(specs, FreeSpecifier);
5409 }
5410 else
5411 sourceExp->cast.typeName = MkTypeName(specs, (((void *)0)));
5412 if(newExp->type == 4)
5413 {
5414 sourceExp->cast.exp = MkExpBrackets(MkListOne(newExp));
5415 }
5416 else
5417 sourceExp->cast.exp = newExp;
5418 FreeType(sourceExp->expType);
5419 sourceExp->expType = (((void *)0));
5420 ProcessExpressionType(sourceExp);
5421 }
5422 else
5423 FreeList(specs, FreeSpecifier);
5424 FreeType(dest);
5425 FreeType(source);
5426 return 0x1;
5427 }
5428 else
5429 {
5430 while((sourceExp->type == 5 || sourceExp->type == 34) && sourceExp->list)
5431 sourceExp = (*sourceExp->list).last;
5432 if(sourceExp->type == 0)
5433 {
5434 struct Identifier * id = sourceExp->identifier;
5435
5436 if(dest->kind == 8)
5437 {
5438 if(dest->_class && dest->_class->registered && dest->_class->registered->type == 4)
5439 {
5440 struct __ecereNameSpace__ecere__com__Class * _class = dest->_class->registered;
5441 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
5442
5443 if(enumClass)
5444 {
5445 for(; _class && _class->type == 4; _class = _class->base)
5446 {
5447 struct __ecereNameSpace__ecere__sys__NamedLink * value;
5448 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
5449
5450 for(value = e->values.first; value; value = value->next)
5451 {
5452 if(!strcmp(value->name, id->string))
5453 break;
5454 }
5455 if(value)
5456 {
5457 FreeExpContents(sourceExp);
5458 FreeType(sourceExp->expType);
5459 sourceExp->isConstant = 0x1;
5460 sourceExp->expType = MkClassType(_class->fullName);
5461 {
5462 char constant[256];
5463
5464 sourceExp->type = 2;
5465 if(_class->dataTypeString && !strcmp(_class->dataTypeString, "int"))
5466 sprintf(constant, "%d", value->data);
5467 else
5468 sprintf(constant, "0x%X", value->data);
5469 sourceExp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
5470 }
5471 return 0x1;
5472 }
5473 }
5474 }
5475 }
5476 }
5477 if(dest->classObjectType != 2 && dest->kind == 8 && MatchWithEnums_Module(privateModule, sourceExp, dest, id->string, conversions))
5478 return 0x1;
5479 }
5480 }
5481 return 0x0;
5482 }
5483
5484 static unsigned int IntAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5485 {
5486 int value2 = op2->i;
5487
5488 exp->type = 2;
5489 exp->string = PrintInt(op1->i + value2);
5490 if(!exp->expType)
5491 {
5492 exp->expType = op1->type;
5493 if(op1->type)
5494 op1->type->refCount++;
5495 }
5496 return 0x1;
5497 }
5498
5499 static unsigned int UIntAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5500 {
5501 unsigned int value2 = op2->ui;
5502
5503 exp->type = 2;
5504 exp->string = PrintUInt(op1->ui + value2);
5505 if(!exp->expType)
5506 {
5507 exp->expType = op1->type;
5508 if(op1->type)
5509 op1->type->refCount++;
5510 }
5511 return 0x1;
5512 }
5513
5514 static unsigned int ShortAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5515 {
5516 short value2 = op2->s;
5517
5518 exp->type = 2;
5519 exp->string = PrintShort(op1->s + value2);
5520 if(!exp->expType)
5521 {
5522 exp->expType = op1->type;
5523 if(op1->type)
5524 op1->type->refCount++;
5525 }
5526 return 0x1;
5527 }
5528
5529 static unsigned int UShortAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5530 {
5531 unsigned short value2 = op2->us;
5532
5533 exp->type = 2;
5534 exp->string = PrintUShort(op1->us + value2);
5535 if(!exp->expType)
5536 {
5537 exp->expType = op1->type;
5538 if(op1->type)
5539 op1->type->refCount++;
5540 }
5541 return 0x1;
5542 }
5543
5544 static unsigned int CharAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5545 {
5546 char value2 = op2->c;
5547
5548 exp->type = 2;
5549 exp->string = PrintChar(op1->c + value2);
5550 if(!exp->expType)
5551 {
5552 exp->expType = op1->type;
5553 if(op1->type)
5554 op1->type->refCount++;
5555 }
5556 return 0x1;
5557 }
5558
5559 static unsigned int UCharAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5560 {
5561 unsigned char value2 = op2->uc;
5562
5563 exp->type = 2;
5564 exp->string = PrintUChar(op1->uc + value2);
5565 if(!exp->expType)
5566 {
5567 exp->expType = op1->type;
5568 if(op1->type)
5569 op1->type->refCount++;
5570 }
5571 return 0x1;
5572 }
5573
5574 static unsigned int FloatAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5575 {
5576 float value2 = op2->f;
5577
5578 exp->type = 2;
5579 exp->string = PrintFloat(op1->f + value2);
5580 if(!exp->expType)
5581 {
5582 exp->expType = op1->type;
5583 if(op1->type)
5584 op1->type->refCount++;
5585 }
5586 return 0x1;
5587 }
5588
5589 static unsigned int DoubleAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5590 {
5591 double value2 = op2->d;
5592
5593 exp->type = 2;
5594 exp->string = PrintDouble(op1->d + value2);
5595 if(!exp->expType)
5596 {
5597 exp->expType = op1->type;
5598 if(op1->type)
5599 op1->type->refCount++;
5600 }
5601 return 0x1;
5602 }
5603
5604 static unsigned int IntSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5605 {
5606 int value2 = op2->i;
5607
5608 exp->type = 2;
5609 exp->string = PrintInt(op1->i - value2);
5610 if(!exp->expType)
5611 {
5612 exp->expType = op1->type;
5613 if(op1->type)
5614 op1->type->refCount++;
5615 }
5616 return 0x1;
5617 }
5618
5619 static unsigned int UIntSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5620 {
5621 unsigned int value2 = op2->ui;
5622
5623 exp->type = 2;
5624 exp->string = PrintUInt(op1->ui - value2);
5625 if(!exp->expType)
5626 {
5627 exp->expType = op1->type;
5628 if(op1->type)
5629 op1->type->refCount++;
5630 }
5631 return 0x1;
5632 }
5633
5634 static unsigned int ShortSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5635 {
5636 short value2 = op2->s;
5637
5638 exp->type = 2;
5639 exp->string = PrintShort(op1->s - value2);
5640 if(!exp->expType)
5641 {
5642 exp->expType = op1->type;
5643 if(op1->type)
5644 op1->type->refCount++;
5645 }
5646 return 0x1;
5647 }
5648
5649 static unsigned int UShortSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5650 {
5651 unsigned short value2 = op2->us;
5652
5653 exp->type = 2;
5654 exp->string = PrintUShort(op1->us - value2);
5655 if(!exp->expType)
5656 {
5657 exp->expType = op1->type;
5658 if(op1->type)
5659 op1->type->refCount++;
5660 }
5661 return 0x1;
5662 }
5663
5664 static unsigned int CharSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5665 {
5666 char value2 = op2->c;
5667
5668 exp->type = 2;
5669 exp->string = PrintChar(op1->c - value2);
5670 if(!exp->expType)
5671 {
5672 exp->expType = op1->type;
5673 if(op1->type)
5674 op1->type->refCount++;
5675 }
5676 return 0x1;
5677 }
5678
5679 static unsigned int UCharSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5680 {
5681 unsigned char value2 = op2->uc;
5682
5683 exp->type = 2;
5684 exp->string = PrintUChar(op1->uc - value2);
5685 if(!exp->expType)
5686 {
5687 exp->expType = op1->type;
5688 if(op1->type)
5689 op1->type->refCount++;
5690 }
5691 return 0x1;
5692 }
5693
5694 static unsigned int FloatSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5695 {
5696 float value2 = op2->f;
5697
5698 exp->type = 2;
5699 exp->string = PrintFloat(op1->f - value2);
5700 if(!exp->expType)
5701 {
5702 exp->expType = op1->type;
5703 if(op1->type)
5704 op1->type->refCount++;
5705 }
5706 return 0x1;
5707 }
5708
5709 static unsigned int DoubleSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5710 {
5711 double value2 = op2->d;
5712
5713 exp->type = 2;
5714 exp->string = PrintDouble(op1->d - value2);
5715 if(!exp->expType)
5716 {
5717 exp->expType = op1->type;
5718 if(op1->type)
5719 op1->type->refCount++;
5720 }
5721 return 0x1;
5722 }
5723
5724 static unsigned int IntMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5725 {
5726 int value2 = op2->i;
5727
5728 exp->type = 2;
5729 exp->string = PrintInt(op1->i * value2);
5730 if(!exp->expType)
5731 {
5732 exp->expType = op1->type;
5733 if(op1->type)
5734 op1->type->refCount++;
5735 }
5736 return 0x1;
5737 }
5738
5739 static unsigned int UIntMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5740 {
5741 unsigned int value2 = op2->ui;
5742
5743 exp->type = 2;
5744 exp->string = PrintUInt(op1->ui * value2);
5745 if(!exp->expType)
5746 {
5747 exp->expType = op1->type;
5748 if(op1->type)
5749 op1->type->refCount++;
5750 }
5751 return 0x1;
5752 }
5753
5754 static unsigned int ShortMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5755 {
5756 short value2 = op2->s;
5757
5758 exp->type = 2;
5759 exp->string = PrintShort(op1->s * value2);
5760 if(!exp->expType)
5761 {
5762 exp->expType = op1->type;
5763 if(op1->type)
5764 op1->type->refCount++;
5765 }
5766 return 0x1;
5767 }
5768
5769 static unsigned int UShortMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5770 {
5771 unsigned short value2 = op2->us;
5772
5773 exp->type = 2;
5774 exp->string = PrintUShort(op1->us * value2);
5775 if(!exp->expType)
5776 {
5777 exp->expType = op1->type;
5778 if(op1->type)
5779 op1->type->refCount++;
5780 }
5781 return 0x1;
5782 }
5783
5784 static unsigned int CharMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5785 {
5786 char value2 = op2->c;
5787
5788 exp->type = 2;
5789 exp->string = PrintChar(op1->c * value2);
5790 if(!exp->expType)
5791 {
5792 exp->expType = op1->type;
5793 if(op1->type)
5794 op1->type->refCount++;
5795 }
5796 return 0x1;
5797 }
5798
5799 static unsigned int UCharMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5800 {
5801 unsigned char value2 = op2->uc;
5802
5803 exp->type = 2;
5804 exp->string = PrintUChar(op1->uc * value2);
5805 if(!exp->expType)
5806 {
5807 exp->expType = op1->type;
5808 if(op1->type)
5809 op1->type->refCount++;
5810 }
5811 return 0x1;
5812 }
5813
5814 static unsigned int FloatMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5815 {
5816 float value2 = op2->f;
5817
5818 exp->type = 2;
5819 exp->string = PrintFloat(op1->f * value2);
5820 if(!exp->expType)
5821 {
5822 exp->expType = op1->type;
5823 if(op1->type)
5824 op1->type->refCount++;
5825 }
5826 return 0x1;
5827 }
5828
5829 static unsigned int DoubleMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5830 {
5831 double value2 = op2->d;
5832
5833 exp->type = 2;
5834 exp->string = PrintDouble(op1->d * value2);
5835 if(!exp->expType)
5836 {
5837 exp->expType = op1->type;
5838 if(op1->type)
5839 op1->type->refCount++;
5840 }
5841 return 0x1;
5842 }
5843
5844 static unsigned int IntDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5845 {
5846 int value2 = op2->i;
5847
5848 exp->type = 2;
5849 exp->string = PrintInt(value2 ? (op1->i / value2) : 0);
5850 if(!exp->expType)
5851 {
5852 exp->expType = op1->type;
5853 if(op1->type)
5854 op1->type->refCount++;
5855 }
5856 return 0x1;
5857 }
5858
5859 static unsigned int UIntDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5860 {
5861 unsigned int value2 = op2->ui;
5862
5863 exp->type = 2;
5864 exp->string = PrintUInt(value2 ? (op1->ui / value2) : 0);
5865 if(!exp->expType)
5866 {
5867 exp->expType = op1->type;
5868 if(op1->type)
5869 op1->type->refCount++;
5870 }
5871 return 0x1;
5872 }
5873
5874 static unsigned int ShortDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5875 {
5876 short value2 = op2->s;
5877
5878 exp->type = 2;
5879 exp->string = PrintShort(value2 ? (op1->s / value2) : (short)0);
5880 if(!exp->expType)
5881 {
5882 exp->expType = op1->type;
5883 if(op1->type)
5884 op1->type->refCount++;
5885 }
5886 return 0x1;
5887 }
5888
5889 static unsigned int UShortDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5890 {
5891 unsigned short value2 = op2->us;
5892
5893 exp->type = 2;
5894 exp->string = PrintUShort(value2 ? (op1->us / value2) : (unsigned short)0);
5895 if(!exp->expType)
5896 {
5897 exp->expType = op1->type;
5898 if(op1->type)
5899 op1->type->refCount++;
5900 }
5901 return 0x1;
5902 }
5903
5904 static unsigned int CharDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5905 {
5906 char value2 = op2->c;
5907
5908 exp->type = 2;
5909 exp->string = PrintChar(value2 ? (op1->c / value2) : (char)0);
5910 if(!exp->expType)
5911 {
5912 exp->expType = op1->type;
5913 if(op1->type)
5914 op1->type->refCount++;
5915 }
5916 return 0x1;
5917 }
5918
5919 static unsigned int UCharDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5920 {
5921 unsigned char value2 = op2->uc;
5922
5923 exp->type = 2;
5924 exp->string = PrintUChar(value2 ? (op1->uc / value2) : (unsigned char)0);
5925 if(!exp->expType)
5926 {
5927 exp->expType = op1->type;
5928 if(op1->type)
5929 op1->type->refCount++;
5930 }
5931 return 0x1;
5932 }
5933
5934 static unsigned int FloatDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5935 {
5936 float value2 = op2->f;
5937
5938 exp->type = 2;
5939 exp->string = PrintFloat(value2 ? (op1->f / value2) : (float)0);
5940 if(!exp->expType)
5941 {
5942 exp->expType = op1->type;
5943 if(op1->type)
5944 op1->type->refCount++;
5945 }
5946 return 0x1;
5947 }
5948
5949 static unsigned int DoubleDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5950 {
5951 double value2 = op2->d;
5952
5953 exp->type = 2;
5954 exp->string = PrintDouble(value2 ? (op1->d / value2) : (double)0);
5955 if(!exp->expType)
5956 {
5957 exp->expType = op1->type;
5958 if(op1->type)
5959 op1->type->refCount++;
5960 }
5961 return 0x1;
5962 }
5963
5964 static unsigned int IntMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5965 {
5966 int value2 = op2->i;
5967
5968 exp->type = 2;
5969 exp->string = PrintInt(value2 ? (op1->i % value2) : 0);
5970 if(!exp->expType)
5971 {
5972 exp->expType = op1->type;
5973 if(op1->type)
5974 op1->type->refCount++;
5975 }
5976 return 0x1;
5977 }
5978
5979 static unsigned int UIntMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5980 {
5981 unsigned int value2 = op2->ui;
5982
5983 exp->type = 2;
5984 exp->string = PrintUInt(value2 ? (op1->ui % value2) : 0);
5985 if(!exp->expType)
5986 {
5987 exp->expType = op1->type;
5988 if(op1->type)
5989 op1->type->refCount++;
5990 }
5991 return 0x1;
5992 }
5993
5994 static unsigned int ShortMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5995 {
5996 short value2 = op2->s;
5997
5998 exp->type = 2;
5999 exp->string = PrintShort(value2 ? (op1->s % value2) : (short)0);
6000 if(!exp->expType)
6001 {
6002 exp->expType = op1->type;
6003 if(op1->type)
6004 op1->type->refCount++;
6005 }
6006 return 0x1;
6007 }
6008
6009 static unsigned int UShortMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6010 {
6011 unsigned short value2 = op2->us;
6012
6013 exp->type = 2;
6014 exp->string = PrintUShort(value2 ? (op1->us % value2) : (unsigned short)0);
6015 if(!exp->expType)
6016 {
6017 exp->expType = op1->type;
6018 if(op1->type)
6019 op1->type->refCount++;
6020 }
6021 return 0x1;
6022 }
6023
6024 static unsigned int CharMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6025 {
6026 char value2 = op2->c;
6027
6028 exp->type = 2;
6029 exp->string = PrintChar(value2 ? (op1->c % value2) : (char)0);
6030 if(!exp->expType)
6031 {
6032 exp->expType = op1->type;
6033 if(op1->type)
6034 op1->type->refCount++;
6035 }
6036 return 0x1;
6037 }
6038
6039 static unsigned int UCharMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6040 {
6041 unsigned char value2 = op2->uc;
6042
6043 exp->type = 2;
6044 exp->string = PrintUChar(value2 ? (op1->uc % value2) : (unsigned char)0);
6045 if(!exp->expType)
6046 {
6047 exp->expType = op1->type;
6048 if(op1->type)
6049 op1->type->refCount++;
6050 }
6051 return 0x1;
6052 }
6053
6054 static unsigned int IntNeg(struct Expression * exp, struct Operand * op1)
6055 {
6056 exp->type = 2;
6057 exp->string = PrintInt(-op1->i);
6058 if(!exp->expType)
6059 {
6060 exp->expType = op1->type;
6061 if(op1->type)
6062 op1->type->refCount++;
6063 }
6064 return 0x1;
6065 }
6066
6067 static unsigned int UIntNeg(struct Expression * exp, struct Operand * op1)
6068 {
6069 exp->type = 2;
6070 exp->string = PrintUInt(-op1->ui);
6071 if(!exp->expType)
6072 {
6073 exp->expType = op1->type;
6074 if(op1->type)
6075 op1->type->refCount++;
6076 }
6077 return 0x1;
6078 }
6079
6080 static unsigned int ShortNeg(struct Expression * exp, struct Operand * op1)
6081 {
6082 exp->type = 2;
6083 exp->string = PrintShort(-op1->s);
6084 if(!exp->expType)
6085 {
6086 exp->expType = op1->type;
6087 if(op1->type)
6088 op1->type->refCount++;
6089 }
6090 return 0x1;
6091 }
6092
6093 static unsigned int UShortNeg(struct Expression * exp, struct Operand * op1)
6094 {
6095 exp->type = 2;
6096 exp->string = PrintUShort(-op1->us);
6097 if(!exp->expType)
6098 {
6099 exp->expType = op1->type;
6100 if(op1->type)
6101 op1->type->refCount++;
6102 }
6103 return 0x1;
6104 }
6105
6106 static unsigned int CharNeg(struct Expression * exp, struct Operand * op1)
6107 {
6108 exp->type = 2;
6109 exp->string = PrintChar(-op1->c);
6110 if(!exp->expType)
6111 {
6112 exp->expType = op1->type;
6113 if(op1->type)
6114 op1->type->refCount++;
6115 }
6116 return 0x1;
6117 }
6118
6119 static unsigned int UCharNeg(struct Expression * exp, struct Operand * op1)
6120 {
6121 exp->type = 2;
6122 exp->string = PrintUChar(-op1->uc);
6123 if(!exp->expType)
6124 {
6125 exp->expType = op1->type;
6126 if(op1->type)
6127 op1->type->refCount++;
6128 }
6129 return 0x1;
6130 }
6131
6132 static unsigned int FloatNeg(struct Expression * exp, struct Operand * op1)
6133 {
6134 exp->type = 2;
6135 exp->string = PrintFloat(-op1->f);
6136 if(!exp->expType)
6137 {
6138 exp->expType = op1->type;
6139 if(op1->type)
6140 op1->type->refCount++;
6141 }
6142 return 0x1;
6143 }
6144
6145 static unsigned int DoubleNeg(struct Expression * exp, struct Operand * op1)
6146 {
6147 exp->type = 2;
6148 exp->string = PrintDouble(-op1->d);
6149 if(!exp->expType)
6150 {
6151 exp->expType = op1->type;
6152 if(op1->type)
6153 op1->type->refCount++;
6154 }
6155 return 0x1;
6156 }
6157
6158 static unsigned int IntInc(struct Expression * exp, struct Operand * op1)
6159 {
6160 exp->type = 2;
6161 exp->string = PrintInt(++op1->i);
6162 if(!exp->expType)
6163 {
6164 exp->expType = op1->type;
6165 if(op1->type)
6166 op1->type->refCount++;
6167 }
6168 return 0x1;
6169 }
6170
6171 static unsigned int UIntInc(struct Expression * exp, struct Operand * op1)
6172 {
6173 exp->type = 2;
6174 exp->string = PrintUInt(++op1->ui);
6175 if(!exp->expType)
6176 {
6177 exp->expType = op1->type;
6178 if(op1->type)
6179 op1->type->refCount++;
6180 }
6181 return 0x1;
6182 }
6183
6184 static unsigned int ShortInc(struct Expression * exp, struct Operand * op1)
6185 {
6186 exp->type = 2;
6187 exp->string = PrintShort(++op1->s);
6188 if(!exp->expType)
6189 {
6190 exp->expType = op1->type;
6191 if(op1->type)
6192 op1->type->refCount++;
6193 }
6194 return 0x1;
6195 }
6196
6197 static unsigned int UShortInc(struct Expression * exp, struct Operand * op1)
6198 {
6199 exp->type = 2;
6200 exp->string = PrintUShort(++op1->us);
6201 if(!exp->expType)
6202 {
6203 exp->expType = op1->type;
6204 if(op1->type)
6205 op1->type->refCount++;
6206 }
6207 return 0x1;
6208 }
6209
6210 static unsigned int CharInc(struct Expression * exp, struct Operand * op1)
6211 {
6212 exp->type = 2;
6213 exp->string = PrintChar(++op1->c);
6214 if(!exp->expType)
6215 {
6216 exp->expType = op1->type;
6217 if(op1->type)
6218 op1->type->refCount++;
6219 }
6220 return 0x1;
6221 }
6222
6223 static unsigned int UCharInc(struct Expression * exp, struct Operand * op1)
6224 {
6225 exp->type = 2;
6226 exp->string = PrintUChar(++op1->uc);
6227 if(!exp->expType)
6228 {
6229 exp->expType = op1->type;
6230 if(op1->type)
6231 op1->type->refCount++;
6232 }
6233 return 0x1;
6234 }
6235
6236 static unsigned int FloatInc(struct Expression * exp, struct Operand * op1)
6237 {
6238 exp->type = 2;
6239 exp->string = PrintFloat(++op1->f);
6240 if(!exp->expType)
6241 {
6242 exp->expType = op1->type;
6243 if(op1->type)
6244 op1->type->refCount++;
6245 }
6246 return 0x1;
6247 }
6248
6249 static unsigned int DoubleInc(struct Expression * exp, struct Operand * op1)
6250 {
6251 exp->type = 2;
6252 exp->string = PrintDouble(++op1->d);
6253 if(!exp->expType)
6254 {
6255 exp->expType = op1->type;
6256 if(op1->type)
6257 op1->type->refCount++;
6258 }
6259 return 0x1;
6260 }
6261
6262 static unsigned int IntDec(struct Expression * exp, struct Operand * op1)
6263 {
6264 exp->type = 2;
6265 exp->string = PrintInt(--op1->i);
6266 if(!exp->expType)
6267 {
6268 exp->expType = op1->type;
6269 if(op1->type)
6270 op1->type->refCount++;
6271 }
6272 return 0x1;
6273 }
6274
6275 static unsigned int UIntDec(struct Expression * exp, struct Operand * op1)
6276 {
6277 exp->type = 2;
6278 exp->string = PrintUInt(--op1->ui);
6279 if(!exp->expType)
6280 {
6281 exp->expType = op1->type;
6282 if(op1->type)
6283 op1->type->refCount++;
6284 }
6285 return 0x1;
6286 }
6287
6288 static unsigned int ShortDec(struct Expression * exp, struct Operand * op1)
6289 {
6290 exp->type = 2;
6291 exp->string = PrintShort(--op1->s);
6292 if(!exp->expType)
6293 {
6294 exp->expType = op1->type;
6295 if(op1->type)
6296 op1->type->refCount++;
6297 }
6298 return 0x1;
6299 }
6300
6301 static unsigned int UShortDec(struct Expression * exp, struct Operand * op1)
6302 {
6303 exp->type = 2;
6304 exp->string = PrintUShort(--op1->us);
6305 if(!exp->expType)
6306 {
6307 exp->expType = op1->type;
6308 if(op1->type)
6309 op1->type->refCount++;
6310 }
6311 return 0x1;
6312 }
6313
6314 static unsigned int CharDec(struct Expression * exp, struct Operand * op1)
6315 {
6316 exp->type = 2;
6317 exp->string = PrintChar(--op1->c);
6318 if(!exp->expType)
6319 {
6320 exp->expType = op1->type;
6321 if(op1->type)
6322 op1->type->refCount++;
6323 }
6324 return 0x1;
6325 }
6326
6327 static unsigned int UCharDec(struct Expression * exp, struct Operand * op1)
6328 {
6329 exp->type = 2;
6330 exp->string = PrintUChar(--op1->uc);
6331 if(!exp->expType)
6332 {
6333 exp->expType = op1->type;
6334 if(op1->type)
6335 op1->type->refCount++;
6336 }
6337 return 0x1;
6338 }
6339
6340 static unsigned int FloatDec(struct Expression * exp, struct Operand * op1)
6341 {
6342 exp->type = 2;
6343 exp->string = PrintFloat(--op1->f);
6344 if(!exp->expType)
6345 {
6346 exp->expType = op1->type;
6347 if(op1->type)
6348 op1->type->refCount++;
6349 }
6350 return 0x1;
6351 }
6352
6353 static unsigned int DoubleDec(struct Expression * exp, struct Operand * op1)
6354 {
6355 exp->type = 2;
6356 exp->string = PrintDouble(--op1->d);
6357 if(!exp->expType)
6358 {
6359 exp->expType = op1->type;
6360 if(op1->type)
6361 op1->type->refCount++;
6362 }
6363 return 0x1;
6364 }
6365
6366 static unsigned int IntAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6367 {
6368 int value2 = op2->i;
6369
6370 exp->type = 2;
6371 exp->string = PrintInt(op1->i = value2);
6372 if(!exp->expType)
6373 {
6374 exp->expType = op1->type;
6375 if(op1->type)
6376 op1->type->refCount++;
6377 }
6378 return 0x1;
6379 }
6380
6381 static unsigned int UIntAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6382 {
6383 unsigned int value2 = op2->ui;
6384
6385 exp->type = 2;
6386 exp->string = PrintUInt(op1->ui = value2);
6387 if(!exp->expType)
6388 {
6389 exp->expType = op1->type;
6390 if(op1->type)
6391 op1->type->refCount++;
6392 }
6393 return 0x1;
6394 }
6395
6396 static unsigned int ShortAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6397 {
6398 short value2 = op2->s;
6399
6400 exp->type = 2;
6401 exp->string = PrintShort(op1->s = value2);
6402 if(!exp->expType)
6403 {
6404 exp->expType = op1->type;
6405 if(op1->type)
6406 op1->type->refCount++;
6407 }
6408 return 0x1;
6409 }
6410
6411 static unsigned int UShortAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6412 {
6413 unsigned short value2 = op2->us;
6414
6415 exp->type = 2;
6416 exp->string = PrintUShort(op1->us = value2);
6417 if(!exp->expType)
6418 {
6419 exp->expType = op1->type;
6420 if(op1->type)
6421 op1->type->refCount++;
6422 }
6423 return 0x1;
6424 }
6425
6426 static unsigned int CharAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6427 {
6428 char value2 = op2->c;
6429
6430 exp->type = 2;
6431 exp->string = PrintChar(op1->c = value2);
6432 if(!exp->expType)
6433 {
6434 exp->expType = op1->type;
6435 if(op1->type)
6436 op1->type->refCount++;
6437 }
6438 return 0x1;
6439 }
6440
6441 static unsigned int UCharAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6442 {
6443 unsigned char value2 = op2->uc;
6444
6445 exp->type = 2;
6446 exp->string = PrintUChar(op1->uc = value2);
6447 if(!exp->expType)
6448 {
6449 exp->expType = op1->type;
6450 if(op1->type)
6451 op1->type->refCount++;
6452 }
6453 return 0x1;
6454 }
6455
6456 static unsigned int FloatAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6457 {
6458 float value2 = op2->f;
6459
6460 exp->type = 2;
6461 exp->string = PrintFloat(op1->f = value2);
6462 if(!exp->expType)
6463 {
6464 exp->expType = op1->type;
6465 if(op1->type)
6466 op1->type->refCount++;
6467 }
6468 return 0x1;
6469 }
6470
6471 static unsigned int DoubleAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6472 {
6473 double value2 = op2->d;
6474
6475 exp->type = 2;
6476 exp->string = PrintDouble(op1->d = value2);
6477 if(!exp->expType)
6478 {
6479 exp->expType = op1->type;
6480 if(op1->type)
6481 op1->type->refCount++;
6482 }
6483 return 0x1;
6484 }
6485
6486 static unsigned int IntAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6487 {
6488 int value2 = op2->i;
6489
6490 exp->type = 2;
6491 exp->string = PrintInt(op1->i += value2);
6492 if(!exp->expType)
6493 {
6494 exp->expType = op1->type;
6495 if(op1->type)
6496 op1->type->refCount++;
6497 }
6498 return 0x1;
6499 }
6500
6501 static unsigned int UIntAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6502 {
6503 unsigned int value2 = op2->ui;
6504
6505 exp->type = 2;
6506 exp->string = PrintUInt(op1->ui += value2);
6507 if(!exp->expType)
6508 {
6509 exp->expType = op1->type;
6510 if(op1->type)
6511 op1->type->refCount++;
6512 }
6513 return 0x1;
6514 }
6515
6516 static unsigned int ShortAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6517 {
6518 short value2 = op2->s;
6519
6520 exp->type = 2;
6521 exp->string = PrintShort(op1->s += value2);
6522 if(!exp->expType)
6523 {
6524 exp->expType = op1->type;
6525 if(op1->type)
6526 op1->type->refCount++;
6527 }
6528 return 0x1;
6529 }
6530
6531 static unsigned int UShortAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6532 {
6533 unsigned short value2 = op2->us;
6534
6535 exp->type = 2;
6536 exp->string = PrintUShort(op1->us += value2);
6537 if(!exp->expType)
6538 {
6539 exp->expType = op1->type;
6540 if(op1->type)
6541 op1->type->refCount++;
6542 }
6543 return 0x1;
6544 }
6545
6546 static unsigned int CharAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6547 {
6548 char value2 = op2->c;
6549
6550 exp->type = 2;
6551 exp->string = PrintChar(op1->c += value2);
6552 if(!exp->expType)
6553 {
6554 exp->expType = op1->type;
6555 if(op1->type)
6556 op1->type->refCount++;
6557 }
6558 return 0x1;
6559 }
6560
6561 static unsigned int UCharAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6562 {
6563 unsigned char value2 = op2->uc;
6564
6565 exp->type = 2;
6566 exp->string = PrintUChar(op1->uc += value2);
6567 if(!exp->expType)
6568 {
6569 exp->expType = op1->type;
6570 if(op1->type)
6571 op1->type->refCount++;
6572 }
6573 return 0x1;
6574 }
6575
6576 static unsigned int FloatAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6577 {
6578 float value2 = op2->f;
6579
6580 exp->type = 2;
6581 exp->string = PrintFloat(op1->f += value2);
6582 if(!exp->expType)
6583 {
6584 exp->expType = op1->type;
6585 if(op1->type)
6586 op1->type->refCount++;
6587 }
6588 return 0x1;
6589 }
6590
6591 static unsigned int DoubleAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6592 {
6593 double value2 = op2->d;
6594
6595 exp->type = 2;
6596 exp->string = PrintDouble(op1->d += value2);
6597 if(!exp->expType)
6598 {
6599 exp->expType = op1->type;
6600 if(op1->type)
6601 op1->type->refCount++;
6602 }
6603 return 0x1;
6604 }
6605
6606 static unsigned int IntSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6607 {
6608 int value2 = op2->i;
6609
6610 exp->type = 2;
6611 exp->string = PrintInt(op1->i -= value2);
6612 if(!exp->expType)
6613 {
6614 exp->expType = op1->type;
6615 if(op1->type)
6616 op1->type->refCount++;
6617 }
6618 return 0x1;
6619 }
6620
6621 static unsigned int UIntSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6622 {
6623 unsigned int value2 = op2->ui;
6624
6625 exp->type = 2;
6626 exp->string = PrintUInt(op1->ui -= value2);
6627 if(!exp->expType)
6628 {
6629 exp->expType = op1->type;
6630 if(op1->type)
6631 op1->type->refCount++;
6632 }
6633 return 0x1;
6634 }
6635
6636 static unsigned int ShortSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6637 {
6638 short value2 = op2->s;
6639
6640 exp->type = 2;
6641 exp->string = PrintShort(op1->s -= value2);
6642 if(!exp->expType)
6643 {
6644 exp->expType = op1->type;
6645 if(op1->type)
6646 op1->type->refCount++;
6647 }
6648 return 0x1;
6649 }
6650
6651 static unsigned int UShortSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6652 {
6653 unsigned short value2 = op2->us;
6654
6655 exp->type = 2;
6656 exp->string = PrintUShort(op1->us -= value2);
6657 if(!exp->expType)
6658 {
6659 exp->expType = op1->type;
6660 if(op1->type)
6661 op1->type->refCount++;
6662 }
6663 return 0x1;
6664 }
6665
6666 static unsigned int CharSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6667 {
6668 char value2 = op2->c;
6669
6670 exp->type = 2;
6671 exp->string = PrintChar(op1->c -= value2);
6672 if(!exp->expType)
6673 {
6674 exp->expType = op1->type;
6675 if(op1->type)
6676 op1->type->refCount++;
6677 }
6678 return 0x1;
6679 }
6680
6681 static unsigned int UCharSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6682 {
6683 unsigned char value2 = op2->uc;
6684
6685 exp->type = 2;
6686 exp->string = PrintUChar(op1->uc -= value2);
6687 if(!exp->expType)
6688 {
6689 exp->expType = op1->type;
6690 if(op1->type)
6691 op1->type->refCount++;
6692 }
6693 return 0x1;
6694 }
6695
6696 static unsigned int FloatSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6697 {
6698 float value2 = op2->f;
6699
6700 exp->type = 2;
6701 exp->string = PrintFloat(op1->f -= value2);
6702 if(!exp->expType)
6703 {
6704 exp->expType = op1->type;
6705 if(op1->type)
6706 op1->type->refCount++;
6707 }
6708 return 0x1;
6709 }
6710
6711 static unsigned int DoubleSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6712 {
6713 double value2 = op2->d;
6714
6715 exp->type = 2;
6716 exp->string = PrintDouble(op1->d -= value2);
6717 if(!exp->expType)
6718 {
6719 exp->expType = op1->type;
6720 if(op1->type)
6721 op1->type->refCount++;
6722 }
6723 return 0x1;
6724 }
6725
6726 static unsigned int IntMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6727 {
6728 int value2 = op2->i;
6729
6730 exp->type = 2;
6731 exp->string = PrintInt(op1->i *= value2);
6732 if(!exp->expType)
6733 {
6734 exp->expType = op1->type;
6735 if(op1->type)
6736 op1->type->refCount++;
6737 }
6738 return 0x1;
6739 }
6740
6741 static unsigned int UIntMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6742 {
6743 unsigned int value2 = op2->ui;
6744
6745 exp->type = 2;
6746 exp->string = PrintUInt(op1->ui *= value2);
6747 if(!exp->expType)
6748 {
6749 exp->expType = op1->type;
6750 if(op1->type)
6751 op1->type->refCount++;
6752 }
6753 return 0x1;
6754 }
6755
6756 static unsigned int ShortMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6757 {
6758 short value2 = op2->s;
6759
6760 exp->type = 2;
6761 exp->string = PrintShort(op1->s *= value2);
6762 if(!exp->expType)
6763 {
6764 exp->expType = op1->type;
6765 if(op1->type)
6766 op1->type->refCount++;
6767 }
6768 return 0x1;
6769 }
6770
6771 static unsigned int UShortMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6772 {
6773 unsigned short value2 = op2->us;
6774
6775 exp->type = 2;
6776 exp->string = PrintUShort(op1->us *= value2);
6777 if(!exp->expType)
6778 {
6779 exp->expType = op1->type;
6780 if(op1->type)
6781 op1->type->refCount++;
6782 }
6783 return 0x1;
6784 }
6785
6786 static unsigned int CharMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6787 {
6788 char value2 = op2->c;
6789
6790 exp->type = 2;
6791 exp->string = PrintChar(op1->c *= value2);
6792 if(!exp->expType)
6793 {
6794 exp->expType = op1->type;
6795 if(op1->type)
6796 op1->type->refCount++;
6797 }
6798 return 0x1;
6799 }
6800
6801 static unsigned int UCharMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6802 {
6803 unsigned char value2 = op2->uc;
6804
6805 exp->type = 2;
6806 exp->string = PrintUChar(op1->uc *= value2);
6807 if(!exp->expType)
6808 {
6809 exp->expType = op1->type;
6810 if(op1->type)
6811 op1->type->refCount++;
6812 }
6813 return 0x1;
6814 }
6815
6816 static unsigned int FloatMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6817 {
6818 float value2 = op2->f;
6819
6820 exp->type = 2;
6821 exp->string = PrintFloat(op1->f *= value2);
6822 if(!exp->expType)
6823 {
6824 exp->expType = op1->type;
6825 if(op1->type)
6826 op1->type->refCount++;
6827 }
6828 return 0x1;
6829 }
6830
6831 static unsigned int DoubleMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6832 {
6833 double value2 = op2->d;
6834
6835 exp->type = 2;
6836 exp->string = PrintDouble(op1->d *= value2);
6837 if(!exp->expType)
6838 {
6839 exp->expType = op1->type;
6840 if(op1->type)
6841 op1->type->refCount++;
6842 }
6843 return 0x1;
6844 }
6845
6846 static unsigned int IntDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6847 {
6848 int value2 = op2->i;
6849
6850 exp->type = 2;
6851 exp->string = PrintInt(value2 ? (op1->i /= value2) : 0);
6852 if(!exp->expType)
6853 {
6854 exp->expType = op1->type;
6855 if(op1->type)
6856 op1->type->refCount++;
6857 }
6858 return 0x1;
6859 }
6860
6861 static unsigned int UIntDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6862 {
6863 unsigned int value2 = op2->ui;
6864
6865 exp->type = 2;
6866 exp->string = PrintUInt(value2 ? (op1->ui /= value2) : 0);
6867 if(!exp->expType)
6868 {
6869 exp->expType = op1->type;
6870 if(op1->type)
6871 op1->type->refCount++;
6872 }
6873 return 0x1;
6874 }
6875
6876 static unsigned int ShortDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6877 {
6878 short value2 = op2->s;
6879
6880 exp->type = 2;
6881 exp->string = PrintShort(value2 ? (op1->s /= value2) : (short)0);
6882 if(!exp->expType)
6883 {
6884 exp->expType = op1->type;
6885 if(op1->type)
6886 op1->type->refCount++;
6887 }
6888 return 0x1;
6889 }
6890
6891 static unsigned int UShortDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6892 {
6893 unsigned short value2 = op2->us;
6894
6895 exp->type = 2;
6896 exp->string = PrintUShort(value2 ? (op1->us /= value2) : (unsigned short)0);
6897 if(!exp->expType)
6898 {
6899 exp->expType = op1->type;
6900 if(op1->type)
6901 op1->type->refCount++;
6902 }
6903 return 0x1;
6904 }
6905
6906 static unsigned int CharDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6907 {
6908 char value2 = op2->c;
6909
6910 exp->type = 2;
6911 exp->string = PrintChar(value2 ? (op1->c /= value2) : (char)0);
6912 if(!exp->expType)
6913 {
6914 exp->expType = op1->type;
6915 if(op1->type)
6916 op1->type->refCount++;
6917 }
6918 return 0x1;
6919 }
6920
6921 static unsigned int UCharDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6922 {
6923 unsigned char value2 = op2->uc;
6924
6925 exp->type = 2;
6926 exp->string = PrintUChar(value2 ? (op1->uc /= value2) : (unsigned char)0);
6927 if(!exp->expType)
6928 {
6929 exp->expType = op1->type;
6930 if(op1->type)
6931 op1->type->refCount++;
6932 }
6933 return 0x1;
6934 }
6935
6936 static unsigned int FloatDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6937 {
6938 float value2 = op2->f;
6939
6940 exp->type = 2;
6941 exp->string = PrintFloat(value2 ? (op1->f /= value2) : (float)0);
6942 if(!exp->expType)
6943 {
6944 exp->expType = op1->type;
6945 if(op1->type)
6946 op1->type->refCount++;
6947 }
6948 return 0x1;
6949 }
6950
6951 static unsigned int DoubleDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6952 {
6953 double value2 = op2->d;
6954
6955 exp->type = 2;
6956 exp->string = PrintDouble(value2 ? (op1->d /= value2) : (double)0);
6957 if(!exp->expType)
6958 {
6959 exp->expType = op1->type;
6960 if(op1->type)
6961 op1->type->refCount++;
6962 }
6963 return 0x1;
6964 }
6965
6966 static unsigned int IntModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6967 {
6968 int value2 = op2->i;
6969
6970 exp->type = 2;
6971 exp->string = PrintInt(value2 ? (op1->i %= value2) : 0);
6972 if(!exp->expType)
6973 {
6974 exp->expType = op1->type;
6975 if(op1->type)
6976 op1->type->refCount++;
6977 }
6978 return 0x1;
6979 }
6980
6981 static unsigned int UIntModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6982 {
6983 unsigned int value2 = op2->ui;
6984
6985 exp->type = 2;
6986 exp->string = PrintUInt(value2 ? (op1->ui %= value2) : 0);
6987 if(!exp->expType)
6988 {
6989 exp->expType = op1->type;
6990 if(op1->type)
6991 op1->type->refCount++;
6992 }
6993 return 0x1;
6994 }
6995
6996 static unsigned int ShortModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6997 {
6998 short value2 = op2->s;
6999
7000 exp->type = 2;
7001 exp->string = PrintShort(value2 ? (op1->s %= value2) : (short)0);
7002 if(!exp->expType)
7003 {
7004 exp->expType = op1->type;
7005 if(op1->type)
7006 op1->type->refCount++;
7007 }
7008 return 0x1;
7009 }
7010
7011 static unsigned int UShortModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7012 {
7013 unsigned short value2 = op2->us;
7014
7015 exp->type = 2;
7016 exp->string = PrintUShort(value2 ? (op1->us %= value2) : (unsigned short)0);
7017 if(!exp->expType)
7018 {
7019 exp->expType = op1->type;
7020 if(op1->type)
7021 op1->type->refCount++;
7022 }
7023 return 0x1;
7024 }
7025
7026 static unsigned int CharModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7027 {
7028 char value2 = op2->c;
7029
7030 exp->type = 2;
7031 exp->string = PrintChar(value2 ? (op1->c %= value2) : (char)0);
7032 if(!exp->expType)
7033 {
7034 exp->expType = op1->type;
7035 if(op1->type)
7036 op1->type->refCount++;
7037 }
7038 return 0x1;
7039 }
7040
7041 static unsigned int UCharModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7042 {
7043 unsigned char value2 = op2->uc;
7044
7045 exp->type = 2;
7046 exp->string = PrintUChar(value2 ? (op1->uc %= value2) : (unsigned char)0);
7047 if(!exp->expType)
7048 {
7049 exp->expType = op1->type;
7050 if(op1->type)
7051 op1->type->refCount++;
7052 }
7053 return 0x1;
7054 }
7055
7056 static unsigned int IntBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7057 {
7058 int value2 = op2->i;
7059
7060 exp->type = 2;
7061 exp->string = PrintInt(op1->i & value2);
7062 if(!exp->expType)
7063 {
7064 exp->expType = op1->type;
7065 if(op1->type)
7066 op1->type->refCount++;
7067 }
7068 return 0x1;
7069 }
7070
7071 static unsigned int UIntBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7072 {
7073 unsigned int value2 = op2->ui;
7074
7075 exp->type = 2;
7076 exp->string = PrintUInt(op1->ui & value2);
7077 if(!exp->expType)
7078 {
7079 exp->expType = op1->type;
7080 if(op1->type)
7081 op1->type->refCount++;
7082 }
7083 return 0x1;
7084 }
7085
7086 static unsigned int ShortBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7087 {
7088 short value2 = op2->s;
7089
7090 exp->type = 2;
7091 exp->string = PrintShort(op1->s & value2);
7092 if(!exp->expType)
7093 {
7094 exp->expType = op1->type;
7095 if(op1->type)
7096 op1->type->refCount++;
7097 }
7098 return 0x1;
7099 }
7100
7101 static unsigned int UShortBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7102 {
7103 unsigned short value2 = op2->us;
7104
7105 exp->type = 2;
7106 exp->string = PrintUShort(op1->us & value2);
7107 if(!exp->expType)
7108 {
7109 exp->expType = op1->type;
7110 if(op1->type)
7111 op1->type->refCount++;
7112 }
7113 return 0x1;
7114 }
7115
7116 static unsigned int CharBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7117 {
7118 char value2 = op2->c;
7119
7120 exp->type = 2;
7121 exp->string = PrintChar(op1->c & value2);
7122 if(!exp->expType)
7123 {
7124 exp->expType = op1->type;
7125 if(op1->type)
7126 op1->type->refCount++;
7127 }
7128 return 0x1;
7129 }
7130
7131 static unsigned int UCharBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7132 {
7133 unsigned char value2 = op2->uc;
7134
7135 exp->type = 2;
7136 exp->string = PrintUChar(op1->uc & value2);
7137 if(!exp->expType)
7138 {
7139 exp->expType = op1->type;
7140 if(op1->type)
7141 op1->type->refCount++;
7142 }
7143 return 0x1;
7144 }
7145
7146 static unsigned int IntBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7147 {
7148 int value2 = op2->i;
7149
7150 exp->type = 2;
7151 exp->string = PrintInt(op1->i | value2);
7152 if(!exp->expType)
7153 {
7154 exp->expType = op1->type;
7155 if(op1->type)
7156 op1->type->refCount++;
7157 }
7158 return 0x1;
7159 }
7160
7161 static unsigned int UIntBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7162 {
7163 unsigned int value2 = op2->ui;
7164
7165 exp->type = 2;
7166 exp->string = PrintUInt(op1->ui | value2);
7167 if(!exp->expType)
7168 {
7169 exp->expType = op1->type;
7170 if(op1->type)
7171 op1->type->refCount++;
7172 }
7173 return 0x1;
7174 }
7175
7176 static unsigned int ShortBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7177 {
7178 short value2 = op2->s;
7179
7180 exp->type = 2;
7181 exp->string = PrintShort(op1->s | value2);
7182 if(!exp->expType)
7183 {
7184 exp->expType = op1->type;
7185 if(op1->type)
7186 op1->type->refCount++;
7187 }
7188 return 0x1;
7189 }
7190
7191 static unsigned int UShortBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7192 {
7193 unsigned short value2 = op2->us;
7194
7195 exp->type = 2;
7196 exp->string = PrintUShort(op1->us | value2);
7197 if(!exp->expType)
7198 {
7199 exp->expType = op1->type;
7200 if(op1->type)
7201 op1->type->refCount++;
7202 }
7203 return 0x1;
7204 }
7205
7206 static unsigned int CharBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7207 {
7208 char value2 = op2->c;
7209
7210 exp->type = 2;
7211 exp->string = PrintChar(op1->c | value2);
7212 if(!exp->expType)
7213 {
7214 exp->expType = op1->type;
7215 if(op1->type)
7216 op1->type->refCount++;
7217 }
7218 return 0x1;
7219 }
7220
7221 static unsigned int UCharBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7222 {
7223 unsigned char value2 = op2->uc;
7224
7225 exp->type = 2;
7226 exp->string = PrintUChar(op1->uc | value2);
7227 if(!exp->expType)
7228 {
7229 exp->expType = op1->type;
7230 if(op1->type)
7231 op1->type->refCount++;
7232 }
7233 return 0x1;
7234 }
7235
7236 static unsigned int IntBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7237 {
7238 int value2 = op2->i;
7239
7240 exp->type = 2;
7241 exp->string = PrintInt(op1->i ^ value2);
7242 if(!exp->expType)
7243 {
7244 exp->expType = op1->type;
7245 if(op1->type)
7246 op1->type->refCount++;
7247 }
7248 return 0x1;
7249 }
7250
7251 static unsigned int UIntBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7252 {
7253 unsigned int value2 = op2->ui;
7254
7255 exp->type = 2;
7256 exp->string = PrintUInt(op1->ui ^ value2);
7257 if(!exp->expType)
7258 {
7259 exp->expType = op1->type;
7260 if(op1->type)
7261 op1->type->refCount++;
7262 }
7263 return 0x1;
7264 }
7265
7266 static unsigned int ShortBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7267 {
7268 short value2 = op2->s;
7269
7270 exp->type = 2;
7271 exp->string = PrintShort(op1->s ^ value2);
7272 if(!exp->expType)
7273 {
7274 exp->expType = op1->type;
7275 if(op1->type)
7276 op1->type->refCount++;
7277 }
7278 return 0x1;
7279 }
7280
7281 static unsigned int UShortBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7282 {
7283 unsigned short value2 = op2->us;
7284
7285 exp->type = 2;
7286 exp->string = PrintUShort(op1->us ^ value2);
7287 if(!exp->expType)
7288 {
7289 exp->expType = op1->type;
7290 if(op1->type)
7291 op1->type->refCount++;
7292 }
7293 return 0x1;
7294 }
7295
7296 static unsigned int CharBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7297 {
7298 char value2 = op2->c;
7299
7300 exp->type = 2;
7301 exp->string = PrintChar(op1->c ^ value2);
7302 if(!exp->expType)
7303 {
7304 exp->expType = op1->type;
7305 if(op1->type)
7306 op1->type->refCount++;
7307 }
7308 return 0x1;
7309 }
7310
7311 static unsigned int UCharBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7312 {
7313 unsigned char value2 = op2->uc;
7314
7315 exp->type = 2;
7316 exp->string = PrintUChar(op1->uc ^ value2);
7317 if(!exp->expType)
7318 {
7319 exp->expType = op1->type;
7320 if(op1->type)
7321 op1->type->refCount++;
7322 }
7323 return 0x1;
7324 }
7325
7326 static unsigned int IntLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7327 {
7328 int value2 = op2->i;
7329
7330 exp->type = 2;
7331 exp->string = PrintInt(op1->i << value2);
7332 if(!exp->expType)
7333 {
7334 exp->expType = op1->type;
7335 if(op1->type)
7336 op1->type->refCount++;
7337 }
7338 return 0x1;
7339 }
7340
7341 static unsigned int UIntLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7342 {
7343 unsigned int value2 = op2->ui;
7344
7345 exp->type = 2;
7346 exp->string = PrintUInt(op1->ui << value2);
7347 if(!exp->expType)
7348 {
7349 exp->expType = op1->type;
7350 if(op1->type)
7351 op1->type->refCount++;
7352 }
7353 return 0x1;
7354 }
7355
7356 static unsigned int ShortLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7357 {
7358 short value2 = op2->s;
7359
7360 exp->type = 2;
7361 exp->string = PrintShort(op1->s << value2);
7362 if(!exp->expType)
7363 {
7364 exp->expType = op1->type;
7365 if(op1->type)
7366 op1->type->refCount++;
7367 }
7368 return 0x1;
7369 }
7370
7371 static unsigned int UShortLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7372 {
7373 unsigned short value2 = op2->us;
7374
7375 exp->type = 2;
7376 exp->string = PrintUShort(op1->us << value2);
7377 if(!exp->expType)
7378 {
7379 exp->expType = op1->type;
7380 if(op1->type)
7381 op1->type->refCount++;
7382 }
7383 return 0x1;
7384 }
7385
7386 static unsigned int CharLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7387 {
7388 char value2 = op2->c;
7389
7390 exp->type = 2;
7391 exp->string = PrintChar(op1->c << value2);
7392 if(!exp->expType)
7393 {
7394 exp->expType = op1->type;
7395 if(op1->type)
7396 op1->type->refCount++;
7397 }
7398 return 0x1;
7399 }
7400
7401 static unsigned int UCharLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7402 {
7403 unsigned char value2 = op2->uc;
7404
7405 exp->type = 2;
7406 exp->string = PrintUChar(op1->uc << value2);
7407 if(!exp->expType)
7408 {
7409 exp->expType = op1->type;
7410 if(op1->type)
7411 op1->type->refCount++;
7412 }
7413 return 0x1;
7414 }
7415
7416 static unsigned int IntRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7417 {
7418 int value2 = op2->i;
7419
7420 exp->type = 2;
7421 exp->string = PrintInt(op1->i >> value2);
7422 if(!exp->expType)
7423 {
7424 exp->expType = op1->type;
7425 if(op1->type)
7426 op1->type->refCount++;
7427 }
7428 return 0x1;
7429 }
7430
7431 static unsigned int UIntRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7432 {
7433 unsigned int value2 = op2->ui;
7434
7435 exp->type = 2;
7436 exp->string = PrintUInt(op1->ui >> value2);
7437 if(!exp->expType)
7438 {
7439 exp->expType = op1->type;
7440 if(op1->type)
7441 op1->type->refCount++;
7442 }
7443 return 0x1;
7444 }
7445
7446 static unsigned int ShortRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7447 {
7448 short value2 = op2->s;
7449
7450 exp->type = 2;
7451 exp->string = PrintShort(op1->s >> value2);
7452 if(!exp->expType)
7453 {
7454 exp->expType = op1->type;
7455 if(op1->type)
7456 op1->type->refCount++;
7457 }
7458 return 0x1;
7459 }
7460
7461 static unsigned int UShortRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7462 {
7463 unsigned short value2 = op2->us;
7464
7465 exp->type = 2;
7466 exp->string = PrintUShort(op1->us >> value2);
7467 if(!exp->expType)
7468 {
7469 exp->expType = op1->type;
7470 if(op1->type)
7471 op1->type->refCount++;
7472 }
7473 return 0x1;
7474 }
7475
7476 static unsigned int CharRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7477 {
7478 char value2 = op2->c;
7479
7480 exp->type = 2;
7481 exp->string = PrintChar(op1->c >> value2);
7482 if(!exp->expType)
7483 {
7484 exp->expType = op1->type;
7485 if(op1->type)
7486 op1->type->refCount++;
7487 }
7488 return 0x1;
7489 }
7490
7491 static unsigned int UCharRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7492 {
7493 unsigned char value2 = op2->uc;
7494
7495 exp->type = 2;
7496 exp->string = PrintUChar(op1->uc >> value2);
7497 if(!exp->expType)
7498 {
7499 exp->expType = op1->type;
7500 if(op1->type)
7501 op1->type->refCount++;
7502 }
7503 return 0x1;
7504 }
7505
7506 static unsigned int IntBitNot(struct Expression * exp, struct Operand * op1)
7507 {
7508 exp->type = 2;
7509 exp->string = PrintInt(~op1->i);
7510 if(!exp->expType)
7511 {
7512 exp->expType = op1->type;
7513 if(op1->type)
7514 op1->type->refCount++;
7515 }
7516 return 0x1;
7517 }
7518
7519 static unsigned int UIntBitNot(struct Expression * exp, struct Operand * op1)
7520 {
7521 exp->type = 2;
7522 exp->string = PrintUInt(~op1->ui);
7523 if(!exp->expType)
7524 {
7525 exp->expType = op1->type;
7526 if(op1->type)
7527 op1->type->refCount++;
7528 }
7529 return 0x1;
7530 }
7531
7532 static unsigned int ShortBitNot(struct Expression * exp, struct Operand * op1)
7533 {
7534 exp->type = 2;
7535 exp->string = PrintShort(~op1->s);
7536 if(!exp->expType)
7537 {
7538 exp->expType = op1->type;
7539 if(op1->type)
7540 op1->type->refCount++;
7541 }
7542 return 0x1;
7543 }
7544
7545 static unsigned int UShortBitNot(struct Expression * exp, struct Operand * op1)
7546 {
7547 exp->type = 2;
7548 exp->string = PrintUShort(~op1->us);
7549 if(!exp->expType)
7550 {
7551 exp->expType = op1->type;
7552 if(op1->type)
7553 op1->type->refCount++;
7554 }
7555 return 0x1;
7556 }
7557
7558 static unsigned int CharBitNot(struct Expression * exp, struct Operand * op1)
7559 {
7560 exp->type = 2;
7561 exp->string = PrintChar(~op1->c);
7562 if(!exp->expType)
7563 {
7564 exp->expType = op1->type;
7565 if(op1->type)
7566 op1->type->refCount++;
7567 }
7568 return 0x1;
7569 }
7570
7571 static unsigned int UCharBitNot(struct Expression * exp, struct Operand * op1)
7572 {
7573 exp->type = 2;
7574 exp->string = PrintUChar(~op1->uc);
7575 if(!exp->expType)
7576 {
7577 exp->expType = op1->type;
7578 if(op1->type)
7579 op1->type->refCount++;
7580 }
7581 return 0x1;
7582 }
7583
7584 static unsigned int IntAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7585 {
7586 int value2 = op2->i;
7587
7588 exp->type = 2;
7589 exp->string = PrintInt(op1->i &= value2);
7590 if(!exp->expType)
7591 {
7592 exp->expType = op1->type;
7593 if(op1->type)
7594 op1->type->refCount++;
7595 }
7596 return 0x1;
7597 }
7598
7599 static unsigned int UIntAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7600 {
7601 unsigned int value2 = op2->ui;
7602
7603 exp->type = 2;
7604 exp->string = PrintUInt(op1->ui &= value2);
7605 if(!exp->expType)
7606 {
7607 exp->expType = op1->type;
7608 if(op1->type)
7609 op1->type->refCount++;
7610 }
7611 return 0x1;
7612 }
7613
7614 static unsigned int ShortAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7615 {
7616 short value2 = op2->s;
7617
7618 exp->type = 2;
7619 exp->string = PrintShort(op1->s &= value2);
7620 if(!exp->expType)
7621 {
7622 exp->expType = op1->type;
7623 if(op1->type)
7624 op1->type->refCount++;
7625 }
7626 return 0x1;
7627 }
7628
7629 static unsigned int UShortAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7630 {
7631 unsigned short value2 = op2->us;
7632
7633 exp->type = 2;
7634 exp->string = PrintUShort(op1->us &= value2);
7635 if(!exp->expType)
7636 {
7637 exp->expType = op1->type;
7638 if(op1->type)
7639 op1->type->refCount++;
7640 }
7641 return 0x1;
7642 }
7643
7644 static unsigned int CharAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7645 {
7646 char value2 = op2->c;
7647
7648 exp->type = 2;
7649 exp->string = PrintChar(op1->c &= value2);
7650 if(!exp->expType)
7651 {
7652 exp->expType = op1->type;
7653 if(op1->type)
7654 op1->type->refCount++;
7655 }
7656 return 0x1;
7657 }
7658
7659 static unsigned int UCharAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7660 {
7661 unsigned char value2 = op2->uc;
7662
7663 exp->type = 2;
7664 exp->string = PrintUChar(op1->uc &= value2);
7665 if(!exp->expType)
7666 {
7667 exp->expType = op1->type;
7668 if(op1->type)
7669 op1->type->refCount++;
7670 }
7671 return 0x1;
7672 }
7673
7674 static unsigned int IntOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7675 {
7676 int value2 = op2->i;
7677
7678 exp->type = 2;
7679 exp->string = PrintInt(op1->i |= value2);
7680 if(!exp->expType)
7681 {
7682 exp->expType = op1->type;
7683 if(op1->type)
7684 op1->type->refCount++;
7685 }
7686 return 0x1;
7687 }
7688
7689 static unsigned int UIntOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7690 {
7691 unsigned int value2 = op2->ui;
7692
7693 exp->type = 2;
7694 exp->string = PrintUInt(op1->ui |= value2);
7695 if(!exp->expType)
7696 {
7697 exp->expType = op1->type;
7698 if(op1->type)
7699 op1->type->refCount++;
7700 }
7701 return 0x1;
7702 }
7703
7704 static unsigned int ShortOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7705 {
7706 short value2 = op2->s;
7707
7708 exp->type = 2;
7709 exp->string = PrintShort(op1->s |= value2);
7710 if(!exp->expType)
7711 {
7712 exp->expType = op1->type;
7713 if(op1->type)
7714 op1->type->refCount++;
7715 }
7716 return 0x1;
7717 }
7718
7719 static unsigned int UShortOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7720 {
7721 unsigned short value2 = op2->us;
7722
7723 exp->type = 2;
7724 exp->string = PrintUShort(op1->us |= value2);
7725 if(!exp->expType)
7726 {
7727 exp->expType = op1->type;
7728 if(op1->type)
7729 op1->type->refCount++;
7730 }
7731 return 0x1;
7732 }
7733
7734 static unsigned int CharOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7735 {
7736 char value2 = op2->c;
7737
7738 exp->type = 2;
7739 exp->string = PrintChar(op1->c |= value2);
7740 if(!exp->expType)
7741 {
7742 exp->expType = op1->type;
7743 if(op1->type)
7744 op1->type->refCount++;
7745 }
7746 return 0x1;
7747 }
7748
7749 static unsigned int UCharOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7750 {
7751 unsigned char value2 = op2->uc;
7752
7753 exp->type = 2;
7754 exp->string = PrintUChar(op1->uc |= value2);
7755 if(!exp->expType)
7756 {
7757 exp->expType = op1->type;
7758 if(op1->type)
7759 op1->type->refCount++;
7760 }
7761 return 0x1;
7762 }
7763
7764 static unsigned int IntXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7765 {
7766 int value2 = op2->i;
7767
7768 exp->type = 2;
7769 exp->string = PrintInt(op1->i ^= value2);
7770 if(!exp->expType)
7771 {
7772 exp->expType = op1->type;
7773 if(op1->type)
7774 op1->type->refCount++;
7775 }
7776 return 0x1;
7777 }
7778
7779 static unsigned int UIntXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7780 {
7781 unsigned int value2 = op2->ui;
7782
7783 exp->type = 2;
7784 exp->string = PrintUInt(op1->ui ^= value2);
7785 if(!exp->expType)
7786 {
7787 exp->expType = op1->type;
7788 if(op1->type)
7789 op1->type->refCount++;
7790 }
7791 return 0x1;
7792 }
7793
7794 static unsigned int ShortXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7795 {
7796 short value2 = op2->s;
7797
7798 exp->type = 2;
7799 exp->string = PrintShort(op1->s ^= value2);
7800 if(!exp->expType)
7801 {
7802 exp->expType = op1->type;
7803 if(op1->type)
7804 op1->type->refCount++;
7805 }
7806 return 0x1;
7807 }
7808
7809 static unsigned int UShortXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7810 {
7811 unsigned short value2 = op2->us;
7812
7813 exp->type = 2;
7814 exp->string = PrintUShort(op1->us ^= value2);
7815 if(!exp->expType)
7816 {
7817 exp->expType = op1->type;
7818 if(op1->type)
7819 op1->type->refCount++;
7820 }
7821 return 0x1;
7822 }
7823
7824 static unsigned int CharXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7825 {
7826 char value2 = op2->c;
7827
7828 exp->type = 2;
7829 exp->string = PrintChar(op1->c ^= value2);
7830 if(!exp->expType)
7831 {
7832 exp->expType = op1->type;
7833 if(op1->type)
7834 op1->type->refCount++;
7835 }
7836 return 0x1;
7837 }
7838
7839 static unsigned int UCharXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7840 {
7841 unsigned char value2 = op2->uc;
7842
7843 exp->type = 2;
7844 exp->string = PrintUChar(op1->uc ^= value2);
7845 if(!exp->expType)
7846 {
7847 exp->expType = op1->type;
7848 if(op1->type)
7849 op1->type->refCount++;
7850 }
7851 return 0x1;
7852 }
7853
7854 static unsigned int IntLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7855 {
7856 int value2 = op2->i;
7857
7858 exp->type = 2;
7859 exp->string = PrintInt(op1->i <<= value2);
7860 if(!exp->expType)
7861 {
7862 exp->expType = op1->type;
7863 if(op1->type)
7864 op1->type->refCount++;
7865 }
7866 return 0x1;
7867 }
7868
7869 static unsigned int UIntLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7870 {
7871 unsigned int value2 = op2->ui;
7872
7873 exp->type = 2;
7874 exp->string = PrintUInt(op1->ui <<= value2);
7875 if(!exp->expType)
7876 {
7877 exp->expType = op1->type;
7878 if(op1->type)
7879 op1->type->refCount++;
7880 }
7881 return 0x1;
7882 }
7883
7884 static unsigned int ShortLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7885 {
7886 short value2 = op2->s;
7887
7888 exp->type = 2;
7889 exp->string = PrintShort(op1->s <<= value2);
7890 if(!exp->expType)
7891 {
7892 exp->expType = op1->type;
7893 if(op1->type)
7894 op1->type->refCount++;
7895 }
7896 return 0x1;
7897 }
7898
7899 static unsigned int UShortLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7900 {
7901 unsigned short value2 = op2->us;
7902
7903 exp->type = 2;
7904 exp->string = PrintUShort(op1->us <<= value2);
7905 if(!exp->expType)
7906 {
7907 exp->expType = op1->type;
7908 if(op1->type)
7909 op1->type->refCount++;
7910 }
7911 return 0x1;
7912 }
7913
7914 static unsigned int CharLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7915 {
7916 char value2 = op2->c;
7917
7918 exp->type = 2;
7919 exp->string = PrintChar(op1->c <<= value2);
7920 if(!exp->expType)
7921 {
7922 exp->expType = op1->type;
7923 if(op1->type)
7924 op1->type->refCount++;
7925 }
7926 return 0x1;
7927 }
7928
7929 static unsigned int UCharLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7930 {
7931 unsigned char value2 = op2->uc;
7932
7933 exp->type = 2;
7934 exp->string = PrintUChar(op1->uc <<= value2);
7935 if(!exp->expType)
7936 {
7937 exp->expType = op1->type;
7938 if(op1->type)
7939 op1->type->refCount++;
7940 }
7941 return 0x1;
7942 }
7943
7944 static unsigned int IntRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7945 {
7946 int value2 = op2->i;
7947
7948 exp->type = 2;
7949 exp->string = PrintInt(op1->i >>= value2);
7950 if(!exp->expType)
7951 {
7952 exp->expType = op1->type;
7953 if(op1->type)
7954 op1->type->refCount++;
7955 }
7956 return 0x1;
7957 }
7958
7959 static unsigned int UIntRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7960 {
7961 unsigned int value2 = op2->ui;
7962
7963 exp->type = 2;
7964 exp->string = PrintUInt(op1->ui >>= value2);
7965 if(!exp->expType)
7966 {
7967 exp->expType = op1->type;
7968 if(op1->type)
7969 op1->type->refCount++;
7970 }
7971 return 0x1;
7972 }
7973
7974 static unsigned int ShortRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7975 {
7976 short value2 = op2->s;
7977
7978 exp->type = 2;
7979 exp->string = PrintShort(op1->s >>= value2);
7980 if(!exp->expType)
7981 {
7982 exp->expType = op1->type;
7983 if(op1->type)
7984 op1->type->refCount++;
7985 }
7986 return 0x1;
7987 }
7988
7989 static unsigned int UShortRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7990 {
7991 unsigned short value2 = op2->us;
7992
7993 exp->type = 2;
7994 exp->string = PrintUShort(op1->us >>= value2);
7995 if(!exp->expType)
7996 {
7997 exp->expType = op1->type;
7998 if(op1->type)
7999 op1->type->refCount++;
8000 }
8001 return 0x1;
8002 }
8003
8004 static unsigned int CharRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8005 {
8006 char value2 = op2->c;
8007
8008 exp->type = 2;
8009 exp->string = PrintChar(op1->c >>= value2);
8010 if(!exp->expType)
8011 {
8012 exp->expType = op1->type;
8013 if(op1->type)
8014 op1->type->refCount++;
8015 }
8016 return 0x1;
8017 }
8018
8019 static unsigned int UCharRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8020 {
8021 unsigned char value2 = op2->uc;
8022
8023 exp->type = 2;
8024 exp->string = PrintUChar(op1->uc >>= value2);
8025 if(!exp->expType)
8026 {
8027 exp->expType = op1->type;
8028 if(op1->type)
8029 op1->type->refCount++;
8030 }
8031 return 0x1;
8032 }
8033
8034 static unsigned int IntNot(struct Expression * exp, struct Operand * op1)
8035 {
8036 exp->type = 2;
8037 exp->string = PrintInt(!op1->i);
8038 if(!exp->expType)
8039 {
8040 exp->expType = op1->type;
8041 if(op1->type)
8042 op1->type->refCount++;
8043 }
8044 return 0x1;
8045 }
8046
8047 static unsigned int UIntNot(struct Expression * exp, struct Operand * op1)
8048 {
8049 exp->type = 2;
8050 exp->string = PrintUInt(!op1->ui);
8051 if(!exp->expType)
8052 {
8053 exp->expType = op1->type;
8054 if(op1->type)
8055 op1->type->refCount++;
8056 }
8057 return 0x1;
8058 }
8059
8060 static unsigned int ShortNot(struct Expression * exp, struct Operand * op1)
8061 {
8062 exp->type = 2;
8063 exp->string = PrintShort(!op1->s);
8064 if(!exp->expType)
8065 {
8066 exp->expType = op1->type;
8067 if(op1->type)
8068 op1->type->refCount++;
8069 }
8070 return 0x1;
8071 }
8072
8073 static unsigned int UShortNot(struct Expression * exp, struct Operand * op1)
8074 {
8075 exp->type = 2;
8076 exp->string = PrintUShort(!op1->us);
8077 if(!exp->expType)
8078 {
8079 exp->expType = op1->type;
8080 if(op1->type)
8081 op1->type->refCount++;
8082 }
8083 return 0x1;
8084 }
8085
8086 static unsigned int CharNot(struct Expression * exp, struct Operand * op1)
8087 {
8088 exp->type = 2;
8089 exp->string = PrintChar(!op1->c);
8090 if(!exp->expType)
8091 {
8092 exp->expType = op1->type;
8093 if(op1->type)
8094 op1->type->refCount++;
8095 }
8096 return 0x1;
8097 }
8098
8099 static unsigned int UCharNot(struct Expression * exp, struct Operand * op1)
8100 {
8101 exp->type = 2;
8102 exp->string = PrintUChar(!op1->uc);
8103 if(!exp->expType)
8104 {
8105 exp->expType = op1->type;
8106 if(op1->type)
8107 op1->type->refCount++;
8108 }
8109 return 0x1;
8110 }
8111
8112 static unsigned int IntEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8113 {
8114 int value2 = op2->i;
8115
8116 exp->type = 2;
8117 exp->string = PrintInt(op1->i == value2);
8118 if(!exp->expType)
8119 {
8120 exp->expType = op1->type;
8121 if(op1->type)
8122 op1->type->refCount++;
8123 }
8124 return 0x1;
8125 }
8126
8127 static unsigned int UIntEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8128 {
8129 unsigned int value2 = op2->ui;
8130
8131 exp->type = 2;
8132 exp->string = PrintUInt(op1->ui == value2);
8133 if(!exp->expType)
8134 {
8135 exp->expType = op1->type;
8136 if(op1->type)
8137 op1->type->refCount++;
8138 }
8139 return 0x1;
8140 }
8141
8142 static unsigned int ShortEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8143 {
8144 short value2 = op2->s;
8145
8146 exp->type = 2;
8147 exp->string = PrintShort(op1->s == value2);
8148 if(!exp->expType)
8149 {
8150 exp->expType = op1->type;
8151 if(op1->type)
8152 op1->type->refCount++;
8153 }
8154 return 0x1;
8155 }
8156
8157 static unsigned int UShortEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8158 {
8159 unsigned short value2 = op2->us;
8160
8161 exp->type = 2;
8162 exp->string = PrintUShort(op1->us == value2);
8163 if(!exp->expType)
8164 {
8165 exp->expType = op1->type;
8166 if(op1->type)
8167 op1->type->refCount++;
8168 }
8169 return 0x1;
8170 }
8171
8172 static unsigned int CharEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8173 {
8174 char value2 = op2->c;
8175
8176 exp->type = 2;
8177 exp->string = PrintChar(op1->c == value2);
8178 if(!exp->expType)
8179 {
8180 exp->expType = op1->type;
8181 if(op1->type)
8182 op1->type->refCount++;
8183 }
8184 return 0x1;
8185 }
8186
8187 static unsigned int UCharEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8188 {
8189 unsigned char value2 = op2->uc;
8190
8191 exp->type = 2;
8192 exp->string = PrintUChar(op1->uc == value2);
8193 if(!exp->expType)
8194 {
8195 exp->expType = op1->type;
8196 if(op1->type)
8197 op1->type->refCount++;
8198 }
8199 return 0x1;
8200 }
8201
8202 static unsigned int FloatEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8203 {
8204 float value2 = op2->f;
8205
8206 exp->type = 2;
8207 exp->string = PrintFloat(op1->f == value2);
8208 if(!exp->expType)
8209 {
8210 exp->expType = op1->type;
8211 if(op1->type)
8212 op1->type->refCount++;
8213 }
8214 return 0x1;
8215 }
8216
8217 static unsigned int DoubleEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8218 {
8219 double value2 = op2->d;
8220
8221 exp->type = 2;
8222 exp->string = PrintDouble(op1->d == value2);
8223 if(!exp->expType)
8224 {
8225 exp->expType = op1->type;
8226 if(op1->type)
8227 op1->type->refCount++;
8228 }
8229 return 0x1;
8230 }
8231
8232 static unsigned int IntNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8233 {
8234 int value2 = op2->i;
8235
8236 exp->type = 2;
8237 exp->string = PrintInt(op1->i != value2);
8238 if(!exp->expType)
8239 {
8240 exp->expType = op1->type;
8241 if(op1->type)
8242 op1->type->refCount++;
8243 }
8244 return 0x1;
8245 }
8246
8247 static unsigned int UIntNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8248 {
8249 unsigned int value2 = op2->ui;
8250
8251 exp->type = 2;
8252 exp->string = PrintUInt(op1->ui != value2);
8253 if(!exp->expType)
8254 {
8255 exp->expType = op1->type;
8256 if(op1->type)
8257 op1->type->refCount++;
8258 }
8259 return 0x1;
8260 }
8261
8262 static unsigned int ShortNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8263 {
8264 short value2 = op2->s;
8265
8266 exp->type = 2;
8267 exp->string = PrintShort(op1->s != value2);
8268 if(!exp->expType)
8269 {
8270 exp->expType = op1->type;
8271 if(op1->type)
8272 op1->type->refCount++;
8273 }
8274 return 0x1;
8275 }
8276
8277 static unsigned int UShortNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8278 {
8279 unsigned short value2 = op2->us;
8280
8281 exp->type = 2;
8282 exp->string = PrintUShort(op1->us != value2);
8283 if(!exp->expType)
8284 {
8285 exp->expType = op1->type;
8286 if(op1->type)
8287 op1->type->refCount++;
8288 }
8289 return 0x1;
8290 }
8291
8292 static unsigned int CharNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8293 {
8294 char value2 = op2->c;
8295
8296 exp->type = 2;
8297 exp->string = PrintChar(op1->c != value2);
8298 if(!exp->expType)
8299 {
8300 exp->expType = op1->type;
8301 if(op1->type)
8302 op1->type->refCount++;
8303 }
8304 return 0x1;
8305 }
8306
8307 static unsigned int UCharNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8308 {
8309 unsigned char value2 = op2->uc;
8310
8311 exp->type = 2;
8312 exp->string = PrintUChar(op1->uc != value2);
8313 if(!exp->expType)
8314 {
8315 exp->expType = op1->type;
8316 if(op1->type)
8317 op1->type->refCount++;
8318 }
8319 return 0x1;
8320 }
8321
8322 static unsigned int FloatNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8323 {
8324 float value2 = op2->f;
8325
8326 exp->type = 2;
8327 exp->string = PrintFloat(op1->f != value2);
8328 if(!exp->expType)
8329 {
8330 exp->expType = op1->type;
8331 if(op1->type)
8332 op1->type->refCount++;
8333 }
8334 return 0x1;
8335 }
8336
8337 static unsigned int DoubleNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8338 {
8339 double value2 = op2->d;
8340
8341 exp->type = 2;
8342 exp->string = PrintDouble(op1->d != value2);
8343 if(!exp->expType)
8344 {
8345 exp->expType = op1->type;
8346 if(op1->type)
8347 op1->type->refCount++;
8348 }
8349 return 0x1;
8350 }
8351
8352 static unsigned int IntAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8353 {
8354 int value2 = op2->i;
8355
8356 exp->type = 2;
8357 exp->string = PrintInt(op1->i && value2);
8358 if(!exp->expType)
8359 {
8360 exp->expType = op1->type;
8361 if(op1->type)
8362 op1->type->refCount++;
8363 }
8364 return 0x1;
8365 }
8366
8367 static unsigned int UIntAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8368 {
8369 unsigned int value2 = op2->ui;
8370
8371 exp->type = 2;
8372 exp->string = PrintUInt(op1->ui && value2);
8373 if(!exp->expType)
8374 {
8375 exp->expType = op1->type;
8376 if(op1->type)
8377 op1->type->refCount++;
8378 }
8379 return 0x1;
8380 }
8381
8382 static unsigned int ShortAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8383 {
8384 short value2 = op2->s;
8385
8386 exp->type = 2;
8387 exp->string = PrintShort(op1->s && value2);
8388 if(!exp->expType)
8389 {
8390 exp->expType = op1->type;
8391 if(op1->type)
8392 op1->type->refCount++;
8393 }
8394 return 0x1;
8395 }
8396
8397 static unsigned int UShortAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8398 {
8399 unsigned short value2 = op2->us;
8400
8401 exp->type = 2;
8402 exp->string = PrintUShort(op1->us && value2);
8403 if(!exp->expType)
8404 {
8405 exp->expType = op1->type;
8406 if(op1->type)
8407 op1->type->refCount++;
8408 }
8409 return 0x1;
8410 }
8411
8412 static unsigned int CharAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8413 {
8414 char value2 = op2->c;
8415
8416 exp->type = 2;
8417 exp->string = PrintChar(op1->c && value2);
8418 if(!exp->expType)
8419 {
8420 exp->expType = op1->type;
8421 if(op1->type)
8422 op1->type->refCount++;
8423 }
8424 return 0x1;
8425 }
8426
8427 static unsigned int UCharAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8428 {
8429 unsigned char value2 = op2->uc;
8430
8431 exp->type = 2;
8432 exp->string = PrintUChar(op1->uc && value2);
8433 if(!exp->expType)
8434 {
8435 exp->expType = op1->type;
8436 if(op1->type)
8437 op1->type->refCount++;
8438 }
8439 return 0x1;
8440 }
8441
8442 static unsigned int FloatAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8443 {
8444 float value2 = op2->f;
8445
8446 exp->type = 2;
8447 exp->string = PrintFloat(op1->f && value2);
8448 if(!exp->expType)
8449 {
8450 exp->expType = op1->type;
8451 if(op1->type)
8452 op1->type->refCount++;
8453 }
8454 return 0x1;
8455 }
8456
8457 static unsigned int DoubleAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8458 {
8459 double value2 = op2->d;
8460
8461 exp->type = 2;
8462 exp->string = PrintDouble(op1->d && value2);
8463 if(!exp->expType)
8464 {
8465 exp->expType = op1->type;
8466 if(op1->type)
8467 op1->type->refCount++;
8468 }
8469 return 0x1;
8470 }
8471
8472 static unsigned int IntOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8473 {
8474 int value2 = op2->i;
8475
8476 exp->type = 2;
8477 exp->string = PrintInt(op1->i || value2);
8478 if(!exp->expType)
8479 {
8480 exp->expType = op1->type;
8481 if(op1->type)
8482 op1->type->refCount++;
8483 }
8484 return 0x1;
8485 }
8486
8487 static unsigned int UIntOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8488 {
8489 unsigned int value2 = op2->ui;
8490
8491 exp->type = 2;
8492 exp->string = PrintUInt(op1->ui || value2);
8493 if(!exp->expType)
8494 {
8495 exp->expType = op1->type;
8496 if(op1->type)
8497 op1->type->refCount++;
8498 }
8499 return 0x1;
8500 }
8501
8502 static unsigned int ShortOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8503 {
8504 short value2 = op2->s;
8505
8506 exp->type = 2;
8507 exp->string = PrintShort(op1->s || value2);
8508 if(!exp->expType)
8509 {
8510 exp->expType = op1->type;
8511 if(op1->type)
8512 op1->type->refCount++;
8513 }
8514 return 0x1;
8515 }
8516
8517 static unsigned int UShortOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8518 {
8519 unsigned short value2 = op2->us;
8520
8521 exp->type = 2;
8522 exp->string = PrintUShort(op1->us || value2);
8523 if(!exp->expType)
8524 {
8525 exp->expType = op1->type;
8526 if(op1->type)
8527 op1->type->refCount++;
8528 }
8529 return 0x1;
8530 }
8531
8532 static unsigned int CharOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8533 {
8534 char value2 = op2->c;
8535
8536 exp->type = 2;
8537 exp->string = PrintChar(op1->c || value2);
8538 if(!exp->expType)
8539 {
8540 exp->expType = op1->type;
8541 if(op1->type)
8542 op1->type->refCount++;
8543 }
8544 return 0x1;
8545 }
8546
8547 static unsigned int UCharOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8548 {
8549 unsigned char value2 = op2->uc;
8550
8551 exp->type = 2;
8552 exp->string = PrintUChar(op1->uc || value2);
8553 if(!exp->expType)
8554 {
8555 exp->expType = op1->type;
8556 if(op1->type)
8557 op1->type->refCount++;
8558 }
8559 return 0x1;
8560 }
8561
8562 static unsigned int FloatOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8563 {
8564 float value2 = op2->f;
8565
8566 exp->type = 2;
8567 exp->string = PrintFloat(op1->f || value2);
8568 if(!exp->expType)
8569 {
8570 exp->expType = op1->type;
8571 if(op1->type)
8572 op1->type->refCount++;
8573 }
8574 return 0x1;
8575 }
8576
8577 static unsigned int DoubleOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8578 {
8579 double value2 = op2->d;
8580
8581 exp->type = 2;
8582 exp->string = PrintDouble(op1->d || value2);
8583 if(!exp->expType)
8584 {
8585 exp->expType = op1->type;
8586 if(op1->type)
8587 op1->type->refCount++;
8588 }
8589 return 0x1;
8590 }
8591
8592 static unsigned int IntGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8593 {
8594 int value2 = op2->i;
8595
8596 exp->type = 2;
8597 exp->string = PrintInt(op1->i > value2);
8598 if(!exp->expType)
8599 {
8600 exp->expType = op1->type;
8601 if(op1->type)
8602 op1->type->refCount++;
8603 }
8604 return 0x1;
8605 }
8606
8607 static unsigned int UIntGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8608 {
8609 unsigned int value2 = op2->ui;
8610
8611 exp->type = 2;
8612 exp->string = PrintUInt(op1->ui > value2);
8613 if(!exp->expType)
8614 {
8615 exp->expType = op1->type;
8616 if(op1->type)
8617 op1->type->refCount++;
8618 }
8619 return 0x1;
8620 }
8621
8622 static unsigned int ShortGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8623 {
8624 short value2 = op2->s;
8625
8626 exp->type = 2;
8627 exp->string = PrintShort(op1->s > value2);
8628 if(!exp->expType)
8629 {
8630 exp->expType = op1->type;
8631 if(op1->type)
8632 op1->type->refCount++;
8633 }
8634 return 0x1;
8635 }
8636
8637 static unsigned int UShortGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8638 {
8639 unsigned short value2 = op2->us;
8640
8641 exp->type = 2;
8642 exp->string = PrintUShort(op1->us > value2);
8643 if(!exp->expType)
8644 {
8645 exp->expType = op1->type;
8646 if(op1->type)
8647 op1->type->refCount++;
8648 }
8649 return 0x1;
8650 }
8651
8652 static unsigned int CharGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8653 {
8654 char value2 = op2->c;
8655
8656 exp->type = 2;
8657 exp->string = PrintChar(op1->c > value2);
8658 if(!exp->expType)
8659 {
8660 exp->expType = op1->type;
8661 if(op1->type)
8662 op1->type->refCount++;
8663 }
8664 return 0x1;
8665 }
8666
8667 static unsigned int UCharGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8668 {
8669 unsigned char value2 = op2->uc;
8670
8671 exp->type = 2;
8672 exp->string = PrintUChar(op1->uc > value2);
8673 if(!exp->expType)
8674 {
8675 exp->expType = op1->type;
8676 if(op1->type)
8677 op1->type->refCount++;
8678 }
8679 return 0x1;
8680 }
8681
8682 static unsigned int FloatGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8683 {
8684 float value2 = op2->f;
8685
8686 exp->type = 2;
8687 exp->string = PrintFloat(op1->f > value2);
8688 if(!exp->expType)
8689 {
8690 exp->expType = op1->type;
8691 if(op1->type)
8692 op1->type->refCount++;
8693 }
8694 return 0x1;
8695 }
8696
8697 static unsigned int DoubleGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8698 {
8699 double value2 = op2->d;
8700
8701 exp->type = 2;
8702 exp->string = PrintDouble(op1->d > value2);
8703 if(!exp->expType)
8704 {
8705 exp->expType = op1->type;
8706 if(op1->type)
8707 op1->type->refCount++;
8708 }
8709 return 0x1;
8710 }
8711
8712 static unsigned int IntSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8713 {
8714 int value2 = op2->i;
8715
8716 exp->type = 2;
8717 exp->string = PrintInt(op1->i < value2);
8718 if(!exp->expType)
8719 {
8720 exp->expType = op1->type;
8721 if(op1->type)
8722 op1->type->refCount++;
8723 }
8724 return 0x1;
8725 }
8726
8727 static unsigned int UIntSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8728 {
8729 unsigned int value2 = op2->ui;
8730
8731 exp->type = 2;
8732 exp->string = PrintUInt(op1->ui < value2);
8733 if(!exp->expType)
8734 {
8735 exp->expType = op1->type;
8736 if(op1->type)
8737 op1->type->refCount++;
8738 }
8739 return 0x1;
8740 }
8741
8742 static unsigned int ShortSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8743 {
8744 short value2 = op2->s;
8745
8746 exp->type = 2;
8747 exp->string = PrintShort(op1->s < value2);
8748 if(!exp->expType)
8749 {
8750 exp->expType = op1->type;
8751 if(op1->type)
8752 op1->type->refCount++;
8753 }
8754 return 0x1;
8755 }
8756
8757 static unsigned int UShortSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8758 {
8759 unsigned short value2 = op2->us;
8760
8761 exp->type = 2;
8762 exp->string = PrintUShort(op1->us < value2);
8763 if(!exp->expType)
8764 {
8765 exp->expType = op1->type;
8766 if(op1->type)
8767 op1->type->refCount++;
8768 }
8769 return 0x1;
8770 }
8771
8772 static unsigned int CharSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8773 {
8774 char value2 = op2->c;
8775
8776 exp->type = 2;
8777 exp->string = PrintChar(op1->c < value2);
8778 if(!exp->expType)
8779 {
8780 exp->expType = op1->type;
8781 if(op1->type)
8782 op1->type->refCount++;
8783 }
8784 return 0x1;
8785 }
8786
8787 static unsigned int UCharSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8788 {
8789 unsigned char value2 = op2->uc;
8790
8791 exp->type = 2;
8792 exp->string = PrintUChar(op1->uc < value2);
8793 if(!exp->expType)
8794 {
8795 exp->expType = op1->type;
8796 if(op1->type)
8797 op1->type->refCount++;
8798 }
8799 return 0x1;
8800 }
8801
8802 static unsigned int FloatSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8803 {
8804 float value2 = op2->f;
8805
8806 exp->type = 2;
8807 exp->string = PrintFloat(op1->f < value2);
8808 if(!exp->expType)
8809 {
8810 exp->expType = op1->type;
8811 if(op1->type)
8812 op1->type->refCount++;
8813 }
8814 return 0x1;
8815 }
8816
8817 static unsigned int DoubleSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8818 {
8819 double value2 = op2->d;
8820
8821 exp->type = 2;
8822 exp->string = PrintDouble(op1->d < value2);
8823 if(!exp->expType)
8824 {
8825 exp->expType = op1->type;
8826 if(op1->type)
8827 op1->type->refCount++;
8828 }
8829 return 0x1;
8830 }
8831
8832 static unsigned int IntGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8833 {
8834 int value2 = op2->i;
8835
8836 exp->type = 2;
8837 exp->string = PrintInt(op1->i >= value2);
8838 if(!exp->expType)
8839 {
8840 exp->expType = op1->type;
8841 if(op1->type)
8842 op1->type->refCount++;
8843 }
8844 return 0x1;
8845 }
8846
8847 static unsigned int UIntGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8848 {
8849 unsigned int value2 = op2->ui;
8850
8851 exp->type = 2;
8852 exp->string = PrintUInt(op1->ui >= value2);
8853 if(!exp->expType)
8854 {
8855 exp->expType = op1->type;
8856 if(op1->type)
8857 op1->type->refCount++;
8858 }
8859 return 0x1;
8860 }
8861
8862 static unsigned int ShortGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8863 {
8864 short value2 = op2->s;
8865
8866 exp->type = 2;
8867 exp->string = PrintShort(op1->s >= value2);
8868 if(!exp->expType)
8869 {
8870 exp->expType = op1->type;
8871 if(op1->type)
8872 op1->type->refCount++;
8873 }
8874 return 0x1;
8875 }
8876
8877 static unsigned int UShortGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8878 {
8879 unsigned short value2 = op2->us;
8880
8881 exp->type = 2;
8882 exp->string = PrintUShort(op1->us >= value2);
8883 if(!exp->expType)
8884 {
8885 exp->expType = op1->type;
8886 if(op1->type)
8887 op1->type->refCount++;
8888 }
8889 return 0x1;
8890 }
8891
8892 static unsigned int CharGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8893 {
8894 char value2 = op2->c;
8895
8896 exp->type = 2;
8897 exp->string = PrintChar(op1->c >= value2);
8898 if(!exp->expType)
8899 {
8900 exp->expType = op1->type;
8901 if(op1->type)
8902 op1->type->refCount++;
8903 }
8904 return 0x1;
8905 }
8906
8907 static unsigned int UCharGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8908 {
8909 unsigned char value2 = op2->uc;
8910
8911 exp->type = 2;
8912 exp->string = PrintUChar(op1->uc >= value2);
8913 if(!exp->expType)
8914 {
8915 exp->expType = op1->type;
8916 if(op1->type)
8917 op1->type->refCount++;
8918 }
8919 return 0x1;
8920 }
8921
8922 static unsigned int FloatGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8923 {
8924 float value2 = op2->f;
8925
8926 exp->type = 2;
8927 exp->string = PrintFloat(op1->f >= value2);
8928 if(!exp->expType)
8929 {
8930 exp->expType = op1->type;
8931 if(op1->type)
8932 op1->type->refCount++;
8933 }
8934 return 0x1;
8935 }
8936
8937 static unsigned int DoubleGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8938 {
8939 double value2 = op2->d;
8940
8941 exp->type = 2;
8942 exp->string = PrintDouble(op1->d >= value2);
8943 if(!exp->expType)
8944 {
8945 exp->expType = op1->type;
8946 if(op1->type)
8947 op1->type->refCount++;
8948 }
8949 return 0x1;
8950 }
8951
8952 static unsigned int IntSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8953 {
8954 int value2 = op2->i;
8955
8956 exp->type = 2;
8957 exp->string = PrintInt(op1->i <= value2);
8958 if(!exp->expType)
8959 {
8960 exp->expType = op1->type;
8961 if(op1->type)
8962 op1->type->refCount++;
8963 }
8964 return 0x1;
8965 }
8966
8967 static unsigned int UIntSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8968 {
8969 unsigned int value2 = op2->ui;
8970
8971 exp->type = 2;
8972 exp->string = PrintUInt(op1->ui <= value2);
8973 if(!exp->expType)
8974 {
8975 exp->expType = op1->type;
8976 if(op1->type)
8977 op1->type->refCount++;
8978 }
8979 return 0x1;
8980 }
8981
8982 static unsigned int ShortSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8983 {
8984 short value2 = op2->s;
8985
8986 exp->type = 2;
8987 exp->string = PrintShort(op1->s <= value2);
8988 if(!exp->expType)
8989 {
8990 exp->expType = op1->type;
8991 if(op1->type)
8992 op1->type->refCount++;
8993 }
8994 return 0x1;
8995 }
8996
8997 static unsigned int UShortSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8998 {
8999 unsigned short value2 = op2->us;
9000
9001 exp->type = 2;
9002 exp->string = PrintUShort(op1->us <= value2);
9003 if(!exp->expType)
9004 {
9005 exp->expType = op1->type;
9006 if(op1->type)
9007 op1->type->refCount++;
9008 }
9009 return 0x1;
9010 }
9011
9012 static unsigned int CharSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9013 {
9014 char value2 = op2->c;
9015
9016 exp->type = 2;
9017 exp->string = PrintChar(op1->c <= value2);
9018 if(!exp->expType)
9019 {
9020 exp->expType = op1->type;
9021 if(op1->type)
9022 op1->type->refCount++;
9023 }
9024 return 0x1;
9025 }
9026
9027 static unsigned int UCharSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9028 {
9029 unsigned char value2 = op2->uc;
9030
9031 exp->type = 2;
9032 exp->string = PrintUChar(op1->uc <= value2);
9033 if(!exp->expType)
9034 {
9035 exp->expType = op1->type;
9036 if(op1->type)
9037 op1->type->refCount++;
9038 }
9039 return 0x1;
9040 }
9041
9042 static unsigned int FloatSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9043 {
9044 float value2 = op2->f;
9045
9046 exp->type = 2;
9047 exp->string = PrintFloat(op1->f <= value2);
9048 if(!exp->expType)
9049 {
9050 exp->expType = op1->type;
9051 if(op1->type)
9052 op1->type->refCount++;
9053 }
9054 return 0x1;
9055 }
9056
9057 static unsigned int DoubleSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9058 {
9059 double value2 = op2->d;
9060
9061 exp->type = 2;
9062 exp->string = PrintDouble(op1->d <= value2);
9063 if(!exp->expType)
9064 {
9065 exp->expType = op1->type;
9066 if(op1->type)
9067 op1->type->refCount++;
9068 }
9069 return 0x1;
9070 }
9071
9072 static unsigned int IntCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
9073 {
9074 exp->type = 2;
9075 exp->string = PrintInt(op1->i ? op2->i : op3->i);
9076 if(!exp->expType)
9077 {
9078 exp->expType = op1->type;
9079 if(op1->type)
9080 op1->type->refCount++;
9081 }
9082 return 0x1;
9083 }
9084
9085 static unsigned int UIntCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
9086 {
9087 exp->type = 2;
9088 exp->string = PrintUInt(op1->ui ? op2->ui : op3->ui);
9089 if(!exp->expType)
9090 {
9091 exp->expType = op1->type;
9092 if(op1->type)
9093 op1->type->refCount++;
9094 }
9095 return 0x1;
9096 }
9097
9098 static unsigned int ShortCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
9099 {
9100 exp->type = 2;
9101 exp->string = PrintShort(op1->s ? op2->s : op3->s);
9102 if(!exp->expType)
9103 {
9104 exp->expType = op1->type;
9105 if(op1->type)
9106 op1->type->refCount++;
9107 }
9108 return 0x1;
9109 }
9110
9111 static unsigned int UShortCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
9112 {
9113 exp->type = 2;
9114 exp->string = PrintUShort(op1->us ? op2->us : op3->us);
9115 if(!exp->expType)
9116 {
9117 exp->expType = op1->type;
9118 if(op1->type)
9119 op1->type->refCount++;
9120 }
9121 return 0x1;
9122 }
9123
9124 static unsigned int CharCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
9125 {
9126 exp->type = 2;
9127 exp->string = PrintChar(op1->c ? op2->c : op3->c);
9128 if(!exp->expType)
9129 {
9130 exp->expType = op1->type;
9131 if(op1->type)
9132 op1->type->refCount++;
9133 }
9134 return 0x1;
9135 }
9136
9137 static unsigned int UCharCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
9138 {
9139 exp->type = 2;
9140 exp->string = PrintUChar(op1->uc ? op2->uc : op3->uc);
9141 if(!exp->expType)
9142 {
9143 exp->expType = op1->type;
9144 if(op1->type)
9145 op1->type->refCount++;
9146 }
9147 return 0x1;
9148 }
9149
9150 static unsigned int FloatCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
9151 {
9152 exp->type = 2;
9153 exp->string = PrintFloat(op1->f ? op2->f : op3->f);
9154 if(!exp->expType)
9155 {
9156 exp->expType = op1->type;
9157 if(op1->type)
9158 op1->type->refCount++;
9159 }
9160 return 0x1;
9161 }
9162
9163 static unsigned int DoubleCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
9164 {
9165 exp->type = 2;
9166 exp->string = PrintDouble(op1->d ? op2->d : op3->d);
9167 if(!exp->expType)
9168 {
9169 exp->expType = op1->type;
9170 if(op1->type)
9171 op1->type->refCount++;
9172 }
9173 return 0x1;
9174 }
9175
9176 struct OpTable intOps = 
9177 {
9178 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
9179 };
9180
9181 struct OpTable uintOps = 
9182 {
9183 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
9184 };
9185
9186 struct OpTable shortOps = 
9187 {
9188 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
9189 };
9190
9191 struct OpTable ushortOps = 
9192 {
9193 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
9194 };
9195
9196 struct OpTable floatOps = 
9197 {
9198 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
9199 };
9200
9201 struct OpTable doubleOps = 
9202 {
9203 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
9204 };
9205
9206 struct OpTable charOps = 
9207 {
9208 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
9209 };
9210
9211 struct OpTable ucharOps = 
9212 {
9213 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
9214 };
9215
9216 void ReadString(char * output, char * string)
9217 {
9218 int len = strlen(string);
9219 int c, d = 0;
9220 unsigned int quoted = 0x0, escaped = 0x0;
9221
9222 for(c = 0; c < len; c++)
9223 {
9224 char ch = string[c];
9225
9226 if(escaped)
9227 {
9228 switch(ch)
9229 {
9230 case 'n':
9231 output[d] = '\n';
9232 break;
9233 case 't':
9234 output[d] = '\t';
9235 break;
9236 case 'a':
9237 output[d] = '\a';
9238 break;
9239 case 'b':
9240 output[d] = '\b';
9241 break;
9242 case 'f':
9243 output[d] = '\f';
9244 break;
9245 case 'r':
9246 output[d] = '\r';
9247 break;
9248 case 'v':
9249 output[d] = '\v';
9250 break;
9251 case '\\':
9252 output[d] = '\\';
9253 break;
9254 case '\"':
9255 output[d] = '\"';
9256 break;
9257 default:
9258 output[d++] = '\\';
9259 output[d] = ch;
9260 }
9261 d++;
9262 escaped = 0x0;
9263 }
9264 else
9265 {
9266 if(ch == '\"')
9267 quoted ^= 0x1;
9268 else if(quoted)
9269 {
9270 if(ch == '\\')
9271 escaped = 0x1;
9272 else
9273 output[d++] = ch;
9274 }
9275 }
9276 }
9277 output[d] = '\0';
9278 }
9279
9280 extern double strtod(char * , char * * );
9281
9282 struct Operand GetOperand(struct Expression * exp)
9283 {
9284 struct Operand op = 
9285 {
9286 0, 0, 0, 0, 
9287 {
9288 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
9289 }
9290 };
9291 struct Type * type = exp->expType;
9292
9293 if(type)
9294 {
9295 while(type->kind == 8 && type->_class->registered && (type->_class->registered->type == 2 || type->_class->registered->type == 3 || type->_class->registered->type == 4))
9296 {
9297 if(!type->_class->registered->dataType)
9298 type->_class->registered->dataType = ProcessTypeString(type->_class->registered->dataTypeString, 0x0);
9299 type = type->_class->registered->dataType;
9300 }
9301 op.kind = type->kind;
9302 op.type = exp->expType;
9303 if(exp->isConstant && exp->type == 2)
9304 {
9305 switch(op.kind)
9306 {
9307 case 1:
9308 {
9309 if(exp->constant[0] == '\'')
9310 op.c = exp->constant[1];
9311 else if(type->isSigned)
9312 {
9313 op.c = (char)strtol(exp->constant, (((void *)0)), 0);
9314 op.ops = charOps;
9315 }
9316 else
9317 {
9318 op.uc = (unsigned char)strtoul(exp->constant, (((void *)0)), 0);
9319 op.ops = ucharOps;
9320 }
9321 break;
9322 }
9323 case 2:
9324 if(type->isSigned)
9325 {
9326 op.s = (short)strtol(exp->constant, (((void *)0)), 0);
9327 op.ops = shortOps;
9328 }
9329 else
9330 {
9331 op.us = (unsigned short)strtoul(exp->constant, (((void *)0)), 0);
9332 op.ops = ushortOps;
9333 }
9334 break;
9335 case 3:
9336 case 5:
9337 if(type->isSigned)
9338 {
9339 op.i = strtol(exp->constant, (((void *)0)), 0);
9340 op.ops = intOps;
9341 }
9342 else
9343 {
9344 op.ui = strtoul(exp->constant, (((void *)0)), 0);
9345 op.ops = uintOps;
9346 }
9347 op.kind = 3;
9348 break;
9349 case 4:
9350 if(type->isSigned)
9351 {
9352 op.i64 = _strtoi64(exp->constant, (((void *)0)), 0);
9353 op.ops = intOps;
9354 }
9355 else
9356 {
9357 op.ui64 = _strtoui64(exp->constant, (((void *)0)), 0);
9358 op.ops = uintOps;
9359 }
9360 op.kind = 3;
9361 break;
9362 case 22:
9363 if(type->isSigned)
9364 {
9365 op.iptr = (intptr_t)_strtoi64(exp->constant, (((void *)0)), 0);
9366 op.ops = intOps;
9367 }
9368 else
9369 {
9370 op.uiptr = (uintptr_t)_strtoui64(exp->constant, (((void *)0)), 0);
9371 op.ops = uintOps;
9372 }
9373 op.kind = 3;
9374 break;
9375 case 6:
9376 op.f = (float)strtod(exp->constant, (((void *)0)));
9377 op.ops = floatOps;
9378 break;
9379 case 7:
9380 op.d = (double)strtod(exp->constant, (((void *)0)));
9381 op.ops = doubleOps;
9382 break;
9383 case 12:
9384 case 13:
9385 case 8:
9386 op.p = (unsigned char *)strtoul(exp->constant, (((void *)0)), 0);
9387 op.kind = 13;
9388 op.ops = uintOps;
9389 break;
9390 }
9391 }
9392 }
9393 return op;
9394 }
9395
9396 int __ecereVMethodID_class_OnGetString;
9397
9398 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_int;
9399
9400 static void UnusedFunction()
9401 {
9402 int a;
9403
9404 ((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);
9405 }
9406
9407 extern int __ecereVMethodID_class_OnGetString;
9408
9409 static void PopulateInstanceProcessMember(struct Instantiation * inst, struct __ecereNameSpace__ecere__sys__OldList * memberList, struct __ecereNameSpace__ecere__com__DataMember * parentDataMember, unsigned int offset)
9410 {
9411 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
9412
9413 for(dataMember = parentDataMember->members.first; dataMember; dataMember = dataMember->next)
9414 {
9415 if(!dataMember->name && (dataMember->type == 2 || dataMember->type == 1))
9416 PopulateInstanceProcessMember(inst, memberList, dataMember, offset + dataMember->offset);
9417 else
9418 {
9419 struct Expression * exp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
9420 struct MemberInit * member = MkMemberInit(MkListOne(MkIdentifier(dataMember->name)), MkInitializerAssignment(exp));
9421 struct Type * type;
9422 void * ptr = inst->data + dataMember->offset + offset;
9423 char * result = (((void *)0));
9424
9425 exp->loc = member->loc = inst->loc;
9426 ((struct Identifier *)(*member->identifiers).first)->loc = inst->loc;
9427 if(!dataMember->dataType)
9428 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
9429 type = dataMember->dataType;
9430 if(type->kind == 8)
9431 {
9432 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
9433
9434 if(_class->type == 4)
9435 {
9436 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
9437
9438 if(enumClass)
9439 {
9440 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
9441 struct __ecereNameSpace__ecere__sys__NamedLink * item;
9442
9443 for(item = e->values.first; item; item = item->next)
9444 {
9445 if((int)item->data == *(int *)ptr)
9446 {
9447 result = item->name;
9448 break;
9449 }
9450 }
9451 if(result)
9452 {
9453 exp->identifier = MkIdentifier(result);
9454 exp->type = 0;
9455 exp->destType = MkClassType(_class->fullName);
9456 ProcessExpressionType(exp);
9457 }
9458 }
9459 }
9460 if(_class->type == 4 || _class->type == 3 || _class->type == 2)
9461 {
9462 if(!_class->dataType)
9463 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
9464 type = _class->dataType;
9465 }
9466 }
9467 if(!result)
9468 {
9469 switch(type->kind)
9470 {
9471 case 6:
9472 {
9473 FreeExpContents(exp);
9474 exp->constant = PrintFloat(*(float *)ptr);
9475 exp->type = 2;
9476 break;
9477 }
9478 case 7:
9479 {
9480 FreeExpContents(exp);
9481 exp->constant = PrintDouble(*(double *)ptr);
9482 exp->type = 2;
9483 break;
9484 }
9485 case 3:
9486 {
9487 FreeExpContents(exp);
9488 exp->constant = PrintInt(*(int *)ptr);
9489 exp->type = 2;
9490 break;
9491 }
9492 case 4:
9493 {
9494 FreeExpContents(exp);
9495 exp->constant = PrintInt64(*(long long *)ptr);
9496 exp->type = 2;
9497 break;
9498 }
9499 case 22:
9500 {
9501 FreeExpContents(exp);
9502 exp->constant = PrintInt64((long long)*(intptr_t *)ptr);
9503 exp->type = 2;
9504 break;
9505 }
9506 default:
9507 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Unhandled type populating instance\n", (((void *)0))));
9508 }
9509 }
9510 ListAdd(memberList, member);
9511 }
9512 if(parentDataMember->type == 1)
9513 break;
9514 }
9515 }
9516
9517 extern struct MembersInit * MkMembersInitList(struct __ecereNameSpace__ecere__sys__OldList * dataMembers);
9518
9519 void PopulateInstance(struct Instantiation * inst)
9520 {
9521 struct Symbol * classSym = inst->_class->symbol;
9522 struct __ecereNameSpace__ecere__com__Class * _class = classSym->registered;
9523 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
9524 struct __ecereNameSpace__ecere__sys__OldList * memberList = MkList();
9525
9526 inst->members = MkListOne(MkMembersInitList(memberList));
9527 for(dataMember = _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
9528 {
9529 if(!dataMember->isProperty)
9530 {
9531 if(!dataMember->name && (dataMember->type == 2 || dataMember->type == 1))
9532 PopulateInstanceProcessMember(inst, memberList, dataMember, dataMember->offset);
9533 else
9534 {
9535 struct Expression * exp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
9536 struct MemberInit * member = MkMemberInit(MkListOne(MkIdentifier(dataMember->name)), MkInitializerAssignment(exp));
9537 struct Type * type;
9538 void * ptr = inst->data + dataMember->offset;
9539 char * result = (((void *)0));
9540
9541 exp->loc = member->loc = inst->loc;
9542 ((struct Identifier *)(*member->identifiers).first)->loc = inst->loc;
9543 if(!dataMember->dataType)
9544 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
9545 type = dataMember->dataType;
9546 if(type->kind == 8)
9547 {
9548 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
9549
9550 if(_class->type == 4)
9551 {
9552 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
9553
9554 if(enumClass)
9555 {
9556 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
9557 struct __ecereNameSpace__ecere__sys__NamedLink * item;
9558
9559 for(item = e->values.first; item; item = item->next)
9560 {
9561 if((int)item->data == *(int *)ptr)
9562 {
9563 result = item->name;
9564 break;
9565 }
9566 }
9567 }
9568 if(result)
9569 {
9570 exp->identifier = MkIdentifier(result);
9571 exp->type = 0;
9572 exp->destType = MkClassType(_class->fullName);
9573 ProcessExpressionType(exp);
9574 }
9575 }
9576 if(_class->type == 4 || _class->type == 3 || _class->type == 2)
9577 {
9578 if(!_class->dataType)
9579 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
9580 type = _class->dataType;
9581 }
9582 }
9583 if(!result)
9584 {
9585 switch(type->kind)
9586 {
9587 case 6:
9588 {
9589 exp->constant = PrintFloat(*(float *)ptr);
9590 exp->type = 2;
9591 break;
9592 }
9593 case 7:
9594 {
9595 exp->constant = PrintDouble(*(double *)ptr);
9596 exp->type = 2;
9597 break;
9598 }
9599 case 3:
9600 {
9601 exp->constant = PrintInt(*(int *)ptr);
9602 exp->type = 2;
9603 break;
9604 }
9605 case 4:
9606 {
9607 exp->constant = PrintInt64(*(long long *)ptr);
9608 exp->type = 2;
9609 break;
9610 }
9611 case 22:
9612 {
9613 exp->constant = PrintInt64((long long)*(intptr_t *)ptr);
9614 exp->type = 2;
9615 break;
9616 }
9617 default:
9618 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Unhandled type populating instance\n", (((void *)0))));
9619 }
9620 }
9621 ListAdd(memberList, member);
9622 }
9623 }
9624 }
9625 }
9626
9627 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);
9628
9629 extern void FreeInstance(struct Instantiation * inst);
9630
9631 void ComputeInstantiation(struct Expression * exp)
9632 {
9633 struct Instantiation * inst = exp->instance;
9634 struct MembersInit * members;
9635 struct Symbol * classSym = inst->_class ? inst->_class->symbol : (((void *)0));
9636 struct __ecereNameSpace__ecere__com__Class * _class = classSym ? classSym->registered : (((void *)0));
9637 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
9638 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
9639 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
9640 int subMemberStackPos = 0;
9641 uint64 bits = 0;
9642
9643 if(_class && (_class->type == 1 || _class->type == 0 || _class->type == 5))
9644 {
9645 if(inst->data)
9646 return ;
9647 if(_class->type == 0 || _class->type == 5)
9648 inst->data = (unsigned char *)__ecereNameSpace__ecere__com__eInstance_New(_class);
9649 else
9650 inst->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
9651 }
9652 if(inst->members)
9653 {
9654 for(members = (*inst->members).first; members; members = members->next)
9655 {
9656 switch(members->type)
9657 {
9658 case 0:
9659 {
9660 if(members->dataMembers)
9661 {
9662 struct MemberInit * member;
9663
9664 for(member = (*members->dataMembers).first; member; member = member->next)
9665 {
9666 struct Identifier * ident = member->identifiers ? (*member->identifiers).first : (((void *)0));
9667 unsigned int found = 0x0;
9668 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
9669 struct __ecereNameSpace__ecere__com__DataMember * dataMember = (((void *)0));
9670 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
9671 unsigned int dataMemberOffset;
9672
9673 if(!ident)
9674 {
9675 __ecereNameSpace__ecere__com__eClass_FindNextMember(_class, &curClass, &curMember, subMemberStack, &subMemberStackPos);
9676 if(curMember)
9677 {
9678 if(curMember->isProperty)
9679 prop = (struct __ecereNameSpace__ecere__com__Property *)curMember;
9680 else
9681 {
9682 dataMember = curMember;
9683 __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(_class, dataMember->name, &dataMemberOffset, privateModule, (((void *)0)), (((void *)0)));
9684 }
9685 found = 0x1;
9686 }
9687 }
9688 else
9689 {
9690 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, ident->string, privateModule);
9691 if(prop)
9692 {
9693 found = 0x1;
9694 if(prop->memberAccess == 1)
9695 {
9696 curMember = (struct __ecereNameSpace__ecere__com__DataMember *)prop;
9697 curClass = prop->_class;
9698 }
9699 }
9700 else
9701 {
9702 struct __ecereNameSpace__ecere__com__DataMember * _subMemberStack[256];
9703 int _subMemberStackPos = 0;
9704
9705 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(_class, ident->string, &dataMemberOffset, privateModule, _subMemberStack, &_subMemberStackPos);
9706 if(dataMember)
9707 {
9708 found = 0x1;
9709 if(dataMember->memberAccess == 1)
9710 {
9711 curMember = dataMember;
9712 curClass = dataMember->_class;
9713 memcpy(subMemberStack, _subMemberStack, sizeof(int) * _subMemberStackPos);
9714 subMemberStackPos = _subMemberStackPos;
9715 }
9716 }
9717 }
9718 }
9719 if(found && member->initializer && member->initializer->type == 0)
9720 {
9721 struct Expression * value = member->initializer->exp;
9722 struct Type * type = (((void *)0));
9723
9724 if(prop)
9725 {
9726 type = prop->dataType;
9727 }
9728 else if(dataMember)
9729 {
9730 if(!dataMember->dataType)
9731 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
9732 type = dataMember->dataType;
9733 }
9734 if(ident && ident->next)
9735 {
9736 for(ident = ident->next; ident && type; ident = ident->next)
9737 {
9738 if(type->kind == 8)
9739 {
9740 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(type->_class->registered, ident->string, privateModule);
9741 if(prop)
9742 type = prop->dataType;
9743 else
9744 {
9745 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(type->_class->registered, ident->string, &dataMemberOffset, privateModule, (((void *)0)), (((void *)0)));
9746 if(dataMember)
9747 type = dataMember->dataType;
9748 }
9749 }
9750 else if(type->kind == 9 || type->kind == 10)
9751 {
9752 struct Type * memberType;
9753
9754 for(memberType = type->members.first; memberType; memberType = memberType->next)
9755 {
9756 if(!strcmp(memberType->name, ident->string))
9757 {
9758 type = memberType;
9759 break;
9760 }
9761 }
9762 }
9763 }
9764 }
9765 if(value)
9766 {
9767 FreeType(value->destType);
9768 value->destType = type;
9769 if(type)
9770 type->refCount++;
9771 ComputeExpression(value);
9772 }
9773 if(value && (_class->type == 1 || _class->type == 0 || _class->type == 5))
9774 {
9775 if(type->kind == 8)
9776 {
9777 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
9778
9779 if(_class->type == 2 || _class->type == 3 || _class->type == 4)
9780 {
9781 if(!_class->dataType)
9782 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
9783 type = _class->dataType;
9784 }
9785 }
9786 if(dataMember)
9787 {
9788 void * ptr = inst->data + dataMemberOffset;
9789
9790 if(value->type == 2)
9791 {
9792 switch(type->kind)
9793 {
9794 case 3:
9795 {
9796 GetInt(value, (int *)ptr);
9797 break;
9798 }
9799 case 4:
9800 {
9801 GetInt64(value, (long long *)ptr);
9802 break;
9803 }
9804 case 22:
9805 {
9806 GetIntPtr(value, (intptr_t *)ptr);
9807 break;
9808 }
9809 case 6:
9810 {
9811 GetFloat(value, (float *)ptr);
9812 break;
9813 }
9814 case 7:
9815 {
9816 GetDouble(value, (double *)ptr);
9817 break;
9818 }
9819 }
9820 }
9821 else if(value->type == 1)
9822 {
9823 if(type->kind == 8)
9824 {
9825 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
9826
9827 if(_class->type == 1)
9828 {
9829 ComputeTypeSize(type);
9830 if(value->instance->data)
9831 memcpy(ptr, value->instance->data, type->size);
9832 }
9833 }
9834 }
9835 }
9836 else if(prop)
9837 {
9838 if(value->type == 1 && value->instance->data)
9839 {
9840 void (* Set)(void *, void *) = (void *)prop->Set;
9841
9842 Set(inst->data, value->instance->data);
9843 PopulateInstance(inst);
9844 }
9845 else if(value->type == 2)
9846 {
9847 switch(type->kind)
9848 {
9849 case 7:
9850 {
9851 void (* Set)(void *, double) = (void *)prop->Set;
9852
9853 Set(inst->data, strtod(value->constant, (((void *)0))));
9854 break;
9855 }
9856 case 6:
9857 {
9858 void (* Set)(void *, float) = (void *)prop->Set;
9859
9860 Set(inst->data, (float)(strtod(value->constant, (((void *)0)))));
9861 break;
9862 }
9863 case 3:
9864 {
9865 void (* Set)(void *, int) = (void *)prop->Set;
9866
9867 Set(inst->data, strtol(value->constant, (((void *)0)), 0));
9868 break;
9869 }
9870 case 4:
9871 {
9872 void (* Set)(void *, long long) = (void *)prop->Set;
9873
9874 Set(inst->data, _strtoi64(value->constant, (((void *)0)), 0));
9875 break;
9876 }
9877 case 22:
9878 {
9879 void (* Set)(void *, intptr_t) = (void *)prop->Set;
9880
9881 Set(inst->data, (intptr_t)_strtoi64(value->constant, (((void *)0)), 0));
9882 break;
9883 }
9884 }
9885 }
9886 else if(value->type == 3)
9887 {
9888 char temp[1024];
9889
9890 ReadString(temp, value->string);
9891 prop->Set(inst->data, temp);
9892 }
9893 }
9894 }
9895 else if(_class->type == 3)
9896 {
9897 if(prop)
9898 {
9899 if(value->type == 2)
9900 {
9901 if(type->kind == 8)
9902 {
9903 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
9904
9905 if(_class->type == 3)
9906 {
9907 if(!_class->dataType)
9908 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
9909 type = _class->dataType;
9910 }
9911 }
9912 switch(type->kind)
9913 {
9914 case 6:
9915 {
9916 float fValue;
9917 float (* Set)(float) = (void *)prop->Set;
9918
9919 GetFloat(member->initializer->exp, &fValue);
9920 exp->constant = PrintFloat(Set(fValue));
9921 exp->type = 2;
9922 break;
9923 }
9924 case 7:
9925 {
9926 double dValue;
9927 double (* Set)(double) = (void *)prop->Set;
9928
9929 GetDouble(member->initializer->exp, &dValue);
9930 exp->constant = PrintDouble(Set(dValue));
9931 exp->type = 2;
9932 break;
9933 }
9934 }
9935 }
9936 }
9937 }
9938 else if(_class->type == 2)
9939 {
9940 if(prop)
9941 {
9942 if(value->type == 1 && value->instance->data)
9943 {
9944 unsigned int (* Set)(void *) = (void *)prop->Set;
9945
9946 bits = Set(value->instance->data);
9947 }
9948 else if(value->type == 2)
9949 {
9950 }
9951 }
9952 else if(dataMember)
9953 {
9954 struct __ecereNameSpace__ecere__com__BitMember * bitMember = (struct __ecereNameSpace__ecere__com__BitMember *)dataMember;
9955 struct Type * type;
9956 int part = 0;
9957
9958 GetInt(value, &part);
9959 bits = (bits & ~bitMember->mask);
9960 if(!bitMember->dataType)
9961 bitMember->dataType = ProcessTypeString(bitMember->dataTypeString, 0x0);
9962 type = bitMember->dataType;
9963 if(type->kind == 8 && type->_class && type->_class->registered)
9964 {
9965 if(!type->_class->registered->dataType)
9966 type->_class->registered->dataType = ProcessTypeString(type->_class->registered->dataTypeString, 0x0);
9967 type = type->_class->registered->dataType;
9968 }
9969 switch(type->kind)
9970 {
9971 case 1:
9972 if(type->isSigned)
9973 bits |= ((char)part << bitMember->pos);
9974 else
9975 bits |= ((unsigned char)part << bitMember->pos);
9976 break;
9977 case 2:
9978 if(type->isSigned)
9979 bits |= ((short)part << bitMember->pos);
9980 else
9981 bits |= ((unsigned short)part << bitMember->pos);
9982 break;
9983 case 3:
9984 case 5:
9985 if(type->isSigned)
9986 bits |= (part << bitMember->pos);
9987 else
9988 bits |= ((unsigned int)part << bitMember->pos);
9989 break;
9990 case 4:
9991 if(type->isSigned)
9992 bits |= ((long long)part << bitMember->pos);
9993 else
9994 bits |= ((uint64)part << bitMember->pos);
9995 break;
9996 case 22:
9997 if(type->isSigned)
9998 bits |= ((intptr_t)part << bitMember->pos);
9999 else
10000 bits |= ((uintptr_t)part << bitMember->pos);
10001 break;
10002 }
10003 }
10004 }
10005 }
10006 else
10007 {
10008 if(_class && _class->type == 3)
10009 {
10010 ComputeExpression(member->initializer->exp);
10011 exp->constant = member->initializer->exp->constant;
10012 exp->type = 2;
10013 member->initializer->exp->constant = (((void *)0));
10014 }
10015 }
10016 }
10017 }
10018 break;
10019 }
10020 }
10021 }
10022 }
10023 if(_class && _class->type == 2)
10024 {
10025 exp->constant = PrintHexUInt(bits);
10026 exp->type = 2;
10027 }
10028 if(exp->type != 1)
10029 {
10030 FreeInstance(inst);
10031 }
10032 }
10033
10034 void CallOperator(struct Expression * exp, struct Expression * exp1, struct Expression * exp2, struct Operand * op1, struct Operand * op2)
10035 {
10036 if(exp->op.op == SIZEOF)
10037 {
10038 FreeExpContents(exp);
10039 exp->type = 2;
10040 exp->constant = PrintUInt(ComputeTypeSize(op1->type));
10041 }
10042 else
10043 {
10044 if(!exp->op.exp1)
10045 {
10046 switch(exp->op.op)
10047 {
10048 case '+':
10049 {
10050 struct Expression * exp2 = exp->op.exp2;
10051
10052 exp->op.exp2 = (((void *)0));
10053 FreeExpContents(exp);
10054 FreeType(exp->expType);
10055 FreeType(exp->destType);
10056 *exp = *exp2;
10057 ((exp2 ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(exp2) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(exp2)) : 0), exp2 = 0);
10058 break;
10059 }
10060 case '-':
10061 if(op1->ops.Neg)
10062 {
10063 FreeExpContents(exp);
10064 op1->ops.Neg(exp, op1);
10065 }
10066 break;
10067 case '~':
10068 if(op1->ops.BitNot)
10069 {
10070 FreeExpContents(exp);
10071 op1->ops.BitNot(exp, op1);
10072 }
10073 break;
10074 case '!':
10075 if(op1->ops.Not)
10076 {
10077 FreeExpContents(exp);
10078 op1->ops.Not(exp, op1);
10079 }
10080 break;
10081 }
10082 }
10083 else
10084 {
10085 switch(exp->op.op)
10086 {
10087 case '+':
10088 if(op1->ops.Add)
10089 {
10090 FreeExpContents(exp);
10091 op1->ops.Add(exp, op1, op2);
10092 }
10093 break;
10094 case '-':
10095 if(op1->ops.Sub)
10096 {
10097 FreeExpContents(exp);
10098 op1->ops.Sub(exp, op1, op2);
10099 }
10100 break;
10101 case '*':
10102 if(op1->ops.Mul)
10103 {
10104 FreeExpContents(exp);
10105 op1->ops.Mul(exp, op1, op2);
10106 }
10107 break;
10108 case '/':
10109 if(op1->ops.Div)
10110 {
10111 FreeExpContents(exp);
10112 op1->ops.Div(exp, op1, op2);
10113 }
10114 break;
10115 case '%':
10116 if(op1->ops.Mod)
10117 {
10118 FreeExpContents(exp);
10119 op1->ops.Mod(exp, op1, op2);
10120 }
10121 break;
10122 case '&':
10123 if(exp->op.exp2)
10124 {
10125 if(op1->ops.BitAnd)
10126 {
10127 FreeExpContents(exp);
10128 op1->ops.BitAnd(exp, op1, op2);
10129 }
10130 }
10131 break;
10132 case '|':
10133 if(op1->ops.BitOr)
10134 {
10135 FreeExpContents(exp);
10136 op1->ops.BitOr(exp, op1, op2);
10137 }
10138 break;
10139 case '^':
10140 if(op1->ops.BitXor)
10141 {
10142 FreeExpContents(exp);
10143 op1->ops.BitXor(exp, op1, op2);
10144 }
10145 break;
10146 case LEFT_OP:
10147 if(op1->ops.LShift)
10148 {
10149 FreeExpContents(exp);
10150 op1->ops.LShift(exp, op1, op2);
10151 }
10152 break;
10153 case RIGHT_OP:
10154 if(op1->ops.RShift)
10155 {
10156 FreeExpContents(exp);
10157 op1->ops.RShift(exp, op1, op2);
10158 }
10159 break;
10160 case EQ_OP:
10161 if(op1->ops.Equ)
10162 {
10163 FreeExpContents(exp);
10164 op1->ops.Equ(exp, op1, op2);
10165 }
10166 break;
10167 case NE_OP:
10168 if(op1->ops.Nqu)
10169 {
10170 FreeExpContents(exp);
10171 op1->ops.Nqu(exp, op1, op2);
10172 }
10173 break;
10174 case AND_OP:
10175 if(op1->ops.And)
10176 {
10177 FreeExpContents(exp);
10178 op1->ops.And(exp, op1, op2);
10179 }
10180 break;
10181 case OR_OP:
10182 if(op1->ops.Or)
10183 {
10184 FreeExpContents(exp);
10185 op1->ops.Or(exp, op1, op2);
10186 }
10187 break;
10188 case '>':
10189 if(op1->ops.Grt)
10190 {
10191 FreeExpContents(exp);
10192 op1->ops.Grt(exp, op1, op2);
10193 }
10194 break;
10195 case '<':
10196 if(op1->ops.Sma)
10197 {
10198 FreeExpContents(exp);
10199 op1->ops.Sma(exp, op1, op2);
10200 }
10201 break;
10202 case GE_OP:
10203 if(op1->ops.GrtEqu)
10204 {
10205 FreeExpContents(exp);
10206 op1->ops.GrtEqu(exp, op1, op2);
10207 }
10208 break;
10209 case LE_OP:
10210 if(op1->ops.SmaEqu)
10211 {
10212 FreeExpContents(exp);
10213 op1->ops.SmaEqu(exp, op1, op2);
10214 }
10215 break;
10216 }
10217 }
10218 }
10219 }
10220
10221 extern struct Expression * MkExpIdentifier(struct Identifier * id);
10222
10223 void ComputeExpression(struct Expression * exp)
10224 {
10225 char expString[10240];
10226
10227 expString[0] = '\0';
10228 switch(exp->type)
10229 {
10230 case 1:
10231 {
10232 ComputeInstantiation(exp);
10233 break;
10234 }
10235 case 4:
10236 {
10237 struct Expression * exp1, * exp2 = (((void *)0));
10238 struct Operand op1 = 
10239 {
10240 0, 0, 0, 0, 
10241 {
10242 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
10243 }
10244 };
10245 struct Operand op2 = 
10246 {
10247 0, 0, 0, 0, 
10248 {
10249 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
10250 }
10251 };
10252
10253 if(exp->op.exp2)
10254 ComputeExpression(exp->op.exp2);
10255 if(exp->op.exp1)
10256 {
10257 ComputeExpression(exp->op.exp1);
10258 exp1 = exp->op.exp1;
10259 exp2 = exp->op.exp2;
10260 op1 = GetOperand(exp1);
10261 if(op1.type)
10262 op1.type->refCount++;
10263 if(exp2)
10264 {
10265 op2 = GetOperand(exp2);
10266 if(op2.type)
10267 op2.type->refCount++;
10268 }
10269 }
10270 else
10271 {
10272 exp1 = exp->op.exp2;
10273 op1 = GetOperand(exp1);
10274 if(op1.type)
10275 op1.type->refCount++;
10276 }
10277 CallOperator(exp, exp1, exp2, &op1, &op2);
10278 if(op1.type)
10279 FreeType(op1.type);
10280 if(op2.type)
10281 FreeType(op2.type);
10282 break;
10283 }
10284 case 5:
10285 case 34:
10286 {
10287 struct Expression * e, * n;
10288
10289 for(e = (*exp->list).first; e; e = n)
10290 {
10291 n = e->next;
10292 if(!n)
10293 {
10294 struct __ecereNameSpace__ecere__sys__OldList * list = exp->list;
10295
10296 ComputeExpression(e);
10297 FreeType(exp->expType);
10298 FreeType(exp->destType);
10299 *exp = *e;
10300 ((e ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(e) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(e)) : 0), e = 0);
10301 (__ecereNameSpace__ecere__com__eSystem_Delete(list), list = 0);
10302 }
10303 else
10304 {
10305 FreeExpression(e);
10306 }
10307 }
10308 break;
10309 }
10310 case 8:
10311 {
10312 struct Expression * memberExp = exp->member.exp;
10313 struct Identifier * memberID = exp->member.member;
10314 struct Type * type;
10315
10316 ComputeExpression(exp->member.exp);
10317 type = exp->member.exp->expType;
10318 if(type)
10319 {
10320 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)));
10321 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
10322 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
10323 struct __ecereNameSpace__ecere__com__Class * convertTo = (((void *)0));
10324
10325 if(type->kind == 19 && exp->member.exp->type == 26)
10326 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "ecere::com::Class");
10327 if(!_class)
10328 {
10329 char string[256];
10330 struct Symbol * classSym;
10331
10332 string[0] = '\0';
10333 PrintType(type, string, 0x0, 0x1);
10334 classSym = FindClass(string);
10335 _class = classSym ? classSym->registered : (((void *)0));
10336 }
10337 if(exp->member.member)
10338 {
10339 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, exp->member.member->string, privateModule);
10340 if(!prop)
10341 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, exp->member.member->string, privateModule, (((void *)0)), (((void *)0)));
10342 }
10343 if(!prop && !member && _class && exp->member.member)
10344 {
10345 struct Symbol * classSym = FindClass(exp->member.member->string);
10346
10347 convertTo = _class;
10348 _class = classSym ? classSym->registered : (((void *)0));
10349 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, convertTo->fullName, privateModule);
10350 }
10351 if(prop)
10352 {
10353 if(prop->compiled)
10354 {
10355 struct Type * type = prop->dataType;
10356
10357 if(_class->type == 3)
10358 {
10359 if(type->kind == 8)
10360 {
10361 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
10362
10363 if(_class->type == 3)
10364 {
10365 if(!_class->dataType)
10366 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
10367 type = _class->dataType;
10368 }
10369 }
10370 switch(type->kind)
10371 {
10372 case 6:
10373 {
10374 float value;
10375 float (* Get)(float) = (void *)prop->Get;
10376
10377 GetFloat(exp->member.exp, &value);
10378 exp->constant = PrintFloat(Get ? Get(value) : value);
10379 exp->type = 2;
10380 break;
10381 }
10382 case 7:
10383 {
10384 double value;
10385 double (* Get)(double);
10386
10387 GetDouble(exp->member.exp, &value);
10388 if(convertTo)
10389 Get = (void *)prop->Set;
10390 else
10391 Get = (void *)prop->Get;
10392 exp->constant = PrintDouble(Get ? Get(value) : value);
10393 exp->type = 2;
10394 break;
10395 }
10396 }
10397 }
10398 else
10399 {
10400 if(convertTo)
10401 {
10402 struct Expression * value = exp->member.exp;
10403 struct Type * type;
10404
10405 if(!prop->dataType)
10406 ProcessPropertyType(prop);
10407 type = prop->dataType;
10408 if(!type)
10409 {
10410 }
10411 else if(_class->type == 1)
10412 {
10413 switch(type->kind)
10414 {
10415 case 8:
10416 {
10417 struct __ecereNameSpace__ecere__com__Class * propertyClass = type->_class->registered;
10418
10419 if(propertyClass->type == 1 && value->type == 1)
10420 {
10421 void (* Set)(void *, void *) = (void *)prop->Set;
10422
10423 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10424 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10425 exp->instance->_class = MkSpecifierName(_class->fullName);
10426 exp->instance->loc = exp->loc;
10427 exp->type = 1;
10428 Set(exp->instance->data, value->instance->data);
10429 PopulateInstance(exp->instance);
10430 }
10431 break;
10432 }
10433 case 3:
10434 {
10435 int intValue;
10436 void (* Set)(void *, int) = (void *)prop->Set;
10437
10438 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10439 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10440 exp->instance->_class = MkSpecifierName(_class->fullName);
10441 exp->instance->loc = exp->loc;
10442 exp->type = 1;
10443 GetInt(value, &intValue);
10444 Set(exp->instance->data, intValue);
10445 PopulateInstance(exp->instance);
10446 break;
10447 }
10448 case 4:
10449 {
10450 long long intValue;
10451 void (* Set)(void *, long long) = (void *)prop->Set;
10452
10453 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10454 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10455 exp->instance->_class = MkSpecifierName(_class->fullName);
10456 exp->instance->loc = exp->loc;
10457 exp->type = 1;
10458 GetInt64(value, &intValue);
10459 Set(exp->instance->data, intValue);
10460 PopulateInstance(exp->instance);
10461 break;
10462 }
10463 case 22:
10464 {
10465 intptr_t intValue;
10466 void (* Set)(void *, intptr_t) = (void *)prop->Set;
10467
10468 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10469 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10470 exp->instance->_class = MkSpecifierName(_class->fullName);
10471 exp->instance->loc = exp->loc;
10472 exp->type = 1;
10473 GetIntPtr(value, &intValue);
10474 Set(exp->instance->data, intValue);
10475 PopulateInstance(exp->instance);
10476 break;
10477 }
10478 case 7:
10479 {
10480 double doubleValue;
10481 void (* Set)(void *, double) = (void *)prop->Set;
10482
10483 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10484 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10485 exp->instance->_class = MkSpecifierName(_class->fullName);
10486 exp->instance->loc = exp->loc;
10487 exp->type = 1;
10488 GetDouble(value, &doubleValue);
10489 Set(exp->instance->data, doubleValue);
10490 PopulateInstance(exp->instance);
10491 break;
10492 }
10493 }
10494 }
10495 else if(_class->type == 2)
10496 {
10497 switch(type->kind)
10498 {
10499 case 8:
10500 {
10501 struct __ecereNameSpace__ecere__com__Class * propertyClass = type->_class->registered;
10502
10503 if(propertyClass->type == 1 && value->instance->data)
10504 {
10505 unsigned int (* Set)(void *) = (void *)prop->Set;
10506 unsigned int bits = Set(value->instance->data);
10507
10508 exp->constant = PrintHexUInt(bits);
10509 exp->type = 2;
10510 break;
10511 }
10512 else if(_class->type == 2)
10513 {
10514 unsigned int value;
10515 unsigned int (* Set)(unsigned int) = (void *)prop->Set;
10516 unsigned int bits;
10517
10518 GetUInt(exp->member.exp, &value);
10519 bits = Set(value);
10520 exp->constant = PrintHexUInt(bits);
10521 exp->type = 2;
10522 }
10523 }
10524 }
10525 }
10526 }
10527 else
10528 {
10529 if(_class->type == 2)
10530 {
10531 unsigned int value;
10532
10533 GetUInt(exp->member.exp, &value);
10534 switch(type->kind)
10535 {
10536 case 8:
10537 {
10538 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
10539
10540 if(_class->type == 1)
10541 {
10542 void (* Get)(unsigned int, void *) = (void *)prop->Get;
10543
10544 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10545 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10546 exp->instance->_class = MkSpecifierName(_class->fullName);
10547 exp->instance->loc = exp->loc;
10548 exp->type = 1;
10549 Get(value, exp->instance->data);
10550 PopulateInstance(exp->instance);
10551 }
10552 else if(_class->type == 2)
10553 {
10554 unsigned int (* Get)(unsigned int) = (void *)prop->Get;
10555 uint64 bits = Get(value);
10556
10557 exp->constant = PrintHexUInt64(bits);
10558 exp->type = 2;
10559 }
10560 break;
10561 }
10562 }
10563 }
10564 else if(_class->type == 1)
10565 {
10566 char * value = (exp->member.exp->type == 1) ? exp->member.exp->instance->data : (((void *)0));
10567
10568 switch(type->kind)
10569 {
10570 case 8:
10571 {
10572 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
10573
10574 if(_class->type == 1 && value)
10575 {
10576 void (* Get)(void *, void *) = (void *)prop->Get;
10577
10578 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10579 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10580 exp->instance->_class = MkSpecifierName(_class->fullName);
10581 exp->instance->loc = exp->loc;
10582 exp->type = 1;
10583 Get(value, exp->instance->data);
10584 PopulateInstance(exp->instance);
10585 }
10586 break;
10587 }
10588 }
10589 }
10590 }
10591 }
10592 }
10593 else
10594 {
10595 exp->isConstant = 0x0;
10596 }
10597 }
10598 else if(member)
10599 {
10600 }
10601 }
10602 if(exp->type != 8)
10603 {
10604 FreeExpression(memberExp);
10605 FreeIdentifier(memberID);
10606 }
10607 break;
10608 }
10609 case 10:
10610 {
10611 struct Type * type = ProcessType(exp->typeName->qualifiers, exp->typeName->declarator);
10612
10613 FreeExpContents(exp);
10614 exp->constant = PrintUInt(ComputeTypeSize(type));
10615 exp->type = 2;
10616 FreeType(type);
10617 break;
10618 }
10619 case 15:
10620 {
10621 struct Symbol * classSym = exp->_class->symbol;
10622
10623 if(classSym && classSym->registered)
10624 {
10625 if(classSym->registered->fixed)
10626 {
10627 FreeSpecifier(exp->_class);
10628 exp->constant = PrintUInt(classSym->registered->templateClass ? classSym->registered->templateClass->structSize : classSym->registered->structSize);
10629 exp->type = 2;
10630 }
10631 else
10632 {
10633 char className[1024];
10634
10635 strcpy(className, "__ecereClass_");
10636 FullClassNameCat(className, classSym->string, 0x1);
10637 MangleClassName(className);
10638 FreeExpContents(exp);
10639 exp->type = 9;
10640 exp->member.exp = MkExpIdentifier(MkIdentifier(className));
10641 exp->member.member = MkIdentifier("structSize");
10642 }
10643 }
10644 break;
10645 }
10646 case 11:
10647 {
10648 struct Type * type;
10649 struct Expression * e = exp;
10650
10651 if(exp->type == 11)
10652 {
10653 if(exp->cast.exp)
10654 ComputeExpression(exp->cast.exp);
10655 e = exp->cast.exp;
10656 }
10657 if(e && exp->expType)
10658 {
10659 type = exp->expType;
10660 if(type->kind == 8)
10661 {
10662 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
10663
10664 if(_class && (_class->type == 3 || _class->type == 2))
10665 {
10666 if(!_class->dataType)
10667 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
10668 type = _class->dataType;
10669 }
10670 }
10671 switch(type->kind)
10672 {
10673 case 1:
10674 if(type->isSigned)
10675 {
10676 char value;
10677
10678 GetChar(e, &value);
10679 FreeExpContents(exp);
10680 exp->constant = PrintChar(value);
10681 exp->type = 2;
10682 }
10683 else
10684 {
10685 unsigned char value;
10686
10687 GetUChar(e, &value);
10688 FreeExpContents(exp);
10689 exp->constant = PrintUChar(value);
10690 exp->type = 2;
10691 }
10692 break;
10693 case 2:
10694 if(type->isSigned)
10695 {
10696 short value;
10697
10698 GetShort(e, &value);
10699 FreeExpContents(exp);
10700 exp->constant = PrintShort(value);
10701 exp->type = 2;
10702 }
10703 else
10704 {
10705 unsigned short value;
10706
10707 GetUShort(e, &value);
10708 FreeExpContents(exp);
10709 exp->constant = PrintUShort(value);
10710 exp->type = 2;
10711 }
10712 break;
10713 case 3:
10714 if(type->isSigned)
10715 {
10716 int value;
10717
10718 GetInt(e, &value);
10719 FreeExpContents(exp);
10720 exp->constant = PrintInt(value);
10721 exp->type = 2;
10722 }
10723 else
10724 {
10725 unsigned int value;
10726
10727 GetUInt(e, &value);
10728 FreeExpContents(exp);
10729 exp->constant = PrintUInt(value);
10730 exp->type = 2;
10731 }
10732 break;
10733 case 4:
10734 if(type->isSigned)
10735 {
10736 long long value;
10737
10738 GetInt64(e, &value);
10739 FreeExpContents(exp);
10740 exp->constant = PrintInt64(value);
10741 exp->type = 2;
10742 }
10743 else
10744 {
10745 uint64 value;
10746
10747 GetUInt64(e, &value);
10748 FreeExpContents(exp);
10749 exp->constant = PrintUInt64(value);
10750 exp->type = 2;
10751 }
10752 break;
10753 case 22:
10754 if(type->isSigned)
10755 {
10756 intptr_t value;
10757
10758 GetIntPtr(e, &value);
10759 FreeExpContents(exp);
10760 exp->constant = PrintInt64((long long)value);
10761 exp->type = 2;
10762 }
10763 else
10764 {
10765 uintptr_t value;
10766
10767 GetUIntPtr(e, &value);
10768 FreeExpContents(exp);
10769 exp->constant = PrintUInt64((uint64)value);
10770 exp->type = 2;
10771 }
10772 break;
10773 case 6:
10774 {
10775 float value;
10776
10777 GetFloat(e, &value);
10778 FreeExpContents(exp);
10779 exp->constant = PrintFloat(value);
10780 exp->type = 2;
10781 break;
10782 }
10783 case 7:
10784 {
10785 double value;
10786
10787 GetDouble(e, &value);
10788 FreeExpContents(exp);
10789 exp->constant = PrintDouble(value);
10790 exp->type = 2;
10791 break;
10792 }
10793 }
10794 }
10795 break;
10796 }
10797 case 12:
10798 {
10799 struct Operand op1 = 
10800 {
10801 0, 0, 0, 0, 
10802 {
10803 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
10804 }
10805 };
10806 struct Operand op2 = 
10807 {
10808 0, 0, 0, 0, 
10809 {
10810 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
10811 }
10812 };
10813 struct Operand op3 = 
10814 {
10815 0, 0, 0, 0, 
10816 {
10817 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
10818 }
10819 };
10820
10821 if(exp->cond.exp)
10822 ComputeExpression((*exp->cond.exp).last);
10823 if(exp->cond.elseExp)
10824 ComputeExpression(exp->cond.elseExp);
10825 if(exp->cond.cond)
10826 ComputeExpression(exp->cond.cond);
10827 op1 = GetOperand(exp->cond.cond);
10828 if(op1.type)
10829 op1.type->refCount++;
10830 op2 = GetOperand((*exp->cond.exp).last);
10831 if(op2.type)
10832 op2.type->refCount++;
10833 op3 = GetOperand(exp->cond.elseExp);
10834 if(op3.type)
10835 op3.type->refCount++;
10836 if(op1.ops.Cond)
10837 {
10838 FreeExpContents(exp);
10839 op1.ops.Cond(exp, &op1, &op2, &op3);
10840 }
10841 if(op1.type)
10842 FreeType(op1.type);
10843 if(op2.type)
10844 FreeType(op2.type);
10845 if(op3.type)
10846 FreeType(op3.type);
10847 break;
10848 }
10849 }
10850 }
10851
10852 void ApplyAnyObjectLogic(struct Expression * e);
10853
10854 extern void CopyTypeInto(struct Type * type, struct Type * src);
10855
10856 static unsigned int CheckExpressionType(struct Expression * exp, struct Type * destType, unsigned int skipUnitBla)
10857 {
10858 unsigned int result = 0x1;
10859
10860 if(destType)
10861 {
10862 struct __ecereNameSpace__ecere__sys__OldList converts = 
10863 {
10864 0, 0, 0, 0, 0
10865 };
10866 struct Conversion * convert;
10867
10868 if(destType->kind == 0)
10869 return 0x0;
10870 if(!MatchTypeExpression(exp, destType, &converts, skipUnitBla))
10871 result = 0x0;
10872 if(converts.count)
10873 {
10874 for(convert = converts.first; convert; convert = convert->next)
10875 {
10876 unsigned int empty = !(convert->isGet ? (void *)convert->convert->Get : (void *)convert->convert->Set);
10877
10878 if(!empty)
10879 {
10880 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
10881 int objectType = exp->expType ? exp->expType->classObjectType : 0;
10882
10883 *newExp = *exp;
10884 newExp->destType = (((void *)0));
10885 if(convert->isGet)
10886 {
10887 exp->type = 8;
10888 exp->addedThis = 0x1;
10889 exp->member.exp = newExp;
10890 FreeType(exp->member.exp->expType);
10891 exp->member.exp->expType = MkClassType(convert->convert->_class->fullName);
10892 exp->member.exp->expType->classObjectType = objectType;
10893 exp->member.member = MkIdentifier(convert->convert->dataTypeString);
10894 exp->member.memberType = 1;
10895 exp->expType = convert->resultType ? convert->resultType : convert->convert->dataType;
10896 exp->needCast = 0x1;
10897 if(exp->expType)
10898 exp->expType->refCount++;
10899 ApplyAnyObjectLogic(exp->member.exp);
10900 }
10901 else
10902 {
10903 {
10904 exp->type = 8;
10905 exp->addedThis = 0x1;
10906 exp->member.exp = newExp;
10907 if(newExp->expType && newExp->expType->kind == 8 && newExp->expType->_class && newExp->expType->_class->registered && newExp->expType->_class->registered->type == 5)
10908 {
10909 newExp->byReference = 0x1;
10910 }
10911 FreeType(exp->member.exp->expType);
10912 exp->member.exp->expType = (((void *)0));
10913 if(convert->convert->dataType)
10914 {
10915 exp->member.exp->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
10916 CopyTypeInto(exp->member.exp->expType, convert->convert->dataType);
10917 exp->member.exp->expType->refCount = 1;
10918 exp->member.exp->expType->classObjectType = objectType;
10919 ApplyAnyObjectLogic(exp->member.exp);
10920 }
10921 exp->member.member = MkIdentifier(convert->convert->_class->fullName);
10922 exp->member.memberType = 4;
10923 exp->expType = convert->resultType ? convert->resultType : MkClassType(convert->convert->_class->fullName);
10924 exp->needCast = 0x1;
10925 if(convert->resultType)
10926 convert->resultType->refCount++;
10927 }
10928 }
10929 }
10930 else
10931 {
10932 FreeType(exp->expType);
10933 if(convert->isGet)
10934 {
10935 exp->expType = convert->resultType ? convert->resultType : convert->convert->dataType;
10936 exp->needCast = 0x1;
10937 if(exp->expType)
10938 exp->expType->refCount++;
10939 }
10940 else
10941 {
10942 exp->expType = convert->resultType ? convert->resultType : MkClassType(convert->convert->_class->fullName);
10943 exp->needCast = 0x1;
10944 if(convert->resultType)
10945 convert->resultType->refCount++;
10946 }
10947 }
10948 }
10949 if(exp->isConstant && inCompiler)
10950 ComputeExpression(exp);
10951 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(&converts, FreeConvert);
10952 }
10953 if(!result && exp->expType && converts.count)
10954 {
10955 result = MatchTypes(exp->expType, exp->destType, (((void *)0)), (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0);
10956 }
10957 if(!result && exp->expType && exp->destType)
10958 {
10959 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))
10960 result = 0x1;
10961 }
10962 }
10963 return result;
10964 }
10965
10966 extern struct Statement * MkCompoundStmt(struct __ecereNameSpace__ecere__sys__OldList * declarations, struct __ecereNameSpace__ecere__sys__OldList * statements);
10967
10968 extern struct Statement * MkExpressionStmt(struct __ecereNameSpace__ecere__sys__OldList * expressions);
10969
10970 extern struct Expression * MkExpMember(struct Expression * expression, struct Identifier * member);
10971
10972 void CheckTemplateTypes(struct Expression * exp)
10973 {
10974 if(exp->destType && exp->destType->passAsTemplate && exp->expType && exp->expType->kind != 20 && !exp->expType->passAsTemplate)
10975 {
10976 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
10977 struct Statement * compound;
10978 struct Context * context;
10979
10980 *newExp = *exp;
10981 if(exp->destType)
10982 exp->destType->refCount++;
10983 if(exp->expType)
10984 exp->expType->refCount++;
10985 newExp->prev = (((void *)0));
10986 newExp->next = (((void *)0));
10987 switch(exp->expType->kind)
10988 {
10989 case 7:
10990 if(exp->destType->classObjectType)
10991 {
10992 if(exp->destType)
10993 exp->destType->refCount--;
10994 if(exp->expType)
10995 exp->expType->refCount--;
10996 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
10997 }
10998 else
10999 {
11000 struct __ecereNameSpace__ecere__sys__OldList * specs;
11001 struct __ecereNameSpace__ecere__sys__OldList * unionDefs = MkList();
11002 struct __ecereNameSpace__ecere__sys__OldList * statements = MkList();
11003
11004 context = PushContext();
11005 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(DOUBLE)), MkListOne(MkDeclaratorIdentifier(MkIdentifier("d"))), (((void *)0)))));
11006 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifierName("uint64")), MkListOne(MkDeclaratorIdentifier(MkIdentifier("i"))), (((void *)0)))));
11007 specs = MkListOne(MkStructOrUnion(4, (((void *)0)), unionDefs));
11008 exp->type = 25;
11009 exp->compound = MkCompoundStmt(MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internal_union")), (((void *)0)))))), statements);
11010 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("d")), '=', newExp))));
11011 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("i")))));
11012 exp->compound->compound.context = context;
11013 PopContext(context);
11014 }
11015 break;
11016 default:
11017 exp->type = 11;
11018 exp->cast.typeName = MkTypeName(MkListOne(MkSpecifierName("uint64")), (((void *)0)));
11019 exp->cast.exp = MkExpBrackets(MkListOne(newExp));
11020 break;
11021 }
11022 }
11023 else if(exp->expType && exp->expType->passAsTemplate && exp->destType && ((unsigned int)((exp->usage & 0x1) >> 0)) && exp->destType->kind != 20 && !exp->destType->passAsTemplate)
11024 {
11025 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
11026 struct Statement * compound;
11027 struct Context * context;
11028
11029 *newExp = *exp;
11030 if(exp->destType)
11031 exp->destType->refCount++;
11032 if(exp->expType)
11033 exp->expType->refCount++;
11034 newExp->prev = (((void *)0));
11035 newExp->next = (((void *)0));
11036 switch(exp->expType->kind)
11037 {
11038 case 7:
11039 if(exp->destType->classObjectType)
11040 {
11041 if(exp->destType)
11042 exp->destType->refCount--;
11043 if(exp->expType)
11044 exp->expType->refCount--;
11045 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
11046 }
11047 else
11048 {
11049 struct __ecereNameSpace__ecere__sys__OldList * specs;
11050 struct __ecereNameSpace__ecere__sys__OldList * unionDefs = MkList();
11051 struct __ecereNameSpace__ecere__sys__OldList * statements = MkList();
11052
11053 context = PushContext();
11054 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(DOUBLE)), MkListOne(MkDeclaratorIdentifier(MkIdentifier("d"))), (((void *)0)))));
11055 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifierName("uint64")), MkListOne(MkDeclaratorIdentifier(MkIdentifier("i"))), (((void *)0)))));
11056 specs = MkListOne(MkStructOrUnion(4, (((void *)0)), unionDefs));
11057 exp->type = 25;
11058 exp->compound = MkCompoundStmt(MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internal_union")), (((void *)0)))))), statements);
11059 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("i")), '=', newExp))));
11060 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("d")))));
11061 exp->compound->compound.context = context;
11062 PopContext(context);
11063 }
11064 break;
11065 case 8:
11066 {
11067 if(exp->expType->_class && exp->expType->_class->registered && exp->expType->_class->registered->type == 1)
11068 {
11069 exp->type = 5;
11070 exp->list = MkListOne(MkExpOp((((void *)0)), '*', MkExpCast(MkTypeName(MkListOne(MkSpecifierName(exp->expType->_class->string)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), newExp)));
11071 ProcessExpressionType((*exp->list).first);
11072 break;
11073 }
11074 else
11075 {
11076 exp->type = 5;
11077 exp->list = MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName(exp->expType->_class->string)), (((void *)0))), newExp));
11078 newExp->needCast = 0x1;
11079 ProcessExpressionType((*exp->list).first);
11080 break;
11081 }
11082 }
11083 default:
11084 {
11085 if(exp->expType->kind == 20)
11086 {
11087 struct Type * type = ProcessTemplateParameterType(exp->expType->templateParameter);
11088
11089 if(type)
11090 {
11091 FreeType(exp->destType);
11092 FreeType(exp->expType);
11093 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
11094 break;
11095 }
11096 }
11097 if(newExp->type == 8 && newExp->member.memberType == 3)
11098 {
11099 exp->type = 4;
11100 exp->op.op = '*';
11101 exp->op.exp1 = (((void *)0));
11102 exp->op.exp2 = MkExpCast(MkTypeName(MkListOne(MkSpecifierName("uint64")), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), MkExpBrackets(MkListOne(MkExpOp((((void *)0)), '&', newExp))));
11103 }
11104 else
11105 {
11106 char typeString[1024];
11107 struct Declarator * decl;
11108 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
11109
11110 typeString[0] = '\0';
11111 PrintType(exp->expType, typeString, 0x0, 0x0);
11112 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
11113 exp->type = 11;
11114 exp->cast.typeName = MkTypeName(specs, decl);
11115 exp->cast.exp = MkExpBrackets(MkListOne(newExp));
11116 exp->cast.exp->needCast = 0x1;
11117 }
11118 break;
11119 }
11120 }
11121 }
11122 }
11123
11124 extern int strncmp(const char * , const char * , int n);
11125
11126 struct __ecereNameSpace__ecere__sys__BTNode * __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindPrefix(struct __ecereNameSpace__ecere__sys__BinaryTree * this, char *  key);
11127
11128 static struct Symbol * ScanWithNameSpace(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, char * nameSpace, char * name)
11129 {
11130 int nsLen = strlen(nameSpace);
11131 struct Symbol * symbol;
11132
11133 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)))
11134 {
11135 char * s = symbol->string;
11136
11137 if(!strncmp(s, nameSpace, nsLen))
11138 {
11139 int c;
11140 char * namePart;
11141
11142 for(c = strlen(s) - 1; c >= 0; c--)
11143 if(s[c] == ':')
11144 break;
11145 namePart = s + c + 1;
11146 if(!strcmp(namePart, name))
11147 {
11148 return symbol;
11149 }
11150 }
11151 else
11152 break;
11153 }
11154 return (((void *)0));
11155 }
11156
11157 static struct Symbol * FindWithNameSpace(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, char * name)
11158 {
11159 int c;
11160 char nameSpace[1024];
11161 char * namePart;
11162 unsigned int gotColon = 0x0;
11163
11164 nameSpace[0] = '\0';
11165 for(c = strlen(name) - 1; c >= 0; c--)
11166 if(name[c] == ':')
11167 {
11168 gotColon = 0x1;
11169 break;
11170 }
11171 namePart = name + c + 1;
11172 while(c >= 0 && name[c] == ':')
11173 c--;
11174 if(c >= 0)
11175 {
11176 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, name);
11177
11178 if(symbol)
11179 return symbol;
11180 memcpy(nameSpace, name, c + 1);
11181 nameSpace[c + 1] = (char)0;
11182 return ScanWithNameSpace(tree, nameSpace, namePart);
11183 }
11184 else if(gotColon)
11185 {
11186 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, namePart);
11187
11188 return symbol;
11189 }
11190 else
11191 {
11192 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, namePart);
11193
11194 if(symbol)
11195 return symbol;
11196 return ScanWithNameSpace(tree, "", namePart);
11197 }
11198 return (((void *)0));
11199 }
11200
11201 static void ProcessDeclaration(struct Declaration * decl);
11202
11203 struct Symbol * FindSymbol(char * name, struct Context * startContext, struct Context * endContext, unsigned int isStruct, unsigned int globalNameSpace)
11204 {
11205 struct Context * ctx;
11206 struct Symbol * symbol = (((void *)0));
11207
11208 for(ctx = startContext; ctx && !symbol; ctx = ctx->parent)
11209 {
11210 if(ctx == globalContext && !globalNameSpace && ctx->hasNameSpace)
11211 {
11212 symbol = (((void *)0));
11213 if(thisNameSpace)
11214 {
11215 char curName[1024];
11216
11217 strcpy(curName, thisNameSpace);
11218 strcat(curName, "::");
11219 strcat(curName, name);
11220 symbol = FindWithNameSpace(isStruct ? &ctx->structSymbols : &ctx->symbols, curName);
11221 }
11222 if(!symbol)
11223 symbol = FindWithNameSpace(isStruct ? &ctx->structSymbols : &ctx->symbols, name);
11224 }
11225 else
11226 symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString((isStruct ? &ctx->structSymbols : &ctx->symbols), name);
11227 if(symbol || ctx == endContext)
11228 break;
11229 }
11230 if(inCompiler && curExternal && symbol && ctx == globalContext && curExternal->symbol && symbol->id > curExternal->symbol->idCode && symbol->pointerExternal)
11231 {
11232 if(symbol->pointerExternal->type == 0)
11233 {
11234 struct FunctionDefinition * function = symbol->pointerExternal->function;
11235 struct Context * tmpContext = curContext;
11236
11237 curContext = (((void *)0));
11238 symbol->pointerExternal = MkExternalDeclaration(MkDeclaration(CopyList(function->specifiers, CopySpecifier), MkListOne(MkInitDeclarator(CopyDeclarator(function->declarator), (((void *)0))))));
11239 curContext = tmpContext;
11240 symbol->pointerExternal->symbol = symbol;
11241 DeclareType(symbol->type, 0x1, 0x1);
11242 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, symbol->pointerExternal);
11243 symbol->id = curExternal->symbol->idCode;
11244 }
11245 else if(symbol->pointerExternal->type == 1 && curExternal->symbol->idCode < symbol->pointerExternal->symbol->id)
11246 {
11247 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
11248 symbol->id = curExternal->symbol->idCode;
11249 }
11250 }
11251 return symbol;
11252 }
11253
11254 static void GetTypeSpecs(struct Type * type, struct __ecereNameSpace__ecere__sys__OldList * specs)
11255 {
11256 if(!type->isSigned && type->kind != 22)
11257 ListAdd(specs, MkSpecifier(UNSIGNED));
11258 switch(type->kind)
11259 {
11260 case 8:
11261 {
11262 if(type->_class->registered)
11263 {
11264 if(!type->_class->registered->dataType)
11265 type->_class->registered->dataType = ProcessTypeString(type->_class->registered->dataTypeString, 0x0);
11266 GetTypeSpecs(type->_class->registered->dataType, specs);
11267 }
11268 break;
11269 }
11270 case 7:
11271 ListAdd(specs, MkSpecifier(DOUBLE));
11272 break;
11273 case 6:
11274 ListAdd(specs, MkSpecifier(FLOAT));
11275 break;
11276 case 1:
11277 ListAdd(specs, MkSpecifier(CHAR));
11278 break;
11279 case 2:
11280 ListAdd(specs, MkSpecifier(SHORT));
11281 break;
11282 case 4:
11283 ListAdd(specs, MkSpecifier(INT64));
11284 break;
11285 case 22:
11286 ListAdd(specs, MkSpecifierName(type->isSigned ? "intptr" : "uintptr"));
11287 break;
11288 case 3:
11289 default:
11290 ListAdd(specs, MkSpecifier(INT));
11291 break;
11292 }
11293 }
11294
11295 extern char *  __ecereNameSpace__ecere__sys__RSearchString(char *  buffer, char *  subStr, int maxLen, unsigned int matchCase, unsigned int matchWord);
11296
11297 static void _PrintType(struct Type * type, char * string, unsigned int printName, unsigned int printFunction, unsigned int fullName)
11298 {
11299 if(type)
11300 {
11301 switch(type->kind)
11302 {
11303 case 8:
11304 if(type->_class && type->_class->string)
11305 {
11306 if(type->classObjectType == 2)
11307 strcat(string, "typed_object");
11308 else if(fullName)
11309 strcat(string, type->_class->string);
11310 else
11311 {
11312 if(type->_class->registered)
11313 strcat(string, type->_class->registered->name);
11314 else
11315 strcat(string, type->_class->string);
11316 }
11317 }
11318 break;
11319 case 13:
11320 {
11321 {
11322 _PrintType(type->type, string, 0x0, printFunction, fullName);
11323 strcat(string, " *");
11324 }
11325 break;
11326 }
11327 case 0:
11328 strcat(string, "void");
11329 break;
11330 case 3:
11331 strcat(string, type->isSigned ? "int" : "uint");
11332 break;
11333 case 4:
11334 strcat(string, type->isSigned ? "int64" : "uint64");
11335 break;
11336 case 22:
11337 strcat(string, type->isSigned ? "intptr" : "uintptr");
11338 break;
11339 case 1:
11340 strcat(string, type->isSigned ? "char" : "byte");
11341 break;
11342 case 2:
11343 strcat(string, type->isSigned ? "short" : "uint16");
11344 break;
11345 case 6:
11346 strcat(string, "float");
11347 break;
11348 case 7:
11349 strcat(string, "double");
11350 break;
11351 case 9:
11352 if(type->enumName)
11353 {
11354 strcat(string, "struct ");
11355 strcat(string, type->enumName);
11356 }
11357 else if(type->typeName)
11358 {
11359 strcat(string, type->typeName);
11360 }
11361 else
11362 {
11363 struct Type * member;
11364
11365 strcat(string, "struct {");
11366 for(member = type->members.first; member; member = member->next)
11367 {
11368 PrintType(member, string, 0x1, fullName);
11369 strcat(string, "; ");
11370 }
11371 strcat(string, "}");
11372 }
11373 break;
11374 case 10:
11375 if(type->enumName)
11376 {
11377 strcat(string, "union ");
11378 strcat(string, type->enumName);
11379 }
11380 else if(type->typeName)
11381 {
11382 strcat(string, type->typeName);
11383 }
11384 else
11385 {
11386 strcat(string, "union ");
11387 strcat(string, "(unnamed)");
11388 }
11389 break;
11390 case 15:
11391 if(type->enumName)
11392 {
11393 strcat(string, "enum ");
11394 strcat(string, type->enumName);
11395 }
11396 else if(type->typeName)
11397 {
11398 strcat(string, type->typeName);
11399 }
11400 else
11401 strcat(string, "enum");
11402 break;
11403 case 11:
11404 {
11405 if(printFunction)
11406 {
11407 if(type->dllExport)
11408 strcat(string, "dllexport ");
11409 PrintType(type->returnType, string, 0x0, fullName);
11410 strcat(string, " ");
11411 }
11412 if(printName)
11413 {
11414 if(type->name)
11415 {
11416 if(fullName)
11417 strcat(string, type->name);
11418 else
11419 {
11420 char * name = __ecereNameSpace__ecere__sys__RSearchString(type->name, "::", strlen(type->name), 0x1, 0x0);
11421
11422 if(name)
11423 name += 2;
11424 else
11425 name = type->name;
11426 strcat(string, name);
11427 }
11428 }
11429 }
11430 if(printFunction)
11431 {
11432 struct Type * param;
11433
11434 strcat(string, "(");
11435 for(param = type->params.first; param; param = param->next)
11436 {
11437 PrintType(param, string, 0x1, fullName);
11438 if(param->next)
11439 strcat(string, ", ");
11440 }
11441 strcat(string, ")");
11442 }
11443 break;
11444 }
11445 case 12:
11446 {
11447 {
11448 char baseType[1024], size[256];
11449 struct Type * arrayType = type;
11450
11451 baseType[0] = '\0';
11452 size[0] = '\0';
11453 while(arrayType->kind == 12)
11454 {
11455 strcat(size, "[");
11456 if(arrayType->enumClass)
11457 strcat(size, arrayType->enumClass->string);
11458 else if(arrayType->arraySizeExp)
11459 PrintExpression(arrayType->arraySizeExp, size);
11460 strcat(size, "]");
11461 arrayType = arrayType->arrayType;
11462 }
11463 _PrintType(arrayType, baseType, printName, printFunction, fullName);
11464 strcat(string, baseType);
11465 strcat(string, size);
11466 }
11467 printName = 0x0;
11468 break;
11469 }
11470 case 14:
11471 strcat(string, "...");
11472 break;
11473 case 16:
11474 _PrintType(type->method->dataType, string, 0x0, printFunction, fullName);
11475 break;
11476 case 19:
11477 strcat(string, "subclass(");
11478 strcat(string, type->_class ? type->_class->string : "int");
11479 strcat(string, ")");
11480 break;
11481 case 20:
11482 strcat(string, type->templateParameter->identifier->string);
11483 break;
11484 case 21:
11485 strcat(string, "thisclass");
11486 break;
11487 case 17:
11488 strcat(string, "__builtin_va_list");
11489 break;
11490 }
11491 if(type->name && printName && type->kind != 11 && (type->kind != 13 || type->type->kind != 11))
11492 {
11493 strcat(string, " ");
11494 strcat(string, type->name);
11495 }
11496 }
11497 }
11498
11499 void PrintType(struct Type * type, char * string, unsigned int printName, unsigned int fullName)
11500 {
11501 struct Type * funcType;
11502
11503 for(funcType = type; funcType && (funcType->kind == 13 || funcType->kind == 12); funcType = funcType->type)
11504 ;
11505 if(funcType && funcType->kind == 11 && type != funcType)
11506 {
11507 char typeString[1024];
11508 struct Type * param;
11509
11510 PrintType(funcType->returnType, string, 0x0, fullName);
11511 strcat(string, "(");
11512 _PrintType(type, string, printName, 0x0, fullName);
11513 strcat(string, ")");
11514 strcat(string, "(");
11515 for(param = funcType->params.first; param; param = param->next)
11516 {
11517 PrintType(param, string, 0x1, fullName);
11518 if(param->next)
11519 strcat(string, ", ");
11520 }
11521 strcat(string, ")");
11522 }
11523 else
11524 _PrintType(type, string, printName, 0x1, fullName);
11525 if(type->bitFieldCount)
11526 {
11527 char count[100];
11528
11529 sprintf(count, ":%d", type->bitFieldCount);
11530 strcat(string, count);
11531 }
11532 }
11533
11534 static struct Type * FindMember(struct Type * type, char * string)
11535 {
11536 struct Type * memberType;
11537
11538 for(memberType = type->members.first; memberType; memberType = memberType->next)
11539 {
11540 if(!memberType->name)
11541 {
11542 struct Type * subType = FindMember(memberType, string);
11543
11544 if(subType)
11545 return subType;
11546 }
11547 else if(!strcmp(memberType->name, string))
11548 return memberType;
11549 }
11550 return (((void *)0));
11551 }
11552
11553 struct Type * FindMemberAndOffset(struct Type * type, char * string, unsigned int * offset)
11554 {
11555 struct Type * memberType;
11556
11557 for(memberType = type->members.first; memberType; memberType = memberType->next)
11558 {
11559 if(!memberType->name)
11560 {
11561 struct Type * subType = FindMember(memberType, string);
11562
11563 if(subType)
11564 {
11565 *offset += memberType->offset;
11566 return subType;
11567 }
11568 }
11569 else if(!strcmp(memberType->name, string))
11570 {
11571 *offset += memberType->offset;
11572 return memberType;
11573 }
11574 }
11575 return (((void *)0));
11576 }
11577
11578 extern struct __ecereNameSpace__ecere__com__Instance * fileInput;
11579
11580 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Write;
11581
11582 struct Expression * ParseExpressionString(char * expression)
11583 {
11584 fileInput = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
11585 ((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));
11586 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))fileInput->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(fileInput, 0, 0);
11587 echoOn = 0x0;
11588 parsedExpression = (((void *)0));
11589 resetScanner();
11590 expression_yyparse();
11591 (__ecereNameSpace__ecere__com__eInstance_DecRef(fileInput), fileInput = 0);
11592 return parsedExpression;
11593 }
11594
11595 extern char *  QMkString(char *  source);
11596
11597 static unsigned int ResolveIdWithClass(struct Expression * exp, struct __ecereNameSpace__ecere__com__Class * _class, unsigned int skipIDClassCheck)
11598 {
11599 void * __ecereTemp1;
11600 struct Identifier * id = exp->identifier;
11601 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
11602 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
11603 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
11604 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
11605
11606 if(_class && _class->type == 4)
11607 {
11608 struct __ecereNameSpace__ecere__sys__NamedLink * value = (((void *)0));
11609 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
11610
11611 if(enumClass)
11612 {
11613 struct __ecereNameSpace__ecere__com__Class * baseClass;
11614
11615 for(baseClass = _class; baseClass && baseClass->type == 4; baseClass = baseClass->base)
11616 {
11617 struct __ecereNameSpace__ecere__com__EnumClassData * e = (baseClass ? ((void *)(((char *)baseClass->data) + enumClass->offsetClass)) : (((void *)0)));
11618
11619 for(value = e->values.first; value; value = value->next)
11620 {
11621 if(!strcmp(value->name, id->string))
11622 break;
11623 }
11624 if(value)
11625 {
11626 char constant[256];
11627
11628 FreeExpContents(exp);
11629 exp->type = 2;
11630 exp->isConstant = 0x1;
11631 if(!strcmp(baseClass->dataTypeString, "int"))
11632 sprintf(constant, "%d", value->data);
11633 else
11634 sprintf(constant, "0x%X", value->data);
11635 exp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
11636 exp->expType = MkClassType(baseClass->fullName);
11637 break;
11638 }
11639 }
11640 }
11641 if(value)
11642 return 0x1;
11643 }
11644 if((method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule)))
11645 {
11646 ProcessMethodType(method);
11647 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));
11648 return 0x1;
11649 }
11650 else if((prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule)))
11651 {
11652 if(!prop->dataType)
11653 ProcessPropertyType(prop);
11654 exp->expType = prop->dataType;
11655 if(prop->dataType)
11656 prop->dataType->refCount++;
11657 return 0x1;
11658 }
11659 else if((member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)))))
11660 {
11661 if(!member->dataType)
11662 member->dataType = ProcessTypeString(member->dataTypeString, 0x0);
11663 exp->expType = member->dataType;
11664 if(member->dataType)
11665 member->dataType->refCount++;
11666 return 0x1;
11667 }
11668 else if((classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(_class, id->string)))
11669 {
11670 if(!classProp->dataType)
11671 classProp->dataType = ProcessTypeString(classProp->dataTypeString, 0x0);
11672 if(classProp->constant)
11673 {
11674 FreeExpContents(exp);
11675 exp->isConstant = 0x1;
11676 if(classProp->dataType->kind == 13 && classProp->dataType->type->kind == 1)
11677 {
11678 exp->type = 3;
11679 exp->constant = QMkString((char *)classProp->Get(_class));
11680 }
11681 else
11682 {
11683 char constant[256];
11684
11685 exp->type = 2;
11686 sprintf(constant, "%d", classProp->Get(_class));
11687 exp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
11688 }
11689 }
11690 else
11691 {
11692 }
11693 exp->expType = classProp->dataType;
11694 if(classProp->dataType)
11695 classProp->dataType->refCount++;
11696 return 0x1;
11697 }
11698 return 0x0;
11699 }
11700
11701 static struct GlobalData * ScanGlobalData(struct __ecereNameSpace__ecere__com__NameSpace * nameSpace, char * name)
11702 {
11703 struct __ecereNameSpace__ecere__sys__BinaryTree * tree = &nameSpace->functions;
11704 struct GlobalData * data = (struct GlobalData *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString((&*tree), name);
11705 struct __ecereNameSpace__ecere__com__NameSpace * child;
11706
11707 if(!data)
11708 {
11709 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)))
11710 {
11711 data = ScanGlobalData(child, name);
11712 if(data)
11713 break;
11714 }
11715 }
11716 return data;
11717 }
11718
11719 extern struct __ecereNameSpace__ecere__com__NameSpace *  globalData;
11720
11721 extern char *  strncpy(char * , const char * , int n);
11722
11723 static struct GlobalData * FindGlobalData(char * name)
11724 {
11725 int start = 0, c;
11726 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
11727
11728 nameSpace = globalData;
11729 for(c = 0; name[c]; c++)
11730 {
11731 if(name[c] == '.' || (name[c] == ':' && name[c + 1] == ':'))
11732 {
11733 struct __ecereNameSpace__ecere__com__NameSpace * newSpace;
11734 char * spaceName = __ecereNameSpace__ecere__com__eSystem_New(sizeof(char) * (c - start + 1));
11735
11736 strncpy(spaceName, name + start, c - start);
11737 spaceName[c - start] = '\0';
11738 newSpace = (struct __ecereNameSpace__ecere__com__NameSpace *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(&(*nameSpace).nameSpaces, spaceName);
11739 (__ecereNameSpace__ecere__com__eSystem_Delete(spaceName), spaceName = 0);
11740 if(!newSpace)
11741 return (((void *)0));
11742 nameSpace = newSpace;
11743 if(name[c] == ':')
11744 c++;
11745 start = c + 1;
11746 }
11747 }
11748 if(c - start)
11749 {
11750 return ScanGlobalData(nameSpace, name + start);
11751 }
11752 return (((void *)0));
11753 }
11754
11755 static int definedExpStackPos;
11756
11757 static void * definedExpStack[512];
11758
11759 void ReplaceExpContents(struct Expression * checkedExp, struct Expression * newExp)
11760 {
11761 struct Expression * prev = checkedExp->prev, * next = checkedExp->next;
11762
11763 FreeExpContents(checkedExp);
11764 FreeType(checkedExp->expType);
11765 FreeType(checkedExp->destType);
11766 *checkedExp = *newExp;
11767 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
11768 checkedExp->prev = prev;
11769 checkedExp->next = next;
11770 }
11771
11772 extern struct Expression * MkExpCall(struct Expression * expression, struct __ecereNameSpace__ecere__sys__OldList * arguments);
11773
11774 extern int printf(char * , ...);
11775
11776 void __ecereMethod_Expression_Clear();
11777
11778 void ApplyAnyObjectLogic(struct Expression * e)
11779 {
11780 struct Type * destType = e->destType;
11781
11782 if(destType && (destType->classObjectType == 3))
11783 {
11784 if(e && e->expType)
11785 {
11786 struct Type * type = e->expType;
11787 struct __ecereNameSpace__ecere__com__Class * _class = (((void *)0));
11788
11789 if(type->kind == 8 && type->_class && type->_class->registered)
11790 {
11791 _class = type->_class->registered;
11792 }
11793 else if(type->kind == 19)
11794 {
11795 _class = FindClass("ecere::com::Class")->registered;
11796 }
11797 else
11798 {
11799 char string[1024] = "";
11800 struct Symbol * classSym;
11801
11802 PrintType(type, string, 0x0, 0x1);
11803 classSym = FindClass(string);
11804 if(classSym)
11805 _class = classSym->registered;
11806 }
11807 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)))
11808 {
11809 if(!_class || strcmp(_class->fullName, "char *"))
11810 {
11811 struct Expression * checkedExp = e, * newExp;
11812
11813 while(((checkedExp->type == 5 || checkedExp->type == 34 || checkedExp->type == 25) && checkedExp->list) || checkedExp->type == 11)
11814 {
11815 if(checkedExp->type == 5 || checkedExp->type == 34 || checkedExp->type == 25)
11816 {
11817 if(checkedExp->type == 25)
11818 {
11819 checkedExp = (*((struct Statement *)(*checkedExp->compound->compound.statements).last)->expressions).last;
11820 }
11821 else
11822 checkedExp = (*checkedExp->list).last;
11823 }
11824 else if(checkedExp->type == 11)
11825 checkedExp = checkedExp->cast.exp;
11826 }
11827 if(checkedExp && checkedExp->type == 4 && checkedExp->op.op == '*' && !checkedExp->op.exp1)
11828 {
11829 newExp = checkedExp->op.exp2;
11830 checkedExp->op.exp2 = (((void *)0));
11831 FreeExpContents(checkedExp);
11832 if(e->expType && e->expType->passAsTemplate)
11833 {
11834 char size[100];
11835
11836 ComputeTypeSize(e->expType);
11837 sprintf(size, "%d", e->expType->size);
11838 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))))));
11839 }
11840 ReplaceExpContents(checkedExp, newExp);
11841 e->byReference = 0x1;
11842 }
11843 else if(!e->byReference || (_class && _class->type == 5))
11844 {
11845 struct Expression * checkedExp, * newExp;
11846
11847 {
11848 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;
11849
11850 if(_class && _class->type != 5 && _class->type != 0 && _class->type != 1 && !hasAddress)
11851 {
11852 struct Context * context = PushContext();
11853 struct Declarator * decl;
11854 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
11855 char typeString[1024];
11856 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
11857
11858 typeString[0] = '\0';
11859 *newExp = *e;
11860 newExp->prev = (((void *)0));
11861 newExp->next = (((void *)0));
11862 newExp->expType = (((void *)0));
11863 PrintType(e->expType, typeString, 0x0, 0x1);
11864 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
11865 newExp->destType = ProcessType(specs, decl);
11866 curContext = context;
11867 e->type = 25;
11868 if(curCompound)
11869 {
11870 char name[100];
11871 struct __ecereNameSpace__ecere__sys__OldList * stmts = MkList();
11872
11873 sprintf(name, "__internalValue%03X", internalValueCounter++);
11874 if(!curCompound->compound.declarations)
11875 curCompound->compound.declarations = MkList();
11876 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*curCompound->compound.declarations), (((void *)0)), MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(name)), (((void *)0))))));
11877 ListAdd(stmts, MkExpressionStmt(MkListOne(MkExpOp(MkExpIdentifier(MkIdentifier(name)), '=', newExp))));
11878 ListAdd(stmts, MkExpressionStmt(MkListOne(MkExpIdentifier(MkIdentifier(name)))));
11879 e->compound = MkCompoundStmt((((void *)0)), stmts);
11880 }
11881 else
11882 printf("libec: compiler error, curCompound is null in ApplyAnyObjectLogic\n");
11883 {
11884 struct Type * type = e->destType;
11885
11886 e->destType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
11887 CopyTypeInto(e->destType, type);
11888 e->destType->refCount = 1;
11889 e->destType->classObjectType = 0;
11890 FreeType(type);
11891 }
11892 e->compound->compound.context = context;
11893 PopContext(context);
11894 curContext = context->parent;
11895 }
11896 }
11897 checkedExp = e;
11898 while(((checkedExp->type == 5 || checkedExp->type == 34 || checkedExp->type == 25) && checkedExp->list) || checkedExp->type == 11)
11899 {
11900 if(checkedExp->type == 5 || checkedExp->type == 34 || checkedExp->type == 25)
11901 {
11902 if(checkedExp->type == 25)
11903 {
11904 checkedExp = (*((struct Statement *)(*checkedExp->compound->compound.statements).last)->expressions).last;
11905 }
11906 else
11907 checkedExp = (*checkedExp->list).last;
11908 }
11909 else if(checkedExp->type == 11)
11910 checkedExp = checkedExp->cast.exp;
11911 }
11912 {
11913 struct Expression * operand = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
11914
11915 *operand = *checkedExp;
11916 checkedExp->destType = (((void *)0));
11917 checkedExp->expType = (((void *)0));
11918 __ecereMethod_Expression_Clear(checkedExp);
11919 checkedExp->type = 4;
11920 checkedExp->op.op = '&';
11921 checkedExp->op.exp1 = (((void *)0));
11922 checkedExp->op.exp2 = operand;
11923 }
11924 }
11925 }
11926 }
11927 }
11928 }
11929 {
11930 }
11931 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))))
11932 {
11933 if(e->expType->kind == 8 && e->expType->_class && e->expType->_class->registered && !strcmp(e->expType->_class->registered->name, "class"))
11934 {
11935 return ;
11936 }
11937 else
11938 {
11939 struct Expression * thisExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
11940
11941 *thisExp = *e;
11942 thisExp->prev = (((void *)0));
11943 thisExp->next = (((void *)0));
11944 __ecereMethod_Expression_Clear(e);
11945 e->type = 5;
11946 e->list = MkListOne(MkExpOp((((void *)0)), '*', MkExpBrackets(MkListOne(thisExp))));
11947 if(thisExp->expType->kind == 8 && thisExp->expType->_class && thisExp->expType->_class->registered && thisExp->expType->_class->registered->type == 5)
11948 ((struct Expression *)(*e->list).first)->byReference = 0x1;
11949 {
11950 e->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
11951 CopyTypeInto(e->expType, thisExp->expType);
11952 e->expType->byReference = 0x0;
11953 e->expType->refCount = 1;
11954 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))
11955 {
11956 e->expType->classObjectType = 0;
11957 }
11958 }
11959 }
11960 }
11961 else if(destType && e->expType && (e->expType->classObjectType == 3 || e->expType->classObjectType == 2) && !destType->classObjectType && destType->kind != 0)
11962 {
11963 if(destType->kind == 14)
11964 {
11965 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Unspecified type\n", (((void *)0))));
11966 }
11967 else if(!(destType->truth && e->expType->kind == 8 && e->expType->_class && e->expType->_class->registered && e->expType->_class->registered->type == 1))
11968 {
11969 unsigned int byReference = e->expType->byReference;
11970 struct Expression * thisExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
11971 struct Declarator * decl;
11972 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
11973 char typeString[1024];
11974 struct Type * type;
11975 int backupClassObjectType;
11976
11977 if(e->expType->kind == 8 && e->expType->_class && e->expType->_class->registered && strcmp(e->expType->_class->registered->name, "class"))
11978 type = e->expType;
11979 else
11980 type = destType;
11981 backupClassObjectType = type->classObjectType;
11982 type->classObjectType = 0;
11983 typeString[0] = '\0';
11984 PrintType(type, typeString, 0x0, 0x1);
11985 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
11986 type->classObjectType = backupClassObjectType;
11987 *thisExp = *e;
11988 thisExp->prev = (((void *)0));
11989 thisExp->next = (((void *)0));
11990 __ecereMethod_Expression_Clear(e);
11991 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)))
11992 {
11993 e->type = 4;
11994 e->op.op = '*';
11995 e->op.exp1 = (((void *)0));
11996 e->op.exp2 = MkExpCast(MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl)), thisExp);
11997 }
11998 else
11999 {
12000 e->type = 11;
12001 e->cast.typeName = MkTypeName(specs, decl);
12002 e->cast.exp = thisExp;
12003 e->byReference = 0x1;
12004 }
12005 e->expType = type;
12006 e->destType = destType;
12007 type->refCount++;
12008 destType->refCount++;
12009 }
12010 }
12011 }
12012
12013 extern char *  strstr(char * , const char * );
12014
12015 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__DefinedExpression;
12016
12017 struct __ecereNameSpace__ecere__com__DefinedExpression
12018 {
12019 struct __ecereNameSpace__ecere__com__DefinedExpression * prev;
12020 struct __ecereNameSpace__ecere__com__DefinedExpression * next;
12021 char *  name;
12022 char *  value;
12023 struct __ecereNameSpace__ecere__com__NameSpace *  nameSpace;
12024 } __attribute__ ((gcc_struct));
12025
12026 extern struct __ecereNameSpace__ecere__com__DefinedExpression * __ecereNameSpace__ecere__com__eSystem_FindDefine(struct __ecereNameSpace__ecere__com__Instance * module, char *  name);
12027
12028 extern struct __ecereNameSpace__ecere__com__GlobalFunction * __ecereNameSpace__ecere__com__eSystem_FindFunction(struct __ecereNameSpace__ecere__com__Instance * module, char *  name);
12029
12030 extern unsigned int __ecereNameSpace__ecere__sys__UTF8GetChar(char *  string, int *  numBytes);
12031
12032 extern struct Expression * GetTemplateArgExp(struct TemplateParameter * param, struct __ecereNameSpace__ecere__com__Class * curClass, unsigned int pointer);
12033
12034 extern struct Expression * MkExpCondition(struct Expression * cond, struct __ecereNameSpace__ecere__sys__OldList * expressions, struct Expression * elseExp);
12035
12036 extern struct Expression * CopyExpression(struct Expression * exp);
12037
12038 extern struct Expression * MkExpTypeSize(struct TypeName * typeName);
12039
12040 extern struct Expression * MkExpClass(struct __ecereNameSpace__ecere__sys__OldList *  specifiers, struct Declarator * decl);
12041
12042 static void ProcessStatement(struct Statement * stmt);
12043
12044 extern struct Expression * MkExpExtensionInitializer(struct TypeName * typeName, struct Initializer * initializer);
12045
12046 extern struct Initializer * MkInitializerList(struct __ecereNameSpace__ecere__sys__OldList * list);
12047
12048 extern char *  __ecereNameSpace__ecere__com__PrintString(struct __ecereNameSpace__ecere__com__Class * class, void * object, ...);
12049
12050 extern char *  sourceFile;
12051
12052 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear(struct __ecereNameSpace__ecere__sys__OldList * this);
12053
12054 void ProcessExpressionType(struct Expression * exp)
12055 {
12056 void * __ecereTemp2;
12057 void * __ecereTemp1;
12058 unsigned int unresolved = 0x0;
12059 struct Location oldyylloc = yylloc;
12060 unsigned int notByReference = 0x0;
12061
12062 if(!exp || exp->expType)
12063 return ;
12064 yylloc = exp->loc;
12065 switch(exp->type)
12066 {
12067 case 0:
12068 {
12069 struct Identifier * id = exp->identifier;
12070
12071 if(!id)
12072 return ;
12073 if(id->_class && id->_class->name)
12074 {
12075 id->classSym = id->_class->symbol;
12076 }
12077 if(strstr(id->string, "__ecereClass") == id->string)
12078 {
12079 exp->expType = ProcessTypeString("ecere::com::Class", 0x1);
12080 break;
12081 }
12082 else if(id->_class && (id->classSym || (id->_class->name && !strcmp(id->_class->name, "property"))))
12083 {
12084 ReplaceClassMembers(exp, thisClass);
12085 if(exp->type != 0)
12086 {
12087 ProcessExpressionType(exp);
12088 break;
12089 }
12090 if(id->classSym && ResolveIdWithClass(exp, id->classSym->registered, 0x0))
12091 break;
12092 }
12093 else
12094 {
12095 struct Symbol * symbol = FindSymbol(id->string, curContext, topContext, 0x0, id->_class && id->_class->name == (((void *)0)));
12096
12097 if(!symbol)
12098 {
12099 if(exp->destType && CheckExpressionType(exp, exp->destType, 0x0))
12100 break;
12101 else
12102 {
12103 if(thisClass)
12104 {
12105 ReplaceClassMembers(exp, thisClass ? thisClass : currentClass);
12106 if(exp->type != 0)
12107 {
12108 ProcessExpressionType(exp);
12109 break;
12110 }
12111 }
12112 else if(currentClass && !id->_class)
12113 {
12114 if(ResolveIdWithClass(exp, currentClass, 0x1))
12115 break;
12116 }
12117 symbol = FindSymbol(id->string, topContext->parent, globalContext, 0x0, id->_class && id->_class->name == (((void *)0)));
12118 }
12119 }
12120 if(symbol)
12121 {
12122 struct Type * type = symbol->type;
12123 struct __ecereNameSpace__ecere__com__Class * _class = (type && type->kind == 8 && type->_class) ? type->_class->registered : (((void *)0));
12124
12125 if(_class && !strcmp(id->string, "this") && !type->classObjectType)
12126 {
12127 struct Context * context = SetupTemplatesContext(_class);
12128
12129 type = ReplaceThisClassType(_class);
12130 FinishTemplatesContext(context);
12131 if(type)
12132 type->refCount = 0;
12133 }
12134 FreeSpecifier(id->_class);
12135 id->_class = (((void *)0));
12136 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
12137 id->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
12138 id->classSym = (((void *)0));
12139 exp->expType = type;
12140 if(type)
12141 type->refCount++;
12142 if(type && (type->kind == 15 || (_class && _class->type == 4)))
12143 exp->isConstant = 0x1;
12144 if(symbol->isParam || !strcmp(id->string, "this"))
12145 {
12146 if(_class && _class->type == 1)
12147 exp->byReference = 0x1;
12148 }
12149 if(symbol->isIterator)
12150 {
12151 if(symbol->isIterator == 3)
12152 {
12153 exp->type = 5;
12154 exp->list = MkListOne(MkExpOp((((void *)0)), '*', MkExpIdentifier(exp->identifier)));
12155 ((struct Expression *)(*exp->list).first)->op.exp2->expType = exp->expType;
12156 exp->expType = (((void *)0));
12157 ProcessExpressionType(exp);
12158 }
12159 else if(symbol->isIterator != 4)
12160 {
12161 exp->type = 8;
12162 exp->member.exp = MkExpIdentifier(exp->identifier);
12163 exp->member.exp->expType = exp->expType;
12164 exp->member.member = MkIdentifier("data");
12165 exp->expType = (((void *)0));
12166 ProcessExpressionType(exp);
12167 }
12168 }
12169 break;
12170 }
12171 else
12172 {
12173 struct __ecereNameSpace__ecere__com__DefinedExpression * definedExp = (((void *)0));
12174
12175 if(thisNameSpace && !(id->_class && !id->_class->name))
12176 {
12177 char name[1024];
12178
12179 strcpy(name, thisNameSpace);
12180 strcat(name, "::");
12181 strcat(name, id->string);
12182 definedExp = __ecereNameSpace__ecere__com__eSystem_FindDefine(privateModule, name);
12183 }
12184 if(!definedExp)
12185 definedExp = __ecereNameSpace__ecere__com__eSystem_FindDefine(privateModule, id->string);
12186 if(definedExp)
12187 {
12188 int c;
12189
12190 for(c = 0; c < definedExpStackPos; c++)
12191 if(definedExpStack[c] == definedExp)
12192 break;
12193 if(c == definedExpStackPos && c < sizeof definedExpStack / sizeof(void *))
12194 {
12195 struct Location backupYylloc = yylloc;
12196
12197 definedExpStack[definedExpStackPos++] = definedExp;
12198 fileInput = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
12199 ((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));
12200 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))fileInput->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(fileInput, 0, 0);
12201 echoOn = 0x0;
12202 parsedExpression = (((void *)0));
12203 resetScanner();
12204 expression_yyparse();
12205 (__ecereNameSpace__ecere__com__eInstance_DecRef(fileInput), fileInput = 0);
12206 yylloc = backupYylloc;
12207 if(parsedExpression)
12208 {
12209 FreeIdentifier(id);
12210 exp->type = 5;
12211 exp->list = MkListOne(parsedExpression);
12212 parsedExpression->loc = yylloc;
12213 ProcessExpressionType(exp);
12214 definedExpStackPos--;
12215 return ;
12216 }
12217 definedExpStackPos--;
12218 }
12219 else
12220 {
12221 if(inCompiler)
12222 {
12223 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Recursion in defined expression %s\n", (((void *)0))), id->string);
12224 }
12225 }
12226 }
12227 else
12228 {
12229 struct GlobalData * data = (((void *)0));
12230
12231 if(thisNameSpace && !(id->_class && !id->_class->name))
12232 {
12233 char name[1024];
12234
12235 strcpy(name, thisNameSpace);
12236 strcat(name, "::");
12237 strcat(name, id->string);
12238 data = FindGlobalData(name);
12239 }
12240 if(!data)
12241 data = FindGlobalData(id->string);
12242 if(data)
12243 {
12244 DeclareGlobalData(data);
12245 exp->expType = data->dataType;
12246 if(data->dataType)
12247 data->dataType->refCount++;
12248 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
12249 id->string = __ecereNameSpace__ecere__sys__CopyString(data->fullName);
12250 FreeSpecifier(id->_class);
12251 id->_class = (((void *)0));
12252 break;
12253 }
12254 else
12255 {
12256 struct __ecereNameSpace__ecere__com__GlobalFunction * function = (((void *)0));
12257
12258 if(thisNameSpace && !(id->_class && !id->_class->name))
12259 {
12260 char name[1024];
12261
12262 strcpy(name, thisNameSpace);
12263 strcat(name, "::");
12264 strcat(name, id->string);
12265 function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, name);
12266 }
12267 if(!function)
12268 function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, id->string);
12269 if(function)
12270 {
12271 char name[1024];
12272
12273 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
12274 id->string = __ecereNameSpace__ecere__sys__CopyString(function->name);
12275 name[0] = (char)0;
12276 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + 12)))->importType != 1 && (!function->dataType || !function->dataType->dllExport))
12277 strcpy(name, "__ecereFunction_");
12278 FullClassNameCat(name, id->string, 0x0);
12279 if(DeclareFunction(function, name))
12280 {
12281 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
12282 id->string = __ecereNameSpace__ecere__sys__CopyString(name);
12283 }
12284 exp->expType = function->dataType;
12285 if(function->dataType)
12286 function->dataType->refCount++;
12287 FreeSpecifier(id->_class);
12288 id->_class = (((void *)0));
12289 break;
12290 }
12291 }
12292 }
12293 }
12294 }
12295 unresolved = 0x1;
12296 break;
12297 }
12298 case 1:
12299 {
12300 struct __ecereNameSpace__ecere__com__Class * _class;
12301
12302 if(!exp->instance->_class)
12303 {
12304 if(exp->destType && exp->destType->kind == 8 && exp->destType->_class)
12305 {
12306 exp->instance->_class = MkSpecifierName(exp->destType->_class->string);
12307 }
12308 }
12309 ProcessInstantiationType(exp->instance);
12310 exp->isConstant = exp->instance->isConstant;
12311 if(exp->instance->_class)
12312 {
12313 exp->expType = MkClassType(exp->instance->_class->name);
12314 }
12315 break;
12316 }
12317 case 2:
12318 {
12319 if(!exp->expType)
12320 {
12321 struct Type * type = (type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), type->refCount = 1, type->constant = 0x1, type);
12322
12323 exp->expType = type;
12324 if(exp->constant[0] == '\'')
12325 {
12326 if((int)((unsigned char *)exp->constant)[1] > 127)
12327 {
12328 int nb;
12329 unsigned int ch = __ecereNameSpace__ecere__sys__UTF8GetChar(exp->constant + 1, &nb);
12330
12331 if(nb < 2)
12332 ch = exp->constant[1];
12333 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->constant), exp->constant = 0);
12334 exp->constant = PrintUInt(ch);
12335 type->kind = 8;
12336 type->_class = FindClass("unichar");
12337 type->isSigned = 0x0;
12338 }
12339 else
12340 {
12341 type->kind = 1;
12342 type->isSigned = 0x1;
12343 }
12344 }
12345 else if(strchr(exp->constant, '.'))
12346 {
12347 char ch = exp->constant[strlen(exp->constant) - 1];
12348
12349 if(ch == 'f')
12350 type->kind = 6;
12351 else
12352 type->kind = 7;
12353 type->isSigned = 0x1;
12354 }
12355 else
12356 {
12357 if(exp->constant[0] == '0' && exp->constant[1])
12358 type->isSigned = 0x0;
12359 else if(strchr(exp->constant, 'L') || strchr(exp->constant, 'l'))
12360 type->isSigned = 0x0;
12361 else if(strtoll(exp->constant, (((void *)0)), 0) > (((int)0x7fffffff)))
12362 type->isSigned = 0x0;
12363 else
12364 type->isSigned = 0x1;
12365 type->kind = 3;
12366 }
12367 exp->isConstant = 0x1;
12368 }
12369 break;
12370 }
12371 case 3:
12372 {
12373 exp->isConstant = 0x1;
12374 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));
12375 break;
12376 }
12377 case 13:
12378 case 28:
12379 ProcessExpressionType(exp->_new.size);
12380 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));
12381 DeclareType(exp->expType->type, 0x0, 0x0);
12382 break;
12383 case 14:
12384 case 29:
12385 ProcessExpressionType(exp->_renew.size);
12386 ProcessExpressionType(exp->_renew.exp);
12387 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));
12388 DeclareType(exp->expType->type, 0x0, 0x0);
12389 break;
12390 case 4:
12391 {
12392 unsigned int assign = 0x0, boolResult = 0x0, boolOps = 0x0;
12393 struct Type * type1 = (((void *)0)), * type2 = (((void *)0));
12394 unsigned int useDestType = 0x0, useSideType = 0x0;
12395 struct Location oldyylloc = yylloc;
12396 unsigned int useSideUnit = 0x0;
12397 struct Type * dummy = (dummy = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), dummy->count = (unsigned int)1, dummy->refCount = 1, dummy);
12398
12399 switch(exp->op.op)
12400 {
12401 case '=':
12402 case MUL_ASSIGN:
12403 case DIV_ASSIGN:
12404 case MOD_ASSIGN:
12405 case ADD_ASSIGN:
12406 case SUB_ASSIGN:
12407 case LEFT_ASSIGN:
12408 case RIGHT_ASSIGN:
12409 case AND_ASSIGN:
12410 case XOR_ASSIGN:
12411 case OR_ASSIGN:
12412 assign = 0x1;
12413 break;
12414 case '!':
12415 break;
12416 case AND_OP:
12417 case OR_OP:
12418 boolOps = 0x1;
12419 boolResult = 0x1;
12420 break;
12421 case EQ_OP:
12422 case '<':
12423 case '>':
12424 case LE_OP:
12425 case GE_OP:
12426 case NE_OP:
12427 boolResult = 0x1;
12428 useSideType = 0x1;
12429 break;
12430 case '+':
12431 case '-':
12432 useSideUnit = 0x1;
12433 case '|':
12434 case '&':
12435 case '^':
12436 case '/':
12437 case '%':
12438 case '*':
12439 if(exp->op.op != '*' || exp->op.exp1)
12440 {
12441 useSideType = 0x1;
12442 useDestType = 0x1;
12443 }
12444 break;
12445 }
12446 if(exp->op.op == '&')
12447 {
12448 if(!exp->op.exp1 && exp->op.exp2 && exp->op.exp2->type == 0 && exp->op.exp2->identifier)
12449 {
12450 struct Identifier * id = exp->op.exp2->identifier;
12451 struct Symbol * symbol = FindSymbol(id->string, curContext, topContext, 0x0, id->_class && id->_class->name == (((void *)0)));
12452
12453 if(symbol && symbol->isIterator == 2)
12454 {
12455 exp->type = 8;
12456 exp->member.exp = exp->op.exp2;
12457 exp->member.member = MkIdentifier("key");
12458 exp->expType = (((void *)0));
12459 exp->op.exp2->expType = symbol->type;
12460 symbol->type->refCount++;
12461 ProcessExpressionType(exp);
12462 FreeType(dummy);
12463 break;
12464 }
12465 }
12466 }
12467 if(exp->op.exp1)
12468 {
12469 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))
12470 {
12471 if(exp->op.exp1->destType)
12472 FreeType(exp->op.exp1->destType);
12473 exp->op.exp1->destType = exp->destType;
12474 if(exp->destType)
12475 exp->destType->refCount++;
12476 }
12477 else if(!assign)
12478 {
12479 if(exp->op.exp1->destType)
12480 FreeType(exp->op.exp1->destType);
12481 exp->op.exp1->destType = dummy;
12482 dummy->refCount++;
12483 }
12484 if(exp->op.exp1->destType && exp->op.op != '=')
12485 exp->op.exp1->destType->count++;
12486 ProcessExpressionType(exp->op.exp1);
12487 if(exp->op.exp1->destType && exp->op.op != '=')
12488 exp->op.exp1->destType->count--;
12489 if(exp->op.exp1->destType == dummy)
12490 {
12491 FreeType(dummy);
12492 exp->op.exp1->destType = (((void *)0));
12493 }
12494 type1 = exp->op.exp1->expType;
12495 }
12496 if(exp->op.exp2)
12497 {
12498 char expString[10240];
12499
12500 expString[0] = '\0';
12501 if(exp->op.exp2->type == 1 && !exp->op.exp2->instance->_class)
12502 {
12503 if(exp->op.exp1)
12504 {
12505 exp->op.exp2->destType = exp->op.exp1->expType;
12506 if(exp->op.exp1->expType)
12507 exp->op.exp1->expType->refCount++;
12508 }
12509 else
12510 {
12511 exp->op.exp2->destType = exp->destType;
12512 if(exp->destType)
12513 exp->destType->refCount++;
12514 }
12515 if(type1)
12516 type1->refCount++;
12517 exp->expType = type1;
12518 }
12519 else if(assign)
12520 {
12521 if(inCompiler)
12522 PrintExpression(exp->op.exp2, expString);
12523 if(type1 && type1->kind == 13)
12524 {
12525 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)
12526 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "operator %s illegal on pointer\n", (((void *)0))), exp->op.op);
12527 else if(exp->op.op == '=')
12528 {
12529 if(exp->op.exp2->destType)
12530 FreeType(exp->op.exp2->destType);
12531 exp->op.exp2->destType = type1;
12532 if(type1)
12533 type1->refCount++;
12534 }
12535 }
12536 else
12537 {
12538 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)
12539 ;
12540 else
12541 {
12542 if(exp->op.exp2->destType)
12543 FreeType(exp->op.exp2->destType);
12544 exp->op.exp2->destType = type1;
12545 if(type1)
12546 type1->refCount++;
12547 }
12548 }
12549 if(type1)
12550 type1->refCount++;
12551 exp->expType = type1;
12552 }
12553 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)))
12554 {
12555 if(exp->op.exp2->destType)
12556 FreeType(exp->op.exp2->destType);
12557 exp->op.exp2->destType = exp->destType;
12558 if(exp->destType)
12559 exp->destType->refCount++;
12560 }
12561 else
12562 {
12563 if(exp->op.exp2->destType)
12564 FreeType(exp->op.exp2->destType);
12565 exp->op.exp2->destType = dummy;
12566 dummy->refCount++;
12567 }
12568 if(type1 && boolResult && useSideType && type1->kind == 8 && type1->_class && type1->_class->registered && (type1->_class->registered->type == 2 || type1->_class->registered->type == 4))
12569 {
12570 FreeType(exp->op.exp2->destType);
12571 exp->op.exp2->destType = type1;
12572 type1->refCount++;
12573 }
12574 if(exp->op.exp2->destType && exp->op.op != '=')
12575 exp->op.exp2->destType->count++;
12576 ProcessExpressionType(exp->op.exp2);
12577 if(exp->op.exp2->destType && exp->op.op != '=')
12578 exp->op.exp2->destType->count--;
12579 if(assign && type1 && type1->kind == 13 && exp->op.exp2->expType)
12580 {
12581 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)
12582 {
12583 if(exp->op.op != '=' && type1->type->kind == 0)
12584 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "void *: unknown size\n", (((void *)0))));
12585 }
12586 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)))
12587 {
12588 if(exp->op.op == ADD_ASSIGN)
12589 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "cannot add two pointers\n", (((void *)0))));
12590 }
12591 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))
12592 {
12593 if(exp->op.op == ADD_ASSIGN)
12594 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "cannot add two pointers\n", (((void *)0))));
12595 }
12596 else if(inCompiler)
12597 {
12598 char type1String[1024];
12599 char type2String[1024];
12600
12601 type1String[0] = '\0';
12602 type2String[0] = '\0';
12603 PrintType(exp->op.exp2->expType, type1String, 0x0, 0x1);
12604 PrintType(type1, type2String, 0x0, 0x1);
12605 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
12606 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible expression %s (%s); expected %s\n", (((void *)0))), expString, type1String, type2String);
12607 }
12608 }
12609 if(exp->op.exp2->destType == dummy)
12610 {
12611 FreeType(dummy);
12612 exp->op.exp2->destType = (((void *)0));
12613 }
12614 type2 = exp->op.exp2->expType;
12615 }
12616 dummy->kind = 0;
12617 if(exp->op.op == SIZEOF)
12618 {
12619 exp->expType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1)->kind = 3, ((struct Type *)__ecereTemp1));
12620 exp->isConstant = 0x1;
12621 }
12622 else if(exp->op.op == '*' && !exp->op.exp1)
12623 {
12624 exp->expType = Dereference(type2);
12625 if(type2 && type2->kind == 8)
12626 notByReference = 0x1;
12627 }
12628 else if(exp->op.op == '&' && !exp->op.exp1)
12629 exp->expType = Reference(type2);
12630 else if(!assign)
12631 {
12632 if(boolOps)
12633 {
12634 if(exp->op.exp1)
12635 {
12636 if(exp->op.exp1->destType)
12637 FreeType(exp->op.exp1->destType);
12638 exp->op.exp1->destType = MkClassType("bool");
12639 exp->op.exp1->destType->truth = 0x1;
12640 if(!exp->op.exp1->expType)
12641 ProcessExpressionType(exp->op.exp1);
12642 else
12643 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
12644 FreeType(exp->op.exp1->expType);
12645 exp->op.exp1->expType = MkClassType("bool");
12646 exp->op.exp1->expType->truth = 0x1;
12647 }
12648 if(exp->op.exp2)
12649 {
12650 if(exp->op.exp2->destType)
12651 FreeType(exp->op.exp2->destType);
12652 exp->op.exp2->destType = MkClassType("bool");
12653 exp->op.exp2->destType->truth = 0x1;
12654 if(!exp->op.exp2->expType)
12655 ProcessExpressionType(exp->op.exp2);
12656 else
12657 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
12658 FreeType(exp->op.exp2->expType);
12659 exp->op.exp2->expType = MkClassType("bool");
12660 exp->op.exp2->expType->truth = 0x1;
12661 }
12662 }
12663 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")))))
12664 {
12665 if(type1 && type2 && ((type1->kind == 8 && type1->_class && strcmp(type1->_class->string, "String")) == (type2->kind == 8 && type2->_class && strcmp(type2->_class->string, "String"))))
12666 {
12667 if(exp->op.exp2->destType)
12668 FreeType(exp->op.exp2->destType);
12669 exp->op.exp2->destType = type1;
12670 type1->refCount++;
12671 if(exp->op.exp1->destType)
12672 FreeType(exp->op.exp1->destType);
12673 exp->op.exp1->destType = type2;
12674 type2->refCount++;
12675 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)
12676 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);
12677 if(type1->kind == 13 && type1->type->kind == 20 && type2->kind != 13)
12678 {
12679 struct Expression * argExp = GetTemplateArgExp(type1->type->templateParameter, thisClass, 0x1);
12680
12681 if(argExp)
12682 {
12683 struct Expression * classExp = MkExpMember(argExp, MkIdentifier("dataTypeClass"));
12684
12685 exp->op.exp1 = MkExpBrackets(MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName("byte")), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), exp->op.exp1)));
12686 ProcessExpressionType(exp->op.exp1);
12687 if(type2->kind != 13)
12688 {
12689 ProcessExpressionType(classExp);
12690 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"))))))));
12691 if(!exp->op.exp2->expType)
12692 type2 = exp->op.exp2->expType = ProcessTypeString("int", 0x0);
12693 ProcessExpressionType(exp->op.exp2);
12694 }
12695 }
12696 }
12697 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)))
12698 {
12699 if(type1->kind != 8 && type1->type->kind == 0)
12700 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "void *: unknown size\n", (((void *)0))));
12701 exp->expType = type1;
12702 if(type1)
12703 type1->refCount++;
12704 }
12705 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)))
12706 {
12707 if(type2->kind != 8 && type2->type->kind == 0)
12708 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "void *: unknown size\n", (((void *)0))));
12709 exp->expType = type2;
12710 if(type2)
12711 type2->refCount++;
12712 }
12713 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))
12714 {
12715 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "different levels of indirection\n", (((void *)0))));
12716 }
12717 else
12718 {
12719 unsigned int success = 0x0;
12720
12721 if(type1->kind == 13 && type2->kind == 13)
12722 {
12723 if(exp->op.op == '+')
12724 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "cannot add two pointers\n", (((void *)0))));
12725 else if(exp->op.op == '-')
12726 {
12727 if(MatchTypes(type1->type, type2->type, (((void *)0)), (((void *)0)), (((void *)0)), 0x0, 0x0, 0x0, 0x0))
12728 {
12729 exp->expType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->kind = 3, ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1));
12730 success = 0x1;
12731 if(type1->type->kind == 20)
12732 {
12733 struct Expression * argExp = GetTemplateArgExp(type1->type->templateParameter, thisClass, 0x1);
12734
12735 if(argExp)
12736 {
12737 struct Expression * classExp = MkExpMember(argExp, MkIdentifier("dataTypeClass"));
12738
12739 ProcessExpressionType(classExp);
12740 exp->type = 5;
12741 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")))))));
12742 ProcessExpressionType(((struct Expression *)(*exp->list).first)->op.exp2);
12743 FreeType(dummy);
12744 return ;
12745 }
12746 }
12747 }
12748 }
12749 }
12750 if(!success && exp->op.exp1->type == 2)
12751 {
12752 if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
12753 {
12754 if(exp->expType)
12755 FreeType(exp->expType);
12756 exp->expType = exp->op.exp1->destType;
12757 if(exp->op.exp1->destType)
12758 exp->op.exp1->destType->refCount++;
12759 success = 0x1;
12760 }
12761 else if(CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0))
12762 {
12763 if(exp->expType)
12764 FreeType(exp->expType);
12765 exp->expType = exp->op.exp2->destType;
12766 if(exp->op.exp2->destType)
12767 exp->op.exp2->destType->refCount++;
12768 success = 0x1;
12769 }
12770 }
12771 else if(!success)
12772 {
12773 if(CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0))
12774 {
12775 if(exp->expType)
12776 FreeType(exp->expType);
12777 exp->expType = exp->op.exp2->destType;
12778 if(exp->op.exp2->destType)
12779 exp->op.exp2->destType->refCount++;
12780 success = 0x1;
12781 }
12782 else if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
12783 {
12784 if(exp->expType)
12785 FreeType(exp->expType);
12786 exp->expType = exp->op.exp1->destType;
12787 if(exp->op.exp1->destType)
12788 exp->op.exp1->destType->refCount++;
12789 success = 0x1;
12790 }
12791 }
12792 if(!success)
12793 {
12794 char expString1[10240];
12795 char expString2[10240];
12796 char type1[1024];
12797 char type2[1024];
12798
12799 expString1[0] = '\0';
12800 expString2[0] = '\0';
12801 type1[0] = '\0';
12802 type2[0] = '\0';
12803 if(inCompiler)
12804 {
12805 PrintExpression(exp->op.exp1, expString1);
12806 __ecereNameSpace__ecere__sys__ChangeCh(expString1, '\n', ' ');
12807 PrintExpression(exp->op.exp2, expString2);
12808 __ecereNameSpace__ecere__sys__ChangeCh(expString2, '\n', ' ');
12809 PrintType(exp->op.exp1->expType, type1, 0x0, 0x1);
12810 PrintType(exp->op.exp2->expType, type2, 0x0, 0x1);
12811 }
12812 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible expressions %s (%s) and %s (%s)\n", (((void *)0))), expString1, type1, expString2, type2);
12813 }
12814 }
12815 }
12816 else if(!boolResult && (!useSideUnit) && type2 && type1 && type2->kind == 8 && type1->kind != 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 3)
12817 {
12818 if(exp->op.exp1->destType)
12819 FreeType(exp->op.exp1->destType);
12820 exp->op.exp1->destType = type2->_class->registered->dataType;
12821 if(type2->_class->registered->dataType)
12822 type2->_class->registered->dataType->refCount++;
12823 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
12824 exp->expType = type2;
12825 if(type2)
12826 type2->refCount++;
12827 }
12828 else if(!boolResult && (!useSideUnit) && type1 && type2 && type1->kind == 8 && type2->kind != 8 && type1->_class && type1->_class->registered && type1->_class->registered->type == 3)
12829 {
12830 if(exp->op.exp2->destType)
12831 FreeType(exp->op.exp2->destType);
12832 exp->op.exp2->destType = type1->_class->registered->dataType;
12833 if(type1->_class->registered->dataType)
12834 type1->_class->registered->dataType->refCount++;
12835 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
12836 exp->expType = type1;
12837 if(type1)
12838 type1->refCount++;
12839 }
12840 else if(type1)
12841 {
12842 unsigned int valid = 0x0;
12843
12844 if(!boolResult && useSideUnit && type1 && type1->kind == 8 && type1->_class->registered && type1->_class->registered->type == 3 && type2 && type2->kind != 8)
12845 {
12846 if(exp->op.exp2->destType)
12847 FreeType(exp->op.exp2->destType);
12848 if(!type1->_class->registered->dataType)
12849 type1->_class->registered->dataType = ProcessTypeString(type1->_class->registered->dataTypeString, 0x0);
12850 exp->op.exp2->destType = type1->_class->registered->dataType;
12851 exp->op.exp2->destType->refCount++;
12852 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
12853 type2 = exp->op.exp2->destType;
12854 exp->expType = type2;
12855 type2->refCount++;
12856 }
12857 if(!boolResult && useSideUnit && type2 && type2->kind == 8 && type2->_class->registered && type2->_class->registered->type == 3 && type1 && type1->kind != 8)
12858 {
12859 if(exp->op.exp1->destType)
12860 FreeType(exp->op.exp1->destType);
12861 if(!type2->_class->registered->dataType)
12862 type2->_class->registered->dataType = ProcessTypeString(type2->_class->registered->dataTypeString, 0x0);
12863 exp->op.exp1->destType = type2->_class->registered->dataType;
12864 exp->op.exp1->destType->refCount++;
12865 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
12866 type1 = exp->op.exp1->destType;
12867 exp->expType = type1;
12868 type1->refCount++;
12869 }
12870 if(!boolResult || exp->op.op == '>' || exp->op.op == '<')
12871 {
12872 if(type1->kind == 8 && type1->_class && type1->_class->registered && type1->_class->registered->type == 4 && exp->op.exp2->expType)
12873 {
12874 if(CheckExpressionType(exp->op.exp1, exp->op.exp2->expType, 0x0))
12875 {
12876 if(exp->expType)
12877 FreeType(exp->expType);
12878 exp->expType = exp->op.exp1->expType;
12879 if(exp->op.exp2->expType)
12880 exp->op.exp1->expType->refCount++;
12881 valid = 0x1;
12882 }
12883 }
12884 else if(type2 && (type2->kind == 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 4 && exp->op.exp1->expType))
12885 {
12886 if(CheckExpressionType(exp->op.exp2, exp->op.exp1->expType, 0x0))
12887 {
12888 if(exp->expType)
12889 FreeType(exp->expType);
12890 exp->expType = exp->op.exp2->expType;
12891 if(exp->op.exp2->expType)
12892 exp->op.exp2->expType->refCount++;
12893 valid = 0x1;
12894 }
12895 }
12896 }
12897 if(!valid)
12898 {
12899 if(exp->op.exp2->destType)
12900 FreeType(exp->op.exp2->destType);
12901 exp->op.exp2->destType = type1;
12902 type1->refCount++;
12903 if(CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0))
12904 {
12905 if(exp->expType)
12906 FreeType(exp->expType);
12907 exp->expType = exp->op.exp2->destType;
12908 if(exp->op.exp2->destType)
12909 exp->op.exp2->destType->refCount++;
12910 }
12911 else if(type1 && type2)
12912 {
12913 char expString1[10240];
12914 char expString2[10240];
12915 char type1String[1024];
12916 char type2String[1024];
12917
12918 expString1[0] = '\0';
12919 expString2[0] = '\0';
12920 type1String[0] = '\0';
12921 type2String[0] = '\0';
12922 if(inCompiler)
12923 {
12924 PrintExpression(exp->op.exp1, expString1);
12925 __ecereNameSpace__ecere__sys__ChangeCh(expString1, '\n', ' ');
12926 PrintExpression(exp->op.exp2, expString2);
12927 __ecereNameSpace__ecere__sys__ChangeCh(expString2, '\n', ' ');
12928 PrintType(exp->op.exp1->expType, type1String, 0x0, 0x1);
12929 PrintType(exp->op.exp2->expType, type2String, 0x0, 0x1);
12930 }
12931 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible expressions %s (%s) and %s (%s)\n", (((void *)0))), expString1, type1String, expString2, type2String);
12932 if(type1->kind == 8 && type1->_class && type1->_class->registered && type1->_class->registered->type == 4)
12933 {
12934 exp->expType = exp->op.exp1->expType;
12935 if(exp->op.exp1->expType)
12936 exp->op.exp1->expType->refCount++;
12937 }
12938 else if(type2->kind == 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 4)
12939 {
12940 exp->expType = exp->op.exp2->expType;
12941 if(exp->op.exp2->expType)
12942 exp->op.exp2->expType->refCount++;
12943 }
12944 }
12945 }
12946 }
12947 else if(type2)
12948 {
12949 if(type2->kind == 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 4)
12950 {
12951 struct Type * oldType = exp->op.exp1->expType;
12952
12953 exp->op.exp1->expType = (((void *)0));
12954 if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
12955 FreeType(oldType);
12956 else
12957 exp->op.exp1->expType = oldType;
12958 }
12959 if(exp->op.exp1->destType)
12960 FreeType(exp->op.exp1->destType);
12961 exp->op.exp1->destType = type2;
12962 type2->refCount++;
12963 if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
12964 {
12965 if(exp->expType)
12966 FreeType(exp->expType);
12967 exp->expType = exp->op.exp1->destType;
12968 if(exp->op.exp1->destType)
12969 exp->op.exp1->destType->refCount++;
12970 }
12971 }
12972 }
12973 else if(type2 && (!type1 || (type2->kind == 8 && type1->kind != 8)))
12974 {
12975 if(type1 && type2->_class && type2->_class->registered && type2->_class->registered->type == 3)
12976 {
12977 if(exp->op.exp1->destType)
12978 FreeType(exp->op.exp1->destType);
12979 exp->op.exp1->destType = type2->_class->registered->dataType;
12980 if(type2->_class->registered->dataType)
12981 type2->_class->registered->dataType->refCount++;
12982 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
12983 }
12984 if(exp->op.op == '!')
12985 {
12986 exp->expType = MkClassType("bool");
12987 exp->expType->truth = 0x1;
12988 }
12989 else
12990 {
12991 exp->expType = type2;
12992 if(type2)
12993 type2->refCount++;
12994 }
12995 }
12996 else if(type1 && (!type2 || (type1->kind == 8 && type2->kind != 8)))
12997 {
12998 if(type2 && type1->_class && type1->_class->registered && type1->_class->registered->type == 3)
12999 {
13000 if(exp->op.exp2->destType)
13001 FreeType(exp->op.exp2->destType);
13002 exp->op.exp2->destType = type1->_class->registered->dataType;
13003 if(type1->_class->registered->dataType)
13004 type1->_class->registered->dataType->refCount++;
13005 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
13006 }
13007 exp->expType = type1;
13008 if(type1)
13009 type1->refCount++;
13010 }
13011 }
13012 yylloc = exp->loc;
13013 if(exp->op.exp1 && !exp->op.exp1->expType)
13014 {
13015 char expString[10000];
13016
13017 expString[0] = '\0';
13018 if(inCompiler)
13019 {
13020 PrintExpression(exp->op.exp1, expString);
13021 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
13022 }
13023 if(expString[0])
13024 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't determine type of %s\n", (((void *)0))), expString);
13025 }
13026 if(exp->op.exp2 && !exp->op.exp2->expType)
13027 {
13028 char expString[10240];
13029
13030 expString[0] = '\0';
13031 if(inCompiler)
13032 {
13033 PrintExpression(exp->op.exp2, expString);
13034 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
13035 }
13036 if(expString[0])
13037 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't determine type of %s\n", (((void *)0))), expString);
13038 }
13039 if(boolResult)
13040 {
13041 FreeType(exp->expType);
13042 exp->expType = MkClassType("bool");
13043 exp->expType->truth = 0x1;
13044 }
13045 if(exp->op.op != SIZEOF)
13046 exp->isConstant = (!exp->op.exp1 || exp->op.exp1->isConstant) && (!exp->op.exp2 || exp->op.exp2->isConstant);
13047 if(exp->op.op == SIZEOF && exp->op.exp2->expType)
13048 {
13049 DeclareType(exp->op.exp2->expType, 0x0, 0x0);
13050 }
13051 yylloc = oldyylloc;
13052 FreeType(dummy);
13053 break;
13054 }
13055 case 5:
13056 case 34:
13057 {
13058 struct Expression * e;
13059
13060 exp->isConstant = 0x1;
13061 for(e = (*exp->list).first; e; e = e->next)
13062 {
13063 unsigned int inced = 0x0;
13064
13065 if(!e->next)
13066 {
13067 FreeType(e->destType);
13068 e->destType = exp->destType;
13069 if(e->destType)
13070 {
13071 exp->destType->refCount++;
13072 e->destType->count++;
13073 inced = 0x1;
13074 }
13075 }
13076 ProcessExpressionType(e);
13077 if(inced)
13078 exp->destType->count--;
13079 if(!exp->expType && !e->next)
13080 {
13081 exp->expType = e->expType;
13082 if(e->expType)
13083 e->expType->refCount++;
13084 }
13085 if(!e->isConstant)
13086 exp->isConstant = 0x0;
13087 }
13088 e = (*exp->list).first;
13089 if(!e->next && e->type == 8)
13090 {
13091 struct Expression * next = exp->next, * prev = exp->prev;
13092
13093 FreeType(exp->expType);
13094 FreeType(exp->destType);
13095 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->list), exp->list = 0);
13096 *exp = *e;
13097 exp->prev = prev;
13098 exp->next = next;
13099 ((e ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(e) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(e)) : 0), e = 0);
13100 ProcessExpressionType(exp);
13101 }
13102 break;
13103 }
13104 case 6:
13105 {
13106 struct Expression * e;
13107
13108 exp->isConstant = 0x1;
13109 ProcessExpressionType(exp->index.exp);
13110 if(!exp->index.exp->isConstant)
13111 exp->isConstant = 0x0;
13112 if(exp->index.exp->expType)
13113 {
13114 struct Type * source = exp->index.exp->expType;
13115
13116 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)
13117 {
13118 struct __ecereNameSpace__ecere__com__Class * _class = source->_class->registered;
13119
13120 exp->expType = ProcessTypeString(_class->templateArgs[2].dataTypeString, 0x0);
13121 if(exp->index.index && (*exp->index.index).last)
13122 {
13123 ((struct Expression *)(*exp->index.index).last)->destType = ProcessTypeString(_class->templateArgs[1].dataTypeString, 0x0);
13124 }
13125 }
13126 }
13127 for(e = (*exp->index.index).first; e; e = e->next)
13128 {
13129 if(!e->next && exp->index.exp->expType && exp->index.exp->expType->kind == 12 && exp->index.exp->expType->enumClass)
13130 {
13131 if(e->destType)
13132 FreeType(e->destType);
13133 e->destType = MkClassType(exp->index.exp->expType->enumClass->string);
13134 }
13135 ProcessExpressionType(e);
13136 if(!e->next)
13137 {
13138 }
13139 if(!e->isConstant)
13140 exp->isConstant = 0x0;
13141 }
13142 if(!exp->expType)
13143 exp->expType = Dereference(exp->index.exp->expType);
13144 if(exp->expType)
13145 DeclareType(exp->expType, 0x0, 0x0);
13146 break;
13147 }
13148 case 7:
13149 {
13150 struct Expression * e;
13151 struct Type * functionType;
13152 struct Type * methodType = (((void *)0));
13153 char name[1024];
13154
13155 name[0] = '\0';
13156 if(inCompiler)
13157 {
13158 PrintExpression(exp->call.exp, name);
13159 if(exp->call.exp->expType && !exp->call.exp->expType->returnType)
13160 {
13161 PrintExpression(exp->call.exp, name);
13162 }
13163 }
13164 if(exp->call.exp->type == 0)
13165 {
13166 struct Expression * idExp = exp->call.exp;
13167 struct Identifier * id = idExp->identifier;
13168
13169 if(!strcmp(id->string, "__ENDIAN_PAD"))
13170 {
13171 exp->expType = ProcessTypeString("int", 0x1);
13172 if(exp->call.arguments && (*exp->call.arguments).first)
13173 ProcessExpressionType((*exp->call.arguments).first);
13174 break;
13175 }
13176 else if(!strcmp(id->string, "Max") || !strcmp(id->string, "Min") || !strcmp(id->string, "Sgn") || !strcmp(id->string, "Abs"))
13177 {
13178 struct Expression * a = (((void *)0));
13179 struct Expression * b = (((void *)0));
13180 struct Expression * tempExp1 = (((void *)0)), * tempExp2 = (((void *)0));
13181
13182 if((!strcmp(id->string, "Max") || !strcmp(id->string, "Min")) && (*exp->call.arguments).count == 2)
13183 {
13184 a = (*exp->call.arguments).first;
13185 b = (*exp->call.arguments).last;
13186 tempExp1 = a;
13187 tempExp2 = b;
13188 }
13189 else if((*exp->call.arguments).count == 1)
13190 {
13191 a = (*exp->call.arguments).first;
13192 tempExp1 = a;
13193 }
13194 if(a)
13195 {
13196 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear((&*exp->call.arguments));
13197 idExp->identifier = (((void *)0));
13198 FreeExpContents(exp);
13199 ProcessExpressionType(a);
13200 if(b)
13201 ProcessExpressionType(b);
13202 exp->type = 5;
13203 exp->list = MkList();
13204 if(a->expType && (!b || b->expType))
13205 {
13206 if((!a->isConstant && a->type != 0) || (b && !b->isConstant && b->type != 0))
13207 {
13208 if(inCompiler)
13209 {
13210 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13211 struct __ecereNameSpace__ecere__sys__OldList * decls = MkList();
13212 struct Declaration * decl;
13213 char temp1[1024], temp2[1024];
13214
13215 GetTypeSpecs(a->expType, specs);
13216 if(a && !a->isConstant && a->type != 0)
13217 {
13218 sprintf(temp1, "__simpleStruct%d", curContext->simpleID++);
13219 ListAdd(decls, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(temp1)), (((void *)0))));
13220 tempExp1 = QMkExpId(temp1);
13221 tempExp1->expType = a->expType;
13222 if(a->expType)
13223 a->expType->refCount++;
13224 ListAdd(exp->list, MkExpOp(CopyExpression(tempExp1), '=', a));
13225 }
13226 if(b && !b->isConstant && b->type != 0)
13227 {
13228 sprintf(temp2, "__simpleStruct%d", curContext->simpleID++);
13229 ListAdd(decls, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(temp2)), (((void *)0))));
13230 tempExp2 = QMkExpId(temp2);
13231 tempExp2->expType = b->expType;
13232 if(b->expType)
13233 b->expType->refCount++;
13234 ListAdd(exp->list, MkExpOp(CopyExpression(tempExp2), '=', b));
13235 }
13236 decl = MkDeclaration(specs, decls);
13237 if(!curCompound->compound.declarations)
13238 curCompound->compound.declarations = MkList();
13239 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*curCompound->compound.declarations), (((void *)0)), decl);
13240 }
13241 }
13242 }
13243 if(!strcmp(id->string, "Max") || !strcmp(id->string, "Min"))
13244 {
13245 int op = (!strcmp(id->string, "Max")) ? '>' : '<';
13246
13247 ListAdd(exp->list, MkExpCondition(MkExpBrackets(MkListOne(MkExpOp(CopyExpression(tempExp1), op, CopyExpression(tempExp2)))), MkListOne(CopyExpression(tempExp1)), CopyExpression(tempExp2)));
13248 exp->expType = a->expType;
13249 if(a->expType)
13250 a->expType->refCount++;
13251 }
13252 else if(!strcmp(id->string, "Abs"))
13253 {
13254 ListAdd(exp->list, MkExpCondition(MkExpBrackets(MkListOne(MkExpOp(CopyExpression(tempExp1), '<', MkExpConstant("0")))), MkListOne(MkExpOp((((void *)0)), '-', CopyExpression(tempExp1))), CopyExpression(tempExp1)));
13255 exp->expType = a->expType;
13256 if(a->expType)
13257 a->expType->refCount++;
13258 }
13259 else if(!strcmp(id->string, "Sgn"))
13260 {
13261 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"))))));
13262 exp->expType = ProcessTypeString("int", 0x0);
13263 }
13264 FreeExpression(tempExp1);
13265 if(tempExp2)
13266 FreeExpression(tempExp2);
13267 FreeIdentifier(id);
13268 break;
13269 }
13270 }
13271 }
13272 {
13273 struct Type * dummy = (dummy = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), dummy->count = (unsigned int)1, dummy->refCount = 1, dummy);
13274
13275 if(!exp->call.exp->destType)
13276 {
13277 exp->call.exp->destType = dummy;
13278 dummy->refCount++;
13279 }
13280 ProcessExpressionType(exp->call.exp);
13281 if(exp->call.exp->destType == dummy)
13282 {
13283 FreeType(dummy);
13284 exp->call.exp->destType = (((void *)0));
13285 }
13286 FreeType(dummy);
13287 }
13288 functionType = exp->call.exp->expType;
13289 if(functionType && functionType->kind == 16)
13290 {
13291 methodType = functionType;
13292 functionType = methodType->method->dataType;
13293 if(exp->call.exp->expType->usedClass)
13294 {
13295 char typeString[1024];
13296
13297 typeString[0] = '\0';
13298 PrintType(functionType, typeString, 0x1, 0x1);
13299 if(strstr(typeString, "thisclass"))
13300 {
13301 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13302 struct Declarator * decl;
13303
13304 {
13305 struct Context * context = SetupTemplatesContext(exp->call.exp->expType->usedClass);
13306
13307 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
13308 if(thisClass != (exp->call.exp->expType->usedClass->templateClass ? exp->call.exp->expType->usedClass->templateClass : exp->call.exp->expType->usedClass))
13309 thisClassParams = 0x0;
13310 ReplaceThisClassSpecifiers(specs, exp->call.exp->expType->usedClass);
13311 {
13312 struct __ecereNameSpace__ecere__com__Class * backupThisClass = thisClass;
13313
13314 thisClass = exp->call.exp->expType->usedClass;
13315 ProcessDeclarator(decl);
13316 thisClass = backupThisClass;
13317 }
13318 thisClassParams = 0x1;
13319 functionType = ProcessType(specs, decl);
13320 functionType->refCount = 0;
13321 FinishTemplatesContext(context);
13322 }
13323 FreeList(specs, FreeSpecifier);
13324 FreeDeclarator(decl);
13325 }
13326 }
13327 }
13328 if(functionType && functionType->kind == 13 && functionType->type && functionType->type->kind == 11)
13329 {
13330 struct Type * type = functionType->type;
13331
13332 if(!functionType->refCount)
13333 {
13334 functionType->type = (((void *)0));
13335 FreeType(functionType);
13336 }
13337 functionType = type;
13338 }
13339 if(functionType && functionType->kind != 11)
13340 {
13341 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "called object %s is not a function\n", (((void *)0))), name);
13342 }
13343 else if(functionType)
13344 {
13345 unsigned int emptyParams = 0x0, noParams = 0x0;
13346 struct Expression * e = exp->call.arguments ? (*exp->call.arguments).first : (((void *)0));
13347 struct Type * type = functionType->params.first;
13348 struct Expression * memberExp = (exp->call.exp->type == 8) ? exp->call.exp : (((void *)0));
13349 int extra = 0;
13350 struct Location oldyylloc = yylloc;
13351
13352 if(!type)
13353 emptyParams = 0x1;
13354 if(functionType->extraParam && e)
13355 {
13356 e->destType = MkClassType(functionType->thisClass->string);
13357 e = e->next;
13358 }
13359 if(!functionType->staticMethod)
13360 {
13361 if(memberExp && memberExp->member.exp && memberExp->member.exp->expType && memberExp->member.exp->expType->kind == 19 && memberExp->member.exp->expType->_class)
13362 {
13363 type = MkClassType(memberExp->member.exp->expType->_class->string);
13364 if(e)
13365 {
13366 e->destType = type;
13367 e = e->next;
13368 type = functionType->params.first;
13369 }
13370 else
13371 type->refCount = 0;
13372 }
13373 else if(!memberExp && (functionType->thisClass || (methodType && methodType->methodClass)))
13374 {
13375 type = MkClassType(functionType->thisClass ? functionType->thisClass->string : (methodType ? methodType->methodClass->fullName : (((void *)0))));
13376 if(e)
13377 {
13378 e->destType = type;
13379 e = e->next;
13380 type = functionType->params.first;
13381 }
13382 else
13383 type->refCount = 0;
13384 }
13385 }
13386 if(type && type->kind == 0)
13387 {
13388 noParams = 0x1;
13389 if(!type->refCount)
13390 FreeType(type);
13391 type = (((void *)0));
13392 }
13393 for(; e; e = e->next)
13394 {
13395 if(!type && !emptyParams)
13396 {
13397 yylloc = e->loc;
13398 if(methodType && methodType->methodClass)
13399 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);
13400 else
13401 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);
13402 break;
13403 }
13404 if(methodType && type && type->kind == 20 && type->templateParameter->type == 0)
13405 {
13406 struct Type * templatedType = (((void *)0));
13407 struct __ecereNameSpace__ecere__com__Class * _class = methodType->usedClass;
13408 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
13409 int id = 0;
13410
13411 if(_class && _class->templateArgs)
13412 {
13413 struct __ecereNameSpace__ecere__com__Class * sClass;
13414
13415 for(sClass = _class; sClass; sClass = sClass->base)
13416 {
13417 if(sClass->templateClass)
13418 sClass = sClass->templateClass;
13419 id = 0;
13420 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
13421 {
13422 if(curParam->type == 0 && !strcmp(type->templateParameter->identifier->string, curParam->name))
13423 {
13424 struct __ecereNameSpace__ecere__com__Class * nextClass;
13425
13426 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
13427 {
13428 if(nextClass->templateClass)
13429 nextClass = nextClass->templateClass;
13430 id += nextClass->templateParams.count;
13431 }
13432 break;
13433 }
13434 id++;
13435 }
13436 if(curParam)
13437 break;
13438 }
13439 }
13440 if(curParam && _class->templateArgs[id].dataTypeString)
13441 {
13442 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = _class->templateArgs[id];
13443
13444 {
13445 struct Context * context = SetupTemplatesContext(_class);
13446
13447 templatedType = ProcessTypeString(arg.dataTypeString, 0x0);
13448 FinishTemplatesContext(context);
13449 }
13450 e->destType = templatedType;
13451 if(templatedType)
13452 {
13453 templatedType->passAsTemplate = 0x1;
13454 }
13455 }
13456 else
13457 {
13458 e->destType = type;
13459 if(type)
13460 type->refCount++;
13461 }
13462 }
13463 else
13464 {
13465 e->destType = type;
13466 if(type)
13467 type->refCount++;
13468 }
13469 if(type && type->kind != 14)
13470 {
13471 struct Type * next = type->next;
13472
13473 if(!type->refCount)
13474 FreeType(type);
13475 type = next;
13476 }
13477 }
13478 if(type && type->kind != 14)
13479 {
13480 if(methodType && methodType->methodClass)
13481 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);
13482 else
13483 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);
13484 }
13485 yylloc = oldyylloc;
13486 if(type && !type->refCount)
13487 FreeType(type);
13488 }
13489 else
13490 {
13491 functionType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->refCount = 0, ((struct Type *)__ecereTemp1)->kind = 11, ((struct Type *)__ecereTemp1));
13492 if(exp->call.exp->type == 0)
13493 {
13494 char * string = exp->call.exp->identifier->string;
13495
13496 if(inCompiler)
13497 {
13498 struct Symbol * symbol;
13499 struct Location oldyylloc = yylloc;
13500
13501 yylloc = exp->call.exp->identifier->loc;
13502 if(strstr(string, "__builtin_") == string)
13503 ;
13504 else
13505 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "%s undefined; assuming extern returning int\n", (((void *)0))), string);
13506 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));
13507 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)symbol);
13508 if(strstr(symbol->string, "::"))
13509 globalContext->hasNameSpace = 0x1;
13510 yylloc = oldyylloc;
13511 }
13512 }
13513 else if(exp->call.exp->type == 8)
13514 {
13515 }
13516 else
13517 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "callable object undefined; extern assuming returning int\n", (((void *)0))));
13518 if(!functionType->returnType)
13519 {
13520 functionType->returnType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1)->kind = 3, ((struct Type *)__ecereTemp1));
13521 }
13522 }
13523 if(functionType && functionType->kind == 11)
13524 {
13525 exp->expType = functionType->returnType;
13526 if(functionType->returnType)
13527 functionType->returnType->refCount++;
13528 if(!functionType->refCount)
13529 FreeType(functionType);
13530 }
13531 if(exp->call.arguments)
13532 {
13533 for(e = (*exp->call.arguments).first; e; e = e->next)
13534 {
13535 struct Type * destType = e->destType;
13536
13537 ProcessExpressionType(e);
13538 }
13539 }
13540 break;
13541 }
13542 case 8:
13543 {
13544 struct Type * type;
13545 struct Location oldyylloc = yylloc;
13546 unsigned int thisPtr = (exp->member.exp && exp->member.exp->type == 0 && !strcmp(exp->member.exp->identifier->string, "this"));
13547
13548 exp->thisPtr = thisPtr;
13549 if(exp->member.member && exp->member.member->_class && exp->member.member->_class->name)
13550 {
13551 exp->member.member->classSym = exp->member.member->_class->symbol;
13552 }
13553 ProcessExpressionType(exp->member.exp);
13554 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)
13555 {
13556 exp->isConstant = 0x0;
13557 }
13558 else
13559 exp->isConstant = exp->member.exp->isConstant;
13560 type = exp->member.exp->expType;
13561 yylloc = exp->loc;
13562 if(type && (type->kind == 20))
13563 {
13564 struct __ecereNameSpace__ecere__com__Class * _class = thisClass ? thisClass : currentClass;
13565 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param = (((void *)0));
13566
13567 if(_class)
13568 {
13569 for(param = _class->templateParams.first; param; param = param->next)
13570 {
13571 if(param->type == 1 && exp->member.member && exp->member.member->string && !strcmp(param->name, exp->member.member->string))
13572 break;
13573 }
13574 }
13575 if(param && param->defaultArg.member)
13576 {
13577 struct Expression * argExp = GetTemplateArgExpByName(param->name, thisClass, 1);
13578
13579 if(argExp)
13580 {
13581 struct Expression * expMember = exp->member.exp;
13582 struct Declarator * decl;
13583 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13584 char thisClassTypeString[1024];
13585
13586 FreeIdentifier(exp->member.member);
13587 ProcessExpressionType(argExp);
13588 {
13589 char * colon = strstr(param->defaultArg.memberString, "::");
13590
13591 if(colon)
13592 {
13593 char className[1024];
13594 struct __ecereNameSpace__ecere__com__Class * sClass;
13595
13596 memcpy(thisClassTypeString, param->defaultArg.memberString, colon - param->defaultArg.memberString);
13597 thisClassTypeString[colon - param->defaultArg.memberString] = '\0';
13598 }
13599 else
13600 strcpy(thisClassTypeString, _class->fullName);
13601 }
13602 decl = SpecDeclFromString(param->defaultArg.member->dataTypeString, specs, (((void *)0)));
13603 exp->expType = ProcessType(specs, decl);
13604 if(exp->expType->kind == 8 && exp->expType->_class && exp->expType->_class->registered && exp->expType->_class->registered->templateClass)
13605 {
13606 struct __ecereNameSpace__ecere__com__Class * expClass = exp->expType->_class->registered;
13607 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
13608 int c;
13609 int paramCount = 0;
13610 int lastParam = -1;
13611 char templateString[1024];
13612 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
13613
13614 sprintf(templateString, "%s<", expClass->templateClass->fullName);
13615 for(cClass = expClass; cClass; cClass = cClass->base)
13616 {
13617 int p = 0;
13618
13619 for(param = cClass->templateParams.first; param; param = param->next)
13620 {
13621 int id = p;
13622 struct __ecereNameSpace__ecere__com__Class * sClass;
13623 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
13624
13625 for(sClass = cClass->base; sClass; sClass = sClass->base)
13626 id += sClass->templateParams.count;
13627 arg = expClass->templateArgs[id];
13628 for(sClass = _class; sClass; sClass = sClass->base)
13629 {
13630 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * cParam;
13631 int p = 0;
13632 struct __ecereNameSpace__ecere__com__Class * nextClass;
13633
13634 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
13635 p += nextClass->templateParams.count;
13636 for(cParam = sClass->templateParams.first; cParam; cParam = cParam->next, p++)
13637 {
13638 if(cParam->type == 0 && arg.dataTypeString && !strcmp(cParam->name, arg.dataTypeString))
13639 {
13640 if(_class->templateArgs && arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
13641 {
13642 arg.dataTypeString = _class->templateArgs[p].dataTypeString;
13643 arg.dataTypeClass = _class->templateArgs[p].dataTypeClass;
13644 break;
13645 }
13646 }
13647 }
13648 }
13649 {
13650 char argument[256];
13651
13652 argument[0] = '\0';
13653 switch(param->type)
13654 {
13655 case 2:
13656 {
13657 char expString[1024];
13658 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13659 struct Declarator * decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
13660 struct Expression * exp;
13661 char * string = PrintHexUInt64(arg.expression.ui64);
13662
13663 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
13664 ProcessExpressionType(exp);
13665 ComputeExpression(exp);
13666 expString[0] = '\0';
13667 PrintExpression(exp, expString);
13668 strcat(argument, expString);
13669 FreeExpression(exp);
13670 break;
13671 }
13672 case 1:
13673 {
13674 strcat(argument, arg.member->name);
13675 break;
13676 }
13677 case 0:
13678 {
13679 if(arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
13680 {
13681 if(!strcmp(arg.dataTypeString, "thisclass"))
13682 strcat(argument, thisClassTypeString);
13683 else
13684 strcat(argument, arg.dataTypeString);
13685 }
13686 break;
13687 }
13688 }
13689 if(argument[0])
13690 {
13691 if(paramCount)
13692 strcat(templateString, ", ");
13693 if(lastParam != p - 1)
13694 {
13695 strcat(templateString, param->name);
13696 strcat(templateString, " = ");
13697 }
13698 strcat(templateString, argument);
13699 paramCount++;
13700 lastParam = p;
13701 }
13702 p++;
13703 }
13704 }
13705 }
13706 {
13707 int len = strlen(templateString);
13708
13709 if(templateString[len - 1] == '>')
13710 templateString[len++] = ' ';
13711 templateString[len++] = '>';
13712 templateString[len++] = '\0';
13713 }
13714 {
13715 struct Context * context = SetupTemplatesContext(_class);
13716
13717 FreeType(exp->expType);
13718 exp->expType = ProcessTypeString(templateString, 0x0);
13719 FinishTemplatesContext(context);
13720 }
13721 }
13722 exp->type = 5;
13723 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")))))))));
13724 }
13725 }
13726 else if(type->templateParameter && type->templateParameter->type == 0 && (type->templateParameter->dataType || type->templateParameter->dataTypeString))
13727 {
13728 type = ProcessTemplateParameterType(type->templateParameter);
13729 }
13730 }
13731 if(type && (type->kind == 20))
13732 ;
13733 else if(type && (type->kind == 8 || type->kind == 19 || type->kind == 3 || type->kind == 15))
13734 {
13735 struct Identifier * id = exp->member.member;
13736 int typeKind = type->kind;
13737 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));
13738
13739 if(typeKind == 19 && exp->member.exp->type == 26)
13740 {
13741 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "ecere::com::Class");
13742 typeKind = 8;
13743 }
13744 if(id && (typeKind == 3 || typeKind == 15))
13745 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "int");
13746 if(_class && id)
13747 {
13748 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
13749 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
13750 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
13751 struct __ecereNameSpace__ecere__com__Property * revConvert = (((void *)0));
13752 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
13753
13754 if(id && id->_class && id->_class->name && !strcmp(id->_class->name, "property"))
13755 exp->member.memberType = 1;
13756 if(id && id->_class && type->_class && !__ecereNameSpace__ecere__com__eClass_IsDerived(type->_class->registered, _class))
13757 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "invalid class specifier %s for object of class %s\n", (((void *)0))), _class->fullName, type->_class->string);
13758 if(typeKind != 19)
13759 {
13760 if((exp->member.memberType == 0 && thisPtr) || exp->member.memberType == 3)
13761 {
13762 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
13763 if(member && member->_class != (_class->templateClass ? _class->templateClass : _class) && exp->member.memberType != 3)
13764 {
13765 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
13766 if(prop)
13767 member = (((void *)0));
13768 }
13769 if(!member && !prop)
13770 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
13771 if((member && member->_class == (_class->templateClass ? _class->templateClass : _class)) || (prop && prop->_class == (_class->templateClass ? _class->templateClass : _class)))
13772 exp->member.thisPtr = 0x1;
13773 }
13774 else
13775 {
13776 if(!id->classSym)
13777 {
13778 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, (((void *)0)));
13779 if(!id->_class || !id->_class->name || strcmp(id->_class->name, "property"))
13780 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, (((void *)0)), (((void *)0)), (((void *)0)));
13781 }
13782 if(!prop && !member)
13783 {
13784 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, (((void *)0)));
13785 if(!method)
13786 {
13787 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
13788 if(!id->_class || !id->_class->name || strcmp(id->_class->name, "property"))
13789 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
13790 }
13791 }
13792 if(member && prop)
13793 {
13794 if(member->_class != prop->_class && !id->_class && __ecereNameSpace__ecere__com__eClass_IsDerived(member->_class, prop->_class))
13795 prop = (((void *)0));
13796 else
13797 member = (((void *)0));
13798 }
13799 }
13800 }
13801 if(!prop && !member)
13802 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule);
13803 if(!prop && !member && !method)
13804 {
13805 if(typeKind == 19)
13806 {
13807 classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(type->_class->registered, exp->member.member->string);
13808 if(classProp)
13809 {
13810 exp->member.memberType = 5;
13811 exp->expType = ProcessTypeString(classProp->dataTypeString, 0x0);
13812 }
13813 else
13814 {
13815 char structName[1024];
13816 struct Identifier * id = exp->member.member;
13817 struct Expression * classExp = exp->member.exp;
13818
13819 type->refCount++;
13820 FreeType(classExp->expType);
13821 classExp->expType = ProcessTypeString("ecere::com::Class", 0x0);
13822 strcpy(structName, "__ecereClassData_");
13823 FullClassNameCat(structName, type->_class->string, 0x0);
13824 exp->type = 9;
13825 exp->member.member = id;
13826 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"))))))));
13827 FreeType(type);
13828 ProcessExpressionType(exp);
13829 return ;
13830 }
13831 }
13832 else
13833 {
13834 struct Symbol * classSym = FindClass(id->string);
13835
13836 if(classSym)
13837 {
13838 struct __ecereNameSpace__ecere__com__Class * convertClass = classSym->registered;
13839
13840 if(convertClass)
13841 revConvert = __ecereNameSpace__ecere__com__eClass_FindProperty(convertClass, _class->fullName, privateModule);
13842 }
13843 }
13844 }
13845 if(prop)
13846 {
13847 exp->member.memberType = 1;
13848 if(!prop->dataType)
13849 ProcessPropertyType(prop);
13850 exp->expType = prop->dataType;
13851 if(prop->dataType)
13852 prop->dataType->refCount++;
13853 }
13854 else if(member)
13855 {
13856 if(exp->member.exp->expType->classObjectType == 2 && !strcmp(exp->member.member->string, "_class"))
13857 {
13858 FreeExpContents(exp);
13859 exp->type = 0;
13860 exp->identifier = MkIdentifier("class");
13861 ProcessExpressionType(exp);
13862 return ;
13863 }
13864 exp->member.memberType = 3;
13865 DeclareStruct(_class->fullName, 0x0);
13866 if(!member->dataType)
13867 {
13868 struct Context * context = SetupTemplatesContext(_class);
13869
13870 member->dataType = ProcessTypeString(member->dataTypeString, 0x0);
13871 FinishTemplatesContext(context);
13872 }
13873 exp->expType = member->dataType;
13874 if(member->dataType)
13875 member->dataType->refCount++;
13876 }
13877 else if(revConvert)
13878 {
13879 exp->member.memberType = 4;
13880 exp->expType = MkClassType(revConvert->_class->fullName);
13881 }
13882 else if(method)
13883 {
13884 if(inCompiler)
13885 {
13886 exp->member.memberType = 2;
13887 }
13888 if(!method->dataType)
13889 ProcessMethodType(method);
13890 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));
13891 exp->expType->methodClass = (id && id->_class) ? _class : (((void *)0));
13892 exp->expType->usedClass = _class;
13893 }
13894 else if(!classProp)
13895 {
13896 if(exp->member.exp->expType->classObjectType == 2 && !strcmp(exp->member.member->string, "_class"))
13897 {
13898 FreeExpContents(exp);
13899 exp->type = 0;
13900 exp->identifier = MkIdentifier("class");
13901 ProcessExpressionType(exp);
13902 return ;
13903 }
13904 yylloc = exp->member.member->loc;
13905 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't find member %s in class %s\n", (((void *)0))), id->string, _class->fullName);
13906 if(inCompiler)
13907 __ecereNameSpace__ecere__com__eClass_AddDataMember(_class, id->string, "int", 0, 0, 1);
13908 }
13909 if(_class && exp->expType)
13910 {
13911 struct __ecereNameSpace__ecere__com__Class * tClass;
13912
13913 tClass = _class;
13914 while(tClass && !tClass->templateClass)
13915 tClass = tClass->base;
13916 if(tClass && exp->expType->kind == 20 && exp->expType->templateParameter->type == 0)
13917 {
13918 int id = 0;
13919 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
13920 struct __ecereNameSpace__ecere__com__Class * sClass;
13921
13922 for(sClass = tClass; sClass; sClass = sClass->base)
13923 {
13924 id = 0;
13925 if(sClass->templateClass)
13926 sClass = sClass->templateClass;
13927 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
13928 {
13929 if(curParam->type == 0 && !strcmp(exp->expType->templateParameter->identifier->string, curParam->name))
13930 {
13931 for(sClass = sClass->base; sClass; sClass = sClass->base)
13932 id += sClass->templateParams.count;
13933 break;
13934 }
13935 id++;
13936 }
13937 if(curParam)
13938 break;
13939 }
13940 if(curParam && tClass->templateArgs[id].dataTypeString)
13941 {
13942 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = tClass->templateArgs[id];
13943 struct Context * context = SetupTemplatesContext(tClass);
13944
13945 FreeType(exp->expType);
13946 exp->expType = ProcessTypeString(arg.dataTypeString, 0x0);
13947 if(exp->expType)
13948 {
13949 if(exp->expType->kind == 21)
13950 {
13951 FreeType(exp->expType);
13952 exp->expType = ReplaceThisClassType(_class);
13953 }
13954 if(tClass->templateClass)
13955 exp->expType->passAsTemplate = 0x1;
13956 if(!exp->destType)
13957 {
13958 exp->destType = ProcessTypeString(arg.dataTypeString, 0x0);
13959 if(exp->destType->kind == 21)
13960 {
13961 FreeType(exp->destType);
13962 exp->destType = ReplaceThisClassType(_class);
13963 }
13964 }
13965 }
13966 FinishTemplatesContext(context);
13967 }
13968 }
13969 else if(tClass && exp->expType->kind == 13 && exp->expType->type && exp->expType->type->kind == 20 && exp->expType->type->templateParameter->type == 0)
13970 {
13971 int id = 0;
13972 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
13973 struct __ecereNameSpace__ecere__com__Class * sClass;
13974
13975 for(sClass = tClass; sClass; sClass = sClass->base)
13976 {
13977 id = 0;
13978 if(sClass->templateClass)
13979 sClass = sClass->templateClass;
13980 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
13981 {
13982 if(curParam->type == 0 && !strcmp(exp->expType->type->templateParameter->identifier->string, curParam->name))
13983 {
13984 for(sClass = sClass->base; sClass; sClass = sClass->base)
13985 id += sClass->templateParams.count;
13986 break;
13987 }
13988 id++;
13989 }
13990 if(curParam)
13991 break;
13992 }
13993 if(curParam)
13994 {
13995 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = tClass->templateArgs[id];
13996 struct Context * context = SetupTemplatesContext(tClass);
13997 struct Type * basicType;
13998
13999 basicType = ProcessTypeString(arg.dataTypeString, 0x0);
14000 if(basicType)
14001 {
14002 if(basicType->kind == 21)
14003 {
14004 FreeType(basicType);
14005 basicType = ReplaceThisClassType(_class);
14006 }
14007 FreeType(exp->expType);
14008 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));
14009 if(!exp->destType)
14010 {
14011 exp->destType = exp->expType;
14012 exp->destType->refCount++;
14013 }
14014 {
14015 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
14016 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
14017 struct Declarator * decl;
14018
14019 decl = SpecDeclFromString(arg.dataTypeString, specs, (((void *)0)));
14020 *newExp = *exp;
14021 if(exp->destType)
14022 exp->destType->refCount++;
14023 if(exp->expType)
14024 exp->expType->refCount++;
14025 exp->type = 11;
14026 exp->cast.typeName = MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl));
14027 exp->cast.exp = newExp;
14028 }
14029 }
14030 FinishTemplatesContext(context);
14031 }
14032 }
14033 else if(tClass && exp->expType->kind == 8 && exp->expType->_class && strchr(exp->expType->_class->string, '<'))
14034 {
14035 struct __ecereNameSpace__ecere__com__Class * expClass = exp->expType->_class->registered;
14036
14037 if(expClass)
14038 {
14039 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
14040 int c;
14041 int p = 0;
14042 int paramCount = 0;
14043 int lastParam = -1;
14044 char templateString[1024];
14045 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
14046
14047 sprintf(templateString, "%s<", expClass->templateClass->fullName);
14048 while(cClass != expClass)
14049 {
14050 struct __ecereNameSpace__ecere__com__Class * sClass;
14051
14052 for(sClass = expClass; sClass && sClass->base != cClass; sClass = sClass->base)
14053 ;
14054 cClass = sClass;
14055 for(param = cClass->templateParams.first; param; param = param->next)
14056 {
14057 struct __ecereNameSpace__ecere__com__Class * cClassCur = (((void *)0));
14058 int c;
14059 int cp = 0;
14060 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * paramCur = (((void *)0));
14061 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
14062
14063 while(cClassCur != tClass && !paramCur)
14064 {
14065 struct __ecereNameSpace__ecere__com__Class * sClassCur;
14066
14067 for(sClassCur = tClass; sClassCur && sClassCur->base != cClassCur; sClassCur = sClassCur->base)
14068 ;
14069 cClassCur = sClassCur;
14070 for(paramCur = cClassCur->templateParams.first; paramCur; paramCur = paramCur->next)
14071 {
14072 if(!strcmp(paramCur->name, param->name))
14073 {
14074 break;
14075 }
14076 cp++;
14077 }
14078 }
14079 if(paramCur && paramCur->type == 0)
14080 arg = tClass->templateArgs[cp];
14081 else
14082 arg = expClass->templateArgs[p];
14083 {
14084 char argument[256];
14085
14086 argument[0] = '\0';
14087 switch(param->type)
14088 {
14089 case 2:
14090 {
14091 char expString[1024];
14092 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
14093 struct Declarator * decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
14094 struct Expression * exp;
14095 char * string = PrintHexUInt64(arg.expression.ui64);
14096
14097 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
14098 ProcessExpressionType(exp);
14099 ComputeExpression(exp);
14100 expString[0] = '\0';
14101 PrintExpression(exp, expString);
14102 strcat(argument, expString);
14103 FreeExpression(exp);
14104 break;
14105 }
14106 case 1:
14107 {
14108 strcat(argument, arg.member->name);
14109 break;
14110 }
14111 case 0:
14112 {
14113 if(arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
14114 strcat(argument, arg.dataTypeString);
14115 break;
14116 }
14117 }
14118 if(argument[0])
14119 {
14120 if(paramCount)
14121 strcat(templateString, ", ");
14122 if(lastParam != p - 1)
14123 {
14124 strcat(templateString, param->name);
14125 strcat(templateString, " = ");
14126 }
14127 strcat(templateString, argument);
14128 paramCount++;
14129 lastParam = p;
14130 }
14131 }
14132 p++;
14133 }
14134 }
14135 {
14136 int len = strlen(templateString);
14137
14138 if(templateString[len - 1] == '>')
14139 templateString[len++] = ' ';
14140 templateString[len++] = '>';
14141 templateString[len++] = '\0';
14142 }
14143 FreeType(exp->expType);
14144 {
14145 struct Context * context = SetupTemplatesContext(tClass);
14146
14147 exp->expType = ProcessTypeString(templateString, 0x0);
14148 FinishTemplatesContext(context);
14149 }
14150 }
14151 }
14152 }
14153 }
14154 else
14155 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)");
14156 }
14157 else if(type && (type->kind == 9 || type->kind == 10))
14158 {
14159 struct Type * memberType = exp->member.member ? FindMember(type, exp->member.member->string) : (((void *)0));
14160
14161 if(memberType)
14162 {
14163 exp->expType = memberType;
14164 if(memberType)
14165 memberType->refCount++;
14166 }
14167 }
14168 else
14169 {
14170 char expString[10240];
14171
14172 expString[0] = '\0';
14173 if(inCompiler)
14174 {
14175 PrintExpression(exp, expString);
14176 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14177 }
14178 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "member operator on non-structure type expression %s\n", (((void *)0))), expString);
14179 }
14180 if(exp->expType && exp->expType->kind == 21 && (!exp->destType || exp->destType->kind != 21))
14181 {
14182 if(type && (type->kind == 8 || type->kind == 19 || type->kind == 3 || type->kind == 15))
14183 {
14184 struct Identifier * id = exp->member.member;
14185 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));
14186
14187 if(_class)
14188 {
14189 FreeType(exp->expType);
14190 exp->expType = ReplaceThisClassType(_class);
14191 }
14192 }
14193 }
14194 yylloc = oldyylloc;
14195 break;
14196 }
14197 case 9:
14198 {
14199 struct Type * destType = exp->destType;
14200
14201 if(exp->member.member && exp->member.member->_class && exp->member.member->_class->name)
14202 {
14203 exp->member.member->classSym = exp->member.member->_class->symbol;
14204 }
14205 exp->member.exp = MkExpBrackets(MkListOne(MkExpOp((((void *)0)), '*', exp->member.exp)));
14206 exp->type = 8;
14207 if(destType)
14208 destType->count++;
14209 ProcessExpressionType(exp);
14210 if(destType)
14211 destType->count--;
14212 break;
14213 }
14214 case 15:
14215 {
14216 struct Symbol * classSym = exp->_class->symbol;
14217
14218 if(classSym && classSym->registered)
14219 {
14220 if(classSym->registered->type == 5)
14221 {
14222 char name[1024];
14223
14224 name[0] = '\0';
14225 DeclareStruct(classSym->string, 0x0);
14226 FreeSpecifier(exp->_class);
14227 exp->type = 10;
14228 FullClassNameCat(name, classSym->string, 0x0);
14229 exp->typeName = MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(name), (((void *)0)))), (((void *)0)));
14230 }
14231 else
14232 {
14233 if(classSym->registered->fixed)
14234 {
14235 FreeSpecifier(exp->_class);
14236 exp->constant = PrintUInt(classSym->registered->templateClass ? classSym->registered->templateClass->structSize : classSym->registered->structSize);
14237 exp->type = 2;
14238 }
14239 else
14240 {
14241 char className[1024];
14242
14243 strcpy(className, "__ecereClass_");
14244 FullClassNameCat(className, classSym->string, 0x1);
14245 MangleClassName(className);
14246 DeclareClass(classSym, className);
14247 FreeExpContents(exp);
14248 exp->type = 9;
14249 exp->member.exp = MkExpIdentifier(MkIdentifier(className));
14250 exp->member.member = MkIdentifier("structSize");
14251 }
14252 }
14253 }
14254 exp->expType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1)->kind = 3, ((struct Type *)__ecereTemp1));
14255 break;
14256 }
14257 case 10:
14258 {
14259 struct Type * type = ProcessType(exp->typeName->qualifiers, exp->typeName->declarator);
14260
14261 exp->expType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1)->kind = 3, ((struct Type *)__ecereTemp1));
14262 exp->isConstant = 0x1;
14263 DeclareType(type, 0x0, 0x0);
14264 FreeType(type);
14265 break;
14266 }
14267 case 11:
14268 {
14269 struct Type * type = ProcessType(exp->cast.typeName->qualifiers, exp->cast.typeName->declarator);
14270
14271 type->count = (unsigned int)1;
14272 FreeType(exp->cast.exp->destType);
14273 exp->cast.exp->destType = type;
14274 type->refCount++;
14275 ProcessExpressionType(exp->cast.exp);
14276 type->count = (unsigned int)0;
14277 exp->expType = type;
14278 if(!exp->cast.exp->needCast && !NeedCast(exp->cast.exp->expType, type))
14279 {
14280 void * prev = exp->prev, * next = exp->next;
14281 struct Type * expType = exp->cast.exp->destType;
14282 struct Expression * castExp = exp->cast.exp;
14283 struct Type * destType = exp->destType;
14284
14285 if(expType)
14286 expType->refCount++;
14287 FreeType(exp->expType);
14288 FreeTypeName(exp->cast.typeName);
14289 *exp = *castExp;
14290 FreeType(exp->expType);
14291 FreeType(exp->destType);
14292 exp->expType = expType;
14293 exp->destType = destType;
14294 ((castExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(castExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(castExp)) : 0), castExp = 0);
14295 exp->prev = prev;
14296 exp->next = next;
14297 }
14298 else
14299 {
14300 exp->isConstant = exp->cast.exp->isConstant;
14301 }
14302 break;
14303 }
14304 case 35:
14305 {
14306 struct Type * type = ProcessType(exp->initializer.typeName->qualifiers, exp->initializer.typeName->declarator);
14307
14308 type->refCount++;
14309 exp->expType = type;
14310 break;
14311 }
14312 case 36:
14313 {
14314 struct Type * type = ProcessType(exp->vaArg.typeName->qualifiers, exp->vaArg.typeName->declarator);
14315
14316 ProcessExpressionType(exp->vaArg.exp);
14317 type->refCount++;
14318 exp->expType = type;
14319 break;
14320 }
14321 case 12:
14322 {
14323 struct Expression * e;
14324
14325 exp->isConstant = 0x1;
14326 FreeType(exp->cond.cond->destType);
14327 exp->cond.cond->destType = MkClassType("bool");
14328 exp->cond.cond->destType->truth = 0x1;
14329 ProcessExpressionType(exp->cond.cond);
14330 if(!exp->cond.cond->isConstant)
14331 exp->isConstant = 0x0;
14332 for(e = (*exp->cond.exp).first; e; e = e->next)
14333 {
14334 if(!e->next)
14335 {
14336 FreeType(e->destType);
14337 e->destType = exp->destType;
14338 if(e->destType)
14339 e->destType->refCount++;
14340 }
14341 ProcessExpressionType(e);
14342 if(!e->next)
14343 {
14344 exp->expType = e->expType;
14345 if(e->expType)
14346 e->expType->refCount++;
14347 }
14348 if(!e->isConstant)
14349 exp->isConstant = 0x0;
14350 }
14351 FreeType(exp->cond.elseExp->destType);
14352 exp->cond.elseExp->destType = exp->destType ? exp->destType : exp->expType;
14353 if(exp->cond.elseExp->destType)
14354 exp->cond.elseExp->destType->refCount++;
14355 ProcessExpressionType(exp->cond.elseExp);
14356 if(!exp->cond.elseExp->isConstant)
14357 exp->isConstant = 0x0;
14358 break;
14359 }
14360 case 25:
14361 {
14362 if(exp->compound && exp->compound->compound.statements && (*exp->compound->compound.statements).last)
14363 {
14364 struct Statement * last = (*exp->compound->compound.statements).last;
14365
14366 if(last->type == 3 && last->expressions && (*last->expressions).last)
14367 {
14368 ((struct Expression *)(*last->expressions).last)->destType = exp->destType;
14369 if(exp->destType)
14370 exp->destType->refCount++;
14371 }
14372 ProcessStatement(exp->compound);
14373 exp->expType = ((struct Expression *)(*last->expressions).last)->expType;
14374 if(((struct Expression *)(*last->expressions).last)->expType)
14375 exp->expType->refCount++;
14376 }
14377 break;
14378 }
14379 case 26:
14380 {
14381 struct Specifier * spec = (*exp->_classExp.specifiers).first;
14382
14383 if(spec && spec->type == 1)
14384 {
14385 exp->expType = MkClassType(spec->name);
14386 exp->expType->kind = 19;
14387 exp->byReference = 0x1;
14388 }
14389 else
14390 {
14391 exp->expType = MkClassType("ecere::com::Class");
14392 exp->byReference = 0x1;
14393 }
14394 break;
14395 }
14396 case 27:
14397 {
14398 struct __ecereNameSpace__ecere__com__Class * _class = thisClass ? thisClass : currentClass;
14399
14400 if(_class)
14401 {
14402 struct Identifier * id = exp->classData.id;
14403 char structName[1024];
14404 struct Expression * classExp;
14405
14406 strcpy(structName, "__ecereClassData_");
14407 FullClassNameCat(structName, _class->fullName, 0x0);
14408 exp->type = 9;
14409 exp->member.member = id;
14410 if(curCompound && FindSymbol("this", curContext, curCompound->compound.context, 0x0, 0x0))
14411 classExp = MkExpMember(MkExpIdentifier(MkIdentifier("this")), MkIdentifier("_class"));
14412 else
14413 classExp = MkExpIdentifier(MkIdentifier("class"));
14414 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"))))))));
14415 ProcessExpressionType(exp);
14416 return ;
14417 }
14418 break;
14419 }
14420 case 37:
14421 {
14422 struct Type * type = (((void *)0));
14423 char * typeString = (((void *)0));
14424 char typeStringBuf[1024];
14425
14426 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))
14427 {
14428 struct __ecereNameSpace__ecere__com__Class * templateClass = exp->destType->_class->registered;
14429
14430 typeString = templateClass->templateArgs[2].dataTypeString;
14431 }
14432 else if(exp->list)
14433 {
14434 struct Expression * e;
14435
14436 for(e = (*exp->list).first; e; e = e->next)
14437 {
14438 ProcessExpressionType(e);
14439 if(e->expType)
14440 {
14441 if(!type)
14442 {
14443 type = e->expType;
14444 type->refCount++;
14445 }
14446 else
14447 {
14448 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
14449 {
14450 FreeType(type);
14451 type = e->expType;
14452 e->expType = (((void *)0));
14453 e = (*exp->list).first;
14454 ProcessExpressionType(e);
14455 if(e->expType)
14456 {
14457 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
14458 {
14459 FreeType(e->expType);
14460 e->expType = (((void *)0));
14461 FreeType(type);
14462 type = (((void *)0));
14463 break;
14464 }
14465 }
14466 }
14467 }
14468 if(e->expType)
14469 {
14470 FreeType(e->expType);
14471 e->expType = (((void *)0));
14472 }
14473 }
14474 }
14475 if(type)
14476 {
14477 typeStringBuf[0] = '\0';
14478 PrintType(type, typeStringBuf, 0x0, 0x1);
14479 typeString = typeStringBuf;
14480 FreeType(type);
14481 type = (((void *)0));
14482 }
14483 }
14484 if(typeString)
14485 {
14486 char templateString[1024];
14487 struct __ecereNameSpace__ecere__sys__OldList * initializers = MkList();
14488 struct __ecereNameSpace__ecere__sys__OldList * structInitializers = MkList();
14489 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
14490 struct Expression * expExt;
14491 struct Declarator * decl = SpecDeclFromString(typeString, specs, (((void *)0)));
14492
14493 sprintf(templateString, "Container<%s>", typeString);
14494 if(exp->list)
14495 {
14496 struct Expression * e;
14497
14498 type = ProcessTypeString(typeString, 0x0);
14499 while(e = (*exp->list).first)
14500 {
14501 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*exp->list), e);
14502 e->destType = type;
14503 type->refCount++;
14504 ProcessExpressionType(e);
14505 ListAdd(initializers, MkInitializerAssignment(e));
14506 }
14507 FreeType(type);
14508 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->list), exp->list = 0);
14509 }
14510 DeclareStruct("ecere::com::BuiltInContainer", 0x0);
14511 ListAdd(structInitializers, MkInitializerAssignment(MkExpMember(MkExpClass(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0))), MkIdentifier("_vTbl"))));
14512 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
14513 ListAdd(structInitializers, MkInitializerAssignment(MkExpClass(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0)))));
14514 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
14515 ListAdd(structInitializers, MkInitializerAssignment(MkExpConstant("0")));
14516 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
14517 ListAdd(structInitializers, MkInitializerAssignment(MkExpExtensionInitializer(MkTypeName(specs, MkDeclaratorArray(decl, (((void *)0)))), MkInitializerList(initializers))));
14518 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
14519 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, 0), ((struct Expression *)__ecereTemp1))));
14520 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
14521 ListAdd(structInitializers, MkInitializerAssignment(MkExpClass(CopyList(specs, CopySpecifier), CopyDeclarator(decl))));
14522 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
14523 exp->expType = ProcessTypeString(templateString, 0x0);
14524 exp->type = 5;
14525 exp->list = MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName(templateString)), (((void *)0))), MkExpOp((((void *)0)), '&', expExt = MkExpExtensionInitializer(MkTypeName(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0))), MkInitializerList(structInitializers)))));
14526 ProcessExpressionType(expExt);
14527 }
14528 else
14529 {
14530 exp->expType = ProcessTypeString("Container", 0x0);
14531 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Couldn't determine type of array elements\n", (((void *)0))));
14532 }
14533 break;
14534 }
14535 }
14536 if(exp->expType && exp->expType->kind == 21 && thisClass && (!exp->destType || exp->destType->kind != 21))
14537 {
14538 FreeType(exp->expType);
14539 exp->expType = ReplaceThisClassType(thisClass);
14540 }
14541 if(exp->expType && (exp->expType->kind == 9 || exp->expType->kind == 10 || exp->expType->kind == 15) && !exp->expType->members.first && exp->expType->enumName)
14542 {
14543 struct Symbol * symbol = FindSymbol(exp->expType->enumName, curContext, globalContext, 0x1, 0x0);
14544
14545 if(symbol)
14546 {
14547 if(exp->expType->kind != 15)
14548 {
14549 struct Type * member;
14550 char * enumName = __ecereNameSpace__ecere__sys__CopyString(exp->expType->enumName);
14551
14552 FreeType(exp->expType);
14553 exp->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14554 exp->expType->kind = symbol->type->kind;
14555 exp->expType->refCount++;
14556 exp->expType->enumName = enumName;
14557 exp->expType->members = symbol->type->members;
14558 for(member = symbol->type->members.first; member; member = member->next)
14559 member->refCount++;
14560 }
14561 else
14562 {
14563 struct __ecereNameSpace__ecere__sys__NamedLink * member;
14564
14565 for(member = symbol->type->members.first; member; member = member->next)
14566 {
14567 struct __ecereNameSpace__ecere__sys__NamedLink * value = (value = __ecereNameSpace__ecere__com__eSystem_New0(16), value->name = __ecereNameSpace__ecere__sys__CopyString(member->name), value);
14568
14569 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&exp->expType->members, value);
14570 }
14571 }
14572 }
14573 }
14574 yylloc = exp->loc;
14575 if(exp->destType && (exp->destType->kind == 0 || exp->destType->kind == 18))
14576 ;
14577 else if(exp->destType && !exp->destType->keepCast)
14578 {
14579 if(!CheckExpressionType(exp, exp->destType, 0x0))
14580 {
14581 if(!exp->destType->count || unresolved)
14582 {
14583 if(!exp->expType)
14584 {
14585 yylloc = exp->loc;
14586 if(exp->destType->kind != 14)
14587 {
14588 char type2[1024];
14589
14590 type2[0] = '\0';
14591 if(inCompiler)
14592 {
14593 char expString[10240];
14594
14595 expString[0] = '\0';
14596 PrintType(exp->destType, type2, 0x0, 0x1);
14597 if(inCompiler)
14598 {
14599 PrintExpression(exp, expString);
14600 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14601 }
14602 if(unresolved)
14603 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "unresolved identifier %s; expected %s\n", (((void *)0))), expString, type2);
14604 else if(exp->type != 16)
14605 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't determine type of %s; expected %s\n", (((void *)0))), expString, type2);
14606 }
14607 }
14608 else
14609 {
14610 char expString[10240];
14611
14612 expString[0] = '\0';
14613 if(inCompiler)
14614 {
14615 PrintExpression(exp, expString);
14616 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14617 }
14618 if(unresolved)
14619 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "unresolved identifier %s\n", (((void *)0))), expString);
14620 else if(exp->type != 16)
14621 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't determine type of %s\n", (((void *)0))), expString);
14622 }
14623 }
14624 else
14625 {
14626 char type1[1024];
14627 char type2[1024];
14628
14629 type1[0] = '\0';
14630 type2[0] = '\0';
14631 if(inCompiler)
14632 {
14633 PrintType(exp->expType, type1, 0x0, 0x1);
14634 PrintType(exp->destType, type2, 0x0, 0x1);
14635 }
14636 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)))
14637 ;
14638 else
14639 {
14640 char expString[10240];
14641
14642 expString[0] = '\0';
14643 if(inCompiler)
14644 {
14645 PrintExpression(exp, expString);
14646 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14647 }
14648 if(!sourceFile || (strcmp(sourceFile, "src\\lexer.ec") && strcmp(sourceFile, "src/lexer.ec") && strcmp(sourceFile, "src\\grammar.ec") && strcmp(sourceFile, "src/grammar.ec")))
14649 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible expression %s (%s); expected %s\n", (((void *)0))), expString, type1, type2);
14650 FreeType(exp->expType);
14651 exp->destType->refCount++;
14652 exp->expType = exp->destType;
14653 }
14654 }
14655 }
14656 }
14657 else if(exp->destType && exp->destType->kind == 14 && exp->expType && exp->expType->passAsTemplate)
14658 {
14659 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
14660 char typeString[1024];
14661 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
14662 struct Declarator * decl;
14663
14664 typeString[0] = '\0';
14665 *newExp = *exp;
14666 if(exp->expType)
14667 exp->expType->refCount++;
14668 if(exp->expType)
14669 exp->expType->refCount++;
14670 exp->type = 11;
14671 newExp->destType = exp->expType;
14672 PrintType(exp->expType, typeString, 0x0, 0x0);
14673 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
14674 exp->cast.typeName = MkTypeName(specs, decl);
14675 exp->cast.exp = newExp;
14676 }
14677 }
14678 else if(unresolved)
14679 {
14680 if(exp->identifier->_class && exp->identifier->_class->name)
14681 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "unresolved identifier %s::%s\n", (((void *)0))), exp->identifier->_class->name, exp->identifier->string);
14682 else if(exp->identifier->string && exp->identifier->string[0])
14683 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "unresolved identifier %s\n", (((void *)0))), exp->identifier->string);
14684 }
14685 else if(!exp->expType && exp->type != 16)
14686 {
14687 char expString[10240];
14688
14689 expString[0] = '\0';
14690 if(inCompiler)
14691 {
14692 PrintExpression(exp, expString);
14693 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14694 }
14695 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't determine type of %s\n", (((void *)0))), expString);
14696 }
14697 ApplyAnyObjectLogic(exp);
14698 if(!notByReference && exp->expType && exp->expType->kind == 8 && exp->expType->_class && exp->expType->_class->registered && exp->expType->_class->registered->type == 5)
14699 {
14700 exp->byReference = 0x1;
14701 }
14702 yylloc = oldyylloc;
14703 }
14704
14705 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)
14706 {
14707 if(*curMember)
14708 {
14709 *curMember = (*curMember)->next;
14710 if(subMemberStackPos && *subMemberStackPos > 0 && subMemberStack[*subMemberStackPos - 1]->type == 1)
14711 {
14712 *curMember = subMemberStack[--(*subMemberStackPos)];
14713 *curMember = (*curMember)->next;
14714 }
14715 while((*curMember) && (*curMember)->isProperty)
14716 *curMember = (*curMember)->next;
14717 if(subMemberStackPos)
14718 {
14719 while((*curMember) && !(*curMember)->isProperty && !(*curMember)->name && ((*curMember)->type == 2 || (*curMember)->type == 1))
14720 {
14721 subMemberStack[(*subMemberStackPos)++] = *curMember;
14722 *curMember = (*curMember)->members.first;
14723 while(*curMember && (*curMember)->isProperty)
14724 *curMember = (*curMember)->next;
14725 }
14726 }
14727 }
14728 while(!*curMember)
14729 {
14730 if(!*curMember)
14731 {
14732 if(subMemberStackPos && *subMemberStackPos)
14733 {
14734 *curMember = subMemberStack[--(*subMemberStackPos)];
14735 *curMember = (*curMember)->next;
14736 }
14737 else
14738 {
14739 struct __ecereNameSpace__ecere__com__Class * lastCurClass = *curClass;
14740
14741 if(*curClass == _class)
14742 break;
14743 for(*curClass = _class; (*curClass)->base != lastCurClass && (*curClass)->base->type != 1000; *curClass = (*curClass)->base)
14744 ;
14745 *curMember = (*curClass)->membersAndProperties.first;
14746 }
14747 while((*curMember) && (*curMember)->isProperty)
14748 *curMember = (*curMember)->next;
14749 if(subMemberStackPos)
14750 {
14751 while((*curMember) && !(*curMember)->isProperty && !(*curMember)->name && ((*curMember)->type == 2 || (*curMember)->type == 1))
14752 {
14753 subMemberStack[(*subMemberStackPos)++] = *curMember;
14754 *curMember = (*curMember)->members.first;
14755 while(*curMember && (*curMember)->isProperty)
14756 *curMember = (*curMember)->next;
14757 }
14758 }
14759 }
14760 }
14761 }
14762
14763 static void ProcessInitializer(struct Initializer * init, struct Type * type)
14764 {
14765 switch(init->type)
14766 {
14767 case 0:
14768 if(!init->exp || init->exp->type != 1 || !init->exp->instance || init->exp->instance->_class || !type || type->kind == 8)
14769 {
14770 if(init->exp && !init->exp->destType)
14771 {
14772 FreeType(init->exp->destType);
14773 init->exp->destType = type;
14774 if(type)
14775 type->refCount++;
14776 }
14777 if(init->exp)
14778 {
14779 ProcessExpressionType(init->exp);
14780 init->isConstant = init->exp->isConstant;
14781 }
14782 break;
14783 }
14784 else
14785 {
14786 struct Expression * exp = init->exp;
14787 struct Instantiation * inst = exp->instance;
14788 struct MembersInit * members;
14789
14790 init->type = 1;
14791 init->list = MkList();
14792 if(inst->members)
14793 {
14794 for(members = (*inst->members).first; members; members = members->next)
14795 {
14796 if(members->type == 0)
14797 {
14798 struct MemberInit * member;
14799
14800 for(member = (*members->dataMembers).first; member; member = member->next)
14801 {
14802 ListAdd(init->list, member->initializer);
14803 member->initializer = (((void *)0));
14804 }
14805 }
14806 }
14807 }
14808 FreeExpression(exp);
14809 }
14810 case 1:
14811 {
14812 struct Initializer * i;
14813 struct Type * initializerType = (((void *)0));
14814 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
14815 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
14816 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
14817 int subMemberStackPos = 0;
14818
14819 if(type && type->kind == 12)
14820 initializerType = Dereference(type);
14821 else if(type && (type->kind == 9 || type->kind == 10))
14822 initializerType = type->members.first;
14823 for(i = (*init->list).first; i; i = i->next)
14824 {
14825 if(type && type->kind == 8 && type->_class && type->_class->registered)
14826 {
14827 FindNextDataMember(type->_class->registered, &curClass, &curMember, subMemberStack, &subMemberStackPos);
14828 if(curMember)
14829 {
14830 if(!curMember->dataType)
14831 curMember->dataType = ProcessTypeString(curMember->dataTypeString, 0x0);
14832 initializerType = curMember->dataType;
14833 }
14834 }
14835 ProcessInitializer(i, initializerType);
14836 if(initializerType && type && (type->kind == 9 || type->kind == 10))
14837 initializerType = initializerType->next;
14838 if(!i->isConstant)
14839 init->isConstant = 0x0;
14840 }
14841 if(type && type->kind == 12)
14842 FreeType(initializerType);
14843 if(type && type->kind != 12 && type->kind != 9 && type->kind != 10 && (type->kind != 8 || !type->_class->registered || type->_class->registered->type != 1))
14844 {
14845 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Assigning list initializer to non list\n", (((void *)0))));
14846 }
14847 break;
14848 }
14849 }
14850 }
14851
14852 extern struct Symbol * FindType(struct Context * ctx, char *  name);
14853
14854 static void ProcessClass(struct __ecereNameSpace__ecere__sys__OldList * definitions, struct Symbol * symbol);
14855
14856 static void ProcessSpecifier(struct Specifier * spec, unsigned int declareStruct)
14857 {
14858 switch(spec->type)
14859 {
14860 case 0:
14861 {
14862 if(spec->specifier == THISCLASS)
14863 {
14864 if(thisClass)
14865 {
14866 spec->type = 1;
14867 spec->name = ReplaceThisClass(thisClass);
14868 spec->symbol = FindClass(spec->name);
14869 ProcessSpecifier(spec, declareStruct);
14870 }
14871 }
14872 break;
14873 }
14874 case 1:
14875 {
14876 struct Symbol * symbol = FindType(curContext, spec->name);
14877
14878 if(symbol)
14879 DeclareType(symbol->type, 0x1, 0x1);
14880 else if((symbol = spec->symbol) && symbol->registered && symbol->registered->type == 1 && declareStruct)
14881 DeclareStruct(spec->name, 0x0);
14882 break;
14883 }
14884 case 2:
14885 {
14886 struct Enumerator * e;
14887
14888 if(spec->list)
14889 {
14890 for(e = (*spec->list).first; e; e = e->next)
14891 {
14892 if(e->exp)
14893 ProcessExpressionType(e->exp);
14894 }
14895 }
14896 break;
14897 }
14898 case 3:
14899 case 4:
14900 {
14901 if(spec->definitions)
14902 {
14903 struct ClassDef * def;
14904 struct Symbol * symbol = spec->id ? FindClass(spec->id->string) : (((void *)0));
14905
14906 ProcessClass(spec->definitions, symbol);
14907 }
14908 break;
14909 }
14910 }
14911 }
14912
14913 static void ProcessDeclarator(struct Declarator * decl)
14914 {
14915 switch(decl->type)
14916 {
14917 case 1:
14918 if(decl->identifier->classSym)
14919 {
14920 FreeSpecifier(decl->identifier->_class);
14921 decl->identifier->_class = (((void *)0));
14922 }
14923 break;
14924 case 3:
14925 if(decl->array.exp)
14926 ProcessExpressionType(decl->array.exp);
14927 case 0:
14928 case 2:
14929 case 4:
14930 case 5:
14931 case 6:
14932 case 7:
14933 if(decl->declarator)
14934 ProcessDeclarator(decl->declarator);
14935 if(decl->type == 4)
14936 {
14937 struct Identifier * id = GetDeclId(decl);
14938
14939 if(id && id->_class)
14940 {
14941 struct TypeName * param = (param = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TypeName), param->qualifiers = MkListOne(id->_class), param->declarator = (((void *)0)), param);
14942
14943 if(!decl->function.parameters)
14944 decl->function.parameters = MkList();
14945 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*decl->function.parameters), (((void *)0)), param);
14946 id->_class = (((void *)0));
14947 }
14948 if(decl->function.parameters)
14949 {
14950 struct TypeName * param;
14951
14952 for(param = (*decl->function.parameters).first; param; param = param->next)
14953 {
14954 if(param->qualifiers && (*param->qualifiers).first)
14955 {
14956 struct Specifier * spec = (*param->qualifiers).first;
14957
14958 if(spec && spec->specifier == TYPED_OBJECT)
14959 {
14960 struct Declarator * d = param->declarator;
14961 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);
14962
14963 FreeList(param->qualifiers, FreeSpecifier);
14964 param->qualifiers = MkListOne(MkStructOrUnion(3, MkIdentifier("__ecereNameSpace__ecere__com__Class"), (((void *)0))));
14965 param->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier("class")));
14966 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*decl->function.parameters), param, newParam);
14967 param = newParam;
14968 }
14969 else if(spec && spec->specifier == ANY_OBJECT)
14970 {
14971 struct Declarator * d = param->declarator;
14972
14973 FreeList(param->qualifiers, FreeSpecifier);
14974 param->qualifiers = MkListOne(MkSpecifier(VOID));
14975 param->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d);
14976 }
14977 else if(spec->specifier == THISCLASS)
14978 {
14979 if(thisClass)
14980 {
14981 spec->type = 1;
14982 spec->name = ReplaceThisClass(thisClass);
14983 spec->symbol = FindClass(spec->name);
14984 ProcessSpecifier(spec, 0x0);
14985 }
14986 }
14987 }
14988 if(param->declarator)
14989 ProcessDeclarator(param->declarator);
14990 }
14991 }
14992 }
14993 break;
14994 }
14995 }
14996
14997 extern struct Identifier * CopyIdentifier(struct Identifier * id);
14998
14999 extern void FreeInitDeclarator(struct InitDeclarator * decl);
15000
15001 static void ProcessDeclaration(struct Declaration * decl)
15002 {
15003 yylloc = decl->loc;
15004 switch(decl->type)
15005 {
15006 case 1:
15007 {
15008 unsigned int declareStruct = 0x0;
15009
15010 if(decl->declarators)
15011 {
15012 struct InitDeclarator * d;
15013
15014 for(d = (*decl->declarators).first; d; d = d->next)
15015 {
15016 struct Type * type, * subType;
15017
15018 ProcessDeclarator(d->declarator);
15019 type = ProcessType(decl->specifiers, d->declarator);
15020 if(d->initializer)
15021 {
15022 ProcessInitializer(d->initializer, type);
15023 if((*decl->declarators).count == 1 && d->initializer->type == 0 && d->initializer->exp->type == 1)
15024 {
15025 if(type->kind == 8 && type->_class == d->initializer->exp->expType->_class)
15026 {
15027 struct Instantiation * inst = d->initializer->exp->instance;
15028
15029 inst->exp = MkExpIdentifier(CopyIdentifier(GetDeclId(d->declarator)));
15030 d->initializer->exp->instance = (((void *)0));
15031 if(decl->specifiers)
15032 FreeList(decl->specifiers, FreeSpecifier);
15033 FreeList(decl->declarators, FreeInitDeclarator);
15034 d = (((void *)0));
15035 decl->type = 2;
15036 decl->inst = inst;
15037 }
15038 }
15039 }
15040 for(subType = type; subType; )
15041 {
15042 if(subType->kind == 8)
15043 {
15044 declareStruct = 0x1;
15045 break;
15046 }
15047 else if(subType->kind == 13)
15048 break;
15049 else if(subType->kind == 12)
15050 subType = subType->arrayType;
15051 else
15052 break;
15053 }
15054 FreeType(type);
15055 if(!d)
15056 break;
15057 }
15058 }
15059 if(decl->specifiers)
15060 {
15061 struct Specifier * s;
15062
15063 for(s = (*decl->specifiers).first; s; s = s->next)
15064 {
15065 ProcessSpecifier(s, declareStruct);
15066 }
15067 }
15068 break;
15069 }
15070 case 2:
15071 {
15072 ProcessInstantiationType(decl->inst);
15073 break;
15074 }
15075 case 0:
15076 {
15077 struct Specifier * spec;
15078 struct Declarator * d;
15079 unsigned int declareStruct = 0x0;
15080
15081 if(decl->declarators)
15082 {
15083 for(d = (*decl->declarators).first; d; d = d->next)
15084 {
15085 struct Type * type = ProcessType(decl->specifiers, d->declarator);
15086 struct Type * subType;
15087
15088 ProcessDeclarator(d);
15089 for(subType = type; subType; )
15090 {
15091 if(subType->kind == 8)
15092 {
15093 declareStruct = 0x1;
15094 break;
15095 }
15096 else if(subType->kind == 13)
15097 break;
15098 else if(subType->kind == 12)
15099 subType = subType->arrayType;
15100 else
15101 break;
15102 }
15103 FreeType(type);
15104 }
15105 }
15106 if(decl->specifiers)
15107 {
15108 for(spec = (*decl->specifiers).first; spec; spec = spec->next)
15109 ProcessSpecifier(spec, declareStruct);
15110 }
15111 break;
15112 }
15113 }
15114 }
15115
15116 static struct FunctionDefinition * curFunction;
15117
15118 static void CreateFireWatcher(struct __ecereNameSpace__ecere__com__Property * prop, struct Expression * object, struct Statement * stmt)
15119 {
15120 char propName[1024], propNameM[1024];
15121 char getName[1024], setName[1024];
15122 struct __ecereNameSpace__ecere__sys__OldList * args;
15123
15124 DeclareProperty(prop, setName, getName);
15125 strcpy(propName, "__ecereProp_");
15126 FullClassNameCat(propName, prop->_class->fullName, 0x0);
15127 strcat(propName, "_");
15128 FullClassNameCat(propName, prop->name, 0x1);
15129 MangleClassName(propName);
15130 strcpy(propNameM, "__ecerePropM_");
15131 FullClassNameCat(propNameM, prop->_class->fullName, 0x0);
15132 strcat(propNameM, "_");
15133 FullClassNameCat(propNameM, prop->name, 0x1);
15134 MangleClassName(propNameM);
15135 if(prop->isWatchable)
15136 {
15137 args = MkList();
15138 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
15139 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
15140 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireWatchers")), args));
15141 args = MkList();
15142 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
15143 ListAdd(args, MkExpIdentifier(MkIdentifier(propNameM)));
15144 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireWatchers")), args));
15145 }
15146 {
15147 args = MkList();
15148 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
15149 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
15150 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireSelfWatchers")), args));
15151 args = MkList();
15152 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
15153 ListAdd(args, MkExpIdentifier(MkIdentifier(propNameM)));
15154 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireSelfWatchers")), args));
15155 }
15156 if(curFunction->propSet && !strcmp(curFunction->propSet->string, prop->name) && (!object || (object->type == 0 && !strcmp(object->identifier->string, "this"))))
15157 curFunction->propSet->fireWatchersDone = 0x1;
15158 }
15159
15160 extern struct Declaration * MkDeclarationInst(struct Instantiation * inst);
15161
15162 extern struct Instantiation * MkInstantiationNamed(struct __ecereNameSpace__ecere__sys__OldList * specs, struct Expression * exp, struct __ecereNameSpace__ecere__sys__OldList * members);
15163
15164 extern struct Statement * MkIfStmt(struct __ecereNameSpace__ecere__sys__OldList * exp, struct Statement * statement, struct Statement * elseStmt);
15165
15166 extern struct Statement * MkForStmt(struct Statement * init, struct Statement * check, struct __ecereNameSpace__ecere__sys__OldList * inc, struct Statement * statement);
15167
15168 extern struct Statement * MkWhileStmt(struct __ecereNameSpace__ecere__sys__OldList * exp, struct Statement * statement);
15169
15170 extern struct ClassFunction * MkClassFunction(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct Specifier * _class, struct Declarator * decl, struct __ecereNameSpace__ecere__sys__OldList * declList);
15171
15172 extern void ProcessClassFunctionBody(struct ClassFunction * func, struct Statement * body);
15173
15174 extern void FreePropertyWatch(struct PropertyWatch * watcher);
15175
15176 static void ProcessStatement(struct Statement * stmt)
15177 {
15178 yylloc = stmt->loc;
15179 switch(stmt->type)
15180 {
15181 case 0:
15182 ProcessStatement(stmt->labeled.stmt);
15183 break;
15184 case 1:
15185 if(stmt->caseStmt.exp)
15186 {
15187 FreeType(stmt->caseStmt.exp->destType);
15188 stmt->caseStmt.exp->destType = curSwitchType;
15189 if(curSwitchType)
15190 curSwitchType->refCount++;
15191 ProcessExpressionType(stmt->caseStmt.exp);
15192 ComputeExpression(stmt->caseStmt.exp);
15193 }
15194 if(stmt->caseStmt.stmt)
15195 ProcessStatement(stmt->caseStmt.stmt);
15196 break;
15197 case 2:
15198 {
15199 if(stmt->compound.context)
15200 {
15201 struct Declaration * decl;
15202 struct Statement * s;
15203 struct Statement * prevCompound = curCompound;
15204 struct Context * prevContext = curContext;
15205
15206 if(!stmt->compound.isSwitch)
15207 {
15208 curCompound = stmt;
15209 curContext = stmt->compound.context;
15210 }
15211 if(stmt->compound.declarations)
15212 {
15213 for(decl = (*stmt->compound.declarations).first; decl; decl = decl->next)
15214 ProcessDeclaration(decl);
15215 }
15216 if(stmt->compound.statements)
15217 {
15218 for(s = (*stmt->compound.statements).first; s; s = s->next)
15219 ProcessStatement(s);
15220 }
15221 curContext = prevContext;
15222 curCompound = prevCompound;
15223 }
15224 break;
15225 }
15226 case 3:
15227 {
15228 struct Expression * exp;
15229
15230 if(stmt->expressions)
15231 {
15232 for(exp = (*stmt->expressions).first; exp; exp = exp->next)
15233 ProcessExpressionType(exp);
15234 }
15235 break;
15236 }
15237 case 4:
15238 {
15239 struct Expression * exp;
15240
15241 FreeType(((struct Expression *)(*stmt->ifStmt.exp).last)->destType);
15242 ((struct Expression *)(*stmt->ifStmt.exp).last)->destType = MkClassType("bool");
15243 ((struct Expression *)(*stmt->ifStmt.exp).last)->destType->truth = 0x1;
15244 for(exp = (*stmt->ifStmt.exp).first; exp; exp = exp->next)
15245 {
15246 ProcessExpressionType(exp);
15247 }
15248 if(stmt->ifStmt.stmt)
15249 ProcessStatement(stmt->ifStmt.stmt);
15250 if(stmt->ifStmt.elseStmt)
15251 ProcessStatement(stmt->ifStmt.elseStmt);
15252 break;
15253 }
15254 case 5:
15255 {
15256 struct Type * oldSwitchType = curSwitchType;
15257
15258 if(stmt->switchStmt.exp)
15259 {
15260 struct Expression * exp;
15261
15262 for(exp = (*stmt->switchStmt.exp).first; exp; exp = exp->next)
15263 {
15264 if(!exp->next)
15265 {
15266 ProcessExpressionType(exp);
15267 }
15268 if(!exp->next)
15269 curSwitchType = exp->expType;
15270 }
15271 }
15272 ProcessStatement(stmt->switchStmt.stmt);
15273 curSwitchType = oldSwitchType;
15274 break;
15275 }
15276 case 6:
15277 {
15278 if(stmt->whileStmt.exp)
15279 {
15280 struct Expression * exp;
15281
15282 FreeType(((struct Expression *)(*stmt->whileStmt.exp).last)->destType);
15283 ((struct Expression *)(*stmt->whileStmt.exp).last)->destType = MkClassType("bool");
15284 ((struct Expression *)(*stmt->whileStmt.exp).last)->destType->truth = 0x1;
15285 for(exp = (*stmt->whileStmt.exp).first; exp; exp = exp->next)
15286 {
15287 ProcessExpressionType(exp);
15288 }
15289 }
15290 if(stmt->whileStmt.stmt)
15291 ProcessStatement(stmt->whileStmt.stmt);
15292 break;
15293 }
15294 case 7:
15295 {
15296 if(stmt->doWhile.exp)
15297 {
15298 struct Expression * exp;
15299
15300 if((*stmt->doWhile.exp).last)
15301 {
15302 FreeType(((struct Expression *)(*stmt->doWhile.exp).last)->destType);
15303 ((struct Expression *)(*stmt->doWhile.exp).last)->destType = MkClassType("bool");
15304 ((struct Expression *)(*stmt->doWhile.exp).last)->destType->truth = 0x1;
15305 }
15306 for(exp = (*stmt->doWhile.exp).first; exp; exp = exp->next)
15307 {
15308 ProcessExpressionType(exp);
15309 }
15310 }
15311 if(stmt->doWhile.stmt)
15312 ProcessStatement(stmt->doWhile.stmt);
15313 break;
15314 }
15315 case 8:
15316 {
15317 struct Expression * exp;
15318
15319 if(stmt->forStmt.init)
15320 ProcessStatement(stmt->forStmt.init);
15321 if(stmt->forStmt.check && stmt->forStmt.check->expressions)
15322 {
15323 FreeType(((struct Expression *)(*stmt->forStmt.check->expressions).last)->destType);
15324 ((struct Expression *)(*stmt->forStmt.check->expressions).last)->destType = MkClassType("bool");
15325 ((struct Expression *)(*stmt->forStmt.check->expressions).last)->destType->truth = 0x1;
15326 }
15327 if(stmt->forStmt.check)
15328 ProcessStatement(stmt->forStmt.check);
15329 if(stmt->forStmt.increment)
15330 {
15331 for(exp = (*stmt->forStmt.increment).first; exp; exp = exp->next)
15332 ProcessExpressionType(exp);
15333 }
15334 if(stmt->forStmt.stmt)
15335 ProcessStatement(stmt->forStmt.stmt);
15336 break;
15337 }
15338 case 18:
15339 {
15340 struct Identifier * id = stmt->forEachStmt.id;
15341 struct __ecereNameSpace__ecere__sys__OldList * exp = stmt->forEachStmt.exp;
15342 struct __ecereNameSpace__ecere__sys__OldList * filter = stmt->forEachStmt.filter;
15343 struct Statement * block = stmt->forEachStmt.stmt;
15344 char iteratorType[1024];
15345 struct Type * source;
15346 struct Expression * e;
15347 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));
15348 struct Expression * arrayExp;
15349 char * typeString = (((void *)0));
15350 int builtinCount = 0;
15351
15352 for(e = exp ? (*exp).first : (((void *)0)); e; e = e->next)
15353 {
15354 if(!e->next)
15355 {
15356 FreeType(e->destType);
15357 e->destType = ProcessTypeString("Container", 0x0);
15358 }
15359 if(!isBuiltin || e->next)
15360 ProcessExpressionType(e);
15361 }
15362 source = (exp && (*exp).last) ? ((struct Expression *)(*exp).last)->expType : (((void *)0));
15363 if(isBuiltin || (source && source->kind == 8 && source->_class && source->_class->registered && source->_class->registered != containerClass && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, containerClass)))
15364 {
15365 struct __ecereNameSpace__ecere__com__Class * _class = source ? source->_class->registered : (((void *)0));
15366 struct Symbol * symbol;
15367 struct Expression * expIt = (((void *)0));
15368 unsigned int isMap = 0x0, isArray = 0x0, isLinkList = 0x0, isList = 0x0, isCustomAVLTree = 0x0, isAVLTree = 0x0;
15369 struct __ecereNameSpace__ecere__com__Class * arrayClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "Array");
15370 struct __ecereNameSpace__ecere__com__Class * linkListClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "LinkList");
15371 struct __ecereNameSpace__ecere__com__Class * customAVLTreeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "CustomAVLTree");
15372
15373 stmt->type = 2;
15374 stmt->compound.context = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Context);
15375 stmt->compound.context->parent = curContext;
15376 curContext = stmt->compound.context;
15377 if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, customAVLTreeClass))
15378 {
15379 struct __ecereNameSpace__ecere__com__Class * mapClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "Map");
15380 struct __ecereNameSpace__ecere__com__Class * avlTreeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "AVLTree");
15381
15382 isCustomAVLTree = 0x1;
15383 if(__ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, avlTreeClass))
15384 isAVLTree = 0x1;
15385 else if(__ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, mapClass))
15386 isMap = 0x1;
15387 }
15388 else if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, arrayClass))
15389 isArray = 0x1;
15390 else if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, linkListClass))
15391 {
15392 struct __ecereNameSpace__ecere__com__Class * listClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "List");
15393
15394 isLinkList = 0x1;
15395 isList = __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, listClass);
15396 }
15397 if(isArray)
15398 {
15399 struct Declarator * decl;
15400 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15401
15402 decl = SpecDeclFromString(_class->templateArgs[2].dataTypeString, specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(id)));
15403 stmt->compound.declarations = MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(decl, (((void *)0))))));
15404 ListAdd(stmt->compound.declarations, MkDeclaration(MkListOne(MkSpecifierName(source->_class->registered->fullName)), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internalArray")), MkInitializerAssignment(MkExpBrackets(exp))))));
15405 }
15406 else if(isBuiltin)
15407 {
15408 struct Type * type = (((void *)0));
15409 char typeStringBuf[1024];
15410
15411 arrayExp = (((struct Expression *)(*exp).last)->type == 37) ? (struct Expression *)(*exp).last : ((struct Expression *)(*exp).last)->cast.exp;
15412 if(((struct Expression *)(*exp).last)->type == 11)
15413 {
15414 struct TypeName * typeName = ((struct Expression *)(*exp).last)->cast.typeName;
15415
15416 if(typeName)
15417 arrayExp->destType = ProcessType(typeName->qualifiers, typeName->declarator);
15418 }
15419 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)
15420 {
15421 struct __ecereNameSpace__ecere__com__Class * templateClass = arrayExp->destType->_class->registered;
15422
15423 typeString = templateClass->templateArgs[2].dataTypeString;
15424 }
15425 else if(arrayExp->list)
15426 {
15427 struct Expression * e;
15428
15429 for(e = (*arrayExp->list).first; e; e = e->next)
15430 {
15431 ProcessExpressionType(e);
15432 if(e->expType)
15433 {
15434 if(!type)
15435 {
15436 type = e->expType;
15437 type->refCount++;
15438 }
15439 else
15440 {
15441 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
15442 {
15443 FreeType(type);
15444 type = e->expType;
15445 e->expType = (((void *)0));
15446 e = (*arrayExp->list).first;
15447 ProcessExpressionType(e);
15448 if(e->expType)
15449 {
15450 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
15451 {
15452 FreeType(e->expType);
15453 e->expType = (((void *)0));
15454 FreeType(type);
15455 type = (((void *)0));
15456 break;
15457 }
15458 }
15459 }
15460 }
15461 if(e->expType)
15462 {
15463 FreeType(e->expType);
15464 e->expType = (((void *)0));
15465 }
15466 }
15467 }
15468 if(type)
15469 {
15470 typeStringBuf[0] = '\0';
15471 PrintType(type, typeStringBuf, 0x0, 0x1);
15472 typeString = typeStringBuf;
15473 FreeType(type);
15474 }
15475 }
15476 if(typeString)
15477 {
15478 struct __ecereNameSpace__ecere__sys__OldList * initializers = MkList();
15479 struct Declarator * decl;
15480 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15481
15482 if(arrayExp->list)
15483 {
15484 struct Expression * e;
15485
15486 builtinCount = (*arrayExp->list).count;
15487 type = ProcessTypeString(typeString, 0x0);
15488 while(e = (*arrayExp->list).first)
15489 {
15490 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*arrayExp->list), e);
15491 e->destType = type;
15492 type->refCount++;
15493 ProcessExpressionType(e);
15494 ListAdd(initializers, MkInitializerAssignment(e));
15495 }
15496 FreeType(type);
15497 (__ecereNameSpace__ecere__com__eSystem_Delete(arrayExp->list), arrayExp->list = 0);
15498 }
15499 decl = SpecDeclFromString(typeString, specs, MkDeclaratorIdentifier(id));
15500 stmt->compound.declarations = MkListOne(MkDeclaration(CopyList(specs, CopySpecifier), MkListOne(MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl), (((void *)0))))));
15501 ListAdd(stmt->compound.declarations, MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorArray(PlugDeclarator(decl, MkDeclaratorIdentifier(MkIdentifier("__internalArray"))), (((void *)0))), MkInitializerList(initializers)))));
15502 FreeList(exp, FreeExpression);
15503 }
15504 else
15505 {
15506 arrayExp->expType = ProcessTypeString("Container", 0x0);
15507 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Couldn't determine type of array elements\n", (((void *)0))));
15508 }
15509 }
15510 else if(isLinkList && !isList)
15511 {
15512 struct Declarator * decl;
15513 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15514
15515 decl = SpecDeclFromString(_class->templateArgs[3].dataTypeString, specs, MkDeclaratorIdentifier(id));
15516 stmt->compound.declarations = MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(decl, (((void *)0))))));
15517 ListAdd(stmt->compound.declarations, MkDeclaration(MkListOne(MkSpecifierName(source->_class->registered->fullName)), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internalLinkList")), MkInitializerAssignment(MkExpBrackets(exp))))));
15518 }
15519 else if(_class->templateArgs)
15520 {
15521 if(isMap)
15522 sprintf(iteratorType, "MapIterator<%s, %s >", _class->templateArgs[5].dataTypeString, _class->templateArgs[6].dataTypeString);
15523 else
15524 sprintf(iteratorType, "Iterator<%s, %s >", _class->templateArgs[2].dataTypeString, _class->templateArgs[1].dataTypeString);
15525 stmt->compound.declarations = MkListOne(MkDeclarationInst(MkInstantiationNamed(MkListOne(MkSpecifierName(iteratorType)), MkExpIdentifier(id), MkListOne(MkMembersInitList(MkListOne(MkMemberInit(isMap ? MkListOne(MkIdentifier("map")) : (((void *)0)), MkInitializerAssignment(MkExpBrackets(exp)))))))));
15526 }
15527 symbol = FindSymbol(id->string, curContext, curContext, 0x0, 0x0);
15528 if(block && block->type == 2 && block->compound.context)
15529 {
15530 block->compound.context->parent = stmt->compound.context;
15531 }
15532 if(filter)
15533 {
15534 block = MkIfStmt(filter, block, (((void *)0)));
15535 }
15536 if(isArray)
15537 {
15538 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));
15539 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.init);
15540 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.check);
15541 ProcessExpressionType((*((struct Statement *)(*stmt->compound.statements).first)->forStmt.increment).first);
15542 }
15543 else if(isBuiltin)
15544 {
15545 char count[128];
15546
15547 sprintf(count, "%d", builtinCount);
15548 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));
15549 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.init);
15550 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.check);
15551 ProcessExpressionType((*((struct Statement *)(*stmt->compound.statements).first)->forStmt.increment).first);
15552 }
15553 else if(isLinkList && !isList)
15554 {
15555 struct __ecereNameSpace__ecere__com__Class * typeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, _class->templateArgs[3].dataTypeString);
15556 struct __ecereNameSpace__ecere__com__Class * listItemClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, "ListItem");
15557
15558 if(typeClass && __ecereNameSpace__ecere__com__eClass_IsDerived(typeClass, listItemClass) && _class->templateArgs[5].dataTypeString && !strcmp(_class->templateArgs[5].dataTypeString, "LT::link"))
15559 {
15560 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));
15561 }
15562 else
15563 {
15564 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15565 struct Declarator * decl = SpecDeclFromString(_class->templateArgs[3].dataTypeString, specs, (((void *)0)));
15566
15567 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));
15568 }
15569 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.init);
15570 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.check);
15571 ProcessExpressionType((*((struct Statement *)(*stmt->compound.statements).first)->forStmt.increment).first);
15572 }
15573 else
15574 {
15575 stmt->compound.statements = MkListOne(MkWhileStmt(MkListOne(MkExpCall(MkExpMember(expIt = MkExpIdentifier(CopyIdentifier(id)), MkIdentifier("Next")), (((void *)0)))), block));
15576 }
15577 ProcessExpressionType(expIt);
15578 if((*stmt->compound.declarations).first)
15579 ProcessDeclaration((*stmt->compound.declarations).first);
15580 if(symbol)
15581 symbol->isIterator = isMap ? 2 : ((isArray || isBuiltin) ? 3 : (isLinkList ? (isList ? 5 : 4) : (isCustomAVLTree ? 6 : 1)));
15582 ProcessStatement(stmt);
15583 curContext = stmt->compound.context->parent;
15584 break;
15585 }
15586 else
15587 {
15588 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Expression is not a container\n", (((void *)0))));
15589 }
15590 break;
15591 }
15592 case 9:
15593 break;
15594 case 10:
15595 break;
15596 case 11:
15597 break;
15598 case 12:
15599 {
15600 struct Expression * exp;
15601
15602 if(stmt->expressions)
15603 {
15604 for(exp = (*stmt->expressions).first; exp; exp = exp->next)
15605 {
15606 if(!exp->next)
15607 {
15608 if(curFunction && !curFunction->type)
15609 curFunction->type = ProcessType(curFunction->specifiers, curFunction->declarator);
15610 FreeType(exp->destType);
15611 exp->destType = (curFunction && curFunction->type && curFunction->type->kind == 11) ? curFunction->type->returnType : (((void *)0));
15612 if(exp->destType)
15613 exp->destType->refCount++;
15614 }
15615 ProcessExpressionType(exp);
15616 }
15617 }
15618 break;
15619 }
15620 case 14:
15621 {
15622 ProcessDeclaration(stmt->decl);
15623 break;
15624 }
15625 case 13:
15626 {
15627 struct AsmField * field;
15628
15629 if(stmt->asmStmt.inputFields)
15630 {
15631 for(field = (*stmt->asmStmt.inputFields).first; field; field = field->next)
15632 if(field->expression)
15633 ProcessExpressionType(field->expression);
15634 }
15635 if(stmt->asmStmt.outputFields)
15636 {
15637 for(field = (*stmt->asmStmt.outputFields).first; field; field = field->next)
15638 if(field->expression)
15639 ProcessExpressionType(field->expression);
15640 }
15641 if(stmt->asmStmt.clobberedFields)
15642 {
15643 for(field = (*stmt->asmStmt.clobberedFields).first; field; field = field->next)
15644 {
15645 if(field->expression)
15646 ProcessExpressionType(field->expression);
15647 }
15648 }
15649 break;
15650 }
15651 case 17:
15652 {
15653 struct PropertyWatch * propWatch;
15654 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->_watch.watches;
15655 struct Expression * object = stmt->_watch.object;
15656 struct Expression * watcher = stmt->_watch.watcher;
15657
15658 if(watcher)
15659 ProcessExpressionType(watcher);
15660 if(object)
15661 ProcessExpressionType(object);
15662 if(inCompiler)
15663 {
15664 if(watcher || thisClass)
15665 {
15666 struct External * external = curExternal;
15667 struct Context * context = curContext;
15668
15669 stmt->type = 3;
15670 stmt->expressions = MkList();
15671 curExternal = external->prev;
15672 for(propWatch = (*watches).first; propWatch; propWatch = propWatch->next)
15673 {
15674 struct ClassFunction * func;
15675 char watcherName[1024];
15676 struct __ecereNameSpace__ecere__com__Class * watcherClass = watcher ? ((watcher->expType && watcher->expType->kind == 8 && watcher->expType->_class) ? watcher->expType->_class->registered : (((void *)0))) : thisClass;
15677 struct External * createdExternal;
15678 struct External * externalDecl = MkExternalDeclaration((((void *)0)));
15679
15680 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, externalDecl);
15681 sprintf(watcherName, "__ecerePropertyWatcher_%d", propWatcherID++);
15682 if(propWatch->deleteWatch)
15683 strcat(watcherName, "_delete");
15684 else
15685 {
15686 struct Identifier * propID;
15687
15688 for(propID = (*propWatch->properties).first; propID; propID = propID->next)
15689 {
15690 strcat(watcherName, "_");
15691 strcat(watcherName, propID->string);
15692 }
15693 }
15694 if(object && object->expType && object->expType->kind == 8 && object->expType->_class && object->expType->_class->registered)
15695 {
15696 func = MkClassFunction(MkListOne(MkSpecifier(VOID)), (((void *)0)), MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(watcherName)), MkListOne(MkTypeName(MkListOne(MkSpecifierName(object->expType->_class->string)), MkDeclaratorIdentifier(MkIdentifier("value"))))), (((void *)0)));
15697 ProcessClassFunctionBody(func, propWatch->compound);
15698 propWatch->compound = (((void *)0));
15699 createdExternal = ProcessClassFunction(watcherClass, func, ast, curExternal, 0x1);
15700 createdExternal->symbol->idCode = external->symbol->idCode;
15701 curExternal = createdExternal;
15702 ProcessFunction(createdExternal->function);
15703 {
15704 struct Declaration * decl = MkDeclaration(CopyList(createdExternal->function->specifiers, CopySpecifier), MkListOne(MkInitDeclarator(CopyDeclarator(createdExternal->function->declarator), (((void *)0)))));
15705
15706 externalDecl->declaration = decl;
15707 if(decl->symbol && !decl->symbol->pointerExternal)
15708 decl->symbol->pointerExternal = externalDecl;
15709 }
15710 if(propWatch->deleteWatch)
15711 {
15712 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
15713
15714 ListAdd(args, CopyExpression(object));
15715 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
15716 ListAdd(args, MkExpIdentifier(MkIdentifier(watcherName)));
15717 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_WatchDestruction")), args));
15718 }
15719 else
15720 {
15721 struct __ecereNameSpace__ecere__com__Class * _class = object->expType->_class->registered;
15722 struct Identifier * propID;
15723
15724 for(propID = (*propWatch->properties).first; propID; propID = propID->next)
15725 {
15726 char propName[1024];
15727 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
15728
15729 if(prop)
15730 {
15731 char getName[1024], setName[1024];
15732 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
15733
15734 DeclareProperty(prop, setName, getName);
15735 strcpy(propName, "__ecereProp_");
15736 FullClassNameCat(propName, prop->_class->fullName, 0x0);
15737 strcat(propName, "_");
15738 FullClassNameCat(propName, prop->name, 0x1);
15739 ListAdd(args, CopyExpression(object));
15740 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
15741 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
15742 ListAdd(args, MkExpIdentifier(MkIdentifier(watcherName)));
15743 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_Watch")), args));
15744 }
15745 else
15746 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Property %s not found in class %s\n", (((void *)0))), prop->name, _class->fullName);
15747 }
15748 }
15749 }
15750 else
15751 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Invalid watched object\n", (((void *)0))));
15752 }
15753 curExternal = external;
15754 curContext = context;
15755 if(watcher)
15756 FreeExpression(watcher);
15757 if(object)
15758 FreeExpression(object);
15759 FreeList(watches, FreePropertyWatch);
15760 }
15761 else
15762 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "No observer specified and not inside a _class\n", (((void *)0))));
15763 }
15764 else
15765 {
15766 for(propWatch = (*watches).first; propWatch; propWatch = propWatch->next)
15767 {
15768 ProcessStatement(propWatch->compound);
15769 }
15770 }
15771 break;
15772 }
15773 case 15:
15774 {
15775 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->_watch.watches;
15776 struct Expression * object = stmt->_watch.object;
15777 struct __ecereNameSpace__ecere__com__Class * _class;
15778
15779 if(object)
15780 ProcessExpressionType(object);
15781 if(inCompiler)
15782 {
15783 _class = object ? ((object->expType && object->expType->kind == 8 && object->expType->_class) ? object->expType->_class->registered : (((void *)0))) : thisClass;
15784 if(_class)
15785 {
15786 struct Identifier * propID;
15787
15788 stmt->type = 3;
15789 stmt->expressions = MkList();
15790 if(!watches && curFunction->propSet && (!object || (object->type == 0 && !strcmp(object->identifier->string, "this"))))
15791 {
15792 watches = MkListOne(MkIdentifier(curFunction->propSet->string));
15793 }
15794 else if(!watches)
15795 {
15796 }
15797 if(watches)
15798 {
15799 for(propID = (*watches).first; propID; propID = propID->next)
15800 {
15801 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
15802
15803 if(prop)
15804 {
15805 CreateFireWatcher(prop, object, stmt);
15806 }
15807 else
15808 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Property %s not found in class %s\n", (((void *)0))), propID->string, _class->fullName);
15809 }
15810 }
15811 else
15812 {
15813 struct __ecereNameSpace__ecere__com__Property * prop;
15814 struct __ecereNameSpace__ecere__com__Class * base;
15815
15816 for(base = _class; base; base = base->base)
15817 {
15818 for(prop = base->membersAndProperties.first; prop; prop = prop->next)
15819 {
15820 if(prop->isProperty && prop->isWatchable)
15821 {
15822 CreateFireWatcher(prop, object, stmt);
15823 }
15824 }
15825 }
15826 }
15827 if(object)
15828 FreeExpression(object);
15829 FreeList(watches, FreeIdentifier);
15830 }
15831 else
15832 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Invalid object specified and not inside a class\n", (((void *)0))));
15833 }
15834 break;
15835 }
15836 case 16:
15837 {
15838 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->_watch.watches;
15839 struct Expression * object = stmt->_watch.object;
15840 struct Expression * watcher = stmt->_watch.watcher;
15841 struct __ecereNameSpace__ecere__com__Class * _class;
15842
15843 if(object)
15844 ProcessExpressionType(object);
15845 if(watcher)
15846 ProcessExpressionType(watcher);
15847 if(inCompiler)
15848 {
15849 _class = (object && object->expType && object->expType->kind == 8 && object->expType->_class) ? object->expType->_class->registered : (((void *)0));
15850 if(watcher || thisClass)
15851 {
15852 if(_class)
15853 {
15854 struct Identifier * propID;
15855
15856 stmt->type = 3;
15857 stmt->expressions = MkList();
15858 if(!watches)
15859 {
15860 struct __ecereNameSpace__ecere__sys__OldList * args;
15861
15862 args = MkList();
15863 ListAdd(args, CopyExpression(object));
15864 ListAdd(args, MkExpConstant("0"));
15865 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
15866 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_StopWatching")), args));
15867 }
15868 else
15869 {
15870 for(propID = (*watches).first; propID; propID = propID->next)
15871 {
15872 char propName[1024];
15873 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
15874
15875 if(prop)
15876 {
15877 char getName[1024], setName[1024];
15878 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
15879
15880 DeclareProperty(prop, setName, getName);
15881 strcpy(propName, "__ecereProp_");
15882 FullClassNameCat(propName, prop->_class->fullName, 0x0);
15883 strcat(propName, "_");
15884 FullClassNameCat(propName, prop->name, 0x1);
15885 MangleClassName(propName);
15886 ListAdd(args, CopyExpression(object));
15887 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
15888 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
15889 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_StopWatching")), args));
15890 }
15891 else
15892 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Property %s not found in class %s\n", (((void *)0))), prop->name, _class->fullName);
15893 }
15894 }
15895 if(object)
15896 FreeExpression(object);
15897 if(watcher)
15898 FreeExpression(watcher);
15899 FreeList(watches, FreeIdentifier);
15900 }
15901 else
15902 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Invalid object specified and not inside a class\n", (((void *)0))));
15903 }
15904 else
15905 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "No observer specified and not inside a class\n", (((void *)0))));
15906 }
15907 break;
15908 }
15909 }
15910 }
15911
15912 extern struct Expression * QBrackets(struct Expression * exp);
15913
15914 extern struct TypeName * QMkType(char *  spec, struct Declarator * decl);
15915
15916 extern struct Declarator * QMkPtrDecl(char *  id);
15917
15918 extern struct Expression * MkExpPointer(struct Expression * expression, struct Identifier * member);
15919
15920 extern struct Expression * QMkExpCond(struct Expression * cond, struct Expression * exp, struct Expression * elseExp);
15921
15922 extern struct Statement * MkFireWatchersStmt(struct Expression * object, struct __ecereNameSpace__ecere__sys__OldList * watches);
15923
15924 static void ProcessFunction(struct FunctionDefinition * function)
15925 {
15926 void * __ecereTemp2;
15927 void * __ecereTemp1;
15928 struct Identifier * id = GetDeclId(function->declarator);
15929 struct Symbol * symbol = function->declarator ? function->declarator->symbol : (((void *)0));
15930 struct Type * type = symbol ? symbol->type : (((void *)0));
15931 struct __ecereNameSpace__ecere__com__Class * oldThisClass = thisClass;
15932 struct Context * oldTopContext = topContext;
15933
15934 yylloc = function->loc;
15935 if(type && type->thisClass)
15936 {
15937 struct Symbol * classSym = type->thisClass;
15938 struct __ecereNameSpace__ecere__com__Class * _class = type->thisClass->registered;
15939 char className[1024];
15940 char structName[1024];
15941 struct Declarator * funcDecl;
15942 struct Symbol * thisSymbol;
15943 unsigned int typedObject = 0x0;
15944
15945 if(_class && !_class->base)
15946 {
15947 _class = currentClass;
15948 if(_class && !_class->symbol)
15949 _class->symbol = FindClass(_class->fullName);
15950 classSym = _class ? _class->symbol : (((void *)0));
15951 typedObject = 0x1;
15952 }
15953 thisClass = _class;
15954 if(inCompiler && _class)
15955 {
15956 if(type->kind == 11)
15957 {
15958 if(symbol->type->params.count == 1 && ((struct Type *)symbol->type->params.first)->kind == 0)
15959 {
15960 struct Type * param = symbol->type->params.first;
15961
15962 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(&symbol->type->params, param);
15963 FreeType(param);
15964 }
15965 if(type->classObjectType != 1)
15966 {
15967 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(&symbol->type->params, (((void *)0)), MkClassType(_class->fullName));
15968 symbol->type->staticMethod = 0x1;
15969 symbol->type->thisClass = (((void *)0));
15970 symbol->type->extraParam = 0x0;
15971 }
15972 }
15973 strcpy(className, "__ecereClass_");
15974 FullClassNameCat(className, _class->fullName, 0x1);
15975 MangleClassName(className);
15976 structName[0] = (char)0;
15977 FullClassNameCat(structName, _class->fullName, 0x0);
15978 funcDecl = GetFuncDecl(function->declarator);
15979 if(funcDecl)
15980 {
15981 if(funcDecl->function.parameters && (*funcDecl->function.parameters).count == 1)
15982 {
15983 struct TypeName * param = (*funcDecl->function.parameters).first;
15984
15985 if(param->qualifiers && (*param->qualifiers).count == 1 && ((struct Specifier *)(*param->qualifiers).first)->specifier == VOID && !param->declarator)
15986 {
15987 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->function.parameters), param);
15988 FreeTypeName(param);
15989 }
15990 }
15991 if(!function->propertyNoThis)
15992 {
15993 struct TypeName * thisParam;
15994
15995 if(type->classObjectType != 1)
15996 {
15997 thisParam = QMkClass(_class->fullName, MkDeclaratorIdentifier(MkIdentifier("this")));
15998 if(!funcDecl->function.parameters)
15999 funcDecl->function.parameters = MkList();
16000 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
16001 }
16002 if(typedObject)
16003 {
16004 if(type->classObjectType != 1)
16005 {
16006 if(type->byReference || _class->type == 3 || _class->type == 1000 || _class->type == 4 || _class->type == 2)
16007 thisParam->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), thisParam->declarator);
16008 }
16009 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));
16010 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
16011 }
16012 }
16013 }
16014 if(symbol && symbol->pointerExternal && symbol->pointerExternal->type == 1)
16015 {
16016 struct InitDeclarator * initDecl = (*symbol->pointerExternal->declaration->declarators).first;
16017
16018 funcDecl = GetFuncDecl(initDecl->declarator);
16019 if(funcDecl)
16020 {
16021 if(funcDecl->function.parameters && (*funcDecl->function.parameters).count == 1)
16022 {
16023 struct TypeName * param = (*funcDecl->function.parameters).first;
16024
16025 if(param->qualifiers && (*param->qualifiers).count == 1 && ((struct Specifier *)(*param->qualifiers).first)->specifier == VOID && !param->declarator)
16026 {
16027 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->function.parameters), param);
16028 FreeTypeName(param);
16029 }
16030 }
16031 if(type->classObjectType != 1)
16032 {
16033 if((_class->type != 2 && _class->type != 3 && _class->type != 4) || function != (struct FunctionDefinition *)symbol->externalSet)
16034 {
16035 struct TypeName * thisParam = QMkClass(_class->fullName, MkDeclaratorIdentifier(MkIdentifier("this")));
16036
16037 if(!funcDecl->function.parameters)
16038 funcDecl->function.parameters = MkList();
16039 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
16040 }
16041 }
16042 }
16043 }
16044 }
16045 if(function->body)
16046 {
16047 if(type->classObjectType != 1)
16048 {
16049 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));
16050 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&function->body->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
16051 if(typedObject && thisSymbol->type)
16052 {
16053 thisSymbol->type->classObjectType = 2;
16054 thisSymbol->type->byReference = type->byReference;
16055 }
16056 }
16057 }
16058 if(inCompiler && _class && (_class->type == 0) && type->classObjectType != 1)
16059 {
16060 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
16061
16062 {
16063 struct __ecereNameSpace__ecere__com__Class * base;
16064
16065 for(base = _class; base && base->type != 1000; base = base->next)
16066 {
16067 for(member = base->membersAndProperties.first; member; member = member->next)
16068 if(!member->isProperty)
16069 break;
16070 if(member)
16071 break;
16072 }
16073 }
16074 for(member = _class->membersAndProperties.first; member; member = member->next)
16075 if(!member->isProperty)
16076 break;
16077 if(member)
16078 {
16079 char pointerName[1024];
16080 struct Declaration * decl;
16081 struct Initializer * initializer;
16082 struct Expression * exp, * bytePtr;
16083
16084 strcpy(pointerName, "__ecerePointer_");
16085 FullClassNameCat(pointerName, _class->fullName, 0x0);
16086 {
16087 char className[1024];
16088
16089 strcpy(className, "__ecereClass_");
16090 FullClassNameCat(className, classSym->string, 0x1);
16091 MangleClassName(className);
16092 DeclareClass(classSym, className);
16093 }
16094 bytePtr = QBrackets(MkExpCast(QMkType("char", QMkPtrDecl((((void *)0)))), QMkExpId("this")));
16095 if(_class->fixed)
16096 {
16097 char string[256];
16098
16099 sprintf(string, "%d", _class->offset);
16100 exp = QBrackets(MkExpOp(bytePtr, '+', MkExpConstant(string)));
16101 }
16102 else
16103 {
16104 exp = QBrackets(MkExpOp(bytePtr, '+', MkExpPointer(QMkExpId(className), MkIdentifier("offset"))));
16105 }
16106 exp = QBrackets(QMkExpCond(QMkExpId("this"), exp, MkExpConstant("0")));
16107 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));
16108 if(function->body)
16109 {
16110 yylloc = function->body->loc;
16111 initializer = MkInitializerAssignment(MkExpCast(MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(structName), (((void *)0)))), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), exp));
16112 {
16113 struct Context * prevContext = curContext;
16114
16115 curContext = function->body->compound.context;
16116 decl = MkDeclaration(MkListOne(MkStructOrUnion(3, MkIdentifier(structName), (((void *)0)))), MkListOne(MkInitDeclarator(QMkPtrDecl(pointerName), initializer)));
16117 curContext = prevContext;
16118 }
16119 decl->symbol = (((void *)0));
16120 if(!function->body->compound.declarations)
16121 function->body->compound.declarations = MkList();
16122 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*function->body->compound.declarations), (((void *)0)), decl);
16123 }
16124 }
16125 }
16126 }
16127 else
16128 thisClass = (((void *)0));
16129 if(id)
16130 {
16131 FreeSpecifier(id->_class);
16132 id->_class = (((void *)0));
16133 if(symbol && symbol->pointerExternal && symbol->pointerExternal->type == 1)
16134 {
16135 struct InitDeclarator * initDecl = (*symbol->pointerExternal->declaration->declarators).first;
16136
16137 id = GetDeclId(initDecl->declarator);
16138 FreeSpecifier(id->_class);
16139 id->_class = (((void *)0));
16140 }
16141 }
16142 if(function->body)
16143 topContext = function->body->compound.context;
16144 {
16145 struct FunctionDefinition * oldFunction = curFunction;
16146
16147 curFunction = function;
16148 if(function->body)
16149 ProcessStatement(function->body);
16150 if(inCompiler && function->propSet && !function->propSet->fireWatchersDone)
16151 {
16152 struct Statement * prevCompound = curCompound;
16153 struct Context * prevContext = curContext;
16154 struct Statement * fireWatchers = MkFireWatchersStmt((((void *)0)), (((void *)0)));
16155
16156 if(!function->body->compound.statements)
16157 function->body->compound.statements = MkList();
16158 ListAdd(function->body->compound.statements, fireWatchers);
16159 curCompound = function->body;
16160 curContext = function->body->compound.context;
16161 ProcessStatement(fireWatchers);
16162 curContext = prevContext;
16163 curCompound = prevCompound;
16164 }
16165 curFunction = oldFunction;
16166 }
16167 if(function->declarator)
16168 {
16169 ProcessDeclarator(function->declarator);
16170 }
16171 topContext = oldTopContext;
16172 thisClass = oldThisClass;
16173 }
16174
16175 extern void FreeSymbol(struct Symbol * symbol);
16176
16177 void __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Remove(struct __ecereNameSpace__ecere__sys__BinaryTree * this, struct __ecereNameSpace__ecere__sys__BTNode * node);
16178
16179 static void ProcessClass(struct __ecereNameSpace__ecere__sys__OldList * definitions, struct Symbol * symbol)
16180 {
16181 struct ClassDef * def;
16182 struct External * external = curExternal;
16183 struct __ecereNameSpace__ecere__com__Class * regClass = symbol ? symbol->registered : (((void *)0));
16184
16185 for(def = definitions->first; def; def = def->next)
16186 {
16187 if(def->type == 0)
16188 {
16189 if(def->function->declarator)
16190 curExternal = def->function->declarator->symbol->pointerExternal;
16191 else
16192 curExternal = external;
16193 ProcessFunction((struct FunctionDefinition *)def->function);
16194 }
16195 else if(def->type == 2)
16196 {
16197 if(def->decl->type == 2)
16198 {
16199 thisClass = regClass;
16200 ProcessInstantiationType(def->decl->inst);
16201 thisClass = (((void *)0));
16202 }
16203 else
16204 {
16205 struct __ecereNameSpace__ecere__com__Class * backThisClass = thisClass;
16206
16207 if(regClass)
16208 thisClass = regClass;
16209 ProcessDeclaration(def->decl);
16210 thisClass = backThisClass;
16211 }
16212 }
16213 else if(def->type == 1 && def->defProperties)
16214 {
16215 struct MemberInit * defProperty;
16216 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);
16217
16218 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
16219 for(defProperty = (*def->defProperties).first; defProperty; defProperty = defProperty->next)
16220 {
16221 thisClass = regClass;
16222 ProcessMemberInitData(defProperty, regClass, (((void *)0)), (((void *)0)), (((void *)0)), (((void *)0)));
16223 thisClass = (((void *)0));
16224 }
16225 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Remove(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
16226 FreeSymbol(thisSymbol);
16227 }
16228 else if(def->type == 3 && def->propertyDef)
16229 {
16230 struct PropertyDef * prop = def->propertyDef;
16231
16232 thisClass = regClass;
16233 if(prop->setStmt)
16234 {
16235 if(regClass)
16236 {
16237 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
16238
16239 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->setStmt->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
16240 }
16241 curExternal = prop->symbol ? prop->symbol->externalSet : (((void *)0));
16242 ProcessStatement(prop->setStmt);
16243 }
16244 if(prop->getStmt)
16245 {
16246 if(regClass)
16247 {
16248 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
16249
16250 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->getStmt->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
16251 }
16252 curExternal = prop->symbol ? prop->symbol->externalGet : (((void *)0));
16253 ProcessStatement(prop->getStmt);
16254 }
16255 if(prop->issetStmt)
16256 {
16257 if(regClass)
16258 {
16259 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
16260
16261 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->issetStmt->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
16262 }
16263 curExternal = prop->symbol ? prop->symbol->externalIsSet : (((void *)0));
16264 ProcessStatement(prop->issetStmt);
16265 }
16266 thisClass = (((void *)0));
16267 }
16268 else if(def->type == 4 && def->propertyWatch)
16269 {
16270 struct PropertyWatch * propertyWatch = def->propertyWatch;
16271
16272 thisClass = regClass;
16273 if(propertyWatch->compound)
16274 {
16275 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);
16276
16277 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&propertyWatch->compound->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
16278 curExternal = (((void *)0));
16279 ProcessStatement(propertyWatch->compound);
16280 }
16281 thisClass = (((void *)0));
16282 }
16283 }
16284 }
16285
16286 void DeclareFunctionUtil(char * s)
16287 {
16288 struct __ecereNameSpace__ecere__com__GlobalFunction * function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, s);
16289
16290 if(function)
16291 {
16292 char name[1024];
16293
16294 name[0] = (char)0;
16295 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + 12)))->importType != 1 && (!function->dataType || !function->dataType->dllExport))
16296 strcpy(name, "__ecereFunction_");
16297 FullClassNameCat(name, s, 0x0);
16298 DeclareFunction(function, name);
16299 }
16300 }
16301
16302 extern struct __ecereNameSpace__ecere__com__Instance * GetPrivateModule(void);
16303
16304 void ComputeDataTypes()
16305 {
16306 void * __ecereTemp1;
16307 struct External * external;
16308 struct External * temp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_External);
16309
16310 currentClass = (((void *)0));
16311 containerClass = __ecereNameSpace__ecere__com__eSystem_FindClass(GetPrivateModule(), "Container");
16312 temp->symbol = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), ((struct Symbol *)__ecereTemp1)->id = -1000, ((struct Symbol *)__ecereTemp1)->idCode = -1000, ((struct Symbol *)__ecereTemp1));
16313 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), (((void *)0)), temp);
16314 curExternal = temp;
16315 DeclareFunctionUtil("eSystem_New");
16316 DeclareFunctionUtil("eSystem_New0");
16317 DeclareFunctionUtil("eSystem_Renew");
16318 DeclareFunctionUtil("eSystem_Renew0");
16319 DeclareStruct("ecere::com::Class", 0x0);
16320 DeclareStruct("ecere::com::Instance", 0x0);
16321 DeclareStruct("ecere::com::Property", 0x0);
16322 DeclareStruct("ecere::com::DataMember", 0x0);
16323 DeclareStruct("ecere::com::Method", 0x0);
16324 DeclareStruct("ecere::com::SerialBuffer", 0x0);
16325 DeclareStruct("ecere::com::ClassTemplateArgument", 0x0);
16326 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*ast), temp);
16327 for(external = (*ast).first; external; external = external->next)
16328 {
16329 afterExternal = curExternal = external;
16330 if(external->type == 0)
16331 {
16332 currentClass = external->function->_class;
16333 ProcessFunction(external->function);
16334 }
16335 else if(external->type == 1)
16336 {
16337 currentClass = (((void *)0));
16338 ProcessDeclaration(external->declaration);
16339 }
16340 else if(external->type == 2)
16341 {
16342 struct ClassDefinition * _class = external->_class;
16343
16344 currentClass = external->symbol->registered;
16345 if(_class->definitions)
16346 {
16347 ProcessClass(_class->definitions, _class->symbol);
16348 }
16349 if(inCompiler)
16350 {
16351 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*ast), external);
16352 ((external ? (__ecereClass_External->Destructor ? __ecereClass_External->Destructor(external) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(external)) : 0), external = 0);
16353 }
16354 }
16355 else if(external->type == 4)
16356 {
16357 thisNameSpace = external->id->string;
16358 }
16359 }
16360 currentClass = (((void *)0));
16361 thisNameSpace = (((void *)0));
16362 ((temp->symbol ? (__ecereClass_Symbol->Destructor ? __ecereClass_Symbol->Destructor(temp->symbol) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(temp->symbol)) : 0), temp->symbol = 0);
16363 ((temp ? (__ecereClass_External->Destructor ? __ecereClass_External->Destructor(temp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(temp)) : 0), temp = 0);
16364 }
16365
16366 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);
16367
16368 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);
16369
16370 void __ecereRegisterModule_pass15(struct __ecereNameSpace__ecere__com__Instance * module)
16371 {
16372 struct __ecereNameSpace__ecere__com__Class * class;
16373
16374 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetYydebug", "void SetYydebug(bool b)", SetYydebug, module, 1);
16375 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetThisClass", "void SetThisClass(ecere::com::Class c)", SetThisClass, module, 1);
16376 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetThisClass", "ecere::com::Class GetThisClass(void)", GetThisClass, module, 1);
16377 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintExpression", "void PrintExpression(Expression exp, char * string)", PrintExpression, module, 1);
16378 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("_strtoi64", "int64 _strtoi64(char * string, char * * endString, int base)", _strtoi64, module, 2);
16379 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("_strtoui64", "uint64 _strtoui64(char * string, char * * endString, int base)", _strtoui64, module, 2);
16380 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessTemplateParameterType", "Type ProcessTemplateParameterType(TemplateParameter param)", ProcessTemplateParameterType, module, 2);
16381 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("NeedCast", "bool NeedCast(Type type1, Type type2)", NeedCast, module, 2);
16382 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintInt", "char * PrintInt(int64 result)", PrintInt, module, 1);
16383 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUInt", "char * PrintUInt(uint64 result)", PrintUInt, module, 1);
16384 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintInt64", "char * PrintInt64(int64 result)", PrintInt64, module, 1);
16385 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUInt64", "char * PrintUInt64(uint64 result)", PrintUInt64, module, 1);
16386 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintHexUInt", "char * PrintHexUInt(uint64 result)", PrintHexUInt, module, 1);
16387 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintHexUInt64", "char * PrintHexUInt64(uint64 result)", PrintHexUInt64, module, 1);
16388 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintShort", "char * PrintShort(short result)", PrintShort, module, 1);
16389 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUShort", "char * PrintUShort(uint16 result)", PrintUShort, module, 1);
16390 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintChar", "char * PrintChar(char result)", PrintChar, module, 1);
16391 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUChar", "char * PrintUChar(byte result)", PrintUChar, module, 1);
16392 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintFloat", "char * PrintFloat(float result)", PrintFloat, module, 1);
16393 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintDouble", "char * PrintDouble(double result)", PrintDouble, module, 1);
16394 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetInt", "bool GetInt(Expression exp, int * value2)", GetInt, module, 1);
16395 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUInt", "bool GetUInt(Expression exp, uint * value2)", GetUInt, module, 1);
16396 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetInt64", "bool GetInt64(Expression exp, int64 * value2)", GetInt64, module, 1);
16397 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUInt64", "bool GetUInt64(Expression exp, uint64 * value2)", GetUInt64, module, 1);
16398 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetIntPtr", "bool GetIntPtr(Expression exp, intptr * value2)", GetIntPtr, module, 1);
16399 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUIntPtr", "bool GetUIntPtr(Expression exp, uintptr * value2)", GetUIntPtr, module, 1);
16400 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetShort", "bool GetShort(Expression exp, short * value2)", GetShort, module, 1);
16401 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUShort", "bool GetUShort(Expression exp, uint16 * value2)", GetUShort, module, 1);
16402 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetChar", "bool GetChar(Expression exp, char * value2)", GetChar, module, 1);
16403 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUChar", "bool GetUChar(Expression exp, byte * value2)", GetUChar, module, 1);
16404 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetFloat", "bool GetFloat(Expression exp, float * value2)", GetFloat, module, 1);
16405 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetDouble", "bool GetDouble(Expression exp, double * value2)", GetDouble, module, 1);
16406 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeClassMembers", "void ComputeClassMembers(ecere::com::Class _class, bool isMember)", ComputeClassMembers, module, 2);
16407 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeModuleClasses", "void ComputeModuleClasses(ecere::com::Module module)", ComputeModuleClasses, module, 1);
16408 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeTypeSize", "int ComputeTypeSize(Type type)", ComputeTypeSize, module, 1);
16409 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("AddMembers", "int AddMembers(ecere::sys::OldList * declarations, ecere::com::Class _class, bool isMember, uint * retSize, ecere::com::Class topClass)", AddMembers, module, 2);
16410 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareStruct", "void DeclareStruct(char * name, bool skipNoHead)", DeclareStruct, module, 2);
16411 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareProperty", "void DeclareProperty(ecere::com::Property prop, char * setName, char * getName)", DeclareProperty, module, 2);
16412 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("Dereference", "Type Dereference(Type source)", Dereference, module, 1);
16413 __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);
16414 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessInstantiationType", "void ProcessInstantiationType(Instantiation inst)", ProcessInstantiationType, module, 2);
16415 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindTemplateArg", "ecere::com::ClassTemplateArgument * FindTemplateArg(ecere::com::Class _class, TemplateParameter param)", FindTemplateArg, module, 2);
16416 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetupTemplatesContext", "Context SetupTemplatesContext(ecere::com::Class _class)", SetupTemplatesContext, module, 1);
16417 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FinishTemplatesContext", "void FinishTemplatesContext(Context context)", FinishTemplatesContext, module, 1);
16418 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessMethodType", "void ProcessMethodType(ecere::com::Method method)", ProcessMethodType, module, 1);
16419 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessPropertyType", "void ProcessPropertyType(ecere::com::Property prop)", ProcessPropertyType, module, 1);
16420 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareMethod", "void DeclareMethod(ecere::com::Method method, char * name)", DeclareMethod, module, 1);
16421 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClass", "char * ReplaceThisClass(ecere::com::Class _class)", ReplaceThisClass, module, 2);
16422 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClassType", "Type ReplaceThisClassType(ecere::com::Class _class)", ReplaceThisClassType, module, 2);
16423 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClassSpecifiers", "void ReplaceThisClassSpecifiers(ecere::sys::OldList specs, ecere::com::Class _class)", ReplaceThisClassSpecifiers, module, 2);
16424 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareFunction", "bool DeclareFunction(ecere::com::GlobalFunction function, char * name)", DeclareFunction, module, 2);
16425 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareGlobalData", "void DeclareGlobalData(GlobalData data)", DeclareGlobalData, module, 2);
16426 class = __ecereNameSpace__ecere__com__eSystem_RegisterClass(5, "Conversion", 0, sizeof(struct Conversion), 0, 0, 0, module, 2, 1);
16427 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + 12)))->application == ((struct __ecereNameSpace__ecere__com__Module *)(((char *)__thisModule + 12)))->application && class)
16428 __ecereClass_Conversion = class;
16429 __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);
16430 __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);
16431 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ModuleVisibility", "bool ModuleVisibility(ecere::com::Module searchIn, ecere::com::Module searchFor)", ModuleVisibility, module, 1);
16432 __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);
16433 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("MatchTypeExpression", "bool MatchTypeExpression(Expression sourceExp, Type dest, ecere::sys::OldList conversions, bool skipUnitBla)", MatchTypeExpression, module, 2);
16434 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReadString", "void ReadString(char * output, char * string)", ReadString, module, 1);
16435 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOperand", "Operand GetOperand(Expression exp)", GetOperand, module, 1);
16436 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PopulateInstance", "void PopulateInstance(Instantiation inst)", PopulateInstance, module, 1);
16437 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeInstantiation", "void ComputeInstantiation(Expression exp)", ComputeInstantiation, module, 1);
16438 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CallOperator", "void CallOperator(Expression exp, Expression exp1, Expression exp2, Operand op1, Operand op2)", CallOperator, module, 1);
16439 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeExpression", "void ComputeExpression(Expression exp)", ComputeExpression, module, 1);
16440 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CheckTemplateTypes", "void CheckTemplateTypes(Expression exp)", CheckTemplateTypes, module, 1);
16441 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindSymbol", "Symbol FindSymbol(char * name, Context startContext, Context endContext, bool isStruct, bool globalNameSpace)", FindSymbol, module, 1);
16442 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintType", "void PrintType(Type type, char * string, bool printName, bool fullName)", PrintType, module, 1);
16443 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindMemberAndOffset", "Type FindMemberAndOffset(Type type, char * string, uint * offset)", FindMemberAndOffset, module, 1);
16444 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ParseExpressionString", "Expression ParseExpressionString(char * expression)", ParseExpressionString, module, 1);
16445 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceExpContents", "void ReplaceExpContents(Expression checkedExp, Expression newExp)", ReplaceExpContents, module, 1);
16446 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ApplyAnyObjectLogic", "void ApplyAnyObjectLogic(Expression e)", ApplyAnyObjectLogic, module, 1);
16447 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessExpressionType", "void ProcessExpressionType(Expression exp)", ProcessExpressionType, module, 1);
16448 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareFunctionUtil", "void DeclareFunctionUtil(String s)", DeclareFunctionUtil, module, 1);
16449 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeDataTypes", "void ComputeDataTypes(void)", ComputeDataTypes, module, 1);
16450 }
16451
16452 void __ecereUnregisterModule_pass15(struct __ecereNameSpace__ecere__com__Instance * module)
16453 {
16454
16455 }
16456