compiler: Updated bootstrap
[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 struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__BTNode;
27
28 struct __ecereNameSpace__ecere__sys__BTNode;
29
30 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__BinaryTree;
31
32 struct __ecereNameSpace__ecere__sys__BinaryTree
33 {
34 struct __ecereNameSpace__ecere__sys__BTNode * root;
35 int count;
36 int (*  CompareKey)(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, uintptr_t a, uintptr_t b);
37 void (*  FreeKey)(void *  key);
38 } __attribute__ ((gcc_struct));
39
40 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__OldList;
41
42 struct __ecereNameSpace__ecere__sys__OldList
43 {
44 void *  first;
45 void *  last;
46 int count;
47 unsigned int offset;
48 unsigned int circ;
49 } __attribute__ ((gcc_struct));
50
51 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Method;
52
53 struct __ecereNameSpace__ecere__com__Method
54 {
55 char *  name;
56 struct __ecereNameSpace__ecere__com__Method * parent;
57 struct __ecereNameSpace__ecere__com__Method * left;
58 struct __ecereNameSpace__ecere__com__Method * right;
59 int depth;
60 int (*  function)();
61 int vid;
62 int type;
63 struct __ecereNameSpace__ecere__com__Class * _class;
64 void *  symbol;
65 char *  dataTypeString;
66 struct Type * dataType;
67 int memberAccess;
68 } __attribute__ ((gcc_struct));
69
70 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Property;
71
72 struct __ecereNameSpace__ecere__com__Property
73 {
74 struct __ecereNameSpace__ecere__com__Property * prev;
75 struct __ecereNameSpace__ecere__com__Property * next;
76 char *  name;
77 unsigned int isProperty;
78 int memberAccess;
79 int id;
80 struct __ecereNameSpace__ecere__com__Class * _class;
81 char *  dataTypeString;
82 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
83 struct Type * dataType;
84 void (*  Set)();
85 int (*  Get)();
86 unsigned int (*  IsSet)();
87 void *  data;
88 void *  symbol;
89 int vid;
90 unsigned int conversion;
91 unsigned int watcherOffset;
92 char *  category;
93 unsigned int compiled;
94 unsigned int selfWatchable;
95 unsigned int isWatchable;
96 } __attribute__ ((gcc_struct));
97
98 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_CodePosition;
99
100 struct CodePosition
101 {
102 int line;
103 int charPos;
104 int pos;
105 unsigned int included;
106 } __attribute__ ((gcc_struct));
107
108 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Location;
109
110 struct Location
111 {
112 struct CodePosition start;
113 struct CodePosition end;
114 } __attribute__ ((gcc_struct));
115
116 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Attrib;
117
118 struct Attrib;
119
120 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ExtDecl;
121
122 struct ExtDecl
123 {
124 struct Location loc;
125 int type;
126 union
127 {
128 char * s;
129 struct Attrib * attr;
130 } __attribute__ ((gcc_struct));
131 } __attribute__ ((gcc_struct));
132
133 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassDefinition;
134
135 struct ClassDefinition
136 {
137 struct ClassDefinition * prev;
138 struct ClassDefinition * next;
139 struct Location loc;
140 struct Specifier * _class;
141 struct __ecereNameSpace__ecere__sys__OldList *  baseSpecs;
142 struct __ecereNameSpace__ecere__sys__OldList *  definitions;
143 struct Symbol * symbol;
144 struct Location blockStart;
145 struct Location nameLoc;
146 int endid;
147 int declMode;
148 unsigned int deleteWatchable;
149 } __attribute__ ((gcc_struct));
150
151 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Context;
152
153 struct Context
154 {
155 struct Context * parent;
156 struct __ecereNameSpace__ecere__sys__BinaryTree types;
157 struct __ecereNameSpace__ecere__sys__BinaryTree classes;
158 struct __ecereNameSpace__ecere__sys__BinaryTree symbols;
159 struct __ecereNameSpace__ecere__sys__BinaryTree structSymbols;
160 int nextID;
161 int simpleID;
162 struct __ecereNameSpace__ecere__sys__BinaryTree templateTypes;
163 struct ClassDefinition * classDef;
164 unsigned int templateTypesOnly;
165 unsigned int hasNameSpace;
166 } __attribute__ ((gcc_struct));
167
168 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Instantiation;
169
170 struct Instantiation
171 {
172 struct Instantiation * prev;
173 struct Instantiation * next;
174 struct Location loc;
175 struct Specifier * _class;
176 struct Expression * exp;
177 struct __ecereNameSpace__ecere__sys__OldList *  members;
178 struct Symbol * symbol;
179 unsigned int fullSet;
180 unsigned int isConstant;
181 unsigned char *  data;
182 struct Location nameLoc;
183 struct Location insideLoc;
184 unsigned int built;
185 } __attribute__ ((gcc_struct));
186
187 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Declaration;
188
189 struct Declaration
190 {
191 struct Declaration * prev;
192 struct Declaration * next;
193 struct Location loc;
194 int type;
195 union
196 {
197 struct
198 {
199 struct __ecereNameSpace__ecere__sys__OldList *  specifiers;
200 struct __ecereNameSpace__ecere__sys__OldList *  declarators;
201 } __attribute__ ((gcc_struct));
202 struct Instantiation * inst;
203 struct
204 {
205 struct Identifier * id;
206 struct Expression * exp;
207 } __attribute__ ((gcc_struct));
208 } __attribute__ ((gcc_struct));
209 struct Specifier * extStorage;
210 struct Symbol * symbol;
211 int declMode;
212 } __attribute__ ((gcc_struct));
213
214 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Statement;
215
216 struct Statement
217 {
218 struct Statement * prev;
219 struct Statement * next;
220 struct Location loc;
221 int type;
222 union
223 {
224 struct __ecereNameSpace__ecere__sys__OldList *  expressions;
225 struct
226 {
227 struct Identifier * id;
228 struct Statement * stmt;
229 } __attribute__ ((gcc_struct)) labeled;
230 struct
231 {
232 struct Expression * exp;
233 struct Statement * stmt;
234 } __attribute__ ((gcc_struct)) caseStmt;
235 struct
236 {
237 struct __ecereNameSpace__ecere__sys__OldList * declarations;
238 struct __ecereNameSpace__ecere__sys__OldList * statements;
239 struct Context * context;
240 unsigned int isSwitch;
241 } __attribute__ ((gcc_struct)) compound;
242 struct
243 {
244 struct __ecereNameSpace__ecere__sys__OldList * exp;
245 struct Statement * stmt;
246 struct Statement * elseStmt;
247 } __attribute__ ((gcc_struct)) ifStmt;
248 struct
249 {
250 struct __ecereNameSpace__ecere__sys__OldList * exp;
251 struct Statement * stmt;
252 } __attribute__ ((gcc_struct)) switchStmt;
253 struct
254 {
255 struct __ecereNameSpace__ecere__sys__OldList * exp;
256 struct Statement * stmt;
257 } __attribute__ ((gcc_struct)) whileStmt;
258 struct
259 {
260 struct __ecereNameSpace__ecere__sys__OldList * exp;
261 struct Statement * stmt;
262 } __attribute__ ((gcc_struct)) doWhile;
263 struct
264 {
265 struct Statement * init;
266 struct Statement * check;
267 struct __ecereNameSpace__ecere__sys__OldList * increment;
268 struct Statement * stmt;
269 } __attribute__ ((gcc_struct)) forStmt;
270 struct
271 {
272 struct Identifier * id;
273 } __attribute__ ((gcc_struct)) gotoStmt;
274 struct
275 {
276 struct Specifier * spec;
277 char * statements;
278 struct __ecereNameSpace__ecere__sys__OldList * inputFields;
279 struct __ecereNameSpace__ecere__sys__OldList * outputFields;
280 struct __ecereNameSpace__ecere__sys__OldList * clobberedFields;
281 } __attribute__ ((gcc_struct)) asmStmt;
282 struct
283 {
284 struct Expression * watcher;
285 struct Expression * object;
286 struct __ecereNameSpace__ecere__sys__OldList * watches;
287 } __attribute__ ((gcc_struct)) _watch;
288 struct
289 {
290 struct Identifier * id;
291 struct __ecereNameSpace__ecere__sys__OldList * exp;
292 struct __ecereNameSpace__ecere__sys__OldList * filter;
293 struct Statement * stmt;
294 } __attribute__ ((gcc_struct)) forEachStmt;
295 struct Declaration * decl;
296 } __attribute__ ((gcc_struct));
297 } __attribute__ ((gcc_struct));
298
299 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TypeName;
300
301 struct TypeName
302 {
303 struct TypeName * prev;
304 struct TypeName * next;
305 struct Location loc;
306 struct __ecereNameSpace__ecere__sys__OldList *  qualifiers;
307 struct Declarator * declarator;
308 int classObjectType;
309 struct Expression * bitCount;
310 } __attribute__ ((gcc_struct));
311
312 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Initializer;
313
314 struct Initializer
315 {
316 struct Initializer * prev;
317 struct Initializer * next;
318 struct Location loc;
319 int type;
320 union
321 {
322 struct Expression * exp;
323 struct __ecereNameSpace__ecere__sys__OldList *  list;
324 } __attribute__ ((gcc_struct));
325 unsigned int isConstant;
326 } __attribute__ ((gcc_struct));
327
328 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__DataValue;
329
330 struct __ecereNameSpace__ecere__com__DataValue
331 {
332 union
333 {
334 char c;
335 unsigned char uc;
336 short s;
337 unsigned short us;
338 int i;
339 unsigned int ui;
340 void *  p;
341 float f;
342 double d;
343 long long i64;
344 uint64 ui64;
345 } __attribute__ ((gcc_struct));
346 } __attribute__ ((gcc_struct));
347
348 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Expression;
349
350 struct Expression
351 {
352 struct Expression * prev;
353 struct Expression * next;
354 struct Location loc;
355 int type;
356 union
357 {
358 struct
359 {
360 char *  constant;
361 struct Identifier * identifier;
362 } __attribute__ ((gcc_struct));
363 struct Statement * compound;
364 struct Instantiation * instance;
365 char *  string;
366 struct __ecereNameSpace__ecere__sys__OldList *  list;
367 struct
368 {
369 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
370 struct Declarator * decl;
371 } __attribute__ ((gcc_struct)) _classExp;
372 struct
373 {
374 struct Identifier * id;
375 } __attribute__ ((gcc_struct)) classData;
376 struct
377 {
378 struct Expression * exp;
379 struct __ecereNameSpace__ecere__sys__OldList * arguments;
380 struct Location argLoc;
381 } __attribute__ ((gcc_struct)) call;
382 struct
383 {
384 struct Expression * exp;
385 struct __ecereNameSpace__ecere__sys__OldList * index;
386 } __attribute__ ((gcc_struct)) index;
387 struct
388 {
389 struct Expression * exp;
390 struct Identifier * member;
391 int memberType;
392 unsigned int thisPtr;
393 } __attribute__ ((gcc_struct)) member;
394 struct
395 {
396 int op;
397 struct Expression * exp1;
398 struct Expression * exp2;
399 } __attribute__ ((gcc_struct)) op;
400 struct TypeName * typeName;
401 struct Specifier * _class;
402 struct
403 {
404 struct TypeName * typeName;
405 struct Expression * exp;
406 } __attribute__ ((gcc_struct)) cast;
407 struct
408 {
409 struct Expression * cond;
410 struct __ecereNameSpace__ecere__sys__OldList * exp;
411 struct Expression * elseExp;
412 } __attribute__ ((gcc_struct)) cond;
413 struct
414 {
415 struct TypeName * typeName;
416 struct Expression * size;
417 } __attribute__ ((gcc_struct)) _new;
418 struct
419 {
420 struct TypeName * typeName;
421 struct Expression * size;
422 struct Expression * exp;
423 } __attribute__ ((gcc_struct)) _renew;
424 struct
425 {
426 char * table;
427 struct Identifier * id;
428 } __attribute__ ((gcc_struct)) db;
429 struct
430 {
431 struct Expression * ds;
432 struct Expression * name;
433 } __attribute__ ((gcc_struct)) dbopen;
434 struct
435 {
436 struct TypeName * typeName;
437 struct Initializer * initializer;
438 } __attribute__ ((gcc_struct)) initializer;
439 struct
440 {
441 struct Expression * exp;
442 struct TypeName * typeName;
443 } __attribute__ ((gcc_struct)) vaArg;
444 } __attribute__ ((gcc_struct));
445 unsigned int debugValue;
446 struct __ecereNameSpace__ecere__com__DataValue val;
447 unsigned int address;
448 unsigned int hasAddress;
449 struct Type * expType;
450 struct Type * destType;
451 unsigned int usage;
452 int tempCount;
453 unsigned int byReference;
454 unsigned int isConstant;
455 unsigned int addedThis;
456 unsigned int needCast;
457 unsigned int thisPtr;
458 } __attribute__ ((gcc_struct));
459
460 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplateDatatype;
461
462 struct TemplateDatatype
463 {
464 struct __ecereNameSpace__ecere__sys__OldList *  specifiers;
465 struct Declarator * decl;
466 } __attribute__ ((gcc_struct));
467
468 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplateArgument;
469
470 struct TemplateArgument;
471
472 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplateParameter;
473
474 struct TemplateParameter
475 {
476 struct TemplateParameter * prev;
477 struct TemplateParameter * next;
478 struct Location loc;
479 int type;
480 struct Identifier * identifier;
481 union
482 {
483 struct TemplateDatatype * dataType;
484 int memberType;
485 } __attribute__ ((gcc_struct));
486 struct TemplateArgument * defaultArgument;
487 char *  dataTypeString;
488 struct Type * baseType;
489 } __attribute__ ((gcc_struct));
490
491 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Specifier;
492
493 struct Specifier
494 {
495 struct Specifier * prev;
496 struct Specifier * next;
497 struct Location loc;
498 int type;
499 union
500 {
501 int specifier;
502 struct
503 {
504 struct ExtDecl * extDecl;
505 char *  name;
506 struct Symbol * symbol;
507 struct __ecereNameSpace__ecere__sys__OldList *  templateArgs;
508 } __attribute__ ((gcc_struct));
509 struct
510 {
511 struct Identifier * id;
512 struct __ecereNameSpace__ecere__sys__OldList *  list;
513 struct __ecereNameSpace__ecere__sys__OldList *  baseSpecs;
514 struct __ecereNameSpace__ecere__sys__OldList *  definitions;
515 unsigned int addNameSpace;
516 struct Context * ctx;
517 } __attribute__ ((gcc_struct));
518 struct Expression * expression;
519 struct Specifier * _class;
520 struct TemplateParameter * templateParameter;
521 } __attribute__ ((gcc_struct));
522 } __attribute__ ((gcc_struct));
523
524 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Identifier;
525
526 struct Identifier
527 {
528 struct Identifier * prev;
529 struct Identifier * next;
530 struct Location loc;
531 struct Symbol * classSym;
532 struct Specifier * _class;
533 char *  string;
534 struct Identifier * badID;
535 } __attribute__ ((gcc_struct));
536
537 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Pointer;
538
539 struct Pointer;
540
541 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Declarator;
542
543 struct Declarator
544 {
545 struct Declarator * prev;
546 struct Declarator * next;
547 struct Location loc;
548 int type;
549 struct Symbol * symbol;
550 struct Declarator * declarator;
551 union
552 {
553 struct Identifier * identifier;
554 struct
555 {
556 struct Expression * exp;
557 struct Expression * posExp;
558 struct Attrib * attrib;
559 } __attribute__ ((gcc_struct)) structDecl;
560 struct
561 {
562 struct Expression * exp;
563 struct Specifier * enumClass;
564 } __attribute__ ((gcc_struct)) array;
565 struct
566 {
567 struct __ecereNameSpace__ecere__sys__OldList * parameters;
568 } __attribute__ ((gcc_struct)) function;
569 struct
570 {
571 struct Pointer * pointer;
572 } __attribute__ ((gcc_struct)) pointer;
573 struct
574 {
575 struct ExtDecl * extended;
576 } __attribute__ ((gcc_struct)) extended;
577 } __attribute__ ((gcc_struct));
578 } __attribute__ ((gcc_struct));
579
580 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_FunctionDefinition;
581
582 struct FunctionDefinition
583 {
584 struct FunctionDefinition * prev;
585 struct FunctionDefinition * next;
586 struct Location loc;
587 struct __ecereNameSpace__ecere__sys__OldList *  specifiers;
588 struct Declarator * declarator;
589 struct __ecereNameSpace__ecere__sys__OldList *  declarations;
590 struct Statement * body;
591 struct __ecereNameSpace__ecere__com__Class * _class;
592 struct __ecereNameSpace__ecere__sys__OldList attached;
593 int declMode;
594 struct Type * type;
595 struct Symbol * propSet;
596 int tempCount;
597 unsigned int propertyNoThis;
598 } __attribute__ ((gcc_struct));
599
600 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_DBTableDef;
601
602 struct DBTableDef;
603
604 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_External;
605
606 struct External
607 {
608 struct External * prev;
609 struct External * next;
610 struct Location loc;
611 int type;
612 struct Symbol * symbol;
613 union
614 {
615 struct FunctionDefinition * function;
616 struct ClassDefinition * _class;
617 struct Declaration * declaration;
618 char *  importString;
619 struct Identifier * id;
620 struct DBTableDef * table;
621 } __attribute__ ((gcc_struct));
622 int importType;
623 } __attribute__ ((gcc_struct));
624
625 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ModuleImport;
626
627 struct ModuleImport
628 {
629 struct ModuleImport * prev;
630 struct ModuleImport * next;
631 char *  name;
632 struct __ecereNameSpace__ecere__sys__OldList classes;
633 struct __ecereNameSpace__ecere__sys__OldList functions;
634 int importType;
635 int importAccess;
636 } __attribute__ ((gcc_struct));
637
638 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassImport;
639
640 struct ClassImport
641 {
642 struct ClassImport * prev;
643 struct ClassImport * next;
644 char *  name;
645 struct __ecereNameSpace__ecere__sys__OldList methods;
646 struct __ecereNameSpace__ecere__sys__OldList properties;
647 unsigned int itself;
648 unsigned int isRemote;
649 } __attribute__ ((gcc_struct));
650
651 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Symbol;
652
653 struct Symbol
654 {
655 char *  string;
656 struct Symbol * parent;
657 struct Symbol * left;
658 struct Symbol * right;
659 int depth;
660 struct Type * type;
661 union
662 {
663 struct __ecereNameSpace__ecere__com__Method * method;
664 struct __ecereNameSpace__ecere__com__Property * _property;
665 struct __ecereNameSpace__ecere__com__Class * registered;
666 } __attribute__ ((gcc_struct));
667 int id;
668 int idCode;
669 union
670 {
671 struct
672 {
673 struct External * pointerExternal;
674 struct External * structExternal;
675 } __attribute__ ((gcc_struct));
676 struct
677 {
678 struct External * externalGet;
679 struct External * externalSet;
680 struct External * externalPtr;
681 struct External * externalIsSet;
682 } __attribute__ ((gcc_struct));
683 struct
684 {
685 struct External * methodExternal;
686 struct External * methodCodeExternal;
687 } __attribute__ ((gcc_struct));
688 } __attribute__ ((gcc_struct));
689 unsigned int imported;
690 unsigned int declaredStructSym;
691 struct __ecereNameSpace__ecere__com__Class * _class;
692 unsigned int declaredStruct;
693 unsigned int needConstructor;
694 unsigned int needDestructor;
695 char *  constructorName;
696 char *  structName;
697 char *  className;
698 char *  destructorName;
699 struct ModuleImport * module;
700 struct ClassImport * _import;
701 struct Location nameLoc;
702 unsigned int isParam;
703 unsigned int isRemote;
704 unsigned int isStruct;
705 unsigned int fireWatchersDone;
706 int declaring;
707 unsigned int classData;
708 unsigned int isStatic;
709 char *  shortName;
710 struct __ecereNameSpace__ecere__sys__OldList *  templateParams;
711 struct __ecereNameSpace__ecere__sys__OldList templatedClasses;
712 struct Context * ctx;
713 int isIterator;
714 struct Expression * propCategory;
715 } __attribute__ ((gcc_struct));
716
717 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Type;
718
719 struct Type
720 {
721 struct Type * prev;
722 struct Type * next;
723 int refCount;
724 union
725 {
726 struct Symbol * _class;
727 struct
728 {
729 struct __ecereNameSpace__ecere__sys__OldList members;
730 char *  enumName;
731 } __attribute__ ((gcc_struct));
732 struct
733 {
734 struct Type * returnType;
735 struct __ecereNameSpace__ecere__sys__OldList params;
736 struct Symbol * thisClass;
737 unsigned int staticMethod;
738 struct TemplateParameter * thisClassTemplate;
739 } __attribute__ ((gcc_struct));
740 struct
741 {
742 struct __ecereNameSpace__ecere__com__Method * method;
743 struct __ecereNameSpace__ecere__com__Class * methodClass;
744 struct __ecereNameSpace__ecere__com__Class * usedClass;
745 } __attribute__ ((gcc_struct));
746 struct
747 {
748 struct Type * arrayType;
749 int arraySize;
750 struct Expression * arraySizeExp;
751 unsigned int freeExp;
752 struct Symbol * enumClass;
753 } __attribute__ ((gcc_struct));
754 struct Type * type;
755 struct TemplateParameter * templateParameter;
756 } __attribute__ ((gcc_struct));
757 unsigned int isSigned;
758 int kind;
759 unsigned int constant;
760 unsigned int size;
761 char *  name;
762 char *  typeName;
763 unsigned int count;
764 unsigned int truth;
765 int classObjectType;
766 unsigned int byReference;
767 unsigned int extraParam;
768 int alignment;
769 unsigned int directClassAccess;
770 unsigned int computing;
771 unsigned int dllExport;
772 unsigned int offset;
773 unsigned int keepCast;
774 unsigned int passAsTemplate;
775 int bitFieldCount;
776 } __attribute__ ((gcc_struct));
777
778 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Class;
779
780 struct __ecereNameSpace__ecere__com__Class
781 {
782 struct __ecereNameSpace__ecere__com__Class * prev;
783 struct __ecereNameSpace__ecere__com__Class * next;
784 char *  name;
785 int offset;
786 int structSize;
787 int (* *  _vTbl)();
788 int vTblSize;
789 int (*  Constructor)(struct __ecereNameSpace__ecere__com__Instance *);
790 void (*  Destructor)(struct __ecereNameSpace__ecere__com__Instance *);
791 int offsetClass;
792 int sizeClass;
793 struct __ecereNameSpace__ecere__com__Class * base;
794 struct __ecereNameSpace__ecere__sys__BinaryTree methods;
795 struct __ecereNameSpace__ecere__sys__BinaryTree members;
796 struct __ecereNameSpace__ecere__sys__BinaryTree prop;
797 struct __ecereNameSpace__ecere__sys__OldList membersAndProperties;
798 struct __ecereNameSpace__ecere__sys__BinaryTree classProperties;
799 struct __ecereNameSpace__ecere__sys__OldList derivatives;
800 int memberID;
801 int startMemberID;
802 int type;
803 struct __ecereNameSpace__ecere__com__Instance * module;
804 struct __ecereNameSpace__ecere__com__NameSpace *  nameSpace;
805 char *  dataTypeString;
806 struct Type * dataType;
807 int typeSize;
808 int defaultAlignment;
809 void (*  Initialize)();
810 int memberOffset;
811 struct __ecereNameSpace__ecere__sys__OldList selfWatchers;
812 char *  designerClass;
813 unsigned int noExpansion;
814 char *  defaultProperty;
815 unsigned int comRedefinition;
816 int count;
817 unsigned int isRemote;
818 unsigned int internalDecl;
819 void *  data;
820 unsigned int computeSize;
821 int structAlignment;
822 int destructionWatchOffset;
823 unsigned int fixed;
824 struct __ecereNameSpace__ecere__sys__OldList delayedCPValues;
825 int inheritanceAccess;
826 char *  fullName;
827 void *  symbol;
828 struct __ecereNameSpace__ecere__sys__OldList conversions;
829 struct __ecereNameSpace__ecere__sys__OldList templateParams;
830 struct __ecereNameSpace__ecere__com__ClassTemplateArgument *  templateArgs;
831 struct __ecereNameSpace__ecere__com__Class * templateClass;
832 struct __ecereNameSpace__ecere__sys__OldList templatized;
833 int numParams;
834 } __attribute__ ((gcc_struct));
835
836 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Instance;
837
838 struct __ecereNameSpace__ecere__com__Instance
839 {
840 int (* *  _vTbl)();
841 struct __ecereNameSpace__ecere__com__Class * _class;
842 int _refCount;
843 } __attribute__ ((gcc_struct));
844
845 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__DataMember;
846
847 struct __ecereNameSpace__ecere__com__DataMember
848 {
849 struct __ecereNameSpace__ecere__com__DataMember * prev;
850 struct __ecereNameSpace__ecere__com__DataMember * next;
851 char *  name;
852 unsigned int isProperty;
853 int memberAccess;
854 int id;
855 struct __ecereNameSpace__ecere__com__Class * _class;
856 char *  dataTypeString;
857 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
858 struct Type * dataType;
859 int type;
860 int offset;
861 int memberID;
862 struct __ecereNameSpace__ecere__sys__OldList members;
863 struct __ecereNameSpace__ecere__sys__BinaryTree membersAlpha;
864 int memberOffset;
865 int structAlignment;
866 } __attribute__ ((gcc_struct));
867
868 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__SerialBuffer;
869
870 struct __ecereNameSpace__ecere__com__SerialBuffer
871 {
872 unsigned char *  _buffer;
873 unsigned int count;
874 unsigned int _size;
875 unsigned int pos;
876 } __attribute__ ((gcc_struct));
877
878 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__ClassTemplateArgument;
879
880 struct __ecereNameSpace__ecere__com__ClassTemplateArgument
881 {
882 union
883 {
884 struct
885 {
886 char *  dataTypeString;
887 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
888 } __attribute__ ((gcc_struct));
889 struct __ecereNameSpace__ecere__com__DataValue expression;
890 struct
891 {
892 char *  memberString;
893 union
894 {
895 struct __ecereNameSpace__ecere__com__DataMember * member;
896 struct __ecereNameSpace__ecere__com__Property * prop;
897 struct __ecereNameSpace__ecere__com__Method * method;
898 } __attribute__ ((gcc_struct));
899 } __attribute__ ((gcc_struct));
900 } __attribute__ ((gcc_struct));
901 } __attribute__ ((gcc_struct));
902
903 typedef unsigned int size_t;
904
905 void exit(int status);
906
907 void * calloc(size_t nmemb, size_t size);
908
909 void free(void * ptr);
910
911 void * malloc(size_t size);
912
913 void * realloc(void * ptr, size_t size);
914
915 long int strtol(const char * nptr, char ** endptr, int base);
916
917 long long int strtoll(const char * nptr, char ** endptr, int base);
918
919 unsigned long long int strtoull(const char * nptr, char ** endptr, int base);
920
921 enum yytokentype
922 {
923 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
924 };
925
926 typedef union YYSTYPE
927 {
928 int specifierType;
929 int i;
930 int declMode;
931 struct Identifier * id;
932 struct Expression * exp;
933 struct Specifier * specifier;
934 struct __ecereNameSpace__ecere__sys__OldList * list;
935 struct Enumerator * enumerator;
936 struct Declarator * declarator;
937 struct Pointer * pointer;
938 struct Initializer * initializer;
939 struct InitDeclarator * initDeclarator;
940 struct TypeName * typeName;
941 struct Declaration * declaration;
942 struct Statement * stmt;
943 struct FunctionDefinition * function;
944 struct External * external;
945 struct Context * context;
946 struct AsmField * asmField;
947 struct Attrib * attrib;
948 struct ExtDecl * extDecl;
949 struct Attribute * attribute;
950 struct Instantiation * instance;
951 struct MembersInit * membersInit;
952 struct MemberInit * memberInit;
953 struct ClassFunction * classFunction;
954 struct ClassDefinition * _class;
955 struct ClassDef * classDef;
956 struct PropertyDef * prop;
957 char * string;
958 struct Symbol * symbol;
959 struct PropertyWatch * propertyWatch;
960 struct TemplateParameter * templateParameter;
961 struct TemplateArgument * templateArgument;
962 struct TemplateDatatype * templateDatatype;
963 struct DBTableEntry * dbtableEntry;
964 struct DBIndexItem * dbindexItem;
965 struct DBTableDef * dbtableDef;
966 } __attribute__ ((gcc_struct)) YYSTYPE;
967
968 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Enumerator;
969
970 struct Enumerator
971 {
972 struct Enumerator * prev;
973 struct Enumerator * next;
974 struct Location loc;
975 struct Identifier * id;
976 struct Expression * exp;
977 } __attribute__ ((gcc_struct));
978
979 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_InitDeclarator;
980
981 struct InitDeclarator
982 {
983 struct InitDeclarator * prev;
984 struct InitDeclarator * next;
985 struct Location loc;
986 struct Declarator * declarator;
987 struct Initializer * initializer;
988 } __attribute__ ((gcc_struct));
989
990 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_AsmField;
991
992 struct AsmField
993 {
994 struct AsmField * prev;
995 struct AsmField * next;
996 struct Location loc;
997 char *  command;
998 struct Expression * expression;
999 } __attribute__ ((gcc_struct));
1000
1001 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Attribute;
1002
1003 struct Attribute;
1004
1005 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassFunction;
1006
1007 struct ClassFunction
1008 {
1009 struct ClassFunction * prev;
1010 struct ClassFunction * next;
1011 struct Location loc;
1012 struct __ecereNameSpace__ecere__sys__OldList *  specifiers;
1013 struct Declarator * declarator;
1014 struct __ecereNameSpace__ecere__sys__OldList *  declarations;
1015 struct Statement * body;
1016 struct __ecereNameSpace__ecere__com__Class * _class;
1017 struct __ecereNameSpace__ecere__sys__OldList attached;
1018 int declMode;
1019 struct Type * type;
1020 struct Symbol * propSet;
1021 unsigned int isVirtual;
1022 unsigned int isConstructor;
1023 unsigned int isDestructor;
1024 unsigned int dontMangle;
1025 int id;
1026 int idCode;
1027 } __attribute__ ((gcc_struct));
1028
1029 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_MembersInit;
1030
1031 struct MembersInit
1032 {
1033 struct MembersInit * prev;
1034 struct MembersInit * next;
1035 struct Location loc;
1036 int type;
1037 union
1038 {
1039 struct __ecereNameSpace__ecere__sys__OldList *  dataMembers;
1040 struct ClassFunction * function;
1041 } __attribute__ ((gcc_struct));
1042 } __attribute__ ((gcc_struct));
1043
1044 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_MemberInit;
1045
1046 struct MemberInit
1047 {
1048 struct MemberInit * prev;
1049 struct MemberInit * next;
1050 struct Location loc;
1051 struct Location realLoc;
1052 struct __ecereNameSpace__ecere__sys__OldList *  identifiers;
1053 struct Initializer * initializer;
1054 unsigned int used;
1055 unsigned int variable;
1056 unsigned int takeOutExp;
1057 } __attribute__ ((gcc_struct));
1058
1059 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_PropertyDef;
1060
1061 struct PropertyDef
1062 {
1063 struct PropertyDef * prev;
1064 struct PropertyDef * next;
1065 struct Location loc;
1066 struct __ecereNameSpace__ecere__sys__OldList *  specifiers;
1067 struct Declarator * declarator;
1068 struct Identifier * id;
1069 struct Statement * getStmt;
1070 struct Statement * setStmt;
1071 struct Statement * issetStmt;
1072 struct Symbol * symbol;
1073 unsigned int conversion;
1074 unsigned int isWatchable;
1075 struct Expression * category;
1076 } __attribute__ ((gcc_struct));
1077
1078 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_PropertyWatch;
1079
1080 struct PropertyWatch
1081 {
1082 struct PropertyWatch * prev;
1083 struct PropertyWatch * next;
1084 struct Location loc;
1085 struct Statement * compound;
1086 struct __ecereNameSpace__ecere__sys__OldList *  properties;
1087 unsigned int deleteWatch;
1088 } __attribute__ ((gcc_struct));
1089
1090 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassDef;
1091
1092 struct ClassDef
1093 {
1094 struct ClassDef * prev;
1095 struct ClassDef * next;
1096 struct Location loc;
1097 int type;
1098 union
1099 {
1100 struct Declaration * decl;
1101 struct ClassFunction * function;
1102 struct __ecereNameSpace__ecere__sys__OldList *  defProperties;
1103 struct PropertyDef * propertyDef;
1104 struct PropertyWatch * propertyWatch;
1105 char *  designer;
1106 struct Identifier * defaultProperty;
1107 struct
1108 {
1109 struct Identifier * id;
1110 struct Initializer * initializer;
1111 } __attribute__ ((gcc_struct));
1112 } __attribute__ ((gcc_struct));
1113 int memberAccess;
1114 void *  object;
1115 } __attribute__ ((gcc_struct));
1116
1117 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_DBTableEntry;
1118
1119 struct DBTableEntry;
1120
1121 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_DBIndexItem;
1122
1123 struct DBIndexItem;
1124
1125 extern YYSTYPE yylval;
1126
1127 extern struct Location yylloc;
1128
1129 extern struct __ecereNameSpace__ecere__sys__OldList * ast;
1130
1131 extern int returnCode;
1132
1133 extern struct Expression * parsedExpression;
1134
1135 extern unsigned int yydebug;
1136
1137 void SetYydebug(unsigned int b)
1138 {
1139 yydebug = b;
1140 }
1141
1142 extern unsigned int echoOn;
1143
1144 void resetScanner();
1145
1146 int propWatcherID;
1147
1148 int expression_yyparse();
1149
1150 static struct Statement * curCompound;
1151
1152 struct External * curExternal, * afterExternal;
1153
1154 static struct Type * curSwitchType;
1155
1156 static struct __ecereNameSpace__ecere__com__Class * currentClass;
1157
1158 struct __ecereNameSpace__ecere__com__Class * thisClass;
1159
1160 void SetThisClass(struct __ecereNameSpace__ecere__com__Class * c)
1161 {
1162 thisClass = c;
1163 }
1164
1165 struct __ecereNameSpace__ecere__com__Class * GetThisClass()
1166 {
1167 return thisClass;
1168 }
1169
1170 static char * thisNameSpace;
1171
1172 struct __ecereNameSpace__ecere__com__Class * containerClass;
1173
1174 unsigned int thisClassParams = 0x1;
1175
1176 unsigned int internalValueCounter;
1177
1178 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__TempFile;
1179
1180 struct __ecereNameSpace__ecere__sys__TempFile
1181 {
1182 char __ecere_padding[24];
1183 } __attribute__ ((gcc_struct));
1184
1185 extern void OutputExpression(struct Expression * exp, struct __ecereNameSpace__ecere__com__Instance * f);
1186
1187 extern int strlen(const char * );
1188
1189 extern void *  __ecereNameSpace__ecere__com__eInstance_New(struct __ecereNameSpace__ecere__com__Class * _class);
1190
1191 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek;
1192
1193 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Read;
1194
1195 extern void __ecereNameSpace__ecere__com__eInstance_DecRef(struct __ecereNameSpace__ecere__com__Instance * instance);
1196
1197 void PrintExpression(struct Expression * exp, char * string)
1198 {
1199 {
1200 struct __ecereNameSpace__ecere__com__Instance * f = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
1201 int count;
1202
1203 if(exp)
1204 OutputExpression(exp, f);
1205 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))f->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(f, 0, 0);
1206 count = strlen(string);
1207 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);
1208 string[count] = '\0';
1209 (__ecereNameSpace__ecere__com__eInstance_DecRef(f), f = 0);
1210 }
1211 }
1212
1213 extern int isspace(int c);
1214
1215 long long _strtoi64(char * string, char ** endString, int base)
1216 {
1217 long long value = 0;
1218 int sign = 1;
1219 int c;
1220 char ch;
1221
1222 for(c = 0; (ch = string[c]) && isspace(ch); c++)
1223 ;
1224 if(ch == '+')
1225 c++;
1226 else if(ch == '-')
1227 {
1228 sign = -1;
1229 c++;
1230 }
1231 ;
1232 if(!base)
1233 {
1234 if(ch == (char)0 && string[c + 1] == 'x')
1235 {
1236 base = 16;
1237 c += 2;
1238 }
1239 else if(ch == '0')
1240 {
1241 base = 8;
1242 c++;
1243 }
1244 else
1245 base = 10;
1246 }
1247 for(; (ch = string[c]); c++)
1248 {
1249 if(ch == '0')
1250 ch = (char)0;
1251 else if(ch >= '1' && ch <= '9')
1252 ch -= '1';
1253 else if(ch >= 'a' && ch <= 'z')
1254 ch -= 'a';
1255 else if(ch >= 'A' && ch <= 'Z')
1256 ch -= 'A';
1257 else
1258 {
1259 if(endString)
1260 *endString = string + c;
1261 break;
1262 }
1263 if(ch < base)
1264 {
1265 value *= base;
1266 value += ch;
1267 }
1268 else
1269 {
1270 if(endString)
1271 *endString = string + c;
1272 break;
1273 }
1274 }
1275 return sign * value;
1276 }
1277
1278 uint64 _strtoui64(char * string, char ** endString, int base)
1279 {
1280 uint64 value = 0;
1281 int sign = 1;
1282 int c;
1283 char ch;
1284
1285 for(c = 0; (ch = string[c]) && isspace(ch); c++)
1286 ;
1287 if(ch == '+')
1288 c++;
1289 else if(ch == '-')
1290 {
1291 sign = -1;
1292 c++;
1293 }
1294 ;
1295 if(!base)
1296 {
1297 if(ch == (char)0 && string[c + 1] == 'x')
1298 {
1299 base = 16;
1300 c += 2;
1301 }
1302 else if(ch == '0')
1303 {
1304 base = 8;
1305 c++;
1306 }
1307 else
1308 base = 10;
1309 }
1310 for(; (ch = string[c]); c++)
1311 {
1312 if(ch == '0')
1313 ch = (char)0;
1314 else if(ch >= '1' && ch <= '9')
1315 ch -= '1';
1316 else if(ch >= 'a' && ch <= 'z')
1317 ch -= 'a';
1318 else if(ch >= 'A' && ch <= 'Z')
1319 ch -= 'A';
1320 else
1321 {
1322 if(endString)
1323 *endString = string + c;
1324 break;
1325 }
1326 if(ch < base)
1327 {
1328 value *= base;
1329 value += ch;
1330 }
1331 else
1332 {
1333 if(endString)
1334 *endString = string + c;
1335 break;
1336 }
1337 }
1338 return sign * value;
1339 }
1340
1341 extern struct Type * ProcessTypeString(char *  string, unsigned int staticMethod);
1342
1343 extern struct Type * ProcessType(struct __ecereNameSpace__ecere__sys__OldList * specs, struct Declarator * decl);
1344
1345 struct Type * ProcessTemplateParameterType(struct TemplateParameter * param)
1346 {
1347 if(param && param->type == 0 && (param->dataType || param->dataTypeString))
1348 {
1349 if(!param->baseType)
1350 {
1351 if(param->dataTypeString)
1352 param->baseType = ProcessTypeString(param->dataTypeString, 0x0);
1353 else
1354 param->baseType = ProcessType(param->dataType->specifiers, param->dataType->decl);
1355 }
1356 return param->baseType;
1357 }
1358 return (((void *)0));
1359 }
1360
1361 unsigned int NeedCast(struct Type * type1, struct Type * type2)
1362 {
1363 if(!type1 || !type2 || type1->keepCast || type2->keepCast)
1364 return 0x1;
1365 if(type1->kind == 20 && type2->kind == 4 && type2->passAsTemplate == 0x0)
1366 {
1367 return 0x0;
1368 }
1369 if(type1->kind == type2->kind)
1370 {
1371 switch(type1->kind)
1372 {
1373 case 1:
1374 case 2:
1375 case 3:
1376 case 4:
1377 case 22:
1378 if(type1->passAsTemplate && !type2->passAsTemplate)
1379 return 0x1;
1380 return type1->isSigned != type2->isSigned;
1381 case 8:
1382 return type1->_class != type2->_class;
1383 case 13:
1384 return NeedCast(type1->type, type2->type);
1385 default:
1386 return 0x1;
1387 }
1388 }
1389 return 0x1;
1390 }
1391
1392 extern int strcmp(const char * , const char * );
1393
1394 extern struct Context * curContext;
1395
1396 extern struct Context * topContext;
1397
1398 extern unsigned int __ecereNameSpace__ecere__com__eClass_IsDerived(struct __ecereNameSpace__ecere__com__Class * _class, struct __ecereNameSpace__ecere__com__Class * from);
1399
1400 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);
1401
1402 extern struct __ecereNameSpace__ecere__com__Instance * privateModule;
1403
1404 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);
1405
1406 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);
1407
1408 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__ClassProperty;
1409
1410 struct __ecereNameSpace__ecere__com__ClassProperty
1411 {
1412 char *  name;
1413 struct __ecereNameSpace__ecere__com__ClassProperty * parent;
1414 struct __ecereNameSpace__ecere__com__ClassProperty * left;
1415 struct __ecereNameSpace__ecere__com__ClassProperty * right;
1416 int depth;
1417 void (*  Set)(struct __ecereNameSpace__ecere__com__Class *, int);
1418 int (*  Get)(struct __ecereNameSpace__ecere__com__Class *);
1419 char *  dataTypeString;
1420 struct Type * dataType;
1421 unsigned int constant;
1422 } __attribute__ ((gcc_struct));
1423
1424 extern struct __ecereNameSpace__ecere__com__ClassProperty * __ecereNameSpace__ecere__com__eClass_FindClassProperty(struct __ecereNameSpace__ecere__com__Class * _class, char *  name);
1425
1426 extern struct Expression * QMkExpId(char *  id);
1427
1428 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__ClassTemplateParameter;
1429
1430 struct __ecereNameSpace__ecere__com__ClassTemplateParameter
1431 {
1432 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * prev;
1433 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * next;
1434 char *  name;
1435 int type;
1436 union
1437 {
1438 char *  dataTypeString;
1439 int memberType;
1440 } __attribute__ ((gcc_struct));
1441 struct __ecereNameSpace__ecere__com__ClassTemplateArgument defaultArg;
1442 void *  param;
1443 char __ecere_padding[4];
1444 } __attribute__ ((gcc_struct));
1445
1446 extern struct Expression * GetTemplateArgExpByName(char *  paramName, struct __ecereNameSpace__ecere__com__Class * curClass, int tplType);
1447
1448 extern struct __ecereNameSpace__ecere__sys__OldList *  MkList(void);
1449
1450 extern void FreeIdentifier(struct Identifier * id);
1451
1452 void ProcessExpressionType(struct Expression * exp);
1453
1454 extern struct Declarator * SpecDeclFromString(char *  string, struct __ecereNameSpace__ecere__sys__OldList *  specs, struct Declarator * baseDecl);
1455
1456 extern struct __ecereNameSpace__ecere__sys__OldList *  MkListOne(void *  item);
1457
1458 extern struct Expression * MkExpOp(struct Expression * exp1, int op, struct Expression * exp2);
1459
1460 extern struct Expression * MkExpCast(struct TypeName * typeName, struct Expression * expression);
1461
1462 extern struct TypeName * MkTypeName(struct __ecereNameSpace__ecere__sys__OldList * qualifiers, struct Declarator * declarator);
1463
1464 extern struct Declarator * MkDeclaratorPointer(struct Pointer * pointer, struct Declarator * declarator);
1465
1466 extern struct Pointer * MkPointer(struct __ecereNameSpace__ecere__sys__OldList * qualifiers, struct Pointer * pointer);
1467
1468 struct __ecereNameSpace__ecere__sys__BTNode * __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(struct __ecereNameSpace__ecere__sys__BinaryTree * this, char *  key);
1469
1470 static void ReplaceClassMembers(struct Expression * exp, struct __ecereNameSpace__ecere__com__Class * _class)
1471 {
1472 if(exp->type == 0 && exp->identifier)
1473 {
1474 struct Identifier * id = exp->identifier;
1475 struct Context * ctx;
1476 struct Symbol * symbol = (((void *)0));
1477
1478 if(!id->_class || !id->_class->name || strcmp(id->_class->name, "property"))
1479 {
1480 for(ctx = curContext; ctx != topContext->parent && !symbol; ctx = ctx->parent)
1481 {
1482 symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(&ctx->symbols, id->string);
1483 if(symbol)
1484 break;
1485 }
1486 }
1487 if(!symbol && ((!id->_class || (id->_class->name && !strcmp(id->_class->name, "property"))) || (id->classSym && __ecereNameSpace__ecere__com__eClass_IsDerived(_class, id->classSym->registered))))
1488 {
1489 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
1490 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
1491 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
1492 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
1493
1494 if(!prop)
1495 {
1496 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule);
1497 }
1498 if(!prop && !method)
1499 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
1500 if(!prop && !method && !member)
1501 {
1502 classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(_class, id->string);
1503 }
1504 if(prop || method || member || classProp)
1505 {
1506 exp->type = 8;
1507 exp->member.member = id;
1508 exp->member.memberType = 0;
1509 exp->member.exp = QMkExpId("this");
1510 exp->addedThis = 0x1;
1511 }
1512 else if(_class && _class->templateParams.first)
1513 {
1514 struct __ecereNameSpace__ecere__com__Class * sClass;
1515
1516 for(sClass = _class; sClass; sClass = sClass->base)
1517 {
1518 if(sClass->templateParams.first)
1519 {
1520 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
1521
1522 for(param = sClass->templateParams.first; param; param = param->next)
1523 {
1524 if(param->type == 2 && !strcmp(param->name, id->string))
1525 {
1526 struct Expression * argExp = GetTemplateArgExpByName(param->name, _class, 2);
1527
1528 if(argExp)
1529 {
1530 struct Declarator * decl;
1531 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
1532
1533 FreeIdentifier(exp->member.member);
1534 ProcessExpressionType(argExp);
1535 decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
1536 exp->expType = ProcessType(specs, decl);
1537 exp->type = 5;
1538 exp->list = MkListOne(MkExpOp((((void *)0)), '*', MkExpCast(MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl)), MkExpOp((((void *)0)), '&', argExp))));
1539 }
1540 }
1541 }
1542 }
1543 }
1544 }
1545 }
1546 }
1547 }
1548
1549 extern int sprintf(char * , char * , ...);
1550
1551 extern int __ecereNameSpace__ecere__com__GetRuntimePlatform(void);
1552
1553 extern char *  __ecereNameSpace__ecere__sys__CopyString(char *  string);
1554
1555 char * PrintInt(long long result)
1556 {
1557 char temp[100];
1558
1559 if(result > (((long long)0x7fffffffffffffffLL)))
1560 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1561 else
1562 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "%I64dLL" : "%lldLL"), result);
1563 return __ecereNameSpace__ecere__sys__CopyString(temp);
1564 }
1565
1566 char * PrintUInt(uint64 result)
1567 {
1568 char temp[100];
1569
1570 if(result > (0xffffffff))
1571 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1572 else if(result > (((int)0x7fffffff)))
1573 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64X" : "0x%llX"), result);
1574 else
1575 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "%I64d" : "%lld"), result);
1576 return __ecereNameSpace__ecere__sys__CopyString(temp);
1577 }
1578
1579 char * PrintInt64(long long result)
1580 {
1581 char temp[100];
1582
1583 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "%I64dLL" : "%lldLL"), result);
1584 return __ecereNameSpace__ecere__sys__CopyString(temp);
1585 }
1586
1587 char * PrintUInt64(uint64 result)
1588 {
1589 char temp[100];
1590
1591 if(result > (((long long)0x7fffffffffffffffLL)))
1592 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1593 else
1594 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "%I64dLL" : "%lldLL"), result);
1595 return __ecereNameSpace__ecere__sys__CopyString(temp);
1596 }
1597
1598 char * PrintHexUInt(uint64 result)
1599 {
1600 char temp[100];
1601
1602 if(result > (0xffffffff))
1603 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1604 else
1605 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64X" : "0x%llX"), result);
1606 return __ecereNameSpace__ecere__sys__CopyString(temp);
1607 }
1608
1609 char * PrintHexUInt64(uint64 result)
1610 {
1611 char temp[100];
1612
1613 if(result > (0xffffffff))
1614 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1615 else
1616 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64X" : "0x%llX"), result);
1617 return __ecereNameSpace__ecere__sys__CopyString(temp);
1618 }
1619
1620 char * PrintShort(short result)
1621 {
1622 char temp[100];
1623
1624 sprintf(temp, "%d", (unsigned short)result);
1625 return __ecereNameSpace__ecere__sys__CopyString(temp);
1626 }
1627
1628 char * PrintUShort(unsigned short result)
1629 {
1630 char temp[100];
1631
1632 if(result > (unsigned short)32767)
1633 sprintf(temp, "0x%X", (int)result);
1634 else
1635 sprintf(temp, "%d", result);
1636 return __ecereNameSpace__ecere__sys__CopyString(temp);
1637 }
1638
1639 extern int isprint(int c);
1640
1641 char * PrintChar(char result)
1642 {
1643 char temp[100];
1644
1645 if(result > (char)0 && isprint(result))
1646 sprintf(temp, "'%c'", result);
1647 else if(result < (char)0)
1648 sprintf(temp, "%d", result);
1649 else
1650 sprintf(temp, "0x%X", (unsigned char)result);
1651 return __ecereNameSpace__ecere__sys__CopyString(temp);
1652 }
1653
1654 char * PrintUChar(unsigned char result)
1655 {
1656 char temp[100];
1657
1658 sprintf(temp, "0x%X", result);
1659 return __ecereNameSpace__ecere__sys__CopyString(temp);
1660 }
1661
1662 char * PrintFloat(float result)
1663 {
1664 char temp[350];
1665
1666 sprintf(temp, "%.16ff", result);
1667 return __ecereNameSpace__ecere__sys__CopyString(temp);
1668 }
1669
1670 char * PrintDouble(double result)
1671 {
1672 char temp[350];
1673
1674 sprintf(temp, "%.16f", result);
1675 return __ecereNameSpace__ecere__sys__CopyString(temp);
1676 }
1677
1678 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_OpTable;
1679
1680 struct OpTable
1681 {
1682 unsigned int (*  Add)(struct Expression *, struct Operand *, struct Operand *);
1683 unsigned int (*  Sub)(struct Expression *, struct Operand *, struct Operand *);
1684 unsigned int (*  Mul)(struct Expression *, struct Operand *, struct Operand *);
1685 unsigned int (*  Div)(struct Expression *, struct Operand *, struct Operand *);
1686 unsigned int (*  Mod)(struct Expression *, struct Operand *, struct Operand *);
1687 unsigned int (*  Neg)(struct Expression *, struct Operand *);
1688 unsigned int (*  Inc)(struct Expression *, struct Operand *);
1689 unsigned int (*  Dec)(struct Expression *, struct Operand *);
1690 unsigned int (*  Asign)(struct Expression *, struct Operand *, struct Operand *);
1691 unsigned int (*  AddAsign)(struct Expression *, struct Operand *, struct Operand *);
1692 unsigned int (*  SubAsign)(struct Expression *, struct Operand *, struct Operand *);
1693 unsigned int (*  MulAsign)(struct Expression *, struct Operand *, struct Operand *);
1694 unsigned int (*  DivAsign)(struct Expression *, struct Operand *, struct Operand *);
1695 unsigned int (*  ModAsign)(struct Expression *, struct Operand *, struct Operand *);
1696 unsigned int (*  BitAnd)(struct Expression *, struct Operand *, struct Operand *);
1697 unsigned int (*  BitOr)(struct Expression *, struct Operand *, struct Operand *);
1698 unsigned int (*  BitXor)(struct Expression *, struct Operand *, struct Operand *);
1699 unsigned int (*  LShift)(struct Expression *, struct Operand *, struct Operand *);
1700 unsigned int (*  RShift)(struct Expression *, struct Operand *, struct Operand *);
1701 unsigned int (*  BitNot)(struct Expression *, struct Operand *);
1702 unsigned int (*  AndAsign)(struct Expression *, struct Operand *, struct Operand *);
1703 unsigned int (*  OrAsign)(struct Expression *, struct Operand *, struct Operand *);
1704 unsigned int (*  XorAsign)(struct Expression *, struct Operand *, struct Operand *);
1705 unsigned int (*  LShiftAsign)(struct Expression *, struct Operand *, struct Operand *);
1706 unsigned int (*  RShiftAsign)(struct Expression *, struct Operand *, struct Operand *);
1707 unsigned int (*  Not)(struct Expression *, struct Operand *);
1708 unsigned int (*  Equ)(struct Expression *, struct Operand *, struct Operand *);
1709 unsigned int (*  Nqu)(struct Expression *, struct Operand *, struct Operand *);
1710 unsigned int (*  And)(struct Expression *, struct Operand *, struct Operand *);
1711 unsigned int (*  Or)(struct Expression *, struct Operand *, struct Operand *);
1712 unsigned int (*  Grt)(struct Expression *, struct Operand *, struct Operand *);
1713 unsigned int (*  Sma)(struct Expression *, struct Operand *, struct Operand *);
1714 unsigned int (*  GrtEqu)(struct Expression *, struct Operand *, struct Operand *);
1715 unsigned int (*  SmaEqu)(struct Expression *, struct Operand *, struct Operand *);
1716 unsigned int (*  Cond)(struct Expression *, struct Operand *, struct Operand *, struct Operand *);
1717 } __attribute__ ((gcc_struct));
1718
1719 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Operand;
1720
1721 struct Operand
1722 {
1723 int kind;
1724 struct Type * type;
1725 unsigned int ptrSize;
1726 union
1727 {
1728 char c;
1729 unsigned char uc;
1730 short s;
1731 unsigned short us;
1732 int i;
1733 unsigned int ui;
1734 float f;
1735 double d;
1736 unsigned char *  p;
1737 long long i64;
1738 uint64 ui64;
1739 intptr_t iptr;
1740 uintptr_t uiptr;
1741 } __attribute__ ((gcc_struct));
1742 struct OpTable ops;
1743 } __attribute__ ((gcc_struct));
1744
1745 struct Operand GetOperand(struct Expression * exp);
1746
1747 unsigned int GetInt(struct Expression * exp, int * value2)
1748 {
1749 struct Operand op2 = GetOperand(exp);
1750
1751 if(op2.kind == 3 && op2.type->isSigned)
1752 *value2 = op2.i;
1753 else if(op2.kind == 3)
1754 *value2 = (int)op2.ui;
1755 if(op2.kind == 4 && op2.type->isSigned)
1756 *value2 = (int)op2.i64;
1757 else if(op2.kind == 4)
1758 *value2 = (int)op2.ui64;
1759 else if(op2.kind == 22 && op2.type->isSigned)
1760 *value2 = (int)op2.iptr;
1761 else if(op2.kind == 22)
1762 *value2 = (int)op2.uiptr;
1763 else if(op2.kind == 2 && op2.type->isSigned)
1764 *value2 = (int)op2.s;
1765 else if(op2.kind == 2)
1766 *value2 = (int)op2.us;
1767 else if(op2.kind == 1 && op2.type->isSigned)
1768 *value2 = (int)op2.c;
1769 else if(op2.kind == 1)
1770 *value2 = (int)op2.uc;
1771 else if(op2.kind == 6)
1772 *value2 = (int)op2.f;
1773 else if(op2.kind == 7)
1774 *value2 = (int)op2.d;
1775 else if(op2.kind == 13)
1776 *value2 = (int)op2.ui;
1777 else
1778 return 0x0;
1779 return 0x1;
1780 }
1781
1782 unsigned int GetUInt(struct Expression * exp, unsigned int * value2)
1783 {
1784 struct Operand op2 = GetOperand(exp);
1785
1786 if(op2.kind == 3 && op2.type->isSigned)
1787 *value2 = (unsigned int)op2.i;
1788 else if(op2.kind == 3)
1789 *value2 = op2.ui;
1790 if(op2.kind == 4 && op2.type->isSigned)
1791 *value2 = (unsigned int)op2.i64;
1792 else if(op2.kind == 4)
1793 *value2 = (unsigned int)op2.ui64;
1794 else if(op2.kind == 22 && op2.type->isSigned)
1795 *value2 = (unsigned int)op2.iptr;
1796 else if(op2.kind == 22)
1797 *value2 = (unsigned int)op2.uiptr;
1798 else if(op2.kind == 2 && op2.type->isSigned)
1799 *value2 = (unsigned int)op2.s;
1800 else if(op2.kind == 2)
1801 *value2 = (unsigned int)op2.us;
1802 else if(op2.kind == 1 && op2.type->isSigned)
1803 *value2 = (unsigned int)op2.c;
1804 else if(op2.kind == 1)
1805 *value2 = (unsigned int)op2.uc;
1806 else if(op2.kind == 6)
1807 *value2 = (unsigned int)op2.f;
1808 else if(op2.kind == 7)
1809 *value2 = (unsigned int)op2.d;
1810 else if(op2.kind == 13)
1811 *value2 = op2.ui;
1812 else
1813 return 0x0;
1814 return 0x1;
1815 }
1816
1817 unsigned int GetInt64(struct Expression * exp, long long * value2)
1818 {
1819 struct Operand op2 = GetOperand(exp);
1820
1821 if(op2.kind == 3 && op2.type->isSigned)
1822 *value2 = (long long)op2.i;
1823 else if(op2.kind == 3)
1824 *value2 = (long long)op2.ui;
1825 if(op2.kind == 4 && op2.type->isSigned)
1826 *value2 = op2.i64;
1827 else if(op2.kind == 4)
1828 *value2 = (long long)op2.ui64;
1829 else if(op2.kind == 22 && op2.type->isSigned)
1830 *value2 = (long long)op2.iptr;
1831 else if(op2.kind == 22)
1832 *value2 = (long long)op2.uiptr;
1833 else if(op2.kind == 2 && op2.type->isSigned)
1834 *value2 = (long long)op2.s;
1835 else if(op2.kind == 2)
1836 *value2 = (long long)op2.us;
1837 else if(op2.kind == 1 && op2.type->isSigned)
1838 *value2 = (long long)op2.c;
1839 else if(op2.kind == 1)
1840 *value2 = (long long)op2.uc;
1841 else if(op2.kind == 6)
1842 *value2 = (long long)op2.f;
1843 else if(op2.kind == 7)
1844 *value2 = (long long)op2.d;
1845 else if(op2.kind == 13)
1846 *value2 = (long long)op2.ui;
1847 else
1848 return 0x0;
1849 return 0x1;
1850 }
1851
1852 unsigned int GetUInt64(struct Expression * exp, uint64 * value2)
1853 {
1854 struct Operand op2 = GetOperand(exp);
1855
1856 if(op2.kind == 3 && op2.type->isSigned)
1857 *value2 = (uint64)op2.i;
1858 else if(op2.kind == 3)
1859 *value2 = (uint64)op2.ui;
1860 if(op2.kind == 4 && op2.type->isSigned)
1861 *value2 = (uint64)op2.i64;
1862 else if(op2.kind == 4)
1863 *value2 = op2.ui64;
1864 else if(op2.kind == 22 && op2.type->isSigned)
1865 *value2 = (uint64)op2.iptr;
1866 else if(op2.kind == 22)
1867 *value2 = (uint64)op2.uiptr;
1868 else if(op2.kind == 2 && op2.type->isSigned)
1869 *value2 = (uint64)op2.s;
1870 else if(op2.kind == 2)
1871 *value2 = (uint64)op2.us;
1872 else if(op2.kind == 1 && op2.type->isSigned)
1873 *value2 = (uint64)op2.c;
1874 else if(op2.kind == 1)
1875 *value2 = (uint64)op2.uc;
1876 else if(op2.kind == 6)
1877 *value2 = (uint64)op2.f;
1878 else if(op2.kind == 7)
1879 *value2 = (uint64)op2.d;
1880 else if(op2.kind == 13)
1881 *value2 = (uint64)op2.ui;
1882 else
1883 return 0x0;
1884 return 0x1;
1885 }
1886
1887 unsigned int GetIntPtr(struct Expression * exp, intptr_t * value2)
1888 {
1889 struct Operand op2 = GetOperand(exp);
1890
1891 if(op2.kind == 3 && op2.type->isSigned)
1892 *value2 = (intptr_t)op2.i;
1893 else if(op2.kind == 3)
1894 *value2 = (intptr_t)op2.ui;
1895 if(op2.kind == 4 && op2.type->isSigned)
1896 *value2 = (intptr_t)op2.i64;
1897 else if(op2.kind == 4)
1898 *value2 = (intptr_t)op2.ui64;
1899 else if(op2.kind == 22 && op2.type->isSigned)
1900 *value2 = op2.iptr;
1901 else if(op2.kind == 22)
1902 *value2 = (intptr_t)op2.uiptr;
1903 else if(op2.kind == 2 && op2.type->isSigned)
1904 *value2 = (intptr_t)op2.s;
1905 else if(op2.kind == 2)
1906 *value2 = (intptr_t)op2.us;
1907 else if(op2.kind == 1 && op2.type->isSigned)
1908 *value2 = (intptr_t)op2.c;
1909 else if(op2.kind == 1)
1910 *value2 = (intptr_t)op2.uc;
1911 else if(op2.kind == 6)
1912 *value2 = (intptr_t)op2.f;
1913 else if(op2.kind == 7)
1914 *value2 = (intptr_t)op2.d;
1915 else if(op2.kind == 13)
1916 *value2 = (intptr_t)op2.ui;
1917 else
1918 return 0x0;
1919 return 0x1;
1920 }
1921
1922 unsigned int GetUIntPtr(struct Expression * exp, uintptr_t * value2)
1923 {
1924 struct Operand op2 = GetOperand(exp);
1925
1926 if(op2.kind == 3 && op2.type->isSigned)
1927 *value2 = (uintptr_t)op2.i;
1928 else if(op2.kind == 3)
1929 *value2 = (uintptr_t)op2.ui;
1930 if(op2.kind == 4 && op2.type->isSigned)
1931 *value2 = (uintptr_t)op2.i64;
1932 else if(op2.kind == 4)
1933 *value2 = (uintptr_t)op2.ui64;
1934 else if(op2.kind == 22 && op2.type->isSigned)
1935 *value2 = (uintptr_t)op2.iptr;
1936 else if(op2.kind == 22)
1937 *value2 = op2.uiptr;
1938 else if(op2.kind == 2 && op2.type->isSigned)
1939 *value2 = (uintptr_t)op2.s;
1940 else if(op2.kind == 2)
1941 *value2 = (uintptr_t)op2.us;
1942 else if(op2.kind == 1 && op2.type->isSigned)
1943 *value2 = (uintptr_t)op2.c;
1944 else if(op2.kind == 1)
1945 *value2 = (uintptr_t)op2.uc;
1946 else if(op2.kind == 6)
1947 *value2 = (uintptr_t)op2.f;
1948 else if(op2.kind == 7)
1949 *value2 = (uintptr_t)op2.d;
1950 else if(op2.kind == 13)
1951 *value2 = (uintptr_t)op2.ui;
1952 else
1953 return 0x0;
1954 return 0x1;
1955 }
1956
1957 unsigned int GetShort(struct Expression * exp, short * value2)
1958 {
1959 struct Operand op2 = GetOperand(exp);
1960
1961 if(op2.kind == 3 && op2.type->isSigned)
1962 *value2 = (short)op2.i;
1963 else if(op2.kind == 3)
1964 *value2 = (short)op2.ui;
1965 if(op2.kind == 4 && op2.type->isSigned)
1966 *value2 = (short)op2.i64;
1967 else if(op2.kind == 4)
1968 *value2 = (short)op2.ui64;
1969 else if(op2.kind == 22 && op2.type->isSigned)
1970 *value2 = (short)op2.iptr;
1971 else if(op2.kind == 22)
1972 *value2 = (short)op2.uiptr;
1973 else if(op2.kind == 2 && op2.type->isSigned)
1974 *value2 = op2.s;
1975 else if(op2.kind == 2)
1976 *value2 = (short)op2.us;
1977 else if(op2.kind == 1 && op2.type->isSigned)
1978 *value2 = (short)op2.c;
1979 else if(op2.kind == 1)
1980 *value2 = (short)op2.uc;
1981 else if(op2.kind == 6)
1982 *value2 = (short)op2.f;
1983 else if(op2.kind == 7)
1984 *value2 = (short)op2.d;
1985 else if(op2.kind == 13)
1986 *value2 = (short)op2.ui;
1987 else
1988 return 0x0;
1989 return 0x1;
1990 }
1991
1992 unsigned int GetUShort(struct Expression * exp, unsigned short * value2)
1993 {
1994 struct Operand op2 = GetOperand(exp);
1995
1996 if(op2.kind == 3 && op2.type->isSigned)
1997 *value2 = (unsigned short)op2.i;
1998 else if(op2.kind == 3)
1999 *value2 = (unsigned short)op2.ui;
2000 if(op2.kind == 4 && op2.type->isSigned)
2001 *value2 = (unsigned short)op2.i64;
2002 else if(op2.kind == 4)
2003 *value2 = (unsigned short)op2.ui64;
2004 else if(op2.kind == 22 && op2.type->isSigned)
2005 *value2 = (unsigned short)op2.iptr;
2006 else if(op2.kind == 22)
2007 *value2 = (unsigned short)op2.uiptr;
2008 else if(op2.kind == 2 && op2.type->isSigned)
2009 *value2 = (unsigned short)op2.s;
2010 else if(op2.kind == 2)
2011 *value2 = op2.us;
2012 else if(op2.kind == 1 && op2.type->isSigned)
2013 *value2 = (unsigned short)op2.c;
2014 else if(op2.kind == 1)
2015 *value2 = (unsigned short)op2.uc;
2016 else if(op2.kind == 6)
2017 *value2 = (unsigned short)op2.f;
2018 else if(op2.kind == 7)
2019 *value2 = (unsigned short)op2.d;
2020 else if(op2.kind == 13)
2021 *value2 = (unsigned short)op2.ui;
2022 else
2023 return 0x0;
2024 return 0x1;
2025 }
2026
2027 unsigned int GetChar(struct Expression * exp, char * value2)
2028 {
2029 struct Operand op2 = GetOperand(exp);
2030
2031 if(op2.kind == 3 && op2.type->isSigned)
2032 *value2 = (char)op2.i;
2033 else if(op2.kind == 3)
2034 *value2 = (char)op2.ui;
2035 if(op2.kind == 4 && op2.type->isSigned)
2036 *value2 = (char)op2.i64;
2037 else if(op2.kind == 4)
2038 *value2 = (char)op2.ui64;
2039 else if(op2.kind == 22 && op2.type->isSigned)
2040 *value2 = (char)op2.iptr;
2041 else if(op2.kind == 22)
2042 *value2 = (char)op2.uiptr;
2043 else if(op2.kind == 2 && op2.type->isSigned)
2044 *value2 = (char)op2.s;
2045 else if(op2.kind == 2)
2046 *value2 = (char)op2.us;
2047 else if(op2.kind == 1 && op2.type->isSigned)
2048 *value2 = op2.c;
2049 else if(op2.kind == 1)
2050 *value2 = (char)op2.uc;
2051 else if(op2.kind == 6)
2052 *value2 = (char)op2.f;
2053 else if(op2.kind == 7)
2054 *value2 = (char)op2.d;
2055 else if(op2.kind == 13)
2056 *value2 = (char)op2.ui;
2057 else
2058 return 0x0;
2059 return 0x1;
2060 }
2061
2062 unsigned int GetUChar(struct Expression * exp, unsigned char * value2)
2063 {
2064 struct Operand op2 = GetOperand(exp);
2065
2066 if(op2.kind == 3 && op2.type->isSigned)
2067 *value2 = (unsigned char)op2.i;
2068 else if(op2.kind == 3)
2069 *value2 = (unsigned char)op2.ui;
2070 if(op2.kind == 4 && op2.type->isSigned)
2071 *value2 = (unsigned char)op2.i64;
2072 else if(op2.kind == 4)
2073 *value2 = (unsigned char)op2.ui64;
2074 else if(op2.kind == 22 && op2.type->isSigned)
2075 *value2 = (unsigned char)op2.iptr;
2076 else if(op2.kind == 22)
2077 *value2 = (unsigned char)op2.uiptr;
2078 else if(op2.kind == 2 && op2.type->isSigned)
2079 *value2 = (unsigned char)op2.s;
2080 else if(op2.kind == 2)
2081 *value2 = (unsigned char)op2.us;
2082 else if(op2.kind == 1 && op2.type->isSigned)
2083 *value2 = (unsigned char)op2.c;
2084 else if(op2.kind == 1)
2085 *value2 = op2.uc;
2086 else if(op2.kind == 6)
2087 *value2 = (unsigned char)op2.f;
2088 else if(op2.kind == 7)
2089 *value2 = (unsigned char)op2.d;
2090 else if(op2.kind == 13)
2091 *value2 = (unsigned char)op2.ui;
2092 else
2093 return 0x0;
2094 return 0x1;
2095 }
2096
2097 unsigned int GetFloat(struct Expression * exp, float * value2)
2098 {
2099 struct Operand op2 = GetOperand(exp);
2100
2101 if(op2.kind == 3 && op2.type->isSigned)
2102 *value2 = (float)(float)op2.i;
2103 else if(op2.kind == 3)
2104 *value2 = (float)(float)op2.ui;
2105 if(op2.kind == 4 && op2.type->isSigned)
2106 *value2 = (float)(float)op2.i64;
2107 else if(op2.kind == 4)
2108 *value2 = (float)(float)op2.ui64;
2109 else if(op2.kind == 22 && op2.type->isSigned)
2110 *value2 = (float)op2.iptr;
2111 else if(op2.kind == 22)
2112 *value2 = (float)op2.uiptr;
2113 else if(op2.kind == 2 && op2.type->isSigned)
2114 *value2 = (float)(float)op2.s;
2115 else if(op2.kind == 2)
2116 *value2 = (float)(float)op2.us;
2117 else if(op2.kind == 1 && op2.type->isSigned)
2118 *value2 = (float)(float)op2.c;
2119 else if(op2.kind == 1)
2120 *value2 = (float)(float)op2.uc;
2121 else if(op2.kind == 6)
2122 *value2 = (float)op2.f;
2123 else if(op2.kind == 7)
2124 *value2 = (float)op2.d;
2125 else if(op2.kind == 13)
2126 *value2 = (float)(float)op2.ui;
2127 else
2128 return 0x0;
2129 return 0x1;
2130 }
2131
2132 unsigned int GetDouble(struct Expression * exp, double * value2)
2133 {
2134 struct Operand op2 = GetOperand(exp);
2135
2136 if(op2.kind == 3 && op2.type->isSigned)
2137 *value2 = (double)(double)op2.i;
2138 else if(op2.kind == 3)
2139 *value2 = (double)(double)op2.ui;
2140 if(op2.kind == 4 && op2.type->isSigned)
2141 *value2 = (double)(double)op2.i64;
2142 else if(op2.kind == 4)
2143 *value2 = (double)(double)op2.ui64;
2144 else if(op2.kind == 22 && op2.type->isSigned)
2145 *value2 = (double)op2.iptr;
2146 else if(op2.kind == 22)
2147 *value2 = (double)op2.uiptr;
2148 else if(op2.kind == 2 && op2.type->isSigned)
2149 *value2 = (double)(double)op2.s;
2150 else if(op2.kind == 2)
2151 *value2 = (double)(double)op2.us;
2152 else if(op2.kind == 1 && op2.type->isSigned)
2153 *value2 = (double)(double)op2.c;
2154 else if(op2.kind == 1)
2155 *value2 = (double)(double)op2.uc;
2156 else if(op2.kind == 6)
2157 *value2 = (double)op2.f;
2158 else if(op2.kind == 7)
2159 *value2 = (double)op2.d;
2160 else if(op2.kind == 13)
2161 *value2 = (double)(double)op2.ui;
2162 else
2163 return 0x0;
2164 return 0x1;
2165 }
2166
2167 void ComputeExpression(struct Expression * exp);
2168
2169 struct Context * SetupTemplatesContext(struct __ecereNameSpace__ecere__com__Class * _class);
2170
2171 int ComputeTypeSize(struct Type * type);
2172
2173 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__BitMember;
2174
2175 struct __ecereNameSpace__ecere__com__BitMember
2176 {
2177 struct __ecereNameSpace__ecere__com__BitMember * prev;
2178 struct __ecereNameSpace__ecere__com__BitMember * next;
2179 char *  name;
2180 unsigned int isProperty;
2181 int memberAccess;
2182 int id;
2183 struct __ecereNameSpace__ecere__com__Class * _class;
2184 char *  dataTypeString;
2185 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
2186 struct Type * dataType;
2187 int type;
2188 int size;
2189 int pos;
2190 uint64 mask;
2191 } __attribute__ ((gcc_struct));
2192
2193 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__OldLink;
2194
2195 struct __ecereNameSpace__ecere__sys__OldLink
2196 {
2197 struct __ecereNameSpace__ecere__sys__OldLink * prev;
2198 struct __ecereNameSpace__ecere__sys__OldLink * next;
2199 void *  data;
2200 } __attribute__ ((gcc_struct));
2201
2202 void FinishTemplatesContext(struct Context * context);
2203
2204 void ComputeClassMembers(struct __ecereNameSpace__ecere__com__Class * _class, unsigned int isMember)
2205 {
2206 struct __ecereNameSpace__ecere__com__DataMember * member = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
2207 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
2208
2209 if(member || ((_class->type == 2 || _class->type == 0 || _class->type == 1 || _class->type == 5) && (_class->type == 2 || _class->structSize == _class->offset) && _class->computeSize))
2210 {
2211 int c;
2212 int unionMemberOffset = 0;
2213 int bitFields = 0;
2214
2215 if(!member && _class->destructionWatchOffset)
2216 _class->memberOffset += sizeof(struct __ecereNameSpace__ecere__sys__OldList);
2217 {
2218 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
2219
2220 for(dataMember = member ? member->members.first : _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
2221 {
2222 if(!dataMember->isProperty)
2223 {
2224 if(dataMember->type == 0 && dataMember->dataTypeString && !dataMember->dataType)
2225 {
2226 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
2227 }
2228 }
2229 }
2230 }
2231 {
2232 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
2233
2234 for(dataMember = member ? member->members.first : _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
2235 {
2236 if(!dataMember->isProperty && (dataMember->type != 0 || dataMember->dataTypeString))
2237 {
2238 if(!isMember && _class->type == 2 && dataMember->dataType)
2239 {
2240 struct __ecereNameSpace__ecere__com__BitMember * bitMember = (struct __ecereNameSpace__ecere__com__BitMember *)dataMember;
2241 uint64 mask = 0;
2242 int d;
2243
2244 ComputeTypeSize(dataMember->dataType);
2245 if(bitMember->pos == -1)
2246 bitMember->pos = _class->memberOffset;
2247 if(!bitMember->size)
2248 bitMember->size = dataMember->dataType->size * 8;
2249 _class->memberOffset = bitMember->pos + bitMember->size;
2250 for(d = 0; d < bitMember->size; d++)
2251 {
2252 if(d)
2253 mask <<= 1;
2254 mask |= 1;
2255 }
2256 bitMember->mask = mask << bitMember->pos;
2257 }
2258 else if(dataMember->type == 0 && dataMember->dataType)
2259 {
2260 int size;
2261 int alignment = 0;
2262
2263 if(dataMember->dataType->kind != 8 || ((!dataMember->dataType->_class || !dataMember->dataType->_class->registered || dataMember->dataType->_class->registered != _class || _class->type != 1)))
2264 ComputeTypeSize(dataMember->dataType);
2265 if(dataMember->dataType->bitFieldCount)
2266 {
2267 bitFields += dataMember->dataType->bitFieldCount;
2268 size = 0;
2269 }
2270 else
2271 {
2272 if(bitFields)
2273 {
2274 int size = (bitFields + 7) / 8;
2275
2276 if(isMember)
2277 {
2278 int __simpleStruct0;
2279
2280 if(alignment)
2281 {
2282 int __simpleStruct0;
2283
2284 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2285 if(member->memberOffset % alignment)
2286 member->memberOffset += alignment - (member->memberOffset % alignment);
2287 }
2288 dataMember->offset = member->memberOffset;
2289 if(member->type == 1)
2290 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2291 else
2292 {
2293 member->memberOffset += size;
2294 }
2295 }
2296 else
2297 {
2298 if(alignment)
2299 {
2300 int __simpleStruct0;
2301
2302 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2303 if(_class->memberOffset % alignment)
2304 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2305 }
2306 dataMember->offset = _class->memberOffset;
2307 _class->memberOffset += size;
2308 }
2309 bitFields = 0;
2310 }
2311 size = dataMember->dataType->size;
2312 alignment = dataMember->dataType->alignment;
2313 }
2314 if(isMember)
2315 {
2316 int __simpleStruct0;
2317
2318 if(alignment)
2319 {
2320 int __simpleStruct0;
2321
2322 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2323 if(member->memberOffset % alignment)
2324 member->memberOffset += alignment - (member->memberOffset % alignment);
2325 }
2326 dataMember->offset = member->memberOffset;
2327 if(member->type == 1)
2328 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2329 else
2330 {
2331 member->memberOffset += size;
2332 }
2333 }
2334 else
2335 {
2336 if(alignment)
2337 {
2338 int __simpleStruct0;
2339
2340 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2341 if(_class->memberOffset % alignment)
2342 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2343 }
2344 dataMember->offset = _class->memberOffset;
2345 _class->memberOffset += size;
2346 }
2347 }
2348 else
2349 {
2350 ComputeClassMembers((struct __ecereNameSpace__ecere__com__Class *)dataMember, 0x1);
2351 if(isMember)
2352 {
2353 int __simpleStruct2;
2354 int __simpleStruct0, __simpleStruct1;
2355
2356 member->structAlignment = (__simpleStruct0 = member->structAlignment, __simpleStruct1 = dataMember->structAlignment, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
2357 dataMember->offset = member->memberOffset;
2358 if(member->type == 1)
2359 unionMemberOffset = (__simpleStruct2 = dataMember->memberOffset, (unionMemberOffset > __simpleStruct2) ? unionMemberOffset : __simpleStruct2);
2360 else
2361 member->memberOffset += dataMember->memberOffset;
2362 }
2363 else
2364 {
2365 int __simpleStruct0, __simpleStruct1;
2366
2367 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, __simpleStruct1 = dataMember->structAlignment, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
2368 dataMember->offset = _class->memberOffset;
2369 _class->memberOffset += dataMember->memberOffset;
2370 }
2371 }
2372 }
2373 }
2374 if(bitFields)
2375 {
2376 int alignment = 0;
2377 int size = (bitFields + 7) / 8;
2378
2379 if(isMember)
2380 {
2381 int __simpleStruct0;
2382
2383 if(alignment)
2384 {
2385 int __simpleStruct0;
2386
2387 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2388 if(member->memberOffset % alignment)
2389 member->memberOffset += alignment - (member->memberOffset % alignment);
2390 }
2391 if(member->type == 1)
2392 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2393 else
2394 {
2395 member->memberOffset += size;
2396 }
2397 }
2398 else
2399 {
2400 if(alignment)
2401 {
2402 int __simpleStruct0;
2403
2404 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2405 if(_class->memberOffset % alignment)
2406 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2407 }
2408 _class->memberOffset += size;
2409 }
2410 bitFields = 0;
2411 }
2412 }
2413 if(member && member->type == 1)
2414 {
2415 member->memberOffset = unionMemberOffset;
2416 }
2417 if(!isMember)
2418 {
2419 if(_class->type != 2)
2420 {
2421 _class->structSize = (_class->base ? (_class->base->templateClass ? _class->base->templateClass->structSize : _class->base->structSize) : 0) + _class->memberOffset;
2422 if(!member)
2423 {
2424 struct __ecereNameSpace__ecere__com__Property * prop;
2425
2426 for(prop = _class->membersAndProperties.first; prop; prop = prop->next)
2427 {
2428 if(prop->isProperty && prop->isWatchable)
2429 {
2430 prop->watcherOffset = _class->structSize;
2431 _class->structSize += sizeof(struct __ecereNameSpace__ecere__sys__OldList);
2432 }
2433 }
2434 }
2435 {
2436 struct __ecereNameSpace__ecere__sys__OldLink * derivative;
2437
2438 for(derivative = _class->derivatives.first; derivative; derivative = derivative->next)
2439 {
2440 struct __ecereNameSpace__ecere__com__Class * deriv = derivative->data;
2441
2442 if(deriv->computeSize)
2443 {
2444 deriv->offset = _class->structSize;
2445 deriv->memberOffset = 0;
2446 deriv->structSize = deriv->offset;
2447 ComputeClassMembers(deriv, 0x0);
2448 }
2449 }
2450 }
2451 }
2452 }
2453 }
2454 if(context)
2455 FinishTemplatesContext(context);
2456 }
2457
2458 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__NameSpace;
2459
2460 struct __ecereNameSpace__ecere__com__NameSpace
2461 {
2462 char *  name;
2463 struct __ecereNameSpace__ecere__com__NameSpace *  btParent;
2464 struct __ecereNameSpace__ecere__com__NameSpace *  left;
2465 struct __ecereNameSpace__ecere__com__NameSpace *  right;
2466 int depth;
2467 struct __ecereNameSpace__ecere__com__NameSpace *  parent;
2468 struct __ecereNameSpace__ecere__sys__BinaryTree nameSpaces;
2469 struct __ecereNameSpace__ecere__sys__BinaryTree classes;
2470 struct __ecereNameSpace__ecere__sys__BinaryTree defines;
2471 struct __ecereNameSpace__ecere__sys__BinaryTree functions;
2472 } __attribute__ ((gcc_struct));
2473
2474 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Module;
2475
2476 struct __ecereNameSpace__ecere__com__Module
2477 {
2478 struct __ecereNameSpace__ecere__com__Instance * application;
2479 struct __ecereNameSpace__ecere__sys__OldList classes;
2480 struct __ecereNameSpace__ecere__sys__OldList defines;
2481 struct __ecereNameSpace__ecere__sys__OldList functions;
2482 struct __ecereNameSpace__ecere__sys__OldList modules;
2483 struct __ecereNameSpace__ecere__com__Instance * prev;
2484 struct __ecereNameSpace__ecere__com__Instance * next;
2485 char *  name;
2486 void *  library;
2487 void *  Unload;
2488 int importType;
2489 int origImportType;
2490 struct __ecereNameSpace__ecere__com__NameSpace privateNameSpace;
2491 struct __ecereNameSpace__ecere__com__NameSpace publicNameSpace;
2492 } __attribute__ ((gcc_struct));
2493
2494 void ComputeModuleClasses(struct __ecereNameSpace__ecere__com__Instance * module)
2495 {
2496 struct __ecereNameSpace__ecere__com__Class * _class;
2497 struct __ecereNameSpace__ecere__sys__OldLink * subModule;
2498
2499 for(subModule = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + 12)))->modules.first; subModule; subModule = subModule->next)
2500 ComputeModuleClasses(subModule->data);
2501 for(_class = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + 12)))->classes.first; _class; _class = _class->next)
2502 ComputeClassMembers(_class, 0x0);
2503 }
2504
2505 extern int targetBits;
2506
2507 extern unsigned int inCompiler;
2508
2509 extern void Compiler_Error(char *  format, ...);
2510
2511 extern char *  __ecereNameSpace__ecere__GetTranslatedString(struct __ecereNameSpace__ecere__com__Instance * module, char *  string, char *  stringAndContext);
2512
2513 extern struct __ecereNameSpace__ecere__com__Instance * __thisModule;
2514
2515 extern int __ecereNameSpace__ecere__com__eClass_GetProperty(struct __ecereNameSpace__ecere__com__Class * _class, char *  name);
2516
2517 int ComputeTypeSize(struct Type * type)
2518 {
2519 unsigned int size = type ? type->size : 0;
2520
2521 if(!size && type && !type->computing)
2522 {
2523 type->computing = 0x1;
2524 switch(type->kind)
2525 {
2526 case 1:
2527 type->alignment = size = sizeof(char);
2528 break;
2529 case 3:
2530 type->alignment = size = sizeof(int);
2531 break;
2532 case 4:
2533 type->alignment = size = sizeof(long long);
2534 break;
2535 case 22:
2536 type->alignment = size = targetBits / 8;
2537 break;
2538 case 5:
2539 type->alignment = size = sizeof(long);
2540 break;
2541 case 2:
2542 type->alignment = size = sizeof(short);
2543 break;
2544 case 6:
2545 type->alignment = size = sizeof(float);
2546 break;
2547 case 7:
2548 type->alignment = size = sizeof(double);
2549 break;
2550 case 8:
2551 {
2552 struct __ecereNameSpace__ecere__com__Class * _class = type->_class ? type->_class->registered : (((void *)0));
2553
2554 if(_class && _class->type == 1)
2555 {
2556 ComputeClassMembers(_class, 0x0);
2557 type->alignment = _class->structAlignment;
2558 size = _class->structSize;
2559 if(type->alignment && size % type->alignment)
2560 size += type->alignment - (size % type->alignment);
2561 }
2562 else if(_class && (_class->type == 3 || _class->type == 4 || _class->type == 2))
2563 {
2564 if(!_class->dataType)
2565 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
2566 size = type->alignment = ComputeTypeSize(_class->dataType);
2567 }
2568 else
2569 size = type->alignment = targetBits / 8;
2570 break;
2571 }
2572 case 13:
2573 case 19:
2574 size = type->alignment = targetBits / 8;
2575 break;
2576 case 12:
2577 if(type->arraySizeExp)
2578 {
2579 ProcessExpressionType(type->arraySizeExp);
2580 ComputeExpression(type->arraySizeExp);
2581 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)))
2582 {
2583 struct Location oldLoc = yylloc;
2584 char expression[10240];
2585
2586 expression[0] = '\0';
2587 type->arraySizeExp->expType = (((void *)0));
2588 yylloc = type->arraySizeExp->loc;
2589 if(inCompiler)
2590 PrintExpression(type->arraySizeExp, expression);
2591 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Array size not constant int (%s)\n", (((void *)0))), expression);
2592 yylloc = oldLoc;
2593 }
2594 GetInt(type->arraySizeExp, &type->arraySize);
2595 }
2596 else if(type->enumClass)
2597 {
2598 if(type->enumClass && type->enumClass->registered && type->enumClass->registered->type == 4)
2599 {
2600 type->arraySize = __ecereNameSpace__ecere__com__eClass_GetProperty(type->enumClass->registered, "enumSize");
2601 }
2602 else
2603 type->arraySize = 0;
2604 }
2605 else
2606 {
2607 type->arraySize = 0;
2608 }
2609 size = ComputeTypeSize(type->type) * type->arraySize;
2610 type->alignment = type->type->alignment;
2611 break;
2612 case 9:
2613 {
2614 struct Type * member;
2615
2616 for(member = type->members.first; member; member = member->next)
2617 {
2618 int __simpleStruct0, __simpleStruct1;
2619 unsigned int addSize = ComputeTypeSize(member);
2620
2621 member->offset = size;
2622 if(member->alignment && size % member->alignment)
2623 member->offset += member->alignment - (size % member->alignment);
2624 size = member->offset;
2625 type->alignment = (__simpleStruct0 = type->alignment, __simpleStruct1 = member->alignment, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
2626 size += addSize;
2627 }
2628 if(type->alignment && size % type->alignment)
2629 size += type->alignment - (size % type->alignment);
2630 break;
2631 }
2632 case 10:
2633 {
2634 struct Type * member;
2635
2636 for(member = type->members.first; member; member = member->next)
2637 {
2638 int __simpleStruct0, __simpleStruct1;
2639 unsigned int addSize = ComputeTypeSize(member);
2640
2641 member->offset = size;
2642 if(member->alignment && size % member->alignment)
2643 member->offset += member->alignment - (size % member->alignment);
2644 size = member->offset;
2645 type->alignment = (__simpleStruct0 = type->alignment, __simpleStruct1 = member->alignment, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
2646 size = ((size > addSize) ? size : addSize);
2647 }
2648 if(type->alignment && size % type->alignment)
2649 size += type->alignment - (size % type->alignment);
2650 break;
2651 }
2652 case 20:
2653 {
2654 struct TemplateParameter * param = type->templateParameter;
2655 struct Type * baseType = ProcessTemplateParameterType(param);
2656
2657 if(baseType)
2658 size = ComputeTypeSize(baseType);
2659 else
2660 size = sizeof(uint64);
2661 break;
2662 }
2663 case 15:
2664 {
2665 size = sizeof(enum
2666 {
2667 test
2668 });
2669 break;
2670 }
2671 case 21:
2672 {
2673 size = targetBits / 8;
2674 break;
2675 }
2676 }
2677 type->size = size;
2678 type->computing = 0x0;
2679 }
2680 return size;
2681 }
2682
2683 extern struct Declarator * MkDeclaratorIdentifier(struct Identifier * id);
2684
2685 extern struct Identifier * MkIdentifier(char *  string);
2686
2687 extern void ListAdd(struct __ecereNameSpace__ecere__sys__OldList * list, void *  item);
2688
2689 extern struct Declarator * MkStructDeclarator(struct Declarator * declarator, struct Expression * exp);
2690
2691 extern struct ClassDef * MkClassDefDeclaration(struct Declaration * decl);
2692
2693 extern struct Declaration * MkStructDeclaration(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct __ecereNameSpace__ecere__sys__OldList * declarators, struct Specifier * extStorage);
2694
2695 void ReplaceThisClassSpecifiers(struct __ecereNameSpace__ecere__sys__OldList * specs, struct __ecereNameSpace__ecere__com__Class * _class);
2696
2697 static void DeclareType(struct Type * type, unsigned int declarePointers, unsigned int declareParams);
2698
2699 extern void FreeType(struct Type * type);
2700
2701 extern struct Specifier * MkStructOrUnion(int type, struct Identifier * id, struct __ecereNameSpace__ecere__sys__OldList * definitions);
2702
2703 extern struct Specifier * MkSpecifier(int specifier);
2704
2705 extern struct Declarator * MkDeclaratorArray(struct Declarator * declarator, struct Expression * exp);
2706
2707 extern struct Expression * MkExpConstant(char *  string);
2708
2709 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)
2710 {
2711 struct __ecereNameSpace__ecere__com__DataMember * topMember = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
2712 unsigned int totalSize = 0;
2713 unsigned int maxSize = 0;
2714 int alignment, size;
2715 struct __ecereNameSpace__ecere__com__DataMember * member;
2716 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
2717
2718 if(!isMember && _class->base)
2719 {
2720 maxSize = _class->structSize;
2721 {
2722 if(_class->type == 1 || _class->type == 5)
2723 AddMembers(declarations, _class->base, 0x0, &totalSize, topClass);
2724 else
2725 maxSize -= _class->base->templateClass ? _class->base->templateClass->structSize : _class->base->structSize;
2726 }
2727 }
2728 for(member = isMember ? topMember->members.first : _class->membersAndProperties.first; member; member = member->next)
2729 {
2730 if(!member->isProperty)
2731 {
2732 switch(member->type)
2733 {
2734 case 0:
2735 {
2736 if(member->dataTypeString)
2737 {
2738 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList(), * decls = MkList();
2739 struct Declarator * decl;
2740
2741 decl = SpecDeclFromString(member->dataTypeString, specs, MkDeclaratorIdentifier(MkIdentifier(member->name)));
2742 ListAdd(decls, MkStructDeclarator(decl, (((void *)0))));
2743 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(specs, decls, (((void *)0)))));
2744 if(!member->dataType)
2745 member->dataType = ProcessType(specs, decl);
2746 ReplaceThisClassSpecifiers(specs, topClass);
2747 {
2748 struct Type * type = ProcessType(specs, decl);
2749
2750 DeclareType(member->dataType, 0x0, 0x0);
2751 FreeType(type);
2752 }
2753 ComputeTypeSize(member->dataType);
2754 size = member->dataType->size;
2755 alignment = member->dataType->alignment;
2756 if(alignment)
2757 {
2758 if(totalSize % alignment)
2759 totalSize += alignment - (totalSize % alignment);
2760 }
2761 totalSize += size;
2762 }
2763 break;
2764 }
2765 case 1:
2766 case 2:
2767 {
2768 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList(), * list = MkList();
2769
2770 size = 0;
2771 AddMembers(list, (struct __ecereNameSpace__ecere__com__Class *)member, 0x1, &size, topClass);
2772 ListAdd(specs, MkStructOrUnion((member->type == 1) ? 4 : 3, (((void *)0)), list));
2773 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(specs, (((void *)0)), (((void *)0)))));
2774 alignment = member->structAlignment;
2775 if(alignment)
2776 {
2777 if(totalSize % alignment)
2778 totalSize += alignment - (totalSize % alignment);
2779 }
2780 totalSize += size;
2781 break;
2782 }
2783 }
2784 }
2785 }
2786 if(retSize)
2787 {
2788 unsigned int __simpleStruct0;
2789
2790 if(topMember && topMember->type == 1)
2791 *retSize = (__simpleStruct0 = *retSize, (__simpleStruct0 > totalSize) ? __simpleStruct0 : totalSize);
2792 else
2793 *retSize += totalSize;
2794 }
2795 else if(totalSize < maxSize && _class->type != 1000)
2796 {
2797 char sizeString[50];
2798
2799 sprintf(sizeString, "%d", maxSize - totalSize);
2800 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(CHAR)), MkListOne(MkDeclaratorArray(MkDeclaratorIdentifier(MkIdentifier("__ecere_padding")), MkExpConstant(sizeString))), (((void *)0)))));
2801 }
2802 if(context)
2803 FinishTemplatesContext(context);
2804 return topMember ? topMember->memberID : _class->memberID;
2805 }
2806
2807 static int DeclareMembers(struct __ecereNameSpace__ecere__com__Class * _class, unsigned int isMember)
2808 {
2809 struct __ecereNameSpace__ecere__com__DataMember * topMember = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
2810 unsigned int totalSize = 0;
2811 struct __ecereNameSpace__ecere__com__DataMember * member;
2812 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
2813
2814 if(!isMember && (_class->type == 1 || _class->type == 5) && _class->base->type != 1000)
2815 DeclareMembers(_class->base, 0x0);
2816 for(member = isMember ? topMember->members.first : _class->membersAndProperties.first; member; member = member->next)
2817 {
2818 if(!member->isProperty)
2819 {
2820 switch(member->type)
2821 {
2822 case 0:
2823 {
2824 if(!member->dataType && member->dataTypeString)
2825 member->dataType = ProcessTypeString(member->dataTypeString, 0x0);
2826 if(member->dataType)
2827 DeclareType(member->dataType, 0x0, 0x0);
2828 break;
2829 }
2830 case 1:
2831 case 2:
2832 {
2833 DeclareMembers((struct __ecereNameSpace__ecere__com__Class *)member, 0x1);
2834 break;
2835 }
2836 }
2837 }
2838 }
2839 if(context)
2840 FinishTemplatesContext(context);
2841 return topMember ? topMember->memberID : _class->memberID;
2842 }
2843
2844 extern struct Symbol * FindClass(char *  name);
2845
2846 extern char *  strchr(char * , int);
2847
2848 extern void FullClassNameCat(char *  output, char *  className, unsigned int includeTemplateParams);
2849
2850 extern void FreeList(struct __ecereNameSpace__ecere__sys__OldList * list, void (* )(void * ));
2851
2852 extern struct External * MkExternalDeclaration(struct Declaration * declaration);
2853
2854 extern struct Declaration * MkDeclaration(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct __ecereNameSpace__ecere__sys__OldList * initDeclarators);
2855
2856 extern char *  strcpy(char * , const char * );
2857
2858 extern void MangleClassName(char *  className);
2859
2860 extern void DeclareClass(struct Symbol * classSym, char *  className);
2861
2862 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move(struct __ecereNameSpace__ecere__sys__OldList * this, void *  item, void *  prevItem);
2863
2864 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(struct __ecereNameSpace__ecere__sys__OldList * this, void *  prevItem, void *  item);
2865
2866 void DeclareStruct(char * name, unsigned int skipNoHead)
2867 {
2868 struct External * external = (((void *)0));
2869 struct Symbol * classSym = FindClass(name);
2870
2871 if(!inCompiler || !classSym)
2872 return (((void *)0));
2873 if(classSym->registered && (classSym->registered->type == 2 || classSym->registered->type == 3 || classSym->registered->type == 4))
2874 return (((void *)0));
2875 if(classSym->registered && classSym->imported && !classSym->declaredStructSym)
2876 {
2877 struct Declaration * decl;
2878 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
2879 struct __ecereNameSpace__ecere__sys__OldList * declarations = (((void *)0));
2880 char structName[1024];
2881
2882 external = (classSym->registered && classSym->registered->type == 1) ? classSym->pointerExternal : classSym->structExternal;
2883 classSym->declaring++;
2884 if(strchr(classSym->string, '<'))
2885 {
2886 if(classSym->registered->templateClass)
2887 {
2888 DeclareStruct(classSym->registered->templateClass->fullName, skipNoHead);
2889 classSym->declaring--;
2890 }
2891 return (((void *)0));
2892 }
2893 DeclareMembers(classSym->registered, 0x0);
2894 structName[0] = (char)0;
2895 FullClassNameCat(structName, name, 0x0);
2896 if(!skipNoHead)
2897 {
2898 classSym->declaredStructSym = 0x1;
2899 declarations = MkList();
2900 AddMembers(declarations, classSym->registered, 0x0, (((void *)0)), classSym->registered);
2901 if(!(*declarations).count)
2902 {
2903 FreeList(declarations, (((void *)0)));
2904 declarations = (((void *)0));
2905 }
2906 }
2907 if(skipNoHead || declarations)
2908 {
2909 if(external && external->declaration)
2910 {
2911 ((struct Specifier *)(*external->declaration->specifiers).first)->definitions = declarations;
2912 if(curExternal && curExternal->symbol && curExternal->symbol->idCode < classSym->id)
2913 {
2914 if(classSym->structExternal)
2915 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->structExternal, curExternal->prev);
2916 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->pointerExternal, curExternal->prev);
2917 classSym->id = curExternal->symbol->idCode;
2918 classSym->idCode = curExternal->symbol->idCode;
2919 }
2920 }
2921 else
2922 {
2923 if(!external)
2924 external = MkExternalDeclaration((((void *)0)));
2925 specifiers = MkList();
2926 declarators = MkList();
2927 ListAdd(specifiers, MkStructOrUnion(3, MkIdentifier(structName), declarations));
2928 external->declaration = decl = MkDeclaration(specifiers, declarators);
2929 if(decl->symbol && !decl->symbol->pointerExternal)
2930 decl->symbol->pointerExternal = external;
2931 if(classSym->registered && classSym->registered->type == 1)
2932 {
2933 char className[1024];
2934
2935 strcpy(className, "__ecereClass_");
2936 FullClassNameCat(className, classSym->string, 0x1);
2937 MangleClassName(className);
2938 DeclareClass(classSym, className);
2939 external->symbol = classSym;
2940 classSym->pointerExternal = external;
2941 classSym->id = (curExternal && curExternal->symbol) ? curExternal->symbol->idCode : 0;
2942 classSym->idCode = (curExternal && curExternal->symbol) ? curExternal->symbol->idCode : 0;
2943 }
2944 else
2945 {
2946 char className[1024];
2947
2948 strcpy(className, "__ecereClass_");
2949 FullClassNameCat(className, classSym->string, 0x1);
2950 MangleClassName(className);
2951 classSym->structExternal = external;
2952 DeclareClass(classSym, className);
2953 external->symbol = classSym;
2954 }
2955 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal ? curExternal->prev : (((void *)0)), external);
2956 }
2957 }
2958 classSym->declaring--;
2959 }
2960 else if(curExternal && curExternal->symbol && curExternal->symbol->idCode < classSym->id)
2961 {
2962 classSym->declaring++;
2963 {
2964 if(classSym->registered)
2965 DeclareMembers(classSym->registered, 0x0);
2966 }
2967 if(classSym->registered && (classSym->registered->type == 1 || classSym->registered->type == 5))
2968 {
2969 if(classSym->structExternal)
2970 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->structExternal, curExternal->prev);
2971 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->pointerExternal, curExternal->prev);
2972 classSym->id = curExternal->symbol->idCode;
2973 classSym->idCode = curExternal->symbol->idCode;
2974 }
2975 classSym->declaring--;
2976 }
2977 }
2978
2979 extern char *  strcat(char * , const char * );
2980
2981 extern struct ModuleImport * FindModule(struct __ecereNameSpace__ecere__com__Instance * moduleToFind);
2982
2983 extern struct ModuleImport * mainModule;
2984
2985 extern struct Specifier * MkSpecifierName(char *  name);
2986
2987 extern struct Declarator * MkDeclaratorBrackets(struct Declarator * declarator);
2988
2989 extern struct Declarator * PlugDeclarator(struct Declarator * decl, struct Declarator * baseDecl);
2990
2991 extern struct Declarator * MkDeclaratorFunction(struct Declarator * declarator, struct __ecereNameSpace__ecere__sys__OldList * parameters);
2992
2993 extern struct InitDeclarator * MkInitDeclarator(struct Declarator * declarator, struct Initializer * initializer);
2994
2995 extern void FreeDeclarator(struct Declarator * decl);
2996
2997 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_PropertyImport;
2998
2999 struct PropertyImport
3000 {
3001 struct PropertyImport * prev;
3002 struct PropertyImport * next;
3003 char *  name;
3004 unsigned int isVirtual;
3005 unsigned int hasSet;
3006 unsigned int hasGet;
3007 } __attribute__ ((gcc_struct));
3008
3009 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(struct __ecereNameSpace__ecere__sys__OldList * this, void *  item);
3010
3011 void DeclareProperty(struct __ecereNameSpace__ecere__com__Property * prop, char * setName, char * getName)
3012 {
3013 void * __ecereTemp1;
3014 struct Symbol * symbol = prop->symbol;
3015 char propName[1024];
3016
3017 strcpy(setName, "__ecereProp_");
3018 FullClassNameCat(setName, prop->_class->fullName, 0x0);
3019 strcat(setName, "_Set_");
3020 FullClassNameCat(setName, prop->name, 0x1);
3021 strcpy(getName, "__ecereProp_");
3022 FullClassNameCat(getName, prop->_class->fullName, 0x0);
3023 strcat(getName, "_Get_");
3024 FullClassNameCat(getName, prop->name, 0x1);
3025 strcpy(propName, "__ecereProp_");
3026 FullClassNameCat(propName, prop->_class->fullName, 0x0);
3027 strcat(propName, "_");
3028 FullClassNameCat(propName, prop->name, 0x1);
3029 MangleClassName(getName);
3030 MangleClassName(setName);
3031 MangleClassName(propName);
3032 if(prop->_class->type == 1)
3033 DeclareStruct(prop->_class->fullName, 0x0);
3034 if(!symbol || curExternal->symbol->idCode < symbol->id)
3035 {
3036 unsigned int imported = 0x0;
3037 unsigned int dllImport = 0x0;
3038
3039 if(!symbol || symbol->_import)
3040 {
3041 if(!symbol)
3042 {
3043 struct Symbol * classSym;
3044
3045 if(!prop->_class->symbol)
3046 prop->_class->symbol = FindClass(prop->_class->fullName);
3047 classSym = prop->_class->symbol;
3048 if(classSym && !classSym->_import)
3049 {
3050 struct ModuleImport * module;
3051
3052 if(prop->_class->module)
3053 module = FindModule(prop->_class->module);
3054 else
3055 module = mainModule;
3056 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));
3057 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->classes, classSym->_import);
3058 }
3059 symbol = prop->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
3060 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));
3061 if(classSym)
3062 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&classSym->_import->properties, symbol->_import);
3063 }
3064 imported = 0x1;
3065 if(prop->_class->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)prop->_class->module + 12)))->importType != 1)
3066 dllImport = 0x1;
3067 }
3068 if(!symbol->type)
3069 {
3070 struct Context * context = SetupTemplatesContext(prop->_class);
3071
3072 symbol->type = ProcessTypeString(prop->dataTypeString, 0x0);
3073 FinishTemplatesContext(context);
3074 }
3075 if(prop->Get)
3076 {
3077 if(!symbol->externalGet || symbol->externalGet->type == 0)
3078 {
3079 struct Declaration * decl;
3080 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
3081 struct Declarator * d;
3082 struct __ecereNameSpace__ecere__sys__OldList * params;
3083 struct Specifier * spec;
3084 struct External * external;
3085 struct Declarator * typeDecl;
3086 unsigned int simple = 0x0;
3087
3088 specifiers = MkList();
3089 declarators = MkList();
3090 params = MkList();
3091 ListAdd(params, MkTypeName(MkListOne(MkSpecifierName(prop->_class->fullName)), MkDeclaratorIdentifier(MkIdentifier("this"))));
3092 d = MkDeclaratorIdentifier(MkIdentifier(getName));
3093 if(dllImport)
3094 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
3095 {
3096 struct Context * context = SetupTemplatesContext(prop->_class);
3097
3098 typeDecl = SpecDeclFromString(prop->dataTypeString, specifiers, (((void *)0)));
3099 FinishTemplatesContext(context);
3100 }
3101 for(spec = (*specifiers).first; spec; spec = spec->next)
3102 {
3103 if(spec->type == 1)
3104 {
3105 if((!typeDecl || typeDecl->type == 1))
3106 {
3107 struct Symbol * classSym = spec->symbol;
3108
3109 symbol->_class = classSym->registered;
3110 if(classSym->registered && classSym->registered->type == 1)
3111 {
3112 DeclareStruct(spec->name, 0x0);
3113 simple = 0x1;
3114 }
3115 }
3116 }
3117 }
3118 if(!simple)
3119 d = PlugDeclarator(typeDecl, d);
3120 else
3121 {
3122 ListAdd(params, MkTypeName(specifiers, PlugDeclarator(typeDecl, MkDeclaratorIdentifier(MkIdentifier("value")))));
3123 specifiers = MkList();
3124 }
3125 d = MkDeclaratorFunction(d, params);
3126 if(dllImport)
3127 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
3128 else if(prop->_class->symbol && ((struct Symbol *)prop->_class->symbol)->isStatic)
3129 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
3130 if(simple)
3131 ListAdd(specifiers, MkSpecifier(VOID));
3132 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
3133 decl = MkDeclaration(specifiers, declarators);
3134 external = MkExternalDeclaration(decl);
3135 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
3136 external->symbol = symbol;
3137 symbol->externalGet = external;
3138 ReplaceThisClassSpecifiers(specifiers, prop->_class);
3139 if(typeDecl)
3140 FreeDeclarator(typeDecl);
3141 }
3142 else
3143 {
3144 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->externalGet, curExternal->prev);
3145 }
3146 }
3147 if(prop->Set)
3148 {
3149 if(!symbol->externalSet || symbol->externalSet->type == 0)
3150 {
3151 struct Declaration * decl;
3152 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
3153 struct Declarator * d;
3154 struct __ecereNameSpace__ecere__sys__OldList * params;
3155 struct Specifier * spec;
3156 struct External * external;
3157 struct Declarator * typeDecl;
3158
3159 declarators = MkList();
3160 params = MkList();
3161 if(!prop->conversion || prop->_class->type == 1)
3162 {
3163 ListAdd(params, MkTypeName(MkListOne(MkSpecifierName(prop->_class->fullName)), MkDeclaratorIdentifier(MkIdentifier("this"))));
3164 }
3165 specifiers = MkList();
3166 {
3167 struct Context * context = SetupTemplatesContext(prop->_class);
3168
3169 typeDecl = d = SpecDeclFromString(prop->dataTypeString, specifiers, MkDeclaratorIdentifier(MkIdentifier("value")));
3170 FinishTemplatesContext(context);
3171 }
3172 ListAdd(params, MkTypeName(specifiers, d));
3173 d = MkDeclaratorIdentifier(MkIdentifier(setName));
3174 if(dllImport)
3175 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
3176 d = MkDeclaratorFunction(d, params);
3177 for(spec = (*specifiers).first; spec; spec = spec->next)
3178 {
3179 if(spec->type == 1)
3180 {
3181 if((!typeDecl || typeDecl->type == 1))
3182 {
3183 struct Symbol * classSym = spec->symbol;
3184
3185 symbol->_class = classSym->registered;
3186 if(classSym->registered && classSym->registered->type == 1)
3187 DeclareStruct(spec->name, 0x0);
3188 }
3189 }
3190 }
3191 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
3192 specifiers = MkList();
3193 if(dllImport)
3194 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
3195 else if(prop->_class->symbol && ((struct Symbol *)prop->_class->symbol)->isStatic)
3196 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
3197 if(!prop->conversion || prop->_class->type == 1)
3198 ListAdd(specifiers, MkSpecifier(VOID));
3199 else
3200 ListAdd(specifiers, MkSpecifierName(prop->_class->fullName));
3201 decl = MkDeclaration(specifiers, declarators);
3202 external = MkExternalDeclaration(decl);
3203 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
3204 external->symbol = symbol;
3205 symbol->externalSet = external;
3206 ReplaceThisClassSpecifiers(specifiers, prop->_class);
3207 }
3208 else
3209 {
3210 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->externalSet, curExternal->prev);
3211 }
3212 }
3213 if(!symbol->externalPtr)
3214 {
3215 struct Declaration * decl;
3216 struct External * external;
3217 struct __ecereNameSpace__ecere__sys__OldList * specifiers = MkList();
3218
3219 if(imported)
3220 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
3221 else
3222 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
3223 ListAdd(specifiers, MkSpecifierName("Property"));
3224 {
3225 struct __ecereNameSpace__ecere__sys__OldList * list = MkList();
3226
3227 ListAdd(list, MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier(propName))), (((void *)0))));
3228 if(!imported)
3229 {
3230 strcpy(propName, "__ecerePropM_");
3231 FullClassNameCat(propName, prop->_class->fullName, 0x0);
3232 strcat(propName, "_");
3233 FullClassNameCat(propName, prop->name, 0x1);
3234 MangleClassName(propName);
3235 ListAdd(list, MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier(propName))), (((void *)0))));
3236 }
3237 decl = MkDeclaration(specifiers, list);
3238 }
3239 external = MkExternalDeclaration(decl);
3240 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
3241 external->symbol = symbol;
3242 symbol->externalPtr = external;
3243 }
3244 else
3245 {
3246 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->externalPtr, curExternal->prev);
3247 }
3248 symbol->id = curExternal->symbol->idCode;
3249 }
3250 }
3251
3252 struct Type * Dereference(struct Type * source)
3253 {
3254 void * __ecereTemp1;
3255 struct Type * type = (((void *)0));
3256
3257 if(source)
3258 {
3259 if(source->kind == 13 || source->kind == 12)
3260 {
3261 type = source->type;
3262 source->type->refCount++;
3263 }
3264 else if(source->kind == 8 && !strcmp(source->_class->string, "String"))
3265 {
3266 type = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->kind = 1, ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1));
3267 }
3268 else if(source->kind == 8 && source->_class && source->_class->registered && source->_class->registered->type == 5)
3269 {
3270 type = source;
3271 source->refCount++;
3272 }
3273 else
3274 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "cannot dereference type\n", (((void *)0))));
3275 }
3276 return type;
3277 }
3278
3279 static struct Type * Reference(struct Type * source)
3280 {
3281 void * __ecereTemp1;
3282 struct Type * type = (((void *)0));
3283
3284 if(source)
3285 {
3286 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));
3287 source->refCount++;
3288 }
3289 return type;
3290 }
3291
3292 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);
3293
3294 extern void *  memcpy(void * , const void * , unsigned int size);
3295
3296 void ProcessMethodType(struct __ecereNameSpace__ecere__com__Method * method);
3297
3298 extern void FreeExpression(struct Expression * exp);
3299
3300 extern void __ecereNameSpace__ecere__sys__ChangeCh(char *  string, char ch1, char ch2);
3301
3302 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);
3303
3304 static void ProcessInitializer(struct Initializer * init, struct Type * type);
3305
3306 extern struct Type * MkClassType(char *  name);
3307
3308 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);
3309
3310 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)
3311 {
3312 struct Identifier * ident = member->identifiers ? (*member->identifiers).first : (((void *)0));
3313 unsigned int found = 0x0;
3314 struct __ecereNameSpace__ecere__com__DataMember * dataMember = (((void *)0));
3315 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
3316 unsigned int freeType = 0x0;
3317
3318 yylloc = member->loc;
3319 if(!ident)
3320 {
3321 if(curMember)
3322 {
3323 __ecereNameSpace__ecere__com__eClass_FindNextMember(_class, curClass, curMember, subMemberStack, subMemberStackPos);
3324 if(*curMember)
3325 {
3326 found = 0x1;
3327 dataMember = *curMember;
3328 }
3329 }
3330 }
3331 else
3332 {
3333 struct __ecereNameSpace__ecere__com__DataMember * thisMember = (struct __ecereNameSpace__ecere__com__DataMember *)__ecereNameSpace__ecere__com__eClass_FindProperty(_class, ident->string, privateModule);
3334 struct __ecereNameSpace__ecere__com__DataMember * _subMemberStack[256];
3335 int _subMemberStackPos = 0;
3336
3337 if(!thisMember)
3338 thisMember = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, ident->string, privateModule, _subMemberStack, &_subMemberStackPos);
3339 if(thisMember)
3340 {
3341 dataMember = thisMember;
3342 if(curMember && thisMember->memberAccess == 1)
3343 {
3344 *curMember = thisMember;
3345 *curClass = thisMember->_class;
3346 memcpy(subMemberStack, _subMemberStack, sizeof(int) * _subMemberStackPos);
3347 *subMemberStackPos = _subMemberStackPos;
3348 }
3349 found = 0x1;
3350 }
3351 else
3352 {
3353 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, ident->string, privateModule);
3354 if(method && method->type == 1)
3355 found = 0x1;
3356 else
3357 method = (((void *)0));
3358 }
3359 }
3360 if(found)
3361 {
3362 struct Type * type = (((void *)0));
3363
3364 if(dataMember)
3365 {
3366 if(!dataMember->dataType && dataMember->dataTypeString)
3367 {
3368 struct Context * context = SetupTemplatesContext(_class);
3369
3370 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
3371 FinishTemplatesContext(context);
3372 }
3373 type = dataMember->dataType;
3374 }
3375 else if(method)
3376 {
3377 if(!method->dataType)
3378 ProcessMethodType(method);
3379 type = method->dataType;
3380 }
3381 if(ident && ident->next)
3382 {
3383 for(ident = ident->next; ident && type; ident = ident->next)
3384 {
3385 if(type->kind == 8)
3386 {
3387 dataMember = (struct __ecereNameSpace__ecere__com__DataMember *)__ecereNameSpace__ecere__com__eClass_FindProperty(type->_class->registered, ident->string, privateModule);
3388 if(!dataMember)
3389 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMember(type->_class->registered, ident->string, privateModule, (((void *)0)), (((void *)0)));
3390 if(dataMember)
3391 type = dataMember->dataType;
3392 }
3393 else if(type->kind == 9 || type->kind == 10)
3394 {
3395 struct Type * memberType;
3396
3397 for(memberType = type->members.first; memberType; memberType = memberType->next)
3398 {
3399 if(!strcmp(memberType->name, ident->string))
3400 {
3401 type = memberType;
3402 break;
3403 }
3404 }
3405 }
3406 }
3407 }
3408 if(type && type->kind == 20 && type->templateParameter->type == 0 && _class->templateArgs)
3409 {
3410 int id = 0;
3411 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
3412 struct __ecereNameSpace__ecere__com__Class * sClass;
3413
3414 for(sClass = _class; sClass; sClass = sClass->base)
3415 {
3416 id = 0;
3417 if(sClass->templateClass)
3418 sClass = sClass->templateClass;
3419 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
3420 {
3421 if(curParam->type == 0 && !strcmp(type->templateParameter->identifier->string, curParam->name))
3422 {
3423 for(sClass = sClass->base; sClass; sClass = sClass->base)
3424 {
3425 if(sClass->templateClass)
3426 sClass = sClass->templateClass;
3427 id += sClass->templateParams.count;
3428 }
3429 break;
3430 }
3431 id++;
3432 }
3433 if(curParam)
3434 break;
3435 }
3436 if(curParam)
3437 {
3438 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = _class->templateArgs[id];
3439
3440 if(arg.dataTypeString)
3441 {
3442 type = ProcessTypeString(arg.dataTypeString, 0x0);
3443 freeType = 0x1;
3444 if(type && _class->templateClass)
3445 type->passAsTemplate = 0x1;
3446 if(type)
3447 {
3448 }
3449 }
3450 }
3451 }
3452 if(type && type->kind == 8 && type->_class && type->_class->registered && strchr(type->_class->registered->fullName, '<'))
3453 {
3454 struct __ecereNameSpace__ecere__com__Class * expClass = type->_class->registered;
3455 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
3456 int c;
3457 int paramCount = 0;
3458 int lastParam = -1;
3459 char templateString[1024];
3460 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
3461
3462 sprintf(templateString, "%s<", expClass->templateClass->fullName);
3463 for(cClass = expClass; cClass; cClass = cClass->base)
3464 {
3465 int p = 0;
3466
3467 if(cClass->templateClass)
3468 cClass = cClass->templateClass;
3469 for(param = cClass->templateParams.first; param; param = param->next)
3470 {
3471 int id = p;
3472 struct __ecereNameSpace__ecere__com__Class * sClass;
3473 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
3474
3475 for(sClass = cClass->base; sClass; sClass = sClass->base)
3476 {
3477 if(sClass->templateClass)
3478 sClass = sClass->templateClass;
3479 id += sClass->templateParams.count;
3480 }
3481 arg = expClass->templateArgs[id];
3482 for(sClass = _class; sClass; sClass = sClass->base)
3483 {
3484 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * cParam;
3485 int p = 0;
3486 struct __ecereNameSpace__ecere__com__Class * nextClass;
3487
3488 if(sClass->templateClass)
3489 sClass = sClass->templateClass;
3490 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
3491 {
3492 if(nextClass->templateClass)
3493 nextClass = nextClass->templateClass;
3494 p += nextClass->templateParams.count;
3495 }
3496 for(cParam = sClass->templateParams.first; cParam; cParam = cParam->next, p++)
3497 {
3498 if(cParam->type == 0 && arg.dataTypeString && !strcmp(cParam->name, arg.dataTypeString))
3499 {
3500 if(_class->templateArgs && arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
3501 {
3502 arg.dataTypeString = _class->templateArgs[p].dataTypeString;
3503 arg.dataTypeClass = _class->templateArgs[p].dataTypeClass;
3504 break;
3505 }
3506 }
3507 }
3508 }
3509 {
3510 char argument[256];
3511
3512 argument[0] = '\0';
3513 switch(param->type)
3514 {
3515 case 2:
3516 {
3517 char expString[1024];
3518 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
3519 struct Declarator * decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
3520 struct Expression * exp;
3521 char * string = PrintHexUInt64(arg.expression.ui64);
3522
3523 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
3524 ProcessExpressionType(exp);
3525 ComputeExpression(exp);
3526 expString[0] = '\0';
3527 PrintExpression(exp, expString);
3528 strcat(argument, expString);
3529 FreeExpression(exp);
3530 break;
3531 }
3532 case 1:
3533 {
3534 strcat(argument, arg.member->name);
3535 break;
3536 }
3537 case 0:
3538 {
3539 if(arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
3540 strcat(argument, arg.dataTypeString);
3541 break;
3542 }
3543 }
3544 if(argument[0])
3545 {
3546 if(paramCount)
3547 strcat(templateString, ", ");
3548 if(lastParam != p - 1)
3549 {
3550 strcat(templateString, param->name);
3551 strcat(templateString, " = ");
3552 }
3553 strcat(templateString, argument);
3554 paramCount++;
3555 lastParam = p;
3556 }
3557 p++;
3558 }
3559 }
3560 }
3561 {
3562 int len = strlen(templateString);
3563
3564 if(templateString[len - 1] == '<')
3565 len--;
3566 else
3567 {
3568 if(templateString[len - 1] == '>')
3569 templateString[len++] = ' ';
3570 templateString[len++] = '>';
3571 }
3572 templateString[len++] = '\0';
3573 }
3574 {
3575 struct Context * context = SetupTemplatesContext(_class);
3576
3577 if(freeType)
3578 FreeType(type);
3579 type = ProcessTypeString(templateString, 0x0);
3580 freeType = 0x1;
3581 FinishTemplatesContext(context);
3582 }
3583 }
3584 if(method && member->initializer && member->initializer->type == 0 && member->initializer->exp)
3585 {
3586 ProcessExpressionType(member->initializer->exp);
3587 if(!member->initializer->exp->expType)
3588 {
3589 if(inCompiler)
3590 {
3591 char expString[10240];
3592
3593 expString[0] = '\0';
3594 PrintExpression(member->initializer->exp, expString);
3595 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
3596 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "unresolved symbol used as an instance method %s\n", (((void *)0))), expString);
3597 }
3598 }
3599 else if(!MatchTypes(member->initializer->exp->expType, type, (((void *)0)), (((void *)0)), _class, 0x1, 0x1, 0x0, 0x0))
3600 {
3601 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible instance method %s\n", (((void *)0))), ident->string);
3602 }
3603 }
3604 else if(member->initializer)
3605 {
3606 ProcessInitializer(member->initializer, type);
3607 }
3608 if(freeType)
3609 FreeType(type);
3610 }
3611 else
3612 {
3613 if(_class && _class->type == 3)
3614 {
3615 if(member->initializer)
3616 {
3617 struct Type * type = MkClassType(_class->fullName);
3618
3619 ProcessInitializer(member->initializer, type);
3620 FreeType(type);
3621 }
3622 }
3623 else
3624 {
3625 if(member->initializer)
3626 {
3627 ProcessInitializer(member->initializer, (((void *)0)));
3628 }
3629 if(ident)
3630 {
3631 if(method)
3632 {
3633 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't find virtual method %s in class %s\n", (((void *)0))), ident->string, _class->fullName);
3634 }
3635 else if(_class)
3636 {
3637 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't find member %s in class %s\n", (((void *)0))), ident->string, _class->fullName);
3638 if(inCompiler)
3639 __ecereNameSpace__ecere__com__eClass_AddDataMember(_class, ident->string, "int", 0, 0, 1);
3640 }
3641 }
3642 else if(_class)
3643 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "too many initializers for instantiation of class %s\n", (((void *)0))), _class->fullName);
3644 }
3645 }
3646 }
3647
3648 extern struct Identifier * GetDeclId(struct Declarator * decl);
3649
3650 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);
3651
3652 extern void FreeSpecifier(struct Specifier * spec);
3653
3654 static void ProcessFunction(struct FunctionDefinition * function);
3655
3656 extern struct __ecereNameSpace__ecere__sys__OldList *  CopyList(struct __ecereNameSpace__ecere__sys__OldList *  source, void *  (* )(void * ));
3657
3658 extern struct Specifier * CopySpecifier(struct Specifier * spec);
3659
3660 extern struct Declarator * CopyDeclarator(struct Declarator * declarator);
3661
3662 extern void FreeClassFunction(struct ClassFunction * func);
3663
3664 extern struct MemberInit * MkMemberInit(struct __ecereNameSpace__ecere__sys__OldList * ids, struct Initializer * initializer);
3665
3666 extern struct Initializer * MkInitializerAssignment(struct Expression * exp);
3667
3668 void ProcessInstantiationType(struct Instantiation * inst)
3669 {
3670 yylloc = inst->loc;
3671 if(inst->_class)
3672 {
3673 struct MembersInit * members;
3674 struct Symbol * classSym;
3675 struct __ecereNameSpace__ecere__com__Class * _class;
3676
3677 classSym = inst->_class->symbol;
3678 _class = classSym ? classSym->registered : (((void *)0));
3679 if(!_class || _class->type != 5)
3680 DeclareStruct(inst->_class->name, 0x0);
3681 afterExternal = afterExternal ? afterExternal : curExternal;
3682 if(inst->exp)
3683 ProcessExpressionType(inst->exp);
3684 inst->isConstant = 0x1;
3685 if(inst->members)
3686 {
3687 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
3688 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
3689 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
3690 int subMemberStackPos = 0;
3691
3692 for(members = (*inst->members).first; members; members = members->next)
3693 {
3694 switch(members->type)
3695 {
3696 case 1:
3697 {
3698 char name[1024];
3699 static unsigned int instMethodID = 0;
3700 struct External * external = curExternal;
3701 struct Context * context = curContext;
3702 struct Declarator * declarator = members->function->declarator;
3703 struct Identifier * nameID = GetDeclId(declarator);
3704 char * unmangled = nameID ? nameID->string : (((void *)0));
3705 struct Expression * exp;
3706 struct External * createdExternal = (((void *)0));
3707
3708 if(inCompiler)
3709 {
3710 char number[16];
3711
3712 strcpy(name, "__ecereInstMeth_");
3713 FullClassNameCat(name, _class ? _class->fullName : "_UNKNOWNCLASS", 0x0);
3714 strcat(name, "_");
3715 strcat(name, nameID->string);
3716 strcat(name, "_");
3717 sprintf(number, "_%08d", instMethodID++);
3718 strcat(name, number);
3719 nameID->string = __ecereNameSpace__ecere__sys__CopyString(name);
3720 }
3721 if(declarator)
3722 {
3723 struct Symbol * symbol = declarator->symbol;
3724 struct __ecereNameSpace__ecere__com__Method * method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, unmangled, privateModule);
3725
3726 if(method && method->type == 1)
3727 {
3728 symbol->method = method;
3729 ProcessMethodType(method);
3730 if(!symbol->type->thisClass)
3731 {
3732 if(method->dataType->thisClass && currentClass && __ecereNameSpace__ecere__com__eClass_IsDerived(currentClass, method->dataType->thisClass->registered))
3733 {
3734 if(!currentClass->symbol)
3735 currentClass->symbol = FindClass(currentClass->fullName);
3736 symbol->type->thisClass = currentClass->symbol;
3737 }
3738 else
3739 {
3740 if(!_class->symbol)
3741 _class->symbol = FindClass(_class->fullName);
3742 symbol->type->thisClass = _class->symbol;
3743 }
3744 }
3745 DeclareType(symbol->type, 0x1, 0x1);
3746 }
3747 else if(classSym)
3748 {
3749 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't find virtual method %s in class %s\n", (((void *)0))), unmangled, classSym->string);
3750 }
3751 }
3752 createdExternal = ProcessClassFunction(classSym ? classSym->registered : (((void *)0)), members->function, ast, afterExternal, 0x1);
3753 if(nameID)
3754 {
3755 FreeSpecifier(nameID->_class);
3756 nameID->_class = (((void *)0));
3757 }
3758 if(inCompiler)
3759 {
3760 struct Type * type = declarator->symbol->type;
3761 struct External * oldExternal = curExternal;
3762
3763 declarator->symbol->id = declarator->symbol->idCode = curExternal->symbol->idCode;
3764 {
3765 struct External * externalDecl;
3766
3767 externalDecl = MkExternalDeclaration((((void *)0)));
3768 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), oldExternal->prev, externalDecl);
3769 if(createdExternal->function)
3770 {
3771 ProcessFunction(createdExternal->function);
3772 {
3773 struct Declaration * decl = MkDeclaration(CopyList(createdExternal->function->specifiers, CopySpecifier), MkListOne(MkInitDeclarator(CopyDeclarator(declarator), (((void *)0)))));
3774
3775 externalDecl->declaration = decl;
3776 if(decl->symbol && !decl->symbol->pointerExternal)
3777 decl->symbol->pointerExternal = externalDecl;
3778 declarator->symbol->pointerExternal = externalDecl;
3779 }
3780 }
3781 }
3782 }
3783 else if(declarator)
3784 {
3785 curExternal = declarator->symbol->pointerExternal;
3786 ProcessFunction((struct FunctionDefinition *)members->function);
3787 }
3788 curExternal = external;
3789 curContext = context;
3790 if(inCompiler)
3791 {
3792 FreeClassFunction(members->function);
3793 exp = QMkExpId(name);
3794 members->type = 0;
3795 members->dataMembers = MkListOne(MkMemberInit(MkListOne(MkIdentifier(unmangled)), MkInitializerAssignment(exp)));
3796 (__ecereNameSpace__ecere__com__eSystem_Delete(unmangled), unmangled = 0);
3797 }
3798 break;
3799 }
3800 case 0:
3801 {
3802 if(members->dataMembers && classSym)
3803 {
3804 struct MemberInit * member;
3805 struct Location oldyyloc = yylloc;
3806
3807 for(member = (*members->dataMembers).first; member; member = member->next)
3808 {
3809 ProcessMemberInitData(member, classSym->registered, &curClass, &curMember, subMemberStack, &subMemberStackPos);
3810 if(member->initializer && !member->initializer->isConstant)
3811 inst->isConstant = 0x0;
3812 }
3813 yylloc = oldyyloc;
3814 }
3815 break;
3816 }
3817 }
3818 }
3819 }
3820 }
3821 }
3822
3823 static void DeclareType(struct Type * type, unsigned int declarePointers, unsigned int declareParams)
3824 {
3825 if(inCompiler)
3826 {
3827 if(type->kind == 11)
3828 {
3829 struct Type * param;
3830
3831 if(declareParams)
3832 {
3833 for(param = type->params.first; param; param = param->next)
3834 DeclareType(param, declarePointers, 0x1);
3835 }
3836 DeclareType(type->returnType, declarePointers, 0x1);
3837 }
3838 else if(type->kind == 13 && declarePointers)
3839 DeclareType(type->type, declarePointers, 0x0);
3840 else if(type->kind == 8)
3841 {
3842 if(type->_class->registered && (type->_class->registered->type == 1 || type->_class->registered->type == 5) && !type->_class->declaring)
3843 DeclareStruct(type->_class->registered->fullName, type->_class->registered->type == 5);
3844 }
3845 else if(type->kind == 9 || type->kind == 10)
3846 {
3847 struct Type * member;
3848
3849 for(member = type->members.first; member; member = member->next)
3850 DeclareType(member, 0x0, 0x0);
3851 }
3852 else if(type->kind == 12)
3853 DeclareType(type->arrayType, declarePointers, 0x0);
3854 }
3855 }
3856
3857 extern struct __ecereNameSpace__ecere__com__Class * __ecereNameSpace__ecere__com__eSystem_FindClass(struct __ecereNameSpace__ecere__com__Instance * module, char *  name);
3858
3859 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * FindTemplateArg(struct __ecereNameSpace__ecere__com__Class * _class, struct TemplateParameter * param)
3860 {
3861 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * arg = (((void *)0));
3862 int id = 0;
3863 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
3864 struct __ecereNameSpace__ecere__com__Class * sClass;
3865
3866 for(sClass = _class; sClass; sClass = sClass->base)
3867 {
3868 id = 0;
3869 if(sClass->templateClass)
3870 sClass = sClass->templateClass;
3871 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
3872 {
3873 if(curParam->type == 0 && !strcmp(param->identifier->string, curParam->name))
3874 {
3875 for(sClass = sClass->base; sClass; sClass = sClass->base)
3876 {
3877 if(sClass->templateClass)
3878 sClass = sClass->templateClass;
3879 id += sClass->templateParams.count;
3880 }
3881 break;
3882 }
3883 id++;
3884 }
3885 if(curParam)
3886 break;
3887 }
3888 if(curParam)
3889 {
3890 arg = &_class->templateArgs[id];
3891 if(arg && param->type == 0)
3892 (*arg).dataTypeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, (*arg).dataTypeString);
3893 }
3894 return arg;
3895 }
3896
3897 extern struct Context * PushContext(void);
3898
3899 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplatedType;
3900
3901 struct TemplatedType
3902 {
3903 uintptr_t key;
3904 struct __ecereNameSpace__ecere__sys__BTNode * parent;
3905 struct __ecereNameSpace__ecere__sys__BTNode * left;
3906 struct __ecereNameSpace__ecere__sys__BTNode * right;
3907 int depth;
3908 struct TemplateParameter * param;
3909 } __attribute__ ((gcc_struct));
3910
3911 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(struct __ecereNameSpace__ecere__sys__BinaryTree * this, struct __ecereNameSpace__ecere__sys__BTNode * node);
3912
3913 struct Context * SetupTemplatesContext(struct __ecereNameSpace__ecere__com__Class * _class)
3914 {
3915 void * __ecereTemp1;
3916 struct Context * context = PushContext();
3917
3918 context->templateTypesOnly = 0x1;
3919 if(_class->symbol && ((struct Symbol *)_class->symbol)->templateParams)
3920 {
3921 struct TemplateParameter * param = (*((struct Symbol *)_class->symbol)->templateParams).first;
3922
3923 for(; param; param = param->next)
3924 {
3925 if(param->type == 0 && param->identifier)
3926 {
3927 struct TemplatedType * type = (type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TemplatedType), type->key = (uintptr_t)param->identifier->string, type->param = param, type);
3928
3929 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&curContext->templateTypes, (struct __ecereNameSpace__ecere__sys__BTNode *)type);
3930 }
3931 }
3932 }
3933 else if(_class)
3934 {
3935 struct __ecereNameSpace__ecere__com__Class * sClass;
3936
3937 for(sClass = _class; sClass; sClass = sClass->base)
3938 {
3939 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * p;
3940
3941 for(p = sClass->templateParams.first; p; p = p->next)
3942 {
3943 if(p->type == 0)
3944 {
3945 struct TemplateParameter * param = p->param;
3946 struct TemplatedType * type;
3947
3948 if(!param)
3949 {
3950 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));
3951 }
3952 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));
3953 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&curContext->templateTypes, (struct __ecereNameSpace__ecere__sys__BTNode *)type);
3954 }
3955 }
3956 }
3957 }
3958 return context;
3959 }
3960
3961 extern void PopContext(struct Context * ctx);
3962
3963 extern void FreeContext(struct Context * context);
3964
3965 void FinishTemplatesContext(struct Context * context)
3966 {
3967 PopContext(context);
3968 FreeContext(context);
3969 ((context ? (__ecereClass_Context->Destructor ? __ecereClass_Context->Destructor(context) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(context)) : 0), context = 0);
3970 }
3971
3972 void ProcessMethodType(struct __ecereNameSpace__ecere__com__Method * method)
3973 {
3974 if(!method->dataType)
3975 {
3976 struct Context * context = SetupTemplatesContext(method->_class);
3977
3978 method->dataType = ProcessTypeString(method->dataTypeString, 0x0);
3979 FinishTemplatesContext(context);
3980 if(method->type != 1 && method->dataType)
3981 {
3982 if(!method->dataType->thisClass && !method->dataType->staticMethod)
3983 {
3984 if(!method->_class->symbol)
3985 method->_class->symbol = FindClass(method->_class->fullName);
3986 method->dataType->thisClass = method->_class->symbol;
3987 }
3988 }
3989 }
3990 }
3991
3992 void ProcessPropertyType(struct __ecereNameSpace__ecere__com__Property * prop)
3993 {
3994 if(!prop->dataType)
3995 {
3996 struct Context * context = SetupTemplatesContext(prop->_class);
3997
3998 prop->dataType = ProcessTypeString(prop->dataTypeString, 0x0);
3999 FinishTemplatesContext(context);
4000 }
4001 }
4002
4003 extern struct Declarator * GetFuncDecl(struct Declarator * decl);
4004
4005 extern void FreeTypeName(struct TypeName * typeName);
4006
4007 static void ProcessDeclarator(struct Declarator * decl);
4008
4009 extern struct __ecereNameSpace__ecere__sys__OldList *  excludedSymbols;
4010
4011 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_MethodImport;
4012
4013 struct MethodImport
4014 {
4015 struct MethodImport * prev;
4016 struct MethodImport * next;
4017 char *  name;
4018 unsigned int isVirtual;
4019 } __attribute__ ((gcc_struct));
4020
4021 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(struct __ecereNameSpace__ecere__sys__OldList * this, void *  item);
4022
4023 void DeclareMethod(struct __ecereNameSpace__ecere__com__Method * method, char * name)
4024 {
4025 void * __ecereTemp1;
4026 struct Symbol * symbol = method->symbol;
4027
4028 if(!symbol || (!symbol->pointerExternal && method->type == 1) || symbol->id > (curExternal ? curExternal->symbol->idCode : -1))
4029 {
4030 unsigned int imported = 0x0;
4031 unsigned int dllImport = 0x0;
4032
4033 if(!method->dataType)
4034 method->dataType = ProcessTypeString(method->dataTypeString, 0x0);
4035 if(!symbol || symbol->_import || method->type == 1)
4036 {
4037 if(!symbol || method->type == 1)
4038 {
4039 struct Symbol * classSym;
4040
4041 if(!method->_class->symbol)
4042 method->_class->symbol = FindClass(method->_class->fullName);
4043 classSym = method->_class->symbol;
4044 if(!classSym->_import)
4045 {
4046 struct ModuleImport * module;
4047
4048 if(method->_class->module && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)method->_class->module + 12)))->name)
4049 module = FindModule(method->_class->module);
4050 else
4051 module = mainModule;
4052 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));
4053 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->classes, classSym->_import);
4054 }
4055 if(!symbol)
4056 {
4057 symbol = method->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4058 }
4059 if(!symbol->_import)
4060 {
4061 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));
4062 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&classSym->_import->methods, symbol->_import);
4063 }
4064 if(!symbol)
4065 {
4066 symbol->type = method->dataType;
4067 if(symbol->type)
4068 symbol->type->refCount++;
4069 }
4070 }
4071 if(!method->dataType->dllExport)
4072 {
4073 imported = 0x1;
4074 if(method->_class->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)method->_class->module + 12)))->importType != 1)
4075 dllImport = 0x1;
4076 }
4077 }
4078 if(method->type != 1 && method->dataType)
4079 DeclareType(method->dataType, 0x1, 0x1);
4080 if(!symbol->pointerExternal || symbol->pointerExternal->type == 0)
4081 {
4082 struct Declaration * decl;
4083 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
4084 struct Declarator * d;
4085 struct Declarator * funcDecl;
4086 struct External * external;
4087
4088 specifiers = MkList();
4089 declarators = MkList();
4090 if(dllImport)
4091 ListAdd(specifiers, MkSpecifier(EXTERN));
4092 else if(method->_class->symbol && ((struct Symbol *)method->_class->symbol)->isStatic)
4093 ListAdd(specifiers, MkSpecifier(STATIC));
4094 if(method->type == 1)
4095 {
4096 ListAdd(specifiers, MkSpecifier(INT));
4097 d = MkDeclaratorIdentifier(MkIdentifier(name));
4098 }
4099 else
4100 {
4101 d = MkDeclaratorIdentifier(MkIdentifier(name));
4102 if(dllImport)
4103 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
4104 {
4105 struct Context * context = SetupTemplatesContext(method->_class);
4106
4107 d = SpecDeclFromString(method->dataTypeString, specifiers, d);
4108 FinishTemplatesContext(context);
4109 }
4110 funcDecl = GetFuncDecl(d);
4111 if(dllImport)
4112 {
4113 struct Specifier * spec, * next;
4114
4115 for(spec = (*specifiers).first; spec; spec = next)
4116 {
4117 next = spec->next;
4118 if(spec->type == 5)
4119 {
4120 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*specifiers), spec);
4121 FreeSpecifier(spec);
4122 }
4123 }
4124 }
4125 if(method->dataType && !method->dataType->staticMethod)
4126 {
4127 if(funcDecl && funcDecl->function.parameters && (*funcDecl->function.parameters).count)
4128 {
4129 struct __ecereNameSpace__ecere__com__Class * _class = method->dataType->thisClass ? method->dataType->thisClass->registered : method->_class;
4130 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")));
4131 struct TypeName * firstParam = ((struct TypeName *)(*funcDecl->function.parameters).first);
4132 struct Specifier * firstSpec = firstParam->qualifiers ? (*firstParam->qualifiers).first : (((void *)0));
4133
4134 if(firstSpec && firstSpec->type == 0 && firstSpec->specifier == VOID && !firstParam->declarator)
4135 {
4136 struct TypeName * param = (*funcDecl->function.parameters).first;
4137
4138 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->function.parameters), param);
4139 FreeTypeName(param);
4140 }
4141 if(!funcDecl->function.parameters)
4142 funcDecl->function.parameters = MkList();
4143 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
4144 }
4145 }
4146 }
4147 ProcessDeclarator(d);
4148 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
4149 decl = MkDeclaration(specifiers, declarators);
4150 ReplaceThisClassSpecifiers(specifiers, method->_class);
4151 if(symbol->pointerExternal)
4152 {
4153 struct Symbol * functionSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4154
4155 {
4156 *functionSymbol = *symbol;
4157 functionSymbol->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
4158 if(functionSymbol->type)
4159 functionSymbol->type->refCount++;
4160 }
4161 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*excludedSymbols), functionSymbol);
4162 symbol->pointerExternal->symbol = functionSymbol;
4163 }
4164 external = MkExternalDeclaration(decl);
4165 if(curExternal)
4166 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal ? curExternal->prev : (((void *)0)), external);
4167 external->symbol = symbol;
4168 symbol->pointerExternal = external;
4169 }
4170 else if(ast)
4171 {
4172 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
4173 }
4174 symbol->id = curExternal ? curExternal->symbol->idCode : (((int)0x7fffffff));
4175 }
4176 }
4177
4178 char * ReplaceThisClass(struct __ecereNameSpace__ecere__com__Class * _class)
4179 {
4180 if(thisClassParams && _class->templateParams.count && !_class->templateClass)
4181 {
4182 unsigned int first = 0x1;
4183 int p = 0;
4184 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
4185 int lastParam = -1;
4186 char className[1024];
4187
4188 strcpy(className, _class->fullName);
4189 for(param = _class->templateParams.first; param; param = param->next)
4190 {
4191 {
4192 if(first)
4193 strcat(className, "<");
4194 if(!first)
4195 strcat(className, ", ");
4196 if(lastParam + 1 != p)
4197 {
4198 strcat(className, param->name);
4199 strcat(className, " = ");
4200 }
4201 strcat(className, param->name);
4202 first = 0x0;
4203 lastParam = p;
4204 }
4205 p++;
4206 }
4207 if(!first)
4208 {
4209 int len = strlen(className);
4210
4211 if(className[len - 1] == '>')
4212 className[len++] = ' ';
4213 className[len++] = '>';
4214 className[len++] = '\0';
4215 }
4216 return __ecereNameSpace__ecere__sys__CopyString(className);
4217 }
4218 else
4219 return __ecereNameSpace__ecere__sys__CopyString(_class->fullName);
4220 }
4221
4222 struct Type * ReplaceThisClassType(struct __ecereNameSpace__ecere__com__Class * _class)
4223 {
4224 if(thisClassParams && _class->templateParams.count && !_class->templateClass)
4225 {
4226 unsigned int first = 0x1;
4227 int p = 0;
4228 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
4229 int lastParam = -1;
4230 char className[1024];
4231
4232 strcpy(className, _class->fullName);
4233 for(param = _class->templateParams.first; param; param = param->next)
4234 {
4235 {
4236 if(first)
4237 strcat(className, "<");
4238 if(!first)
4239 strcat(className, ", ");
4240 if(lastParam + 1 != p)
4241 {
4242 strcat(className, param->name);
4243 strcat(className, " = ");
4244 }
4245 strcat(className, param->name);
4246 first = 0x0;
4247 lastParam = p;
4248 }
4249 p++;
4250 }
4251 if(!first)
4252 {
4253 int len = strlen(className);
4254
4255 if(className[len - 1] == '>')
4256 className[len++] = ' ';
4257 className[len++] = '>';
4258 className[len++] = '\0';
4259 }
4260 return MkClassType(className);
4261 }
4262 else
4263 {
4264 return MkClassType(_class->fullName);
4265 }
4266 }
4267
4268 void ReplaceThisClassSpecifiers(struct __ecereNameSpace__ecere__sys__OldList * specs, struct __ecereNameSpace__ecere__com__Class * _class)
4269 {
4270 if(specs != (((void *)0)) && _class)
4271 {
4272 struct Specifier * spec;
4273
4274 for(spec = specs->first; spec; spec = spec->next)
4275 {
4276 if(spec->type == 0 && spec->specifier == THISCLASS)
4277 {
4278 spec->type = 1;
4279 spec->name = ReplaceThisClass(_class);
4280 spec->symbol = FindClass(spec->name);
4281 }
4282 }
4283 }
4284 }
4285
4286 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__GlobalFunction;
4287
4288 struct __ecereNameSpace__ecere__com__GlobalFunction
4289 {
4290 struct __ecereNameSpace__ecere__com__GlobalFunction * prev;
4291 struct __ecereNameSpace__ecere__com__GlobalFunction * next;
4292 char *  name;
4293 int (*  function)();
4294 struct __ecereNameSpace__ecere__com__Instance * module;
4295 struct __ecereNameSpace__ecere__com__NameSpace *  nameSpace;
4296 char *  dataTypeString;
4297 struct Type * dataType;
4298 void *  symbol;
4299 } __attribute__ ((gcc_struct));
4300
4301 extern struct Context * globalContext;
4302
4303 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_FunctionImport;
4304
4305 struct FunctionImport
4306 {
4307 struct FunctionImport * prev;
4308 struct FunctionImport * next;
4309 char *  name;
4310 } __attribute__ ((gcc_struct));
4311
4312 unsigned int DeclareFunction(struct __ecereNameSpace__ecere__com__GlobalFunction * function, char * name)
4313 {
4314 void * __ecereTemp1;
4315 struct Symbol * symbol = function->symbol;
4316
4317 if(curExternal && (!symbol || symbol->id > curExternal->symbol->idCode))
4318 {
4319 unsigned int imported = 0x0;
4320 unsigned int dllImport = 0x0;
4321
4322 if(!function->dataType)
4323 {
4324 function->dataType = ProcessTypeString(function->dataTypeString, 0x0);
4325 if(!function->dataType->thisClass)
4326 function->dataType->staticMethod = 0x1;
4327 }
4328 if(inCompiler)
4329 {
4330 if(!symbol)
4331 {
4332 struct ModuleImport * module = FindModule(function->module);
4333
4334 symbol = function->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4335 if(module->name)
4336 {
4337 if(!function->dataType->dllExport)
4338 {
4339 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));
4340 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->functions, symbol->_import);
4341 }
4342 }
4343 {
4344 symbol->type = ProcessTypeString(function->dataTypeString, 0x0);
4345 if(!symbol->type->thisClass)
4346 symbol->type->staticMethod = 0x1;
4347 }
4348 }
4349 imported = symbol->_import ? 0x1 : 0x0;
4350 if(imported && function->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + 12)))->importType != 1)
4351 dllImport = 0x1;
4352 }
4353 DeclareType(function->dataType, 0x1, 0x1);
4354 if(inCompiler)
4355 {
4356 if(!symbol->pointerExternal || symbol->pointerExternal->type == 0)
4357 {
4358 struct Declaration * decl;
4359 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
4360 struct Declarator * d;
4361 struct Declarator * funcDecl;
4362 struct External * external;
4363
4364 specifiers = MkList();
4365 declarators = MkList();
4366 ListAdd(specifiers, MkSpecifier(EXTERN));
4367 d = MkDeclaratorIdentifier(MkIdentifier(imported ? name : function->name));
4368 if(dllImport)
4369 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
4370 d = SpecDeclFromString(function->dataTypeString, specifiers, d);
4371 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + 12)))->importType == 1)
4372 {
4373 struct Specifier * spec;
4374
4375 for(spec = (*specifiers).first; spec; spec = spec->next)
4376 if(spec->type == 5 && spec->extDecl && spec->extDecl->type == 0 && !strcmp(spec->extDecl->s, "dllexport"))
4377 {
4378 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*specifiers), spec);
4379 FreeSpecifier(spec);
4380 break;
4381 }
4382 }
4383 funcDecl = GetFuncDecl(d);
4384 if(funcDecl && !funcDecl->function.parameters)
4385 {
4386 funcDecl->function.parameters = MkList();
4387 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), MkTypeName(MkListOne(MkSpecifier(VOID)), (((void *)0))));
4388 }
4389 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
4390 {
4391 struct Context * oldCtx = curContext;
4392
4393 curContext = globalContext;
4394 decl = MkDeclaration(specifiers, declarators);
4395 curContext = oldCtx;
4396 }
4397 if(symbol->pointerExternal)
4398 {
4399 struct Symbol * functionSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4400
4401 {
4402 *functionSymbol = *symbol;
4403 functionSymbol->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
4404 if(functionSymbol->type)
4405 functionSymbol->type->refCount++;
4406 }
4407 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*excludedSymbols), functionSymbol);
4408 symbol->pointerExternal->symbol = functionSymbol;
4409 }
4410 external = MkExternalDeclaration(decl);
4411 if(curExternal)
4412 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
4413 external->symbol = symbol;
4414 symbol->pointerExternal = external;
4415 }
4416 else
4417 {
4418 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
4419 }
4420 if(curExternal)
4421 symbol->id = curExternal->symbol->idCode;
4422 }
4423 }
4424 return (symbol && symbol->_import && function->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + 12)))->importType != 1) ? 0x1 : 0x0;
4425 }
4426
4427 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_GlobalData;
4428
4429 struct GlobalData
4430 {
4431 uintptr_t key;
4432 struct __ecereNameSpace__ecere__sys__BTNode * parent;
4433 struct __ecereNameSpace__ecere__sys__BTNode * left;
4434 struct __ecereNameSpace__ecere__sys__BTNode * right;
4435 int depth;
4436 struct __ecereNameSpace__ecere__com__Instance * module;
4437 char *  dataTypeString;
4438 struct Type * dataType;
4439 void *  symbol;
4440 char *  fullName;
4441 } __attribute__ ((gcc_struct));
4442
4443 void DeclareGlobalData(struct GlobalData * data)
4444 {
4445 struct Symbol * symbol = data->symbol;
4446
4447 if(curExternal && (!symbol || symbol->id > curExternal->symbol->idCode))
4448 {
4449 if(inCompiler)
4450 {
4451 if(!symbol)
4452 symbol = data->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4453 }
4454 if(!data->dataType)
4455 data->dataType = ProcessTypeString(data->dataTypeString, 0x0);
4456 DeclareType(data->dataType, 0x1, 0x1);
4457 if(inCompiler)
4458 {
4459 if(!symbol->pointerExternal)
4460 {
4461 struct Declaration * decl;
4462 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
4463 struct Declarator * d;
4464 struct External * external;
4465
4466 specifiers = MkList();
4467 declarators = MkList();
4468 ListAdd(specifiers, MkSpecifier(EXTERN));
4469 d = MkDeclaratorIdentifier(MkIdentifier(data->fullName));
4470 d = SpecDeclFromString(data->dataTypeString, specifiers, d);
4471 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
4472 decl = MkDeclaration(specifiers, declarators);
4473 external = MkExternalDeclaration(decl);
4474 if(curExternal)
4475 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
4476 external->symbol = symbol;
4477 symbol->pointerExternal = external;
4478 }
4479 else
4480 {
4481 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
4482 }
4483 if(curExternal)
4484 symbol->id = curExternal->symbol->idCode;
4485 }
4486 }
4487 }
4488
4489 struct Conversion
4490 {
4491 struct Conversion * prev, * next;
4492 struct __ecereNameSpace__ecere__com__Property * convert;
4493 unsigned int isGet;
4494 struct Type * resultType;
4495 } __attribute__ ((gcc_struct));
4496
4497 static struct __ecereNameSpace__ecere__com__Class * __ecereClass_Conversion;
4498
4499 extern void Compiler_Warning(char *  format, ...);
4500
4501 void PrintType(struct Type * type, char *  string, unsigned int printName, unsigned int fullName);
4502
4503 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)
4504 {
4505 if(source && dest)
4506 {
4507 if(source->kind == 20 && dest->kind != 20)
4508 {
4509 struct Type * type = ProcessTemplateParameterType(source->templateParameter);
4510
4511 if(type)
4512 source = type;
4513 }
4514 if(dest->kind == 20 && source->kind != 20)
4515 {
4516 struct Type * type = ProcessTemplateParameterType(dest->templateParameter);
4517
4518 if(type)
4519 dest = type;
4520 }
4521 if((dest->classObjectType == 2 && source->classObjectType != 3) || (dest->classObjectType == 3 && source->classObjectType != 2))
4522 {
4523 return 0x1;
4524 }
4525 if(source->classObjectType == 3 && dest->classObjectType != 2)
4526 {
4527 return 0x1;
4528 }
4529 if((dest->kind == 9 && source->kind == 9) || (dest->kind == 10 && source->kind == 10))
4530 {
4531 if((dest->enumName && source->enumName && !strcmp(dest->enumName, source->enumName)) || (source->members.first && source->members.first == dest->members.first))
4532 return 0x1;
4533 }
4534 if(dest->kind == 14 && source->kind != 0)
4535 return 0x1;
4536 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))
4537 return 0x1;
4538 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))
4539 return 0x1;
4540 if(((source->kind == 8 && dest->kind == 8) || (source->kind == 19 && dest->kind == 19)) && source->_class)
4541 {
4542 if(source->_class->registered && source->_class->registered->type == 3)
4543 {
4544 if(conversions != (((void *)0)))
4545 {
4546 if(source->_class->registered == dest->_class->registered)
4547 return 0x1;
4548 }
4549 else
4550 {
4551 struct __ecereNameSpace__ecere__com__Class * sourceBase, * destBase;
4552
4553 for(sourceBase = source->_class->registered; sourceBase && sourceBase->base->type != 1000; sourceBase = sourceBase->base)
4554 ;
4555 for(destBase = dest->_class->registered; destBase && destBase->base->type != 1000; destBase = destBase->base)
4556 ;
4557 if(sourceBase == destBase)
4558 return 0x1;
4559 }
4560 }
4561 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))
4562 return 0x1;
4563 else
4564 {
4565 if(enumBaseType && dest->_class && dest->_class->registered && dest->_class->registered->type == 4 && source->_class && source->_class->registered && source->_class->registered->type != 4)
4566 {
4567 if(__ecereNameSpace__ecere__com__eClass_IsDerived(dest->_class->registered, source->_class->registered))
4568 {
4569 return 0x1;
4570 }
4571 }
4572 }
4573 }
4574 if(source->kind == 19 && dest->kind == 8 && dest->_class && !strcmp(dest->_class->string, "ecere::com::Class"))
4575 return 0x1;
4576 if(doConversion)
4577 {
4578 if(source->kind == 8)
4579 {
4580 struct __ecereNameSpace__ecere__com__Class * _class;
4581
4582 for(_class = source->_class ? source->_class->registered : (((void *)0)); _class; _class = _class->base)
4583 {
4584 struct __ecereNameSpace__ecere__com__Property * convert;
4585
4586 for(convert = _class->conversions.first; convert; convert = convert->next)
4587 {
4588 if(convert->memberAccess == 1 || _class->module == privateModule)
4589 {
4590 struct Conversion * after = (conversions != (((void *)0))) ? conversions->last : (((void *)0));
4591
4592 if(!convert->dataType)
4593 convert->dataType = ProcessTypeString(convert->dataTypeString, 0x0);
4594 if(MatchTypes(convert->dataType, dest, conversions, (((void *)0)), (((void *)0)), 0x0, 0x1, 0x0, 0x1))
4595 {
4596 if(!conversions && !convert->Get)
4597 return 0x1;
4598 else if(conversions != (((void *)0)))
4599 {
4600 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))
4601 return 0x1;
4602 else
4603 {
4604 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv->isGet = 0x1, conv);
4605
4606 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(conversions, after, conv);
4607 return 0x1;
4608 }
4609 }
4610 }
4611 }
4612 }
4613 }
4614 }
4615 if(dest->kind == 8)
4616 {
4617 struct __ecereNameSpace__ecere__com__Class * _class;
4618
4619 for(_class = dest->_class ? dest->_class->registered : (((void *)0)); _class; _class = _class->base)
4620 {
4621 struct __ecereNameSpace__ecere__com__Property * convert;
4622
4623 for(convert = _class->conversions.first; convert; convert = convert->next)
4624 {
4625 if(convert->memberAccess == 1 || _class->module == privateModule)
4626 {
4627 if(!convert->dataType)
4628 convert->dataType = ProcessTypeString(convert->dataTypeString, 0x0);
4629 if(convert->dataType != dest && MatchTypes(source, convert->dataType, conversions, (((void *)0)), (((void *)0)), 0x1, 0x0, 0x0, 0x1))
4630 {
4631 if(!conversions && !convert->Set)
4632 return 0x1;
4633 else if(conversions != (((void *)0)))
4634 {
4635 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))
4636 return 0x1;
4637 else
4638 {
4639 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv);
4640
4641 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(conversions, conv);
4642 return 0x1;
4643 }
4644 }
4645 }
4646 }
4647 }
4648 }
4649 if(enumBaseType && dest->_class && dest->_class->registered && dest->_class->registered->type == 4)
4650 {
4651 if(!dest->_class->registered->dataType)
4652 dest->_class->registered->dataType = ProcessTypeString(dest->_class->registered->dataTypeString, 0x0);
4653 if(dest->_class->registered->dataType->kind == 8 || source->truth || dest->truth)
4654 {
4655 if(MatchTypes(source, dest->_class->registered->dataType, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
4656 {
4657 return 0x1;
4658 }
4659 }
4660 }
4661 }
4662 if(source->kind == 8)
4663 {
4664 struct __ecereNameSpace__ecere__com__Class * _class;
4665
4666 for(_class = source->_class ? source->_class->registered : (((void *)0)); _class; _class = _class->base)
4667 {
4668 struct __ecereNameSpace__ecere__com__Property * convert;
4669
4670 for(convert = _class->conversions.first; convert; convert = convert->next)
4671 {
4672 if(convert->memberAccess == 1 || _class->module == privateModule)
4673 {
4674 struct Conversion * after = (conversions != (((void *)0))) ? conversions->last : (((void *)0));
4675
4676 if(!convert->dataType)
4677 convert->dataType = ProcessTypeString(convert->dataTypeString, 0x0);
4678 if(convert->dataType != source && MatchTypes(convert->dataType, dest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x1))
4679 {
4680 if(!conversions && !convert->Get)
4681 return 0x1;
4682 else if(conversions != (((void *)0)))
4683 {
4684 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))
4685 return 0x1;
4686 else
4687 {
4688 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv->isGet = 0x1, conv);
4689
4690 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(conversions, after, conv);
4691 return 0x1;
4692 }
4693 }
4694 }
4695 }
4696 }
4697 }
4698 if(enumBaseType && source->_class && source->_class->registered && source->_class->registered->type == 4)
4699 {
4700 if(!source->_class->registered->dataType)
4701 source->_class->registered->dataType = ProcessTypeString(source->_class->registered->dataTypeString, 0x0);
4702 if(MatchTypes(source->_class->registered->dataType, dest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
4703 {
4704 return 0x1;
4705 }
4706 }
4707 }
4708 }
4709 if(source->kind == 8 || source->kind == 19)
4710 ;
4711 else if(dest->kind == source->kind && (dest->kind != 9 && dest->kind != 10 && dest->kind != 11 && dest->kind != 12 && dest->kind != 13 && dest->kind != 16))
4712 return 0x1;
4713 else if(dest->kind == 7 && source->kind == 6)
4714 return 0x1;
4715 else if(dest->kind == 2 && source->kind == 1)
4716 return 0x1;
4717 else if(dest->kind == 3 && (source->kind == 2 || source->kind == 1))
4718 return 0x1;
4719 else if(dest->kind == 4 && (source->kind == 2 || source->kind == 1 || source->kind == 3))
4720 return 0x1;
4721 else if(dest->kind == 22 && (source->kind == 2 || source->kind == 1 || source->kind == 3))
4722 return 0x1;
4723 else if(source->kind == 15 && (dest->kind == 3 || dest->kind == 2 || dest->kind == 1 || dest->kind == 5 || dest->kind == 4 || dest->kind == 22))
4724 return 0x1;
4725 else if(dest->kind == 15 && (source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 5 || source->kind == 4 || source->kind == 22))
4726 return 0x1;
4727 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)))
4728 {
4729 struct Type * paramSource, * paramDest;
4730
4731 if(dest->kind == 16)
4732 owningClassDest = dest->methodClass ? dest->methodClass : dest->method->_class;
4733 if(source->kind == 16)
4734 owningClassSource = source->methodClass ? source->methodClass : source->method->_class;
4735 if(dest->kind == 13 && dest->type->kind == 11)
4736 dest = dest->type;
4737 if(source->kind == 13 && source->type->kind == 11)
4738 source = source->type;
4739 if(dest->kind == 16)
4740 dest = dest->method->dataType;
4741 if(source->kind == 16)
4742 source = source->method->dataType;
4743 paramSource = source->params.first;
4744 if(paramSource && paramSource->kind == 0)
4745 paramSource = (((void *)0));
4746 paramDest = dest->params.first;
4747 if(paramDest && paramDest->kind == 0)
4748 paramDest = (((void *)0));
4749 if((dest->staticMethod || (!dest->thisClass && !owningClassDest)) && !(source->staticMethod || (!source->thisClass && !owningClassSource)))
4750 {
4751 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))))
4752 {
4753 if(paramDest && paramDest->kind == 8)
4754 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "method class must be derived from %s\n", (((void *)0))), paramDest->_class->string);
4755 else
4756 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "method class should not take an object\n", (((void *)0))));
4757 return 0x0;
4758 }
4759 paramDest = paramDest->next;
4760 }
4761 else if(!dest->staticMethod && (dest->thisClass || owningClassDest))
4762 {
4763 if((source->staticMethod || (!source->thisClass && !owningClassSource)))
4764 {
4765 if(dest->thisClass)
4766 {
4767 if(!paramSource || paramSource->kind != 8 || !__ecereNameSpace__ecere__com__eClass_IsDerived(paramSource->_class->registered, dest->thisClass->registered))
4768 {
4769 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "method class must be derived from %s\n", (((void *)0))), dest->thisClass->string);
4770 return 0x0;
4771 }
4772 }
4773 else
4774 {
4775 if(!paramSource || paramSource->kind != 8 || (owningClassDest && !__ecereNameSpace__ecere__com__eClass_IsDerived(paramSource->_class->registered, owningClassDest)))
4776 {
4777 if(owningClassDest)
4778 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "%s expected to be derived from method class\n", (((void *)0))), owningClassDest->fullName);
4779 else
4780 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "overriding class expected to be derived from method class\n", (((void *)0))));
4781 return 0x0;
4782 }
4783 }
4784 paramSource = paramSource->next;
4785 }
4786 else
4787 {
4788 if(dest->thisClass)
4789 {
4790 if(!__ecereNameSpace__ecere__com__eClass_IsDerived(source->thisClass ? source->thisClass->registered : owningClassSource, dest->thisClass->registered))
4791 {
4792 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "method class must be derived from %s\n", (((void *)0))), dest->thisClass->string);
4793 return 0x0;
4794 }
4795 }
4796 else
4797 {
4798 if(source->thisClass && source->thisClass->registered && owningClassDest && !__ecereNameSpace__ecere__com__eClass_IsDerived(source->thisClass->registered, owningClassDest))
4799 {
4800 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "%s expected to be derived from method class\n", (((void *)0))), source->thisClass->registered->fullName);
4801 return 0x0;
4802 }
4803 }
4804 }
4805 }
4806 if(!MatchTypes(source->returnType, dest->returnType, (((void *)0)), (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
4807 {
4808 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible return type for function\n", (((void *)0))));
4809 return 0x0;
4810 }
4811 for(; paramDest; paramDest = paramDest->next)
4812 {
4813 if(!paramSource)
4814 {
4815 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "not enough parameters\n", (((void *)0))));
4816 return 0x0;
4817 }
4818 {
4819 struct Type * paramDestType = paramDest;
4820 struct Type * paramSourceType = paramSource;
4821 struct Type * type = paramDestType;
4822
4823 if(paramDest->kind == 20 && paramDest->templateParameter->type == 0 && owningClassSource && paramSource->kind != 20)
4824 {
4825 int id = 0;
4826 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
4827 struct __ecereNameSpace__ecere__com__Class * sClass;
4828
4829 for(sClass = owningClassSource; sClass; sClass = sClass->base)
4830 {
4831 id = 0;
4832 if(sClass->templateClass)
4833 sClass = sClass->templateClass;
4834 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
4835 {
4836 if(curParam->type == 0 && !strcmp(type->templateParameter->identifier->string, curParam->name))
4837 {
4838 for(sClass = sClass->base; sClass; sClass = sClass->base)
4839 {
4840 if(sClass->templateClass)
4841 sClass = sClass->templateClass;
4842 id += sClass->templateParams.count;
4843 }
4844 break;
4845 }
4846 id++;
4847 }
4848 if(curParam)
4849 break;
4850 }
4851 if(curParam)
4852 {
4853 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = owningClassSource->templateArgs[id];
4854
4855 paramDestType = type = ProcessTypeString(arg.dataTypeString, 0x0);
4856 }
4857 }
4858 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)))
4859 {
4860 char type[1024];
4861
4862 type[0] = (char)0;
4863 PrintType(paramDest, type, 0x0, 0x1);
4864 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible parameter %s (expected %s)\n", (((void *)0))), paramSource->name, type);
4865 if(paramDestType != paramDest)
4866 FreeType(paramDestType);
4867 return 0x0;
4868 }
4869 if(paramDestType != paramDest)
4870 FreeType(paramDestType);
4871 }
4872 paramSource = paramSource->next;
4873 }
4874 if(paramSource)
4875 {
4876 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "too many parameters\n", (((void *)0))));
4877 return 0x0;
4878 }
4879 return 0x1;
4880 }
4881 else if((dest->kind == 11 || (dest->kind == 13 && dest->type->kind == 11) || dest->kind == 16) && (source->kind == 13 && source->type->kind == 0))
4882 {
4883 return 0x1;
4884 }
4885 else if((dest->kind == 13 || dest->kind == 12) && (source->kind == 12 || source->kind == 13))
4886 {
4887 if(MatchTypes(source->type, dest->type, (((void *)0)), (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
4888 return 0x1;
4889 }
4890 }
4891 return 0x0;
4892 }
4893
4894 static void FreeConvert(struct Conversion * convert)
4895 {
4896 if(convert->resultType)
4897 FreeType(convert->resultType);
4898 }
4899
4900 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__BTNamedLink;
4901
4902 struct __ecereNameSpace__ecere__com__BTNamedLink
4903 {
4904 char *  name;
4905 struct __ecereNameSpace__ecere__com__BTNamedLink * parent;
4906 struct __ecereNameSpace__ecere__com__BTNamedLink * left;
4907 struct __ecereNameSpace__ecere__com__BTNamedLink * right;
4908 int depth;
4909 void *  data;
4910 } __attribute__ ((gcc_struct));
4911
4912 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__EnumClassData;
4913
4914 struct __ecereNameSpace__ecere__com__EnumClassData
4915 {
4916 struct __ecereNameSpace__ecere__sys__OldList values;
4917 int largest;
4918 } __attribute__ ((gcc_struct));
4919
4920 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__NamedLink;
4921
4922 struct __ecereNameSpace__ecere__sys__NamedLink
4923 {
4924 struct __ecereNameSpace__ecere__sys__NamedLink * prev;
4925 struct __ecereNameSpace__ecere__sys__NamedLink * next;
4926 char *  name;
4927 void *  data;
4928 } __attribute__ ((gcc_struct));
4929
4930 extern void FreeExpContents(struct Expression * exp);
4931
4932 struct __ecereNameSpace__ecere__sys__BTNode * __ecereProp___ecereNameSpace__ecere__sys__BinaryTree_Get_first(struct __ecereNameSpace__ecere__sys__BinaryTree * this);
4933
4934 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp___ecereNameSpace__ecere__sys__BinaryTree_first;
4935
4936 struct __ecereNameSpace__ecere__sys__BTNode * __ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_next(struct __ecereNameSpace__ecere__sys__BTNode * this);
4937
4938 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp___ecereNameSpace__ecere__sys__BTNode_next;
4939
4940 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(struct __ecereNameSpace__ecere__sys__OldList * this, void (*  freeFn)(void * ));
4941
4942 unsigned int MatchWithEnums_NameSpace(struct __ecereNameSpace__ecere__com__NameSpace * nameSpace, struct Expression * sourceExp, struct Type * dest, char * string, struct __ecereNameSpace__ecere__sys__OldList * conversions)
4943 {
4944 struct __ecereNameSpace__ecere__com__BTNamedLink * link;
4945
4946 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)))
4947 {
4948 struct __ecereNameSpace__ecere__com__Class * _class = link->data;
4949
4950 if(_class->type == 4)
4951 {
4952 struct __ecereNameSpace__ecere__sys__OldList converts = 
4953 {
4954 0, 0, 0, 0, 0
4955 };
4956 struct Type * type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
4957
4958 type->kind = 8;
4959 if(!_class->symbol)
4960 _class->symbol = FindClass(_class->fullName);
4961 type->_class = _class->symbol;
4962 if(MatchTypes(type, dest, &converts, (((void *)0)), (((void *)0)), 0x1, 0x0, 0x0, 0x0))
4963 {
4964 struct __ecereNameSpace__ecere__sys__NamedLink * value;
4965 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
4966
4967 if(enumClass)
4968 {
4969 struct __ecereNameSpace__ecere__com__Class * baseClass;
4970
4971 for(baseClass = _class; baseClass && baseClass->type == 4; baseClass = baseClass->base)
4972 {
4973 struct __ecereNameSpace__ecere__com__EnumClassData * e = (baseClass ? ((void *)(((char *)baseClass->data) + enumClass->offsetClass)) : (((void *)0)));
4974
4975 for(value = e->values.first; value; value = value->next)
4976 {
4977 if(!strcmp(value->name, string))
4978 break;
4979 }
4980 if(value)
4981 {
4982 FreeExpContents(sourceExp);
4983 FreeType(sourceExp->expType);
4984 sourceExp->isConstant = 0x1;
4985 sourceExp->expType = MkClassType(baseClass->fullName);
4986 {
4987 char constant[256];
4988
4989 sourceExp->type = 2;
4990 if(!strcmp(baseClass->dataTypeString, "int"))
4991 sprintf(constant, "%d", value->data);
4992 else
4993 sprintf(constant, "0x%X", value->data);
4994 sourceExp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
4995 }
4996 while(converts.first)
4997 {
4998 struct Conversion * convert = converts.first;
4999
5000 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(&converts, convert);
5001 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(conversions, convert);
5002 }
5003 ((type ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(type) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(type)) : 0), type = 0);
5004 return 0x1;
5005 }
5006 }
5007 }
5008 }
5009 if(converts.first)
5010 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(&converts, FreeConvert);
5011 ((type ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(type) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(type)) : 0), type = 0);
5012 }
5013 }
5014 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)))
5015 if(MatchWithEnums_NameSpace(nameSpace, sourceExp, dest, string, conversions))
5016 return 0x1;
5017 return 0x0;
5018 }
5019
5020 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__SubModule;
5021
5022 struct __ecereNameSpace__ecere__com__SubModule
5023 {
5024 struct __ecereNameSpace__ecere__com__SubModule * prev;
5025 struct __ecereNameSpace__ecere__com__SubModule * next;
5026 struct __ecereNameSpace__ecere__com__Instance * module;
5027 int importMode;
5028 } __attribute__ ((gcc_struct));
5029
5030 unsigned int ModuleVisibility(struct __ecereNameSpace__ecere__com__Instance * searchIn, struct __ecereNameSpace__ecere__com__Instance * searchFor)
5031 {
5032 struct __ecereNameSpace__ecere__com__SubModule * subModule;
5033
5034 if(searchFor == searchIn)
5035 return 0x1;
5036 for(subModule = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)searchIn + 12)))->modules.first; subModule; subModule = subModule->next)
5037 {
5038 if(subModule->importMode == 1 || searchIn == ((struct __ecereNameSpace__ecere__com__Module *)(((char *)searchIn + 12)))->application)
5039 {
5040 if(ModuleVisibility(subModule->module, searchFor))
5041 return 0x1;
5042 }
5043 }
5044 return 0x0;
5045 }
5046
5047 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Application;
5048
5049 struct __ecereNameSpace__ecere__com__Application
5050 {
5051 int argc;
5052 char * *  argv;
5053 int exitCode;
5054 unsigned int isGUIApp;
5055 struct __ecereNameSpace__ecere__sys__OldList allModules;
5056 char *  parsedCommand;
5057 struct __ecereNameSpace__ecere__com__NameSpace systemNameSpace;
5058 } __attribute__ ((gcc_struct));
5059
5060 unsigned int MatchWithEnums_Module(struct __ecereNameSpace__ecere__com__Instance * mainModule, struct Expression * sourceExp, struct Type * dest, char * string, struct __ecereNameSpace__ecere__sys__OldList * conversions)
5061 {
5062 struct __ecereNameSpace__ecere__com__Instance * module;
5063
5064 if(MatchWithEnums_NameSpace(&((struct __ecereNameSpace__ecere__com__Application *)(((char *)((struct __ecereNameSpace__ecere__com__Module *)(((char *)mainModule + 12)))->application + 300)))->systemNameSpace, sourceExp, dest, string, conversions))
5065 return 0x1;
5066 if(MatchWithEnums_NameSpace(&((struct __ecereNameSpace__ecere__com__Module *)(((char *)((struct __ecereNameSpace__ecere__com__Module *)(((char *)mainModule + 12)))->application + 12)))->privateNameSpace, sourceExp, dest, string, conversions))
5067 return 0x1;
5068 if(MatchWithEnums_NameSpace(&((struct __ecereNameSpace__ecere__com__Module *)(((char *)((struct __ecereNameSpace__ecere__com__Module *)(((char *)mainModule + 12)))->application + 12)))->publicNameSpace, sourceExp, dest, string, conversions))
5069 return 0x1;
5070 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)
5071 {
5072 if(ModuleVisibility(mainModule, module) && MatchWithEnums_NameSpace(&((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + 12)))->publicNameSpace, sourceExp, dest, string, conversions))
5073 return 0x1;
5074 }
5075 return 0x0;
5076 }
5077
5078 extern unsigned long strtoul(const char *  nptr, char * *  endptr, int base);
5079
5080 void ReadString(char *  output, char *  string);
5081
5082 extern struct Specifier * MkEnum(struct Identifier * id, struct __ecereNameSpace__ecere__sys__OldList * list);
5083
5084 extern struct TypeName * QMkClass(char *  spec, struct Declarator * decl);
5085
5086 extern struct Expression * MkExpBrackets(struct __ecereNameSpace__ecere__sys__OldList * expressions);
5087
5088 unsigned int MatchTypeExpression(struct Expression * sourceExp, struct Type * dest, struct __ecereNameSpace__ecere__sys__OldList * conversions, unsigned int skipUnitBla)
5089 {
5090 void * __ecereTemp1;
5091 struct Type * source = sourceExp->expType;
5092 struct Type * realDest = dest;
5093
5094 if(dest->kind == 13 && sourceExp->type == 2 && !strtoul(sourceExp->constant, (((void *)0)), 0))
5095 return 0x1;
5096 if(!skipUnitBla && source && dest && source->kind == 8 && dest->kind == 8)
5097 {
5098 if(source->_class && source->_class->registered && source->_class->registered->type == 3)
5099 {
5100 struct __ecereNameSpace__ecere__com__Class * sourceBase, * destBase;
5101
5102 for(sourceBase = source->_class->registered; sourceBase && sourceBase->base && sourceBase->base->type != 1000; sourceBase = sourceBase->base)
5103 ;
5104 for(destBase = dest->_class->registered; destBase && destBase->base && destBase->base->type != 1000; destBase = destBase->base)
5105 ;
5106 if(sourceBase == destBase)
5107 return 0x1;
5108 }
5109 }
5110 if(source)
5111 {
5112 struct __ecereNameSpace__ecere__sys__OldList * specs;
5113 unsigned int flag = 0x0;
5114 long long value = (((int)0x7fffffff));
5115
5116 source->refCount++;
5117 dest->refCount++;
5118 if(sourceExp->type == 2)
5119 {
5120 if(source->isSigned)
5121 value = strtoll(sourceExp->constant, (((void *)0)), 0);
5122 else
5123 value = strtoull(sourceExp->constant, (((void *)0)), 0);
5124 }
5125 else if(sourceExp->type == 4 && sourceExp->op.op == '-' && !sourceExp->op.exp1 && sourceExp->op.exp2 && sourceExp->op.exp2->type == 2)
5126 {
5127 if(source->isSigned)
5128 value = -strtoll(sourceExp->op.exp2->constant, (((void *)0)), 0);
5129 else
5130 value = -strtoull(sourceExp->op.exp2->constant, (((void *)0)), 0);
5131 }
5132 if(dest->kind != 8 && source->kind == 8 && source->_class && source->_class->registered && !strcmp(source->_class->registered->fullName, "ecere::com::unichar"))
5133 {
5134 FreeType(source);
5135 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));
5136 }
5137 if(dest->kind == 8)
5138 {
5139 struct __ecereNameSpace__ecere__com__Class * _class = dest->_class ? dest->_class->registered : (((void *)0));
5140
5141 if(_class && _class->type == 3)
5142 {
5143 if(source->kind != 8)
5144 {
5145 struct Type * tempType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5146 struct Type * tempDest, * tempSource;
5147
5148 for(; _class->base->type != 1000; _class = _class->base)
5149 ;
5150 tempSource = dest;
5151 tempDest = tempType;
5152 tempType->kind = 8;
5153 if(!_class->symbol)
5154 _class->symbol = FindClass(_class->fullName);
5155 tempType->_class = _class->symbol;
5156 tempType->truth = dest->truth;
5157 if(tempType->_class)
5158 MatchTypes(tempSource, tempDest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0);
5159 FreeType(sourceExp->expType);
5160 sourceExp->expType = dest;
5161 dest->refCount++;
5162 flag = 0x1;
5163 ((tempType ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(tempType) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(tempType)) : 0), tempType = 0);
5164 }
5165 }
5166 if(_class && _class->type == 2 && source->kind != 8)
5167 {
5168 if(!dest->_class->registered->dataType)
5169 dest->_class->registered->dataType = ProcessTypeString(dest->_class->registered->dataTypeString, 0x0);
5170 if(MatchTypes(source, dest->_class->registered->dataType, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
5171 {
5172 FreeType(source);
5173 FreeType(sourceExp->expType);
5174 source = sourceExp->expType = MkClassType(dest->_class->string);
5175 source->refCount++;
5176 }
5177 }
5178 if(_class && !strcmp(_class->fullName, "ecere::com::Class") && source->kind == 13 && source->type && source->type->kind == 1 && sourceExp->type == 3)
5179 {
5180 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
5181 struct Declarator * decl;
5182 char string[1024];
5183
5184 ReadString(string, sourceExp->string);
5185 decl = SpecDeclFromString(string, specs, (((void *)0)));
5186 FreeExpContents(sourceExp);
5187 FreeType(sourceExp->expType);
5188 sourceExp->type = 26;
5189 sourceExp->_classExp.specifiers = specs;
5190 sourceExp->_classExp.decl = decl;
5191 sourceExp->expType = dest;
5192 dest->refCount++;
5193 FreeType(source);
5194 FreeType(dest);
5195 return 0x1;
5196 }
5197 }
5198 else if(source->kind == 8)
5199 {
5200 struct __ecereNameSpace__ecere__com__Class * _class = source->_class ? source->_class->registered : (((void *)0));
5201
5202 if(_class && (_class->type == 3 || !strcmp(_class->fullName, "bool") || _class->type == 2))
5203 {
5204 if(dest->kind != 8)
5205 {
5206 struct Type * tempType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5207 struct Type * tempDest, * tempSource;
5208
5209 if(!source->_class->registered->dataType)
5210 source->_class->registered->dataType = ProcessTypeString(source->_class->registered->dataTypeString, 0x0);
5211 for(; _class->base->type != 1000; _class = _class->base)
5212 ;
5213 tempDest = source;
5214 tempSource = tempType;
5215 tempType->kind = 8;
5216 tempType->_class = FindClass(_class->fullName);
5217 tempType->truth = source->truth;
5218 tempType->classObjectType = source->classObjectType;
5219 if(tempType->_class)
5220 MatchTypes(tempSource, tempDest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0);
5221 if(conversions->last)
5222 {
5223 ((struct Conversion *)conversions->last)->resultType = dest;
5224 dest->refCount++;
5225 }
5226 FreeType(sourceExp->expType);
5227 sourceExp->expType = MkClassType(_class->fullName);
5228 sourceExp->expType->truth = source->truth;
5229 sourceExp->expType->classObjectType = source->classObjectType;
5230 if(!sourceExp->destType)
5231 {
5232 FreeType(sourceExp->destType);
5233 sourceExp->destType = sourceExp->expType;
5234 if(sourceExp->expType)
5235 sourceExp->expType->refCount++;
5236 }
5237 if(!_class->dataType)
5238 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
5239 FreeType(dest);
5240 dest = MkClassType(source->_class->string);
5241 dest->truth = source->truth;
5242 dest->classObjectType = source->classObjectType;
5243 FreeType(source);
5244 source = _class->dataType;
5245 source->refCount++;
5246 ((tempType ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(tempType) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(tempType)) : 0), tempType = 0);
5247 }
5248 }
5249 }
5250 if(!flag)
5251 {
5252 if(MatchTypes(source, dest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
5253 {
5254 FreeType(source);
5255 FreeType(dest);
5256 return 0x1;
5257 }
5258 }
5259 if(dest->kind == 8)
5260 {
5261 struct __ecereNameSpace__ecere__com__Class * _class = dest->_class ? dest->_class->registered : (((void *)0));
5262
5263 if(_class && !dest->truth && (_class->type == 3 || !strcmp(_class->fullName, "bool") || (_class->type != 1 && !value && source->kind == 3) || _class->type == 2))
5264 {
5265 if(_class->type == 0 || _class->type == 5)
5266 {
5267 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
5268
5269 *newExp = *sourceExp;
5270 if(sourceExp->destType)
5271 sourceExp->destType->refCount++;
5272 if(sourceExp->expType)
5273 sourceExp->expType->refCount++;
5274 sourceExp->type = 11;
5275 sourceExp->cast.typeName = MkTypeName(MkListOne(MkSpecifier(VOID)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0))));
5276 sourceExp->cast.exp = newExp;
5277 FreeType(sourceExp->expType);
5278 sourceExp->expType = (((void *)0));
5279 ProcessExpressionType(sourceExp);
5280 if(!inCompiler)
5281 {
5282 FreeType(sourceExp->expType);
5283 sourceExp->expType = dest;
5284 }
5285 FreeType(source);
5286 if(inCompiler)
5287 FreeType(dest);
5288 return 0x1;
5289 }
5290 if(!_class->dataType)
5291 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
5292 FreeType(dest);
5293 dest = _class->dataType;
5294 dest->refCount++;
5295 }
5296 if(dest->kind == 7 && (source->kind == 7 || source->kind == 6 || dest->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 1))
5297 {
5298 specs = MkListOne(MkSpecifier(DOUBLE));
5299 }
5300 else if(dest->kind == 6 && (source->kind == 6 || dest->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 7))
5301 {
5302 specs = MkListOne(MkSpecifier(FLOAT));
5303 }
5304 else if(dest->kind == 4 && (source->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 6 || source->kind == 7))
5305 {
5306 specs = MkList();
5307 if(!dest->isSigned)
5308 ListAdd(specs, MkSpecifier(UNSIGNED));
5309 ListAdd(specs, MkSpecifier(INT64));
5310 }
5311 else if(dest->kind == 3 && (source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 6 || source->kind == 7))
5312 {
5313 specs = MkList();
5314 if(!dest->isSigned)
5315 ListAdd(specs, MkSpecifier(UNSIGNED));
5316 ListAdd(specs, MkSpecifier(INT));
5317 }
5318 else if(dest->kind == 2 && (source->kind == 2 || source->kind == 1 || source->kind == 3 || source->kind == 6 || source->kind == 7))
5319 {
5320 specs = MkList();
5321 if(!dest->isSigned)
5322 ListAdd(specs, MkSpecifier(UNSIGNED));
5323 ListAdd(specs, MkSpecifier(SHORT));
5324 }
5325 else if(dest->kind == 1 && (source->kind == 1 || source->kind == 2 || source->kind == 3 || source->kind == 6 || source->kind == 7))
5326 {
5327 specs = MkList();
5328 if(!dest->isSigned)
5329 ListAdd(specs, MkSpecifier(UNSIGNED));
5330 ListAdd(specs, MkSpecifier(CHAR));
5331 }
5332 else
5333 {
5334 FreeType(source);
5335 FreeType(dest);
5336 return 0x0;
5337 }
5338 }
5339 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))
5340 {
5341 specs = MkListOne(MkSpecifier(DOUBLE));
5342 }
5343 else if(dest->kind == 6 && (source->kind == 6 || source->kind == 15 || source->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 1))
5344 {
5345 specs = MkListOne(MkSpecifier(FLOAT));
5346 }
5347 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)))
5348 {
5349 specs = MkList();
5350 if(!dest->isSigned)
5351 ListAdd(specs, MkSpecifier(UNSIGNED));
5352 ListAdd(specs, MkSpecifier(CHAR));
5353 }
5354 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)))))
5355 {
5356 specs = MkList();
5357 if(!dest->isSigned)
5358 ListAdd(specs, MkSpecifier(UNSIGNED));
5359 ListAdd(specs, MkSpecifier(SHORT));
5360 }
5361 else if(dest->kind == 3 && (source->kind == 15 || source->kind == 2 || source->kind == 1 || source->kind == 3))
5362 {
5363 specs = MkList();
5364 if(!dest->isSigned)
5365 ListAdd(specs, MkSpecifier(UNSIGNED));
5366 ListAdd(specs, MkSpecifier(INT));
5367 }
5368 else if(dest->kind == 4 && (source->kind == 15 || source->kind == 2 || source->kind == 1 || source->kind == 3 || source->kind == 4))
5369 {
5370 specs = MkList();
5371 if(!dest->isSigned)
5372 ListAdd(specs, MkSpecifier(UNSIGNED));
5373 ListAdd(specs, MkSpecifier(INT64));
5374 }
5375 else if(dest->kind == 15 && (source->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 1))
5376 {
5377 specs = MkListOne(MkEnum(MkIdentifier(dest->enumName), (((void *)0))));
5378 }
5379 else
5380 {
5381 FreeType(source);
5382 FreeType(dest);
5383 return 0x0;
5384 }
5385 if(!flag)
5386 {
5387 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
5388
5389 *newExp = *sourceExp;
5390 newExp->prev = (((void *)0));
5391 newExp->next = (((void *)0));
5392 if(sourceExp->destType)
5393 sourceExp->destType->refCount++;
5394 if(sourceExp->expType)
5395 sourceExp->expType->refCount++;
5396 sourceExp->type = 11;
5397 if(realDest->kind == 8)
5398 {
5399 sourceExp->cast.typeName = QMkClass(realDest->_class->string, (((void *)0)));
5400 FreeList(specs, FreeSpecifier);
5401 }
5402 else
5403 sourceExp->cast.typeName = MkTypeName(specs, (((void *)0)));
5404 if(newExp->type == 4)
5405 {
5406 sourceExp->cast.exp = MkExpBrackets(MkListOne(newExp));
5407 }
5408 else
5409 sourceExp->cast.exp = newExp;
5410 FreeType(sourceExp->expType);
5411 sourceExp->expType = (((void *)0));
5412 ProcessExpressionType(sourceExp);
5413 }
5414 else
5415 FreeList(specs, FreeSpecifier);
5416 FreeType(dest);
5417 FreeType(source);
5418 return 0x1;
5419 }
5420 else
5421 {
5422 while((sourceExp->type == 5 || sourceExp->type == 34) && sourceExp->list)
5423 sourceExp = (*sourceExp->list).last;
5424 if(sourceExp->type == 0)
5425 {
5426 struct Identifier * id = sourceExp->identifier;
5427
5428 if(dest->kind == 8)
5429 {
5430 if(dest->_class && dest->_class->registered && dest->_class->registered->type == 4)
5431 {
5432 struct __ecereNameSpace__ecere__com__Class * _class = dest->_class->registered;
5433 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
5434
5435 if(enumClass)
5436 {
5437 for(; _class && _class->type == 4; _class = _class->base)
5438 {
5439 struct __ecereNameSpace__ecere__sys__NamedLink * value;
5440 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
5441
5442 for(value = e->values.first; value; value = value->next)
5443 {
5444 if(!strcmp(value->name, id->string))
5445 break;
5446 }
5447 if(value)
5448 {
5449 FreeExpContents(sourceExp);
5450 FreeType(sourceExp->expType);
5451 sourceExp->isConstant = 0x1;
5452 sourceExp->expType = MkClassType(_class->fullName);
5453 {
5454 char constant[256];
5455
5456 sourceExp->type = 2;
5457 if(_class->dataTypeString && !strcmp(_class->dataTypeString, "int"))
5458 sprintf(constant, "%d", value->data);
5459 else
5460 sprintf(constant, "0x%X", value->data);
5461 sourceExp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
5462 }
5463 return 0x1;
5464 }
5465 }
5466 }
5467 }
5468 }
5469 if(dest->classObjectType != 2 && dest->kind == 8 && MatchWithEnums_Module(privateModule, sourceExp, dest, id->string, conversions))
5470 return 0x1;
5471 }
5472 }
5473 return 0x0;
5474 }
5475
5476 static unsigned int IntAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5477 {
5478 int value2 = op2->i;
5479
5480 exp->type = 2;
5481 exp->string = PrintInt(op1->i + value2);
5482 if(!exp->expType)
5483 {
5484 exp->expType = op1->type;
5485 if(op1->type)
5486 op1->type->refCount++;
5487 }
5488 return 0x1;
5489 }
5490
5491 static unsigned int UIntAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5492 {
5493 unsigned int value2 = op2->ui;
5494
5495 exp->type = 2;
5496 exp->string = PrintUInt(op1->ui + value2);
5497 if(!exp->expType)
5498 {
5499 exp->expType = op1->type;
5500 if(op1->type)
5501 op1->type->refCount++;
5502 }
5503 return 0x1;
5504 }
5505
5506 static unsigned int ShortAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5507 {
5508 short value2 = op2->s;
5509
5510 exp->type = 2;
5511 exp->string = PrintShort(op1->s + value2);
5512 if(!exp->expType)
5513 {
5514 exp->expType = op1->type;
5515 if(op1->type)
5516 op1->type->refCount++;
5517 }
5518 return 0x1;
5519 }
5520
5521 static unsigned int UShortAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5522 {
5523 unsigned short value2 = op2->us;
5524
5525 exp->type = 2;
5526 exp->string = PrintUShort(op1->us + value2);
5527 if(!exp->expType)
5528 {
5529 exp->expType = op1->type;
5530 if(op1->type)
5531 op1->type->refCount++;
5532 }
5533 return 0x1;
5534 }
5535
5536 static unsigned int CharAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5537 {
5538 char value2 = op2->c;
5539
5540 exp->type = 2;
5541 exp->string = PrintChar(op1->c + value2);
5542 if(!exp->expType)
5543 {
5544 exp->expType = op1->type;
5545 if(op1->type)
5546 op1->type->refCount++;
5547 }
5548 return 0x1;
5549 }
5550
5551 static unsigned int UCharAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5552 {
5553 unsigned char value2 = op2->uc;
5554
5555 exp->type = 2;
5556 exp->string = PrintUChar(op1->uc + value2);
5557 if(!exp->expType)
5558 {
5559 exp->expType = op1->type;
5560 if(op1->type)
5561 op1->type->refCount++;
5562 }
5563 return 0x1;
5564 }
5565
5566 static unsigned int FloatAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5567 {
5568 float value2 = op2->f;
5569
5570 exp->type = 2;
5571 exp->string = PrintFloat(op1->f + value2);
5572 if(!exp->expType)
5573 {
5574 exp->expType = op1->type;
5575 if(op1->type)
5576 op1->type->refCount++;
5577 }
5578 return 0x1;
5579 }
5580
5581 static unsigned int DoubleAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5582 {
5583 double value2 = op2->d;
5584
5585 exp->type = 2;
5586 exp->string = PrintDouble(op1->d + value2);
5587 if(!exp->expType)
5588 {
5589 exp->expType = op1->type;
5590 if(op1->type)
5591 op1->type->refCount++;
5592 }
5593 return 0x1;
5594 }
5595
5596 static unsigned int IntSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5597 {
5598 int value2 = op2->i;
5599
5600 exp->type = 2;
5601 exp->string = PrintInt(op1->i - value2);
5602 if(!exp->expType)
5603 {
5604 exp->expType = op1->type;
5605 if(op1->type)
5606 op1->type->refCount++;
5607 }
5608 return 0x1;
5609 }
5610
5611 static unsigned int UIntSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5612 {
5613 unsigned int value2 = op2->ui;
5614
5615 exp->type = 2;
5616 exp->string = PrintUInt(op1->ui - value2);
5617 if(!exp->expType)
5618 {
5619 exp->expType = op1->type;
5620 if(op1->type)
5621 op1->type->refCount++;
5622 }
5623 return 0x1;
5624 }
5625
5626 static unsigned int ShortSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5627 {
5628 short value2 = op2->s;
5629
5630 exp->type = 2;
5631 exp->string = PrintShort(op1->s - value2);
5632 if(!exp->expType)
5633 {
5634 exp->expType = op1->type;
5635 if(op1->type)
5636 op1->type->refCount++;
5637 }
5638 return 0x1;
5639 }
5640
5641 static unsigned int UShortSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5642 {
5643 unsigned short value2 = op2->us;
5644
5645 exp->type = 2;
5646 exp->string = PrintUShort(op1->us - value2);
5647 if(!exp->expType)
5648 {
5649 exp->expType = op1->type;
5650 if(op1->type)
5651 op1->type->refCount++;
5652 }
5653 return 0x1;
5654 }
5655
5656 static unsigned int CharSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5657 {
5658 char value2 = op2->c;
5659
5660 exp->type = 2;
5661 exp->string = PrintChar(op1->c - value2);
5662 if(!exp->expType)
5663 {
5664 exp->expType = op1->type;
5665 if(op1->type)
5666 op1->type->refCount++;
5667 }
5668 return 0x1;
5669 }
5670
5671 static unsigned int UCharSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5672 {
5673 unsigned char value2 = op2->uc;
5674
5675 exp->type = 2;
5676 exp->string = PrintUChar(op1->uc - value2);
5677 if(!exp->expType)
5678 {
5679 exp->expType = op1->type;
5680 if(op1->type)
5681 op1->type->refCount++;
5682 }
5683 return 0x1;
5684 }
5685
5686 static unsigned int FloatSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5687 {
5688 float value2 = op2->f;
5689
5690 exp->type = 2;
5691 exp->string = PrintFloat(op1->f - value2);
5692 if(!exp->expType)
5693 {
5694 exp->expType = op1->type;
5695 if(op1->type)
5696 op1->type->refCount++;
5697 }
5698 return 0x1;
5699 }
5700
5701 static unsigned int DoubleSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5702 {
5703 double value2 = op2->d;
5704
5705 exp->type = 2;
5706 exp->string = PrintDouble(op1->d - value2);
5707 if(!exp->expType)
5708 {
5709 exp->expType = op1->type;
5710 if(op1->type)
5711 op1->type->refCount++;
5712 }
5713 return 0x1;
5714 }
5715
5716 static unsigned int IntMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5717 {
5718 int value2 = op2->i;
5719
5720 exp->type = 2;
5721 exp->string = PrintInt(op1->i * value2);
5722 if(!exp->expType)
5723 {
5724 exp->expType = op1->type;
5725 if(op1->type)
5726 op1->type->refCount++;
5727 }
5728 return 0x1;
5729 }
5730
5731 static unsigned int UIntMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5732 {
5733 unsigned int value2 = op2->ui;
5734
5735 exp->type = 2;
5736 exp->string = PrintUInt(op1->ui * value2);
5737 if(!exp->expType)
5738 {
5739 exp->expType = op1->type;
5740 if(op1->type)
5741 op1->type->refCount++;
5742 }
5743 return 0x1;
5744 }
5745
5746 static unsigned int ShortMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5747 {
5748 short value2 = op2->s;
5749
5750 exp->type = 2;
5751 exp->string = PrintShort(op1->s * value2);
5752 if(!exp->expType)
5753 {
5754 exp->expType = op1->type;
5755 if(op1->type)
5756 op1->type->refCount++;
5757 }
5758 return 0x1;
5759 }
5760
5761 static unsigned int UShortMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5762 {
5763 unsigned short value2 = op2->us;
5764
5765 exp->type = 2;
5766 exp->string = PrintUShort(op1->us * value2);
5767 if(!exp->expType)
5768 {
5769 exp->expType = op1->type;
5770 if(op1->type)
5771 op1->type->refCount++;
5772 }
5773 return 0x1;
5774 }
5775
5776 static unsigned int CharMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5777 {
5778 char value2 = op2->c;
5779
5780 exp->type = 2;
5781 exp->string = PrintChar(op1->c * value2);
5782 if(!exp->expType)
5783 {
5784 exp->expType = op1->type;
5785 if(op1->type)
5786 op1->type->refCount++;
5787 }
5788 return 0x1;
5789 }
5790
5791 static unsigned int UCharMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5792 {
5793 unsigned char value2 = op2->uc;
5794
5795 exp->type = 2;
5796 exp->string = PrintUChar(op1->uc * value2);
5797 if(!exp->expType)
5798 {
5799 exp->expType = op1->type;
5800 if(op1->type)
5801 op1->type->refCount++;
5802 }
5803 return 0x1;
5804 }
5805
5806 static unsigned int FloatMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5807 {
5808 float value2 = op2->f;
5809
5810 exp->type = 2;
5811 exp->string = PrintFloat(op1->f * value2);
5812 if(!exp->expType)
5813 {
5814 exp->expType = op1->type;
5815 if(op1->type)
5816 op1->type->refCount++;
5817 }
5818 return 0x1;
5819 }
5820
5821 static unsigned int DoubleMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5822 {
5823 double value2 = op2->d;
5824
5825 exp->type = 2;
5826 exp->string = PrintDouble(op1->d * value2);
5827 if(!exp->expType)
5828 {
5829 exp->expType = op1->type;
5830 if(op1->type)
5831 op1->type->refCount++;
5832 }
5833 return 0x1;
5834 }
5835
5836 static unsigned int IntDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5837 {
5838 int value2 = op2->i;
5839
5840 exp->type = 2;
5841 exp->string = PrintInt(value2 ? (op1->i / value2) : 0);
5842 if(!exp->expType)
5843 {
5844 exp->expType = op1->type;
5845 if(op1->type)
5846 op1->type->refCount++;
5847 }
5848 return 0x1;
5849 }
5850
5851 static unsigned int UIntDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5852 {
5853 unsigned int value2 = op2->ui;
5854
5855 exp->type = 2;
5856 exp->string = PrintUInt(value2 ? (op1->ui / value2) : 0);
5857 if(!exp->expType)
5858 {
5859 exp->expType = op1->type;
5860 if(op1->type)
5861 op1->type->refCount++;
5862 }
5863 return 0x1;
5864 }
5865
5866 static unsigned int ShortDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5867 {
5868 short value2 = op2->s;
5869
5870 exp->type = 2;
5871 exp->string = PrintShort(value2 ? (op1->s / value2) : (short)0);
5872 if(!exp->expType)
5873 {
5874 exp->expType = op1->type;
5875 if(op1->type)
5876 op1->type->refCount++;
5877 }
5878 return 0x1;
5879 }
5880
5881 static unsigned int UShortDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5882 {
5883 unsigned short value2 = op2->us;
5884
5885 exp->type = 2;
5886 exp->string = PrintUShort(value2 ? (op1->us / value2) : (unsigned short)0);
5887 if(!exp->expType)
5888 {
5889 exp->expType = op1->type;
5890 if(op1->type)
5891 op1->type->refCount++;
5892 }
5893 return 0x1;
5894 }
5895
5896 static unsigned int CharDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5897 {
5898 char value2 = op2->c;
5899
5900 exp->type = 2;
5901 exp->string = PrintChar(value2 ? (op1->c / value2) : (char)0);
5902 if(!exp->expType)
5903 {
5904 exp->expType = op1->type;
5905 if(op1->type)
5906 op1->type->refCount++;
5907 }
5908 return 0x1;
5909 }
5910
5911 static unsigned int UCharDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5912 {
5913 unsigned char value2 = op2->uc;
5914
5915 exp->type = 2;
5916 exp->string = PrintUChar(value2 ? (op1->uc / value2) : (unsigned char)0);
5917 if(!exp->expType)
5918 {
5919 exp->expType = op1->type;
5920 if(op1->type)
5921 op1->type->refCount++;
5922 }
5923 return 0x1;
5924 }
5925
5926 static unsigned int FloatDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5927 {
5928 float value2 = op2->f;
5929
5930 exp->type = 2;
5931 exp->string = PrintFloat(value2 ? (op1->f / value2) : (float)0);
5932 if(!exp->expType)
5933 {
5934 exp->expType = op1->type;
5935 if(op1->type)
5936 op1->type->refCount++;
5937 }
5938 return 0x1;
5939 }
5940
5941 static unsigned int DoubleDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5942 {
5943 double value2 = op2->d;
5944
5945 exp->type = 2;
5946 exp->string = PrintDouble(value2 ? (op1->d / value2) : (double)0);
5947 if(!exp->expType)
5948 {
5949 exp->expType = op1->type;
5950 if(op1->type)
5951 op1->type->refCount++;
5952 }
5953 return 0x1;
5954 }
5955
5956 static unsigned int IntMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5957 {
5958 int value2 = op2->i;
5959
5960 exp->type = 2;
5961 exp->string = PrintInt(value2 ? (op1->i % value2) : 0);
5962 if(!exp->expType)
5963 {
5964 exp->expType = op1->type;
5965 if(op1->type)
5966 op1->type->refCount++;
5967 }
5968 return 0x1;
5969 }
5970
5971 static unsigned int UIntMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5972 {
5973 unsigned int value2 = op2->ui;
5974
5975 exp->type = 2;
5976 exp->string = PrintUInt(value2 ? (op1->ui % value2) : 0);
5977 if(!exp->expType)
5978 {
5979 exp->expType = op1->type;
5980 if(op1->type)
5981 op1->type->refCount++;
5982 }
5983 return 0x1;
5984 }
5985
5986 static unsigned int ShortMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5987 {
5988 short value2 = op2->s;
5989
5990 exp->type = 2;
5991 exp->string = PrintShort(value2 ? (op1->s % value2) : (short)0);
5992 if(!exp->expType)
5993 {
5994 exp->expType = op1->type;
5995 if(op1->type)
5996 op1->type->refCount++;
5997 }
5998 return 0x1;
5999 }
6000
6001 static unsigned int UShortMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6002 {
6003 unsigned short value2 = op2->us;
6004
6005 exp->type = 2;
6006 exp->string = PrintUShort(value2 ? (op1->us % value2) : (unsigned short)0);
6007 if(!exp->expType)
6008 {
6009 exp->expType = op1->type;
6010 if(op1->type)
6011 op1->type->refCount++;
6012 }
6013 return 0x1;
6014 }
6015
6016 static unsigned int CharMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6017 {
6018 char value2 = op2->c;
6019
6020 exp->type = 2;
6021 exp->string = PrintChar(value2 ? (op1->c % value2) : (char)0);
6022 if(!exp->expType)
6023 {
6024 exp->expType = op1->type;
6025 if(op1->type)
6026 op1->type->refCount++;
6027 }
6028 return 0x1;
6029 }
6030
6031 static unsigned int UCharMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6032 {
6033 unsigned char value2 = op2->uc;
6034
6035 exp->type = 2;
6036 exp->string = PrintUChar(value2 ? (op1->uc % value2) : (unsigned char)0);
6037 if(!exp->expType)
6038 {
6039 exp->expType = op1->type;
6040 if(op1->type)
6041 op1->type->refCount++;
6042 }
6043 return 0x1;
6044 }
6045
6046 static unsigned int IntNeg(struct Expression * exp, struct Operand * op1)
6047 {
6048 exp->type = 2;
6049 exp->string = PrintInt(-op1->i);
6050 if(!exp->expType)
6051 {
6052 exp->expType = op1->type;
6053 if(op1->type)
6054 op1->type->refCount++;
6055 }
6056 return 0x1;
6057 }
6058
6059 static unsigned int UIntNeg(struct Expression * exp, struct Operand * op1)
6060 {
6061 exp->type = 2;
6062 exp->string = PrintUInt(-op1->ui);
6063 if(!exp->expType)
6064 {
6065 exp->expType = op1->type;
6066 if(op1->type)
6067 op1->type->refCount++;
6068 }
6069 return 0x1;
6070 }
6071
6072 static unsigned int ShortNeg(struct Expression * exp, struct Operand * op1)
6073 {
6074 exp->type = 2;
6075 exp->string = PrintShort(-op1->s);
6076 if(!exp->expType)
6077 {
6078 exp->expType = op1->type;
6079 if(op1->type)
6080 op1->type->refCount++;
6081 }
6082 return 0x1;
6083 }
6084
6085 static unsigned int UShortNeg(struct Expression * exp, struct Operand * op1)
6086 {
6087 exp->type = 2;
6088 exp->string = PrintUShort(-op1->us);
6089 if(!exp->expType)
6090 {
6091 exp->expType = op1->type;
6092 if(op1->type)
6093 op1->type->refCount++;
6094 }
6095 return 0x1;
6096 }
6097
6098 static unsigned int CharNeg(struct Expression * exp, struct Operand * op1)
6099 {
6100 exp->type = 2;
6101 exp->string = PrintChar(-op1->c);
6102 if(!exp->expType)
6103 {
6104 exp->expType = op1->type;
6105 if(op1->type)
6106 op1->type->refCount++;
6107 }
6108 return 0x1;
6109 }
6110
6111 static unsigned int UCharNeg(struct Expression * exp, struct Operand * op1)
6112 {
6113 exp->type = 2;
6114 exp->string = PrintUChar(-op1->uc);
6115 if(!exp->expType)
6116 {
6117 exp->expType = op1->type;
6118 if(op1->type)
6119 op1->type->refCount++;
6120 }
6121 return 0x1;
6122 }
6123
6124 static unsigned int FloatNeg(struct Expression * exp, struct Operand * op1)
6125 {
6126 exp->type = 2;
6127 exp->string = PrintFloat(-op1->f);
6128 if(!exp->expType)
6129 {
6130 exp->expType = op1->type;
6131 if(op1->type)
6132 op1->type->refCount++;
6133 }
6134 return 0x1;
6135 }
6136
6137 static unsigned int DoubleNeg(struct Expression * exp, struct Operand * op1)
6138 {
6139 exp->type = 2;
6140 exp->string = PrintDouble(-op1->d);
6141 if(!exp->expType)
6142 {
6143 exp->expType = op1->type;
6144 if(op1->type)
6145 op1->type->refCount++;
6146 }
6147 return 0x1;
6148 }
6149
6150 static unsigned int IntInc(struct Expression * exp, struct Operand * op1)
6151 {
6152 exp->type = 2;
6153 exp->string = PrintInt(++op1->i);
6154 if(!exp->expType)
6155 {
6156 exp->expType = op1->type;
6157 if(op1->type)
6158 op1->type->refCount++;
6159 }
6160 return 0x1;
6161 }
6162
6163 static unsigned int UIntInc(struct Expression * exp, struct Operand * op1)
6164 {
6165 exp->type = 2;
6166 exp->string = PrintUInt(++op1->ui);
6167 if(!exp->expType)
6168 {
6169 exp->expType = op1->type;
6170 if(op1->type)
6171 op1->type->refCount++;
6172 }
6173 return 0x1;
6174 }
6175
6176 static unsigned int ShortInc(struct Expression * exp, struct Operand * op1)
6177 {
6178 exp->type = 2;
6179 exp->string = PrintShort(++op1->s);
6180 if(!exp->expType)
6181 {
6182 exp->expType = op1->type;
6183 if(op1->type)
6184 op1->type->refCount++;
6185 }
6186 return 0x1;
6187 }
6188
6189 static unsigned int UShortInc(struct Expression * exp, struct Operand * op1)
6190 {
6191 exp->type = 2;
6192 exp->string = PrintUShort(++op1->us);
6193 if(!exp->expType)
6194 {
6195 exp->expType = op1->type;
6196 if(op1->type)
6197 op1->type->refCount++;
6198 }
6199 return 0x1;
6200 }
6201
6202 static unsigned int CharInc(struct Expression * exp, struct Operand * op1)
6203 {
6204 exp->type = 2;
6205 exp->string = PrintChar(++op1->c);
6206 if(!exp->expType)
6207 {
6208 exp->expType = op1->type;
6209 if(op1->type)
6210 op1->type->refCount++;
6211 }
6212 return 0x1;
6213 }
6214
6215 static unsigned int UCharInc(struct Expression * exp, struct Operand * op1)
6216 {
6217 exp->type = 2;
6218 exp->string = PrintUChar(++op1->uc);
6219 if(!exp->expType)
6220 {
6221 exp->expType = op1->type;
6222 if(op1->type)
6223 op1->type->refCount++;
6224 }
6225 return 0x1;
6226 }
6227
6228 static unsigned int FloatInc(struct Expression * exp, struct Operand * op1)
6229 {
6230 exp->type = 2;
6231 exp->string = PrintFloat(++op1->f);
6232 if(!exp->expType)
6233 {
6234 exp->expType = op1->type;
6235 if(op1->type)
6236 op1->type->refCount++;
6237 }
6238 return 0x1;
6239 }
6240
6241 static unsigned int DoubleInc(struct Expression * exp, struct Operand * op1)
6242 {
6243 exp->type = 2;
6244 exp->string = PrintDouble(++op1->d);
6245 if(!exp->expType)
6246 {
6247 exp->expType = op1->type;
6248 if(op1->type)
6249 op1->type->refCount++;
6250 }
6251 return 0x1;
6252 }
6253
6254 static unsigned int IntDec(struct Expression * exp, struct Operand * op1)
6255 {
6256 exp->type = 2;
6257 exp->string = PrintInt(--op1->i);
6258 if(!exp->expType)
6259 {
6260 exp->expType = op1->type;
6261 if(op1->type)
6262 op1->type->refCount++;
6263 }
6264 return 0x1;
6265 }
6266
6267 static unsigned int UIntDec(struct Expression * exp, struct Operand * op1)
6268 {
6269 exp->type = 2;
6270 exp->string = PrintUInt(--op1->ui);
6271 if(!exp->expType)
6272 {
6273 exp->expType = op1->type;
6274 if(op1->type)
6275 op1->type->refCount++;
6276 }
6277 return 0x1;
6278 }
6279
6280 static unsigned int ShortDec(struct Expression * exp, struct Operand * op1)
6281 {
6282 exp->type = 2;
6283 exp->string = PrintShort(--op1->s);
6284 if(!exp->expType)
6285 {
6286 exp->expType = op1->type;
6287 if(op1->type)
6288 op1->type->refCount++;
6289 }
6290 return 0x1;
6291 }
6292
6293 static unsigned int UShortDec(struct Expression * exp, struct Operand * op1)
6294 {
6295 exp->type = 2;
6296 exp->string = PrintUShort(--op1->us);
6297 if(!exp->expType)
6298 {
6299 exp->expType = op1->type;
6300 if(op1->type)
6301 op1->type->refCount++;
6302 }
6303 return 0x1;
6304 }
6305
6306 static unsigned int CharDec(struct Expression * exp, struct Operand * op1)
6307 {
6308 exp->type = 2;
6309 exp->string = PrintChar(--op1->c);
6310 if(!exp->expType)
6311 {
6312 exp->expType = op1->type;
6313 if(op1->type)
6314 op1->type->refCount++;
6315 }
6316 return 0x1;
6317 }
6318
6319 static unsigned int UCharDec(struct Expression * exp, struct Operand * op1)
6320 {
6321 exp->type = 2;
6322 exp->string = PrintUChar(--op1->uc);
6323 if(!exp->expType)
6324 {
6325 exp->expType = op1->type;
6326 if(op1->type)
6327 op1->type->refCount++;
6328 }
6329 return 0x1;
6330 }
6331
6332 static unsigned int FloatDec(struct Expression * exp, struct Operand * op1)
6333 {
6334 exp->type = 2;
6335 exp->string = PrintFloat(--op1->f);
6336 if(!exp->expType)
6337 {
6338 exp->expType = op1->type;
6339 if(op1->type)
6340 op1->type->refCount++;
6341 }
6342 return 0x1;
6343 }
6344
6345 static unsigned int DoubleDec(struct Expression * exp, struct Operand * op1)
6346 {
6347 exp->type = 2;
6348 exp->string = PrintDouble(--op1->d);
6349 if(!exp->expType)
6350 {
6351 exp->expType = op1->type;
6352 if(op1->type)
6353 op1->type->refCount++;
6354 }
6355 return 0x1;
6356 }
6357
6358 static unsigned int IntAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6359 {
6360 int value2 = op2->i;
6361
6362 exp->type = 2;
6363 exp->string = PrintInt(op1->i = value2);
6364 if(!exp->expType)
6365 {
6366 exp->expType = op1->type;
6367 if(op1->type)
6368 op1->type->refCount++;
6369 }
6370 return 0x1;
6371 }
6372
6373 static unsigned int UIntAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6374 {
6375 unsigned int value2 = op2->ui;
6376
6377 exp->type = 2;
6378 exp->string = PrintUInt(op1->ui = value2);
6379 if(!exp->expType)
6380 {
6381 exp->expType = op1->type;
6382 if(op1->type)
6383 op1->type->refCount++;
6384 }
6385 return 0x1;
6386 }
6387
6388 static unsigned int ShortAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6389 {
6390 short value2 = op2->s;
6391
6392 exp->type = 2;
6393 exp->string = PrintShort(op1->s = value2);
6394 if(!exp->expType)
6395 {
6396 exp->expType = op1->type;
6397 if(op1->type)
6398 op1->type->refCount++;
6399 }
6400 return 0x1;
6401 }
6402
6403 static unsigned int UShortAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6404 {
6405 unsigned short value2 = op2->us;
6406
6407 exp->type = 2;
6408 exp->string = PrintUShort(op1->us = value2);
6409 if(!exp->expType)
6410 {
6411 exp->expType = op1->type;
6412 if(op1->type)
6413 op1->type->refCount++;
6414 }
6415 return 0x1;
6416 }
6417
6418 static unsigned int CharAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6419 {
6420 char value2 = op2->c;
6421
6422 exp->type = 2;
6423 exp->string = PrintChar(op1->c = value2);
6424 if(!exp->expType)
6425 {
6426 exp->expType = op1->type;
6427 if(op1->type)
6428 op1->type->refCount++;
6429 }
6430 return 0x1;
6431 }
6432
6433 static unsigned int UCharAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6434 {
6435 unsigned char value2 = op2->uc;
6436
6437 exp->type = 2;
6438 exp->string = PrintUChar(op1->uc = value2);
6439 if(!exp->expType)
6440 {
6441 exp->expType = op1->type;
6442 if(op1->type)
6443 op1->type->refCount++;
6444 }
6445 return 0x1;
6446 }
6447
6448 static unsigned int FloatAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6449 {
6450 float value2 = op2->f;
6451
6452 exp->type = 2;
6453 exp->string = PrintFloat(op1->f = value2);
6454 if(!exp->expType)
6455 {
6456 exp->expType = op1->type;
6457 if(op1->type)
6458 op1->type->refCount++;
6459 }
6460 return 0x1;
6461 }
6462
6463 static unsigned int DoubleAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6464 {
6465 double value2 = op2->d;
6466
6467 exp->type = 2;
6468 exp->string = PrintDouble(op1->d = value2);
6469 if(!exp->expType)
6470 {
6471 exp->expType = op1->type;
6472 if(op1->type)
6473 op1->type->refCount++;
6474 }
6475 return 0x1;
6476 }
6477
6478 static unsigned int IntAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6479 {
6480 int value2 = op2->i;
6481
6482 exp->type = 2;
6483 exp->string = PrintInt(op1->i += value2);
6484 if(!exp->expType)
6485 {
6486 exp->expType = op1->type;
6487 if(op1->type)
6488 op1->type->refCount++;
6489 }
6490 return 0x1;
6491 }
6492
6493 static unsigned int UIntAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6494 {
6495 unsigned int value2 = op2->ui;
6496
6497 exp->type = 2;
6498 exp->string = PrintUInt(op1->ui += value2);
6499 if(!exp->expType)
6500 {
6501 exp->expType = op1->type;
6502 if(op1->type)
6503 op1->type->refCount++;
6504 }
6505 return 0x1;
6506 }
6507
6508 static unsigned int ShortAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6509 {
6510 short value2 = op2->s;
6511
6512 exp->type = 2;
6513 exp->string = PrintShort(op1->s += value2);
6514 if(!exp->expType)
6515 {
6516 exp->expType = op1->type;
6517 if(op1->type)
6518 op1->type->refCount++;
6519 }
6520 return 0x1;
6521 }
6522
6523 static unsigned int UShortAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6524 {
6525 unsigned short value2 = op2->us;
6526
6527 exp->type = 2;
6528 exp->string = PrintUShort(op1->us += value2);
6529 if(!exp->expType)
6530 {
6531 exp->expType = op1->type;
6532 if(op1->type)
6533 op1->type->refCount++;
6534 }
6535 return 0x1;
6536 }
6537
6538 static unsigned int CharAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6539 {
6540 char value2 = op2->c;
6541
6542 exp->type = 2;
6543 exp->string = PrintChar(op1->c += value2);
6544 if(!exp->expType)
6545 {
6546 exp->expType = op1->type;
6547 if(op1->type)
6548 op1->type->refCount++;
6549 }
6550 return 0x1;
6551 }
6552
6553 static unsigned int UCharAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6554 {
6555 unsigned char value2 = op2->uc;
6556
6557 exp->type = 2;
6558 exp->string = PrintUChar(op1->uc += value2);
6559 if(!exp->expType)
6560 {
6561 exp->expType = op1->type;
6562 if(op1->type)
6563 op1->type->refCount++;
6564 }
6565 return 0x1;
6566 }
6567
6568 static unsigned int FloatAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6569 {
6570 float value2 = op2->f;
6571
6572 exp->type = 2;
6573 exp->string = PrintFloat(op1->f += value2);
6574 if(!exp->expType)
6575 {
6576 exp->expType = op1->type;
6577 if(op1->type)
6578 op1->type->refCount++;
6579 }
6580 return 0x1;
6581 }
6582
6583 static unsigned int DoubleAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6584 {
6585 double value2 = op2->d;
6586
6587 exp->type = 2;
6588 exp->string = PrintDouble(op1->d += value2);
6589 if(!exp->expType)
6590 {
6591 exp->expType = op1->type;
6592 if(op1->type)
6593 op1->type->refCount++;
6594 }
6595 return 0x1;
6596 }
6597
6598 static unsigned int IntSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6599 {
6600 int value2 = op2->i;
6601
6602 exp->type = 2;
6603 exp->string = PrintInt(op1->i -= value2);
6604 if(!exp->expType)
6605 {
6606 exp->expType = op1->type;
6607 if(op1->type)
6608 op1->type->refCount++;
6609 }
6610 return 0x1;
6611 }
6612
6613 static unsigned int UIntSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6614 {
6615 unsigned int value2 = op2->ui;
6616
6617 exp->type = 2;
6618 exp->string = PrintUInt(op1->ui -= value2);
6619 if(!exp->expType)
6620 {
6621 exp->expType = op1->type;
6622 if(op1->type)
6623 op1->type->refCount++;
6624 }
6625 return 0x1;
6626 }
6627
6628 static unsigned int ShortSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6629 {
6630 short value2 = op2->s;
6631
6632 exp->type = 2;
6633 exp->string = PrintShort(op1->s -= value2);
6634 if(!exp->expType)
6635 {
6636 exp->expType = op1->type;
6637 if(op1->type)
6638 op1->type->refCount++;
6639 }
6640 return 0x1;
6641 }
6642
6643 static unsigned int UShortSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6644 {
6645 unsigned short value2 = op2->us;
6646
6647 exp->type = 2;
6648 exp->string = PrintUShort(op1->us -= value2);
6649 if(!exp->expType)
6650 {
6651 exp->expType = op1->type;
6652 if(op1->type)
6653 op1->type->refCount++;
6654 }
6655 return 0x1;
6656 }
6657
6658 static unsigned int CharSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6659 {
6660 char value2 = op2->c;
6661
6662 exp->type = 2;
6663 exp->string = PrintChar(op1->c -= value2);
6664 if(!exp->expType)
6665 {
6666 exp->expType = op1->type;
6667 if(op1->type)
6668 op1->type->refCount++;
6669 }
6670 return 0x1;
6671 }
6672
6673 static unsigned int UCharSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6674 {
6675 unsigned char value2 = op2->uc;
6676
6677 exp->type = 2;
6678 exp->string = PrintUChar(op1->uc -= value2);
6679 if(!exp->expType)
6680 {
6681 exp->expType = op1->type;
6682 if(op1->type)
6683 op1->type->refCount++;
6684 }
6685 return 0x1;
6686 }
6687
6688 static unsigned int FloatSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6689 {
6690 float value2 = op2->f;
6691
6692 exp->type = 2;
6693 exp->string = PrintFloat(op1->f -= value2);
6694 if(!exp->expType)
6695 {
6696 exp->expType = op1->type;
6697 if(op1->type)
6698 op1->type->refCount++;
6699 }
6700 return 0x1;
6701 }
6702
6703 static unsigned int DoubleSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6704 {
6705 double value2 = op2->d;
6706
6707 exp->type = 2;
6708 exp->string = PrintDouble(op1->d -= value2);
6709 if(!exp->expType)
6710 {
6711 exp->expType = op1->type;
6712 if(op1->type)
6713 op1->type->refCount++;
6714 }
6715 return 0x1;
6716 }
6717
6718 static unsigned int IntMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6719 {
6720 int value2 = op2->i;
6721
6722 exp->type = 2;
6723 exp->string = PrintInt(op1->i *= value2);
6724 if(!exp->expType)
6725 {
6726 exp->expType = op1->type;
6727 if(op1->type)
6728 op1->type->refCount++;
6729 }
6730 return 0x1;
6731 }
6732
6733 static unsigned int UIntMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6734 {
6735 unsigned int value2 = op2->ui;
6736
6737 exp->type = 2;
6738 exp->string = PrintUInt(op1->ui *= value2);
6739 if(!exp->expType)
6740 {
6741 exp->expType = op1->type;
6742 if(op1->type)
6743 op1->type->refCount++;
6744 }
6745 return 0x1;
6746 }
6747
6748 static unsigned int ShortMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6749 {
6750 short value2 = op2->s;
6751
6752 exp->type = 2;
6753 exp->string = PrintShort(op1->s *= value2);
6754 if(!exp->expType)
6755 {
6756 exp->expType = op1->type;
6757 if(op1->type)
6758 op1->type->refCount++;
6759 }
6760 return 0x1;
6761 }
6762
6763 static unsigned int UShortMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6764 {
6765 unsigned short value2 = op2->us;
6766
6767 exp->type = 2;
6768 exp->string = PrintUShort(op1->us *= value2);
6769 if(!exp->expType)
6770 {
6771 exp->expType = op1->type;
6772 if(op1->type)
6773 op1->type->refCount++;
6774 }
6775 return 0x1;
6776 }
6777
6778 static unsigned int CharMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6779 {
6780 char value2 = op2->c;
6781
6782 exp->type = 2;
6783 exp->string = PrintChar(op1->c *= value2);
6784 if(!exp->expType)
6785 {
6786 exp->expType = op1->type;
6787 if(op1->type)
6788 op1->type->refCount++;
6789 }
6790 return 0x1;
6791 }
6792
6793 static unsigned int UCharMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6794 {
6795 unsigned char value2 = op2->uc;
6796
6797 exp->type = 2;
6798 exp->string = PrintUChar(op1->uc *= value2);
6799 if(!exp->expType)
6800 {
6801 exp->expType = op1->type;
6802 if(op1->type)
6803 op1->type->refCount++;
6804 }
6805 return 0x1;
6806 }
6807
6808 static unsigned int FloatMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6809 {
6810 float value2 = op2->f;
6811
6812 exp->type = 2;
6813 exp->string = PrintFloat(op1->f *= value2);
6814 if(!exp->expType)
6815 {
6816 exp->expType = op1->type;
6817 if(op1->type)
6818 op1->type->refCount++;
6819 }
6820 return 0x1;
6821 }
6822
6823 static unsigned int DoubleMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6824 {
6825 double value2 = op2->d;
6826
6827 exp->type = 2;
6828 exp->string = PrintDouble(op1->d *= value2);
6829 if(!exp->expType)
6830 {
6831 exp->expType = op1->type;
6832 if(op1->type)
6833 op1->type->refCount++;
6834 }
6835 return 0x1;
6836 }
6837
6838 static unsigned int IntDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6839 {
6840 int value2 = op2->i;
6841
6842 exp->type = 2;
6843 exp->string = PrintInt(value2 ? (op1->i /= value2) : 0);
6844 if(!exp->expType)
6845 {
6846 exp->expType = op1->type;
6847 if(op1->type)
6848 op1->type->refCount++;
6849 }
6850 return 0x1;
6851 }
6852
6853 static unsigned int UIntDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6854 {
6855 unsigned int value2 = op2->ui;
6856
6857 exp->type = 2;
6858 exp->string = PrintUInt(value2 ? (op1->ui /= value2) : 0);
6859 if(!exp->expType)
6860 {
6861 exp->expType = op1->type;
6862 if(op1->type)
6863 op1->type->refCount++;
6864 }
6865 return 0x1;
6866 }
6867
6868 static unsigned int ShortDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6869 {
6870 short value2 = op2->s;
6871
6872 exp->type = 2;
6873 exp->string = PrintShort(value2 ? (op1->s /= value2) : (short)0);
6874 if(!exp->expType)
6875 {
6876 exp->expType = op1->type;
6877 if(op1->type)
6878 op1->type->refCount++;
6879 }
6880 return 0x1;
6881 }
6882
6883 static unsigned int UShortDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6884 {
6885 unsigned short value2 = op2->us;
6886
6887 exp->type = 2;
6888 exp->string = PrintUShort(value2 ? (op1->us /= value2) : (unsigned short)0);
6889 if(!exp->expType)
6890 {
6891 exp->expType = op1->type;
6892 if(op1->type)
6893 op1->type->refCount++;
6894 }
6895 return 0x1;
6896 }
6897
6898 static unsigned int CharDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6899 {
6900 char value2 = op2->c;
6901
6902 exp->type = 2;
6903 exp->string = PrintChar(value2 ? (op1->c /= value2) : (char)0);
6904 if(!exp->expType)
6905 {
6906 exp->expType = op1->type;
6907 if(op1->type)
6908 op1->type->refCount++;
6909 }
6910 return 0x1;
6911 }
6912
6913 static unsigned int UCharDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6914 {
6915 unsigned char value2 = op2->uc;
6916
6917 exp->type = 2;
6918 exp->string = PrintUChar(value2 ? (op1->uc /= value2) : (unsigned char)0);
6919 if(!exp->expType)
6920 {
6921 exp->expType = op1->type;
6922 if(op1->type)
6923 op1->type->refCount++;
6924 }
6925 return 0x1;
6926 }
6927
6928 static unsigned int FloatDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6929 {
6930 float value2 = op2->f;
6931
6932 exp->type = 2;
6933 exp->string = PrintFloat(value2 ? (op1->f /= value2) : (float)0);
6934 if(!exp->expType)
6935 {
6936 exp->expType = op1->type;
6937 if(op1->type)
6938 op1->type->refCount++;
6939 }
6940 return 0x1;
6941 }
6942
6943 static unsigned int DoubleDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6944 {
6945 double value2 = op2->d;
6946
6947 exp->type = 2;
6948 exp->string = PrintDouble(value2 ? (op1->d /= value2) : (double)0);
6949 if(!exp->expType)
6950 {
6951 exp->expType = op1->type;
6952 if(op1->type)
6953 op1->type->refCount++;
6954 }
6955 return 0x1;
6956 }
6957
6958 static unsigned int IntModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6959 {
6960 int value2 = op2->i;
6961
6962 exp->type = 2;
6963 exp->string = PrintInt(value2 ? (op1->i %= value2) : 0);
6964 if(!exp->expType)
6965 {
6966 exp->expType = op1->type;
6967 if(op1->type)
6968 op1->type->refCount++;
6969 }
6970 return 0x1;
6971 }
6972
6973 static unsigned int UIntModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6974 {
6975 unsigned int value2 = op2->ui;
6976
6977 exp->type = 2;
6978 exp->string = PrintUInt(value2 ? (op1->ui %= value2) : 0);
6979 if(!exp->expType)
6980 {
6981 exp->expType = op1->type;
6982 if(op1->type)
6983 op1->type->refCount++;
6984 }
6985 return 0x1;
6986 }
6987
6988 static unsigned int ShortModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6989 {
6990 short value2 = op2->s;
6991
6992 exp->type = 2;
6993 exp->string = PrintShort(value2 ? (op1->s %= value2) : (short)0);
6994 if(!exp->expType)
6995 {
6996 exp->expType = op1->type;
6997 if(op1->type)
6998 op1->type->refCount++;
6999 }
7000 return 0x1;
7001 }
7002
7003 static unsigned int UShortModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7004 {
7005 unsigned short value2 = op2->us;
7006
7007 exp->type = 2;
7008 exp->string = PrintUShort(value2 ? (op1->us %= value2) : (unsigned short)0);
7009 if(!exp->expType)
7010 {
7011 exp->expType = op1->type;
7012 if(op1->type)
7013 op1->type->refCount++;
7014 }
7015 return 0x1;
7016 }
7017
7018 static unsigned int CharModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7019 {
7020 char value2 = op2->c;
7021
7022 exp->type = 2;
7023 exp->string = PrintChar(value2 ? (op1->c %= value2) : (char)0);
7024 if(!exp->expType)
7025 {
7026 exp->expType = op1->type;
7027 if(op1->type)
7028 op1->type->refCount++;
7029 }
7030 return 0x1;
7031 }
7032
7033 static unsigned int UCharModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7034 {
7035 unsigned char value2 = op2->uc;
7036
7037 exp->type = 2;
7038 exp->string = PrintUChar(value2 ? (op1->uc %= value2) : (unsigned char)0);
7039 if(!exp->expType)
7040 {
7041 exp->expType = op1->type;
7042 if(op1->type)
7043 op1->type->refCount++;
7044 }
7045 return 0x1;
7046 }
7047
7048 static unsigned int IntBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7049 {
7050 int value2 = op2->i;
7051
7052 exp->type = 2;
7053 exp->string = PrintInt(op1->i & value2);
7054 if(!exp->expType)
7055 {
7056 exp->expType = op1->type;
7057 if(op1->type)
7058 op1->type->refCount++;
7059 }
7060 return 0x1;
7061 }
7062
7063 static unsigned int UIntBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7064 {
7065 unsigned int value2 = op2->ui;
7066
7067 exp->type = 2;
7068 exp->string = PrintUInt(op1->ui & value2);
7069 if(!exp->expType)
7070 {
7071 exp->expType = op1->type;
7072 if(op1->type)
7073 op1->type->refCount++;
7074 }
7075 return 0x1;
7076 }
7077
7078 static unsigned int ShortBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7079 {
7080 short value2 = op2->s;
7081
7082 exp->type = 2;
7083 exp->string = PrintShort(op1->s & value2);
7084 if(!exp->expType)
7085 {
7086 exp->expType = op1->type;
7087 if(op1->type)
7088 op1->type->refCount++;
7089 }
7090 return 0x1;
7091 }
7092
7093 static unsigned int UShortBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7094 {
7095 unsigned short value2 = op2->us;
7096
7097 exp->type = 2;
7098 exp->string = PrintUShort(op1->us & value2);
7099 if(!exp->expType)
7100 {
7101 exp->expType = op1->type;
7102 if(op1->type)
7103 op1->type->refCount++;
7104 }
7105 return 0x1;
7106 }
7107
7108 static unsigned int CharBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7109 {
7110 char value2 = op2->c;
7111
7112 exp->type = 2;
7113 exp->string = PrintChar(op1->c & value2);
7114 if(!exp->expType)
7115 {
7116 exp->expType = op1->type;
7117 if(op1->type)
7118 op1->type->refCount++;
7119 }
7120 return 0x1;
7121 }
7122
7123 static unsigned int UCharBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7124 {
7125 unsigned char value2 = op2->uc;
7126
7127 exp->type = 2;
7128 exp->string = PrintUChar(op1->uc & value2);
7129 if(!exp->expType)
7130 {
7131 exp->expType = op1->type;
7132 if(op1->type)
7133 op1->type->refCount++;
7134 }
7135 return 0x1;
7136 }
7137
7138 static unsigned int IntBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7139 {
7140 int value2 = op2->i;
7141
7142 exp->type = 2;
7143 exp->string = PrintInt(op1->i | value2);
7144 if(!exp->expType)
7145 {
7146 exp->expType = op1->type;
7147 if(op1->type)
7148 op1->type->refCount++;
7149 }
7150 return 0x1;
7151 }
7152
7153 static unsigned int UIntBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7154 {
7155 unsigned int value2 = op2->ui;
7156
7157 exp->type = 2;
7158 exp->string = PrintUInt(op1->ui | value2);
7159 if(!exp->expType)
7160 {
7161 exp->expType = op1->type;
7162 if(op1->type)
7163 op1->type->refCount++;
7164 }
7165 return 0x1;
7166 }
7167
7168 static unsigned int ShortBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7169 {
7170 short value2 = op2->s;
7171
7172 exp->type = 2;
7173 exp->string = PrintShort(op1->s | value2);
7174 if(!exp->expType)
7175 {
7176 exp->expType = op1->type;
7177 if(op1->type)
7178 op1->type->refCount++;
7179 }
7180 return 0x1;
7181 }
7182
7183 static unsigned int UShortBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7184 {
7185 unsigned short value2 = op2->us;
7186
7187 exp->type = 2;
7188 exp->string = PrintUShort(op1->us | value2);
7189 if(!exp->expType)
7190 {
7191 exp->expType = op1->type;
7192 if(op1->type)
7193 op1->type->refCount++;
7194 }
7195 return 0x1;
7196 }
7197
7198 static unsigned int CharBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7199 {
7200 char value2 = op2->c;
7201
7202 exp->type = 2;
7203 exp->string = PrintChar(op1->c | value2);
7204 if(!exp->expType)
7205 {
7206 exp->expType = op1->type;
7207 if(op1->type)
7208 op1->type->refCount++;
7209 }
7210 return 0x1;
7211 }
7212
7213 static unsigned int UCharBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7214 {
7215 unsigned char value2 = op2->uc;
7216
7217 exp->type = 2;
7218 exp->string = PrintUChar(op1->uc | value2);
7219 if(!exp->expType)
7220 {
7221 exp->expType = op1->type;
7222 if(op1->type)
7223 op1->type->refCount++;
7224 }
7225 return 0x1;
7226 }
7227
7228 static unsigned int IntBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7229 {
7230 int value2 = op2->i;
7231
7232 exp->type = 2;
7233 exp->string = PrintInt(op1->i ^ value2);
7234 if(!exp->expType)
7235 {
7236 exp->expType = op1->type;
7237 if(op1->type)
7238 op1->type->refCount++;
7239 }
7240 return 0x1;
7241 }
7242
7243 static unsigned int UIntBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7244 {
7245 unsigned int value2 = op2->ui;
7246
7247 exp->type = 2;
7248 exp->string = PrintUInt(op1->ui ^ value2);
7249 if(!exp->expType)
7250 {
7251 exp->expType = op1->type;
7252 if(op1->type)
7253 op1->type->refCount++;
7254 }
7255 return 0x1;
7256 }
7257
7258 static unsigned int ShortBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7259 {
7260 short value2 = op2->s;
7261
7262 exp->type = 2;
7263 exp->string = PrintShort(op1->s ^ value2);
7264 if(!exp->expType)
7265 {
7266 exp->expType = op1->type;
7267 if(op1->type)
7268 op1->type->refCount++;
7269 }
7270 return 0x1;
7271 }
7272
7273 static unsigned int UShortBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7274 {
7275 unsigned short value2 = op2->us;
7276
7277 exp->type = 2;
7278 exp->string = PrintUShort(op1->us ^ value2);
7279 if(!exp->expType)
7280 {
7281 exp->expType = op1->type;
7282 if(op1->type)
7283 op1->type->refCount++;
7284 }
7285 return 0x1;
7286 }
7287
7288 static unsigned int CharBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7289 {
7290 char value2 = op2->c;
7291
7292 exp->type = 2;
7293 exp->string = PrintChar(op1->c ^ value2);
7294 if(!exp->expType)
7295 {
7296 exp->expType = op1->type;
7297 if(op1->type)
7298 op1->type->refCount++;
7299 }
7300 return 0x1;
7301 }
7302
7303 static unsigned int UCharBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7304 {
7305 unsigned char value2 = op2->uc;
7306
7307 exp->type = 2;
7308 exp->string = PrintUChar(op1->uc ^ value2);
7309 if(!exp->expType)
7310 {
7311 exp->expType = op1->type;
7312 if(op1->type)
7313 op1->type->refCount++;
7314 }
7315 return 0x1;
7316 }
7317
7318 static unsigned int IntLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7319 {
7320 int value2 = op2->i;
7321
7322 exp->type = 2;
7323 exp->string = PrintInt(op1->i << value2);
7324 if(!exp->expType)
7325 {
7326 exp->expType = op1->type;
7327 if(op1->type)
7328 op1->type->refCount++;
7329 }
7330 return 0x1;
7331 }
7332
7333 static unsigned int UIntLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7334 {
7335 unsigned int value2 = op2->ui;
7336
7337 exp->type = 2;
7338 exp->string = PrintUInt(op1->ui << value2);
7339 if(!exp->expType)
7340 {
7341 exp->expType = op1->type;
7342 if(op1->type)
7343 op1->type->refCount++;
7344 }
7345 return 0x1;
7346 }
7347
7348 static unsigned int ShortLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7349 {
7350 short value2 = op2->s;
7351
7352 exp->type = 2;
7353 exp->string = PrintShort(op1->s << value2);
7354 if(!exp->expType)
7355 {
7356 exp->expType = op1->type;
7357 if(op1->type)
7358 op1->type->refCount++;
7359 }
7360 return 0x1;
7361 }
7362
7363 static unsigned int UShortLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7364 {
7365 unsigned short value2 = op2->us;
7366
7367 exp->type = 2;
7368 exp->string = PrintUShort(op1->us << value2);
7369 if(!exp->expType)
7370 {
7371 exp->expType = op1->type;
7372 if(op1->type)
7373 op1->type->refCount++;
7374 }
7375 return 0x1;
7376 }
7377
7378 static unsigned int CharLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7379 {
7380 char value2 = op2->c;
7381
7382 exp->type = 2;
7383 exp->string = PrintChar(op1->c << value2);
7384 if(!exp->expType)
7385 {
7386 exp->expType = op1->type;
7387 if(op1->type)
7388 op1->type->refCount++;
7389 }
7390 return 0x1;
7391 }
7392
7393 static unsigned int UCharLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7394 {
7395 unsigned char value2 = op2->uc;
7396
7397 exp->type = 2;
7398 exp->string = PrintUChar(op1->uc << value2);
7399 if(!exp->expType)
7400 {
7401 exp->expType = op1->type;
7402 if(op1->type)
7403 op1->type->refCount++;
7404 }
7405 return 0x1;
7406 }
7407
7408 static unsigned int IntRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7409 {
7410 int value2 = op2->i;
7411
7412 exp->type = 2;
7413 exp->string = PrintInt(op1->i >> value2);
7414 if(!exp->expType)
7415 {
7416 exp->expType = op1->type;
7417 if(op1->type)
7418 op1->type->refCount++;
7419 }
7420 return 0x1;
7421 }
7422
7423 static unsigned int UIntRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7424 {
7425 unsigned int value2 = op2->ui;
7426
7427 exp->type = 2;
7428 exp->string = PrintUInt(op1->ui >> value2);
7429 if(!exp->expType)
7430 {
7431 exp->expType = op1->type;
7432 if(op1->type)
7433 op1->type->refCount++;
7434 }
7435 return 0x1;
7436 }
7437
7438 static unsigned int ShortRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7439 {
7440 short value2 = op2->s;
7441
7442 exp->type = 2;
7443 exp->string = PrintShort(op1->s >> value2);
7444 if(!exp->expType)
7445 {
7446 exp->expType = op1->type;
7447 if(op1->type)
7448 op1->type->refCount++;
7449 }
7450 return 0x1;
7451 }
7452
7453 static unsigned int UShortRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7454 {
7455 unsigned short value2 = op2->us;
7456
7457 exp->type = 2;
7458 exp->string = PrintUShort(op1->us >> value2);
7459 if(!exp->expType)
7460 {
7461 exp->expType = op1->type;
7462 if(op1->type)
7463 op1->type->refCount++;
7464 }
7465 return 0x1;
7466 }
7467
7468 static unsigned int CharRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7469 {
7470 char value2 = op2->c;
7471
7472 exp->type = 2;
7473 exp->string = PrintChar(op1->c >> value2);
7474 if(!exp->expType)
7475 {
7476 exp->expType = op1->type;
7477 if(op1->type)
7478 op1->type->refCount++;
7479 }
7480 return 0x1;
7481 }
7482
7483 static unsigned int UCharRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7484 {
7485 unsigned char value2 = op2->uc;
7486
7487 exp->type = 2;
7488 exp->string = PrintUChar(op1->uc >> value2);
7489 if(!exp->expType)
7490 {
7491 exp->expType = op1->type;
7492 if(op1->type)
7493 op1->type->refCount++;
7494 }
7495 return 0x1;
7496 }
7497
7498 static unsigned int IntBitNot(struct Expression * exp, struct Operand * op1)
7499 {
7500 exp->type = 2;
7501 exp->string = PrintInt(~op1->i);
7502 if(!exp->expType)
7503 {
7504 exp->expType = op1->type;
7505 if(op1->type)
7506 op1->type->refCount++;
7507 }
7508 return 0x1;
7509 }
7510
7511 static unsigned int UIntBitNot(struct Expression * exp, struct Operand * op1)
7512 {
7513 exp->type = 2;
7514 exp->string = PrintUInt(~op1->ui);
7515 if(!exp->expType)
7516 {
7517 exp->expType = op1->type;
7518 if(op1->type)
7519 op1->type->refCount++;
7520 }
7521 return 0x1;
7522 }
7523
7524 static unsigned int ShortBitNot(struct Expression * exp, struct Operand * op1)
7525 {
7526 exp->type = 2;
7527 exp->string = PrintShort(~op1->s);
7528 if(!exp->expType)
7529 {
7530 exp->expType = op1->type;
7531 if(op1->type)
7532 op1->type->refCount++;
7533 }
7534 return 0x1;
7535 }
7536
7537 static unsigned int UShortBitNot(struct Expression * exp, struct Operand * op1)
7538 {
7539 exp->type = 2;
7540 exp->string = PrintUShort(~op1->us);
7541 if(!exp->expType)
7542 {
7543 exp->expType = op1->type;
7544 if(op1->type)
7545 op1->type->refCount++;
7546 }
7547 return 0x1;
7548 }
7549
7550 static unsigned int CharBitNot(struct Expression * exp, struct Operand * op1)
7551 {
7552 exp->type = 2;
7553 exp->string = PrintChar(~op1->c);
7554 if(!exp->expType)
7555 {
7556 exp->expType = op1->type;
7557 if(op1->type)
7558 op1->type->refCount++;
7559 }
7560 return 0x1;
7561 }
7562
7563 static unsigned int UCharBitNot(struct Expression * exp, struct Operand * op1)
7564 {
7565 exp->type = 2;
7566 exp->string = PrintUChar(~op1->uc);
7567 if(!exp->expType)
7568 {
7569 exp->expType = op1->type;
7570 if(op1->type)
7571 op1->type->refCount++;
7572 }
7573 return 0x1;
7574 }
7575
7576 static unsigned int IntAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7577 {
7578 int value2 = op2->i;
7579
7580 exp->type = 2;
7581 exp->string = PrintInt(op1->i &= value2);
7582 if(!exp->expType)
7583 {
7584 exp->expType = op1->type;
7585 if(op1->type)
7586 op1->type->refCount++;
7587 }
7588 return 0x1;
7589 }
7590
7591 static unsigned int UIntAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7592 {
7593 unsigned int value2 = op2->ui;
7594
7595 exp->type = 2;
7596 exp->string = PrintUInt(op1->ui &= value2);
7597 if(!exp->expType)
7598 {
7599 exp->expType = op1->type;
7600 if(op1->type)
7601 op1->type->refCount++;
7602 }
7603 return 0x1;
7604 }
7605
7606 static unsigned int ShortAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7607 {
7608 short value2 = op2->s;
7609
7610 exp->type = 2;
7611 exp->string = PrintShort(op1->s &= value2);
7612 if(!exp->expType)
7613 {
7614 exp->expType = op1->type;
7615 if(op1->type)
7616 op1->type->refCount++;
7617 }
7618 return 0x1;
7619 }
7620
7621 static unsigned int UShortAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7622 {
7623 unsigned short value2 = op2->us;
7624
7625 exp->type = 2;
7626 exp->string = PrintUShort(op1->us &= value2);
7627 if(!exp->expType)
7628 {
7629 exp->expType = op1->type;
7630 if(op1->type)
7631 op1->type->refCount++;
7632 }
7633 return 0x1;
7634 }
7635
7636 static unsigned int CharAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7637 {
7638 char value2 = op2->c;
7639
7640 exp->type = 2;
7641 exp->string = PrintChar(op1->c &= value2);
7642 if(!exp->expType)
7643 {
7644 exp->expType = op1->type;
7645 if(op1->type)
7646 op1->type->refCount++;
7647 }
7648 return 0x1;
7649 }
7650
7651 static unsigned int UCharAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7652 {
7653 unsigned char value2 = op2->uc;
7654
7655 exp->type = 2;
7656 exp->string = PrintUChar(op1->uc &= value2);
7657 if(!exp->expType)
7658 {
7659 exp->expType = op1->type;
7660 if(op1->type)
7661 op1->type->refCount++;
7662 }
7663 return 0x1;
7664 }
7665
7666 static unsigned int IntOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7667 {
7668 int value2 = op2->i;
7669
7670 exp->type = 2;
7671 exp->string = PrintInt(op1->i |= value2);
7672 if(!exp->expType)
7673 {
7674 exp->expType = op1->type;
7675 if(op1->type)
7676 op1->type->refCount++;
7677 }
7678 return 0x1;
7679 }
7680
7681 static unsigned int UIntOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7682 {
7683 unsigned int value2 = op2->ui;
7684
7685 exp->type = 2;
7686 exp->string = PrintUInt(op1->ui |= value2);
7687 if(!exp->expType)
7688 {
7689 exp->expType = op1->type;
7690 if(op1->type)
7691 op1->type->refCount++;
7692 }
7693 return 0x1;
7694 }
7695
7696 static unsigned int ShortOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7697 {
7698 short value2 = op2->s;
7699
7700 exp->type = 2;
7701 exp->string = PrintShort(op1->s |= value2);
7702 if(!exp->expType)
7703 {
7704 exp->expType = op1->type;
7705 if(op1->type)
7706 op1->type->refCount++;
7707 }
7708 return 0x1;
7709 }
7710
7711 static unsigned int UShortOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7712 {
7713 unsigned short value2 = op2->us;
7714
7715 exp->type = 2;
7716 exp->string = PrintUShort(op1->us |= value2);
7717 if(!exp->expType)
7718 {
7719 exp->expType = op1->type;
7720 if(op1->type)
7721 op1->type->refCount++;
7722 }
7723 return 0x1;
7724 }
7725
7726 static unsigned int CharOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7727 {
7728 char value2 = op2->c;
7729
7730 exp->type = 2;
7731 exp->string = PrintChar(op1->c |= value2);
7732 if(!exp->expType)
7733 {
7734 exp->expType = op1->type;
7735 if(op1->type)
7736 op1->type->refCount++;
7737 }
7738 return 0x1;
7739 }
7740
7741 static unsigned int UCharOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7742 {
7743 unsigned char value2 = op2->uc;
7744
7745 exp->type = 2;
7746 exp->string = PrintUChar(op1->uc |= value2);
7747 if(!exp->expType)
7748 {
7749 exp->expType = op1->type;
7750 if(op1->type)
7751 op1->type->refCount++;
7752 }
7753 return 0x1;
7754 }
7755
7756 static unsigned int IntXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7757 {
7758 int value2 = op2->i;
7759
7760 exp->type = 2;
7761 exp->string = PrintInt(op1->i ^= value2);
7762 if(!exp->expType)
7763 {
7764 exp->expType = op1->type;
7765 if(op1->type)
7766 op1->type->refCount++;
7767 }
7768 return 0x1;
7769 }
7770
7771 static unsigned int UIntXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7772 {
7773 unsigned int value2 = op2->ui;
7774
7775 exp->type = 2;
7776 exp->string = PrintUInt(op1->ui ^= value2);
7777 if(!exp->expType)
7778 {
7779 exp->expType = op1->type;
7780 if(op1->type)
7781 op1->type->refCount++;
7782 }
7783 return 0x1;
7784 }
7785
7786 static unsigned int ShortXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7787 {
7788 short value2 = op2->s;
7789
7790 exp->type = 2;
7791 exp->string = PrintShort(op1->s ^= value2);
7792 if(!exp->expType)
7793 {
7794 exp->expType = op1->type;
7795 if(op1->type)
7796 op1->type->refCount++;
7797 }
7798 return 0x1;
7799 }
7800
7801 static unsigned int UShortXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7802 {
7803 unsigned short value2 = op2->us;
7804
7805 exp->type = 2;
7806 exp->string = PrintUShort(op1->us ^= value2);
7807 if(!exp->expType)
7808 {
7809 exp->expType = op1->type;
7810 if(op1->type)
7811 op1->type->refCount++;
7812 }
7813 return 0x1;
7814 }
7815
7816 static unsigned int CharXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7817 {
7818 char value2 = op2->c;
7819
7820 exp->type = 2;
7821 exp->string = PrintChar(op1->c ^= value2);
7822 if(!exp->expType)
7823 {
7824 exp->expType = op1->type;
7825 if(op1->type)
7826 op1->type->refCount++;
7827 }
7828 return 0x1;
7829 }
7830
7831 static unsigned int UCharXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7832 {
7833 unsigned char value2 = op2->uc;
7834
7835 exp->type = 2;
7836 exp->string = PrintUChar(op1->uc ^= value2);
7837 if(!exp->expType)
7838 {
7839 exp->expType = op1->type;
7840 if(op1->type)
7841 op1->type->refCount++;
7842 }
7843 return 0x1;
7844 }
7845
7846 static unsigned int IntLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7847 {
7848 int value2 = op2->i;
7849
7850 exp->type = 2;
7851 exp->string = PrintInt(op1->i <<= value2);
7852 if(!exp->expType)
7853 {
7854 exp->expType = op1->type;
7855 if(op1->type)
7856 op1->type->refCount++;
7857 }
7858 return 0x1;
7859 }
7860
7861 static unsigned int UIntLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7862 {
7863 unsigned int value2 = op2->ui;
7864
7865 exp->type = 2;
7866 exp->string = PrintUInt(op1->ui <<= value2);
7867 if(!exp->expType)
7868 {
7869 exp->expType = op1->type;
7870 if(op1->type)
7871 op1->type->refCount++;
7872 }
7873 return 0x1;
7874 }
7875
7876 static unsigned int ShortLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7877 {
7878 short value2 = op2->s;
7879
7880 exp->type = 2;
7881 exp->string = PrintShort(op1->s <<= value2);
7882 if(!exp->expType)
7883 {
7884 exp->expType = op1->type;
7885 if(op1->type)
7886 op1->type->refCount++;
7887 }
7888 return 0x1;
7889 }
7890
7891 static unsigned int UShortLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7892 {
7893 unsigned short value2 = op2->us;
7894
7895 exp->type = 2;
7896 exp->string = PrintUShort(op1->us <<= value2);
7897 if(!exp->expType)
7898 {
7899 exp->expType = op1->type;
7900 if(op1->type)
7901 op1->type->refCount++;
7902 }
7903 return 0x1;
7904 }
7905
7906 static unsigned int CharLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7907 {
7908 char value2 = op2->c;
7909
7910 exp->type = 2;
7911 exp->string = PrintChar(op1->c <<= value2);
7912 if(!exp->expType)
7913 {
7914 exp->expType = op1->type;
7915 if(op1->type)
7916 op1->type->refCount++;
7917 }
7918 return 0x1;
7919 }
7920
7921 static unsigned int UCharLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7922 {
7923 unsigned char value2 = op2->uc;
7924
7925 exp->type = 2;
7926 exp->string = PrintUChar(op1->uc <<= value2);
7927 if(!exp->expType)
7928 {
7929 exp->expType = op1->type;
7930 if(op1->type)
7931 op1->type->refCount++;
7932 }
7933 return 0x1;
7934 }
7935
7936 static unsigned int IntRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7937 {
7938 int value2 = op2->i;
7939
7940 exp->type = 2;
7941 exp->string = PrintInt(op1->i >>= value2);
7942 if(!exp->expType)
7943 {
7944 exp->expType = op1->type;
7945 if(op1->type)
7946 op1->type->refCount++;
7947 }
7948 return 0x1;
7949 }
7950
7951 static unsigned int UIntRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7952 {
7953 unsigned int value2 = op2->ui;
7954
7955 exp->type = 2;
7956 exp->string = PrintUInt(op1->ui >>= value2);
7957 if(!exp->expType)
7958 {
7959 exp->expType = op1->type;
7960 if(op1->type)
7961 op1->type->refCount++;
7962 }
7963 return 0x1;
7964 }
7965
7966 static unsigned int ShortRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7967 {
7968 short value2 = op2->s;
7969
7970 exp->type = 2;
7971 exp->string = PrintShort(op1->s >>= value2);
7972 if(!exp->expType)
7973 {
7974 exp->expType = op1->type;
7975 if(op1->type)
7976 op1->type->refCount++;
7977 }
7978 return 0x1;
7979 }
7980
7981 static unsigned int UShortRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7982 {
7983 unsigned short value2 = op2->us;
7984
7985 exp->type = 2;
7986 exp->string = PrintUShort(op1->us >>= value2);
7987 if(!exp->expType)
7988 {
7989 exp->expType = op1->type;
7990 if(op1->type)
7991 op1->type->refCount++;
7992 }
7993 return 0x1;
7994 }
7995
7996 static unsigned int CharRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7997 {
7998 char value2 = op2->c;
7999
8000 exp->type = 2;
8001 exp->string = PrintChar(op1->c >>= value2);
8002 if(!exp->expType)
8003 {
8004 exp->expType = op1->type;
8005 if(op1->type)
8006 op1->type->refCount++;
8007 }
8008 return 0x1;
8009 }
8010
8011 static unsigned int UCharRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8012 {
8013 unsigned char value2 = op2->uc;
8014
8015 exp->type = 2;
8016 exp->string = PrintUChar(op1->uc >>= value2);
8017 if(!exp->expType)
8018 {
8019 exp->expType = op1->type;
8020 if(op1->type)
8021 op1->type->refCount++;
8022 }
8023 return 0x1;
8024 }
8025
8026 static unsigned int IntNot(struct Expression * exp, struct Operand * op1)
8027 {
8028 exp->type = 2;
8029 exp->string = PrintInt(!op1->i);
8030 if(!exp->expType)
8031 {
8032 exp->expType = op1->type;
8033 if(op1->type)
8034 op1->type->refCount++;
8035 }
8036 return 0x1;
8037 }
8038
8039 static unsigned int UIntNot(struct Expression * exp, struct Operand * op1)
8040 {
8041 exp->type = 2;
8042 exp->string = PrintUInt(!op1->ui);
8043 if(!exp->expType)
8044 {
8045 exp->expType = op1->type;
8046 if(op1->type)
8047 op1->type->refCount++;
8048 }
8049 return 0x1;
8050 }
8051
8052 static unsigned int ShortNot(struct Expression * exp, struct Operand * op1)
8053 {
8054 exp->type = 2;
8055 exp->string = PrintShort(!op1->s);
8056 if(!exp->expType)
8057 {
8058 exp->expType = op1->type;
8059 if(op1->type)
8060 op1->type->refCount++;
8061 }
8062 return 0x1;
8063 }
8064
8065 static unsigned int UShortNot(struct Expression * exp, struct Operand * op1)
8066 {
8067 exp->type = 2;
8068 exp->string = PrintUShort(!op1->us);
8069 if(!exp->expType)
8070 {
8071 exp->expType = op1->type;
8072 if(op1->type)
8073 op1->type->refCount++;
8074 }
8075 return 0x1;
8076 }
8077
8078 static unsigned int CharNot(struct Expression * exp, struct Operand * op1)
8079 {
8080 exp->type = 2;
8081 exp->string = PrintChar(!op1->c);
8082 if(!exp->expType)
8083 {
8084 exp->expType = op1->type;
8085 if(op1->type)
8086 op1->type->refCount++;
8087 }
8088 return 0x1;
8089 }
8090
8091 static unsigned int UCharNot(struct Expression * exp, struct Operand * op1)
8092 {
8093 exp->type = 2;
8094 exp->string = PrintUChar(!op1->uc);
8095 if(!exp->expType)
8096 {
8097 exp->expType = op1->type;
8098 if(op1->type)
8099 op1->type->refCount++;
8100 }
8101 return 0x1;
8102 }
8103
8104 static unsigned int IntEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8105 {
8106 int value2 = op2->i;
8107
8108 exp->type = 2;
8109 exp->string = PrintInt(op1->i == value2);
8110 if(!exp->expType)
8111 {
8112 exp->expType = op1->type;
8113 if(op1->type)
8114 op1->type->refCount++;
8115 }
8116 return 0x1;
8117 }
8118
8119 static unsigned int UIntEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8120 {
8121 unsigned int value2 = op2->ui;
8122
8123 exp->type = 2;
8124 exp->string = PrintUInt(op1->ui == value2);
8125 if(!exp->expType)
8126 {
8127 exp->expType = op1->type;
8128 if(op1->type)
8129 op1->type->refCount++;
8130 }
8131 return 0x1;
8132 }
8133
8134 static unsigned int ShortEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8135 {
8136 short value2 = op2->s;
8137
8138 exp->type = 2;
8139 exp->string = PrintShort(op1->s == value2);
8140 if(!exp->expType)
8141 {
8142 exp->expType = op1->type;
8143 if(op1->type)
8144 op1->type->refCount++;
8145 }
8146 return 0x1;
8147 }
8148
8149 static unsigned int UShortEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8150 {
8151 unsigned short value2 = op2->us;
8152
8153 exp->type = 2;
8154 exp->string = PrintUShort(op1->us == value2);
8155 if(!exp->expType)
8156 {
8157 exp->expType = op1->type;
8158 if(op1->type)
8159 op1->type->refCount++;
8160 }
8161 return 0x1;
8162 }
8163
8164 static unsigned int CharEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8165 {
8166 char value2 = op2->c;
8167
8168 exp->type = 2;
8169 exp->string = PrintChar(op1->c == value2);
8170 if(!exp->expType)
8171 {
8172 exp->expType = op1->type;
8173 if(op1->type)
8174 op1->type->refCount++;
8175 }
8176 return 0x1;
8177 }
8178
8179 static unsigned int UCharEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8180 {
8181 unsigned char value2 = op2->uc;
8182
8183 exp->type = 2;
8184 exp->string = PrintUChar(op1->uc == value2);
8185 if(!exp->expType)
8186 {
8187 exp->expType = op1->type;
8188 if(op1->type)
8189 op1->type->refCount++;
8190 }
8191 return 0x1;
8192 }
8193
8194 static unsigned int FloatEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8195 {
8196 float value2 = op2->f;
8197
8198 exp->type = 2;
8199 exp->string = PrintFloat(op1->f == value2);
8200 if(!exp->expType)
8201 {
8202 exp->expType = op1->type;
8203 if(op1->type)
8204 op1->type->refCount++;
8205 }
8206 return 0x1;
8207 }
8208
8209 static unsigned int DoubleEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8210 {
8211 double value2 = op2->d;
8212
8213 exp->type = 2;
8214 exp->string = PrintDouble(op1->d == value2);
8215 if(!exp->expType)
8216 {
8217 exp->expType = op1->type;
8218 if(op1->type)
8219 op1->type->refCount++;
8220 }
8221 return 0x1;
8222 }
8223
8224 static unsigned int IntNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8225 {
8226 int value2 = op2->i;
8227
8228 exp->type = 2;
8229 exp->string = PrintInt(op1->i != value2);
8230 if(!exp->expType)
8231 {
8232 exp->expType = op1->type;
8233 if(op1->type)
8234 op1->type->refCount++;
8235 }
8236 return 0x1;
8237 }
8238
8239 static unsigned int UIntNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8240 {
8241 unsigned int value2 = op2->ui;
8242
8243 exp->type = 2;
8244 exp->string = PrintUInt(op1->ui != value2);
8245 if(!exp->expType)
8246 {
8247 exp->expType = op1->type;
8248 if(op1->type)
8249 op1->type->refCount++;
8250 }
8251 return 0x1;
8252 }
8253
8254 static unsigned int ShortNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8255 {
8256 short value2 = op2->s;
8257
8258 exp->type = 2;
8259 exp->string = PrintShort(op1->s != value2);
8260 if(!exp->expType)
8261 {
8262 exp->expType = op1->type;
8263 if(op1->type)
8264 op1->type->refCount++;
8265 }
8266 return 0x1;
8267 }
8268
8269 static unsigned int UShortNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8270 {
8271 unsigned short value2 = op2->us;
8272
8273 exp->type = 2;
8274 exp->string = PrintUShort(op1->us != value2);
8275 if(!exp->expType)
8276 {
8277 exp->expType = op1->type;
8278 if(op1->type)
8279 op1->type->refCount++;
8280 }
8281 return 0x1;
8282 }
8283
8284 static unsigned int CharNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8285 {
8286 char value2 = op2->c;
8287
8288 exp->type = 2;
8289 exp->string = PrintChar(op1->c != value2);
8290 if(!exp->expType)
8291 {
8292 exp->expType = op1->type;
8293 if(op1->type)
8294 op1->type->refCount++;
8295 }
8296 return 0x1;
8297 }
8298
8299 static unsigned int UCharNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8300 {
8301 unsigned char value2 = op2->uc;
8302
8303 exp->type = 2;
8304 exp->string = PrintUChar(op1->uc != value2);
8305 if(!exp->expType)
8306 {
8307 exp->expType = op1->type;
8308 if(op1->type)
8309 op1->type->refCount++;
8310 }
8311 return 0x1;
8312 }
8313
8314 static unsigned int FloatNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8315 {
8316 float value2 = op2->f;
8317
8318 exp->type = 2;
8319 exp->string = PrintFloat(op1->f != value2);
8320 if(!exp->expType)
8321 {
8322 exp->expType = op1->type;
8323 if(op1->type)
8324 op1->type->refCount++;
8325 }
8326 return 0x1;
8327 }
8328
8329 static unsigned int DoubleNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8330 {
8331 double value2 = op2->d;
8332
8333 exp->type = 2;
8334 exp->string = PrintDouble(op1->d != value2);
8335 if(!exp->expType)
8336 {
8337 exp->expType = op1->type;
8338 if(op1->type)
8339 op1->type->refCount++;
8340 }
8341 return 0x1;
8342 }
8343
8344 static unsigned int IntAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8345 {
8346 int value2 = op2->i;
8347
8348 exp->type = 2;
8349 exp->string = PrintInt(op1->i && value2);
8350 if(!exp->expType)
8351 {
8352 exp->expType = op1->type;
8353 if(op1->type)
8354 op1->type->refCount++;
8355 }
8356 return 0x1;
8357 }
8358
8359 static unsigned int UIntAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8360 {
8361 unsigned int value2 = op2->ui;
8362
8363 exp->type = 2;
8364 exp->string = PrintUInt(op1->ui && value2);
8365 if(!exp->expType)
8366 {
8367 exp->expType = op1->type;
8368 if(op1->type)
8369 op1->type->refCount++;
8370 }
8371 return 0x1;
8372 }
8373
8374 static unsigned int ShortAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8375 {
8376 short value2 = op2->s;
8377
8378 exp->type = 2;
8379 exp->string = PrintShort(op1->s && value2);
8380 if(!exp->expType)
8381 {
8382 exp->expType = op1->type;
8383 if(op1->type)
8384 op1->type->refCount++;
8385 }
8386 return 0x1;
8387 }
8388
8389 static unsigned int UShortAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8390 {
8391 unsigned short value2 = op2->us;
8392
8393 exp->type = 2;
8394 exp->string = PrintUShort(op1->us && value2);
8395 if(!exp->expType)
8396 {
8397 exp->expType = op1->type;
8398 if(op1->type)
8399 op1->type->refCount++;
8400 }
8401 return 0x1;
8402 }
8403
8404 static unsigned int CharAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8405 {
8406 char value2 = op2->c;
8407
8408 exp->type = 2;
8409 exp->string = PrintChar(op1->c && value2);
8410 if(!exp->expType)
8411 {
8412 exp->expType = op1->type;
8413 if(op1->type)
8414 op1->type->refCount++;
8415 }
8416 return 0x1;
8417 }
8418
8419 static unsigned int UCharAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8420 {
8421 unsigned char value2 = op2->uc;
8422
8423 exp->type = 2;
8424 exp->string = PrintUChar(op1->uc && value2);
8425 if(!exp->expType)
8426 {
8427 exp->expType = op1->type;
8428 if(op1->type)
8429 op1->type->refCount++;
8430 }
8431 return 0x1;
8432 }
8433
8434 static unsigned int FloatAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8435 {
8436 float value2 = op2->f;
8437
8438 exp->type = 2;
8439 exp->string = PrintFloat(op1->f && value2);
8440 if(!exp->expType)
8441 {
8442 exp->expType = op1->type;
8443 if(op1->type)
8444 op1->type->refCount++;
8445 }
8446 return 0x1;
8447 }
8448
8449 static unsigned int DoubleAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8450 {
8451 double value2 = op2->d;
8452
8453 exp->type = 2;
8454 exp->string = PrintDouble(op1->d && value2);
8455 if(!exp->expType)
8456 {
8457 exp->expType = op1->type;
8458 if(op1->type)
8459 op1->type->refCount++;
8460 }
8461 return 0x1;
8462 }
8463
8464 static unsigned int IntOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8465 {
8466 int value2 = op2->i;
8467
8468 exp->type = 2;
8469 exp->string = PrintInt(op1->i || value2);
8470 if(!exp->expType)
8471 {
8472 exp->expType = op1->type;
8473 if(op1->type)
8474 op1->type->refCount++;
8475 }
8476 return 0x1;
8477 }
8478
8479 static unsigned int UIntOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8480 {
8481 unsigned int value2 = op2->ui;
8482
8483 exp->type = 2;
8484 exp->string = PrintUInt(op1->ui || value2);
8485 if(!exp->expType)
8486 {
8487 exp->expType = op1->type;
8488 if(op1->type)
8489 op1->type->refCount++;
8490 }
8491 return 0x1;
8492 }
8493
8494 static unsigned int ShortOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8495 {
8496 short value2 = op2->s;
8497
8498 exp->type = 2;
8499 exp->string = PrintShort(op1->s || value2);
8500 if(!exp->expType)
8501 {
8502 exp->expType = op1->type;
8503 if(op1->type)
8504 op1->type->refCount++;
8505 }
8506 return 0x1;
8507 }
8508
8509 static unsigned int UShortOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8510 {
8511 unsigned short value2 = op2->us;
8512
8513 exp->type = 2;
8514 exp->string = PrintUShort(op1->us || value2);
8515 if(!exp->expType)
8516 {
8517 exp->expType = op1->type;
8518 if(op1->type)
8519 op1->type->refCount++;
8520 }
8521 return 0x1;
8522 }
8523
8524 static unsigned int CharOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8525 {
8526 char value2 = op2->c;
8527
8528 exp->type = 2;
8529 exp->string = PrintChar(op1->c || value2);
8530 if(!exp->expType)
8531 {
8532 exp->expType = op1->type;
8533 if(op1->type)
8534 op1->type->refCount++;
8535 }
8536 return 0x1;
8537 }
8538
8539 static unsigned int UCharOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8540 {
8541 unsigned char value2 = op2->uc;
8542
8543 exp->type = 2;
8544 exp->string = PrintUChar(op1->uc || value2);
8545 if(!exp->expType)
8546 {
8547 exp->expType = op1->type;
8548 if(op1->type)
8549 op1->type->refCount++;
8550 }
8551 return 0x1;
8552 }
8553
8554 static unsigned int FloatOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8555 {
8556 float value2 = op2->f;
8557
8558 exp->type = 2;
8559 exp->string = PrintFloat(op1->f || value2);
8560 if(!exp->expType)
8561 {
8562 exp->expType = op1->type;
8563 if(op1->type)
8564 op1->type->refCount++;
8565 }
8566 return 0x1;
8567 }
8568
8569 static unsigned int DoubleOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8570 {
8571 double value2 = op2->d;
8572
8573 exp->type = 2;
8574 exp->string = PrintDouble(op1->d || value2);
8575 if(!exp->expType)
8576 {
8577 exp->expType = op1->type;
8578 if(op1->type)
8579 op1->type->refCount++;
8580 }
8581 return 0x1;
8582 }
8583
8584 static unsigned int IntGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8585 {
8586 int value2 = op2->i;
8587
8588 exp->type = 2;
8589 exp->string = PrintInt(op1->i > value2);
8590 if(!exp->expType)
8591 {
8592 exp->expType = op1->type;
8593 if(op1->type)
8594 op1->type->refCount++;
8595 }
8596 return 0x1;
8597 }
8598
8599 static unsigned int UIntGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8600 {
8601 unsigned int value2 = op2->ui;
8602
8603 exp->type = 2;
8604 exp->string = PrintUInt(op1->ui > value2);
8605 if(!exp->expType)
8606 {
8607 exp->expType = op1->type;
8608 if(op1->type)
8609 op1->type->refCount++;
8610 }
8611 return 0x1;
8612 }
8613
8614 static unsigned int ShortGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8615 {
8616 short value2 = op2->s;
8617
8618 exp->type = 2;
8619 exp->string = PrintShort(op1->s > value2);
8620 if(!exp->expType)
8621 {
8622 exp->expType = op1->type;
8623 if(op1->type)
8624 op1->type->refCount++;
8625 }
8626 return 0x1;
8627 }
8628
8629 static unsigned int UShortGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8630 {
8631 unsigned short value2 = op2->us;
8632
8633 exp->type = 2;
8634 exp->string = PrintUShort(op1->us > value2);
8635 if(!exp->expType)
8636 {
8637 exp->expType = op1->type;
8638 if(op1->type)
8639 op1->type->refCount++;
8640 }
8641 return 0x1;
8642 }
8643
8644 static unsigned int CharGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8645 {
8646 char value2 = op2->c;
8647
8648 exp->type = 2;
8649 exp->string = PrintChar(op1->c > value2);
8650 if(!exp->expType)
8651 {
8652 exp->expType = op1->type;
8653 if(op1->type)
8654 op1->type->refCount++;
8655 }
8656 return 0x1;
8657 }
8658
8659 static unsigned int UCharGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8660 {
8661 unsigned char value2 = op2->uc;
8662
8663 exp->type = 2;
8664 exp->string = PrintUChar(op1->uc > value2);
8665 if(!exp->expType)
8666 {
8667 exp->expType = op1->type;
8668 if(op1->type)
8669 op1->type->refCount++;
8670 }
8671 return 0x1;
8672 }
8673
8674 static unsigned int FloatGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8675 {
8676 float value2 = op2->f;
8677
8678 exp->type = 2;
8679 exp->string = PrintFloat(op1->f > value2);
8680 if(!exp->expType)
8681 {
8682 exp->expType = op1->type;
8683 if(op1->type)
8684 op1->type->refCount++;
8685 }
8686 return 0x1;
8687 }
8688
8689 static unsigned int DoubleGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8690 {
8691 double value2 = op2->d;
8692
8693 exp->type = 2;
8694 exp->string = PrintDouble(op1->d > value2);
8695 if(!exp->expType)
8696 {
8697 exp->expType = op1->type;
8698 if(op1->type)
8699 op1->type->refCount++;
8700 }
8701 return 0x1;
8702 }
8703
8704 static unsigned int IntSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8705 {
8706 int value2 = op2->i;
8707
8708 exp->type = 2;
8709 exp->string = PrintInt(op1->i < value2);
8710 if(!exp->expType)
8711 {
8712 exp->expType = op1->type;
8713 if(op1->type)
8714 op1->type->refCount++;
8715 }
8716 return 0x1;
8717 }
8718
8719 static unsigned int UIntSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8720 {
8721 unsigned int value2 = op2->ui;
8722
8723 exp->type = 2;
8724 exp->string = PrintUInt(op1->ui < value2);
8725 if(!exp->expType)
8726 {
8727 exp->expType = op1->type;
8728 if(op1->type)
8729 op1->type->refCount++;
8730 }
8731 return 0x1;
8732 }
8733
8734 static unsigned int ShortSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8735 {
8736 short value2 = op2->s;
8737
8738 exp->type = 2;
8739 exp->string = PrintShort(op1->s < value2);
8740 if(!exp->expType)
8741 {
8742 exp->expType = op1->type;
8743 if(op1->type)
8744 op1->type->refCount++;
8745 }
8746 return 0x1;
8747 }
8748
8749 static unsigned int UShortSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8750 {
8751 unsigned short value2 = op2->us;
8752
8753 exp->type = 2;
8754 exp->string = PrintUShort(op1->us < value2);
8755 if(!exp->expType)
8756 {
8757 exp->expType = op1->type;
8758 if(op1->type)
8759 op1->type->refCount++;
8760 }
8761 return 0x1;
8762 }
8763
8764 static unsigned int CharSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8765 {
8766 char value2 = op2->c;
8767
8768 exp->type = 2;
8769 exp->string = PrintChar(op1->c < value2);
8770 if(!exp->expType)
8771 {
8772 exp->expType = op1->type;
8773 if(op1->type)
8774 op1->type->refCount++;
8775 }
8776 return 0x1;
8777 }
8778
8779 static unsigned int UCharSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8780 {
8781 unsigned char value2 = op2->uc;
8782
8783 exp->type = 2;
8784 exp->string = PrintUChar(op1->uc < value2);
8785 if(!exp->expType)
8786 {
8787 exp->expType = op1->type;
8788 if(op1->type)
8789 op1->type->refCount++;
8790 }
8791 return 0x1;
8792 }
8793
8794 static unsigned int FloatSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8795 {
8796 float value2 = op2->f;
8797
8798 exp->type = 2;
8799 exp->string = PrintFloat(op1->f < value2);
8800 if(!exp->expType)
8801 {
8802 exp->expType = op1->type;
8803 if(op1->type)
8804 op1->type->refCount++;
8805 }
8806 return 0x1;
8807 }
8808
8809 static unsigned int DoubleSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8810 {
8811 double value2 = op2->d;
8812
8813 exp->type = 2;
8814 exp->string = PrintDouble(op1->d < value2);
8815 if(!exp->expType)
8816 {
8817 exp->expType = op1->type;
8818 if(op1->type)
8819 op1->type->refCount++;
8820 }
8821 return 0x1;
8822 }
8823
8824 static unsigned int IntGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8825 {
8826 int value2 = op2->i;
8827
8828 exp->type = 2;
8829 exp->string = PrintInt(op1->i >= value2);
8830 if(!exp->expType)
8831 {
8832 exp->expType = op1->type;
8833 if(op1->type)
8834 op1->type->refCount++;
8835 }
8836 return 0x1;
8837 }
8838
8839 static unsigned int UIntGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8840 {
8841 unsigned int value2 = op2->ui;
8842
8843 exp->type = 2;
8844 exp->string = PrintUInt(op1->ui >= value2);
8845 if(!exp->expType)
8846 {
8847 exp->expType = op1->type;
8848 if(op1->type)
8849 op1->type->refCount++;
8850 }
8851 return 0x1;
8852 }
8853
8854 static unsigned int ShortGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8855 {
8856 short value2 = op2->s;
8857
8858 exp->type = 2;
8859 exp->string = PrintShort(op1->s >= value2);
8860 if(!exp->expType)
8861 {
8862 exp->expType = op1->type;
8863 if(op1->type)
8864 op1->type->refCount++;
8865 }
8866 return 0x1;
8867 }
8868
8869 static unsigned int UShortGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8870 {
8871 unsigned short value2 = op2->us;
8872
8873 exp->type = 2;
8874 exp->string = PrintUShort(op1->us >= value2);
8875 if(!exp->expType)
8876 {
8877 exp->expType = op1->type;
8878 if(op1->type)
8879 op1->type->refCount++;
8880 }
8881 return 0x1;
8882 }
8883
8884 static unsigned int CharGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8885 {
8886 char value2 = op2->c;
8887
8888 exp->type = 2;
8889 exp->string = PrintChar(op1->c >= value2);
8890 if(!exp->expType)
8891 {
8892 exp->expType = op1->type;
8893 if(op1->type)
8894 op1->type->refCount++;
8895 }
8896 return 0x1;
8897 }
8898
8899 static unsigned int UCharGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8900 {
8901 unsigned char value2 = op2->uc;
8902
8903 exp->type = 2;
8904 exp->string = PrintUChar(op1->uc >= value2);
8905 if(!exp->expType)
8906 {
8907 exp->expType = op1->type;
8908 if(op1->type)
8909 op1->type->refCount++;
8910 }
8911 return 0x1;
8912 }
8913
8914 static unsigned int FloatGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8915 {
8916 float value2 = op2->f;
8917
8918 exp->type = 2;
8919 exp->string = PrintFloat(op1->f >= value2);
8920 if(!exp->expType)
8921 {
8922 exp->expType = op1->type;
8923 if(op1->type)
8924 op1->type->refCount++;
8925 }
8926 return 0x1;
8927 }
8928
8929 static unsigned int DoubleGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8930 {
8931 double value2 = op2->d;
8932
8933 exp->type = 2;
8934 exp->string = PrintDouble(op1->d >= value2);
8935 if(!exp->expType)
8936 {
8937 exp->expType = op1->type;
8938 if(op1->type)
8939 op1->type->refCount++;
8940 }
8941 return 0x1;
8942 }
8943
8944 static unsigned int IntSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8945 {
8946 int value2 = op2->i;
8947
8948 exp->type = 2;
8949 exp->string = PrintInt(op1->i <= value2);
8950 if(!exp->expType)
8951 {
8952 exp->expType = op1->type;
8953 if(op1->type)
8954 op1->type->refCount++;
8955 }
8956 return 0x1;
8957 }
8958
8959 static unsigned int UIntSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8960 {
8961 unsigned int value2 = op2->ui;
8962
8963 exp->type = 2;
8964 exp->string = PrintUInt(op1->ui <= value2);
8965 if(!exp->expType)
8966 {
8967 exp->expType = op1->type;
8968 if(op1->type)
8969 op1->type->refCount++;
8970 }
8971 return 0x1;
8972 }
8973
8974 static unsigned int ShortSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8975 {
8976 short value2 = op2->s;
8977
8978 exp->type = 2;
8979 exp->string = PrintShort(op1->s <= value2);
8980 if(!exp->expType)
8981 {
8982 exp->expType = op1->type;
8983 if(op1->type)
8984 op1->type->refCount++;
8985 }
8986 return 0x1;
8987 }
8988
8989 static unsigned int UShortSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8990 {
8991 unsigned short value2 = op2->us;
8992
8993 exp->type = 2;
8994 exp->string = PrintUShort(op1->us <= value2);
8995 if(!exp->expType)
8996 {
8997 exp->expType = op1->type;
8998 if(op1->type)
8999 op1->type->refCount++;
9000 }
9001 return 0x1;
9002 }
9003
9004 static unsigned int CharSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9005 {
9006 char value2 = op2->c;
9007
9008 exp->type = 2;
9009 exp->string = PrintChar(op1->c <= value2);
9010 if(!exp->expType)
9011 {
9012 exp->expType = op1->type;
9013 if(op1->type)
9014 op1->type->refCount++;
9015 }
9016 return 0x1;
9017 }
9018
9019 static unsigned int UCharSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9020 {
9021 unsigned char value2 = op2->uc;
9022
9023 exp->type = 2;
9024 exp->string = PrintUChar(op1->uc <= value2);
9025 if(!exp->expType)
9026 {
9027 exp->expType = op1->type;
9028 if(op1->type)
9029 op1->type->refCount++;
9030 }
9031 return 0x1;
9032 }
9033
9034 static unsigned int FloatSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9035 {
9036 float value2 = op2->f;
9037
9038 exp->type = 2;
9039 exp->string = PrintFloat(op1->f <= value2);
9040 if(!exp->expType)
9041 {
9042 exp->expType = op1->type;
9043 if(op1->type)
9044 op1->type->refCount++;
9045 }
9046 return 0x1;
9047 }
9048
9049 static unsigned int DoubleSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9050 {
9051 double value2 = op2->d;
9052
9053 exp->type = 2;
9054 exp->string = PrintDouble(op1->d <= value2);
9055 if(!exp->expType)
9056 {
9057 exp->expType = op1->type;
9058 if(op1->type)
9059 op1->type->refCount++;
9060 }
9061 return 0x1;
9062 }
9063
9064 static unsigned int IntCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
9065 {
9066 exp->type = 2;
9067 exp->string = PrintInt(op1->i ? op2->i : op3->i);
9068 if(!exp->expType)
9069 {
9070 exp->expType = op1->type;
9071 if(op1->type)
9072 op1->type->refCount++;
9073 }
9074 return 0x1;
9075 }
9076
9077 static unsigned int UIntCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
9078 {
9079 exp->type = 2;
9080 exp->string = PrintUInt(op1->ui ? op2->ui : op3->ui);
9081 if(!exp->expType)
9082 {
9083 exp->expType = op1->type;
9084 if(op1->type)
9085 op1->type->refCount++;
9086 }
9087 return 0x1;
9088 }
9089
9090 static unsigned int ShortCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
9091 {
9092 exp->type = 2;
9093 exp->string = PrintShort(op1->s ? op2->s : op3->s);
9094 if(!exp->expType)
9095 {
9096 exp->expType = op1->type;
9097 if(op1->type)
9098 op1->type->refCount++;
9099 }
9100 return 0x1;
9101 }
9102
9103 static unsigned int UShortCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
9104 {
9105 exp->type = 2;
9106 exp->string = PrintUShort(op1->us ? op2->us : op3->us);
9107 if(!exp->expType)
9108 {
9109 exp->expType = op1->type;
9110 if(op1->type)
9111 op1->type->refCount++;
9112 }
9113 return 0x1;
9114 }
9115
9116 static unsigned int CharCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
9117 {
9118 exp->type = 2;
9119 exp->string = PrintChar(op1->c ? op2->c : op3->c);
9120 if(!exp->expType)
9121 {
9122 exp->expType = op1->type;
9123 if(op1->type)
9124 op1->type->refCount++;
9125 }
9126 return 0x1;
9127 }
9128
9129 static unsigned int UCharCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
9130 {
9131 exp->type = 2;
9132 exp->string = PrintUChar(op1->uc ? op2->uc : op3->uc);
9133 if(!exp->expType)
9134 {
9135 exp->expType = op1->type;
9136 if(op1->type)
9137 op1->type->refCount++;
9138 }
9139 return 0x1;
9140 }
9141
9142 static unsigned int FloatCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
9143 {
9144 exp->type = 2;
9145 exp->string = PrintFloat(op1->f ? op2->f : op3->f);
9146 if(!exp->expType)
9147 {
9148 exp->expType = op1->type;
9149 if(op1->type)
9150 op1->type->refCount++;
9151 }
9152 return 0x1;
9153 }
9154
9155 static unsigned int DoubleCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
9156 {
9157 exp->type = 2;
9158 exp->string = PrintDouble(op1->d ? op2->d : op3->d);
9159 if(!exp->expType)
9160 {
9161 exp->expType = op1->type;
9162 if(op1->type)
9163 op1->type->refCount++;
9164 }
9165 return 0x1;
9166 }
9167
9168 struct OpTable intOps = 
9169 {
9170 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
9171 };
9172
9173 struct OpTable uintOps = 
9174 {
9175 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
9176 };
9177
9178 struct OpTable shortOps = 
9179 {
9180 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
9181 };
9182
9183 struct OpTable ushortOps = 
9184 {
9185 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
9186 };
9187
9188 struct OpTable floatOps = 
9189 {
9190 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
9191 };
9192
9193 struct OpTable doubleOps = 
9194 {
9195 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
9196 };
9197
9198 struct OpTable charOps = 
9199 {
9200 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
9201 };
9202
9203 struct OpTable ucharOps = 
9204 {
9205 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
9206 };
9207
9208 void ReadString(char * output, char * string)
9209 {
9210 int len = strlen(string);
9211 int c, d = 0;
9212 unsigned int quoted = 0x0, escaped = 0x0;
9213
9214 for(c = 0; c < len; c++)
9215 {
9216 char ch = string[c];
9217
9218 if(escaped)
9219 {
9220 switch(ch)
9221 {
9222 case 'n':
9223 output[d] = '\n';
9224 break;
9225 case 't':
9226 output[d] = '\t';
9227 break;
9228 case 'a':
9229 output[d] = '\a';
9230 break;
9231 case 'b':
9232 output[d] = '\b';
9233 break;
9234 case 'f':
9235 output[d] = '\f';
9236 break;
9237 case 'r':
9238 output[d] = '\r';
9239 break;
9240 case 'v':
9241 output[d] = '\v';
9242 break;
9243 case '\\':
9244 output[d] = '\\';
9245 break;
9246 case '\"':
9247 output[d] = '\"';
9248 break;
9249 default:
9250 output[d++] = '\\';
9251 output[d] = ch;
9252 }
9253 d++;
9254 escaped = 0x0;
9255 }
9256 else
9257 {
9258 if(ch == '\"')
9259 quoted ^= 0x1;
9260 else if(quoted)
9261 {
9262 if(ch == '\\')
9263 escaped = 0x1;
9264 else
9265 output[d++] = ch;
9266 }
9267 }
9268 }
9269 output[d] = '\0';
9270 }
9271
9272 extern double strtod(char * , char * * );
9273
9274 struct Operand GetOperand(struct Expression * exp)
9275 {
9276 struct Operand op = 
9277 {
9278 0, 0, 0, 0, 
9279 {
9280 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
9281 }
9282 };
9283 struct Type * type = exp->expType;
9284
9285 if(type)
9286 {
9287 while(type->kind == 8 && type->_class->registered && (type->_class->registered->type == 2 || type->_class->registered->type == 3 || type->_class->registered->type == 4))
9288 {
9289 if(!type->_class->registered->dataType)
9290 type->_class->registered->dataType = ProcessTypeString(type->_class->registered->dataTypeString, 0x0);
9291 type = type->_class->registered->dataType;
9292 }
9293 op.kind = type->kind;
9294 op.type = exp->expType;
9295 if(exp->isConstant && exp->type == 2)
9296 {
9297 switch(op.kind)
9298 {
9299 case 1:
9300 {
9301 if(exp->constant[0] == '\'')
9302 op.c = exp->constant[1];
9303 else if(type->isSigned)
9304 {
9305 op.c = (char)strtol(exp->constant, (((void *)0)), 0);
9306 op.ops = charOps;
9307 }
9308 else
9309 {
9310 op.uc = (unsigned char)strtoul(exp->constant, (((void *)0)), 0);
9311 op.ops = ucharOps;
9312 }
9313 break;
9314 }
9315 case 2:
9316 if(type->isSigned)
9317 {
9318 op.s = (short)strtol(exp->constant, (((void *)0)), 0);
9319 op.ops = shortOps;
9320 }
9321 else
9322 {
9323 op.us = (unsigned short)strtoul(exp->constant, (((void *)0)), 0);
9324 op.ops = ushortOps;
9325 }
9326 break;
9327 case 3:
9328 case 5:
9329 if(type->isSigned)
9330 {
9331 op.i = strtol(exp->constant, (((void *)0)), 0);
9332 op.ops = intOps;
9333 }
9334 else
9335 {
9336 op.ui = strtoul(exp->constant, (((void *)0)), 0);
9337 op.ops = uintOps;
9338 }
9339 op.kind = 3;
9340 break;
9341 case 4:
9342 if(type->isSigned)
9343 {
9344 op.i64 = _strtoi64(exp->constant, (((void *)0)), 0);
9345 op.ops = intOps;
9346 }
9347 else
9348 {
9349 op.ui64 = _strtoui64(exp->constant, (((void *)0)), 0);
9350 op.ops = uintOps;
9351 }
9352 op.kind = 3;
9353 break;
9354 case 22:
9355 if(type->isSigned)
9356 {
9357 op.iptr = (intptr_t)_strtoi64(exp->constant, (((void *)0)), 0);
9358 op.ops = intOps;
9359 }
9360 else
9361 {
9362 op.uiptr = (uintptr_t)_strtoui64(exp->constant, (((void *)0)), 0);
9363 op.ops = uintOps;
9364 }
9365 op.kind = 3;
9366 break;
9367 case 6:
9368 op.f = (float)strtod(exp->constant, (((void *)0)));
9369 op.ops = floatOps;
9370 break;
9371 case 7:
9372 op.d = (double)strtod(exp->constant, (((void *)0)));
9373 op.ops = doubleOps;
9374 break;
9375 case 12:
9376 case 13:
9377 case 8:
9378 op.p = (unsigned char *)strtoul(exp->constant, (((void *)0)), 0);
9379 op.kind = 13;
9380 op.ops = uintOps;
9381 break;
9382 }
9383 }
9384 }
9385 return op;
9386 }
9387
9388 int __ecereVMethodID_class_OnGetString;
9389
9390 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_int;
9391
9392 static void UnusedFunction()
9393 {
9394 int a;
9395
9396 ((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);
9397 }
9398
9399 extern int __ecereVMethodID_class_OnGetString;
9400
9401 static void PopulateInstanceProcessMember(struct Instantiation * inst, struct __ecereNameSpace__ecere__sys__OldList * memberList, struct __ecereNameSpace__ecere__com__DataMember * parentDataMember, unsigned int offset)
9402 {
9403 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
9404
9405 for(dataMember = parentDataMember->members.first; dataMember; dataMember = dataMember->next)
9406 {
9407 if(!dataMember->name && (dataMember->type == 2 || dataMember->type == 1))
9408 PopulateInstanceProcessMember(inst, memberList, dataMember, offset + dataMember->offset);
9409 else
9410 {
9411 struct Expression * exp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
9412 struct MemberInit * member = MkMemberInit(MkListOne(MkIdentifier(dataMember->name)), MkInitializerAssignment(exp));
9413 struct Type * type;
9414 void * ptr = inst->data + dataMember->offset + offset;
9415 char * result = (((void *)0));
9416
9417 exp->loc = member->loc = inst->loc;
9418 ((struct Identifier *)(*member->identifiers).first)->loc = inst->loc;
9419 if(!dataMember->dataType)
9420 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
9421 type = dataMember->dataType;
9422 if(type->kind == 8)
9423 {
9424 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
9425
9426 if(_class->type == 4)
9427 {
9428 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
9429
9430 if(enumClass)
9431 {
9432 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
9433 struct __ecereNameSpace__ecere__sys__NamedLink * item;
9434
9435 for(item = e->values.first; item; item = item->next)
9436 {
9437 if((int)item->data == *(int *)ptr)
9438 {
9439 result = item->name;
9440 break;
9441 }
9442 }
9443 if(result)
9444 {
9445 exp->identifier = MkIdentifier(result);
9446 exp->type = 0;
9447 exp->destType = MkClassType(_class->fullName);
9448 ProcessExpressionType(exp);
9449 }
9450 }
9451 }
9452 if(_class->type == 4 || _class->type == 3 || _class->type == 2)
9453 {
9454 if(!_class->dataType)
9455 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
9456 type = _class->dataType;
9457 }
9458 }
9459 if(!result)
9460 {
9461 switch(type->kind)
9462 {
9463 case 6:
9464 {
9465 FreeExpContents(exp);
9466 exp->constant = PrintFloat(*(float *)ptr);
9467 exp->type = 2;
9468 break;
9469 }
9470 case 7:
9471 {
9472 FreeExpContents(exp);
9473 exp->constant = PrintDouble(*(double *)ptr);
9474 exp->type = 2;
9475 break;
9476 }
9477 case 3:
9478 {
9479 FreeExpContents(exp);
9480 exp->constant = PrintInt(*(int *)ptr);
9481 exp->type = 2;
9482 break;
9483 }
9484 case 4:
9485 {
9486 FreeExpContents(exp);
9487 exp->constant = PrintInt64(*(long long *)ptr);
9488 exp->type = 2;
9489 break;
9490 }
9491 case 22:
9492 {
9493 FreeExpContents(exp);
9494 exp->constant = PrintInt64((long long)*(intptr_t *)ptr);
9495 exp->type = 2;
9496 break;
9497 }
9498 default:
9499 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Unhandled type populating instance\n", (((void *)0))));
9500 }
9501 }
9502 ListAdd(memberList, member);
9503 }
9504 if(parentDataMember->type == 1)
9505 break;
9506 }
9507 }
9508
9509 extern struct MembersInit * MkMembersInitList(struct __ecereNameSpace__ecere__sys__OldList * dataMembers);
9510
9511 void PopulateInstance(struct Instantiation * inst)
9512 {
9513 struct Symbol * classSym = inst->_class->symbol;
9514 struct __ecereNameSpace__ecere__com__Class * _class = classSym->registered;
9515 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
9516 struct __ecereNameSpace__ecere__sys__OldList * memberList = MkList();
9517
9518 inst->members = MkListOne(MkMembersInitList(memberList));
9519 for(dataMember = _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
9520 {
9521 if(!dataMember->isProperty)
9522 {
9523 if(!dataMember->name && (dataMember->type == 2 || dataMember->type == 1))
9524 PopulateInstanceProcessMember(inst, memberList, dataMember, dataMember->offset);
9525 else
9526 {
9527 struct Expression * exp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
9528 struct MemberInit * member = MkMemberInit(MkListOne(MkIdentifier(dataMember->name)), MkInitializerAssignment(exp));
9529 struct Type * type;
9530 void * ptr = inst->data + dataMember->offset;
9531 char * result = (((void *)0));
9532
9533 exp->loc = member->loc = inst->loc;
9534 ((struct Identifier *)(*member->identifiers).first)->loc = inst->loc;
9535 if(!dataMember->dataType)
9536 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
9537 type = dataMember->dataType;
9538 if(type->kind == 8)
9539 {
9540 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
9541
9542 if(_class->type == 4)
9543 {
9544 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
9545
9546 if(enumClass)
9547 {
9548 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
9549 struct __ecereNameSpace__ecere__sys__NamedLink * item;
9550
9551 for(item = e->values.first; item; item = item->next)
9552 {
9553 if((int)item->data == *(int *)ptr)
9554 {
9555 result = item->name;
9556 break;
9557 }
9558 }
9559 }
9560 if(result)
9561 {
9562 exp->identifier = MkIdentifier(result);
9563 exp->type = 0;
9564 exp->destType = MkClassType(_class->fullName);
9565 ProcessExpressionType(exp);
9566 }
9567 }
9568 if(_class->type == 4 || _class->type == 3 || _class->type == 2)
9569 {
9570 if(!_class->dataType)
9571 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
9572 type = _class->dataType;
9573 }
9574 }
9575 if(!result)
9576 {
9577 switch(type->kind)
9578 {
9579 case 6:
9580 {
9581 exp->constant = PrintFloat(*(float *)ptr);
9582 exp->type = 2;
9583 break;
9584 }
9585 case 7:
9586 {
9587 exp->constant = PrintDouble(*(double *)ptr);
9588 exp->type = 2;
9589 break;
9590 }
9591 case 3:
9592 {
9593 exp->constant = PrintInt(*(int *)ptr);
9594 exp->type = 2;
9595 break;
9596 }
9597 case 4:
9598 {
9599 exp->constant = PrintInt64(*(long long *)ptr);
9600 exp->type = 2;
9601 break;
9602 }
9603 case 22:
9604 {
9605 exp->constant = PrintInt64((long long)*(intptr_t *)ptr);
9606 exp->type = 2;
9607 break;
9608 }
9609 default:
9610 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Unhandled type populating instance\n", (((void *)0))));
9611 }
9612 }
9613 ListAdd(memberList, member);
9614 }
9615 }
9616 }
9617 }
9618
9619 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);
9620
9621 extern void FreeInstance(struct Instantiation * inst);
9622
9623 void ComputeInstantiation(struct Expression * exp)
9624 {
9625 struct Instantiation * inst = exp->instance;
9626 struct MembersInit * members;
9627 struct Symbol * classSym = inst->_class ? inst->_class->symbol : (((void *)0));
9628 struct __ecereNameSpace__ecere__com__Class * _class = classSym ? classSym->registered : (((void *)0));
9629 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
9630 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
9631 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
9632 int subMemberStackPos = 0;
9633 uint64 bits = 0;
9634
9635 if(_class && (_class->type == 1 || _class->type == 0 || _class->type == 5))
9636 {
9637 if(inst->data)
9638 return ;
9639 if(_class->type == 0 || _class->type == 5)
9640 inst->data = (unsigned char *)__ecereNameSpace__ecere__com__eInstance_New(_class);
9641 else
9642 inst->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
9643 }
9644 if(inst->members)
9645 {
9646 for(members = (*inst->members).first; members; members = members->next)
9647 {
9648 switch(members->type)
9649 {
9650 case 0:
9651 {
9652 if(members->dataMembers)
9653 {
9654 struct MemberInit * member;
9655
9656 for(member = (*members->dataMembers).first; member; member = member->next)
9657 {
9658 struct Identifier * ident = member->identifiers ? (*member->identifiers).first : (((void *)0));
9659 unsigned int found = 0x0;
9660 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
9661 struct __ecereNameSpace__ecere__com__DataMember * dataMember = (((void *)0));
9662 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
9663 unsigned int dataMemberOffset;
9664
9665 if(!ident)
9666 {
9667 __ecereNameSpace__ecere__com__eClass_FindNextMember(_class, &curClass, &curMember, subMemberStack, &subMemberStackPos);
9668 if(curMember)
9669 {
9670 if(curMember->isProperty)
9671 prop = (struct __ecereNameSpace__ecere__com__Property *)curMember;
9672 else
9673 {
9674 dataMember = curMember;
9675 __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(_class, dataMember->name, &dataMemberOffset, privateModule, (((void *)0)), (((void *)0)));
9676 }
9677 found = 0x1;
9678 }
9679 }
9680 else
9681 {
9682 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, ident->string, privateModule);
9683 if(prop)
9684 {
9685 found = 0x1;
9686 if(prop->memberAccess == 1)
9687 {
9688 curMember = (struct __ecereNameSpace__ecere__com__DataMember *)prop;
9689 curClass = prop->_class;
9690 }
9691 }
9692 else
9693 {
9694 struct __ecereNameSpace__ecere__com__DataMember * _subMemberStack[256];
9695 int _subMemberStackPos = 0;
9696
9697 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(_class, ident->string, &dataMemberOffset, privateModule, _subMemberStack, &_subMemberStackPos);
9698 if(dataMember)
9699 {
9700 found = 0x1;
9701 if(dataMember->memberAccess == 1)
9702 {
9703 curMember = dataMember;
9704 curClass = dataMember->_class;
9705 memcpy(subMemberStack, _subMemberStack, sizeof(int) * _subMemberStackPos);
9706 subMemberStackPos = _subMemberStackPos;
9707 }
9708 }
9709 }
9710 }
9711 if(found && member->initializer && member->initializer->type == 0)
9712 {
9713 struct Expression * value = member->initializer->exp;
9714 struct Type * type = (((void *)0));
9715
9716 if(prop)
9717 {
9718 type = prop->dataType;
9719 }
9720 else if(dataMember)
9721 {
9722 if(!dataMember->dataType)
9723 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
9724 type = dataMember->dataType;
9725 }
9726 if(ident && ident->next)
9727 {
9728 for(ident = ident->next; ident && type; ident = ident->next)
9729 {
9730 if(type->kind == 8)
9731 {
9732 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(type->_class->registered, ident->string, privateModule);
9733 if(prop)
9734 type = prop->dataType;
9735 else
9736 {
9737 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(type->_class->registered, ident->string, &dataMemberOffset, privateModule, (((void *)0)), (((void *)0)));
9738 if(dataMember)
9739 type = dataMember->dataType;
9740 }
9741 }
9742 else if(type->kind == 9 || type->kind == 10)
9743 {
9744 struct Type * memberType;
9745
9746 for(memberType = type->members.first; memberType; memberType = memberType->next)
9747 {
9748 if(!strcmp(memberType->name, ident->string))
9749 {
9750 type = memberType;
9751 break;
9752 }
9753 }
9754 }
9755 }
9756 }
9757 if(value)
9758 {
9759 FreeType(value->destType);
9760 value->destType = type;
9761 if(type)
9762 type->refCount++;
9763 ComputeExpression(value);
9764 }
9765 if(value && (_class->type == 1 || _class->type == 0 || _class->type == 5))
9766 {
9767 if(type->kind == 8)
9768 {
9769 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
9770
9771 if(_class->type == 2 || _class->type == 3 || _class->type == 4)
9772 {
9773 if(!_class->dataType)
9774 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
9775 type = _class->dataType;
9776 }
9777 }
9778 if(dataMember)
9779 {
9780 void * ptr = inst->data + dataMemberOffset;
9781
9782 if(value->type == 2)
9783 {
9784 switch(type->kind)
9785 {
9786 case 3:
9787 {
9788 GetInt(value, (int *)ptr);
9789 break;
9790 }
9791 case 4:
9792 {
9793 GetInt64(value, (long long *)ptr);
9794 break;
9795 }
9796 case 22:
9797 {
9798 GetIntPtr(value, (intptr_t *)ptr);
9799 break;
9800 }
9801 case 6:
9802 {
9803 GetFloat(value, (float *)ptr);
9804 break;
9805 }
9806 case 7:
9807 {
9808 GetDouble(value, (double *)ptr);
9809 break;
9810 }
9811 }
9812 }
9813 else if(value->type == 1)
9814 {
9815 if(type->kind == 8)
9816 {
9817 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
9818
9819 if(_class->type == 1)
9820 {
9821 ComputeTypeSize(type);
9822 if(value->instance->data)
9823 memcpy(ptr, value->instance->data, type->size);
9824 }
9825 }
9826 }
9827 }
9828 else if(prop)
9829 {
9830 if(value->type == 1 && value->instance->data)
9831 {
9832 void (* Set)(void *, void *) = (void *)prop->Set;
9833
9834 Set(inst->data, value->instance->data);
9835 PopulateInstance(inst);
9836 }
9837 else if(value->type == 2)
9838 {
9839 switch(type->kind)
9840 {
9841 case 7:
9842 {
9843 void (* Set)(void *, double) = (void *)prop->Set;
9844
9845 Set(inst->data, strtod(value->constant, (((void *)0))));
9846 break;
9847 }
9848 case 6:
9849 {
9850 void (* Set)(void *, float) = (void *)prop->Set;
9851
9852 Set(inst->data, (float)(strtod(value->constant, (((void *)0)))));
9853 break;
9854 }
9855 case 3:
9856 {
9857 void (* Set)(void *, int) = (void *)prop->Set;
9858
9859 Set(inst->data, strtol(value->constant, (((void *)0)), 0));
9860 break;
9861 }
9862 case 4:
9863 {
9864 void (* Set)(void *, long long) = (void *)prop->Set;
9865
9866 Set(inst->data, _strtoi64(value->constant, (((void *)0)), 0));
9867 break;
9868 }
9869 case 22:
9870 {
9871 void (* Set)(void *, intptr_t) = (void *)prop->Set;
9872
9873 Set(inst->data, (intptr_t)_strtoi64(value->constant, (((void *)0)), 0));
9874 break;
9875 }
9876 }
9877 }
9878 else if(value->type == 3)
9879 {
9880 char temp[1024];
9881
9882 ReadString(temp, value->string);
9883 prop->Set(inst->data, temp);
9884 }
9885 }
9886 }
9887 else if(_class->type == 3)
9888 {
9889 if(prop)
9890 {
9891 if(value->type == 2)
9892 {
9893 if(type->kind == 8)
9894 {
9895 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
9896
9897 if(_class->type == 3)
9898 {
9899 if(!_class->dataType)
9900 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
9901 type = _class->dataType;
9902 }
9903 }
9904 switch(type->kind)
9905 {
9906 case 6:
9907 {
9908 float fValue;
9909 float (* Set)(float) = (void *)prop->Set;
9910
9911 GetFloat(member->initializer->exp, &fValue);
9912 exp->constant = PrintFloat(Set(fValue));
9913 exp->type = 2;
9914 break;
9915 }
9916 case 7:
9917 {
9918 double dValue;
9919 double (* Set)(double) = (void *)prop->Set;
9920
9921 GetDouble(member->initializer->exp, &dValue);
9922 exp->constant = PrintDouble(Set(dValue));
9923 exp->type = 2;
9924 break;
9925 }
9926 }
9927 }
9928 }
9929 }
9930 else if(_class->type == 2)
9931 {
9932 if(prop)
9933 {
9934 if(value->type == 1 && value->instance->data)
9935 {
9936 unsigned int (* Set)(void *) = (void *)prop->Set;
9937
9938 bits = Set(value->instance->data);
9939 }
9940 else if(value->type == 2)
9941 {
9942 }
9943 }
9944 else if(dataMember)
9945 {
9946 struct __ecereNameSpace__ecere__com__BitMember * bitMember = (struct __ecereNameSpace__ecere__com__BitMember *)dataMember;
9947 struct Type * type;
9948 int part = 0;
9949
9950 GetInt(value, &part);
9951 bits = (bits & ~bitMember->mask);
9952 if(!bitMember->dataType)
9953 bitMember->dataType = ProcessTypeString(bitMember->dataTypeString, 0x0);
9954 type = bitMember->dataType;
9955 if(type->kind == 8 && type->_class && type->_class->registered)
9956 {
9957 if(!type->_class->registered->dataType)
9958 type->_class->registered->dataType = ProcessTypeString(type->_class->registered->dataTypeString, 0x0);
9959 type = type->_class->registered->dataType;
9960 }
9961 switch(type->kind)
9962 {
9963 case 1:
9964 if(type->isSigned)
9965 bits |= ((char)part << bitMember->pos);
9966 else
9967 bits |= ((unsigned char)part << bitMember->pos);
9968 break;
9969 case 2:
9970 if(type->isSigned)
9971 bits |= ((short)part << bitMember->pos);
9972 else
9973 bits |= ((unsigned short)part << bitMember->pos);
9974 break;
9975 case 3:
9976 case 5:
9977 if(type->isSigned)
9978 bits |= (part << bitMember->pos);
9979 else
9980 bits |= ((unsigned int)part << bitMember->pos);
9981 break;
9982 case 4:
9983 if(type->isSigned)
9984 bits |= ((long long)part << bitMember->pos);
9985 else
9986 bits |= ((uint64)part << bitMember->pos);
9987 break;
9988 case 22:
9989 if(type->isSigned)
9990 bits |= ((intptr_t)part << bitMember->pos);
9991 else
9992 bits |= ((uintptr_t)part << bitMember->pos);
9993 break;
9994 }
9995 }
9996 }
9997 }
9998 else
9999 {
10000 if(_class && _class->type == 3)
10001 {
10002 ComputeExpression(member->initializer->exp);
10003 exp->constant = member->initializer->exp->constant;
10004 exp->type = 2;
10005 member->initializer->exp->constant = (((void *)0));
10006 }
10007 }
10008 }
10009 }
10010 break;
10011 }
10012 }
10013 }
10014 }
10015 if(_class && _class->type == 2)
10016 {
10017 exp->constant = PrintHexUInt(bits);
10018 exp->type = 2;
10019 }
10020 if(exp->type != 1)
10021 {
10022 FreeInstance(inst);
10023 }
10024 }
10025
10026 void CallOperator(struct Expression * exp, struct Expression * exp1, struct Expression * exp2, struct Operand * op1, struct Operand * op2)
10027 {
10028 if(exp->op.op == SIZEOF)
10029 {
10030 FreeExpContents(exp);
10031 exp->type = 2;
10032 exp->constant = PrintUInt(ComputeTypeSize(op1->type));
10033 }
10034 else
10035 {
10036 if(!exp->op.exp1)
10037 {
10038 switch(exp->op.op)
10039 {
10040 case '+':
10041 {
10042 struct Expression * exp2 = exp->op.exp2;
10043
10044 exp->op.exp2 = (((void *)0));
10045 FreeExpContents(exp);
10046 FreeType(exp->expType);
10047 FreeType(exp->destType);
10048 *exp = *exp2;
10049 ((exp2 ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(exp2) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(exp2)) : 0), exp2 = 0);
10050 break;
10051 }
10052 case '-':
10053 if(op1->ops.Neg)
10054 {
10055 FreeExpContents(exp);
10056 op1->ops.Neg(exp, op1);
10057 }
10058 break;
10059 case '~':
10060 if(op1->ops.BitNot)
10061 {
10062 FreeExpContents(exp);
10063 op1->ops.BitNot(exp, op1);
10064 }
10065 break;
10066 case '!':
10067 if(op1->ops.Not)
10068 {
10069 FreeExpContents(exp);
10070 op1->ops.Not(exp, op1);
10071 }
10072 break;
10073 }
10074 }
10075 else
10076 {
10077 switch(exp->op.op)
10078 {
10079 case '+':
10080 if(op1->ops.Add)
10081 {
10082 FreeExpContents(exp);
10083 op1->ops.Add(exp, op1, op2);
10084 }
10085 break;
10086 case '-':
10087 if(op1->ops.Sub)
10088 {
10089 FreeExpContents(exp);
10090 op1->ops.Sub(exp, op1, op2);
10091 }
10092 break;
10093 case '*':
10094 if(op1->ops.Mul)
10095 {
10096 FreeExpContents(exp);
10097 op1->ops.Mul(exp, op1, op2);
10098 }
10099 break;
10100 case '/':
10101 if(op1->ops.Div)
10102 {
10103 FreeExpContents(exp);
10104 op1->ops.Div(exp, op1, op2);
10105 }
10106 break;
10107 case '%':
10108 if(op1->ops.Mod)
10109 {
10110 FreeExpContents(exp);
10111 op1->ops.Mod(exp, op1, op2);
10112 }
10113 break;
10114 case '&':
10115 if(exp->op.exp2)
10116 {
10117 if(op1->ops.BitAnd)
10118 {
10119 FreeExpContents(exp);
10120 op1->ops.BitAnd(exp, op1, op2);
10121 }
10122 }
10123 break;
10124 case '|':
10125 if(op1->ops.BitOr)
10126 {
10127 FreeExpContents(exp);
10128 op1->ops.BitOr(exp, op1, op2);
10129 }
10130 break;
10131 case '^':
10132 if(op1->ops.BitXor)
10133 {
10134 FreeExpContents(exp);
10135 op1->ops.BitXor(exp, op1, op2);
10136 }
10137 break;
10138 case LEFT_OP:
10139 if(op1->ops.LShift)
10140 {
10141 FreeExpContents(exp);
10142 op1->ops.LShift(exp, op1, op2);
10143 }
10144 break;
10145 case RIGHT_OP:
10146 if(op1->ops.RShift)
10147 {
10148 FreeExpContents(exp);
10149 op1->ops.RShift(exp, op1, op2);
10150 }
10151 break;
10152 case EQ_OP:
10153 if(op1->ops.Equ)
10154 {
10155 FreeExpContents(exp);
10156 op1->ops.Equ(exp, op1, op2);
10157 }
10158 break;
10159 case NE_OP:
10160 if(op1->ops.Nqu)
10161 {
10162 FreeExpContents(exp);
10163 op1->ops.Nqu(exp, op1, op2);
10164 }
10165 break;
10166 case AND_OP:
10167 if(op1->ops.And)
10168 {
10169 FreeExpContents(exp);
10170 op1->ops.And(exp, op1, op2);
10171 }
10172 break;
10173 case OR_OP:
10174 if(op1->ops.Or)
10175 {
10176 FreeExpContents(exp);
10177 op1->ops.Or(exp, op1, op2);
10178 }
10179 break;
10180 case '>':
10181 if(op1->ops.Grt)
10182 {
10183 FreeExpContents(exp);
10184 op1->ops.Grt(exp, op1, op2);
10185 }
10186 break;
10187 case '<':
10188 if(op1->ops.Sma)
10189 {
10190 FreeExpContents(exp);
10191 op1->ops.Sma(exp, op1, op2);
10192 }
10193 break;
10194 case GE_OP:
10195 if(op1->ops.GrtEqu)
10196 {
10197 FreeExpContents(exp);
10198 op1->ops.GrtEqu(exp, op1, op2);
10199 }
10200 break;
10201 case LE_OP:
10202 if(op1->ops.SmaEqu)
10203 {
10204 FreeExpContents(exp);
10205 op1->ops.SmaEqu(exp, op1, op2);
10206 }
10207 break;
10208 }
10209 }
10210 }
10211 }
10212
10213 extern struct Expression * MkExpIdentifier(struct Identifier * id);
10214
10215 void ComputeExpression(struct Expression * exp)
10216 {
10217 char expString[10240];
10218
10219 expString[0] = '\0';
10220 switch(exp->type)
10221 {
10222 case 1:
10223 {
10224 ComputeInstantiation(exp);
10225 break;
10226 }
10227 case 4:
10228 {
10229 struct Expression * exp1, * exp2 = (((void *)0));
10230 struct Operand op1 = 
10231 {
10232 0, 0, 0, 0, 
10233 {
10234 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
10235 }
10236 };
10237 struct Operand op2 = 
10238 {
10239 0, 0, 0, 0, 
10240 {
10241 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
10242 }
10243 };
10244
10245 if(exp->op.exp2)
10246 ComputeExpression(exp->op.exp2);
10247 if(exp->op.exp1)
10248 {
10249 ComputeExpression(exp->op.exp1);
10250 exp1 = exp->op.exp1;
10251 exp2 = exp->op.exp2;
10252 op1 = GetOperand(exp1);
10253 if(op1.type)
10254 op1.type->refCount++;
10255 if(exp2)
10256 {
10257 op2 = GetOperand(exp2);
10258 if(op2.type)
10259 op2.type->refCount++;
10260 }
10261 }
10262 else
10263 {
10264 exp1 = exp->op.exp2;
10265 op1 = GetOperand(exp1);
10266 if(op1.type)
10267 op1.type->refCount++;
10268 }
10269 CallOperator(exp, exp1, exp2, &op1, &op2);
10270 if(op1.type)
10271 FreeType(op1.type);
10272 if(op2.type)
10273 FreeType(op2.type);
10274 break;
10275 }
10276 case 5:
10277 case 34:
10278 {
10279 struct Expression * e, * n;
10280
10281 for(e = (*exp->list).first; e; e = n)
10282 {
10283 n = e->next;
10284 if(!n)
10285 {
10286 struct __ecereNameSpace__ecere__sys__OldList * list = exp->list;
10287
10288 ComputeExpression(e);
10289 FreeType(exp->expType);
10290 FreeType(exp->destType);
10291 *exp = *e;
10292 ((e ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(e) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(e)) : 0), e = 0);
10293 (__ecereNameSpace__ecere__com__eSystem_Delete(list), list = 0);
10294 }
10295 else
10296 {
10297 FreeExpression(e);
10298 }
10299 }
10300 break;
10301 }
10302 case 8:
10303 {
10304 struct Expression * memberExp = exp->member.exp;
10305 struct Identifier * memberID = exp->member.member;
10306 struct Type * type;
10307
10308 ComputeExpression(exp->member.exp);
10309 type = exp->member.exp->expType;
10310 if(type)
10311 {
10312 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)));
10313 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
10314 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
10315 struct __ecereNameSpace__ecere__com__Class * convertTo = (((void *)0));
10316
10317 if(type->kind == 19 && exp->member.exp->type == 26)
10318 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "ecere::com::Class");
10319 if(!_class)
10320 {
10321 char string[256];
10322 struct Symbol * classSym;
10323
10324 string[0] = '\0';
10325 PrintType(type, string, 0x0, 0x1);
10326 classSym = FindClass(string);
10327 _class = classSym ? classSym->registered : (((void *)0));
10328 }
10329 if(exp->member.member)
10330 {
10331 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, exp->member.member->string, privateModule);
10332 if(!prop)
10333 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, exp->member.member->string, privateModule, (((void *)0)), (((void *)0)));
10334 }
10335 if(!prop && !member && _class && exp->member.member)
10336 {
10337 struct Symbol * classSym = FindClass(exp->member.member->string);
10338
10339 convertTo = _class;
10340 _class = classSym ? classSym->registered : (((void *)0));
10341 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, convertTo->fullName, privateModule);
10342 }
10343 if(prop)
10344 {
10345 if(prop->compiled)
10346 {
10347 struct Type * type = prop->dataType;
10348
10349 if(_class->type == 3)
10350 {
10351 if(type->kind == 8)
10352 {
10353 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
10354
10355 if(_class->type == 3)
10356 {
10357 if(!_class->dataType)
10358 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
10359 type = _class->dataType;
10360 }
10361 }
10362 switch(type->kind)
10363 {
10364 case 6:
10365 {
10366 float value;
10367 float (* Get)(float) = (void *)prop->Get;
10368
10369 GetFloat(exp->member.exp, &value);
10370 exp->constant = PrintFloat(Get ? Get(value) : value);
10371 exp->type = 2;
10372 break;
10373 }
10374 case 7:
10375 {
10376 double value;
10377 double (* Get)(double);
10378
10379 GetDouble(exp->member.exp, &value);
10380 if(convertTo)
10381 Get = (void *)prop->Set;
10382 else
10383 Get = (void *)prop->Get;
10384 exp->constant = PrintDouble(Get ? Get(value) : value);
10385 exp->type = 2;
10386 break;
10387 }
10388 }
10389 }
10390 else
10391 {
10392 if(convertTo)
10393 {
10394 struct Expression * value = exp->member.exp;
10395 struct Type * type;
10396
10397 if(!prop->dataType)
10398 ProcessPropertyType(prop);
10399 type = prop->dataType;
10400 if(!type)
10401 {
10402 }
10403 else if(_class->type == 1)
10404 {
10405 switch(type->kind)
10406 {
10407 case 8:
10408 {
10409 struct __ecereNameSpace__ecere__com__Class * propertyClass = type->_class->registered;
10410
10411 if(propertyClass->type == 1 && value->type == 1)
10412 {
10413 void (* Set)(void *, void *) = (void *)prop->Set;
10414
10415 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10416 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10417 exp->instance->_class = MkSpecifierName(_class->fullName);
10418 exp->instance->loc = exp->loc;
10419 exp->type = 1;
10420 Set(exp->instance->data, value->instance->data);
10421 PopulateInstance(exp->instance);
10422 }
10423 break;
10424 }
10425 case 3:
10426 {
10427 int intValue;
10428 void (* Set)(void *, int) = (void *)prop->Set;
10429
10430 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10431 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10432 exp->instance->_class = MkSpecifierName(_class->fullName);
10433 exp->instance->loc = exp->loc;
10434 exp->type = 1;
10435 GetInt(value, &intValue);
10436 Set(exp->instance->data, intValue);
10437 PopulateInstance(exp->instance);
10438 break;
10439 }
10440 case 4:
10441 {
10442 long long intValue;
10443 void (* Set)(void *, long long) = (void *)prop->Set;
10444
10445 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10446 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10447 exp->instance->_class = MkSpecifierName(_class->fullName);
10448 exp->instance->loc = exp->loc;
10449 exp->type = 1;
10450 GetInt64(value, &intValue);
10451 Set(exp->instance->data, intValue);
10452 PopulateInstance(exp->instance);
10453 break;
10454 }
10455 case 22:
10456 {
10457 intptr_t intValue;
10458 void (* Set)(void *, intptr_t) = (void *)prop->Set;
10459
10460 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10461 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10462 exp->instance->_class = MkSpecifierName(_class->fullName);
10463 exp->instance->loc = exp->loc;
10464 exp->type = 1;
10465 GetIntPtr(value, &intValue);
10466 Set(exp->instance->data, intValue);
10467 PopulateInstance(exp->instance);
10468 break;
10469 }
10470 case 7:
10471 {
10472 double doubleValue;
10473 void (* Set)(void *, double) = (void *)prop->Set;
10474
10475 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10476 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10477 exp->instance->_class = MkSpecifierName(_class->fullName);
10478 exp->instance->loc = exp->loc;
10479 exp->type = 1;
10480 GetDouble(value, &doubleValue);
10481 Set(exp->instance->data, doubleValue);
10482 PopulateInstance(exp->instance);
10483 break;
10484 }
10485 }
10486 }
10487 else if(_class->type == 2)
10488 {
10489 switch(type->kind)
10490 {
10491 case 8:
10492 {
10493 struct __ecereNameSpace__ecere__com__Class * propertyClass = type->_class->registered;
10494
10495 if(propertyClass->type == 1 && value->instance->data)
10496 {
10497 unsigned int (* Set)(void *) = (void *)prop->Set;
10498 unsigned int bits = Set(value->instance->data);
10499
10500 exp->constant = PrintHexUInt(bits);
10501 exp->type = 2;
10502 break;
10503 }
10504 else if(_class->type == 2)
10505 {
10506 unsigned int value;
10507 unsigned int (* Set)(unsigned int) = (void *)prop->Set;
10508 unsigned int bits;
10509
10510 GetUInt(exp->member.exp, &value);
10511 bits = Set(value);
10512 exp->constant = PrintHexUInt(bits);
10513 exp->type = 2;
10514 }
10515 }
10516 }
10517 }
10518 }
10519 else
10520 {
10521 if(_class->type == 2)
10522 {
10523 unsigned int value;
10524
10525 GetUInt(exp->member.exp, &value);
10526 switch(type->kind)
10527 {
10528 case 8:
10529 {
10530 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
10531
10532 if(_class->type == 1)
10533 {
10534 void (* Get)(unsigned int, void *) = (void *)prop->Get;
10535
10536 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10537 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10538 exp->instance->_class = MkSpecifierName(_class->fullName);
10539 exp->instance->loc = exp->loc;
10540 exp->type = 1;
10541 Get(value, exp->instance->data);
10542 PopulateInstance(exp->instance);
10543 }
10544 else if(_class->type == 2)
10545 {
10546 unsigned int (* Get)(unsigned int) = (void *)prop->Get;
10547 uint64 bits = Get(value);
10548
10549 exp->constant = PrintHexUInt64(bits);
10550 exp->type = 2;
10551 }
10552 break;
10553 }
10554 }
10555 }
10556 else if(_class->type == 1)
10557 {
10558 char * value = (exp->member.exp->type == 1) ? exp->member.exp->instance->data : (((void *)0));
10559
10560 switch(type->kind)
10561 {
10562 case 8:
10563 {
10564 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
10565
10566 if(_class->type == 1 && value)
10567 {
10568 void (* Get)(void *, void *) = (void *)prop->Get;
10569
10570 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10571 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10572 exp->instance->_class = MkSpecifierName(_class->fullName);
10573 exp->instance->loc = exp->loc;
10574 exp->type = 1;
10575 Get(value, exp->instance->data);
10576 PopulateInstance(exp->instance);
10577 }
10578 break;
10579 }
10580 }
10581 }
10582 }
10583 }
10584 }
10585 else
10586 {
10587 exp->isConstant = 0x0;
10588 }
10589 }
10590 else if(member)
10591 {
10592 }
10593 }
10594 if(exp->type != 8)
10595 {
10596 FreeExpression(memberExp);
10597 FreeIdentifier(memberID);
10598 }
10599 break;
10600 }
10601 case 10:
10602 {
10603 struct Type * type = ProcessType(exp->typeName->qualifiers, exp->typeName->declarator);
10604
10605 FreeExpContents(exp);
10606 exp->constant = PrintUInt(ComputeTypeSize(type));
10607 exp->type = 2;
10608 FreeType(type);
10609 break;
10610 }
10611 case 15:
10612 {
10613 struct Symbol * classSym = exp->_class->symbol;
10614
10615 if(classSym && classSym->registered)
10616 {
10617 if(classSym->registered->fixed)
10618 {
10619 FreeSpecifier(exp->_class);
10620 exp->constant = PrintUInt(classSym->registered->templateClass ? classSym->registered->templateClass->structSize : classSym->registered->structSize);
10621 exp->type = 2;
10622 }
10623 else
10624 {
10625 char className[1024];
10626
10627 strcpy(className, "__ecereClass_");
10628 FullClassNameCat(className, classSym->string, 0x1);
10629 MangleClassName(className);
10630 FreeExpContents(exp);
10631 exp->type = 9;
10632 exp->member.exp = MkExpIdentifier(MkIdentifier(className));
10633 exp->member.member = MkIdentifier("structSize");
10634 }
10635 }
10636 break;
10637 }
10638 case 11:
10639 {
10640 struct Type * type;
10641 struct Expression * e = exp;
10642
10643 if(exp->type == 11)
10644 {
10645 if(exp->cast.exp)
10646 ComputeExpression(exp->cast.exp);
10647 e = exp->cast.exp;
10648 }
10649 if(e && exp->expType)
10650 {
10651 type = exp->expType;
10652 if(type->kind == 8)
10653 {
10654 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
10655
10656 if(_class && (_class->type == 3 || _class->type == 2))
10657 {
10658 if(!_class->dataType)
10659 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
10660 type = _class->dataType;
10661 }
10662 }
10663 switch(type->kind)
10664 {
10665 case 1:
10666 if(type->isSigned)
10667 {
10668 char value;
10669
10670 GetChar(e, &value);
10671 FreeExpContents(exp);
10672 exp->constant = PrintChar(value);
10673 exp->type = 2;
10674 }
10675 else
10676 {
10677 unsigned char value;
10678
10679 GetUChar(e, &value);
10680 FreeExpContents(exp);
10681 exp->constant = PrintUChar(value);
10682 exp->type = 2;
10683 }
10684 break;
10685 case 2:
10686 if(type->isSigned)
10687 {
10688 short value;
10689
10690 GetShort(e, &value);
10691 FreeExpContents(exp);
10692 exp->constant = PrintShort(value);
10693 exp->type = 2;
10694 }
10695 else
10696 {
10697 unsigned short value;
10698
10699 GetUShort(e, &value);
10700 FreeExpContents(exp);
10701 exp->constant = PrintUShort(value);
10702 exp->type = 2;
10703 }
10704 break;
10705 case 3:
10706 if(type->isSigned)
10707 {
10708 int value;
10709
10710 GetInt(e, &value);
10711 FreeExpContents(exp);
10712 exp->constant = PrintInt(value);
10713 exp->type = 2;
10714 }
10715 else
10716 {
10717 unsigned int value;
10718
10719 GetUInt(e, &value);
10720 FreeExpContents(exp);
10721 exp->constant = PrintUInt(value);
10722 exp->type = 2;
10723 }
10724 break;
10725 case 4:
10726 if(type->isSigned)
10727 {
10728 long long value;
10729
10730 GetInt64(e, &value);
10731 FreeExpContents(exp);
10732 exp->constant = PrintInt64(value);
10733 exp->type = 2;
10734 }
10735 else
10736 {
10737 uint64 value;
10738
10739 GetUInt64(e, &value);
10740 FreeExpContents(exp);
10741 exp->constant = PrintUInt64(value);
10742 exp->type = 2;
10743 }
10744 break;
10745 case 22:
10746 if(type->isSigned)
10747 {
10748 intptr_t value;
10749
10750 GetIntPtr(e, &value);
10751 FreeExpContents(exp);
10752 exp->constant = PrintInt64((long long)value);
10753 exp->type = 2;
10754 }
10755 else
10756 {
10757 uintptr_t value;
10758
10759 GetUIntPtr(e, &value);
10760 FreeExpContents(exp);
10761 exp->constant = PrintUInt64((uint64)value);
10762 exp->type = 2;
10763 }
10764 break;
10765 case 6:
10766 {
10767 float value;
10768
10769 GetFloat(e, &value);
10770 FreeExpContents(exp);
10771 exp->constant = PrintFloat(value);
10772 exp->type = 2;
10773 break;
10774 }
10775 case 7:
10776 {
10777 double value;
10778
10779 GetDouble(e, &value);
10780 FreeExpContents(exp);
10781 exp->constant = PrintDouble(value);
10782 exp->type = 2;
10783 break;
10784 }
10785 }
10786 }
10787 break;
10788 }
10789 case 12:
10790 {
10791 struct Operand op1 = 
10792 {
10793 0, 0, 0, 0, 
10794 {
10795 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
10796 }
10797 };
10798 struct Operand op2 = 
10799 {
10800 0, 0, 0, 0, 
10801 {
10802 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
10803 }
10804 };
10805 struct Operand op3 = 
10806 {
10807 0, 0, 0, 0, 
10808 {
10809 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
10810 }
10811 };
10812
10813 if(exp->cond.exp)
10814 ComputeExpression((*exp->cond.exp).last);
10815 if(exp->cond.elseExp)
10816 ComputeExpression(exp->cond.elseExp);
10817 if(exp->cond.cond)
10818 ComputeExpression(exp->cond.cond);
10819 op1 = GetOperand(exp->cond.cond);
10820 if(op1.type)
10821 op1.type->refCount++;
10822 op2 = GetOperand((*exp->cond.exp).last);
10823 if(op2.type)
10824 op2.type->refCount++;
10825 op3 = GetOperand(exp->cond.elseExp);
10826 if(op3.type)
10827 op3.type->refCount++;
10828 if(op1.ops.Cond)
10829 {
10830 FreeExpContents(exp);
10831 op1.ops.Cond(exp, &op1, &op2, &op3);
10832 }
10833 if(op1.type)
10834 FreeType(op1.type);
10835 if(op2.type)
10836 FreeType(op2.type);
10837 if(op3.type)
10838 FreeType(op3.type);
10839 break;
10840 }
10841 }
10842 }
10843
10844 void ApplyAnyObjectLogic(struct Expression * e);
10845
10846 extern void CopyTypeInto(struct Type * type, struct Type * src);
10847
10848 static unsigned int CheckExpressionType(struct Expression * exp, struct Type * destType, unsigned int skipUnitBla)
10849 {
10850 unsigned int result = 0x1;
10851
10852 if(destType)
10853 {
10854 struct __ecereNameSpace__ecere__sys__OldList converts = 
10855 {
10856 0, 0, 0, 0, 0
10857 };
10858 struct Conversion * convert;
10859
10860 if(destType->kind == 0)
10861 return 0x0;
10862 if(!MatchTypeExpression(exp, destType, &converts, skipUnitBla))
10863 result = 0x0;
10864 if(converts.count)
10865 {
10866 for(convert = converts.first; convert; convert = convert->next)
10867 {
10868 unsigned int empty = !(convert->isGet ? (void *)convert->convert->Get : (void *)convert->convert->Set);
10869
10870 if(!empty)
10871 {
10872 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
10873 int objectType = exp->expType ? exp->expType->classObjectType : 0;
10874
10875 *newExp = *exp;
10876 newExp->destType = (((void *)0));
10877 if(convert->isGet)
10878 {
10879 exp->type = 8;
10880 exp->addedThis = 0x1;
10881 exp->member.exp = newExp;
10882 FreeType(exp->member.exp->expType);
10883 exp->member.exp->expType = MkClassType(convert->convert->_class->fullName);
10884 exp->member.exp->expType->classObjectType = objectType;
10885 exp->member.member = MkIdentifier(convert->convert->dataTypeString);
10886 exp->member.memberType = 1;
10887 exp->expType = convert->resultType ? convert->resultType : convert->convert->dataType;
10888 exp->needCast = 0x1;
10889 if(exp->expType)
10890 exp->expType->refCount++;
10891 ApplyAnyObjectLogic(exp->member.exp);
10892 }
10893 else
10894 {
10895 {
10896 exp->type = 8;
10897 exp->addedThis = 0x1;
10898 exp->member.exp = newExp;
10899 if(newExp->expType && newExp->expType->kind == 8 && newExp->expType->_class && newExp->expType->_class->registered && newExp->expType->_class->registered->type == 5)
10900 {
10901 newExp->byReference = 0x1;
10902 }
10903 FreeType(exp->member.exp->expType);
10904 exp->member.exp->expType = (((void *)0));
10905 if(convert->convert->dataType)
10906 {
10907 exp->member.exp->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
10908 CopyTypeInto(exp->member.exp->expType, convert->convert->dataType);
10909 exp->member.exp->expType->refCount = 1;
10910 exp->member.exp->expType->classObjectType = objectType;
10911 ApplyAnyObjectLogic(exp->member.exp);
10912 }
10913 exp->member.member = MkIdentifier(convert->convert->_class->fullName);
10914 exp->member.memberType = 4;
10915 exp->expType = convert->resultType ? convert->resultType : MkClassType(convert->convert->_class->fullName);
10916 exp->needCast = 0x1;
10917 if(convert->resultType)
10918 convert->resultType->refCount++;
10919 }
10920 }
10921 }
10922 else
10923 {
10924 FreeType(exp->expType);
10925 if(convert->isGet)
10926 {
10927 exp->expType = convert->resultType ? convert->resultType : convert->convert->dataType;
10928 exp->needCast = 0x1;
10929 if(exp->expType)
10930 exp->expType->refCount++;
10931 }
10932 else
10933 {
10934 exp->expType = convert->resultType ? convert->resultType : MkClassType(convert->convert->_class->fullName);
10935 exp->needCast = 0x1;
10936 if(convert->resultType)
10937 convert->resultType->refCount++;
10938 }
10939 }
10940 }
10941 if(exp->isConstant && inCompiler)
10942 ComputeExpression(exp);
10943 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(&converts, FreeConvert);
10944 }
10945 if(!result && exp->expType && converts.count)
10946 {
10947 result = MatchTypes(exp->expType, exp->destType, (((void *)0)), (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0);
10948 }
10949 if(!result && exp->expType && exp->destType)
10950 {
10951 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))
10952 result = 0x1;
10953 }
10954 }
10955 return result;
10956 }
10957
10958 extern struct Statement * MkCompoundStmt(struct __ecereNameSpace__ecere__sys__OldList * declarations, struct __ecereNameSpace__ecere__sys__OldList * statements);
10959
10960 extern struct Statement * MkExpressionStmt(struct __ecereNameSpace__ecere__sys__OldList * expressions);
10961
10962 extern struct Expression * MkExpMember(struct Expression * expression, struct Identifier * member);
10963
10964 void CheckTemplateTypes(struct Expression * exp)
10965 {
10966 if(exp->destType && exp->destType->passAsTemplate && exp->expType && exp->expType->kind != 20 && !exp->expType->passAsTemplate)
10967 {
10968 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
10969 struct Statement * compound;
10970 struct Context * context;
10971
10972 *newExp = *exp;
10973 if(exp->destType)
10974 exp->destType->refCount++;
10975 if(exp->expType)
10976 exp->expType->refCount++;
10977 newExp->prev = (((void *)0));
10978 newExp->next = (((void *)0));
10979 switch(exp->expType->kind)
10980 {
10981 case 7:
10982 if(exp->destType->classObjectType)
10983 {
10984 if(exp->destType)
10985 exp->destType->refCount--;
10986 if(exp->expType)
10987 exp->expType->refCount--;
10988 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
10989 }
10990 else
10991 {
10992 struct __ecereNameSpace__ecere__sys__OldList * specs;
10993 struct __ecereNameSpace__ecere__sys__OldList * unionDefs = MkList();
10994 struct __ecereNameSpace__ecere__sys__OldList * statements = MkList();
10995
10996 context = PushContext();
10997 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(DOUBLE)), MkListOne(MkDeclaratorIdentifier(MkIdentifier("d"))), (((void *)0)))));
10998 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifierName("uint64")), MkListOne(MkDeclaratorIdentifier(MkIdentifier("i"))), (((void *)0)))));
10999 specs = MkListOne(MkStructOrUnion(4, (((void *)0)), unionDefs));
11000 exp->type = 25;
11001 exp->compound = MkCompoundStmt(MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internal_union")), (((void *)0)))))), statements);
11002 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("d")), '=', newExp))));
11003 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("i")))));
11004 exp->compound->compound.context = context;
11005 PopContext(context);
11006 }
11007 break;
11008 default:
11009 exp->type = 11;
11010 exp->cast.typeName = MkTypeName(MkListOne(MkSpecifierName("uint64")), (((void *)0)));
11011 exp->cast.exp = MkExpBrackets(MkListOne(newExp));
11012 break;
11013 }
11014 }
11015 else if(exp->expType && exp->expType->passAsTemplate && exp->destType && ((unsigned int)((exp->usage & 0x1) >> 0)) && exp->destType->kind != 20 && !exp->destType->passAsTemplate)
11016 {
11017 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
11018 struct Statement * compound;
11019 struct Context * context;
11020
11021 *newExp = *exp;
11022 if(exp->destType)
11023 exp->destType->refCount++;
11024 if(exp->expType)
11025 exp->expType->refCount++;
11026 newExp->prev = (((void *)0));
11027 newExp->next = (((void *)0));
11028 switch(exp->expType->kind)
11029 {
11030 case 7:
11031 if(exp->destType->classObjectType)
11032 {
11033 if(exp->destType)
11034 exp->destType->refCount--;
11035 if(exp->expType)
11036 exp->expType->refCount--;
11037 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
11038 }
11039 else
11040 {
11041 struct __ecereNameSpace__ecere__sys__OldList * specs;
11042 struct __ecereNameSpace__ecere__sys__OldList * unionDefs = MkList();
11043 struct __ecereNameSpace__ecere__sys__OldList * statements = MkList();
11044
11045 context = PushContext();
11046 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(DOUBLE)), MkListOne(MkDeclaratorIdentifier(MkIdentifier("d"))), (((void *)0)))));
11047 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifierName("uint64")), MkListOne(MkDeclaratorIdentifier(MkIdentifier("i"))), (((void *)0)))));
11048 specs = MkListOne(MkStructOrUnion(4, (((void *)0)), unionDefs));
11049 exp->type = 25;
11050 exp->compound = MkCompoundStmt(MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internal_union")), (((void *)0)))))), statements);
11051 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("i")), '=', newExp))));
11052 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("d")))));
11053 exp->compound->compound.context = context;
11054 PopContext(context);
11055 }
11056 break;
11057 case 8:
11058 {
11059 if(exp->expType->_class && exp->expType->_class->registered && exp->expType->_class->registered->type == 1)
11060 {
11061 exp->type = 5;
11062 exp->list = MkListOne(MkExpOp((((void *)0)), '*', MkExpCast(MkTypeName(MkListOne(MkSpecifierName(exp->expType->_class->string)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), newExp)));
11063 ProcessExpressionType((*exp->list).first);
11064 break;
11065 }
11066 else
11067 {
11068 exp->type = 5;
11069 exp->list = MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName(exp->expType->_class->string)), (((void *)0))), newExp));
11070 newExp->needCast = 0x1;
11071 ProcessExpressionType((*exp->list).first);
11072 break;
11073 }
11074 }
11075 default:
11076 {
11077 if(exp->expType->kind == 20)
11078 {
11079 struct Type * type = ProcessTemplateParameterType(exp->expType->templateParameter);
11080
11081 if(type)
11082 {
11083 FreeType(exp->destType);
11084 FreeType(exp->expType);
11085 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
11086 break;
11087 }
11088 }
11089 if(newExp->type == 8 && newExp->member.memberType == 3)
11090 {
11091 exp->type = 4;
11092 exp->op.op = '*';
11093 exp->op.exp1 = (((void *)0));
11094 exp->op.exp2 = MkExpCast(MkTypeName(MkListOne(MkSpecifierName("uint64")), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), MkExpBrackets(MkListOne(MkExpOp((((void *)0)), '&', newExp))));
11095 }
11096 else
11097 {
11098 char typeString[1024];
11099 struct Declarator * decl;
11100 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
11101
11102 typeString[0] = '\0';
11103 PrintType(exp->expType, typeString, 0x0, 0x0);
11104 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
11105 exp->type = 11;
11106 exp->cast.typeName = MkTypeName(specs, decl);
11107 exp->cast.exp = MkExpBrackets(MkListOne(newExp));
11108 exp->cast.exp->needCast = 0x1;
11109 }
11110 break;
11111 }
11112 }
11113 }
11114 }
11115
11116 extern int strncmp(const char * , const char * , int n);
11117
11118 struct __ecereNameSpace__ecere__sys__BTNode * __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindPrefix(struct __ecereNameSpace__ecere__sys__BinaryTree * this, char *  key);
11119
11120 static struct Symbol * ScanWithNameSpace(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, char * nameSpace, char * name)
11121 {
11122 int nsLen = strlen(nameSpace);
11123 struct Symbol * symbol;
11124
11125 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)))
11126 {
11127 char * s = symbol->string;
11128
11129 if(!strncmp(s, nameSpace, nsLen))
11130 {
11131 int c;
11132 char * namePart;
11133
11134 for(c = strlen(s) - 1; c >= 0; c--)
11135 if(s[c] == ':')
11136 break;
11137 namePart = s + c + 1;
11138 if(!strcmp(namePart, name))
11139 {
11140 return symbol;
11141 }
11142 }
11143 else
11144 break;
11145 }
11146 return (((void *)0));
11147 }
11148
11149 static struct Symbol * FindWithNameSpace(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, char * name)
11150 {
11151 int c;
11152 char nameSpace[1024];
11153 char * namePart;
11154 unsigned int gotColon = 0x0;
11155
11156 nameSpace[0] = '\0';
11157 for(c = strlen(name) - 1; c >= 0; c--)
11158 if(name[c] == ':')
11159 {
11160 gotColon = 0x1;
11161 break;
11162 }
11163 namePart = name + c + 1;
11164 while(c >= 0 && name[c] == ':')
11165 c--;
11166 if(c >= 0)
11167 {
11168 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, name);
11169
11170 if(symbol)
11171 return symbol;
11172 memcpy(nameSpace, name, c + 1);
11173 nameSpace[c + 1] = (char)0;
11174 return ScanWithNameSpace(tree, nameSpace, namePart);
11175 }
11176 else if(gotColon)
11177 {
11178 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, namePart);
11179
11180 return symbol;
11181 }
11182 else
11183 {
11184 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, namePart);
11185
11186 if(symbol)
11187 return symbol;
11188 return ScanWithNameSpace(tree, "", namePart);
11189 }
11190 return (((void *)0));
11191 }
11192
11193 static void ProcessDeclaration(struct Declaration * decl);
11194
11195 struct Symbol * FindSymbol(char * name, struct Context * startContext, struct Context * endContext, unsigned int isStruct, unsigned int globalNameSpace)
11196 {
11197 struct Context * ctx;
11198 struct Symbol * symbol = (((void *)0));
11199
11200 for(ctx = startContext; ctx && !symbol; ctx = ctx->parent)
11201 {
11202 if(ctx == globalContext && !globalNameSpace && ctx->hasNameSpace)
11203 {
11204 symbol = (((void *)0));
11205 if(thisNameSpace)
11206 {
11207 char curName[1024];
11208
11209 strcpy(curName, thisNameSpace);
11210 strcat(curName, "::");
11211 strcat(curName, name);
11212 symbol = FindWithNameSpace(isStruct ? &ctx->structSymbols : &ctx->symbols, curName);
11213 }
11214 if(!symbol)
11215 symbol = FindWithNameSpace(isStruct ? &ctx->structSymbols : &ctx->symbols, name);
11216 }
11217 else
11218 symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString((isStruct ? &ctx->structSymbols : &ctx->symbols), name);
11219 if(symbol || ctx == endContext)
11220 break;
11221 }
11222 if(inCompiler && curExternal && symbol && ctx == globalContext && curExternal->symbol && symbol->id > curExternal->symbol->idCode && symbol->pointerExternal)
11223 {
11224 if(symbol->pointerExternal->type == 0)
11225 {
11226 struct FunctionDefinition * function = symbol->pointerExternal->function;
11227 struct Context * tmpContext = curContext;
11228
11229 curContext = (((void *)0));
11230 symbol->pointerExternal = MkExternalDeclaration(MkDeclaration(CopyList(function->specifiers, CopySpecifier), MkListOne(MkInitDeclarator(CopyDeclarator(function->declarator), (((void *)0))))));
11231 curContext = tmpContext;
11232 symbol->pointerExternal->symbol = symbol;
11233 DeclareType(symbol->type, 0x1, 0x1);
11234 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, symbol->pointerExternal);
11235 symbol->id = curExternal->symbol->idCode;
11236 }
11237 else if(symbol->pointerExternal->type == 1 && curExternal->symbol->idCode < symbol->pointerExternal->symbol->id)
11238 {
11239 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
11240 symbol->id = curExternal->symbol->idCode;
11241 }
11242 }
11243 return symbol;
11244 }
11245
11246 static void GetTypeSpecs(struct Type * type, struct __ecereNameSpace__ecere__sys__OldList * specs)
11247 {
11248 if(!type->isSigned && type->kind != 22)
11249 ListAdd(specs, MkSpecifier(UNSIGNED));
11250 switch(type->kind)
11251 {
11252 case 8:
11253 {
11254 if(type->_class->registered)
11255 {
11256 if(!type->_class->registered->dataType)
11257 type->_class->registered->dataType = ProcessTypeString(type->_class->registered->dataTypeString, 0x0);
11258 GetTypeSpecs(type->_class->registered->dataType, specs);
11259 }
11260 break;
11261 }
11262 case 7:
11263 ListAdd(specs, MkSpecifier(DOUBLE));
11264 break;
11265 case 6:
11266 ListAdd(specs, MkSpecifier(FLOAT));
11267 break;
11268 case 1:
11269 ListAdd(specs, MkSpecifier(CHAR));
11270 break;
11271 case 2:
11272 ListAdd(specs, MkSpecifier(SHORT));
11273 break;
11274 case 4:
11275 ListAdd(specs, MkSpecifier(INT64));
11276 break;
11277 case 22:
11278 ListAdd(specs, MkSpecifierName(type->isSigned ? "intptr" : "uintptr"));
11279 break;
11280 case 3:
11281 default:
11282 ListAdd(specs, MkSpecifier(INT));
11283 break;
11284 }
11285 }
11286
11287 extern char *  __ecereNameSpace__ecere__sys__RSearchString(char *  buffer, char *  subStr, int maxLen, unsigned int matchCase, unsigned int matchWord);
11288
11289 static void _PrintType(struct Type * type, char * string, unsigned int printName, unsigned int printFunction, unsigned int fullName)
11290 {
11291 if(type)
11292 {
11293 switch(type->kind)
11294 {
11295 case 8:
11296 if(type->_class && type->_class->string)
11297 {
11298 if(type->classObjectType == 2)
11299 strcat(string, "typed_object");
11300 else if(fullName)
11301 strcat(string, type->_class->string);
11302 else
11303 {
11304 if(type->_class->registered)
11305 strcat(string, type->_class->registered->name);
11306 else
11307 strcat(string, type->_class->string);
11308 }
11309 }
11310 break;
11311 case 13:
11312 {
11313 {
11314 _PrintType(type->type, string, 0x0, printFunction, fullName);
11315 strcat(string, " *");
11316 }
11317 break;
11318 }
11319 case 0:
11320 strcat(string, "void");
11321 break;
11322 case 3:
11323 strcat(string, type->isSigned ? "int" : "uint");
11324 break;
11325 case 4:
11326 strcat(string, type->isSigned ? "int64" : "uint64");
11327 break;
11328 case 22:
11329 strcat(string, type->isSigned ? "intptr" : "uintptr");
11330 break;
11331 case 1:
11332 strcat(string, type->isSigned ? "char" : "byte");
11333 break;
11334 case 2:
11335 strcat(string, type->isSigned ? "short" : "uint16");
11336 break;
11337 case 6:
11338 strcat(string, "float");
11339 break;
11340 case 7:
11341 strcat(string, "double");
11342 break;
11343 case 9:
11344 if(type->enumName)
11345 {
11346 strcat(string, "struct ");
11347 strcat(string, type->enumName);
11348 }
11349 else if(type->typeName)
11350 {
11351 strcat(string, type->typeName);
11352 }
11353 else
11354 {
11355 struct Type * member;
11356
11357 strcat(string, "struct {");
11358 for(member = type->members.first; member; member = member->next)
11359 {
11360 PrintType(member, string, 0x1, fullName);
11361 strcat(string, "; ");
11362 }
11363 strcat(string, "}");
11364 }
11365 break;
11366 case 10:
11367 if(type->enumName)
11368 {
11369 strcat(string, "union ");
11370 strcat(string, type->enumName);
11371 }
11372 else if(type->typeName)
11373 {
11374 strcat(string, type->typeName);
11375 }
11376 else
11377 {
11378 strcat(string, "union ");
11379 strcat(string, "(unnamed)");
11380 }
11381 break;
11382 case 15:
11383 if(type->enumName)
11384 {
11385 strcat(string, "enum ");
11386 strcat(string, type->enumName);
11387 }
11388 else if(type->typeName)
11389 {
11390 strcat(string, type->typeName);
11391 }
11392 else
11393 strcat(string, "enum");
11394 break;
11395 case 11:
11396 {
11397 if(printFunction)
11398 {
11399 if(type->dllExport)
11400 strcat(string, "dllexport ");
11401 PrintType(type->returnType, string, 0x0, fullName);
11402 strcat(string, " ");
11403 }
11404 if(printName)
11405 {
11406 if(type->name)
11407 {
11408 if(fullName)
11409 strcat(string, type->name);
11410 else
11411 {
11412 char * name = __ecereNameSpace__ecere__sys__RSearchString(type->name, "::", strlen(type->name), 0x1, 0x0);
11413
11414 if(name)
11415 name += 2;
11416 else
11417 name = type->name;
11418 strcat(string, name);
11419 }
11420 }
11421 }
11422 if(printFunction)
11423 {
11424 struct Type * param;
11425
11426 strcat(string, "(");
11427 for(param = type->params.first; param; param = param->next)
11428 {
11429 PrintType(param, string, 0x1, fullName);
11430 if(param->next)
11431 strcat(string, ", ");
11432 }
11433 strcat(string, ")");
11434 }
11435 break;
11436 }
11437 case 12:
11438 {
11439 {
11440 char baseType[1024], size[256];
11441 struct Type * arrayType = type;
11442
11443 baseType[0] = '\0';
11444 size[0] = '\0';
11445 while(arrayType->kind == 12)
11446 {
11447 strcat(size, "[");
11448 if(arrayType->enumClass)
11449 strcat(size, arrayType->enumClass->string);
11450 else if(arrayType->arraySizeExp)
11451 PrintExpression(arrayType->arraySizeExp, size);
11452 strcat(size, "]");
11453 arrayType = arrayType->arrayType;
11454 }
11455 _PrintType(arrayType, baseType, printName, printFunction, fullName);
11456 strcat(string, baseType);
11457 strcat(string, size);
11458 }
11459 printName = 0x0;
11460 break;
11461 }
11462 case 14:
11463 strcat(string, "...");
11464 break;
11465 case 16:
11466 _PrintType(type->method->dataType, string, 0x0, printFunction, fullName);
11467 break;
11468 case 19:
11469 strcat(string, "subclass(");
11470 strcat(string, type->_class ? type->_class->string : "int");
11471 strcat(string, ")");
11472 break;
11473 case 20:
11474 strcat(string, type->templateParameter->identifier->string);
11475 break;
11476 case 21:
11477 strcat(string, "thisclass");
11478 break;
11479 case 17:
11480 strcat(string, "__builtin_va_list");
11481 break;
11482 }
11483 if(type->name && printName && type->kind != 11 && (type->kind != 13 || type->type->kind != 11))
11484 {
11485 strcat(string, " ");
11486 strcat(string, type->name);
11487 }
11488 }
11489 }
11490
11491 void PrintType(struct Type * type, char * string, unsigned int printName, unsigned int fullName)
11492 {
11493 struct Type * funcType;
11494
11495 for(funcType = type; funcType && (funcType->kind == 13 || funcType->kind == 12); funcType = funcType->type)
11496 ;
11497 if(funcType && funcType->kind == 11 && type != funcType)
11498 {
11499 char typeString[1024];
11500 struct Type * param;
11501
11502 PrintType(funcType->returnType, string, 0x0, fullName);
11503 strcat(string, "(");
11504 _PrintType(type, string, printName, 0x0, fullName);
11505 strcat(string, ")");
11506 strcat(string, "(");
11507 for(param = funcType->params.first; param; param = param->next)
11508 {
11509 PrintType(param, string, 0x1, fullName);
11510 if(param->next)
11511 strcat(string, ", ");
11512 }
11513 strcat(string, ")");
11514 }
11515 else
11516 _PrintType(type, string, printName, 0x1, fullName);
11517 if(type->bitFieldCount)
11518 {
11519 char count[100];
11520
11521 sprintf(count, ":%d", type->bitFieldCount);
11522 strcat(string, count);
11523 }
11524 }
11525
11526 static struct Type * FindMember(struct Type * type, char * string)
11527 {
11528 struct Type * memberType;
11529
11530 for(memberType = type->members.first; memberType; memberType = memberType->next)
11531 {
11532 if(!memberType->name)
11533 {
11534 struct Type * subType = FindMember(memberType, string);
11535
11536 if(subType)
11537 return subType;
11538 }
11539 else if(!strcmp(memberType->name, string))
11540 return memberType;
11541 }
11542 return (((void *)0));
11543 }
11544
11545 struct Type * FindMemberAndOffset(struct Type * type, char * string, unsigned int * offset)
11546 {
11547 struct Type * memberType;
11548
11549 for(memberType = type->members.first; memberType; memberType = memberType->next)
11550 {
11551 if(!memberType->name)
11552 {
11553 struct Type * subType = FindMember(memberType, string);
11554
11555 if(subType)
11556 {
11557 *offset += memberType->offset;
11558 return subType;
11559 }
11560 }
11561 else if(!strcmp(memberType->name, string))
11562 {
11563 *offset += memberType->offset;
11564 return memberType;
11565 }
11566 }
11567 return (((void *)0));
11568 }
11569
11570 extern struct __ecereNameSpace__ecere__com__Instance * fileInput;
11571
11572 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Write;
11573
11574 struct Expression * ParseExpressionString(char * expression)
11575 {
11576 fileInput = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
11577 ((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));
11578 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))fileInput->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(fileInput, 0, 0);
11579 echoOn = 0x0;
11580 parsedExpression = (((void *)0));
11581 resetScanner();
11582 expression_yyparse();
11583 (__ecereNameSpace__ecere__com__eInstance_DecRef(fileInput), fileInput = 0);
11584 return parsedExpression;
11585 }
11586
11587 extern char *  QMkString(char *  source);
11588
11589 static unsigned int ResolveIdWithClass(struct Expression * exp, struct __ecereNameSpace__ecere__com__Class * _class, unsigned int skipIDClassCheck)
11590 {
11591 void * __ecereTemp1;
11592 struct Identifier * id = exp->identifier;
11593 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
11594 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
11595 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
11596 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
11597
11598 if(_class && _class->type == 4)
11599 {
11600 struct __ecereNameSpace__ecere__sys__NamedLink * value = (((void *)0));
11601 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
11602
11603 if(enumClass)
11604 {
11605 struct __ecereNameSpace__ecere__com__Class * baseClass;
11606
11607 for(baseClass = _class; baseClass && baseClass->type == 4; baseClass = baseClass->base)
11608 {
11609 struct __ecereNameSpace__ecere__com__EnumClassData * e = (baseClass ? ((void *)(((char *)baseClass->data) + enumClass->offsetClass)) : (((void *)0)));
11610
11611 for(value = e->values.first; value; value = value->next)
11612 {
11613 if(!strcmp(value->name, id->string))
11614 break;
11615 }
11616 if(value)
11617 {
11618 char constant[256];
11619
11620 FreeExpContents(exp);
11621 exp->type = 2;
11622 exp->isConstant = 0x1;
11623 if(!strcmp(baseClass->dataTypeString, "int"))
11624 sprintf(constant, "%d", value->data);
11625 else
11626 sprintf(constant, "0x%X", value->data);
11627 exp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
11628 exp->expType = MkClassType(baseClass->fullName);
11629 break;
11630 }
11631 }
11632 }
11633 if(value)
11634 return 0x1;
11635 }
11636 if((method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule)))
11637 {
11638 ProcessMethodType(method);
11639 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));
11640 return 0x1;
11641 }
11642 else if((prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule)))
11643 {
11644 if(!prop->dataType)
11645 ProcessPropertyType(prop);
11646 exp->expType = prop->dataType;
11647 if(prop->dataType)
11648 prop->dataType->refCount++;
11649 return 0x1;
11650 }
11651 else if((member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)))))
11652 {
11653 if(!member->dataType)
11654 member->dataType = ProcessTypeString(member->dataTypeString, 0x0);
11655 exp->expType = member->dataType;
11656 if(member->dataType)
11657 member->dataType->refCount++;
11658 return 0x1;
11659 }
11660 else if((classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(_class, id->string)))
11661 {
11662 if(!classProp->dataType)
11663 classProp->dataType = ProcessTypeString(classProp->dataTypeString, 0x0);
11664 if(classProp->constant)
11665 {
11666 FreeExpContents(exp);
11667 exp->isConstant = 0x1;
11668 if(classProp->dataType->kind == 13 && classProp->dataType->type->kind == 1)
11669 {
11670 exp->type = 3;
11671 exp->constant = QMkString((char *)classProp->Get(_class));
11672 }
11673 else
11674 {
11675 char constant[256];
11676
11677 exp->type = 2;
11678 sprintf(constant, "%d", classProp->Get(_class));
11679 exp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
11680 }
11681 }
11682 else
11683 {
11684 }
11685 exp->expType = classProp->dataType;
11686 if(classProp->dataType)
11687 classProp->dataType->refCount++;
11688 return 0x1;
11689 }
11690 return 0x0;
11691 }
11692
11693 static struct GlobalData * ScanGlobalData(struct __ecereNameSpace__ecere__com__NameSpace * nameSpace, char * name)
11694 {
11695 struct __ecereNameSpace__ecere__sys__BinaryTree * tree = &nameSpace->functions;
11696 struct GlobalData * data = (struct GlobalData *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString((&*tree), name);
11697 struct __ecereNameSpace__ecere__com__NameSpace * child;
11698
11699 if(!data)
11700 {
11701 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)))
11702 {
11703 data = ScanGlobalData(child, name);
11704 if(data)
11705 break;
11706 }
11707 }
11708 return data;
11709 }
11710
11711 extern struct __ecereNameSpace__ecere__com__NameSpace *  globalData;
11712
11713 extern char *  strncpy(char * , const char * , int n);
11714
11715 static struct GlobalData * FindGlobalData(char * name)
11716 {
11717 int start = 0, c;
11718 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
11719
11720 nameSpace = globalData;
11721 for(c = 0; name[c]; c++)
11722 {
11723 if(name[c] == '.' || (name[c] == ':' && name[c + 1] == ':'))
11724 {
11725 struct __ecereNameSpace__ecere__com__NameSpace * newSpace;
11726 char * spaceName = __ecereNameSpace__ecere__com__eSystem_New(sizeof(char) * (c - start + 1));
11727
11728 strncpy(spaceName, name + start, c - start);
11729 spaceName[c - start] = '\0';
11730 newSpace = (struct __ecereNameSpace__ecere__com__NameSpace *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(&(*nameSpace).nameSpaces, spaceName);
11731 (__ecereNameSpace__ecere__com__eSystem_Delete(spaceName), spaceName = 0);
11732 if(!newSpace)
11733 return (((void *)0));
11734 nameSpace = newSpace;
11735 if(name[c] == ':')
11736 c++;
11737 start = c + 1;
11738 }
11739 }
11740 if(c - start)
11741 {
11742 return ScanGlobalData(nameSpace, name + start);
11743 }
11744 return (((void *)0));
11745 }
11746
11747 static int definedExpStackPos;
11748
11749 static void * definedExpStack[512];
11750
11751 void ReplaceExpContents(struct Expression * checkedExp, struct Expression * newExp)
11752 {
11753 struct Expression * prev = checkedExp->prev, * next = checkedExp->next;
11754
11755 FreeExpContents(checkedExp);
11756 FreeType(checkedExp->expType);
11757 FreeType(checkedExp->destType);
11758 *checkedExp = *newExp;
11759 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
11760 checkedExp->prev = prev;
11761 checkedExp->next = next;
11762 }
11763
11764 extern struct Expression * MkExpCall(struct Expression * expression, struct __ecereNameSpace__ecere__sys__OldList * arguments);
11765
11766 extern int printf(char * , ...);
11767
11768 void __ecereMethod_Expression_Clear();
11769
11770 void ApplyAnyObjectLogic(struct Expression * e)
11771 {
11772 struct Type * destType = e->destType;
11773
11774 if(destType && (destType->classObjectType == 3))
11775 {
11776 if(e && e->expType)
11777 {
11778 struct Type * type = e->expType;
11779 struct __ecereNameSpace__ecere__com__Class * _class = (((void *)0));
11780
11781 if(type->kind == 8 && type->_class && type->_class->registered)
11782 {
11783 _class = type->_class->registered;
11784 }
11785 else if(type->kind == 19)
11786 {
11787 _class = FindClass("ecere::com::Class")->registered;
11788 }
11789 else
11790 {
11791 char string[1024] = "";
11792 struct Symbol * classSym;
11793
11794 PrintType(type, string, 0x0, 0x1);
11795 classSym = FindClass(string);
11796 if(classSym)
11797 _class = classSym->registered;
11798 }
11799 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)))
11800 {
11801 if(!_class || strcmp(_class->fullName, "char *"))
11802 {
11803 struct Expression * checkedExp = e, * newExp;
11804
11805 while(((checkedExp->type == 5 || checkedExp->type == 34 || checkedExp->type == 25) && checkedExp->list) || checkedExp->type == 11)
11806 {
11807 if(checkedExp->type == 5 || checkedExp->type == 34 || checkedExp->type == 25)
11808 {
11809 if(checkedExp->type == 25)
11810 {
11811 checkedExp = (*((struct Statement *)(*checkedExp->compound->compound.statements).last)->expressions).last;
11812 }
11813 else
11814 checkedExp = (*checkedExp->list).last;
11815 }
11816 else if(checkedExp->type == 11)
11817 checkedExp = checkedExp->cast.exp;
11818 }
11819 if(checkedExp && checkedExp->type == 4 && checkedExp->op.op == '*' && !checkedExp->op.exp1)
11820 {
11821 newExp = checkedExp->op.exp2;
11822 checkedExp->op.exp2 = (((void *)0));
11823 FreeExpContents(checkedExp);
11824 if(e->expType && e->expType->passAsTemplate)
11825 {
11826 char size[100];
11827
11828 ComputeTypeSize(e->expType);
11829 sprintf(size, "%d", e->expType->size);
11830 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))))));
11831 }
11832 ReplaceExpContents(checkedExp, newExp);
11833 e->byReference = 0x1;
11834 }
11835 else if(!e->byReference || (_class && _class->type == 5))
11836 {
11837 struct Expression * checkedExp, * newExp;
11838
11839 {
11840 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;
11841
11842 if(_class && _class->type != 5 && _class->type != 0 && _class->type != 1 && !hasAddress)
11843 {
11844 struct Context * context = PushContext();
11845 struct Declarator * decl;
11846 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
11847 char typeString[1024];
11848 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
11849
11850 typeString[0] = '\0';
11851 *newExp = *e;
11852 newExp->prev = (((void *)0));
11853 newExp->next = (((void *)0));
11854 newExp->expType = (((void *)0));
11855 PrintType(e->expType, typeString, 0x0, 0x1);
11856 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
11857 newExp->destType = ProcessType(specs, decl);
11858 curContext = context;
11859 e->type = 25;
11860 if(curCompound)
11861 {
11862 char name[100];
11863 struct __ecereNameSpace__ecere__sys__OldList * stmts = MkList();
11864
11865 sprintf(name, "__internalValue%03X", internalValueCounter++);
11866 if(!curCompound->compound.declarations)
11867 curCompound->compound.declarations = MkList();
11868 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*curCompound->compound.declarations), (((void *)0)), MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(name)), (((void *)0))))));
11869 ListAdd(stmts, MkExpressionStmt(MkListOne(MkExpOp(MkExpIdentifier(MkIdentifier(name)), '=', newExp))));
11870 ListAdd(stmts, MkExpressionStmt(MkListOne(MkExpIdentifier(MkIdentifier(name)))));
11871 e->compound = MkCompoundStmt((((void *)0)), stmts);
11872 }
11873 else
11874 printf("libec: compiler error, curCompound is null in ApplyAnyObjectLogic\n");
11875 {
11876 struct Type * type = e->destType;
11877
11878 e->destType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
11879 CopyTypeInto(e->destType, type);
11880 e->destType->refCount = 1;
11881 e->destType->classObjectType = 0;
11882 FreeType(type);
11883 }
11884 e->compound->compound.context = context;
11885 PopContext(context);
11886 curContext = context->parent;
11887 }
11888 }
11889 checkedExp = e;
11890 while(((checkedExp->type == 5 || checkedExp->type == 34 || checkedExp->type == 25) && checkedExp->list) || checkedExp->type == 11)
11891 {
11892 if(checkedExp->type == 5 || checkedExp->type == 34 || checkedExp->type == 25)
11893 {
11894 if(checkedExp->type == 25)
11895 {
11896 checkedExp = (*((struct Statement *)(*checkedExp->compound->compound.statements).last)->expressions).last;
11897 }
11898 else
11899 checkedExp = (*checkedExp->list).last;
11900 }
11901 else if(checkedExp->type == 11)
11902 checkedExp = checkedExp->cast.exp;
11903 }
11904 {
11905 struct Expression * operand = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
11906
11907 *operand = *checkedExp;
11908 checkedExp->destType = (((void *)0));
11909 checkedExp->expType = (((void *)0));
11910 __ecereMethod_Expression_Clear(checkedExp);
11911 checkedExp->type = 4;
11912 checkedExp->op.op = '&';
11913 checkedExp->op.exp1 = (((void *)0));
11914 checkedExp->op.exp2 = operand;
11915 }
11916 }
11917 }
11918 }
11919 }
11920 }
11921 {
11922 }
11923 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))))
11924 {
11925 if(e->expType->kind == 8 && e->expType->_class && e->expType->_class->registered && !strcmp(e->expType->_class->registered->name, "class"))
11926 {
11927 return ;
11928 }
11929 else
11930 {
11931 struct Expression * thisExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
11932
11933 *thisExp = *e;
11934 thisExp->prev = (((void *)0));
11935 thisExp->next = (((void *)0));
11936 __ecereMethod_Expression_Clear(e);
11937 e->type = 5;
11938 e->list = MkListOne(MkExpOp((((void *)0)), '*', MkExpBrackets(MkListOne(thisExp))));
11939 if(thisExp->expType->kind == 8 && thisExp->expType->_class && thisExp->expType->_class->registered && thisExp->expType->_class->registered->type == 5)
11940 ((struct Expression *)(*e->list).first)->byReference = 0x1;
11941 {
11942 e->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
11943 CopyTypeInto(e->expType, thisExp->expType);
11944 e->expType->byReference = 0x0;
11945 e->expType->refCount = 1;
11946 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))
11947 {
11948 e->expType->classObjectType = 0;
11949 }
11950 }
11951 }
11952 }
11953 else if(destType && e->expType && (e->expType->classObjectType == 3 || e->expType->classObjectType == 2) && !destType->classObjectType && destType->kind != 0)
11954 {
11955 if(destType->kind == 14)
11956 {
11957 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Unspecified type\n", (((void *)0))));
11958 }
11959 else if(!(destType->truth && e->expType->kind == 8 && e->expType->_class && e->expType->_class->registered && e->expType->_class->registered->type == 1))
11960 {
11961 unsigned int byReference = e->expType->byReference;
11962 struct Expression * thisExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
11963 struct Declarator * decl;
11964 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
11965 char typeString[1024];
11966 struct Type * type;
11967 int backupClassObjectType;
11968
11969 if(e->expType->kind == 8 && e->expType->_class && e->expType->_class->registered && strcmp(e->expType->_class->registered->name, "class"))
11970 type = e->expType;
11971 else
11972 type = destType;
11973 backupClassObjectType = type->classObjectType;
11974 type->classObjectType = 0;
11975 typeString[0] = '\0';
11976 PrintType(type, typeString, 0x0, 0x1);
11977 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
11978 type->classObjectType = backupClassObjectType;
11979 *thisExp = *e;
11980 thisExp->prev = (((void *)0));
11981 thisExp->next = (((void *)0));
11982 __ecereMethod_Expression_Clear(e);
11983 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)))
11984 {
11985 e->type = 4;
11986 e->op.op = '*';
11987 e->op.exp1 = (((void *)0));
11988 e->op.exp2 = MkExpCast(MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl)), thisExp);
11989 }
11990 else
11991 {
11992 e->type = 11;
11993 e->cast.typeName = MkTypeName(specs, decl);
11994 e->cast.exp = thisExp;
11995 e->byReference = 0x1;
11996 }
11997 e->expType = type;
11998 e->destType = destType;
11999 type->refCount++;
12000 destType->refCount++;
12001 }
12002 }
12003 }
12004
12005 extern char *  strstr(char * , const char * );
12006
12007 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__DefinedExpression;
12008
12009 struct __ecereNameSpace__ecere__com__DefinedExpression
12010 {
12011 struct __ecereNameSpace__ecere__com__DefinedExpression * prev;
12012 struct __ecereNameSpace__ecere__com__DefinedExpression * next;
12013 char *  name;
12014 char *  value;
12015 struct __ecereNameSpace__ecere__com__NameSpace *  nameSpace;
12016 } __attribute__ ((gcc_struct));
12017
12018 extern struct __ecereNameSpace__ecere__com__DefinedExpression * __ecereNameSpace__ecere__com__eSystem_FindDefine(struct __ecereNameSpace__ecere__com__Instance * module, char *  name);
12019
12020 extern struct __ecereNameSpace__ecere__com__GlobalFunction * __ecereNameSpace__ecere__com__eSystem_FindFunction(struct __ecereNameSpace__ecere__com__Instance * module, char *  name);
12021
12022 extern unsigned int __ecereNameSpace__ecere__sys__UTF8GetChar(char *  string, int *  numBytes);
12023
12024 extern struct Expression * GetTemplateArgExp(struct TemplateParameter * param, struct __ecereNameSpace__ecere__com__Class * curClass, unsigned int pointer);
12025
12026 extern struct Expression * MkExpCondition(struct Expression * cond, struct __ecereNameSpace__ecere__sys__OldList * expressions, struct Expression * elseExp);
12027
12028 extern struct Expression * CopyExpression(struct Expression * exp);
12029
12030 extern struct Expression * MkExpTypeSize(struct TypeName * typeName);
12031
12032 extern struct Expression * MkExpClass(struct __ecereNameSpace__ecere__sys__OldList *  specifiers, struct Declarator * decl);
12033
12034 static void ProcessStatement(struct Statement * stmt);
12035
12036 extern struct Expression * MkExpExtensionInitializer(struct TypeName * typeName, struct Initializer * initializer);
12037
12038 extern struct Initializer * MkInitializerList(struct __ecereNameSpace__ecere__sys__OldList * list);
12039
12040 extern char *  __ecereNameSpace__ecere__com__PrintString(struct __ecereNameSpace__ecere__com__Class * class, void * object, ...);
12041
12042 extern char *  sourceFile;
12043
12044 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear(struct __ecereNameSpace__ecere__sys__OldList * this);
12045
12046 void ProcessExpressionType(struct Expression * exp)
12047 {
12048 void * __ecereTemp2;
12049 void * __ecereTemp1;
12050 unsigned int unresolved = 0x0;
12051 struct Location oldyylloc = yylloc;
12052 unsigned int notByReference = 0x0;
12053
12054 if(!exp || exp->expType)
12055 return ;
12056 yylloc = exp->loc;
12057 switch(exp->type)
12058 {
12059 case 0:
12060 {
12061 struct Identifier * id = exp->identifier;
12062
12063 if(!id)
12064 return ;
12065 if(id->_class && id->_class->name)
12066 {
12067 id->classSym = id->_class->symbol;
12068 }
12069 if(strstr(id->string, "__ecereClass") == id->string)
12070 {
12071 exp->expType = ProcessTypeString("ecere::com::Class", 0x1);
12072 break;
12073 }
12074 else if(id->_class && (id->classSym || (id->_class->name && !strcmp(id->_class->name, "property"))))
12075 {
12076 ReplaceClassMembers(exp, thisClass);
12077 if(exp->type != 0)
12078 {
12079 ProcessExpressionType(exp);
12080 break;
12081 }
12082 if(id->classSym && ResolveIdWithClass(exp, id->classSym->registered, 0x0))
12083 break;
12084 }
12085 else
12086 {
12087 struct Symbol * symbol = FindSymbol(id->string, curContext, topContext, 0x0, id->_class && id->_class->name == (((void *)0)));
12088
12089 if(!symbol)
12090 {
12091 if(exp->destType && CheckExpressionType(exp, exp->destType, 0x0))
12092 break;
12093 else
12094 {
12095 if(thisClass)
12096 {
12097 ReplaceClassMembers(exp, thisClass ? thisClass : currentClass);
12098 if(exp->type != 0)
12099 {
12100 ProcessExpressionType(exp);
12101 break;
12102 }
12103 }
12104 else if(currentClass && !id->_class)
12105 {
12106 if(ResolveIdWithClass(exp, currentClass, 0x1))
12107 break;
12108 }
12109 symbol = FindSymbol(id->string, topContext->parent, globalContext, 0x0, id->_class && id->_class->name == (((void *)0)));
12110 }
12111 }
12112 if(symbol)
12113 {
12114 struct Type * type = symbol->type;
12115 struct __ecereNameSpace__ecere__com__Class * _class = (type && type->kind == 8 && type->_class) ? type->_class->registered : (((void *)0));
12116
12117 if(_class && !strcmp(id->string, "this") && !type->classObjectType)
12118 {
12119 struct Context * context = SetupTemplatesContext(_class);
12120
12121 type = ReplaceThisClassType(_class);
12122 FinishTemplatesContext(context);
12123 if(type)
12124 type->refCount = 0;
12125 }
12126 FreeSpecifier(id->_class);
12127 id->_class = (((void *)0));
12128 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
12129 id->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
12130 id->classSym = (((void *)0));
12131 exp->expType = type;
12132 if(type)
12133 type->refCount++;
12134 if(type && (type->kind == 15 || (_class && _class->type == 4)))
12135 exp->isConstant = 0x1;
12136 if(symbol->isParam || !strcmp(id->string, "this"))
12137 {
12138 if(_class && _class->type == 1)
12139 exp->byReference = 0x1;
12140 }
12141 if(symbol->isIterator)
12142 {
12143 if(symbol->isIterator == 3)
12144 {
12145 exp->type = 5;
12146 exp->list = MkListOne(MkExpOp((((void *)0)), '*', MkExpIdentifier(exp->identifier)));
12147 ((struct Expression *)(*exp->list).first)->op.exp2->expType = exp->expType;
12148 exp->expType = (((void *)0));
12149 ProcessExpressionType(exp);
12150 }
12151 else if(symbol->isIterator != 4)
12152 {
12153 exp->type = 8;
12154 exp->member.exp = MkExpIdentifier(exp->identifier);
12155 exp->member.exp->expType = exp->expType;
12156 exp->member.member = MkIdentifier("data");
12157 exp->expType = (((void *)0));
12158 ProcessExpressionType(exp);
12159 }
12160 }
12161 break;
12162 }
12163 else
12164 {
12165 struct __ecereNameSpace__ecere__com__DefinedExpression * definedExp = (((void *)0));
12166
12167 if(thisNameSpace && !(id->_class && !id->_class->name))
12168 {
12169 char name[1024];
12170
12171 strcpy(name, thisNameSpace);
12172 strcat(name, "::");
12173 strcat(name, id->string);
12174 definedExp = __ecereNameSpace__ecere__com__eSystem_FindDefine(privateModule, name);
12175 }
12176 if(!definedExp)
12177 definedExp = __ecereNameSpace__ecere__com__eSystem_FindDefine(privateModule, id->string);
12178 if(definedExp)
12179 {
12180 int c;
12181
12182 for(c = 0; c < definedExpStackPos; c++)
12183 if(definedExpStack[c] == definedExp)
12184 break;
12185 if(c == definedExpStackPos && c < sizeof definedExpStack / sizeof(void *))
12186 {
12187 struct Location backupYylloc = yylloc;
12188
12189 definedExpStack[definedExpStackPos++] = definedExp;
12190 fileInput = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
12191 ((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));
12192 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))fileInput->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(fileInput, 0, 0);
12193 echoOn = 0x0;
12194 parsedExpression = (((void *)0));
12195 resetScanner();
12196 expression_yyparse();
12197 (__ecereNameSpace__ecere__com__eInstance_DecRef(fileInput), fileInput = 0);
12198 yylloc = backupYylloc;
12199 if(parsedExpression)
12200 {
12201 FreeIdentifier(id);
12202 exp->type = 5;
12203 exp->list = MkListOne(parsedExpression);
12204 parsedExpression->loc = yylloc;
12205 ProcessExpressionType(exp);
12206 definedExpStackPos--;
12207 return ;
12208 }
12209 definedExpStackPos--;
12210 }
12211 else
12212 {
12213 if(inCompiler)
12214 {
12215 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Recursion in defined expression %s\n", (((void *)0))), id->string);
12216 }
12217 }
12218 }
12219 else
12220 {
12221 struct GlobalData * data = (((void *)0));
12222
12223 if(thisNameSpace && !(id->_class && !id->_class->name))
12224 {
12225 char name[1024];
12226
12227 strcpy(name, thisNameSpace);
12228 strcat(name, "::");
12229 strcat(name, id->string);
12230 data = FindGlobalData(name);
12231 }
12232 if(!data)
12233 data = FindGlobalData(id->string);
12234 if(data)
12235 {
12236 DeclareGlobalData(data);
12237 exp->expType = data->dataType;
12238 if(data->dataType)
12239 data->dataType->refCount++;
12240 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
12241 id->string = __ecereNameSpace__ecere__sys__CopyString(data->fullName);
12242 FreeSpecifier(id->_class);
12243 id->_class = (((void *)0));
12244 break;
12245 }
12246 else
12247 {
12248 struct __ecereNameSpace__ecere__com__GlobalFunction * function = (((void *)0));
12249
12250 if(thisNameSpace && !(id->_class && !id->_class->name))
12251 {
12252 char name[1024];
12253
12254 strcpy(name, thisNameSpace);
12255 strcat(name, "::");
12256 strcat(name, id->string);
12257 function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, name);
12258 }
12259 if(!function)
12260 function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, id->string);
12261 if(function)
12262 {
12263 char name[1024];
12264
12265 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
12266 id->string = __ecereNameSpace__ecere__sys__CopyString(function->name);
12267 name[0] = (char)0;
12268 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + 12)))->importType != 1 && (!function->dataType || !function->dataType->dllExport))
12269 strcpy(name, "__ecereFunction_");
12270 FullClassNameCat(name, id->string, 0x0);
12271 if(DeclareFunction(function, name))
12272 {
12273 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
12274 id->string = __ecereNameSpace__ecere__sys__CopyString(name);
12275 }
12276 exp->expType = function->dataType;
12277 if(function->dataType)
12278 function->dataType->refCount++;
12279 FreeSpecifier(id->_class);
12280 id->_class = (((void *)0));
12281 break;
12282 }
12283 }
12284 }
12285 }
12286 }
12287 unresolved = 0x1;
12288 break;
12289 }
12290 case 1:
12291 {
12292 struct __ecereNameSpace__ecere__com__Class * _class;
12293
12294 if(!exp->instance->_class)
12295 {
12296 if(exp->destType && exp->destType->kind == 8 && exp->destType->_class)
12297 {
12298 exp->instance->_class = MkSpecifierName(exp->destType->_class->string);
12299 }
12300 }
12301 ProcessInstantiationType(exp->instance);
12302 exp->isConstant = exp->instance->isConstant;
12303 if(exp->instance->_class)
12304 {
12305 exp->expType = MkClassType(exp->instance->_class->name);
12306 }
12307 break;
12308 }
12309 case 2:
12310 {
12311 if(!exp->expType)
12312 {
12313 struct Type * type = (type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), type->refCount = 1, type->constant = 0x1, type);
12314
12315 exp->expType = type;
12316 if(exp->constant[0] == '\'')
12317 {
12318 if((int)((unsigned char *)exp->constant)[1] > 127)
12319 {
12320 int nb;
12321 unsigned int ch = __ecereNameSpace__ecere__sys__UTF8GetChar(exp->constant + 1, &nb);
12322
12323 if(nb < 2)
12324 ch = exp->constant[1];
12325 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->constant), exp->constant = 0);
12326 exp->constant = PrintUInt(ch);
12327 type->kind = 8;
12328 type->_class = FindClass("unichar");
12329 type->isSigned = 0x0;
12330 }
12331 else
12332 {
12333 type->kind = 1;
12334 type->isSigned = 0x1;
12335 }
12336 }
12337 else if(strchr(exp->constant, '.'))
12338 {
12339 char ch = exp->constant[strlen(exp->constant) - 1];
12340
12341 if(ch == 'f')
12342 type->kind = 6;
12343 else
12344 type->kind = 7;
12345 type->isSigned = 0x1;
12346 }
12347 else
12348 {
12349 if(exp->constant[0] == '0' && exp->constant[1])
12350 type->isSigned = 0x0;
12351 else if(strchr(exp->constant, 'L') || strchr(exp->constant, 'l'))
12352 type->isSigned = 0x0;
12353 else if(strtoll(exp->constant, (((void *)0)), 0) > (((int)0x7fffffff)))
12354 type->isSigned = 0x0;
12355 else
12356 type->isSigned = 0x1;
12357 type->kind = 3;
12358 }
12359 exp->isConstant = 0x1;
12360 }
12361 break;
12362 }
12363 case 3:
12364 {
12365 exp->isConstant = 0x1;
12366 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));
12367 break;
12368 }
12369 case 13:
12370 case 28:
12371 ProcessExpressionType(exp->_new.size);
12372 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));
12373 DeclareType(exp->expType->type, 0x0, 0x0);
12374 break;
12375 case 14:
12376 case 29:
12377 ProcessExpressionType(exp->_renew.size);
12378 ProcessExpressionType(exp->_renew.exp);
12379 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));
12380 DeclareType(exp->expType->type, 0x0, 0x0);
12381 break;
12382 case 4:
12383 {
12384 unsigned int assign = 0x0, boolResult = 0x0, boolOps = 0x0;
12385 struct Type * type1 = (((void *)0)), * type2 = (((void *)0));
12386 unsigned int useDestType = 0x0, useSideType = 0x0;
12387 struct Location oldyylloc = yylloc;
12388 unsigned int useSideUnit = 0x0;
12389 struct Type * dummy = (dummy = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), dummy->count = (unsigned int)1, dummy->refCount = 1, dummy);
12390
12391 switch(exp->op.op)
12392 {
12393 case '=':
12394 case MUL_ASSIGN:
12395 case DIV_ASSIGN:
12396 case MOD_ASSIGN:
12397 case ADD_ASSIGN:
12398 case SUB_ASSIGN:
12399 case LEFT_ASSIGN:
12400 case RIGHT_ASSIGN:
12401 case AND_ASSIGN:
12402 case XOR_ASSIGN:
12403 case OR_ASSIGN:
12404 assign = 0x1;
12405 break;
12406 case '!':
12407 break;
12408 case AND_OP:
12409 case OR_OP:
12410 boolOps = 0x1;
12411 boolResult = 0x1;
12412 break;
12413 case EQ_OP:
12414 case '<':
12415 case '>':
12416 case LE_OP:
12417 case GE_OP:
12418 case NE_OP:
12419 boolResult = 0x1;
12420 useSideType = 0x1;
12421 break;
12422 case '+':
12423 case '-':
12424 useSideUnit = 0x1;
12425 case '|':
12426 case '&':
12427 case '^':
12428 case '/':
12429 case '%':
12430 case '*':
12431 if(exp->op.op != '*' || exp->op.exp1)
12432 {
12433 useSideType = 0x1;
12434 useDestType = 0x1;
12435 }
12436 break;
12437 }
12438 if(exp->op.op == '&')
12439 {
12440 if(!exp->op.exp1 && exp->op.exp2 && exp->op.exp2->type == 0 && exp->op.exp2->identifier)
12441 {
12442 struct Identifier * id = exp->op.exp2->identifier;
12443 struct Symbol * symbol = FindSymbol(id->string, curContext, topContext, 0x0, id->_class && id->_class->name == (((void *)0)));
12444
12445 if(symbol && symbol->isIterator == 2)
12446 {
12447 exp->type = 8;
12448 exp->member.exp = exp->op.exp2;
12449 exp->member.member = MkIdentifier("key");
12450 exp->expType = (((void *)0));
12451 exp->op.exp2->expType = symbol->type;
12452 symbol->type->refCount++;
12453 ProcessExpressionType(exp);
12454 FreeType(dummy);
12455 break;
12456 }
12457 }
12458 }
12459 if(exp->op.exp1)
12460 {
12461 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))
12462 {
12463 if(exp->op.exp1->destType)
12464 FreeType(exp->op.exp1->destType);
12465 exp->op.exp1->destType = exp->destType;
12466 if(exp->destType)
12467 exp->destType->refCount++;
12468 }
12469 else if(!assign)
12470 {
12471 if(exp->op.exp1->destType)
12472 FreeType(exp->op.exp1->destType);
12473 exp->op.exp1->destType = dummy;
12474 dummy->refCount++;
12475 }
12476 if(exp->op.exp1->destType && exp->op.op != '=')
12477 exp->op.exp1->destType->count++;
12478 ProcessExpressionType(exp->op.exp1);
12479 if(exp->op.exp1->destType && exp->op.op != '=')
12480 exp->op.exp1->destType->count--;
12481 if(exp->op.exp1->destType == dummy)
12482 {
12483 FreeType(dummy);
12484 exp->op.exp1->destType = (((void *)0));
12485 }
12486 type1 = exp->op.exp1->expType;
12487 }
12488 if(exp->op.exp2)
12489 {
12490 char expString[10240];
12491
12492 expString[0] = '\0';
12493 if(exp->op.exp2->type == 1 && !exp->op.exp2->instance->_class)
12494 {
12495 if(exp->op.exp1)
12496 {
12497 exp->op.exp2->destType = exp->op.exp1->expType;
12498 if(exp->op.exp1->expType)
12499 exp->op.exp1->expType->refCount++;
12500 }
12501 else
12502 {
12503 exp->op.exp2->destType = exp->destType;
12504 if(exp->destType)
12505 exp->destType->refCount++;
12506 }
12507 if(type1)
12508 type1->refCount++;
12509 exp->expType = type1;
12510 }
12511 else if(assign)
12512 {
12513 if(inCompiler)
12514 PrintExpression(exp->op.exp2, expString);
12515 if(type1 && type1->kind == 13)
12516 {
12517 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)
12518 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "operator %s illegal on pointer\n", (((void *)0))), exp->op.op);
12519 else if(exp->op.op == '=')
12520 {
12521 if(exp->op.exp2->destType)
12522 FreeType(exp->op.exp2->destType);
12523 exp->op.exp2->destType = type1;
12524 if(type1)
12525 type1->refCount++;
12526 }
12527 }
12528 else
12529 {
12530 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)
12531 ;
12532 else
12533 {
12534 if(exp->op.exp2->destType)
12535 FreeType(exp->op.exp2->destType);
12536 exp->op.exp2->destType = type1;
12537 if(type1)
12538 type1->refCount++;
12539 }
12540 }
12541 if(type1)
12542 type1->refCount++;
12543 exp->expType = type1;
12544 }
12545 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)))
12546 {
12547 if(exp->op.exp2->destType)
12548 FreeType(exp->op.exp2->destType);
12549 exp->op.exp2->destType = exp->destType;
12550 if(exp->destType)
12551 exp->destType->refCount++;
12552 }
12553 else
12554 {
12555 if(exp->op.exp2->destType)
12556 FreeType(exp->op.exp2->destType);
12557 exp->op.exp2->destType = dummy;
12558 dummy->refCount++;
12559 }
12560 if(type1 && boolResult && useSideType && type1->kind == 8 && type1->_class && type1->_class->registered && (type1->_class->registered->type == 2 || type1->_class->registered->type == 4))
12561 {
12562 FreeType(exp->op.exp2->destType);
12563 exp->op.exp2->destType = type1;
12564 type1->refCount++;
12565 }
12566 if(exp->op.exp2->destType && exp->op.op != '=')
12567 exp->op.exp2->destType->count++;
12568 ProcessExpressionType(exp->op.exp2);
12569 if(exp->op.exp2->destType && exp->op.op != '=')
12570 exp->op.exp2->destType->count--;
12571 if(assign && type1 && type1->kind == 13 && exp->op.exp2->expType)
12572 {
12573 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)
12574 {
12575 if(exp->op.op != '=' && type1->type->kind == 0)
12576 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "void *: unknown size\n", (((void *)0))));
12577 }
12578 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)))
12579 {
12580 if(exp->op.op == ADD_ASSIGN)
12581 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "cannot add two pointers\n", (((void *)0))));
12582 }
12583 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))
12584 {
12585 if(exp->op.op == ADD_ASSIGN)
12586 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "cannot add two pointers\n", (((void *)0))));
12587 }
12588 else if(inCompiler)
12589 {
12590 char type1String[1024];
12591 char type2String[1024];
12592
12593 type1String[0] = '\0';
12594 type2String[0] = '\0';
12595 PrintType(exp->op.exp2->expType, type1String, 0x0, 0x1);
12596 PrintType(type1, type2String, 0x0, 0x1);
12597 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
12598 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible expression %s (%s); expected %s\n", (((void *)0))), expString, type1String, type2String);
12599 }
12600 }
12601 if(exp->op.exp2->destType == dummy)
12602 {
12603 FreeType(dummy);
12604 exp->op.exp2->destType = (((void *)0));
12605 }
12606 type2 = exp->op.exp2->expType;
12607 }
12608 dummy->kind = 0;
12609 if(exp->op.op == SIZEOF)
12610 {
12611 exp->expType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1)->kind = 3, ((struct Type *)__ecereTemp1));
12612 exp->isConstant = 0x1;
12613 }
12614 else if(exp->op.op == '*' && !exp->op.exp1)
12615 {
12616 exp->expType = Dereference(type2);
12617 if(type2 && type2->kind == 8)
12618 notByReference = 0x1;
12619 }
12620 else if(exp->op.op == '&' && !exp->op.exp1)
12621 exp->expType = Reference(type2);
12622 else if(!assign)
12623 {
12624 if(boolOps)
12625 {
12626 if(exp->op.exp1)
12627 {
12628 if(exp->op.exp1->destType)
12629 FreeType(exp->op.exp1->destType);
12630 exp->op.exp1->destType = MkClassType("bool");
12631 exp->op.exp1->destType->truth = 0x1;
12632 if(!exp->op.exp1->expType)
12633 ProcessExpressionType(exp->op.exp1);
12634 else
12635 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
12636 FreeType(exp->op.exp1->expType);
12637 exp->op.exp1->expType = MkClassType("bool");
12638 exp->op.exp1->expType->truth = 0x1;
12639 }
12640 if(exp->op.exp2)
12641 {
12642 if(exp->op.exp2->destType)
12643 FreeType(exp->op.exp2->destType);
12644 exp->op.exp2->destType = MkClassType("bool");
12645 exp->op.exp2->destType->truth = 0x1;
12646 if(!exp->op.exp2->expType)
12647 ProcessExpressionType(exp->op.exp2);
12648 else
12649 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
12650 FreeType(exp->op.exp2->expType);
12651 exp->op.exp2->expType = MkClassType("bool");
12652 exp->op.exp2->expType->truth = 0x1;
12653 }
12654 }
12655 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")))))
12656 {
12657 if(type1 && type2 && ((type1->kind == 8 && type1->_class && strcmp(type1->_class->string, "String")) == (type2->kind == 8 && type2->_class && strcmp(type2->_class->string, "String"))))
12658 {
12659 if(exp->op.exp2->destType)
12660 FreeType(exp->op.exp2->destType);
12661 exp->op.exp2->destType = type1;
12662 type1->refCount++;
12663 if(exp->op.exp1->destType)
12664 FreeType(exp->op.exp1->destType);
12665 exp->op.exp1->destType = type2;
12666 type2->refCount++;
12667 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)
12668 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);
12669 if(type1->kind == 13 && type1->type->kind == 20 && type2->kind != 13)
12670 {
12671 struct Expression * argExp = GetTemplateArgExp(type1->type->templateParameter, thisClass, 0x1);
12672
12673 if(argExp)
12674 {
12675 struct Expression * classExp = MkExpMember(argExp, MkIdentifier("dataTypeClass"));
12676
12677 exp->op.exp1 = MkExpBrackets(MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName("byte")), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), exp->op.exp1)));
12678 ProcessExpressionType(exp->op.exp1);
12679 if(type2->kind != 13)
12680 {
12681 ProcessExpressionType(classExp);
12682 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"))))))));
12683 if(!exp->op.exp2->expType)
12684 type2 = exp->op.exp2->expType = ProcessTypeString("int", 0x0);
12685 ProcessExpressionType(exp->op.exp2);
12686 }
12687 }
12688 }
12689 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)))
12690 {
12691 if(type1->kind != 8 && type1->type->kind == 0)
12692 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "void *: unknown size\n", (((void *)0))));
12693 exp->expType = type1;
12694 if(type1)
12695 type1->refCount++;
12696 }
12697 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)))
12698 {
12699 if(type2->kind != 8 && type2->type->kind == 0)
12700 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "void *: unknown size\n", (((void *)0))));
12701 exp->expType = type2;
12702 if(type2)
12703 type2->refCount++;
12704 }
12705 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))
12706 {
12707 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "different levels of indirection\n", (((void *)0))));
12708 }
12709 else
12710 {
12711 unsigned int success = 0x0;
12712
12713 if(type1->kind == 13 && type2->kind == 13)
12714 {
12715 if(exp->op.op == '+')
12716 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "cannot add two pointers\n", (((void *)0))));
12717 else if(exp->op.op == '-')
12718 {
12719 if(MatchTypes(type1->type, type2->type, (((void *)0)), (((void *)0)), (((void *)0)), 0x0, 0x0, 0x0, 0x0))
12720 {
12721 exp->expType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->kind = 3, ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1));
12722 success = 0x1;
12723 if(type1->type->kind == 20)
12724 {
12725 struct Expression * argExp = GetTemplateArgExp(type1->type->templateParameter, thisClass, 0x1);
12726
12727 if(argExp)
12728 {
12729 struct Expression * classExp = MkExpMember(argExp, MkIdentifier("dataTypeClass"));
12730
12731 ProcessExpressionType(classExp);
12732 exp->type = 5;
12733 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")))))));
12734 ProcessExpressionType(((struct Expression *)(*exp->list).first)->op.exp2);
12735 FreeType(dummy);
12736 return ;
12737 }
12738 }
12739 }
12740 }
12741 }
12742 if(!success && exp->op.exp1->type == 2)
12743 {
12744 if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
12745 {
12746 if(exp->expType)
12747 FreeType(exp->expType);
12748 exp->expType = exp->op.exp1->destType;
12749 if(exp->op.exp1->destType)
12750 exp->op.exp1->destType->refCount++;
12751 success = 0x1;
12752 }
12753 else if(CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0))
12754 {
12755 if(exp->expType)
12756 FreeType(exp->expType);
12757 exp->expType = exp->op.exp2->destType;
12758 if(exp->op.exp2->destType)
12759 exp->op.exp2->destType->refCount++;
12760 success = 0x1;
12761 }
12762 }
12763 else if(!success)
12764 {
12765 if(CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0))
12766 {
12767 if(exp->expType)
12768 FreeType(exp->expType);
12769 exp->expType = exp->op.exp2->destType;
12770 if(exp->op.exp2->destType)
12771 exp->op.exp2->destType->refCount++;
12772 success = 0x1;
12773 }
12774 else if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
12775 {
12776 if(exp->expType)
12777 FreeType(exp->expType);
12778 exp->expType = exp->op.exp1->destType;
12779 if(exp->op.exp1->destType)
12780 exp->op.exp1->destType->refCount++;
12781 success = 0x1;
12782 }
12783 }
12784 if(!success)
12785 {
12786 char expString1[10240];
12787 char expString2[10240];
12788 char type1[1024];
12789 char type2[1024];
12790
12791 expString1[0] = '\0';
12792 expString2[0] = '\0';
12793 type1[0] = '\0';
12794 type2[0] = '\0';
12795 if(inCompiler)
12796 {
12797 PrintExpression(exp->op.exp1, expString1);
12798 __ecereNameSpace__ecere__sys__ChangeCh(expString1, '\n', ' ');
12799 PrintExpression(exp->op.exp2, expString2);
12800 __ecereNameSpace__ecere__sys__ChangeCh(expString2, '\n', ' ');
12801 PrintType(exp->op.exp1->expType, type1, 0x0, 0x1);
12802 PrintType(exp->op.exp2->expType, type2, 0x0, 0x1);
12803 }
12804 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible expressions %s (%s) and %s (%s)\n", (((void *)0))), expString1, type1, expString2, type2);
12805 }
12806 }
12807 }
12808 else if(!boolResult && (!useSideUnit) && type2 && type1 && type2->kind == 8 && type1->kind != 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 3)
12809 {
12810 if(exp->op.exp1->destType)
12811 FreeType(exp->op.exp1->destType);
12812 exp->op.exp1->destType = type2->_class->registered->dataType;
12813 if(type2->_class->registered->dataType)
12814 type2->_class->registered->dataType->refCount++;
12815 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
12816 exp->expType = type2;
12817 if(type2)
12818 type2->refCount++;
12819 }
12820 else if(!boolResult && (!useSideUnit) && type1 && type2 && type1->kind == 8 && type2->kind != 8 && type1->_class && type1->_class->registered && type1->_class->registered->type == 3)
12821 {
12822 if(exp->op.exp2->destType)
12823 FreeType(exp->op.exp2->destType);
12824 exp->op.exp2->destType = type1->_class->registered->dataType;
12825 if(type1->_class->registered->dataType)
12826 type1->_class->registered->dataType->refCount++;
12827 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
12828 exp->expType = type1;
12829 if(type1)
12830 type1->refCount++;
12831 }
12832 else if(type1)
12833 {
12834 unsigned int valid = 0x0;
12835
12836 if(!boolResult && useSideUnit && type1 && type1->kind == 8 && type1->_class->registered && type1->_class->registered->type == 3 && type2 && type2->kind != 8)
12837 {
12838 if(exp->op.exp2->destType)
12839 FreeType(exp->op.exp2->destType);
12840 if(!type1->_class->registered->dataType)
12841 type1->_class->registered->dataType = ProcessTypeString(type1->_class->registered->dataTypeString, 0x0);
12842 exp->op.exp2->destType = type1->_class->registered->dataType;
12843 exp->op.exp2->destType->refCount++;
12844 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
12845 type2 = exp->op.exp2->destType;
12846 exp->expType = type2;
12847 type2->refCount++;
12848 }
12849 if(!boolResult && useSideUnit && type2 && type2->kind == 8 && type2->_class->registered && type2->_class->registered->type == 3 && type1 && type1->kind != 8)
12850 {
12851 if(exp->op.exp1->destType)
12852 FreeType(exp->op.exp1->destType);
12853 if(!type2->_class->registered->dataType)
12854 type2->_class->registered->dataType = ProcessTypeString(type2->_class->registered->dataTypeString, 0x0);
12855 exp->op.exp1->destType = type2->_class->registered->dataType;
12856 exp->op.exp1->destType->refCount++;
12857 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
12858 type1 = exp->op.exp1->destType;
12859 exp->expType = type1;
12860 type1->refCount++;
12861 }
12862 if(!boolResult || exp->op.op == '>' || exp->op.op == '<')
12863 {
12864 if(type1->kind == 8 && type1->_class && type1->_class->registered && type1->_class->registered->type == 4 && exp->op.exp2->expType)
12865 {
12866 if(CheckExpressionType(exp->op.exp1, exp->op.exp2->expType, 0x0))
12867 {
12868 if(exp->expType)
12869 FreeType(exp->expType);
12870 exp->expType = exp->op.exp1->expType;
12871 if(exp->op.exp2->expType)
12872 exp->op.exp1->expType->refCount++;
12873 valid = 0x1;
12874 }
12875 }
12876 else if(type2 && (type2->kind == 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 4 && exp->op.exp1->expType))
12877 {
12878 if(CheckExpressionType(exp->op.exp2, exp->op.exp1->expType, 0x0))
12879 {
12880 if(exp->expType)
12881 FreeType(exp->expType);
12882 exp->expType = exp->op.exp2->expType;
12883 if(exp->op.exp2->expType)
12884 exp->op.exp2->expType->refCount++;
12885 valid = 0x1;
12886 }
12887 }
12888 }
12889 if(!valid)
12890 {
12891 if(exp->op.exp2->destType)
12892 FreeType(exp->op.exp2->destType);
12893 exp->op.exp2->destType = type1;
12894 type1->refCount++;
12895 if(CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0))
12896 {
12897 if(exp->expType)
12898 FreeType(exp->expType);
12899 exp->expType = exp->op.exp2->destType;
12900 if(exp->op.exp2->destType)
12901 exp->op.exp2->destType->refCount++;
12902 }
12903 else if(type1 && type2)
12904 {
12905 char expString1[10240];
12906 char expString2[10240];
12907 char type1String[1024];
12908 char type2String[1024];
12909
12910 expString1[0] = '\0';
12911 expString2[0] = '\0';
12912 type1String[0] = '\0';
12913 type2String[0] = '\0';
12914 if(inCompiler)
12915 {
12916 PrintExpression(exp->op.exp1, expString1);
12917 __ecereNameSpace__ecere__sys__ChangeCh(expString1, '\n', ' ');
12918 PrintExpression(exp->op.exp2, expString2);
12919 __ecereNameSpace__ecere__sys__ChangeCh(expString2, '\n', ' ');
12920 PrintType(exp->op.exp1->expType, type1String, 0x0, 0x1);
12921 PrintType(exp->op.exp2->expType, type2String, 0x0, 0x1);
12922 }
12923 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible expressions %s (%s) and %s (%s)\n", (((void *)0))), expString1, type1String, expString2, type2String);
12924 if(type1->kind == 8 && type1->_class && type1->_class->registered && type1->_class->registered->type == 4)
12925 {
12926 exp->expType = exp->op.exp1->expType;
12927 if(exp->op.exp1->expType)
12928 exp->op.exp1->expType->refCount++;
12929 }
12930 else if(type2->kind == 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 4)
12931 {
12932 exp->expType = exp->op.exp2->expType;
12933 if(exp->op.exp2->expType)
12934 exp->op.exp2->expType->refCount++;
12935 }
12936 }
12937 }
12938 }
12939 else if(type2)
12940 {
12941 if(type2->kind == 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 4)
12942 {
12943 struct Type * oldType = exp->op.exp1->expType;
12944
12945 exp->op.exp1->expType = (((void *)0));
12946 if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
12947 FreeType(oldType);
12948 else
12949 exp->op.exp1->expType = oldType;
12950 }
12951 if(exp->op.exp1->destType)
12952 FreeType(exp->op.exp1->destType);
12953 exp->op.exp1->destType = type2;
12954 type2->refCount++;
12955 if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
12956 {
12957 if(exp->expType)
12958 FreeType(exp->expType);
12959 exp->expType = exp->op.exp1->destType;
12960 if(exp->op.exp1->destType)
12961 exp->op.exp1->destType->refCount++;
12962 }
12963 }
12964 }
12965 else if(type2 && (!type1 || (type2->kind == 8 && type1->kind != 8)))
12966 {
12967 if(type1 && type2->_class && type2->_class->registered && type2->_class->registered->type == 3)
12968 {
12969 if(exp->op.exp1->destType)
12970 FreeType(exp->op.exp1->destType);
12971 exp->op.exp1->destType = type2->_class->registered->dataType;
12972 if(type2->_class->registered->dataType)
12973 type2->_class->registered->dataType->refCount++;
12974 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
12975 }
12976 if(exp->op.op == '!')
12977 {
12978 exp->expType = MkClassType("bool");
12979 exp->expType->truth = 0x1;
12980 }
12981 else
12982 {
12983 exp->expType = type2;
12984 if(type2)
12985 type2->refCount++;
12986 }
12987 }
12988 else if(type1 && (!type2 || (type1->kind == 8 && type2->kind != 8)))
12989 {
12990 if(type2 && type1->_class && type1->_class->registered && type1->_class->registered->type == 3)
12991 {
12992 if(exp->op.exp2->destType)
12993 FreeType(exp->op.exp2->destType);
12994 exp->op.exp2->destType = type1->_class->registered->dataType;
12995 if(type1->_class->registered->dataType)
12996 type1->_class->registered->dataType->refCount++;
12997 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
12998 }
12999 exp->expType = type1;
13000 if(type1)
13001 type1->refCount++;
13002 }
13003 }
13004 yylloc = exp->loc;
13005 if(exp->op.exp1 && !exp->op.exp1->expType)
13006 {
13007 char expString[10000];
13008
13009 expString[0] = '\0';
13010 if(inCompiler)
13011 {
13012 PrintExpression(exp->op.exp1, expString);
13013 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
13014 }
13015 if(expString[0])
13016 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't determine type of %s\n", (((void *)0))), expString);
13017 }
13018 if(exp->op.exp2 && !exp->op.exp2->expType)
13019 {
13020 char expString[10240];
13021
13022 expString[0] = '\0';
13023 if(inCompiler)
13024 {
13025 PrintExpression(exp->op.exp2, expString);
13026 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
13027 }
13028 if(expString[0])
13029 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't determine type of %s\n", (((void *)0))), expString);
13030 }
13031 if(boolResult)
13032 {
13033 FreeType(exp->expType);
13034 exp->expType = MkClassType("bool");
13035 exp->expType->truth = 0x1;
13036 }
13037 if(exp->op.op != SIZEOF)
13038 exp->isConstant = (!exp->op.exp1 || exp->op.exp1->isConstant) && (!exp->op.exp2 || exp->op.exp2->isConstant);
13039 if(exp->op.op == SIZEOF && exp->op.exp2->expType)
13040 {
13041 DeclareType(exp->op.exp2->expType, 0x0, 0x0);
13042 }
13043 yylloc = oldyylloc;
13044 FreeType(dummy);
13045 break;
13046 }
13047 case 5:
13048 case 34:
13049 {
13050 struct Expression * e;
13051
13052 exp->isConstant = 0x1;
13053 for(e = (*exp->list).first; e; e = e->next)
13054 {
13055 unsigned int inced = 0x0;
13056
13057 if(!e->next)
13058 {
13059 FreeType(e->destType);
13060 e->destType = exp->destType;
13061 if(e->destType)
13062 {
13063 exp->destType->refCount++;
13064 e->destType->count++;
13065 inced = 0x1;
13066 }
13067 }
13068 ProcessExpressionType(e);
13069 if(inced)
13070 exp->destType->count--;
13071 if(!exp->expType && !e->next)
13072 {
13073 exp->expType = e->expType;
13074 if(e->expType)
13075 e->expType->refCount++;
13076 }
13077 if(!e->isConstant)
13078 exp->isConstant = 0x0;
13079 }
13080 e = (*exp->list).first;
13081 if(!e->next && e->type == 8)
13082 {
13083 struct Expression * next = exp->next, * prev = exp->prev;
13084
13085 FreeType(exp->expType);
13086 FreeType(exp->destType);
13087 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->list), exp->list = 0);
13088 *exp = *e;
13089 exp->prev = prev;
13090 exp->next = next;
13091 ((e ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(e) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(e)) : 0), e = 0);
13092 ProcessExpressionType(exp);
13093 }
13094 break;
13095 }
13096 case 6:
13097 {
13098 struct Expression * e;
13099
13100 exp->isConstant = 0x1;
13101 ProcessExpressionType(exp->index.exp);
13102 if(!exp->index.exp->isConstant)
13103 exp->isConstant = 0x0;
13104 if(exp->index.exp->expType)
13105 {
13106 struct Type * source = exp->index.exp->expType;
13107
13108 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)
13109 {
13110 struct __ecereNameSpace__ecere__com__Class * _class = source->_class->registered;
13111
13112 exp->expType = ProcessTypeString(_class->templateArgs[2].dataTypeString, 0x0);
13113 if(exp->index.index && (*exp->index.index).last)
13114 {
13115 ((struct Expression *)(*exp->index.index).last)->destType = ProcessTypeString(_class->templateArgs[1].dataTypeString, 0x0);
13116 }
13117 }
13118 }
13119 for(e = (*exp->index.index).first; e; e = e->next)
13120 {
13121 if(!e->next && exp->index.exp->expType && exp->index.exp->expType->kind == 12 && exp->index.exp->expType->enumClass)
13122 {
13123 if(e->destType)
13124 FreeType(e->destType);
13125 e->destType = MkClassType(exp->index.exp->expType->enumClass->string);
13126 }
13127 ProcessExpressionType(e);
13128 if(!e->next)
13129 {
13130 }
13131 if(!e->isConstant)
13132 exp->isConstant = 0x0;
13133 }
13134 if(!exp->expType)
13135 exp->expType = Dereference(exp->index.exp->expType);
13136 if(exp->expType)
13137 DeclareType(exp->expType, 0x0, 0x0);
13138 break;
13139 }
13140 case 7:
13141 {
13142 struct Expression * e;
13143 struct Type * functionType;
13144 struct Type * methodType = (((void *)0));
13145 char name[1024];
13146
13147 name[0] = '\0';
13148 if(inCompiler)
13149 {
13150 PrintExpression(exp->call.exp, name);
13151 if(exp->call.exp->expType && !exp->call.exp->expType->returnType)
13152 {
13153 PrintExpression(exp->call.exp, name);
13154 }
13155 }
13156 if(exp->call.exp->type == 0)
13157 {
13158 struct Expression * idExp = exp->call.exp;
13159 struct Identifier * id = idExp->identifier;
13160
13161 if(!strcmp(id->string, "__ENDIAN_PAD"))
13162 {
13163 exp->expType = ProcessTypeString("int", 0x1);
13164 if(exp->call.arguments && (*exp->call.arguments).first)
13165 ProcessExpressionType((*exp->call.arguments).first);
13166 break;
13167 }
13168 else if(!strcmp(id->string, "Max") || !strcmp(id->string, "Min") || !strcmp(id->string, "Sgn") || !strcmp(id->string, "Abs"))
13169 {
13170 struct Expression * a = (((void *)0));
13171 struct Expression * b = (((void *)0));
13172 struct Expression * tempExp1 = (((void *)0)), * tempExp2 = (((void *)0));
13173
13174 if((!strcmp(id->string, "Max") || !strcmp(id->string, "Min")) && (*exp->call.arguments).count == 2)
13175 {
13176 a = (*exp->call.arguments).first;
13177 b = (*exp->call.arguments).last;
13178 tempExp1 = a;
13179 tempExp2 = b;
13180 }
13181 else if((*exp->call.arguments).count == 1)
13182 {
13183 a = (*exp->call.arguments).first;
13184 tempExp1 = a;
13185 }
13186 if(a)
13187 {
13188 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear((&*exp->call.arguments));
13189 idExp->identifier = (((void *)0));
13190 FreeExpContents(exp);
13191 ProcessExpressionType(a);
13192 if(b)
13193 ProcessExpressionType(b);
13194 exp->type = 5;
13195 exp->list = MkList();
13196 if(a->expType && (!b || b->expType))
13197 {
13198 if((!a->isConstant && a->type != 0) || (b && !b->isConstant && b->type != 0))
13199 {
13200 if(inCompiler)
13201 {
13202 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13203 struct __ecereNameSpace__ecere__sys__OldList * decls = MkList();
13204 struct Declaration * decl;
13205 char temp1[1024], temp2[1024];
13206
13207 GetTypeSpecs(a->expType, specs);
13208 if(a && !a->isConstant && a->type != 0)
13209 {
13210 sprintf(temp1, "__simpleStruct%d", curContext->simpleID++);
13211 ListAdd(decls, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(temp1)), (((void *)0))));
13212 tempExp1 = QMkExpId(temp1);
13213 tempExp1->expType = a->expType;
13214 if(a->expType)
13215 a->expType->refCount++;
13216 ListAdd(exp->list, MkExpOp(CopyExpression(tempExp1), '=', a));
13217 }
13218 if(b && !b->isConstant && b->type != 0)
13219 {
13220 sprintf(temp2, "__simpleStruct%d", curContext->simpleID++);
13221 ListAdd(decls, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(temp2)), (((void *)0))));
13222 tempExp2 = QMkExpId(temp2);
13223 tempExp2->expType = b->expType;
13224 if(b->expType)
13225 b->expType->refCount++;
13226 ListAdd(exp->list, MkExpOp(CopyExpression(tempExp2), '=', b));
13227 }
13228 decl = MkDeclaration(specs, decls);
13229 if(!curCompound->compound.declarations)
13230 curCompound->compound.declarations = MkList();
13231 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*curCompound->compound.declarations), (((void *)0)), decl);
13232 }
13233 }
13234 }
13235 if(!strcmp(id->string, "Max") || !strcmp(id->string, "Min"))
13236 {
13237 int op = (!strcmp(id->string, "Max")) ? '>' : '<';
13238
13239 ListAdd(exp->list, MkExpCondition(MkExpBrackets(MkListOne(MkExpOp(CopyExpression(tempExp1), op, CopyExpression(tempExp2)))), MkListOne(CopyExpression(tempExp1)), CopyExpression(tempExp2)));
13240 exp->expType = a->expType;
13241 if(a->expType)
13242 a->expType->refCount++;
13243 }
13244 else if(!strcmp(id->string, "Abs"))
13245 {
13246 ListAdd(exp->list, MkExpCondition(MkExpBrackets(MkListOne(MkExpOp(CopyExpression(tempExp1), '<', MkExpConstant("0")))), MkListOne(MkExpOp((((void *)0)), '-', CopyExpression(tempExp1))), CopyExpression(tempExp1)));
13247 exp->expType = a->expType;
13248 if(a->expType)
13249 a->expType->refCount++;
13250 }
13251 else if(!strcmp(id->string, "Sgn"))
13252 {
13253 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"))))));
13254 exp->expType = ProcessTypeString("int", 0x0);
13255 }
13256 FreeExpression(tempExp1);
13257 if(tempExp2)
13258 FreeExpression(tempExp2);
13259 FreeIdentifier(id);
13260 break;
13261 }
13262 }
13263 }
13264 {
13265 struct Type * dummy = (dummy = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), dummy->count = (unsigned int)1, dummy->refCount = 1, dummy);
13266
13267 if(!exp->call.exp->destType)
13268 {
13269 exp->call.exp->destType = dummy;
13270 dummy->refCount++;
13271 }
13272 ProcessExpressionType(exp->call.exp);
13273 if(exp->call.exp->destType == dummy)
13274 {
13275 FreeType(dummy);
13276 exp->call.exp->destType = (((void *)0));
13277 }
13278 FreeType(dummy);
13279 }
13280 functionType = exp->call.exp->expType;
13281 if(functionType && functionType->kind == 16)
13282 {
13283 methodType = functionType;
13284 functionType = methodType->method->dataType;
13285 if(exp->call.exp->expType->usedClass)
13286 {
13287 char typeString[1024];
13288
13289 typeString[0] = '\0';
13290 PrintType(functionType, typeString, 0x1, 0x1);
13291 if(strstr(typeString, "thisclass"))
13292 {
13293 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13294 struct Declarator * decl;
13295
13296 {
13297 struct Context * context = SetupTemplatesContext(exp->call.exp->expType->usedClass);
13298
13299 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
13300 if(thisClass != (exp->call.exp->expType->usedClass->templateClass ? exp->call.exp->expType->usedClass->templateClass : exp->call.exp->expType->usedClass))
13301 thisClassParams = 0x0;
13302 ReplaceThisClassSpecifiers(specs, exp->call.exp->expType->usedClass);
13303 {
13304 struct __ecereNameSpace__ecere__com__Class * backupThisClass = thisClass;
13305
13306 thisClass = exp->call.exp->expType->usedClass;
13307 ProcessDeclarator(decl);
13308 thisClass = backupThisClass;
13309 }
13310 thisClassParams = 0x1;
13311 functionType = ProcessType(specs, decl);
13312 functionType->refCount = 0;
13313 FinishTemplatesContext(context);
13314 }
13315 FreeList(specs, FreeSpecifier);
13316 FreeDeclarator(decl);
13317 }
13318 }
13319 }
13320 if(functionType && functionType->kind == 13 && functionType->type && functionType->type->kind == 11)
13321 {
13322 struct Type * type = functionType->type;
13323
13324 if(!functionType->refCount)
13325 {
13326 functionType->type = (((void *)0));
13327 FreeType(functionType);
13328 }
13329 functionType = type;
13330 }
13331 if(functionType && functionType->kind != 11)
13332 {
13333 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "called object %s is not a function\n", (((void *)0))), name);
13334 }
13335 else if(functionType)
13336 {
13337 unsigned int emptyParams = 0x0, noParams = 0x0;
13338 struct Expression * e = exp->call.arguments ? (*exp->call.arguments).first : (((void *)0));
13339 struct Type * type = functionType->params.first;
13340 struct Expression * memberExp = (exp->call.exp->type == 8) ? exp->call.exp : (((void *)0));
13341 int extra = 0;
13342 struct Location oldyylloc = yylloc;
13343
13344 if(!type)
13345 emptyParams = 0x1;
13346 if(functionType->extraParam && e)
13347 {
13348 e->destType = MkClassType(functionType->thisClass->string);
13349 e = e->next;
13350 }
13351 if(!functionType->staticMethod)
13352 {
13353 if(memberExp && memberExp->member.exp && memberExp->member.exp->expType && memberExp->member.exp->expType->kind == 19 && memberExp->member.exp->expType->_class)
13354 {
13355 type = MkClassType(memberExp->member.exp->expType->_class->string);
13356 if(e)
13357 {
13358 e->destType = type;
13359 e = e->next;
13360 type = functionType->params.first;
13361 }
13362 else
13363 type->refCount = 0;
13364 }
13365 else if(!memberExp && (functionType->thisClass || (methodType && methodType->methodClass)))
13366 {
13367 type = MkClassType(functionType->thisClass ? functionType->thisClass->string : (methodType ? methodType->methodClass->fullName : (((void *)0))));
13368 if(e)
13369 {
13370 e->destType = type;
13371 e = e->next;
13372 type = functionType->params.first;
13373 }
13374 else
13375 type->refCount = 0;
13376 }
13377 }
13378 if(type && type->kind == 0)
13379 {
13380 noParams = 0x1;
13381 if(!type->refCount)
13382 FreeType(type);
13383 type = (((void *)0));
13384 }
13385 for(; e; e = e->next)
13386 {
13387 if(!type && !emptyParams)
13388 {
13389 yylloc = e->loc;
13390 if(methodType && methodType->methodClass)
13391 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);
13392 else
13393 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);
13394 break;
13395 }
13396 if(methodType && type && type->kind == 20 && type->templateParameter->type == 0)
13397 {
13398 struct Type * templatedType = (((void *)0));
13399 struct __ecereNameSpace__ecere__com__Class * _class = methodType->usedClass;
13400 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
13401 int id = 0;
13402
13403 if(_class && _class->templateArgs)
13404 {
13405 struct __ecereNameSpace__ecere__com__Class * sClass;
13406
13407 for(sClass = _class; sClass; sClass = sClass->base)
13408 {
13409 if(sClass->templateClass)
13410 sClass = sClass->templateClass;
13411 id = 0;
13412 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
13413 {
13414 if(curParam->type == 0 && !strcmp(type->templateParameter->identifier->string, curParam->name))
13415 {
13416 struct __ecereNameSpace__ecere__com__Class * nextClass;
13417
13418 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
13419 {
13420 if(nextClass->templateClass)
13421 nextClass = nextClass->templateClass;
13422 id += nextClass->templateParams.count;
13423 }
13424 break;
13425 }
13426 id++;
13427 }
13428 if(curParam)
13429 break;
13430 }
13431 }
13432 if(curParam && _class->templateArgs[id].dataTypeString)
13433 {
13434 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = _class->templateArgs[id];
13435
13436 {
13437 struct Context * context = SetupTemplatesContext(_class);
13438
13439 templatedType = ProcessTypeString(arg.dataTypeString, 0x0);
13440 FinishTemplatesContext(context);
13441 }
13442 e->destType = templatedType;
13443 if(templatedType)
13444 {
13445 templatedType->passAsTemplate = 0x1;
13446 }
13447 }
13448 else
13449 {
13450 e->destType = type;
13451 if(type)
13452 type->refCount++;
13453 }
13454 }
13455 else
13456 {
13457 e->destType = type;
13458 if(type)
13459 type->refCount++;
13460 }
13461 if(type && type->kind != 14)
13462 {
13463 struct Type * next = type->next;
13464
13465 if(!type->refCount)
13466 FreeType(type);
13467 type = next;
13468 }
13469 }
13470 if(type && type->kind != 14)
13471 {
13472 if(methodType && methodType->methodClass)
13473 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);
13474 else
13475 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);
13476 }
13477 yylloc = oldyylloc;
13478 if(type && !type->refCount)
13479 FreeType(type);
13480 }
13481 else
13482 {
13483 functionType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->refCount = 0, ((struct Type *)__ecereTemp1)->kind = 11, ((struct Type *)__ecereTemp1));
13484 if(exp->call.exp->type == 0)
13485 {
13486 char * string = exp->call.exp->identifier->string;
13487
13488 if(inCompiler)
13489 {
13490 struct Symbol * symbol;
13491 struct Location oldyylloc = yylloc;
13492
13493 yylloc = exp->call.exp->identifier->loc;
13494 if(strstr(string, "__builtin_") == string)
13495 ;
13496 else
13497 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "%s undefined; assuming extern returning int\n", (((void *)0))), string);
13498 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));
13499 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)symbol);
13500 if(strstr(symbol->string, "::"))
13501 globalContext->hasNameSpace = 0x1;
13502 yylloc = oldyylloc;
13503 }
13504 }
13505 else if(exp->call.exp->type == 8)
13506 {
13507 }
13508 else
13509 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "callable object undefined; extern assuming returning int\n", (((void *)0))));
13510 if(!functionType->returnType)
13511 {
13512 functionType->returnType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1)->kind = 3, ((struct Type *)__ecereTemp1));
13513 }
13514 }
13515 if(functionType && functionType->kind == 11)
13516 {
13517 exp->expType = functionType->returnType;
13518 if(functionType->returnType)
13519 functionType->returnType->refCount++;
13520 if(!functionType->refCount)
13521 FreeType(functionType);
13522 }
13523 if(exp->call.arguments)
13524 {
13525 for(e = (*exp->call.arguments).first; e; e = e->next)
13526 {
13527 struct Type * destType = e->destType;
13528
13529 ProcessExpressionType(e);
13530 }
13531 }
13532 break;
13533 }
13534 case 8:
13535 {
13536 struct Type * type;
13537 struct Location oldyylloc = yylloc;
13538 unsigned int thisPtr = (exp->member.exp && exp->member.exp->type == 0 && !strcmp(exp->member.exp->identifier->string, "this"));
13539
13540 exp->thisPtr = thisPtr;
13541 if(exp->member.member && exp->member.member->_class && exp->member.member->_class->name)
13542 {
13543 exp->member.member->classSym = exp->member.member->_class->symbol;
13544 }
13545 ProcessExpressionType(exp->member.exp);
13546 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)
13547 {
13548 exp->isConstant = 0x0;
13549 }
13550 else
13551 exp->isConstant = exp->member.exp->isConstant;
13552 type = exp->member.exp->expType;
13553 yylloc = exp->loc;
13554 if(type && (type->kind == 20))
13555 {
13556 struct __ecereNameSpace__ecere__com__Class * _class = thisClass ? thisClass : currentClass;
13557 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param = (((void *)0));
13558
13559 if(_class)
13560 {
13561 for(param = _class->templateParams.first; param; param = param->next)
13562 {
13563 if(param->type == 1 && exp->member.member && exp->member.member->string && !strcmp(param->name, exp->member.member->string))
13564 break;
13565 }
13566 }
13567 if(param && param->defaultArg.member)
13568 {
13569 struct Expression * argExp = GetTemplateArgExpByName(param->name, thisClass, 1);
13570
13571 if(argExp)
13572 {
13573 struct Expression * expMember = exp->member.exp;
13574 struct Declarator * decl;
13575 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13576 char thisClassTypeString[1024];
13577
13578 FreeIdentifier(exp->member.member);
13579 ProcessExpressionType(argExp);
13580 {
13581 char * colon = strstr(param->defaultArg.memberString, "::");
13582
13583 if(colon)
13584 {
13585 char className[1024];
13586 struct __ecereNameSpace__ecere__com__Class * sClass;
13587
13588 memcpy(thisClassTypeString, param->defaultArg.memberString, colon - param->defaultArg.memberString);
13589 thisClassTypeString[colon - param->defaultArg.memberString] = '\0';
13590 }
13591 else
13592 strcpy(thisClassTypeString, _class->fullName);
13593 }
13594 decl = SpecDeclFromString(param->defaultArg.member->dataTypeString, specs, (((void *)0)));
13595 exp->expType = ProcessType(specs, decl);
13596 if(exp->expType->kind == 8 && exp->expType->_class && exp->expType->_class->registered && exp->expType->_class->registered->templateClass)
13597 {
13598 struct __ecereNameSpace__ecere__com__Class * expClass = exp->expType->_class->registered;
13599 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
13600 int c;
13601 int paramCount = 0;
13602 int lastParam = -1;
13603 char templateString[1024];
13604 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
13605
13606 sprintf(templateString, "%s<", expClass->templateClass->fullName);
13607 for(cClass = expClass; cClass; cClass = cClass->base)
13608 {
13609 int p = 0;
13610
13611 for(param = cClass->templateParams.first; param; param = param->next)
13612 {
13613 int id = p;
13614 struct __ecereNameSpace__ecere__com__Class * sClass;
13615 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
13616
13617 for(sClass = cClass->base; sClass; sClass = sClass->base)
13618 id += sClass->templateParams.count;
13619 arg = expClass->templateArgs[id];
13620 for(sClass = _class; sClass; sClass = sClass->base)
13621 {
13622 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * cParam;
13623 int p = 0;
13624 struct __ecereNameSpace__ecere__com__Class * nextClass;
13625
13626 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
13627 p += nextClass->templateParams.count;
13628 for(cParam = sClass->templateParams.first; cParam; cParam = cParam->next, p++)
13629 {
13630 if(cParam->type == 0 && arg.dataTypeString && !strcmp(cParam->name, arg.dataTypeString))
13631 {
13632 if(_class->templateArgs && arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
13633 {
13634 arg.dataTypeString = _class->templateArgs[p].dataTypeString;
13635 arg.dataTypeClass = _class->templateArgs[p].dataTypeClass;
13636 break;
13637 }
13638 }
13639 }
13640 }
13641 {
13642 char argument[256];
13643
13644 argument[0] = '\0';
13645 switch(param->type)
13646 {
13647 case 2:
13648 {
13649 char expString[1024];
13650 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13651 struct Declarator * decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
13652 struct Expression * exp;
13653 char * string = PrintHexUInt64(arg.expression.ui64);
13654
13655 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
13656 ProcessExpressionType(exp);
13657 ComputeExpression(exp);
13658 expString[0] = '\0';
13659 PrintExpression(exp, expString);
13660 strcat(argument, expString);
13661 FreeExpression(exp);
13662 break;
13663 }
13664 case 1:
13665 {
13666 strcat(argument, arg.member->name);
13667 break;
13668 }
13669 case 0:
13670 {
13671 if(arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
13672 {
13673 if(!strcmp(arg.dataTypeString, "thisclass"))
13674 strcat(argument, thisClassTypeString);
13675 else
13676 strcat(argument, arg.dataTypeString);
13677 }
13678 break;
13679 }
13680 }
13681 if(argument[0])
13682 {
13683 if(paramCount)
13684 strcat(templateString, ", ");
13685 if(lastParam != p - 1)
13686 {
13687 strcat(templateString, param->name);
13688 strcat(templateString, " = ");
13689 }
13690 strcat(templateString, argument);
13691 paramCount++;
13692 lastParam = p;
13693 }
13694 p++;
13695 }
13696 }
13697 }
13698 {
13699 int len = strlen(templateString);
13700
13701 if(templateString[len - 1] == '>')
13702 templateString[len++] = ' ';
13703 templateString[len++] = '>';
13704 templateString[len++] = '\0';
13705 }
13706 {
13707 struct Context * context = SetupTemplatesContext(_class);
13708
13709 FreeType(exp->expType);
13710 exp->expType = ProcessTypeString(templateString, 0x0);
13711 FinishTemplatesContext(context);
13712 }
13713 }
13714 exp->type = 5;
13715 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")))))))));
13716 }
13717 }
13718 else if(type->templateParameter && type->templateParameter->type == 0 && (type->templateParameter->dataType || type->templateParameter->dataTypeString))
13719 {
13720 type = ProcessTemplateParameterType(type->templateParameter);
13721 }
13722 }
13723 if(type && (type->kind == 20))
13724 ;
13725 else if(type && (type->kind == 8 || type->kind == 19 || type->kind == 3 || type->kind == 15))
13726 {
13727 struct Identifier * id = exp->member.member;
13728 int typeKind = type->kind;
13729 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));
13730
13731 if(typeKind == 19 && exp->member.exp->type == 26)
13732 {
13733 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "ecere::com::Class");
13734 typeKind = 8;
13735 }
13736 if(id && (typeKind == 3 || typeKind == 15))
13737 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "int");
13738 if(_class && id)
13739 {
13740 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
13741 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
13742 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
13743 struct __ecereNameSpace__ecere__com__Property * revConvert = (((void *)0));
13744 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
13745
13746 if(id && id->_class && id->_class->name && !strcmp(id->_class->name, "property"))
13747 exp->member.memberType = 1;
13748 if(id && id->_class && type->_class && !__ecereNameSpace__ecere__com__eClass_IsDerived(type->_class->registered, _class))
13749 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "invalid class specifier %s for object of class %s\n", (((void *)0))), _class->fullName, type->_class->string);
13750 if(typeKind != 19)
13751 {
13752 if((exp->member.memberType == 0 && thisPtr) || exp->member.memberType == 3)
13753 {
13754 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
13755 if(member && member->_class != (_class->templateClass ? _class->templateClass : _class) && exp->member.memberType != 3)
13756 {
13757 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
13758 if(prop)
13759 member = (((void *)0));
13760 }
13761 if(!member && !prop)
13762 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
13763 if((member && member->_class == (_class->templateClass ? _class->templateClass : _class)) || (prop && prop->_class == (_class->templateClass ? _class->templateClass : _class)))
13764 exp->member.thisPtr = 0x1;
13765 }
13766 else
13767 {
13768 if(!id->classSym)
13769 {
13770 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, (((void *)0)));
13771 if(!id->_class || !id->_class->name || strcmp(id->_class->name, "property"))
13772 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, (((void *)0)), (((void *)0)), (((void *)0)));
13773 }
13774 if(!prop && !member)
13775 {
13776 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, (((void *)0)));
13777 if(!method)
13778 {
13779 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
13780 if(!id->_class || !id->_class->name || strcmp(id->_class->name, "property"))
13781 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
13782 }
13783 }
13784 if(member && prop)
13785 {
13786 if(member->_class != prop->_class && !id->_class && __ecereNameSpace__ecere__com__eClass_IsDerived(member->_class, prop->_class))
13787 prop = (((void *)0));
13788 else
13789 member = (((void *)0));
13790 }
13791 }
13792 }
13793 if(!prop && !member)
13794 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule);
13795 if(!prop && !member && !method)
13796 {
13797 if(typeKind == 19)
13798 {
13799 classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(type->_class->registered, exp->member.member->string);
13800 if(classProp)
13801 {
13802 exp->member.memberType = 5;
13803 exp->expType = ProcessTypeString(classProp->dataTypeString, 0x0);
13804 }
13805 else
13806 {
13807 char structName[1024];
13808 struct Identifier * id = exp->member.member;
13809 struct Expression * classExp = exp->member.exp;
13810
13811 type->refCount++;
13812 FreeType(classExp->expType);
13813 classExp->expType = ProcessTypeString("ecere::com::Class", 0x0);
13814 strcpy(structName, "__ecereClassData_");
13815 FullClassNameCat(structName, type->_class->string, 0x0);
13816 exp->type = 9;
13817 exp->member.member = id;
13818 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"))))))));
13819 FreeType(type);
13820 ProcessExpressionType(exp);
13821 return ;
13822 }
13823 }
13824 else
13825 {
13826 struct Symbol * classSym = FindClass(id->string);
13827
13828 if(classSym)
13829 {
13830 struct __ecereNameSpace__ecere__com__Class * convertClass = classSym->registered;
13831
13832 if(convertClass)
13833 revConvert = __ecereNameSpace__ecere__com__eClass_FindProperty(convertClass, _class->fullName, privateModule);
13834 }
13835 }
13836 }
13837 if(prop)
13838 {
13839 exp->member.memberType = 1;
13840 if(!prop->dataType)
13841 ProcessPropertyType(prop);
13842 exp->expType = prop->dataType;
13843 if(prop->dataType)
13844 prop->dataType->refCount++;
13845 }
13846 else if(member)
13847 {
13848 if(exp->member.exp->expType->classObjectType == 2 && !strcmp(exp->member.member->string, "_class"))
13849 {
13850 FreeExpContents(exp);
13851 exp->type = 0;
13852 exp->identifier = MkIdentifier("class");
13853 ProcessExpressionType(exp);
13854 return ;
13855 }
13856 exp->member.memberType = 3;
13857 DeclareStruct(_class->fullName, 0x0);
13858 if(!member->dataType)
13859 {
13860 struct Context * context = SetupTemplatesContext(_class);
13861
13862 member->dataType = ProcessTypeString(member->dataTypeString, 0x0);
13863 FinishTemplatesContext(context);
13864 }
13865 exp->expType = member->dataType;
13866 if(member->dataType)
13867 member->dataType->refCount++;
13868 }
13869 else if(revConvert)
13870 {
13871 exp->member.memberType = 4;
13872 exp->expType = MkClassType(revConvert->_class->fullName);
13873 }
13874 else if(method)
13875 {
13876 if(inCompiler)
13877 {
13878 exp->member.memberType = 2;
13879 }
13880 if(!method->dataType)
13881 ProcessMethodType(method);
13882 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));
13883 exp->expType->methodClass = (id && id->_class) ? _class : (((void *)0));
13884 exp->expType->usedClass = _class;
13885 }
13886 else if(!classProp)
13887 {
13888 if(exp->member.exp->expType->classObjectType == 2 && !strcmp(exp->member.member->string, "_class"))
13889 {
13890 FreeExpContents(exp);
13891 exp->type = 0;
13892 exp->identifier = MkIdentifier("class");
13893 ProcessExpressionType(exp);
13894 return ;
13895 }
13896 yylloc = exp->member.member->loc;
13897 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't find member %s in class %s\n", (((void *)0))), id->string, _class->fullName);
13898 if(inCompiler)
13899 __ecereNameSpace__ecere__com__eClass_AddDataMember(_class, id->string, "int", 0, 0, 1);
13900 }
13901 if(_class && exp->expType)
13902 {
13903 struct __ecereNameSpace__ecere__com__Class * tClass;
13904
13905 tClass = _class;
13906 while(tClass && !tClass->templateClass)
13907 tClass = tClass->base;
13908 if(tClass && exp->expType->kind == 20 && exp->expType->templateParameter->type == 0)
13909 {
13910 int id = 0;
13911 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
13912 struct __ecereNameSpace__ecere__com__Class * sClass;
13913
13914 for(sClass = tClass; sClass; sClass = sClass->base)
13915 {
13916 id = 0;
13917 if(sClass->templateClass)
13918 sClass = sClass->templateClass;
13919 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
13920 {
13921 if(curParam->type == 0 && !strcmp(exp->expType->templateParameter->identifier->string, curParam->name))
13922 {
13923 for(sClass = sClass->base; sClass; sClass = sClass->base)
13924 id += sClass->templateParams.count;
13925 break;
13926 }
13927 id++;
13928 }
13929 if(curParam)
13930 break;
13931 }
13932 if(curParam && tClass->templateArgs[id].dataTypeString)
13933 {
13934 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = tClass->templateArgs[id];
13935 struct Context * context = SetupTemplatesContext(tClass);
13936
13937 FreeType(exp->expType);
13938 exp->expType = ProcessTypeString(arg.dataTypeString, 0x0);
13939 if(exp->expType)
13940 {
13941 if(exp->expType->kind == 21)
13942 {
13943 FreeType(exp->expType);
13944 exp->expType = ReplaceThisClassType(_class);
13945 }
13946 if(tClass->templateClass)
13947 exp->expType->passAsTemplate = 0x1;
13948 if(!exp->destType)
13949 {
13950 exp->destType = ProcessTypeString(arg.dataTypeString, 0x0);
13951 if(exp->destType->kind == 21)
13952 {
13953 FreeType(exp->destType);
13954 exp->destType = ReplaceThisClassType(_class);
13955 }
13956 }
13957 }
13958 FinishTemplatesContext(context);
13959 }
13960 }
13961 else if(tClass && exp->expType->kind == 13 && exp->expType->type && exp->expType->type->kind == 20 && exp->expType->type->templateParameter->type == 0)
13962 {
13963 int id = 0;
13964 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
13965 struct __ecereNameSpace__ecere__com__Class * sClass;
13966
13967 for(sClass = tClass; sClass; sClass = sClass->base)
13968 {
13969 id = 0;
13970 if(sClass->templateClass)
13971 sClass = sClass->templateClass;
13972 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
13973 {
13974 if(curParam->type == 0 && !strcmp(exp->expType->type->templateParameter->identifier->string, curParam->name))
13975 {
13976 for(sClass = sClass->base; sClass; sClass = sClass->base)
13977 id += sClass->templateParams.count;
13978 break;
13979 }
13980 id++;
13981 }
13982 if(curParam)
13983 break;
13984 }
13985 if(curParam)
13986 {
13987 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = tClass->templateArgs[id];
13988 struct Context * context = SetupTemplatesContext(tClass);
13989 struct Type * basicType;
13990
13991 basicType = ProcessTypeString(arg.dataTypeString, 0x0);
13992 if(basicType)
13993 {
13994 if(basicType->kind == 21)
13995 {
13996 FreeType(basicType);
13997 basicType = ReplaceThisClassType(_class);
13998 }
13999 FreeType(exp->expType);
14000 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));
14001 if(!exp->destType)
14002 {
14003 exp->destType = exp->expType;
14004 exp->destType->refCount++;
14005 }
14006 {
14007 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
14008 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
14009 struct Declarator * decl;
14010
14011 decl = SpecDeclFromString(arg.dataTypeString, specs, (((void *)0)));
14012 *newExp = *exp;
14013 if(exp->destType)
14014 exp->destType->refCount++;
14015 if(exp->expType)
14016 exp->expType->refCount++;
14017 exp->type = 11;
14018 exp->cast.typeName = MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl));
14019 exp->cast.exp = newExp;
14020 }
14021 }
14022 FinishTemplatesContext(context);
14023 }
14024 }
14025 else if(tClass && exp->expType->kind == 8 && exp->expType->_class && strchr(exp->expType->_class->string, '<'))
14026 {
14027 struct __ecereNameSpace__ecere__com__Class * expClass = exp->expType->_class->registered;
14028
14029 if(expClass)
14030 {
14031 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
14032 int c;
14033 int p = 0;
14034 int paramCount = 0;
14035 int lastParam = -1;
14036 char templateString[1024];
14037 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
14038
14039 sprintf(templateString, "%s<", expClass->templateClass->fullName);
14040 while(cClass != expClass)
14041 {
14042 struct __ecereNameSpace__ecere__com__Class * sClass;
14043
14044 for(sClass = expClass; sClass && sClass->base != cClass; sClass = sClass->base)
14045 ;
14046 cClass = sClass;
14047 for(param = cClass->templateParams.first; param; param = param->next)
14048 {
14049 struct __ecereNameSpace__ecere__com__Class * cClassCur = (((void *)0));
14050 int c;
14051 int cp = 0;
14052 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * paramCur = (((void *)0));
14053 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
14054
14055 while(cClassCur != tClass && !paramCur)
14056 {
14057 struct __ecereNameSpace__ecere__com__Class * sClassCur;
14058
14059 for(sClassCur = tClass; sClassCur && sClassCur->base != cClassCur; sClassCur = sClassCur->base)
14060 ;
14061 cClassCur = sClassCur;
14062 for(paramCur = cClassCur->templateParams.first; paramCur; paramCur = paramCur->next)
14063 {
14064 if(!strcmp(paramCur->name, param->name))
14065 {
14066 break;
14067 }
14068 cp++;
14069 }
14070 }
14071 if(paramCur && paramCur->type == 0)
14072 arg = tClass->templateArgs[cp];
14073 else
14074 arg = expClass->templateArgs[p];
14075 {
14076 char argument[256];
14077
14078 argument[0] = '\0';
14079 switch(param->type)
14080 {
14081 case 2:
14082 {
14083 char expString[1024];
14084 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
14085 struct Declarator * decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
14086 struct Expression * exp;
14087 char * string = PrintHexUInt64(arg.expression.ui64);
14088
14089 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
14090 ProcessExpressionType(exp);
14091 ComputeExpression(exp);
14092 expString[0] = '\0';
14093 PrintExpression(exp, expString);
14094 strcat(argument, expString);
14095 FreeExpression(exp);
14096 break;
14097 }
14098 case 1:
14099 {
14100 strcat(argument, arg.member->name);
14101 break;
14102 }
14103 case 0:
14104 {
14105 if(arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
14106 strcat(argument, arg.dataTypeString);
14107 break;
14108 }
14109 }
14110 if(argument[0])
14111 {
14112 if(paramCount)
14113 strcat(templateString, ", ");
14114 if(lastParam != p - 1)
14115 {
14116 strcat(templateString, param->name);
14117 strcat(templateString, " = ");
14118 }
14119 strcat(templateString, argument);
14120 paramCount++;
14121 lastParam = p;
14122 }
14123 }
14124 p++;
14125 }
14126 }
14127 {
14128 int len = strlen(templateString);
14129
14130 if(templateString[len - 1] == '>')
14131 templateString[len++] = ' ';
14132 templateString[len++] = '>';
14133 templateString[len++] = '\0';
14134 }
14135 FreeType(exp->expType);
14136 {
14137 struct Context * context = SetupTemplatesContext(tClass);
14138
14139 exp->expType = ProcessTypeString(templateString, 0x0);
14140 FinishTemplatesContext(context);
14141 }
14142 }
14143 }
14144 }
14145 }
14146 else
14147 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)");
14148 }
14149 else if(type && (type->kind == 9 || type->kind == 10))
14150 {
14151 struct Type * memberType = exp->member.member ? FindMember(type, exp->member.member->string) : (((void *)0));
14152
14153 if(memberType)
14154 {
14155 exp->expType = memberType;
14156 if(memberType)
14157 memberType->refCount++;
14158 }
14159 }
14160 else
14161 {
14162 char expString[10240];
14163
14164 expString[0] = '\0';
14165 if(inCompiler)
14166 {
14167 PrintExpression(exp, expString);
14168 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14169 }
14170 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "member operator on non-structure type expression %s\n", (((void *)0))), expString);
14171 }
14172 if(exp->expType && exp->expType->kind == 21 && (!exp->destType || exp->destType->kind != 21))
14173 {
14174 if(type && (type->kind == 8 || type->kind == 19 || type->kind == 3 || type->kind == 15))
14175 {
14176 struct Identifier * id = exp->member.member;
14177 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));
14178
14179 if(_class)
14180 {
14181 FreeType(exp->expType);
14182 exp->expType = ReplaceThisClassType(_class);
14183 }
14184 }
14185 }
14186 yylloc = oldyylloc;
14187 break;
14188 }
14189 case 9:
14190 {
14191 struct Type * destType = exp->destType;
14192
14193 if(exp->member.member && exp->member.member->_class && exp->member.member->_class->name)
14194 {
14195 exp->member.member->classSym = exp->member.member->_class->symbol;
14196 }
14197 exp->member.exp = MkExpBrackets(MkListOne(MkExpOp((((void *)0)), '*', exp->member.exp)));
14198 exp->type = 8;
14199 if(destType)
14200 destType->count++;
14201 ProcessExpressionType(exp);
14202 if(destType)
14203 destType->count--;
14204 break;
14205 }
14206 case 15:
14207 {
14208 struct Symbol * classSym = exp->_class->symbol;
14209
14210 if(classSym && classSym->registered)
14211 {
14212 if(classSym->registered->type == 5)
14213 {
14214 char name[1024];
14215
14216 name[0] = '\0';
14217 DeclareStruct(classSym->string, 0x0);
14218 FreeSpecifier(exp->_class);
14219 exp->type = 10;
14220 FullClassNameCat(name, classSym->string, 0x0);
14221 exp->typeName = MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(name), (((void *)0)))), (((void *)0)));
14222 }
14223 else
14224 {
14225 if(classSym->registered->fixed)
14226 {
14227 FreeSpecifier(exp->_class);
14228 exp->constant = PrintUInt(classSym->registered->templateClass ? classSym->registered->templateClass->structSize : classSym->registered->structSize);
14229 exp->type = 2;
14230 }
14231 else
14232 {
14233 char className[1024];
14234
14235 strcpy(className, "__ecereClass_");
14236 FullClassNameCat(className, classSym->string, 0x1);
14237 MangleClassName(className);
14238 DeclareClass(classSym, className);
14239 FreeExpContents(exp);
14240 exp->type = 9;
14241 exp->member.exp = MkExpIdentifier(MkIdentifier(className));
14242 exp->member.member = MkIdentifier("structSize");
14243 }
14244 }
14245 }
14246 exp->expType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1)->kind = 3, ((struct Type *)__ecereTemp1));
14247 break;
14248 }
14249 case 10:
14250 {
14251 struct Type * type = ProcessType(exp->typeName->qualifiers, exp->typeName->declarator);
14252
14253 exp->expType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1)->kind = 3, ((struct Type *)__ecereTemp1));
14254 exp->isConstant = 0x1;
14255 DeclareType(type, 0x0, 0x0);
14256 FreeType(type);
14257 break;
14258 }
14259 case 11:
14260 {
14261 struct Type * type = ProcessType(exp->cast.typeName->qualifiers, exp->cast.typeName->declarator);
14262
14263 type->count = (unsigned int)1;
14264 FreeType(exp->cast.exp->destType);
14265 exp->cast.exp->destType = type;
14266 type->refCount++;
14267 ProcessExpressionType(exp->cast.exp);
14268 type->count = (unsigned int)0;
14269 exp->expType = type;
14270 if(!exp->cast.exp->needCast && !NeedCast(exp->cast.exp->expType, type))
14271 {
14272 void * prev = exp->prev, * next = exp->next;
14273 struct Type * expType = exp->cast.exp->destType;
14274 struct Expression * castExp = exp->cast.exp;
14275 struct Type * destType = exp->destType;
14276
14277 if(expType)
14278 expType->refCount++;
14279 FreeType(exp->expType);
14280 FreeTypeName(exp->cast.typeName);
14281 *exp = *castExp;
14282 FreeType(exp->expType);
14283 FreeType(exp->destType);
14284 exp->expType = expType;
14285 exp->destType = destType;
14286 ((castExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(castExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(castExp)) : 0), castExp = 0);
14287 exp->prev = prev;
14288 exp->next = next;
14289 }
14290 else
14291 {
14292 exp->isConstant = exp->cast.exp->isConstant;
14293 }
14294 break;
14295 }
14296 case 35:
14297 {
14298 struct Type * type = ProcessType(exp->initializer.typeName->qualifiers, exp->initializer.typeName->declarator);
14299
14300 type->refCount++;
14301 exp->expType = type;
14302 break;
14303 }
14304 case 36:
14305 {
14306 struct Type * type = ProcessType(exp->vaArg.typeName->qualifiers, exp->vaArg.typeName->declarator);
14307
14308 ProcessExpressionType(exp->vaArg.exp);
14309 type->refCount++;
14310 exp->expType = type;
14311 break;
14312 }
14313 case 12:
14314 {
14315 struct Expression * e;
14316
14317 exp->isConstant = 0x1;
14318 FreeType(exp->cond.cond->destType);
14319 exp->cond.cond->destType = MkClassType("bool");
14320 exp->cond.cond->destType->truth = 0x1;
14321 ProcessExpressionType(exp->cond.cond);
14322 if(!exp->cond.cond->isConstant)
14323 exp->isConstant = 0x0;
14324 for(e = (*exp->cond.exp).first; e; e = e->next)
14325 {
14326 if(!e->next)
14327 {
14328 FreeType(e->destType);
14329 e->destType = exp->destType;
14330 if(e->destType)
14331 e->destType->refCount++;
14332 }
14333 ProcessExpressionType(e);
14334 if(!e->next)
14335 {
14336 exp->expType = e->expType;
14337 if(e->expType)
14338 e->expType->refCount++;
14339 }
14340 if(!e->isConstant)
14341 exp->isConstant = 0x0;
14342 }
14343 FreeType(exp->cond.elseExp->destType);
14344 exp->cond.elseExp->destType = exp->destType ? exp->destType : exp->expType;
14345 if(exp->cond.elseExp->destType)
14346 exp->cond.elseExp->destType->refCount++;
14347 ProcessExpressionType(exp->cond.elseExp);
14348 if(!exp->cond.elseExp->isConstant)
14349 exp->isConstant = 0x0;
14350 break;
14351 }
14352 case 25:
14353 {
14354 if(exp->compound && exp->compound->compound.statements && (*exp->compound->compound.statements).last)
14355 {
14356 struct Statement * last = (*exp->compound->compound.statements).last;
14357
14358 if(last->type == 3 && last->expressions && (*last->expressions).last)
14359 {
14360 ((struct Expression *)(*last->expressions).last)->destType = exp->destType;
14361 if(exp->destType)
14362 exp->destType->refCount++;
14363 }
14364 ProcessStatement(exp->compound);
14365 exp->expType = ((struct Expression *)(*last->expressions).last)->expType;
14366 if(((struct Expression *)(*last->expressions).last)->expType)
14367 exp->expType->refCount++;
14368 }
14369 break;
14370 }
14371 case 26:
14372 {
14373 struct Specifier * spec = (*exp->_classExp.specifiers).first;
14374
14375 if(spec && spec->type == 1)
14376 {
14377 exp->expType = MkClassType(spec->name);
14378 exp->expType->kind = 19;
14379 exp->byReference = 0x1;
14380 }
14381 else
14382 {
14383 exp->expType = MkClassType("ecere::com::Class");
14384 exp->byReference = 0x1;
14385 }
14386 break;
14387 }
14388 case 27:
14389 {
14390 struct __ecereNameSpace__ecere__com__Class * _class = thisClass ? thisClass : currentClass;
14391
14392 if(_class)
14393 {
14394 struct Identifier * id = exp->classData.id;
14395 char structName[1024];
14396 struct Expression * classExp;
14397
14398 strcpy(structName, "__ecereClassData_");
14399 FullClassNameCat(structName, _class->fullName, 0x0);
14400 exp->type = 9;
14401 exp->member.member = id;
14402 if(curCompound && FindSymbol("this", curContext, curCompound->compound.context, 0x0, 0x0))
14403 classExp = MkExpMember(MkExpIdentifier(MkIdentifier("this")), MkIdentifier("_class"));
14404 else
14405 classExp = MkExpIdentifier(MkIdentifier("class"));
14406 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"))))))));
14407 ProcessExpressionType(exp);
14408 return ;
14409 }
14410 break;
14411 }
14412 case 37:
14413 {
14414 struct Type * type = (((void *)0));
14415 char * typeString = (((void *)0));
14416 char typeStringBuf[1024];
14417
14418 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))
14419 {
14420 struct __ecereNameSpace__ecere__com__Class * templateClass = exp->destType->_class->registered;
14421
14422 typeString = templateClass->templateArgs[2].dataTypeString;
14423 }
14424 else if(exp->list)
14425 {
14426 struct Expression * e;
14427
14428 for(e = (*exp->list).first; e; e = e->next)
14429 {
14430 ProcessExpressionType(e);
14431 if(e->expType)
14432 {
14433 if(!type)
14434 {
14435 type = e->expType;
14436 type->refCount++;
14437 }
14438 else
14439 {
14440 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
14441 {
14442 FreeType(type);
14443 type = e->expType;
14444 e->expType = (((void *)0));
14445 e = (*exp->list).first;
14446 ProcessExpressionType(e);
14447 if(e->expType)
14448 {
14449 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
14450 {
14451 FreeType(e->expType);
14452 e->expType = (((void *)0));
14453 FreeType(type);
14454 type = (((void *)0));
14455 break;
14456 }
14457 }
14458 }
14459 }
14460 if(e->expType)
14461 {
14462 FreeType(e->expType);
14463 e->expType = (((void *)0));
14464 }
14465 }
14466 }
14467 if(type)
14468 {
14469 typeStringBuf[0] = '\0';
14470 PrintType(type, typeStringBuf, 0x0, 0x1);
14471 typeString = typeStringBuf;
14472 FreeType(type);
14473 type = (((void *)0));
14474 }
14475 }
14476 if(typeString)
14477 {
14478 char templateString[1024];
14479 struct __ecereNameSpace__ecere__sys__OldList * initializers = MkList();
14480 struct __ecereNameSpace__ecere__sys__OldList * structInitializers = MkList();
14481 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
14482 struct Expression * expExt;
14483 struct Declarator * decl = SpecDeclFromString(typeString, specs, (((void *)0)));
14484
14485 sprintf(templateString, "Container<%s>", typeString);
14486 if(exp->list)
14487 {
14488 struct Expression * e;
14489
14490 type = ProcessTypeString(typeString, 0x0);
14491 while(e = (*exp->list).first)
14492 {
14493 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*exp->list), e);
14494 e->destType = type;
14495 type->refCount++;
14496 ProcessExpressionType(e);
14497 ListAdd(initializers, MkInitializerAssignment(e));
14498 }
14499 FreeType(type);
14500 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->list), exp->list = 0);
14501 }
14502 DeclareStruct("ecere::com::BuiltInContainer", 0x0);
14503 ListAdd(structInitializers, MkInitializerAssignment(MkExpMember(MkExpClass(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0))), MkIdentifier("_vTbl"))));
14504 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
14505 ListAdd(structInitializers, MkInitializerAssignment(MkExpClass(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0)))));
14506 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
14507 ListAdd(structInitializers, MkInitializerAssignment(MkExpConstant("0")));
14508 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
14509 ListAdd(structInitializers, MkInitializerAssignment(MkExpExtensionInitializer(MkTypeName(specs, MkDeclaratorArray(decl, (((void *)0)))), MkInitializerList(initializers))));
14510 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
14511 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))));
14512 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
14513 ListAdd(structInitializers, MkInitializerAssignment(MkExpClass(CopyList(specs, CopySpecifier), CopyDeclarator(decl))));
14514 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
14515 exp->expType = ProcessTypeString(templateString, 0x0);
14516 exp->type = 5;
14517 exp->list = MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName(templateString)), (((void *)0))), MkExpOp((((void *)0)), '&', expExt = MkExpExtensionInitializer(MkTypeName(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0))), MkInitializerList(structInitializers)))));
14518 ProcessExpressionType(expExt);
14519 }
14520 else
14521 {
14522 exp->expType = ProcessTypeString("Container", 0x0);
14523 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Couldn't determine type of array elements\n", (((void *)0))));
14524 }
14525 break;
14526 }
14527 }
14528 if(exp->expType && exp->expType->kind == 21 && thisClass && (!exp->destType || exp->destType->kind != 21))
14529 {
14530 FreeType(exp->expType);
14531 exp->expType = ReplaceThisClassType(thisClass);
14532 }
14533 if(exp->expType && (exp->expType->kind == 9 || exp->expType->kind == 10 || exp->expType->kind == 15) && !exp->expType->members.first && exp->expType->enumName)
14534 {
14535 struct Symbol * symbol = FindSymbol(exp->expType->enumName, curContext, globalContext, 0x1, 0x0);
14536
14537 if(symbol)
14538 {
14539 if(exp->expType->kind != 15)
14540 {
14541 struct Type * member;
14542 char * enumName = __ecereNameSpace__ecere__sys__CopyString(exp->expType->enumName);
14543
14544 FreeType(exp->expType);
14545 exp->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14546 exp->expType->kind = symbol->type->kind;
14547 exp->expType->refCount++;
14548 exp->expType->enumName = enumName;
14549 exp->expType->members = symbol->type->members;
14550 for(member = symbol->type->members.first; member; member = member->next)
14551 member->refCount++;
14552 }
14553 else
14554 {
14555 struct __ecereNameSpace__ecere__sys__NamedLink * member;
14556
14557 for(member = symbol->type->members.first; member; member = member->next)
14558 {
14559 struct __ecereNameSpace__ecere__sys__NamedLink * value = (value = __ecereNameSpace__ecere__com__eSystem_New0(16), value->name = __ecereNameSpace__ecere__sys__CopyString(member->name), value);
14560
14561 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&exp->expType->members, value);
14562 }
14563 }
14564 }
14565 }
14566 yylloc = exp->loc;
14567 if(exp->destType && (exp->destType->kind == 0 || exp->destType->kind == 18))
14568 ;
14569 else if(exp->destType && !exp->destType->keepCast)
14570 {
14571 if(!CheckExpressionType(exp, exp->destType, 0x0))
14572 {
14573 if(!exp->destType->count || unresolved)
14574 {
14575 if(!exp->expType)
14576 {
14577 yylloc = exp->loc;
14578 if(exp->destType->kind != 14)
14579 {
14580 char type2[1024];
14581
14582 type2[0] = '\0';
14583 if(inCompiler)
14584 {
14585 char expString[10240];
14586
14587 expString[0] = '\0';
14588 PrintType(exp->destType, type2, 0x0, 0x1);
14589 if(inCompiler)
14590 {
14591 PrintExpression(exp, expString);
14592 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14593 }
14594 if(unresolved)
14595 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "unresolved identifier %s; expected %s\n", (((void *)0))), expString, type2);
14596 else if(exp->type != 16)
14597 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't determine type of %s; expected %s\n", (((void *)0))), expString, type2);
14598 }
14599 }
14600 else
14601 {
14602 char expString[10240];
14603
14604 expString[0] = '\0';
14605 if(inCompiler)
14606 {
14607 PrintExpression(exp, expString);
14608 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14609 }
14610 if(unresolved)
14611 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "unresolved identifier %s\n", (((void *)0))), expString);
14612 else if(exp->type != 16)
14613 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't determine type of %s\n", (((void *)0))), expString);
14614 }
14615 }
14616 else
14617 {
14618 char type1[1024];
14619 char type2[1024];
14620
14621 type1[0] = '\0';
14622 type2[0] = '\0';
14623 if(inCompiler)
14624 {
14625 PrintType(exp->expType, type1, 0x0, 0x1);
14626 PrintType(exp->destType, type2, 0x0, 0x1);
14627 }
14628 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)))
14629 ;
14630 else
14631 {
14632 char expString[10240];
14633
14634 expString[0] = '\0';
14635 if(inCompiler)
14636 {
14637 PrintExpression(exp, expString);
14638 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14639 }
14640 if(!sourceFile || (strcmp(sourceFile, "src\\lexer.ec") && strcmp(sourceFile, "src/lexer.ec") && strcmp(sourceFile, "src\\grammar.ec") && strcmp(sourceFile, "src/grammar.ec")))
14641 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible expression %s (%s); expected %s\n", (((void *)0))), expString, type1, type2);
14642 FreeType(exp->expType);
14643 exp->destType->refCount++;
14644 exp->expType = exp->destType;
14645 }
14646 }
14647 }
14648 }
14649 else if(exp->destType && exp->destType->kind == 14 && exp->expType && exp->expType->passAsTemplate)
14650 {
14651 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
14652 char typeString[1024];
14653 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
14654 struct Declarator * decl;
14655
14656 typeString[0] = '\0';
14657 *newExp = *exp;
14658 if(exp->expType)
14659 exp->expType->refCount++;
14660 if(exp->expType)
14661 exp->expType->refCount++;
14662 exp->type = 11;
14663 newExp->destType = exp->expType;
14664 PrintType(exp->expType, typeString, 0x0, 0x0);
14665 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
14666 exp->cast.typeName = MkTypeName(specs, decl);
14667 exp->cast.exp = newExp;
14668 }
14669 }
14670 else if(unresolved)
14671 {
14672 if(exp->identifier->_class && exp->identifier->_class->name)
14673 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "unresolved identifier %s::%s\n", (((void *)0))), exp->identifier->_class->name, exp->identifier->string);
14674 else if(exp->identifier->string && exp->identifier->string[0])
14675 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "unresolved identifier %s\n", (((void *)0))), exp->identifier->string);
14676 }
14677 else if(!exp->expType && exp->type != 16)
14678 {
14679 char expString[10240];
14680
14681 expString[0] = '\0';
14682 if(inCompiler)
14683 {
14684 PrintExpression(exp, expString);
14685 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14686 }
14687 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't determine type of %s\n", (((void *)0))), expString);
14688 }
14689 ApplyAnyObjectLogic(exp);
14690 if(!notByReference && exp->expType && exp->expType->kind == 8 && exp->expType->_class && exp->expType->_class->registered && exp->expType->_class->registered->type == 5)
14691 {
14692 exp->byReference = 0x1;
14693 }
14694 yylloc = oldyylloc;
14695 }
14696
14697 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)
14698 {
14699 if(*curMember)
14700 {
14701 *curMember = (*curMember)->next;
14702 if(subMemberStackPos && *subMemberStackPos > 0 && subMemberStack[*subMemberStackPos - 1]->type == 1)
14703 {
14704 *curMember = subMemberStack[--(*subMemberStackPos)];
14705 *curMember = (*curMember)->next;
14706 }
14707 while((*curMember) && (*curMember)->isProperty)
14708 *curMember = (*curMember)->next;
14709 if(subMemberStackPos)
14710 {
14711 while((*curMember) && !(*curMember)->isProperty && !(*curMember)->name && ((*curMember)->type == 2 || (*curMember)->type == 1))
14712 {
14713 subMemberStack[(*subMemberStackPos)++] = *curMember;
14714 *curMember = (*curMember)->members.first;
14715 while(*curMember && (*curMember)->isProperty)
14716 *curMember = (*curMember)->next;
14717 }
14718 }
14719 }
14720 while(!*curMember)
14721 {
14722 if(!*curMember)
14723 {
14724 if(subMemberStackPos && *subMemberStackPos)
14725 {
14726 *curMember = subMemberStack[--(*subMemberStackPos)];
14727 *curMember = (*curMember)->next;
14728 }
14729 else
14730 {
14731 struct __ecereNameSpace__ecere__com__Class * lastCurClass = *curClass;
14732
14733 if(*curClass == _class)
14734 break;
14735 for(*curClass = _class; (*curClass)->base != lastCurClass && (*curClass)->base->type != 1000; *curClass = (*curClass)->base)
14736 ;
14737 *curMember = (*curClass)->membersAndProperties.first;
14738 }
14739 while((*curMember) && (*curMember)->isProperty)
14740 *curMember = (*curMember)->next;
14741 if(subMemberStackPos)
14742 {
14743 while((*curMember) && !(*curMember)->isProperty && !(*curMember)->name && ((*curMember)->type == 2 || (*curMember)->type == 1))
14744 {
14745 subMemberStack[(*subMemberStackPos)++] = *curMember;
14746 *curMember = (*curMember)->members.first;
14747 while(*curMember && (*curMember)->isProperty)
14748 *curMember = (*curMember)->next;
14749 }
14750 }
14751 }
14752 }
14753 }
14754
14755 static void ProcessInitializer(struct Initializer * init, struct Type * type)
14756 {
14757 switch(init->type)
14758 {
14759 case 0:
14760 if(!init->exp || init->exp->type != 1 || !init->exp->instance || init->exp->instance->_class || !type || type->kind == 8)
14761 {
14762 if(init->exp && !init->exp->destType)
14763 {
14764 FreeType(init->exp->destType);
14765 init->exp->destType = type;
14766 if(type)
14767 type->refCount++;
14768 }
14769 if(init->exp)
14770 {
14771 ProcessExpressionType(init->exp);
14772 init->isConstant = init->exp->isConstant;
14773 }
14774 break;
14775 }
14776 else
14777 {
14778 struct Expression * exp = init->exp;
14779 struct Instantiation * inst = exp->instance;
14780 struct MembersInit * members;
14781
14782 init->type = 1;
14783 init->list = MkList();
14784 if(inst->members)
14785 {
14786 for(members = (*inst->members).first; members; members = members->next)
14787 {
14788 if(members->type == 0)
14789 {
14790 struct MemberInit * member;
14791
14792 for(member = (*members->dataMembers).first; member; member = member->next)
14793 {
14794 ListAdd(init->list, member->initializer);
14795 member->initializer = (((void *)0));
14796 }
14797 }
14798 }
14799 }
14800 FreeExpression(exp);
14801 }
14802 case 1:
14803 {
14804 struct Initializer * i;
14805 struct Type * initializerType = (((void *)0));
14806 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
14807 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
14808 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
14809 int subMemberStackPos = 0;
14810
14811 if(type && type->kind == 12)
14812 initializerType = Dereference(type);
14813 else if(type && (type->kind == 9 || type->kind == 10))
14814 initializerType = type->members.first;
14815 for(i = (*init->list).first; i; i = i->next)
14816 {
14817 if(type && type->kind == 8 && type->_class && type->_class->registered)
14818 {
14819 FindNextDataMember(type->_class->registered, &curClass, &curMember, subMemberStack, &subMemberStackPos);
14820 if(curMember)
14821 {
14822 if(!curMember->dataType)
14823 curMember->dataType = ProcessTypeString(curMember->dataTypeString, 0x0);
14824 initializerType = curMember->dataType;
14825 }
14826 }
14827 ProcessInitializer(i, initializerType);
14828 if(initializerType && type && (type->kind == 9 || type->kind == 10))
14829 initializerType = initializerType->next;
14830 if(!i->isConstant)
14831 init->isConstant = 0x0;
14832 }
14833 if(type && type->kind == 12)
14834 FreeType(initializerType);
14835 if(type && type->kind != 12 && type->kind != 9 && type->kind != 10 && (type->kind != 8 || !type->_class->registered || type->_class->registered->type != 1))
14836 {
14837 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Assigning list initializer to non list\n", (((void *)0))));
14838 }
14839 break;
14840 }
14841 }
14842 }
14843
14844 extern struct Symbol * FindType(struct Context * ctx, char *  name);
14845
14846 static void ProcessClass(struct __ecereNameSpace__ecere__sys__OldList * definitions, struct Symbol * symbol);
14847
14848 static void ProcessSpecifier(struct Specifier * spec, unsigned int declareStruct)
14849 {
14850 switch(spec->type)
14851 {
14852 case 0:
14853 {
14854 if(spec->specifier == THISCLASS)
14855 {
14856 if(thisClass)
14857 {
14858 spec->type = 1;
14859 spec->name = ReplaceThisClass(thisClass);
14860 spec->symbol = FindClass(spec->name);
14861 ProcessSpecifier(spec, declareStruct);
14862 }
14863 }
14864 break;
14865 }
14866 case 1:
14867 {
14868 struct Symbol * symbol = FindType(curContext, spec->name);
14869
14870 if(symbol)
14871 DeclareType(symbol->type, 0x1, 0x1);
14872 else if((symbol = spec->symbol) && symbol->registered && symbol->registered->type == 1 && declareStruct)
14873 DeclareStruct(spec->name, 0x0);
14874 break;
14875 }
14876 case 2:
14877 {
14878 struct Enumerator * e;
14879
14880 if(spec->list)
14881 {
14882 for(e = (*spec->list).first; e; e = e->next)
14883 {
14884 if(e->exp)
14885 ProcessExpressionType(e->exp);
14886 }
14887 }
14888 break;
14889 }
14890 case 3:
14891 case 4:
14892 {
14893 if(spec->definitions)
14894 {
14895 struct ClassDef * def;
14896 struct Symbol * symbol = spec->id ? FindClass(spec->id->string) : (((void *)0));
14897
14898 ProcessClass(spec->definitions, symbol);
14899 }
14900 break;
14901 }
14902 }
14903 }
14904
14905 static void ProcessDeclarator(struct Declarator * decl)
14906 {
14907 switch(decl->type)
14908 {
14909 case 1:
14910 if(decl->identifier->classSym)
14911 {
14912 FreeSpecifier(decl->identifier->_class);
14913 decl->identifier->_class = (((void *)0));
14914 }
14915 break;
14916 case 3:
14917 if(decl->array.exp)
14918 ProcessExpressionType(decl->array.exp);
14919 case 0:
14920 case 2:
14921 case 4:
14922 case 5:
14923 case 6:
14924 case 7:
14925 if(decl->declarator)
14926 ProcessDeclarator(decl->declarator);
14927 if(decl->type == 4)
14928 {
14929 struct Identifier * id = GetDeclId(decl);
14930
14931 if(id && id->_class)
14932 {
14933 struct TypeName * param = (param = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TypeName), param->qualifiers = MkListOne(id->_class), param->declarator = (((void *)0)), param);
14934
14935 if(!decl->function.parameters)
14936 decl->function.parameters = MkList();
14937 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*decl->function.parameters), (((void *)0)), param);
14938 id->_class = (((void *)0));
14939 }
14940 if(decl->function.parameters)
14941 {
14942 struct TypeName * param;
14943
14944 for(param = (*decl->function.parameters).first; param; param = param->next)
14945 {
14946 if(param->qualifiers && (*param->qualifiers).first)
14947 {
14948 struct Specifier * spec = (*param->qualifiers).first;
14949
14950 if(spec && spec->specifier == TYPED_OBJECT)
14951 {
14952 struct Declarator * d = param->declarator;
14953 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);
14954
14955 FreeList(param->qualifiers, FreeSpecifier);
14956 param->qualifiers = MkListOne(MkStructOrUnion(3, MkIdentifier("__ecereNameSpace__ecere__com__Class"), (((void *)0))));
14957 param->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier("class")));
14958 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*decl->function.parameters), param, newParam);
14959 param = newParam;
14960 }
14961 else if(spec && spec->specifier == ANY_OBJECT)
14962 {
14963 struct Declarator * d = param->declarator;
14964
14965 FreeList(param->qualifiers, FreeSpecifier);
14966 param->qualifiers = MkListOne(MkSpecifier(VOID));
14967 param->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d);
14968 }
14969 else if(spec->specifier == THISCLASS)
14970 {
14971 if(thisClass)
14972 {
14973 spec->type = 1;
14974 spec->name = ReplaceThisClass(thisClass);
14975 spec->symbol = FindClass(spec->name);
14976 ProcessSpecifier(spec, 0x0);
14977 }
14978 }
14979 }
14980 if(param->declarator)
14981 ProcessDeclarator(param->declarator);
14982 }
14983 }
14984 }
14985 break;
14986 }
14987 }
14988
14989 extern struct Identifier * CopyIdentifier(struct Identifier * id);
14990
14991 extern void FreeInitDeclarator(struct InitDeclarator * decl);
14992
14993 static void ProcessDeclaration(struct Declaration * decl)
14994 {
14995 yylloc = decl->loc;
14996 switch(decl->type)
14997 {
14998 case 1:
14999 {
15000 unsigned int declareStruct = 0x0;
15001
15002 if(decl->declarators)
15003 {
15004 struct InitDeclarator * d;
15005
15006 for(d = (*decl->declarators).first; d; d = d->next)
15007 {
15008 struct Type * type, * subType;
15009
15010 ProcessDeclarator(d->declarator);
15011 type = ProcessType(decl->specifiers, d->declarator);
15012 if(d->initializer)
15013 {
15014 ProcessInitializer(d->initializer, type);
15015 if((*decl->declarators).count == 1 && d->initializer->type == 0 && d->initializer->exp->type == 1)
15016 {
15017 if(type->kind == 8 && type->_class == d->initializer->exp->expType->_class)
15018 {
15019 struct Instantiation * inst = d->initializer->exp->instance;
15020
15021 inst->exp = MkExpIdentifier(CopyIdentifier(GetDeclId(d->declarator)));
15022 d->initializer->exp->instance = (((void *)0));
15023 if(decl->specifiers)
15024 FreeList(decl->specifiers, FreeSpecifier);
15025 FreeList(decl->declarators, FreeInitDeclarator);
15026 d = (((void *)0));
15027 decl->type = 2;
15028 decl->inst = inst;
15029 }
15030 }
15031 }
15032 for(subType = type; subType; )
15033 {
15034 if(subType->kind == 8)
15035 {
15036 declareStruct = 0x1;
15037 break;
15038 }
15039 else if(subType->kind == 13)
15040 break;
15041 else if(subType->kind == 12)
15042 subType = subType->arrayType;
15043 else
15044 break;
15045 }
15046 FreeType(type);
15047 if(!d)
15048 break;
15049 }
15050 }
15051 if(decl->specifiers)
15052 {
15053 struct Specifier * s;
15054
15055 for(s = (*decl->specifiers).first; s; s = s->next)
15056 {
15057 ProcessSpecifier(s, declareStruct);
15058 }
15059 }
15060 break;
15061 }
15062 case 2:
15063 {
15064 ProcessInstantiationType(decl->inst);
15065 break;
15066 }
15067 case 0:
15068 {
15069 struct Specifier * spec;
15070 struct Declarator * d;
15071 unsigned int declareStruct = 0x0;
15072
15073 if(decl->declarators)
15074 {
15075 for(d = (*decl->declarators).first; d; d = d->next)
15076 {
15077 struct Type * type = ProcessType(decl->specifiers, d->declarator);
15078 struct Type * subType;
15079
15080 ProcessDeclarator(d);
15081 for(subType = type; subType; )
15082 {
15083 if(subType->kind == 8)
15084 {
15085 declareStruct = 0x1;
15086 break;
15087 }
15088 else if(subType->kind == 13)
15089 break;
15090 else if(subType->kind == 12)
15091 subType = subType->arrayType;
15092 else
15093 break;
15094 }
15095 FreeType(type);
15096 }
15097 }
15098 if(decl->specifiers)
15099 {
15100 for(spec = (*decl->specifiers).first; spec; spec = spec->next)
15101 ProcessSpecifier(spec, declareStruct);
15102 }
15103 break;
15104 }
15105 }
15106 }
15107
15108 static struct FunctionDefinition * curFunction;
15109
15110 static void CreateFireWatcher(struct __ecereNameSpace__ecere__com__Property * prop, struct Expression * object, struct Statement * stmt)
15111 {
15112 char propName[1024], propNameM[1024];
15113 char getName[1024], setName[1024];
15114 struct __ecereNameSpace__ecere__sys__OldList * args;
15115
15116 DeclareProperty(prop, setName, getName);
15117 strcpy(propName, "__ecereProp_");
15118 FullClassNameCat(propName, prop->_class->fullName, 0x0);
15119 strcat(propName, "_");
15120 FullClassNameCat(propName, prop->name, 0x1);
15121 MangleClassName(propName);
15122 strcpy(propNameM, "__ecerePropM_");
15123 FullClassNameCat(propNameM, prop->_class->fullName, 0x0);
15124 strcat(propNameM, "_");
15125 FullClassNameCat(propNameM, prop->name, 0x1);
15126 MangleClassName(propNameM);
15127 if(prop->isWatchable)
15128 {
15129 args = MkList();
15130 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
15131 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
15132 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireWatchers")), args));
15133 args = MkList();
15134 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
15135 ListAdd(args, MkExpIdentifier(MkIdentifier(propNameM)));
15136 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireWatchers")), args));
15137 }
15138 {
15139 args = MkList();
15140 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
15141 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
15142 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireSelfWatchers")), args));
15143 args = MkList();
15144 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
15145 ListAdd(args, MkExpIdentifier(MkIdentifier(propNameM)));
15146 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireSelfWatchers")), args));
15147 }
15148 if(curFunction->propSet && !strcmp(curFunction->propSet->string, prop->name) && (!object || (object->type == 0 && !strcmp(object->identifier->string, "this"))))
15149 curFunction->propSet->fireWatchersDone = 0x1;
15150 }
15151
15152 extern struct Declaration * MkDeclarationInst(struct Instantiation * inst);
15153
15154 extern struct Instantiation * MkInstantiationNamed(struct __ecereNameSpace__ecere__sys__OldList * specs, struct Expression * exp, struct __ecereNameSpace__ecere__sys__OldList * members);
15155
15156 extern struct Statement * MkIfStmt(struct __ecereNameSpace__ecere__sys__OldList * exp, struct Statement * statement, struct Statement * elseStmt);
15157
15158 extern struct Statement * MkForStmt(struct Statement * init, struct Statement * check, struct __ecereNameSpace__ecere__sys__OldList * inc, struct Statement * statement);
15159
15160 extern struct Statement * MkWhileStmt(struct __ecereNameSpace__ecere__sys__OldList * exp, struct Statement * statement);
15161
15162 extern struct ClassFunction * MkClassFunction(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct Specifier * _class, struct Declarator * decl, struct __ecereNameSpace__ecere__sys__OldList * declList);
15163
15164 extern void ProcessClassFunctionBody(struct ClassFunction * func, struct Statement * body);
15165
15166 extern void FreePropertyWatch(struct PropertyWatch * watcher);
15167
15168 static void ProcessStatement(struct Statement * stmt)
15169 {
15170 yylloc = stmt->loc;
15171 switch(stmt->type)
15172 {
15173 case 0:
15174 ProcessStatement(stmt->labeled.stmt);
15175 break;
15176 case 1:
15177 if(stmt->caseStmt.exp)
15178 {
15179 FreeType(stmt->caseStmt.exp->destType);
15180 stmt->caseStmt.exp->destType = curSwitchType;
15181 if(curSwitchType)
15182 curSwitchType->refCount++;
15183 ProcessExpressionType(stmt->caseStmt.exp);
15184 ComputeExpression(stmt->caseStmt.exp);
15185 }
15186 if(stmt->caseStmt.stmt)
15187 ProcessStatement(stmt->caseStmt.stmt);
15188 break;
15189 case 2:
15190 {
15191 if(stmt->compound.context)
15192 {
15193 struct Declaration * decl;
15194 struct Statement * s;
15195 struct Statement * prevCompound = curCompound;
15196 struct Context * prevContext = curContext;
15197
15198 if(!stmt->compound.isSwitch)
15199 {
15200 curCompound = stmt;
15201 curContext = stmt->compound.context;
15202 }
15203 if(stmt->compound.declarations)
15204 {
15205 for(decl = (*stmt->compound.declarations).first; decl; decl = decl->next)
15206 ProcessDeclaration(decl);
15207 }
15208 if(stmt->compound.statements)
15209 {
15210 for(s = (*stmt->compound.statements).first; s; s = s->next)
15211 ProcessStatement(s);
15212 }
15213 curContext = prevContext;
15214 curCompound = prevCompound;
15215 }
15216 break;
15217 }
15218 case 3:
15219 {
15220 struct Expression * exp;
15221
15222 if(stmt->expressions)
15223 {
15224 for(exp = (*stmt->expressions).first; exp; exp = exp->next)
15225 ProcessExpressionType(exp);
15226 }
15227 break;
15228 }
15229 case 4:
15230 {
15231 struct Expression * exp;
15232
15233 FreeType(((struct Expression *)(*stmt->ifStmt.exp).last)->destType);
15234 ((struct Expression *)(*stmt->ifStmt.exp).last)->destType = MkClassType("bool");
15235 ((struct Expression *)(*stmt->ifStmt.exp).last)->destType->truth = 0x1;
15236 for(exp = (*stmt->ifStmt.exp).first; exp; exp = exp->next)
15237 {
15238 ProcessExpressionType(exp);
15239 }
15240 if(stmt->ifStmt.stmt)
15241 ProcessStatement(stmt->ifStmt.stmt);
15242 if(stmt->ifStmt.elseStmt)
15243 ProcessStatement(stmt->ifStmt.elseStmt);
15244 break;
15245 }
15246 case 5:
15247 {
15248 struct Type * oldSwitchType = curSwitchType;
15249
15250 if(stmt->switchStmt.exp)
15251 {
15252 struct Expression * exp;
15253
15254 for(exp = (*stmt->switchStmt.exp).first; exp; exp = exp->next)
15255 {
15256 if(!exp->next)
15257 {
15258 ProcessExpressionType(exp);
15259 }
15260 if(!exp->next)
15261 curSwitchType = exp->expType;
15262 }
15263 }
15264 ProcessStatement(stmt->switchStmt.stmt);
15265 curSwitchType = oldSwitchType;
15266 break;
15267 }
15268 case 6:
15269 {
15270 if(stmt->whileStmt.exp)
15271 {
15272 struct Expression * exp;
15273
15274 FreeType(((struct Expression *)(*stmt->whileStmt.exp).last)->destType);
15275 ((struct Expression *)(*stmt->whileStmt.exp).last)->destType = MkClassType("bool");
15276 ((struct Expression *)(*stmt->whileStmt.exp).last)->destType->truth = 0x1;
15277 for(exp = (*stmt->whileStmt.exp).first; exp; exp = exp->next)
15278 {
15279 ProcessExpressionType(exp);
15280 }
15281 }
15282 if(stmt->whileStmt.stmt)
15283 ProcessStatement(stmt->whileStmt.stmt);
15284 break;
15285 }
15286 case 7:
15287 {
15288 if(stmt->doWhile.exp)
15289 {
15290 struct Expression * exp;
15291
15292 if((*stmt->doWhile.exp).last)
15293 {
15294 FreeType(((struct Expression *)(*stmt->doWhile.exp).last)->destType);
15295 ((struct Expression *)(*stmt->doWhile.exp).last)->destType = MkClassType("bool");
15296 ((struct Expression *)(*stmt->doWhile.exp).last)->destType->truth = 0x1;
15297 }
15298 for(exp = (*stmt->doWhile.exp).first; exp; exp = exp->next)
15299 {
15300 ProcessExpressionType(exp);
15301 }
15302 }
15303 if(stmt->doWhile.stmt)
15304 ProcessStatement(stmt->doWhile.stmt);
15305 break;
15306 }
15307 case 8:
15308 {
15309 struct Expression * exp;
15310
15311 if(stmt->forStmt.init)
15312 ProcessStatement(stmt->forStmt.init);
15313 if(stmt->forStmt.check && stmt->forStmt.check->expressions)
15314 {
15315 FreeType(((struct Expression *)(*stmt->forStmt.check->expressions).last)->destType);
15316 ((struct Expression *)(*stmt->forStmt.check->expressions).last)->destType = MkClassType("bool");
15317 ((struct Expression *)(*stmt->forStmt.check->expressions).last)->destType->truth = 0x1;
15318 }
15319 if(stmt->forStmt.check)
15320 ProcessStatement(stmt->forStmt.check);
15321 if(stmt->forStmt.increment)
15322 {
15323 for(exp = (*stmt->forStmt.increment).first; exp; exp = exp->next)
15324 ProcessExpressionType(exp);
15325 }
15326 if(stmt->forStmt.stmt)
15327 ProcessStatement(stmt->forStmt.stmt);
15328 break;
15329 }
15330 case 18:
15331 {
15332 struct Identifier * id = stmt->forEachStmt.id;
15333 struct __ecereNameSpace__ecere__sys__OldList * exp = stmt->forEachStmt.exp;
15334 struct __ecereNameSpace__ecere__sys__OldList * filter = stmt->forEachStmt.filter;
15335 struct Statement * block = stmt->forEachStmt.stmt;
15336 char iteratorType[1024];
15337 struct Type * source;
15338 struct Expression * e;
15339 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));
15340 struct Expression * arrayExp;
15341 char * typeString = (((void *)0));
15342 int builtinCount = 0;
15343
15344 for(e = exp ? (*exp).first : (((void *)0)); e; e = e->next)
15345 {
15346 if(!e->next)
15347 {
15348 FreeType(e->destType);
15349 e->destType = ProcessTypeString("Container", 0x0);
15350 }
15351 if(!isBuiltin || e->next)
15352 ProcessExpressionType(e);
15353 }
15354 source = (exp && (*exp).last) ? ((struct Expression *)(*exp).last)->expType : (((void *)0));
15355 if(isBuiltin || (source && source->kind == 8 && source->_class && source->_class->registered && source->_class->registered != containerClass && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, containerClass)))
15356 {
15357 struct __ecereNameSpace__ecere__com__Class * _class = source ? source->_class->registered : (((void *)0));
15358 struct Symbol * symbol;
15359 struct Expression * expIt = (((void *)0));
15360 unsigned int isMap = 0x0, isArray = 0x0, isLinkList = 0x0, isList = 0x0, isCustomAVLTree = 0x0, isAVLTree = 0x0;
15361 struct __ecereNameSpace__ecere__com__Class * arrayClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "Array");
15362 struct __ecereNameSpace__ecere__com__Class * linkListClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "LinkList");
15363 struct __ecereNameSpace__ecere__com__Class * customAVLTreeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "CustomAVLTree");
15364
15365 stmt->type = 2;
15366 stmt->compound.context = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Context);
15367 stmt->compound.context->parent = curContext;
15368 curContext = stmt->compound.context;
15369 if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, customAVLTreeClass))
15370 {
15371 struct __ecereNameSpace__ecere__com__Class * mapClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "Map");
15372 struct __ecereNameSpace__ecere__com__Class * avlTreeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "AVLTree");
15373
15374 isCustomAVLTree = 0x1;
15375 if(__ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, avlTreeClass))
15376 isAVLTree = 0x1;
15377 else if(__ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, mapClass))
15378 isMap = 0x1;
15379 }
15380 else if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, arrayClass))
15381 isArray = 0x1;
15382 else if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, linkListClass))
15383 {
15384 struct __ecereNameSpace__ecere__com__Class * listClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "List");
15385
15386 isLinkList = 0x1;
15387 isList = __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, listClass);
15388 }
15389 if(isArray)
15390 {
15391 struct Declarator * decl;
15392 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15393
15394 decl = SpecDeclFromString(_class->templateArgs[2].dataTypeString, specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(id)));
15395 stmt->compound.declarations = MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(decl, (((void *)0))))));
15396 ListAdd(stmt->compound.declarations, MkDeclaration(MkListOne(MkSpecifierName(source->_class->registered->fullName)), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internalArray")), MkInitializerAssignment(MkExpBrackets(exp))))));
15397 }
15398 else if(isBuiltin)
15399 {
15400 struct Type * type = (((void *)0));
15401 char typeStringBuf[1024];
15402
15403 arrayExp = (((struct Expression *)(*exp).last)->type == 37) ? (struct Expression *)(*exp).last : ((struct Expression *)(*exp).last)->cast.exp;
15404 if(((struct Expression *)(*exp).last)->type == 11)
15405 {
15406 struct TypeName * typeName = ((struct Expression *)(*exp).last)->cast.typeName;
15407
15408 if(typeName)
15409 arrayExp->destType = ProcessType(typeName->qualifiers, typeName->declarator);
15410 }
15411 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)
15412 {
15413 struct __ecereNameSpace__ecere__com__Class * templateClass = arrayExp->destType->_class->registered;
15414
15415 typeString = templateClass->templateArgs[2].dataTypeString;
15416 }
15417 else if(arrayExp->list)
15418 {
15419 struct Expression * e;
15420
15421 for(e = (*arrayExp->list).first; e; e = e->next)
15422 {
15423 ProcessExpressionType(e);
15424 if(e->expType)
15425 {
15426 if(!type)
15427 {
15428 type = e->expType;
15429 type->refCount++;
15430 }
15431 else
15432 {
15433 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
15434 {
15435 FreeType(type);
15436 type = e->expType;
15437 e->expType = (((void *)0));
15438 e = (*arrayExp->list).first;
15439 ProcessExpressionType(e);
15440 if(e->expType)
15441 {
15442 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
15443 {
15444 FreeType(e->expType);
15445 e->expType = (((void *)0));
15446 FreeType(type);
15447 type = (((void *)0));
15448 break;
15449 }
15450 }
15451 }
15452 }
15453 if(e->expType)
15454 {
15455 FreeType(e->expType);
15456 e->expType = (((void *)0));
15457 }
15458 }
15459 }
15460 if(type)
15461 {
15462 typeStringBuf[0] = '\0';
15463 PrintType(type, typeStringBuf, 0x0, 0x1);
15464 typeString = typeStringBuf;
15465 FreeType(type);
15466 }
15467 }
15468 if(typeString)
15469 {
15470 struct __ecereNameSpace__ecere__sys__OldList * initializers = MkList();
15471 struct Declarator * decl;
15472 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15473
15474 if(arrayExp->list)
15475 {
15476 struct Expression * e;
15477
15478 builtinCount = (*arrayExp->list).count;
15479 type = ProcessTypeString(typeString, 0x0);
15480 while(e = (*arrayExp->list).first)
15481 {
15482 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*arrayExp->list), e);
15483 e->destType = type;
15484 type->refCount++;
15485 ProcessExpressionType(e);
15486 ListAdd(initializers, MkInitializerAssignment(e));
15487 }
15488 FreeType(type);
15489 (__ecereNameSpace__ecere__com__eSystem_Delete(arrayExp->list), arrayExp->list = 0);
15490 }
15491 decl = SpecDeclFromString(typeString, specs, MkDeclaratorIdentifier(id));
15492 stmt->compound.declarations = MkListOne(MkDeclaration(CopyList(specs, CopySpecifier), MkListOne(MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl), (((void *)0))))));
15493 ListAdd(stmt->compound.declarations, MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorArray(PlugDeclarator(decl, MkDeclaratorIdentifier(MkIdentifier("__internalArray"))), (((void *)0))), MkInitializerList(initializers)))));
15494 FreeList(exp, FreeExpression);
15495 }
15496 else
15497 {
15498 arrayExp->expType = ProcessTypeString("Container", 0x0);
15499 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Couldn't determine type of array elements\n", (((void *)0))));
15500 }
15501 }
15502 else if(isLinkList && !isList)
15503 {
15504 struct Declarator * decl;
15505 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15506
15507 decl = SpecDeclFromString(_class->templateArgs[3].dataTypeString, specs, MkDeclaratorIdentifier(id));
15508 stmt->compound.declarations = MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(decl, (((void *)0))))));
15509 ListAdd(stmt->compound.declarations, MkDeclaration(MkListOne(MkSpecifierName(source->_class->registered->fullName)), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internalLinkList")), MkInitializerAssignment(MkExpBrackets(exp))))));
15510 }
15511 else if(_class->templateArgs)
15512 {
15513 if(isMap)
15514 sprintf(iteratorType, "MapIterator<%s, %s >", _class->templateArgs[5].dataTypeString, _class->templateArgs[6].dataTypeString);
15515 else
15516 sprintf(iteratorType, "Iterator<%s, %s >", _class->templateArgs[2].dataTypeString, _class->templateArgs[1].dataTypeString);
15517 stmt->compound.declarations = MkListOne(MkDeclarationInst(MkInstantiationNamed(MkListOne(MkSpecifierName(iteratorType)), MkExpIdentifier(id), MkListOne(MkMembersInitList(MkListOne(MkMemberInit(isMap ? MkListOne(MkIdentifier("map")) : (((void *)0)), MkInitializerAssignment(MkExpBrackets(exp)))))))));
15518 }
15519 symbol = FindSymbol(id->string, curContext, curContext, 0x0, 0x0);
15520 if(block && block->type == 2 && block->compound.context)
15521 {
15522 block->compound.context->parent = stmt->compound.context;
15523 }
15524 if(filter)
15525 {
15526 block = MkIfStmt(filter, block, (((void *)0)));
15527 }
15528 if(isArray)
15529 {
15530 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));
15531 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.init);
15532 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.check);
15533 ProcessExpressionType((*((struct Statement *)(*stmt->compound.statements).first)->forStmt.increment).first);
15534 }
15535 else if(isBuiltin)
15536 {
15537 char count[128];
15538
15539 sprintf(count, "%d", builtinCount);
15540 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));
15541 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.init);
15542 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.check);
15543 ProcessExpressionType((*((struct Statement *)(*stmt->compound.statements).first)->forStmt.increment).first);
15544 }
15545 else if(isLinkList && !isList)
15546 {
15547 struct __ecereNameSpace__ecere__com__Class * typeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, _class->templateArgs[3].dataTypeString);
15548 struct __ecereNameSpace__ecere__com__Class * listItemClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, "ListItem");
15549
15550 if(typeClass && __ecereNameSpace__ecere__com__eClass_IsDerived(typeClass, listItemClass) && _class->templateArgs[5].dataTypeString && !strcmp(_class->templateArgs[5].dataTypeString, "LT::link"))
15551 {
15552 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));
15553 }
15554 else
15555 {
15556 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15557 struct Declarator * decl = SpecDeclFromString(_class->templateArgs[3].dataTypeString, specs, (((void *)0)));
15558
15559 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));
15560 }
15561 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.init);
15562 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.check);
15563 ProcessExpressionType((*((struct Statement *)(*stmt->compound.statements).first)->forStmt.increment).first);
15564 }
15565 else
15566 {
15567 stmt->compound.statements = MkListOne(MkWhileStmt(MkListOne(MkExpCall(MkExpMember(expIt = MkExpIdentifier(CopyIdentifier(id)), MkIdentifier("Next")), (((void *)0)))), block));
15568 }
15569 ProcessExpressionType(expIt);
15570 if((*stmt->compound.declarations).first)
15571 ProcessDeclaration((*stmt->compound.declarations).first);
15572 if(symbol)
15573 symbol->isIterator = isMap ? 2 : ((isArray || isBuiltin) ? 3 : (isLinkList ? (isList ? 5 : 4) : (isCustomAVLTree ? 6 : 1)));
15574 ProcessStatement(stmt);
15575 curContext = stmt->compound.context->parent;
15576 break;
15577 }
15578 else
15579 {
15580 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Expression is not a container\n", (((void *)0))));
15581 }
15582 break;
15583 }
15584 case 9:
15585 break;
15586 case 10:
15587 break;
15588 case 11:
15589 break;
15590 case 12:
15591 {
15592 struct Expression * exp;
15593
15594 if(stmt->expressions)
15595 {
15596 for(exp = (*stmt->expressions).first; exp; exp = exp->next)
15597 {
15598 if(!exp->next)
15599 {
15600 if(curFunction && !curFunction->type)
15601 curFunction->type = ProcessType(curFunction->specifiers, curFunction->declarator);
15602 FreeType(exp->destType);
15603 exp->destType = (curFunction && curFunction->type && curFunction->type->kind == 11) ? curFunction->type->returnType : (((void *)0));
15604 if(exp->destType)
15605 exp->destType->refCount++;
15606 }
15607 ProcessExpressionType(exp);
15608 }
15609 }
15610 break;
15611 }
15612 case 14:
15613 {
15614 ProcessDeclaration(stmt->decl);
15615 break;
15616 }
15617 case 13:
15618 {
15619 struct AsmField * field;
15620
15621 if(stmt->asmStmt.inputFields)
15622 {
15623 for(field = (*stmt->asmStmt.inputFields).first; field; field = field->next)
15624 if(field->expression)
15625 ProcessExpressionType(field->expression);
15626 }
15627 if(stmt->asmStmt.outputFields)
15628 {
15629 for(field = (*stmt->asmStmt.outputFields).first; field; field = field->next)
15630 if(field->expression)
15631 ProcessExpressionType(field->expression);
15632 }
15633 if(stmt->asmStmt.clobberedFields)
15634 {
15635 for(field = (*stmt->asmStmt.clobberedFields).first; field; field = field->next)
15636 {
15637 if(field->expression)
15638 ProcessExpressionType(field->expression);
15639 }
15640 }
15641 break;
15642 }
15643 case 17:
15644 {
15645 struct PropertyWatch * propWatch;
15646 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->_watch.watches;
15647 struct Expression * object = stmt->_watch.object;
15648 struct Expression * watcher = stmt->_watch.watcher;
15649
15650 if(watcher)
15651 ProcessExpressionType(watcher);
15652 if(object)
15653 ProcessExpressionType(object);
15654 if(inCompiler)
15655 {
15656 if(watcher || thisClass)
15657 {
15658 struct External * external = curExternal;
15659 struct Context * context = curContext;
15660
15661 stmt->type = 3;
15662 stmt->expressions = MkList();
15663 curExternal = external->prev;
15664 for(propWatch = (*watches).first; propWatch; propWatch = propWatch->next)
15665 {
15666 struct ClassFunction * func;
15667 char watcherName[1024];
15668 struct __ecereNameSpace__ecere__com__Class * watcherClass = watcher ? ((watcher->expType && watcher->expType->kind == 8 && watcher->expType->_class) ? watcher->expType->_class->registered : (((void *)0))) : thisClass;
15669 struct External * createdExternal;
15670 struct External * externalDecl = MkExternalDeclaration((((void *)0)));
15671
15672 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, externalDecl);
15673 sprintf(watcherName, "__ecerePropertyWatcher_%d", propWatcherID++);
15674 if(propWatch->deleteWatch)
15675 strcat(watcherName, "_delete");
15676 else
15677 {
15678 struct Identifier * propID;
15679
15680 for(propID = (*propWatch->properties).first; propID; propID = propID->next)
15681 {
15682 strcat(watcherName, "_");
15683 strcat(watcherName, propID->string);
15684 }
15685 }
15686 if(object && object->expType && object->expType->kind == 8 && object->expType->_class && object->expType->_class->registered)
15687 {
15688 func = MkClassFunction(MkListOne(MkSpecifier(VOID)), (((void *)0)), MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(watcherName)), MkListOne(MkTypeName(MkListOne(MkSpecifierName(object->expType->_class->string)), MkDeclaratorIdentifier(MkIdentifier("value"))))), (((void *)0)));
15689 ProcessClassFunctionBody(func, propWatch->compound);
15690 propWatch->compound = (((void *)0));
15691 createdExternal = ProcessClassFunction(watcherClass, func, ast, curExternal, 0x1);
15692 createdExternal->symbol->idCode = external->symbol->idCode;
15693 curExternal = createdExternal;
15694 ProcessFunction(createdExternal->function);
15695 {
15696 struct Declaration * decl = MkDeclaration(CopyList(createdExternal->function->specifiers, CopySpecifier), MkListOne(MkInitDeclarator(CopyDeclarator(createdExternal->function->declarator), (((void *)0)))));
15697
15698 externalDecl->declaration = decl;
15699 if(decl->symbol && !decl->symbol->pointerExternal)
15700 decl->symbol->pointerExternal = externalDecl;
15701 }
15702 if(propWatch->deleteWatch)
15703 {
15704 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
15705
15706 ListAdd(args, CopyExpression(object));
15707 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
15708 ListAdd(args, MkExpIdentifier(MkIdentifier(watcherName)));
15709 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_WatchDestruction")), args));
15710 }
15711 else
15712 {
15713 struct __ecereNameSpace__ecere__com__Class * _class = object->expType->_class->registered;
15714 struct Identifier * propID;
15715
15716 for(propID = (*propWatch->properties).first; propID; propID = propID->next)
15717 {
15718 char propName[1024];
15719 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
15720
15721 if(prop)
15722 {
15723 char getName[1024], setName[1024];
15724 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
15725
15726 DeclareProperty(prop, setName, getName);
15727 strcpy(propName, "__ecereProp_");
15728 FullClassNameCat(propName, prop->_class->fullName, 0x0);
15729 strcat(propName, "_");
15730 FullClassNameCat(propName, prop->name, 0x1);
15731 ListAdd(args, CopyExpression(object));
15732 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
15733 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
15734 ListAdd(args, MkExpIdentifier(MkIdentifier(watcherName)));
15735 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_Watch")), args));
15736 }
15737 else
15738 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Property %s not found in class %s\n", (((void *)0))), prop->name, _class->fullName);
15739 }
15740 }
15741 }
15742 else
15743 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Invalid watched object\n", (((void *)0))));
15744 }
15745 curExternal = external;
15746 curContext = context;
15747 if(watcher)
15748 FreeExpression(watcher);
15749 if(object)
15750 FreeExpression(object);
15751 FreeList(watches, FreePropertyWatch);
15752 }
15753 else
15754 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "No observer specified and not inside a _class\n", (((void *)0))));
15755 }
15756 else
15757 {
15758 for(propWatch = (*watches).first; propWatch; propWatch = propWatch->next)
15759 {
15760 ProcessStatement(propWatch->compound);
15761 }
15762 }
15763 break;
15764 }
15765 case 15:
15766 {
15767 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->_watch.watches;
15768 struct Expression * object = stmt->_watch.object;
15769 struct __ecereNameSpace__ecere__com__Class * _class;
15770
15771 if(object)
15772 ProcessExpressionType(object);
15773 if(inCompiler)
15774 {
15775 _class = object ? ((object->expType && object->expType->kind == 8 && object->expType->_class) ? object->expType->_class->registered : (((void *)0))) : thisClass;
15776 if(_class)
15777 {
15778 struct Identifier * propID;
15779
15780 stmt->type = 3;
15781 stmt->expressions = MkList();
15782 if(!watches && curFunction->propSet && (!object || (object->type == 0 && !strcmp(object->identifier->string, "this"))))
15783 {
15784 watches = MkListOne(MkIdentifier(curFunction->propSet->string));
15785 }
15786 else if(!watches)
15787 {
15788 }
15789 if(watches)
15790 {
15791 for(propID = (*watches).first; propID; propID = propID->next)
15792 {
15793 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
15794
15795 if(prop)
15796 {
15797 CreateFireWatcher(prop, object, stmt);
15798 }
15799 else
15800 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Property %s not found in class %s\n", (((void *)0))), propID->string, _class->fullName);
15801 }
15802 }
15803 else
15804 {
15805 struct __ecereNameSpace__ecere__com__Property * prop;
15806 struct __ecereNameSpace__ecere__com__Class * base;
15807
15808 for(base = _class; base; base = base->base)
15809 {
15810 for(prop = base->membersAndProperties.first; prop; prop = prop->next)
15811 {
15812 if(prop->isProperty && prop->isWatchable)
15813 {
15814 CreateFireWatcher(prop, object, stmt);
15815 }
15816 }
15817 }
15818 }
15819 if(object)
15820 FreeExpression(object);
15821 FreeList(watches, FreeIdentifier);
15822 }
15823 else
15824 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Invalid object specified and not inside a class\n", (((void *)0))));
15825 }
15826 break;
15827 }
15828 case 16:
15829 {
15830 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->_watch.watches;
15831 struct Expression * object = stmt->_watch.object;
15832 struct Expression * watcher = stmt->_watch.watcher;
15833 struct __ecereNameSpace__ecere__com__Class * _class;
15834
15835 if(object)
15836 ProcessExpressionType(object);
15837 if(watcher)
15838 ProcessExpressionType(watcher);
15839 if(inCompiler)
15840 {
15841 _class = (object && object->expType && object->expType->kind == 8 && object->expType->_class) ? object->expType->_class->registered : (((void *)0));
15842 if(watcher || thisClass)
15843 {
15844 if(_class)
15845 {
15846 struct Identifier * propID;
15847
15848 stmt->type = 3;
15849 stmt->expressions = MkList();
15850 if(!watches)
15851 {
15852 struct __ecereNameSpace__ecere__sys__OldList * args;
15853
15854 args = MkList();
15855 ListAdd(args, CopyExpression(object));
15856 ListAdd(args, MkExpConstant("0"));
15857 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
15858 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_StopWatching")), args));
15859 }
15860 else
15861 {
15862 for(propID = (*watches).first; propID; propID = propID->next)
15863 {
15864 char propName[1024];
15865 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
15866
15867 if(prop)
15868 {
15869 char getName[1024], setName[1024];
15870 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
15871
15872 DeclareProperty(prop, setName, getName);
15873 strcpy(propName, "__ecereProp_");
15874 FullClassNameCat(propName, prop->_class->fullName, 0x0);
15875 strcat(propName, "_");
15876 FullClassNameCat(propName, prop->name, 0x1);
15877 MangleClassName(propName);
15878 ListAdd(args, CopyExpression(object));
15879 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
15880 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
15881 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_StopWatching")), args));
15882 }
15883 else
15884 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Property %s not found in class %s\n", (((void *)0))), prop->name, _class->fullName);
15885 }
15886 }
15887 if(object)
15888 FreeExpression(object);
15889 if(watcher)
15890 FreeExpression(watcher);
15891 FreeList(watches, FreeIdentifier);
15892 }
15893 else
15894 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Invalid object specified and not inside a class\n", (((void *)0))));
15895 }
15896 else
15897 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "No observer specified and not inside a class\n", (((void *)0))));
15898 }
15899 break;
15900 }
15901 }
15902 }
15903
15904 extern struct Expression * QBrackets(struct Expression * exp);
15905
15906 extern struct TypeName * QMkType(char *  spec, struct Declarator * decl);
15907
15908 extern struct Declarator * QMkPtrDecl(char *  id);
15909
15910 extern struct Expression * MkExpPointer(struct Expression * expression, struct Identifier * member);
15911
15912 extern struct Expression * QMkExpCond(struct Expression * cond, struct Expression * exp, struct Expression * elseExp);
15913
15914 extern struct Statement * MkFireWatchersStmt(struct Expression * object, struct __ecereNameSpace__ecere__sys__OldList * watches);
15915
15916 static void ProcessFunction(struct FunctionDefinition * function)
15917 {
15918 void * __ecereTemp2;
15919 void * __ecereTemp1;
15920 struct Identifier * id = GetDeclId(function->declarator);
15921 struct Symbol * symbol = function->declarator ? function->declarator->symbol : (((void *)0));
15922 struct Type * type = symbol ? symbol->type : (((void *)0));
15923 struct __ecereNameSpace__ecere__com__Class * oldThisClass = thisClass;
15924 struct Context * oldTopContext = topContext;
15925
15926 yylloc = function->loc;
15927 if(type && type->thisClass)
15928 {
15929 struct Symbol * classSym = type->thisClass;
15930 struct __ecereNameSpace__ecere__com__Class * _class = type->thisClass->registered;
15931 char className[1024];
15932 char structName[1024];
15933 struct Declarator * funcDecl;
15934 struct Symbol * thisSymbol;
15935 unsigned int typedObject = 0x0;
15936
15937 if(_class && !_class->base)
15938 {
15939 _class = currentClass;
15940 if(_class && !_class->symbol)
15941 _class->symbol = FindClass(_class->fullName);
15942 classSym = _class ? _class->symbol : (((void *)0));
15943 typedObject = 0x1;
15944 }
15945 thisClass = _class;
15946 if(inCompiler && _class)
15947 {
15948 if(type->kind == 11)
15949 {
15950 if(symbol->type->params.count == 1 && ((struct Type *)symbol->type->params.first)->kind == 0)
15951 {
15952 struct Type * param = symbol->type->params.first;
15953
15954 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(&symbol->type->params, param);
15955 FreeType(param);
15956 }
15957 if(type->classObjectType != 1)
15958 {
15959 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(&symbol->type->params, (((void *)0)), MkClassType(_class->fullName));
15960 symbol->type->staticMethod = 0x1;
15961 symbol->type->thisClass = (((void *)0));
15962 symbol->type->extraParam = 0x0;
15963 }
15964 }
15965 strcpy(className, "__ecereClass_");
15966 FullClassNameCat(className, _class->fullName, 0x1);
15967 MangleClassName(className);
15968 structName[0] = (char)0;
15969 FullClassNameCat(structName, _class->fullName, 0x0);
15970 funcDecl = GetFuncDecl(function->declarator);
15971 if(funcDecl)
15972 {
15973 if(funcDecl->function.parameters && (*funcDecl->function.parameters).count == 1)
15974 {
15975 struct TypeName * param = (*funcDecl->function.parameters).first;
15976
15977 if(param->qualifiers && (*param->qualifiers).count == 1 && ((struct Specifier *)(*param->qualifiers).first)->specifier == VOID && !param->declarator)
15978 {
15979 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->function.parameters), param);
15980 FreeTypeName(param);
15981 }
15982 }
15983 if(!function->propertyNoThis)
15984 {
15985 struct TypeName * thisParam;
15986
15987 if(type->classObjectType != 1)
15988 {
15989 thisParam = QMkClass(_class->fullName, MkDeclaratorIdentifier(MkIdentifier("this")));
15990 if(!funcDecl->function.parameters)
15991 funcDecl->function.parameters = MkList();
15992 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
15993 }
15994 if(typedObject)
15995 {
15996 if(type->classObjectType != 1)
15997 {
15998 if(type->byReference || _class->type == 3 || _class->type == 1000 || _class->type == 4 || _class->type == 2)
15999 thisParam->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), thisParam->declarator);
16000 }
16001 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));
16002 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
16003 }
16004 }
16005 }
16006 if(symbol && symbol->pointerExternal && symbol->pointerExternal->type == 1)
16007 {
16008 struct InitDeclarator * initDecl = (*symbol->pointerExternal->declaration->declarators).first;
16009
16010 funcDecl = GetFuncDecl(initDecl->declarator);
16011 if(funcDecl)
16012 {
16013 if(funcDecl->function.parameters && (*funcDecl->function.parameters).count == 1)
16014 {
16015 struct TypeName * param = (*funcDecl->function.parameters).first;
16016
16017 if(param->qualifiers && (*param->qualifiers).count == 1 && ((struct Specifier *)(*param->qualifiers).first)->specifier == VOID && !param->declarator)
16018 {
16019 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->function.parameters), param);
16020 FreeTypeName(param);
16021 }
16022 }
16023 if(type->classObjectType != 1)
16024 {
16025 if((_class->type != 2 && _class->type != 3 && _class->type != 4) || function != (struct FunctionDefinition *)symbol->externalSet)
16026 {
16027 struct TypeName * thisParam = QMkClass(_class->fullName, MkDeclaratorIdentifier(MkIdentifier("this")));
16028
16029 if(!funcDecl->function.parameters)
16030 funcDecl->function.parameters = MkList();
16031 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
16032 }
16033 }
16034 }
16035 }
16036 }
16037 if(function->body)
16038 {
16039 if(type->classObjectType != 1)
16040 {
16041 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));
16042 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&function->body->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
16043 if(typedObject && thisSymbol->type)
16044 {
16045 thisSymbol->type->classObjectType = 2;
16046 thisSymbol->type->byReference = type->byReference;
16047 }
16048 }
16049 }
16050 if(inCompiler && _class && (_class->type == 0) && type->classObjectType != 1)
16051 {
16052 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
16053
16054 {
16055 struct __ecereNameSpace__ecere__com__Class * base;
16056
16057 for(base = _class; base && base->type != 1000; base = base->next)
16058 {
16059 for(member = base->membersAndProperties.first; member; member = member->next)
16060 if(!member->isProperty)
16061 break;
16062 if(member)
16063 break;
16064 }
16065 }
16066 for(member = _class->membersAndProperties.first; member; member = member->next)
16067 if(!member->isProperty)
16068 break;
16069 if(member)
16070 {
16071 char pointerName[1024];
16072 struct Declaration * decl;
16073 struct Initializer * initializer;
16074 struct Expression * exp, * bytePtr;
16075
16076 strcpy(pointerName, "__ecerePointer_");
16077 FullClassNameCat(pointerName, _class->fullName, 0x0);
16078 {
16079 char className[1024];
16080
16081 strcpy(className, "__ecereClass_");
16082 FullClassNameCat(className, classSym->string, 0x1);
16083 MangleClassName(className);
16084 DeclareClass(classSym, className);
16085 }
16086 bytePtr = QBrackets(MkExpCast(QMkType("char", QMkPtrDecl((((void *)0)))), QMkExpId("this")));
16087 if(_class->fixed)
16088 {
16089 char string[256];
16090
16091 sprintf(string, "%d", _class->offset);
16092 exp = QBrackets(MkExpOp(bytePtr, '+', MkExpConstant(string)));
16093 }
16094 else
16095 {
16096 exp = QBrackets(MkExpOp(bytePtr, '+', MkExpPointer(QMkExpId(className), MkIdentifier("offset"))));
16097 }
16098 exp = QBrackets(QMkExpCond(QMkExpId("this"), exp, MkExpConstant("0")));
16099 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));
16100 if(function->body)
16101 {
16102 yylloc = function->body->loc;
16103 initializer = MkInitializerAssignment(MkExpCast(MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(structName), (((void *)0)))), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), exp));
16104 {
16105 struct Context * prevContext = curContext;
16106
16107 curContext = function->body->compound.context;
16108 decl = MkDeclaration(MkListOne(MkStructOrUnion(3, MkIdentifier(structName), (((void *)0)))), MkListOne(MkInitDeclarator(QMkPtrDecl(pointerName), initializer)));
16109 curContext = prevContext;
16110 }
16111 decl->symbol = (((void *)0));
16112 if(!function->body->compound.declarations)
16113 function->body->compound.declarations = MkList();
16114 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*function->body->compound.declarations), (((void *)0)), decl);
16115 }
16116 }
16117 }
16118 }
16119 else
16120 thisClass = (((void *)0));
16121 if(id)
16122 {
16123 FreeSpecifier(id->_class);
16124 id->_class = (((void *)0));
16125 if(symbol && symbol->pointerExternal && symbol->pointerExternal->type == 1)
16126 {
16127 struct InitDeclarator * initDecl = (*symbol->pointerExternal->declaration->declarators).first;
16128
16129 id = GetDeclId(initDecl->declarator);
16130 FreeSpecifier(id->_class);
16131 id->_class = (((void *)0));
16132 }
16133 }
16134 if(function->body)
16135 topContext = function->body->compound.context;
16136 {
16137 struct FunctionDefinition * oldFunction = curFunction;
16138
16139 curFunction = function;
16140 if(function->body)
16141 ProcessStatement(function->body);
16142 if(inCompiler && function->propSet && !function->propSet->fireWatchersDone)
16143 {
16144 struct Statement * prevCompound = curCompound;
16145 struct Context * prevContext = curContext;
16146 struct Statement * fireWatchers = MkFireWatchersStmt((((void *)0)), (((void *)0)));
16147
16148 if(!function->body->compound.statements)
16149 function->body->compound.statements = MkList();
16150 ListAdd(function->body->compound.statements, fireWatchers);
16151 curCompound = function->body;
16152 curContext = function->body->compound.context;
16153 ProcessStatement(fireWatchers);
16154 curContext = prevContext;
16155 curCompound = prevCompound;
16156 }
16157 curFunction = oldFunction;
16158 }
16159 if(function->declarator)
16160 {
16161 ProcessDeclarator(function->declarator);
16162 }
16163 topContext = oldTopContext;
16164 thisClass = oldThisClass;
16165 }
16166
16167 extern void FreeSymbol(struct Symbol * symbol);
16168
16169 void __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Remove(struct __ecereNameSpace__ecere__sys__BinaryTree * this, struct __ecereNameSpace__ecere__sys__BTNode * node);
16170
16171 static void ProcessClass(struct __ecereNameSpace__ecere__sys__OldList * definitions, struct Symbol * symbol)
16172 {
16173 struct ClassDef * def;
16174 struct External * external = curExternal;
16175 struct __ecereNameSpace__ecere__com__Class * regClass = symbol ? symbol->registered : (((void *)0));
16176
16177 for(def = definitions->first; def; def = def->next)
16178 {
16179 if(def->type == 0)
16180 {
16181 if(def->function->declarator)
16182 curExternal = def->function->declarator->symbol->pointerExternal;
16183 else
16184 curExternal = external;
16185 ProcessFunction((struct FunctionDefinition *)def->function);
16186 }
16187 else if(def->type == 2)
16188 {
16189 if(def->decl->type == 2)
16190 {
16191 thisClass = regClass;
16192 ProcessInstantiationType(def->decl->inst);
16193 thisClass = (((void *)0));
16194 }
16195 else
16196 {
16197 struct __ecereNameSpace__ecere__com__Class * backThisClass = thisClass;
16198
16199 if(regClass)
16200 thisClass = regClass;
16201 ProcessDeclaration(def->decl);
16202 thisClass = backThisClass;
16203 }
16204 }
16205 else if(def->type == 1 && def->defProperties)
16206 {
16207 struct MemberInit * defProperty;
16208 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);
16209
16210 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
16211 for(defProperty = (*def->defProperties).first; defProperty; defProperty = defProperty->next)
16212 {
16213 thisClass = regClass;
16214 ProcessMemberInitData(defProperty, regClass, (((void *)0)), (((void *)0)), (((void *)0)), (((void *)0)));
16215 thisClass = (((void *)0));
16216 }
16217 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Remove(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
16218 FreeSymbol(thisSymbol);
16219 }
16220 else if(def->type == 3 && def->propertyDef)
16221 {
16222 struct PropertyDef * prop = def->propertyDef;
16223
16224 thisClass = regClass;
16225 if(prop->setStmt)
16226 {
16227 if(regClass)
16228 {
16229 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
16230
16231 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->setStmt->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
16232 }
16233 curExternal = prop->symbol ? prop->symbol->externalSet : (((void *)0));
16234 ProcessStatement(prop->setStmt);
16235 }
16236 if(prop->getStmt)
16237 {
16238 if(regClass)
16239 {
16240 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
16241
16242 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->getStmt->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
16243 }
16244 curExternal = prop->symbol ? prop->symbol->externalGet : (((void *)0));
16245 ProcessStatement(prop->getStmt);
16246 }
16247 if(prop->issetStmt)
16248 {
16249 if(regClass)
16250 {
16251 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
16252
16253 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->issetStmt->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
16254 }
16255 curExternal = prop->symbol ? prop->symbol->externalIsSet : (((void *)0));
16256 ProcessStatement(prop->issetStmt);
16257 }
16258 thisClass = (((void *)0));
16259 }
16260 else if(def->type == 4 && def->propertyWatch)
16261 {
16262 struct PropertyWatch * propertyWatch = def->propertyWatch;
16263
16264 thisClass = regClass;
16265 if(propertyWatch->compound)
16266 {
16267 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);
16268
16269 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&propertyWatch->compound->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
16270 curExternal = (((void *)0));
16271 ProcessStatement(propertyWatch->compound);
16272 }
16273 thisClass = (((void *)0));
16274 }
16275 }
16276 }
16277
16278 void DeclareFunctionUtil(char * s)
16279 {
16280 struct __ecereNameSpace__ecere__com__GlobalFunction * function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, s);
16281
16282 if(function)
16283 {
16284 char name[1024];
16285
16286 name[0] = (char)0;
16287 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + 12)))->importType != 1 && (!function->dataType || !function->dataType->dllExport))
16288 strcpy(name, "__ecereFunction_");
16289 FullClassNameCat(name, s, 0x0);
16290 DeclareFunction(function, name);
16291 }
16292 }
16293
16294 extern struct __ecereNameSpace__ecere__com__Instance * GetPrivateModule(void);
16295
16296 void ComputeDataTypes()
16297 {
16298 void * __ecereTemp1;
16299 struct External * external;
16300 struct External * temp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_External);
16301
16302 currentClass = (((void *)0));
16303 containerClass = __ecereNameSpace__ecere__com__eSystem_FindClass(GetPrivateModule(), "Container");
16304 temp->symbol = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), ((struct Symbol *)__ecereTemp1)->id = -1000, ((struct Symbol *)__ecereTemp1)->idCode = -1000, ((struct Symbol *)__ecereTemp1));
16305 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), (((void *)0)), temp);
16306 curExternal = temp;
16307 DeclareFunctionUtil("eSystem_New");
16308 DeclareFunctionUtil("eSystem_New0");
16309 DeclareFunctionUtil("eSystem_Renew");
16310 DeclareFunctionUtil("eSystem_Renew0");
16311 DeclareStruct("ecere::com::Class", 0x0);
16312 DeclareStruct("ecere::com::Instance", 0x0);
16313 DeclareStruct("ecere::com::Property", 0x0);
16314 DeclareStruct("ecere::com::DataMember", 0x0);
16315 DeclareStruct("ecere::com::Method", 0x0);
16316 DeclareStruct("ecere::com::SerialBuffer", 0x0);
16317 DeclareStruct("ecere::com::ClassTemplateArgument", 0x0);
16318 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*ast), temp);
16319 for(external = (*ast).first; external; external = external->next)
16320 {
16321 afterExternal = curExternal = external;
16322 if(external->type == 0)
16323 {
16324 currentClass = external->function->_class;
16325 ProcessFunction(external->function);
16326 }
16327 else if(external->type == 1)
16328 {
16329 currentClass = (((void *)0));
16330 ProcessDeclaration(external->declaration);
16331 }
16332 else if(external->type == 2)
16333 {
16334 struct ClassDefinition * _class = external->_class;
16335
16336 currentClass = external->symbol->registered;
16337 if(_class->definitions)
16338 {
16339 ProcessClass(_class->definitions, _class->symbol);
16340 }
16341 if(inCompiler)
16342 {
16343 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*ast), external);
16344 ((external ? (__ecereClass_External->Destructor ? __ecereClass_External->Destructor(external) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(external)) : 0), external = 0);
16345 }
16346 }
16347 else if(external->type == 4)
16348 {
16349 thisNameSpace = external->id->string;
16350 }
16351 }
16352 currentClass = (((void *)0));
16353 thisNameSpace = (((void *)0));
16354 ((temp->symbol ? (__ecereClass_Symbol->Destructor ? __ecereClass_Symbol->Destructor(temp->symbol) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(temp->symbol)) : 0), temp->symbol = 0);
16355 ((temp ? (__ecereClass_External->Destructor ? __ecereClass_External->Destructor(temp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(temp)) : 0), temp = 0);
16356 }
16357
16358 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);
16359
16360 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);
16361
16362 void __ecereRegisterModule_pass15(struct __ecereNameSpace__ecere__com__Instance * module)
16363 {
16364 struct __ecereNameSpace__ecere__com__Class * class;
16365
16366 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetYydebug", "void SetYydebug(bool b)", SetYydebug, module, 1);
16367 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetThisClass", "void SetThisClass(ecere::com::Class c)", SetThisClass, module, 1);
16368 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetThisClass", "ecere::com::Class GetThisClass(void)", GetThisClass, module, 1);
16369 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintExpression", "void PrintExpression(Expression exp, char * string)", PrintExpression, module, 1);
16370 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("_strtoi64", "int64 _strtoi64(char * string, char * * endString, int base)", _strtoi64, module, 2);
16371 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("_strtoui64", "uint64 _strtoui64(char * string, char * * endString, int base)", _strtoui64, module, 2);
16372 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessTemplateParameterType", "Type ProcessTemplateParameterType(TemplateParameter param)", ProcessTemplateParameterType, module, 2);
16373 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("NeedCast", "bool NeedCast(Type type1, Type type2)", NeedCast, module, 2);
16374 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintInt", "char * PrintInt(int64 result)", PrintInt, module, 1);
16375 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUInt", "char * PrintUInt(uint64 result)", PrintUInt, module, 1);
16376 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintInt64", "char * PrintInt64(int64 result)", PrintInt64, module, 1);
16377 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUInt64", "char * PrintUInt64(uint64 result)", PrintUInt64, module, 1);
16378 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintHexUInt", "char * PrintHexUInt(uint64 result)", PrintHexUInt, module, 1);
16379 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintHexUInt64", "char * PrintHexUInt64(uint64 result)", PrintHexUInt64, module, 1);
16380 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintShort", "char * PrintShort(short result)", PrintShort, module, 1);
16381 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUShort", "char * PrintUShort(uint16 result)", PrintUShort, module, 1);
16382 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintChar", "char * PrintChar(char result)", PrintChar, module, 1);
16383 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUChar", "char * PrintUChar(byte result)", PrintUChar, module, 1);
16384 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintFloat", "char * PrintFloat(float result)", PrintFloat, module, 1);
16385 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintDouble", "char * PrintDouble(double result)", PrintDouble, module, 1);
16386 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetInt", "bool GetInt(Expression exp, int * value2)", GetInt, module, 1);
16387 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUInt", "bool GetUInt(Expression exp, uint * value2)", GetUInt, module, 1);
16388 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetInt64", "bool GetInt64(Expression exp, int64 * value2)", GetInt64, module, 1);
16389 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUInt64", "bool GetUInt64(Expression exp, uint64 * value2)", GetUInt64, module, 1);
16390 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetIntPtr", "bool GetIntPtr(Expression exp, intptr * value2)", GetIntPtr, module, 1);
16391 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUIntPtr", "bool GetUIntPtr(Expression exp, uintptr * value2)", GetUIntPtr, module, 1);
16392 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetShort", "bool GetShort(Expression exp, short * value2)", GetShort, module, 1);
16393 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUShort", "bool GetUShort(Expression exp, uint16 * value2)", GetUShort, module, 1);
16394 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetChar", "bool GetChar(Expression exp, char * value2)", GetChar, module, 1);
16395 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUChar", "bool GetUChar(Expression exp, byte * value2)", GetUChar, module, 1);
16396 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetFloat", "bool GetFloat(Expression exp, float * value2)", GetFloat, module, 1);
16397 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetDouble", "bool GetDouble(Expression exp, double * value2)", GetDouble, module, 1);
16398 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeClassMembers", "void ComputeClassMembers(ecere::com::Class _class, bool isMember)", ComputeClassMembers, module, 2);
16399 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeModuleClasses", "void ComputeModuleClasses(ecere::com::Module module)", ComputeModuleClasses, module, 1);
16400 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeTypeSize", "int ComputeTypeSize(Type type)", ComputeTypeSize, module, 1);
16401 __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);
16402 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareStruct", "void DeclareStruct(char * name, bool skipNoHead)", DeclareStruct, module, 2);
16403 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareProperty", "void DeclareProperty(ecere::com::Property prop, char * setName, char * getName)", DeclareProperty, module, 2);
16404 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("Dereference", "Type Dereference(Type source)", Dereference, module, 1);
16405 __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);
16406 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessInstantiationType", "void ProcessInstantiationType(Instantiation inst)", ProcessInstantiationType, module, 2);
16407 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindTemplateArg", "ecere::com::ClassTemplateArgument * FindTemplateArg(ecere::com::Class _class, TemplateParameter param)", FindTemplateArg, module, 2);
16408 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetupTemplatesContext", "Context SetupTemplatesContext(ecere::com::Class _class)", SetupTemplatesContext, module, 1);
16409 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FinishTemplatesContext", "void FinishTemplatesContext(Context context)", FinishTemplatesContext, module, 1);
16410 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessMethodType", "void ProcessMethodType(ecere::com::Method method)", ProcessMethodType, module, 1);
16411 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessPropertyType", "void ProcessPropertyType(ecere::com::Property prop)", ProcessPropertyType, module, 1);
16412 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareMethod", "void DeclareMethod(ecere::com::Method method, char * name)", DeclareMethod, module, 1);
16413 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClass", "char * ReplaceThisClass(ecere::com::Class _class)", ReplaceThisClass, module, 2);
16414 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClassType", "Type ReplaceThisClassType(ecere::com::Class _class)", ReplaceThisClassType, module, 2);
16415 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClassSpecifiers", "void ReplaceThisClassSpecifiers(ecere::sys::OldList specs, ecere::com::Class _class)", ReplaceThisClassSpecifiers, module, 2);
16416 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareFunction", "bool DeclareFunction(ecere::com::GlobalFunction function, char * name)", DeclareFunction, module, 2);
16417 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareGlobalData", "void DeclareGlobalData(GlobalData data)", DeclareGlobalData, module, 2);
16418 class = __ecereNameSpace__ecere__com__eSystem_RegisterClass(5, "Conversion", 0, sizeof(struct Conversion), 0, 0, 0, module, 2, 1);
16419 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + 12)))->application == ((struct __ecereNameSpace__ecere__com__Module *)(((char *)__thisModule + 12)))->application && class)
16420 __ecereClass_Conversion = class;
16421 __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);
16422 __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);
16423 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ModuleVisibility", "bool ModuleVisibility(ecere::com::Module searchIn, ecere::com::Module searchFor)", ModuleVisibility, module, 1);
16424 __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);
16425 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("MatchTypeExpression", "bool MatchTypeExpression(Expression sourceExp, Type dest, ecere::sys::OldList conversions, bool skipUnitBla)", MatchTypeExpression, module, 2);
16426 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReadString", "void ReadString(char * output, char * string)", ReadString, module, 1);
16427 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOperand", "Operand GetOperand(Expression exp)", GetOperand, module, 1);
16428 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PopulateInstance", "void PopulateInstance(Instantiation inst)", PopulateInstance, module, 1);
16429 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeInstantiation", "void ComputeInstantiation(Expression exp)", ComputeInstantiation, module, 1);
16430 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CallOperator", "void CallOperator(Expression exp, Expression exp1, Expression exp2, Operand op1, Operand op2)", CallOperator, module, 1);
16431 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeExpression", "void ComputeExpression(Expression exp)", ComputeExpression, module, 1);
16432 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CheckTemplateTypes", "void CheckTemplateTypes(Expression exp)", CheckTemplateTypes, module, 1);
16433 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindSymbol", "Symbol FindSymbol(char * name, Context startContext, Context endContext, bool isStruct, bool globalNameSpace)", FindSymbol, module, 1);
16434 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintType", "void PrintType(Type type, char * string, bool printName, bool fullName)", PrintType, module, 1);
16435 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindMemberAndOffset", "Type FindMemberAndOffset(Type type, char * string, uint * offset)", FindMemberAndOffset, module, 1);
16436 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ParseExpressionString", "Expression ParseExpressionString(char * expression)", ParseExpressionString, module, 1);
16437 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceExpContents", "void ReplaceExpContents(Expression checkedExp, Expression newExp)", ReplaceExpContents, module, 1);
16438 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ApplyAnyObjectLogic", "void ApplyAnyObjectLogic(Expression e)", ApplyAnyObjectLogic, module, 1);
16439 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessExpressionType", "void ProcessExpressionType(Expression exp)", ProcessExpressionType, module, 1);
16440 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareFunctionUtil", "void DeclareFunctionUtil(String s)", DeclareFunctionUtil, module, 1);
16441 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeDataTypes", "void ComputeDataTypes(void)", ComputeDataTypes, module, 1);
16442 }
16443
16444 void __ecereUnregisterModule_pass15(struct __ecereNameSpace__ecere__com__Instance * module)
16445 {
16446
16447 }
16448