compiler: Fixed __declspec compiling issue on Linux; ide: Fixed crash on null workspace
[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 #else
14 #define __declspec(x)
15 #endif
16 typedef long long int64;
17 typedef unsigned long long uint64;
18 #else
19 typedef __int64 int64;
20 typedef unsigned __int64 uint64;
21 #endif
22 #ifdef __BIG_ENDIAN__
23 #define __ENDIAN_PAD(x) (8 - (x))
24 #else
25 #define __ENDIAN_PAD(x) 0
26 #endif
27 #include <stdint.h>
28 extern void *  __ecereNameSpace__ecere__com__eSystem_New(unsigned int size);
29
30 extern void *  __ecereNameSpace__ecere__com__eSystem_New0(unsigned int size);
31
32 extern void *  __ecereNameSpace__ecere__com__eSystem_Renew(void *  memory, unsigned int size);
33
34 extern void *  __ecereNameSpace__ecere__com__eSystem_Renew0(void *  memory, unsigned int size);
35
36 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__BTNode;
37
38 struct __ecereNameSpace__ecere__sys__BTNode;
39
40 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__BinaryTree;
41
42 struct __ecereNameSpace__ecere__sys__BinaryTree
43 {
44 struct __ecereNameSpace__ecere__sys__BTNode * root;
45 int count;
46 int (*  CompareKey)(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, uintptr_t a, uintptr_t b);
47 void (*  FreeKey)(void *  key);
48 } __attribute__ ((gcc_struct));
49
50 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__OldList;
51
52 struct __ecereNameSpace__ecere__sys__OldList
53 {
54 void *  first;
55 void *  last;
56 int count;
57 unsigned int offset;
58 unsigned int circ;
59 } __attribute__ ((gcc_struct));
60
61 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Method;
62
63 struct __ecereNameSpace__ecere__com__Method
64 {
65 char *  name;
66 struct __ecereNameSpace__ecere__com__Method * parent;
67 struct __ecereNameSpace__ecere__com__Method * left;
68 struct __ecereNameSpace__ecere__com__Method * right;
69 int depth;
70 int (*  function)();
71 int vid;
72 int type;
73 struct __ecereNameSpace__ecere__com__Class * _class;
74 void *  symbol;
75 char *  dataTypeString;
76 struct Type * dataType;
77 int memberAccess;
78 } __attribute__ ((gcc_struct));
79
80 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Property;
81
82 struct __ecereNameSpace__ecere__com__Property
83 {
84 struct __ecereNameSpace__ecere__com__Property * prev;
85 struct __ecereNameSpace__ecere__com__Property * next;
86 char *  name;
87 unsigned int isProperty;
88 int memberAccess;
89 int id;
90 struct __ecereNameSpace__ecere__com__Class * _class;
91 char *  dataTypeString;
92 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
93 struct Type * dataType;
94 void (*  Set)();
95 int (*  Get)();
96 unsigned int (*  IsSet)();
97 void *  data;
98 void *  symbol;
99 int vid;
100 unsigned int conversion;
101 unsigned int watcherOffset;
102 char *  category;
103 unsigned int compiled;
104 unsigned int selfWatchable;
105 unsigned int isWatchable;
106 } __attribute__ ((gcc_struct));
107
108 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_CodePosition;
109
110 struct CodePosition
111 {
112 int line;
113 int charPos;
114 int pos;
115 unsigned int included;
116 } __attribute__ ((gcc_struct));
117
118 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Location;
119
120 struct Location
121 {
122 struct CodePosition start;
123 struct CodePosition end;
124 } __attribute__ ((gcc_struct));
125
126 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Attrib;
127
128 struct Attrib;
129
130 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ExtDecl;
131
132 struct ExtDecl
133 {
134 struct Location loc;
135 int type;
136 union
137 {
138 char * s;
139 struct Attrib * attr;
140 } __attribute__ ((gcc_struct));
141 } __attribute__ ((gcc_struct));
142
143 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassDefinition;
144
145 struct ClassDefinition
146 {
147 struct ClassDefinition * prev;
148 struct ClassDefinition * next;
149 struct Location loc;
150 struct Specifier * _class;
151 struct __ecereNameSpace__ecere__sys__OldList *  baseSpecs;
152 struct __ecereNameSpace__ecere__sys__OldList *  definitions;
153 struct Symbol * symbol;
154 struct Location blockStart;
155 struct Location nameLoc;
156 int endid;
157 int declMode;
158 unsigned int deleteWatchable;
159 } __attribute__ ((gcc_struct));
160
161 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Context;
162
163 struct Context
164 {
165 struct Context * parent;
166 struct __ecereNameSpace__ecere__sys__BinaryTree types;
167 struct __ecereNameSpace__ecere__sys__BinaryTree classes;
168 struct __ecereNameSpace__ecere__sys__BinaryTree symbols;
169 struct __ecereNameSpace__ecere__sys__BinaryTree structSymbols;
170 int nextID;
171 int simpleID;
172 struct __ecereNameSpace__ecere__sys__BinaryTree templateTypes;
173 struct ClassDefinition * classDef;
174 unsigned int templateTypesOnly;
175 unsigned int hasNameSpace;
176 } __attribute__ ((gcc_struct));
177
178 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Instantiation;
179
180 struct Instantiation
181 {
182 struct Instantiation * prev;
183 struct Instantiation * next;
184 struct Location loc;
185 struct Specifier * _class;
186 struct Expression * exp;
187 struct __ecereNameSpace__ecere__sys__OldList *  members;
188 struct Symbol * symbol;
189 unsigned int fullSet;
190 unsigned int isConstant;
191 unsigned char *  data;
192 struct Location nameLoc;
193 struct Location insideLoc;
194 unsigned int built;
195 } __attribute__ ((gcc_struct));
196
197 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Declaration;
198
199 struct Declaration
200 {
201 struct Declaration * prev;
202 struct Declaration * next;
203 struct Location loc;
204 int type;
205 union
206 {
207 struct
208 {
209 struct __ecereNameSpace__ecere__sys__OldList *  specifiers;
210 struct __ecereNameSpace__ecere__sys__OldList *  declarators;
211 } __attribute__ ((gcc_struct));
212 struct Instantiation * inst;
213 struct
214 {
215 struct Identifier * id;
216 struct Expression * exp;
217 } __attribute__ ((gcc_struct));
218 } __attribute__ ((gcc_struct));
219 struct Specifier * extStorage;
220 struct Symbol * symbol;
221 int declMode;
222 } __attribute__ ((gcc_struct));
223
224 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Statement;
225
226 struct Statement
227 {
228 struct Statement * prev;
229 struct Statement * next;
230 struct Location loc;
231 int type;
232 union
233 {
234 struct __ecereNameSpace__ecere__sys__OldList *  expressions;
235 struct
236 {
237 struct Identifier * id;
238 struct Statement * stmt;
239 } __attribute__ ((gcc_struct)) labeled;
240 struct
241 {
242 struct Expression * exp;
243 struct Statement * stmt;
244 } __attribute__ ((gcc_struct)) caseStmt;
245 struct
246 {
247 struct __ecereNameSpace__ecere__sys__OldList * declarations;
248 struct __ecereNameSpace__ecere__sys__OldList * statements;
249 struct Context * context;
250 unsigned int isSwitch;
251 } __attribute__ ((gcc_struct)) compound;
252 struct
253 {
254 struct __ecereNameSpace__ecere__sys__OldList * exp;
255 struct Statement * stmt;
256 struct Statement * elseStmt;
257 } __attribute__ ((gcc_struct)) ifStmt;
258 struct
259 {
260 struct __ecereNameSpace__ecere__sys__OldList * exp;
261 struct Statement * stmt;
262 } __attribute__ ((gcc_struct)) switchStmt;
263 struct
264 {
265 struct __ecereNameSpace__ecere__sys__OldList * exp;
266 struct Statement * stmt;
267 } __attribute__ ((gcc_struct)) whileStmt;
268 struct
269 {
270 struct __ecereNameSpace__ecere__sys__OldList * exp;
271 struct Statement * stmt;
272 } __attribute__ ((gcc_struct)) doWhile;
273 struct
274 {
275 struct Statement * init;
276 struct Statement * check;
277 struct __ecereNameSpace__ecere__sys__OldList * increment;
278 struct Statement * stmt;
279 } __attribute__ ((gcc_struct)) forStmt;
280 struct
281 {
282 struct Identifier * id;
283 } __attribute__ ((gcc_struct)) gotoStmt;
284 struct
285 {
286 struct Specifier * spec;
287 char * statements;
288 struct __ecereNameSpace__ecere__sys__OldList * inputFields;
289 struct __ecereNameSpace__ecere__sys__OldList * outputFields;
290 struct __ecereNameSpace__ecere__sys__OldList * clobberedFields;
291 } __attribute__ ((gcc_struct)) asmStmt;
292 struct
293 {
294 struct Expression * watcher;
295 struct Expression * object;
296 struct __ecereNameSpace__ecere__sys__OldList * watches;
297 } __attribute__ ((gcc_struct)) _watch;
298 struct
299 {
300 struct Identifier * id;
301 struct __ecereNameSpace__ecere__sys__OldList * exp;
302 struct __ecereNameSpace__ecere__sys__OldList * filter;
303 struct Statement * stmt;
304 } __attribute__ ((gcc_struct)) forEachStmt;
305 struct Declaration * decl;
306 } __attribute__ ((gcc_struct));
307 } __attribute__ ((gcc_struct));
308
309 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TypeName;
310
311 struct TypeName
312 {
313 struct TypeName * prev;
314 struct TypeName * next;
315 struct Location loc;
316 struct __ecereNameSpace__ecere__sys__OldList *  qualifiers;
317 struct Declarator * declarator;
318 int classObjectType;
319 struct Expression * bitCount;
320 } __attribute__ ((gcc_struct));
321
322 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Initializer;
323
324 struct Initializer
325 {
326 struct Initializer * prev;
327 struct Initializer * next;
328 struct Location loc;
329 int type;
330 union
331 {
332 struct Expression * exp;
333 struct __ecereNameSpace__ecere__sys__OldList *  list;
334 } __attribute__ ((gcc_struct));
335 unsigned int isConstant;
336 } __attribute__ ((gcc_struct));
337
338 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__DataValue;
339
340 struct __ecereNameSpace__ecere__com__DataValue
341 {
342 union
343 {
344 char c;
345 unsigned char uc;
346 short s;
347 unsigned short us;
348 int i;
349 unsigned int ui;
350 void *  p;
351 float f;
352 double d;
353 long long i64;
354 uint64 ui64;
355 } __attribute__ ((gcc_struct));
356 } __attribute__ ((gcc_struct));
357
358 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Expression;
359
360 struct Expression
361 {
362 struct Expression * prev;
363 struct Expression * next;
364 struct Location loc;
365 int type;
366 union
367 {
368 struct
369 {
370 char *  constant;
371 struct Identifier * identifier;
372 } __attribute__ ((gcc_struct));
373 struct Statement * compound;
374 struct Instantiation * instance;
375 char *  string;
376 struct __ecereNameSpace__ecere__sys__OldList *  list;
377 struct
378 {
379 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
380 struct Declarator * decl;
381 } __attribute__ ((gcc_struct)) _classExp;
382 struct
383 {
384 struct Identifier * id;
385 } __attribute__ ((gcc_struct)) classData;
386 struct
387 {
388 struct Expression * exp;
389 struct __ecereNameSpace__ecere__sys__OldList * arguments;
390 struct Location argLoc;
391 } __attribute__ ((gcc_struct)) call;
392 struct
393 {
394 struct Expression * exp;
395 struct __ecereNameSpace__ecere__sys__OldList * index;
396 } __attribute__ ((gcc_struct)) index;
397 struct
398 {
399 struct Expression * exp;
400 struct Identifier * member;
401 int memberType;
402 unsigned int thisPtr;
403 } __attribute__ ((gcc_struct)) member;
404 struct
405 {
406 int op;
407 struct Expression * exp1;
408 struct Expression * exp2;
409 } __attribute__ ((gcc_struct)) op;
410 struct TypeName * typeName;
411 struct Specifier * _class;
412 struct
413 {
414 struct TypeName * typeName;
415 struct Expression * exp;
416 } __attribute__ ((gcc_struct)) cast;
417 struct
418 {
419 struct Expression * cond;
420 struct __ecereNameSpace__ecere__sys__OldList * exp;
421 struct Expression * elseExp;
422 } __attribute__ ((gcc_struct)) cond;
423 struct
424 {
425 struct TypeName * typeName;
426 struct Expression * size;
427 } __attribute__ ((gcc_struct)) _new;
428 struct
429 {
430 struct TypeName * typeName;
431 struct Expression * size;
432 struct Expression * exp;
433 } __attribute__ ((gcc_struct)) _renew;
434 struct
435 {
436 char * table;
437 struct Identifier * id;
438 } __attribute__ ((gcc_struct)) db;
439 struct
440 {
441 struct Expression * ds;
442 struct Expression * name;
443 } __attribute__ ((gcc_struct)) dbopen;
444 struct
445 {
446 struct TypeName * typeName;
447 struct Initializer * initializer;
448 } __attribute__ ((gcc_struct)) initializer;
449 struct
450 {
451 struct Expression * exp;
452 struct TypeName * typeName;
453 } __attribute__ ((gcc_struct)) vaArg;
454 } __attribute__ ((gcc_struct));
455 unsigned int debugValue;
456 struct __ecereNameSpace__ecere__com__DataValue val;
457 unsigned int address;
458 unsigned int hasAddress;
459 struct Type * expType;
460 struct Type * destType;
461 unsigned int usage;
462 int tempCount;
463 unsigned int byReference;
464 unsigned int isConstant;
465 unsigned int addedThis;
466 unsigned int needCast;
467 unsigned int thisPtr;
468 } __attribute__ ((gcc_struct));
469
470 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplateDatatype;
471
472 struct TemplateDatatype
473 {
474 struct __ecereNameSpace__ecere__sys__OldList *  specifiers;
475 struct Declarator * decl;
476 } __attribute__ ((gcc_struct));
477
478 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplateArgument;
479
480 struct TemplateArgument;
481
482 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplateParameter;
483
484 struct TemplateParameter
485 {
486 struct TemplateParameter * prev;
487 struct TemplateParameter * next;
488 struct Location loc;
489 int type;
490 struct Identifier * identifier;
491 union
492 {
493 struct TemplateDatatype * dataType;
494 int memberType;
495 } __attribute__ ((gcc_struct));
496 struct TemplateArgument * defaultArgument;
497 char *  dataTypeString;
498 struct Type * baseType;
499 } __attribute__ ((gcc_struct));
500
501 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Specifier;
502
503 struct Specifier
504 {
505 struct Specifier * prev;
506 struct Specifier * next;
507 struct Location loc;
508 int type;
509 union
510 {
511 int specifier;
512 struct
513 {
514 struct ExtDecl * extDecl;
515 char *  name;
516 struct Symbol * symbol;
517 struct __ecereNameSpace__ecere__sys__OldList *  templateArgs;
518 } __attribute__ ((gcc_struct));
519 struct
520 {
521 struct Identifier * id;
522 struct __ecereNameSpace__ecere__sys__OldList *  list;
523 struct __ecereNameSpace__ecere__sys__OldList *  baseSpecs;
524 struct __ecereNameSpace__ecere__sys__OldList *  definitions;
525 unsigned int addNameSpace;
526 struct Context * ctx;
527 } __attribute__ ((gcc_struct));
528 struct Expression * expression;
529 struct Specifier * _class;
530 struct TemplateParameter * templateParameter;
531 } __attribute__ ((gcc_struct));
532 } __attribute__ ((gcc_struct));
533
534 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Identifier;
535
536 struct Identifier
537 {
538 struct Identifier * prev;
539 struct Identifier * next;
540 struct Location loc;
541 struct Symbol * classSym;
542 struct Specifier * _class;
543 char *  string;
544 struct Identifier * badID;
545 } __attribute__ ((gcc_struct));
546
547 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Pointer;
548
549 struct Pointer;
550
551 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Declarator;
552
553 struct Declarator
554 {
555 struct Declarator * prev;
556 struct Declarator * next;
557 struct Location loc;
558 int type;
559 struct Symbol * symbol;
560 struct Declarator * declarator;
561 union
562 {
563 struct Identifier * identifier;
564 struct
565 {
566 struct Expression * exp;
567 struct Expression * posExp;
568 struct Attrib * attrib;
569 } __attribute__ ((gcc_struct)) structDecl;
570 struct
571 {
572 struct Expression * exp;
573 struct Specifier * enumClass;
574 } __attribute__ ((gcc_struct)) array;
575 struct
576 {
577 struct __ecereNameSpace__ecere__sys__OldList * parameters;
578 } __attribute__ ((gcc_struct)) function;
579 struct
580 {
581 struct Pointer * pointer;
582 } __attribute__ ((gcc_struct)) pointer;
583 struct
584 {
585 struct ExtDecl * extended;
586 } __attribute__ ((gcc_struct)) extended;
587 } __attribute__ ((gcc_struct));
588 } __attribute__ ((gcc_struct));
589
590 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_FunctionDefinition;
591
592 struct FunctionDefinition
593 {
594 struct FunctionDefinition * prev;
595 struct FunctionDefinition * next;
596 struct Location loc;
597 struct __ecereNameSpace__ecere__sys__OldList *  specifiers;
598 struct Declarator * declarator;
599 struct __ecereNameSpace__ecere__sys__OldList *  declarations;
600 struct Statement * body;
601 struct __ecereNameSpace__ecere__com__Class * _class;
602 struct __ecereNameSpace__ecere__sys__OldList attached;
603 int declMode;
604 struct Type * type;
605 struct Symbol * propSet;
606 int tempCount;
607 unsigned int propertyNoThis;
608 } __attribute__ ((gcc_struct));
609
610 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_DBTableDef;
611
612 struct DBTableDef;
613
614 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_External;
615
616 struct External
617 {
618 struct External * prev;
619 struct External * next;
620 struct Location loc;
621 int type;
622 struct Symbol * symbol;
623 union
624 {
625 struct FunctionDefinition * function;
626 struct ClassDefinition * _class;
627 struct Declaration * declaration;
628 char *  importString;
629 struct Identifier * id;
630 struct DBTableDef * table;
631 } __attribute__ ((gcc_struct));
632 int importType;
633 } __attribute__ ((gcc_struct));
634
635 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ModuleImport;
636
637 struct ModuleImport
638 {
639 struct ModuleImport * prev;
640 struct ModuleImport * next;
641 char *  name;
642 struct __ecereNameSpace__ecere__sys__OldList classes;
643 struct __ecereNameSpace__ecere__sys__OldList functions;
644 int importType;
645 int importAccess;
646 } __attribute__ ((gcc_struct));
647
648 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassImport;
649
650 struct ClassImport
651 {
652 struct ClassImport * prev;
653 struct ClassImport * next;
654 char *  name;
655 struct __ecereNameSpace__ecere__sys__OldList methods;
656 struct __ecereNameSpace__ecere__sys__OldList properties;
657 unsigned int itself;
658 unsigned int isRemote;
659 } __attribute__ ((gcc_struct));
660
661 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Symbol;
662
663 struct Symbol
664 {
665 char *  string;
666 struct Symbol * parent;
667 struct Symbol * left;
668 struct Symbol * right;
669 int depth;
670 struct Type * type;
671 union
672 {
673 struct __ecereNameSpace__ecere__com__Method * method;
674 struct __ecereNameSpace__ecere__com__Property * _property;
675 struct __ecereNameSpace__ecere__com__Class * registered;
676 } __attribute__ ((gcc_struct));
677 int id;
678 int idCode;
679 union
680 {
681 struct
682 {
683 struct External * pointerExternal;
684 struct External * structExternal;
685 } __attribute__ ((gcc_struct));
686 struct
687 {
688 struct External * externalGet;
689 struct External * externalSet;
690 struct External * externalPtr;
691 struct External * externalIsSet;
692 } __attribute__ ((gcc_struct));
693 struct
694 {
695 struct External * methodExternal;
696 struct External * methodCodeExternal;
697 } __attribute__ ((gcc_struct));
698 } __attribute__ ((gcc_struct));
699 unsigned int imported;
700 unsigned int declaredStructSym;
701 struct __ecereNameSpace__ecere__com__Class * _class;
702 unsigned int declaredStruct;
703 unsigned int needConstructor;
704 unsigned int needDestructor;
705 char *  constructorName;
706 char *  structName;
707 char *  className;
708 char *  destructorName;
709 struct ModuleImport * module;
710 struct ClassImport * _import;
711 struct Location nameLoc;
712 unsigned int isParam;
713 unsigned int isRemote;
714 unsigned int isStruct;
715 unsigned int fireWatchersDone;
716 int declaring;
717 unsigned int classData;
718 unsigned int isStatic;
719 char *  shortName;
720 struct __ecereNameSpace__ecere__sys__OldList *  templateParams;
721 struct __ecereNameSpace__ecere__sys__OldList templatedClasses;
722 struct Context * ctx;
723 int isIterator;
724 struct Expression * propCategory;
725 } __attribute__ ((gcc_struct));
726
727 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Type;
728
729 struct Type
730 {
731 struct Type * prev;
732 struct Type * next;
733 int refCount;
734 union
735 {
736 struct Symbol * _class;
737 struct
738 {
739 struct __ecereNameSpace__ecere__sys__OldList members;
740 char *  enumName;
741 } __attribute__ ((gcc_struct));
742 struct
743 {
744 struct Type * returnType;
745 struct __ecereNameSpace__ecere__sys__OldList params;
746 struct Symbol * thisClass;
747 unsigned int staticMethod;
748 struct TemplateParameter * thisClassTemplate;
749 } __attribute__ ((gcc_struct));
750 struct
751 {
752 struct __ecereNameSpace__ecere__com__Method * method;
753 struct __ecereNameSpace__ecere__com__Class * methodClass;
754 struct __ecereNameSpace__ecere__com__Class * usedClass;
755 } __attribute__ ((gcc_struct));
756 struct
757 {
758 struct Type * arrayType;
759 int arraySize;
760 struct Expression * arraySizeExp;
761 unsigned int freeExp;
762 struct Symbol * enumClass;
763 } __attribute__ ((gcc_struct));
764 struct Type * type;
765 struct TemplateParameter * templateParameter;
766 } __attribute__ ((gcc_struct));
767 unsigned int isSigned;
768 int kind;
769 unsigned int constant;
770 unsigned int size;
771 char *  name;
772 char *  typeName;
773 unsigned int count;
774 unsigned int truth;
775 int classObjectType;
776 unsigned int byReference;
777 unsigned int extraParam;
778 int alignment;
779 unsigned int directClassAccess;
780 unsigned int computing;
781 unsigned int dllExport;
782 unsigned int offset;
783 unsigned int keepCast;
784 unsigned int passAsTemplate;
785 int bitFieldCount;
786 } __attribute__ ((gcc_struct));
787
788 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Class;
789
790 struct __ecereNameSpace__ecere__com__Class
791 {
792 struct __ecereNameSpace__ecere__com__Class * prev;
793 struct __ecereNameSpace__ecere__com__Class * next;
794 char *  name;
795 int offset;
796 int structSize;
797 int (* *  _vTbl)();
798 int vTblSize;
799 int (*  Constructor)(struct __ecereNameSpace__ecere__com__Instance *);
800 void (*  Destructor)(struct __ecereNameSpace__ecere__com__Instance *);
801 int offsetClass;
802 int sizeClass;
803 struct __ecereNameSpace__ecere__com__Class * base;
804 struct __ecereNameSpace__ecere__sys__BinaryTree methods;
805 struct __ecereNameSpace__ecere__sys__BinaryTree members;
806 struct __ecereNameSpace__ecere__sys__BinaryTree prop;
807 struct __ecereNameSpace__ecere__sys__OldList membersAndProperties;
808 struct __ecereNameSpace__ecere__sys__BinaryTree classProperties;
809 struct __ecereNameSpace__ecere__sys__OldList derivatives;
810 int memberID;
811 int startMemberID;
812 int type;
813 struct __ecereNameSpace__ecere__com__Instance * module;
814 struct __ecereNameSpace__ecere__com__NameSpace *  nameSpace;
815 char *  dataTypeString;
816 struct Type * dataType;
817 int typeSize;
818 int defaultAlignment;
819 void (*  Initialize)();
820 int memberOffset;
821 struct __ecereNameSpace__ecere__sys__OldList selfWatchers;
822 char *  designerClass;
823 unsigned int noExpansion;
824 char *  defaultProperty;
825 unsigned int comRedefinition;
826 int count;
827 unsigned int isRemote;
828 unsigned int internalDecl;
829 void *  data;
830 unsigned int computeSize;
831 int structAlignment;
832 int destructionWatchOffset;
833 unsigned int fixed;
834 struct __ecereNameSpace__ecere__sys__OldList delayedCPValues;
835 int inheritanceAccess;
836 char *  fullName;
837 void *  symbol;
838 struct __ecereNameSpace__ecere__sys__OldList conversions;
839 struct __ecereNameSpace__ecere__sys__OldList templateParams;
840 struct __ecereNameSpace__ecere__com__ClassTemplateArgument *  templateArgs;
841 struct __ecereNameSpace__ecere__com__Class * templateClass;
842 struct __ecereNameSpace__ecere__sys__OldList templatized;
843 int numParams;
844 } __attribute__ ((gcc_struct));
845
846 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Instance;
847
848 struct __ecereNameSpace__ecere__com__Instance
849 {
850 int (* *  _vTbl)();
851 struct __ecereNameSpace__ecere__com__Class * _class;
852 int _refCount;
853 } __attribute__ ((gcc_struct));
854
855 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__DataMember;
856
857 struct __ecereNameSpace__ecere__com__DataMember
858 {
859 struct __ecereNameSpace__ecere__com__DataMember * prev;
860 struct __ecereNameSpace__ecere__com__DataMember * next;
861 char *  name;
862 unsigned int isProperty;
863 int memberAccess;
864 int id;
865 struct __ecereNameSpace__ecere__com__Class * _class;
866 char *  dataTypeString;
867 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
868 struct Type * dataType;
869 int type;
870 int offset;
871 int memberID;
872 struct __ecereNameSpace__ecere__sys__OldList members;
873 struct __ecereNameSpace__ecere__sys__BinaryTree membersAlpha;
874 int memberOffset;
875 int structAlignment;
876 } __attribute__ ((gcc_struct));
877
878 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__SerialBuffer;
879
880 struct __ecereNameSpace__ecere__com__SerialBuffer
881 {
882 unsigned char *  _buffer;
883 unsigned int count;
884 unsigned int _size;
885 unsigned int pos;
886 } __attribute__ ((gcc_struct));
887
888 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__ClassTemplateArgument;
889
890 struct __ecereNameSpace__ecere__com__ClassTemplateArgument
891 {
892 union
893 {
894 struct
895 {
896 char *  dataTypeString;
897 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
898 } __attribute__ ((gcc_struct));
899 struct __ecereNameSpace__ecere__com__DataValue expression;
900 struct
901 {
902 char *  memberString;
903 union
904 {
905 struct __ecereNameSpace__ecere__com__DataMember * member;
906 struct __ecereNameSpace__ecere__com__Property * prop;
907 struct __ecereNameSpace__ecere__com__Method * method;
908 } __attribute__ ((gcc_struct));
909 } __attribute__ ((gcc_struct));
910 } __attribute__ ((gcc_struct));
911 } __attribute__ ((gcc_struct));
912
913 typedef unsigned int size_t;
914
915 void exit(int status);
916
917 void * calloc(size_t nmemb, size_t size);
918
919 void free(void * ptr);
920
921 void * malloc(size_t size);
922
923 void * realloc(void * ptr, size_t size);
924
925 long int strtol(const char * nptr, char ** endptr, int base);
926
927 long long int strtoll(const char * nptr, char ** endptr, int base);
928
929 unsigned long long int strtoull(const char * nptr, char ** endptr, int base);
930
931 enum yytokentype
932 {
933 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
934 };
935
936 typedef union YYSTYPE
937 {
938 int specifierType;
939 int i;
940 int declMode;
941 struct Identifier * id;
942 struct Expression * exp;
943 struct Specifier * specifier;
944 struct __ecereNameSpace__ecere__sys__OldList * list;
945 struct Enumerator * enumerator;
946 struct Declarator * declarator;
947 struct Pointer * pointer;
948 struct Initializer * initializer;
949 struct InitDeclarator * initDeclarator;
950 struct TypeName * typeName;
951 struct Declaration * declaration;
952 struct Statement * stmt;
953 struct FunctionDefinition * function;
954 struct External * external;
955 struct Context * context;
956 struct AsmField * asmField;
957 struct Attrib * attrib;
958 struct ExtDecl * extDecl;
959 struct Attribute * attribute;
960 struct Instantiation * instance;
961 struct MembersInit * membersInit;
962 struct MemberInit * memberInit;
963 struct ClassFunction * classFunction;
964 struct ClassDefinition * _class;
965 struct ClassDef * classDef;
966 struct PropertyDef * prop;
967 char * string;
968 struct Symbol * symbol;
969 struct PropertyWatch * propertyWatch;
970 struct TemplateParameter * templateParameter;
971 struct TemplateArgument * templateArgument;
972 struct TemplateDatatype * templateDatatype;
973 struct DBTableEntry * dbtableEntry;
974 struct DBIndexItem * dbindexItem;
975 struct DBTableDef * dbtableDef;
976 } __attribute__ ((gcc_struct)) YYSTYPE;
977
978 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Enumerator;
979
980 struct Enumerator
981 {
982 struct Enumerator * prev;
983 struct Enumerator * next;
984 struct Location loc;
985 struct Identifier * id;
986 struct Expression * exp;
987 } __attribute__ ((gcc_struct));
988
989 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_InitDeclarator;
990
991 struct InitDeclarator
992 {
993 struct InitDeclarator * prev;
994 struct InitDeclarator * next;
995 struct Location loc;
996 struct Declarator * declarator;
997 struct Initializer * initializer;
998 } __attribute__ ((gcc_struct));
999
1000 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_AsmField;
1001
1002 struct AsmField
1003 {
1004 struct AsmField * prev;
1005 struct AsmField * next;
1006 struct Location loc;
1007 char *  command;
1008 struct Expression * expression;
1009 } __attribute__ ((gcc_struct));
1010
1011 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Attribute;
1012
1013 struct Attribute;
1014
1015 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassFunction;
1016
1017 struct ClassFunction
1018 {
1019 struct ClassFunction * prev;
1020 struct ClassFunction * next;
1021 struct Location loc;
1022 struct __ecereNameSpace__ecere__sys__OldList *  specifiers;
1023 struct Declarator * declarator;
1024 struct __ecereNameSpace__ecere__sys__OldList *  declarations;
1025 struct Statement * body;
1026 struct __ecereNameSpace__ecere__com__Class * _class;
1027 struct __ecereNameSpace__ecere__sys__OldList attached;
1028 int declMode;
1029 struct Type * type;
1030 struct Symbol * propSet;
1031 unsigned int isVirtual;
1032 unsigned int isConstructor;
1033 unsigned int isDestructor;
1034 unsigned int dontMangle;
1035 int id;
1036 int idCode;
1037 } __attribute__ ((gcc_struct));
1038
1039 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_MembersInit;
1040
1041 struct MembersInit
1042 {
1043 struct MembersInit * prev;
1044 struct MembersInit * next;
1045 struct Location loc;
1046 int type;
1047 union
1048 {
1049 struct __ecereNameSpace__ecere__sys__OldList *  dataMembers;
1050 struct ClassFunction * function;
1051 } __attribute__ ((gcc_struct));
1052 } __attribute__ ((gcc_struct));
1053
1054 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_MemberInit;
1055
1056 struct MemberInit
1057 {
1058 struct MemberInit * prev;
1059 struct MemberInit * next;
1060 struct Location loc;
1061 struct Location realLoc;
1062 struct __ecereNameSpace__ecere__sys__OldList *  identifiers;
1063 struct Initializer * initializer;
1064 unsigned int used;
1065 unsigned int variable;
1066 unsigned int takeOutExp;
1067 } __attribute__ ((gcc_struct));
1068
1069 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_PropertyDef;
1070
1071 struct PropertyDef
1072 {
1073 struct PropertyDef * prev;
1074 struct PropertyDef * next;
1075 struct Location loc;
1076 struct __ecereNameSpace__ecere__sys__OldList *  specifiers;
1077 struct Declarator * declarator;
1078 struct Identifier * id;
1079 struct Statement * getStmt;
1080 struct Statement * setStmt;
1081 struct Statement * issetStmt;
1082 struct Symbol * symbol;
1083 unsigned int conversion;
1084 unsigned int isWatchable;
1085 struct Expression * category;
1086 } __attribute__ ((gcc_struct));
1087
1088 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_PropertyWatch;
1089
1090 struct PropertyWatch
1091 {
1092 struct PropertyWatch * prev;
1093 struct PropertyWatch * next;
1094 struct Location loc;
1095 struct Statement * compound;
1096 struct __ecereNameSpace__ecere__sys__OldList *  properties;
1097 unsigned int deleteWatch;
1098 } __attribute__ ((gcc_struct));
1099
1100 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassDef;
1101
1102 struct ClassDef
1103 {
1104 struct ClassDef * prev;
1105 struct ClassDef * next;
1106 struct Location loc;
1107 int type;
1108 union
1109 {
1110 struct Declaration * decl;
1111 struct ClassFunction * function;
1112 struct __ecereNameSpace__ecere__sys__OldList *  defProperties;
1113 struct PropertyDef * propertyDef;
1114 struct PropertyWatch * propertyWatch;
1115 char *  designer;
1116 struct Identifier * defaultProperty;
1117 struct
1118 {
1119 struct Identifier * id;
1120 struct Initializer * initializer;
1121 } __attribute__ ((gcc_struct));
1122 } __attribute__ ((gcc_struct));
1123 int memberAccess;
1124 void *  object;
1125 } __attribute__ ((gcc_struct));
1126
1127 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_DBTableEntry;
1128
1129 struct DBTableEntry;
1130
1131 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_DBIndexItem;
1132
1133 struct DBIndexItem;
1134
1135 extern YYSTYPE yylval;
1136
1137 extern struct Location yylloc;
1138
1139 extern struct __ecereNameSpace__ecere__sys__OldList * ast;
1140
1141 extern int returnCode;
1142
1143 extern struct Expression * parsedExpression;
1144
1145 extern unsigned int yydebug;
1146
1147 void SetYydebug(unsigned int b)
1148 {
1149 yydebug = b;
1150 }
1151
1152 extern unsigned int echoOn;
1153
1154 void resetScanner();
1155
1156 int propWatcherID;
1157
1158 int expression_yyparse();
1159
1160 static struct Statement * curCompound;
1161
1162 struct External * curExternal, * afterExternal;
1163
1164 static struct Type * curSwitchType;
1165
1166 static struct __ecereNameSpace__ecere__com__Class * currentClass;
1167
1168 struct __ecereNameSpace__ecere__com__Class * thisClass;
1169
1170 void SetThisClass(struct __ecereNameSpace__ecere__com__Class * c)
1171 {
1172 thisClass = c;
1173 }
1174
1175 struct __ecereNameSpace__ecere__com__Class * GetThisClass()
1176 {
1177 return thisClass;
1178 }
1179
1180 static char * thisNameSpace;
1181
1182 struct __ecereNameSpace__ecere__com__Class * containerClass;
1183
1184 unsigned int thisClassParams = 0x1;
1185
1186 unsigned int internalValueCounter;
1187
1188 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__TempFile;
1189
1190 struct __ecereNameSpace__ecere__sys__TempFile
1191 {
1192 char __ecere_padding[24];
1193 } __attribute__ ((gcc_struct));
1194
1195 extern void OutputExpression(struct Expression * exp, struct __ecereNameSpace__ecere__com__Instance * f);
1196
1197 extern int strlen(const char * );
1198
1199 extern void *  __ecereNameSpace__ecere__com__eInstance_New(struct __ecereNameSpace__ecere__com__Class * _class);
1200
1201 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek;
1202
1203 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Read;
1204
1205 extern void __ecereNameSpace__ecere__com__eInstance_DecRef(struct __ecereNameSpace__ecere__com__Instance * instance);
1206
1207 void PrintExpression(struct Expression * exp, char * string)
1208 {
1209 {
1210 struct __ecereNameSpace__ecere__com__Instance * f = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
1211 int count;
1212
1213 if(exp)
1214 OutputExpression(exp, f);
1215 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))f->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(f, 0, 0);
1216 count = strlen(string);
1217 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);
1218 string[count] = '\0';
1219 (__ecereNameSpace__ecere__com__eInstance_DecRef(f), f = 0);
1220 }
1221 }
1222
1223 extern int isspace(int c);
1224
1225 long long _strtoi64(char * string, char ** endString, int base)
1226 {
1227 long long value = 0;
1228 int sign = 1;
1229 int c;
1230 char ch;
1231
1232 for(c = 0; (ch = string[c]) && isspace(ch); c++)
1233 ;
1234 if(ch == '+')
1235 c++;
1236 else if(ch == '-')
1237 {
1238 sign = -1;
1239 c++;
1240 }
1241 ;
1242 if(!base)
1243 {
1244 if(ch == (char)0 && string[c + 1] == 'x')
1245 {
1246 base = 16;
1247 c += 2;
1248 }
1249 else if(ch == '0')
1250 {
1251 base = 8;
1252 c++;
1253 }
1254 else
1255 base = 10;
1256 }
1257 for(; (ch = string[c]); c++)
1258 {
1259 if(ch == '0')
1260 ch = (char)0;
1261 else if(ch >= '1' && ch <= '9')
1262 ch -= '1';
1263 else if(ch >= 'a' && ch <= 'z')
1264 ch -= 'a';
1265 else if(ch >= 'A' && ch <= 'Z')
1266 ch -= 'A';
1267 else
1268 {
1269 if(endString)
1270 *endString = string + c;
1271 break;
1272 }
1273 if(ch < base)
1274 {
1275 value *= base;
1276 value += ch;
1277 }
1278 else
1279 {
1280 if(endString)
1281 *endString = string + c;
1282 break;
1283 }
1284 }
1285 return sign * value;
1286 }
1287
1288 uint64 _strtoui64(char * string, char ** endString, int base)
1289 {
1290 uint64 value = 0;
1291 int sign = 1;
1292 int c;
1293 char ch;
1294
1295 for(c = 0; (ch = string[c]) && isspace(ch); c++)
1296 ;
1297 if(ch == '+')
1298 c++;
1299 else if(ch == '-')
1300 {
1301 sign = -1;
1302 c++;
1303 }
1304 ;
1305 if(!base)
1306 {
1307 if(ch == (char)0 && string[c + 1] == 'x')
1308 {
1309 base = 16;
1310 c += 2;
1311 }
1312 else if(ch == '0')
1313 {
1314 base = 8;
1315 c++;
1316 }
1317 else
1318 base = 10;
1319 }
1320 for(; (ch = string[c]); c++)
1321 {
1322 if(ch == '0')
1323 ch = (char)0;
1324 else if(ch >= '1' && ch <= '9')
1325 ch -= '1';
1326 else if(ch >= 'a' && ch <= 'z')
1327 ch -= 'a';
1328 else if(ch >= 'A' && ch <= 'Z')
1329 ch -= 'A';
1330 else
1331 {
1332 if(endString)
1333 *endString = string + c;
1334 break;
1335 }
1336 if(ch < base)
1337 {
1338 value *= base;
1339 value += ch;
1340 }
1341 else
1342 {
1343 if(endString)
1344 *endString = string + c;
1345 break;
1346 }
1347 }
1348 return sign * value;
1349 }
1350
1351 extern struct Type * ProcessTypeString(char *  string, unsigned int staticMethod);
1352
1353 extern struct Type * ProcessType(struct __ecereNameSpace__ecere__sys__OldList * specs, struct Declarator * decl);
1354
1355 struct Type * ProcessTemplateParameterType(struct TemplateParameter * param)
1356 {
1357 if(param && param->type == 0 && (param->dataType || param->dataTypeString))
1358 {
1359 if(!param->baseType)
1360 {
1361 if(param->dataTypeString)
1362 param->baseType = ProcessTypeString(param->dataTypeString, 0x0);
1363 else
1364 param->baseType = ProcessType(param->dataType->specifiers, param->dataType->decl);
1365 }
1366 return param->baseType;
1367 }
1368 return (((void *)0));
1369 }
1370
1371 unsigned int NeedCast(struct Type * type1, struct Type * type2)
1372 {
1373 if(!type1 || !type2 || type1->keepCast || type2->keepCast)
1374 return 0x1;
1375 if(type1->kind == 20 && type2->kind == 4 && type2->passAsTemplate == 0x0)
1376 {
1377 return 0x0;
1378 }
1379 if(type1->kind == type2->kind)
1380 {
1381 switch(type1->kind)
1382 {
1383 case 1:
1384 case 2:
1385 case 3:
1386 case 4:
1387 case 22:
1388 if(type1->passAsTemplate && !type2->passAsTemplate)
1389 return 0x1;
1390 return type1->isSigned != type2->isSigned;
1391 case 8:
1392 return type1->_class != type2->_class;
1393 case 13:
1394 return NeedCast(type1->type, type2->type);
1395 default:
1396 return 0x1;
1397 }
1398 }
1399 return 0x1;
1400 }
1401
1402 extern int strcmp(const char * , const char * );
1403
1404 extern struct Context * curContext;
1405
1406 extern struct Context * topContext;
1407
1408 extern unsigned int __ecereNameSpace__ecere__com__eClass_IsDerived(struct __ecereNameSpace__ecere__com__Class * _class, struct __ecereNameSpace__ecere__com__Class * from);
1409
1410 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);
1411
1412 extern struct __ecereNameSpace__ecere__com__Instance * privateModule;
1413
1414 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);
1415
1416 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);
1417
1418 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__ClassProperty;
1419
1420 struct __ecereNameSpace__ecere__com__ClassProperty
1421 {
1422 char *  name;
1423 struct __ecereNameSpace__ecere__com__ClassProperty * parent;
1424 struct __ecereNameSpace__ecere__com__ClassProperty * left;
1425 struct __ecereNameSpace__ecere__com__ClassProperty * right;
1426 int depth;
1427 void (*  Set)(struct __ecereNameSpace__ecere__com__Class *, int);
1428 int (*  Get)(struct __ecereNameSpace__ecere__com__Class *);
1429 char *  dataTypeString;
1430 struct Type * dataType;
1431 unsigned int constant;
1432 } __attribute__ ((gcc_struct));
1433
1434 extern struct __ecereNameSpace__ecere__com__ClassProperty * __ecereNameSpace__ecere__com__eClass_FindClassProperty(struct __ecereNameSpace__ecere__com__Class * _class, char *  name);
1435
1436 extern struct Expression * QMkExpId(char *  id);
1437
1438 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__ClassTemplateParameter;
1439
1440 struct __ecereNameSpace__ecere__com__ClassTemplateParameter
1441 {
1442 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * prev;
1443 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * next;
1444 char *  name;
1445 int type;
1446 union
1447 {
1448 char *  dataTypeString;
1449 int memberType;
1450 } __attribute__ ((gcc_struct));
1451 struct __ecereNameSpace__ecere__com__ClassTemplateArgument defaultArg;
1452 void *  param;
1453 char __ecere_padding[4];
1454 } __attribute__ ((gcc_struct));
1455
1456 extern struct Expression * GetTemplateArgExpByName(char *  paramName, struct __ecereNameSpace__ecere__com__Class * curClass, int tplType);
1457
1458 extern struct __ecereNameSpace__ecere__sys__OldList *  MkList(void);
1459
1460 extern void FreeIdentifier(struct Identifier * id);
1461
1462 void ProcessExpressionType(struct Expression * exp);
1463
1464 extern struct Declarator * SpecDeclFromString(char *  string, struct __ecereNameSpace__ecere__sys__OldList *  specs, struct Declarator * baseDecl);
1465
1466 extern struct __ecereNameSpace__ecere__sys__OldList *  MkListOne(void *  item);
1467
1468 extern struct Expression * MkExpOp(struct Expression * exp1, int op, struct Expression * exp2);
1469
1470 extern struct Expression * MkExpCast(struct TypeName * typeName, struct Expression * expression);
1471
1472 extern struct TypeName * MkTypeName(struct __ecereNameSpace__ecere__sys__OldList * qualifiers, struct Declarator * declarator);
1473
1474 extern struct Declarator * MkDeclaratorPointer(struct Pointer * pointer, struct Declarator * declarator);
1475
1476 extern struct Pointer * MkPointer(struct __ecereNameSpace__ecere__sys__OldList * qualifiers, struct Pointer * pointer);
1477
1478 struct __ecereNameSpace__ecere__sys__BTNode * __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(struct __ecereNameSpace__ecere__sys__BinaryTree * this, char *  key);
1479
1480 static void ReplaceClassMembers(struct Expression * exp, struct __ecereNameSpace__ecere__com__Class * _class)
1481 {
1482 if(exp->type == 0 && exp->identifier)
1483 {
1484 struct Identifier * id = exp->identifier;
1485 struct Context * ctx;
1486 struct Symbol * symbol = (((void *)0));
1487
1488 if(!id->_class || !id->_class->name || strcmp(id->_class->name, "property"))
1489 {
1490 for(ctx = curContext; ctx != topContext->parent && !symbol; ctx = ctx->parent)
1491 {
1492 symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(&ctx->symbols, id->string);
1493 if(symbol)
1494 break;
1495 }
1496 }
1497 if(!symbol && ((!id->_class || (id->_class->name && !strcmp(id->_class->name, "property"))) || (id->classSym && __ecereNameSpace__ecere__com__eClass_IsDerived(_class, id->classSym->registered))))
1498 {
1499 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
1500 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
1501 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
1502 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
1503
1504 if(!prop)
1505 {
1506 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule);
1507 }
1508 if(!prop && !method)
1509 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
1510 if(!prop && !method && !member)
1511 {
1512 classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(_class, id->string);
1513 }
1514 if(prop || method || member || classProp)
1515 {
1516 exp->type = 8;
1517 exp->member.member = id;
1518 exp->member.memberType = 0;
1519 exp->member.exp = QMkExpId("this");
1520 exp->addedThis = 0x1;
1521 }
1522 else if(_class && _class->templateParams.first)
1523 {
1524 struct __ecereNameSpace__ecere__com__Class * sClass;
1525
1526 for(sClass = _class; sClass; sClass = sClass->base)
1527 {
1528 if(sClass->templateParams.first)
1529 {
1530 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
1531
1532 for(param = sClass->templateParams.first; param; param = param->next)
1533 {
1534 if(param->type == 2 && !strcmp(param->name, id->string))
1535 {
1536 struct Expression * argExp = GetTemplateArgExpByName(param->name, _class, 2);
1537
1538 if(argExp)
1539 {
1540 struct Declarator * decl;
1541 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
1542
1543 FreeIdentifier(exp->member.member);
1544 ProcessExpressionType(argExp);
1545 decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
1546 exp->expType = ProcessType(specs, decl);
1547 exp->type = 5;
1548 exp->list = MkListOne(MkExpOp((((void *)0)), '*', MkExpCast(MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl)), MkExpOp((((void *)0)), '&', argExp))));
1549 }
1550 }
1551 }
1552 }
1553 }
1554 }
1555 }
1556 }
1557 }
1558
1559 extern int sprintf(char * , char * , ...);
1560
1561 extern int __ecereNameSpace__ecere__com__GetRuntimePlatform(void);
1562
1563 extern char *  __ecereNameSpace__ecere__sys__CopyString(char *  string);
1564
1565 char * PrintInt(long long result)
1566 {
1567 char temp[100];
1568
1569 if(result > (((long long)0x7fffffffffffffffLL)))
1570 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1571 else
1572 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "%I64dLL" : "%lldLL"), result);
1573 return __ecereNameSpace__ecere__sys__CopyString(temp);
1574 }
1575
1576 char * PrintUInt(uint64 result)
1577 {
1578 char temp[100];
1579
1580 if(result > (0xffffffff))
1581 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1582 else if(result > (((int)0x7fffffff)))
1583 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64X" : "0x%llX"), result);
1584 else
1585 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "%I64d" : "%lld"), result);
1586 return __ecereNameSpace__ecere__sys__CopyString(temp);
1587 }
1588
1589 char * PrintInt64(long long result)
1590 {
1591 char temp[100];
1592
1593 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "%I64dLL" : "%lldLL"), result);
1594 return __ecereNameSpace__ecere__sys__CopyString(temp);
1595 }
1596
1597 char * PrintUInt64(uint64 result)
1598 {
1599 char temp[100];
1600
1601 if(result > (((long long)0x7fffffffffffffffLL)))
1602 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1603 else
1604 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "%I64dLL" : "%lldLL"), result);
1605 return __ecereNameSpace__ecere__sys__CopyString(temp);
1606 }
1607
1608 char * PrintHexUInt(uint64 result)
1609 {
1610 char temp[100];
1611
1612 if(result > (0xffffffff))
1613 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1614 else
1615 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64X" : "0x%llX"), result);
1616 return __ecereNameSpace__ecere__sys__CopyString(temp);
1617 }
1618
1619 char * PrintHexUInt64(uint64 result)
1620 {
1621 char temp[100];
1622
1623 if(result > (0xffffffff))
1624 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1625 else
1626 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64X" : "0x%llX"), result);
1627 return __ecereNameSpace__ecere__sys__CopyString(temp);
1628 }
1629
1630 char * PrintShort(short result)
1631 {
1632 char temp[100];
1633
1634 sprintf(temp, "%d", (unsigned short)result);
1635 return __ecereNameSpace__ecere__sys__CopyString(temp);
1636 }
1637
1638 char * PrintUShort(unsigned short result)
1639 {
1640 char temp[100];
1641
1642 if(result > (unsigned short)32767)
1643 sprintf(temp, "0x%X", (int)result);
1644 else
1645 sprintf(temp, "%d", result);
1646 return __ecereNameSpace__ecere__sys__CopyString(temp);
1647 }
1648
1649 extern int isprint(int c);
1650
1651 char * PrintChar(char result)
1652 {
1653 char temp[100];
1654
1655 if(result > (char)0 && isprint(result))
1656 sprintf(temp, "'%c'", result);
1657 else if(result < (char)0)
1658 sprintf(temp, "%d", result);
1659 else
1660 sprintf(temp, "0x%X", (unsigned char)result);
1661 return __ecereNameSpace__ecere__sys__CopyString(temp);
1662 }
1663
1664 char * PrintUChar(unsigned char result)
1665 {
1666 char temp[100];
1667
1668 sprintf(temp, "0x%X", result);
1669 return __ecereNameSpace__ecere__sys__CopyString(temp);
1670 }
1671
1672 char * PrintFloat(float result)
1673 {
1674 char temp[350];
1675
1676 sprintf(temp, "%.16ff", result);
1677 return __ecereNameSpace__ecere__sys__CopyString(temp);
1678 }
1679
1680 char * PrintDouble(double result)
1681 {
1682 char temp[350];
1683
1684 sprintf(temp, "%.16f", result);
1685 return __ecereNameSpace__ecere__sys__CopyString(temp);
1686 }
1687
1688 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_OpTable;
1689
1690 struct OpTable
1691 {
1692 unsigned int (*  Add)(struct Expression *, struct Operand *, struct Operand *);
1693 unsigned int (*  Sub)(struct Expression *, struct Operand *, struct Operand *);
1694 unsigned int (*  Mul)(struct Expression *, struct Operand *, struct Operand *);
1695 unsigned int (*  Div)(struct Expression *, struct Operand *, struct Operand *);
1696 unsigned int (*  Mod)(struct Expression *, struct Operand *, struct Operand *);
1697 unsigned int (*  Neg)(struct Expression *, struct Operand *);
1698 unsigned int (*  Inc)(struct Expression *, struct Operand *);
1699 unsigned int (*  Dec)(struct Expression *, struct Operand *);
1700 unsigned int (*  Asign)(struct Expression *, struct Operand *, struct Operand *);
1701 unsigned int (*  AddAsign)(struct Expression *, struct Operand *, struct Operand *);
1702 unsigned int (*  SubAsign)(struct Expression *, struct Operand *, struct Operand *);
1703 unsigned int (*  MulAsign)(struct Expression *, struct Operand *, struct Operand *);
1704 unsigned int (*  DivAsign)(struct Expression *, struct Operand *, struct Operand *);
1705 unsigned int (*  ModAsign)(struct Expression *, struct Operand *, struct Operand *);
1706 unsigned int (*  BitAnd)(struct Expression *, struct Operand *, struct Operand *);
1707 unsigned int (*  BitOr)(struct Expression *, struct Operand *, struct Operand *);
1708 unsigned int (*  BitXor)(struct Expression *, struct Operand *, struct Operand *);
1709 unsigned int (*  LShift)(struct Expression *, struct Operand *, struct Operand *);
1710 unsigned int (*  RShift)(struct Expression *, struct Operand *, struct Operand *);
1711 unsigned int (*  BitNot)(struct Expression *, struct Operand *);
1712 unsigned int (*  AndAsign)(struct Expression *, struct Operand *, struct Operand *);
1713 unsigned int (*  OrAsign)(struct Expression *, struct Operand *, struct Operand *);
1714 unsigned int (*  XorAsign)(struct Expression *, struct Operand *, struct Operand *);
1715 unsigned int (*  LShiftAsign)(struct Expression *, struct Operand *, struct Operand *);
1716 unsigned int (*  RShiftAsign)(struct Expression *, struct Operand *, struct Operand *);
1717 unsigned int (*  Not)(struct Expression *, struct Operand *);
1718 unsigned int (*  Equ)(struct Expression *, struct Operand *, struct Operand *);
1719 unsigned int (*  Nqu)(struct Expression *, struct Operand *, struct Operand *);
1720 unsigned int (*  And)(struct Expression *, struct Operand *, struct Operand *);
1721 unsigned int (*  Or)(struct Expression *, struct Operand *, struct Operand *);
1722 unsigned int (*  Grt)(struct Expression *, struct Operand *, struct Operand *);
1723 unsigned int (*  Sma)(struct Expression *, struct Operand *, struct Operand *);
1724 unsigned int (*  GrtEqu)(struct Expression *, struct Operand *, struct Operand *);
1725 unsigned int (*  SmaEqu)(struct Expression *, struct Operand *, struct Operand *);
1726 unsigned int (*  Cond)(struct Expression *, struct Operand *, struct Operand *, struct Operand *);
1727 } __attribute__ ((gcc_struct));
1728
1729 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Operand;
1730
1731 struct Operand
1732 {
1733 int kind;
1734 struct Type * type;
1735 unsigned int ptrSize;
1736 union
1737 {
1738 char c;
1739 unsigned char uc;
1740 short s;
1741 unsigned short us;
1742 int i;
1743 unsigned int ui;
1744 float f;
1745 double d;
1746 unsigned char *  p;
1747 long long i64;
1748 uint64 ui64;
1749 intptr_t iptr;
1750 uintptr_t uiptr;
1751 } __attribute__ ((gcc_struct));
1752 struct OpTable ops;
1753 } __attribute__ ((gcc_struct));
1754
1755 struct Operand GetOperand(struct Expression * exp);
1756
1757 unsigned int GetInt(struct Expression * exp, int * value2)
1758 {
1759 struct Operand op2 = GetOperand(exp);
1760
1761 if(op2.kind == 3 && op2.type->isSigned)
1762 *value2 = op2.i;
1763 else if(op2.kind == 3)
1764 *value2 = (int)op2.ui;
1765 if(op2.kind == 4 && op2.type->isSigned)
1766 *value2 = (int)op2.i64;
1767 else if(op2.kind == 4)
1768 *value2 = (int)op2.ui64;
1769 else if(op2.kind == 22 && op2.type->isSigned)
1770 *value2 = (int)op2.iptr;
1771 else if(op2.kind == 22)
1772 *value2 = (int)op2.uiptr;
1773 else if(op2.kind == 2 && op2.type->isSigned)
1774 *value2 = (int)op2.s;
1775 else if(op2.kind == 2)
1776 *value2 = (int)op2.us;
1777 else if(op2.kind == 1 && op2.type->isSigned)
1778 *value2 = (int)op2.c;
1779 else if(op2.kind == 1)
1780 *value2 = (int)op2.uc;
1781 else if(op2.kind == 6)
1782 *value2 = (int)op2.f;
1783 else if(op2.kind == 7)
1784 *value2 = (int)op2.d;
1785 else if(op2.kind == 13)
1786 *value2 = (int)op2.ui;
1787 else
1788 return 0x0;
1789 return 0x1;
1790 }
1791
1792 unsigned int GetUInt(struct Expression * exp, unsigned int * value2)
1793 {
1794 struct Operand op2 = GetOperand(exp);
1795
1796 if(op2.kind == 3 && op2.type->isSigned)
1797 *value2 = (unsigned int)op2.i;
1798 else if(op2.kind == 3)
1799 *value2 = op2.ui;
1800 if(op2.kind == 4 && op2.type->isSigned)
1801 *value2 = (unsigned int)op2.i64;
1802 else if(op2.kind == 4)
1803 *value2 = (unsigned int)op2.ui64;
1804 else if(op2.kind == 22 && op2.type->isSigned)
1805 *value2 = (unsigned int)op2.iptr;
1806 else if(op2.kind == 22)
1807 *value2 = (unsigned int)op2.uiptr;
1808 else if(op2.kind == 2 && op2.type->isSigned)
1809 *value2 = (unsigned int)op2.s;
1810 else if(op2.kind == 2)
1811 *value2 = (unsigned int)op2.us;
1812 else if(op2.kind == 1 && op2.type->isSigned)
1813 *value2 = (unsigned int)op2.c;
1814 else if(op2.kind == 1)
1815 *value2 = (unsigned int)op2.uc;
1816 else if(op2.kind == 6)
1817 *value2 = (unsigned int)op2.f;
1818 else if(op2.kind == 7)
1819 *value2 = (unsigned int)op2.d;
1820 else if(op2.kind == 13)
1821 *value2 = op2.ui;
1822 else
1823 return 0x0;
1824 return 0x1;
1825 }
1826
1827 unsigned int GetInt64(struct Expression * exp, long long * value2)
1828 {
1829 struct Operand op2 = GetOperand(exp);
1830
1831 if(op2.kind == 3 && op2.type->isSigned)
1832 *value2 = (long long)op2.i;
1833 else if(op2.kind == 3)
1834 *value2 = (long long)op2.ui;
1835 if(op2.kind == 4 && op2.type->isSigned)
1836 *value2 = op2.i64;
1837 else if(op2.kind == 4)
1838 *value2 = (long long)op2.ui64;
1839 else if(op2.kind == 22 && op2.type->isSigned)
1840 *value2 = (long long)op2.iptr;
1841 else if(op2.kind == 22)
1842 *value2 = (long long)op2.uiptr;
1843 else if(op2.kind == 2 && op2.type->isSigned)
1844 *value2 = (long long)op2.s;
1845 else if(op2.kind == 2)
1846 *value2 = (long long)op2.us;
1847 else if(op2.kind == 1 && op2.type->isSigned)
1848 *value2 = (long long)op2.c;
1849 else if(op2.kind == 1)
1850 *value2 = (long long)op2.uc;
1851 else if(op2.kind == 6)
1852 *value2 = (long long)op2.f;
1853 else if(op2.kind == 7)
1854 *value2 = (long long)op2.d;
1855 else if(op2.kind == 13)
1856 *value2 = (long long)op2.ui;
1857 else
1858 return 0x0;
1859 return 0x1;
1860 }
1861
1862 unsigned int GetUInt64(struct Expression * exp, uint64 * value2)
1863 {
1864 struct Operand op2 = GetOperand(exp);
1865
1866 if(op2.kind == 3 && op2.type->isSigned)
1867 *value2 = (uint64)op2.i;
1868 else if(op2.kind == 3)
1869 *value2 = (uint64)op2.ui;
1870 if(op2.kind == 4 && op2.type->isSigned)
1871 *value2 = (uint64)op2.i64;
1872 else if(op2.kind == 4)
1873 *value2 = op2.ui64;
1874 else if(op2.kind == 22 && op2.type->isSigned)
1875 *value2 = (uint64)op2.iptr;
1876 else if(op2.kind == 22)
1877 *value2 = (uint64)op2.uiptr;
1878 else if(op2.kind == 2 && op2.type->isSigned)
1879 *value2 = (uint64)op2.s;
1880 else if(op2.kind == 2)
1881 *value2 = (uint64)op2.us;
1882 else if(op2.kind == 1 && op2.type->isSigned)
1883 *value2 = (uint64)op2.c;
1884 else if(op2.kind == 1)
1885 *value2 = (uint64)op2.uc;
1886 else if(op2.kind == 6)
1887 *value2 = (uint64)op2.f;
1888 else if(op2.kind == 7)
1889 *value2 = (uint64)op2.d;
1890 else if(op2.kind == 13)
1891 *value2 = (uint64)op2.ui;
1892 else
1893 return 0x0;
1894 return 0x1;
1895 }
1896
1897 unsigned int GetIntPtr(struct Expression * exp, intptr_t * value2)
1898 {
1899 struct Operand op2 = GetOperand(exp);
1900
1901 if(op2.kind == 3 && op2.type->isSigned)
1902 *value2 = (intptr_t)op2.i;
1903 else if(op2.kind == 3)
1904 *value2 = (intptr_t)op2.ui;
1905 if(op2.kind == 4 && op2.type->isSigned)
1906 *value2 = (intptr_t)op2.i64;
1907 else if(op2.kind == 4)
1908 *value2 = (intptr_t)op2.ui64;
1909 else if(op2.kind == 22 && op2.type->isSigned)
1910 *value2 = op2.iptr;
1911 else if(op2.kind == 22)
1912 *value2 = (intptr_t)op2.uiptr;
1913 else if(op2.kind == 2 && op2.type->isSigned)
1914 *value2 = (intptr_t)op2.s;
1915 else if(op2.kind == 2)
1916 *value2 = (intptr_t)op2.us;
1917 else if(op2.kind == 1 && op2.type->isSigned)
1918 *value2 = (intptr_t)op2.c;
1919 else if(op2.kind == 1)
1920 *value2 = (intptr_t)op2.uc;
1921 else if(op2.kind == 6)
1922 *value2 = (intptr_t)op2.f;
1923 else if(op2.kind == 7)
1924 *value2 = (intptr_t)op2.d;
1925 else if(op2.kind == 13)
1926 *value2 = (intptr_t)op2.ui;
1927 else
1928 return 0x0;
1929 return 0x1;
1930 }
1931
1932 unsigned int GetUIntPtr(struct Expression * exp, uintptr_t * value2)
1933 {
1934 struct Operand op2 = GetOperand(exp);
1935
1936 if(op2.kind == 3 && op2.type->isSigned)
1937 *value2 = (uintptr_t)op2.i;
1938 else if(op2.kind == 3)
1939 *value2 = (uintptr_t)op2.ui;
1940 if(op2.kind == 4 && op2.type->isSigned)
1941 *value2 = (uintptr_t)op2.i64;
1942 else if(op2.kind == 4)
1943 *value2 = (uintptr_t)op2.ui64;
1944 else if(op2.kind == 22 && op2.type->isSigned)
1945 *value2 = (uintptr_t)op2.iptr;
1946 else if(op2.kind == 22)
1947 *value2 = op2.uiptr;
1948 else if(op2.kind == 2 && op2.type->isSigned)
1949 *value2 = (uintptr_t)op2.s;
1950 else if(op2.kind == 2)
1951 *value2 = (uintptr_t)op2.us;
1952 else if(op2.kind == 1 && op2.type->isSigned)
1953 *value2 = (uintptr_t)op2.c;
1954 else if(op2.kind == 1)
1955 *value2 = (uintptr_t)op2.uc;
1956 else if(op2.kind == 6)
1957 *value2 = (uintptr_t)op2.f;
1958 else if(op2.kind == 7)
1959 *value2 = (uintptr_t)op2.d;
1960 else if(op2.kind == 13)
1961 *value2 = (uintptr_t)op2.ui;
1962 else
1963 return 0x0;
1964 return 0x1;
1965 }
1966
1967 unsigned int GetShort(struct Expression * exp, short * value2)
1968 {
1969 struct Operand op2 = GetOperand(exp);
1970
1971 if(op2.kind == 3 && op2.type->isSigned)
1972 *value2 = (short)op2.i;
1973 else if(op2.kind == 3)
1974 *value2 = (short)op2.ui;
1975 if(op2.kind == 4 && op2.type->isSigned)
1976 *value2 = (short)op2.i64;
1977 else if(op2.kind == 4)
1978 *value2 = (short)op2.ui64;
1979 else if(op2.kind == 22 && op2.type->isSigned)
1980 *value2 = (short)op2.iptr;
1981 else if(op2.kind == 22)
1982 *value2 = (short)op2.uiptr;
1983 else if(op2.kind == 2 && op2.type->isSigned)
1984 *value2 = op2.s;
1985 else if(op2.kind == 2)
1986 *value2 = (short)op2.us;
1987 else if(op2.kind == 1 && op2.type->isSigned)
1988 *value2 = (short)op2.c;
1989 else if(op2.kind == 1)
1990 *value2 = (short)op2.uc;
1991 else if(op2.kind == 6)
1992 *value2 = (short)op2.f;
1993 else if(op2.kind == 7)
1994 *value2 = (short)op2.d;
1995 else if(op2.kind == 13)
1996 *value2 = (short)op2.ui;
1997 else
1998 return 0x0;
1999 return 0x1;
2000 }
2001
2002 unsigned int GetUShort(struct Expression * exp, unsigned short * value2)
2003 {
2004 struct Operand op2 = GetOperand(exp);
2005
2006 if(op2.kind == 3 && op2.type->isSigned)
2007 *value2 = (unsigned short)op2.i;
2008 else if(op2.kind == 3)
2009 *value2 = (unsigned short)op2.ui;
2010 if(op2.kind == 4 && op2.type->isSigned)
2011 *value2 = (unsigned short)op2.i64;
2012 else if(op2.kind == 4)
2013 *value2 = (unsigned short)op2.ui64;
2014 else if(op2.kind == 22 && op2.type->isSigned)
2015 *value2 = (unsigned short)op2.iptr;
2016 else if(op2.kind == 22)
2017 *value2 = (unsigned short)op2.uiptr;
2018 else if(op2.kind == 2 && op2.type->isSigned)
2019 *value2 = (unsigned short)op2.s;
2020 else if(op2.kind == 2)
2021 *value2 = op2.us;
2022 else if(op2.kind == 1 && op2.type->isSigned)
2023 *value2 = (unsigned short)op2.c;
2024 else if(op2.kind == 1)
2025 *value2 = (unsigned short)op2.uc;
2026 else if(op2.kind == 6)
2027 *value2 = (unsigned short)op2.f;
2028 else if(op2.kind == 7)
2029 *value2 = (unsigned short)op2.d;
2030 else if(op2.kind == 13)
2031 *value2 = (unsigned short)op2.ui;
2032 else
2033 return 0x0;
2034 return 0x1;
2035 }
2036
2037 unsigned int GetChar(struct Expression * exp, char * value2)
2038 {
2039 struct Operand op2 = GetOperand(exp);
2040
2041 if(op2.kind == 3 && op2.type->isSigned)
2042 *value2 = (char)op2.i;
2043 else if(op2.kind == 3)
2044 *value2 = (char)op2.ui;
2045 if(op2.kind == 4 && op2.type->isSigned)
2046 *value2 = (char)op2.i64;
2047 else if(op2.kind == 4)
2048 *value2 = (char)op2.ui64;
2049 else if(op2.kind == 22 && op2.type->isSigned)
2050 *value2 = (char)op2.iptr;
2051 else if(op2.kind == 22)
2052 *value2 = (char)op2.uiptr;
2053 else if(op2.kind == 2 && op2.type->isSigned)
2054 *value2 = (char)op2.s;
2055 else if(op2.kind == 2)
2056 *value2 = (char)op2.us;
2057 else if(op2.kind == 1 && op2.type->isSigned)
2058 *value2 = op2.c;
2059 else if(op2.kind == 1)
2060 *value2 = (char)op2.uc;
2061 else if(op2.kind == 6)
2062 *value2 = (char)op2.f;
2063 else if(op2.kind == 7)
2064 *value2 = (char)op2.d;
2065 else if(op2.kind == 13)
2066 *value2 = (char)op2.ui;
2067 else
2068 return 0x0;
2069 return 0x1;
2070 }
2071
2072 unsigned int GetUChar(struct Expression * exp, unsigned char * value2)
2073 {
2074 struct Operand op2 = GetOperand(exp);
2075
2076 if(op2.kind == 3 && op2.type->isSigned)
2077 *value2 = (unsigned char)op2.i;
2078 else if(op2.kind == 3)
2079 *value2 = (unsigned char)op2.ui;
2080 if(op2.kind == 4 && op2.type->isSigned)
2081 *value2 = (unsigned char)op2.i64;
2082 else if(op2.kind == 4)
2083 *value2 = (unsigned char)op2.ui64;
2084 else if(op2.kind == 22 && op2.type->isSigned)
2085 *value2 = (unsigned char)op2.iptr;
2086 else if(op2.kind == 22)
2087 *value2 = (unsigned char)op2.uiptr;
2088 else if(op2.kind == 2 && op2.type->isSigned)
2089 *value2 = (unsigned char)op2.s;
2090 else if(op2.kind == 2)
2091 *value2 = (unsigned char)op2.us;
2092 else if(op2.kind == 1 && op2.type->isSigned)
2093 *value2 = (unsigned char)op2.c;
2094 else if(op2.kind == 1)
2095 *value2 = op2.uc;
2096 else if(op2.kind == 6)
2097 *value2 = (unsigned char)op2.f;
2098 else if(op2.kind == 7)
2099 *value2 = (unsigned char)op2.d;
2100 else if(op2.kind == 13)
2101 *value2 = (unsigned char)op2.ui;
2102 else
2103 return 0x0;
2104 return 0x1;
2105 }
2106
2107 unsigned int GetFloat(struct Expression * exp, float * value2)
2108 {
2109 struct Operand op2 = GetOperand(exp);
2110
2111 if(op2.kind == 3 && op2.type->isSigned)
2112 *value2 = (float)(float)op2.i;
2113 else if(op2.kind == 3)
2114 *value2 = (float)(float)op2.ui;
2115 if(op2.kind == 4 && op2.type->isSigned)
2116 *value2 = (float)(float)op2.i64;
2117 else if(op2.kind == 4)
2118 *value2 = (float)(float)op2.ui64;
2119 else if(op2.kind == 22 && op2.type->isSigned)
2120 *value2 = (float)op2.iptr;
2121 else if(op2.kind == 22)
2122 *value2 = (float)op2.uiptr;
2123 else if(op2.kind == 2 && op2.type->isSigned)
2124 *value2 = (float)(float)op2.s;
2125 else if(op2.kind == 2)
2126 *value2 = (float)(float)op2.us;
2127 else if(op2.kind == 1 && op2.type->isSigned)
2128 *value2 = (float)(float)op2.c;
2129 else if(op2.kind == 1)
2130 *value2 = (float)(float)op2.uc;
2131 else if(op2.kind == 6)
2132 *value2 = (float)op2.f;
2133 else if(op2.kind == 7)
2134 *value2 = (float)op2.d;
2135 else if(op2.kind == 13)
2136 *value2 = (float)(float)op2.ui;
2137 else
2138 return 0x0;
2139 return 0x1;
2140 }
2141
2142 unsigned int GetDouble(struct Expression * exp, double * value2)
2143 {
2144 struct Operand op2 = GetOperand(exp);
2145
2146 if(op2.kind == 3 && op2.type->isSigned)
2147 *value2 = (double)(double)op2.i;
2148 else if(op2.kind == 3)
2149 *value2 = (double)(double)op2.ui;
2150 if(op2.kind == 4 && op2.type->isSigned)
2151 *value2 = (double)(double)op2.i64;
2152 else if(op2.kind == 4)
2153 *value2 = (double)(double)op2.ui64;
2154 else if(op2.kind == 22 && op2.type->isSigned)
2155 *value2 = (double)op2.iptr;
2156 else if(op2.kind == 22)
2157 *value2 = (double)op2.uiptr;
2158 else if(op2.kind == 2 && op2.type->isSigned)
2159 *value2 = (double)(double)op2.s;
2160 else if(op2.kind == 2)
2161 *value2 = (double)(double)op2.us;
2162 else if(op2.kind == 1 && op2.type->isSigned)
2163 *value2 = (double)(double)op2.c;
2164 else if(op2.kind == 1)
2165 *value2 = (double)(double)op2.uc;
2166 else if(op2.kind == 6)
2167 *value2 = (double)op2.f;
2168 else if(op2.kind == 7)
2169 *value2 = (double)op2.d;
2170 else if(op2.kind == 13)
2171 *value2 = (double)(double)op2.ui;
2172 else
2173 return 0x0;
2174 return 0x1;
2175 }
2176
2177 void ComputeExpression(struct Expression * exp);
2178
2179 struct Context * SetupTemplatesContext(struct __ecereNameSpace__ecere__com__Class * _class);
2180
2181 int ComputeTypeSize(struct Type * type);
2182
2183 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__BitMember;
2184
2185 struct __ecereNameSpace__ecere__com__BitMember
2186 {
2187 struct __ecereNameSpace__ecere__com__BitMember * prev;
2188 struct __ecereNameSpace__ecere__com__BitMember * next;
2189 char *  name;
2190 unsigned int isProperty;
2191 int memberAccess;
2192 int id;
2193 struct __ecereNameSpace__ecere__com__Class * _class;
2194 char *  dataTypeString;
2195 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
2196 struct Type * dataType;
2197 int type;
2198 int size;
2199 int pos;
2200 uint64 mask;
2201 } __attribute__ ((gcc_struct));
2202
2203 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__OldLink;
2204
2205 struct __ecereNameSpace__ecere__sys__OldLink
2206 {
2207 struct __ecereNameSpace__ecere__sys__OldLink * prev;
2208 struct __ecereNameSpace__ecere__sys__OldLink * next;
2209 void *  data;
2210 } __attribute__ ((gcc_struct));
2211
2212 void FinishTemplatesContext(struct Context * context);
2213
2214 void ComputeClassMembers(struct __ecereNameSpace__ecere__com__Class * _class, unsigned int isMember)
2215 {
2216 struct __ecereNameSpace__ecere__com__DataMember * member = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
2217 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
2218
2219 if(member || ((_class->type == 2 || _class->type == 0 || _class->type == 1 || _class->type == 5) && (_class->type == 2 || _class->structSize == _class->offset) && _class->computeSize))
2220 {
2221 int c;
2222 int unionMemberOffset = 0;
2223 int bitFields = 0;
2224
2225 if(!member && _class->destructionWatchOffset)
2226 _class->memberOffset += sizeof(struct __ecereNameSpace__ecere__sys__OldList);
2227 {
2228 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
2229
2230 for(dataMember = member ? member->members.first : _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
2231 {
2232 if(!dataMember->isProperty)
2233 {
2234 if(dataMember->type == 0 && dataMember->dataTypeString && !dataMember->dataType)
2235 {
2236 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
2237 }
2238 }
2239 }
2240 }
2241 {
2242 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
2243
2244 for(dataMember = member ? member->members.first : _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
2245 {
2246 if(!dataMember->isProperty && (dataMember->type != 0 || dataMember->dataTypeString))
2247 {
2248 if(!isMember && _class->type == 2 && dataMember->dataType)
2249 {
2250 struct __ecereNameSpace__ecere__com__BitMember * bitMember = (struct __ecereNameSpace__ecere__com__BitMember *)dataMember;
2251 uint64 mask = 0;
2252 int d;
2253
2254 ComputeTypeSize(dataMember->dataType);
2255 if(bitMember->pos == -1)
2256 bitMember->pos = _class->memberOffset;
2257 if(!bitMember->size)
2258 bitMember->size = dataMember->dataType->size * 8;
2259 _class->memberOffset = bitMember->pos + bitMember->size;
2260 for(d = 0; d < bitMember->size; d++)
2261 {
2262 if(d)
2263 mask <<= 1;
2264 mask |= 1;
2265 }
2266 bitMember->mask = mask << bitMember->pos;
2267 }
2268 else if(dataMember->type == 0 && dataMember->dataType)
2269 {
2270 int size;
2271 int alignment = 0;
2272
2273 if(dataMember->dataType->kind != 8 || ((!dataMember->dataType->_class || !dataMember->dataType->_class->registered || dataMember->dataType->_class->registered != _class || _class->type != 1)))
2274 ComputeTypeSize(dataMember->dataType);
2275 if(dataMember->dataType->bitFieldCount)
2276 {
2277 bitFields += dataMember->dataType->bitFieldCount;
2278 size = 0;
2279 }
2280 else
2281 {
2282 if(bitFields)
2283 {
2284 int size = (bitFields + 7) / 8;
2285
2286 if(isMember)
2287 {
2288 int __simpleStruct0;
2289
2290 if(alignment)
2291 {
2292 int __simpleStruct0;
2293
2294 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2295 if(member->memberOffset % alignment)
2296 member->memberOffset += alignment - (member->memberOffset % alignment);
2297 }
2298 dataMember->offset = member->memberOffset;
2299 if(member->type == 1)
2300 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2301 else
2302 {
2303 member->memberOffset += size;
2304 }
2305 }
2306 else
2307 {
2308 if(alignment)
2309 {
2310 int __simpleStruct0;
2311
2312 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2313 if(_class->memberOffset % alignment)
2314 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2315 }
2316 dataMember->offset = _class->memberOffset;
2317 _class->memberOffset += size;
2318 }
2319 bitFields = 0;
2320 }
2321 size = dataMember->dataType->size;
2322 alignment = dataMember->dataType->alignment;
2323 }
2324 if(isMember)
2325 {
2326 int __simpleStruct0;
2327
2328 if(alignment)
2329 {
2330 int __simpleStruct0;
2331
2332 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2333 if(member->memberOffset % alignment)
2334 member->memberOffset += alignment - (member->memberOffset % alignment);
2335 }
2336 dataMember->offset = member->memberOffset;
2337 if(member->type == 1)
2338 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2339 else
2340 {
2341 member->memberOffset += size;
2342 }
2343 }
2344 else
2345 {
2346 if(alignment)
2347 {
2348 int __simpleStruct0;
2349
2350 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2351 if(_class->memberOffset % alignment)
2352 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2353 }
2354 dataMember->offset = _class->memberOffset;
2355 _class->memberOffset += size;
2356 }
2357 }
2358 else
2359 {
2360 ComputeClassMembers((struct __ecereNameSpace__ecere__com__Class *)dataMember, 0x1);
2361 if(isMember)
2362 {
2363 int __simpleStruct2;
2364 int __simpleStruct0, __simpleStruct1;
2365
2366 member->structAlignment = (__simpleStruct0 = member->structAlignment, __simpleStruct1 = dataMember->structAlignment, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
2367 dataMember->offset = member->memberOffset;
2368 if(member->type == 1)
2369 unionMemberOffset = (__simpleStruct2 = dataMember->memberOffset, (unionMemberOffset > __simpleStruct2) ? unionMemberOffset : __simpleStruct2);
2370 else
2371 member->memberOffset += dataMember->memberOffset;
2372 }
2373 else
2374 {
2375 int __simpleStruct0, __simpleStruct1;
2376
2377 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, __simpleStruct1 = dataMember->structAlignment, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
2378 dataMember->offset = _class->memberOffset;
2379 _class->memberOffset += dataMember->memberOffset;
2380 }
2381 }
2382 }
2383 }
2384 if(bitFields)
2385 {
2386 int alignment = 0;
2387 int size = (bitFields + 7) / 8;
2388
2389 if(isMember)
2390 {
2391 int __simpleStruct0;
2392
2393 if(alignment)
2394 {
2395 int __simpleStruct0;
2396
2397 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2398 if(member->memberOffset % alignment)
2399 member->memberOffset += alignment - (member->memberOffset % alignment);
2400 }
2401 if(member->type == 1)
2402 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2403 else
2404 {
2405 member->memberOffset += size;
2406 }
2407 }
2408 else
2409 {
2410 if(alignment)
2411 {
2412 int __simpleStruct0;
2413
2414 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2415 if(_class->memberOffset % alignment)
2416 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2417 }
2418 _class->memberOffset += size;
2419 }
2420 bitFields = 0;
2421 }
2422 }
2423 if(member && member->type == 1)
2424 {
2425 member->memberOffset = unionMemberOffset;
2426 }
2427 if(!isMember)
2428 {
2429 if(_class->type != 2)
2430 {
2431 _class->structSize = (_class->base ? (_class->base->templateClass ? _class->base->templateClass->structSize : _class->base->structSize) : 0) + _class->memberOffset;
2432 if(!member)
2433 {
2434 struct __ecereNameSpace__ecere__com__Property * prop;
2435
2436 for(prop = _class->membersAndProperties.first; prop; prop = prop->next)
2437 {
2438 if(prop->isProperty && prop->isWatchable)
2439 {
2440 prop->watcherOffset = _class->structSize;
2441 _class->structSize += sizeof(struct __ecereNameSpace__ecere__sys__OldList);
2442 }
2443 }
2444 }
2445 {
2446 struct __ecereNameSpace__ecere__sys__OldLink * derivative;
2447
2448 for(derivative = _class->derivatives.first; derivative; derivative = derivative->next)
2449 {
2450 struct __ecereNameSpace__ecere__com__Class * deriv = derivative->data;
2451
2452 if(deriv->computeSize)
2453 {
2454 deriv->offset = _class->structSize;
2455 deriv->memberOffset = 0;
2456 deriv->structSize = deriv->offset;
2457 ComputeClassMembers(deriv, 0x0);
2458 }
2459 }
2460 }
2461 }
2462 }
2463 }
2464 if(context)
2465 FinishTemplatesContext(context);
2466 }
2467
2468 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__NameSpace;
2469
2470 struct __ecereNameSpace__ecere__com__NameSpace
2471 {
2472 char *  name;
2473 struct __ecereNameSpace__ecere__com__NameSpace *  btParent;
2474 struct __ecereNameSpace__ecere__com__NameSpace *  left;
2475 struct __ecereNameSpace__ecere__com__NameSpace *  right;
2476 int depth;
2477 struct __ecereNameSpace__ecere__com__NameSpace *  parent;
2478 struct __ecereNameSpace__ecere__sys__BinaryTree nameSpaces;
2479 struct __ecereNameSpace__ecere__sys__BinaryTree classes;
2480 struct __ecereNameSpace__ecere__sys__BinaryTree defines;
2481 struct __ecereNameSpace__ecere__sys__BinaryTree functions;
2482 } __attribute__ ((gcc_struct));
2483
2484 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Module;
2485
2486 struct __ecereNameSpace__ecere__com__Module
2487 {
2488 struct __ecereNameSpace__ecere__com__Instance * application;
2489 struct __ecereNameSpace__ecere__sys__OldList classes;
2490 struct __ecereNameSpace__ecere__sys__OldList defines;
2491 struct __ecereNameSpace__ecere__sys__OldList functions;
2492 struct __ecereNameSpace__ecere__sys__OldList modules;
2493 struct __ecereNameSpace__ecere__com__Instance * prev;
2494 struct __ecereNameSpace__ecere__com__Instance * next;
2495 char *  name;
2496 void *  library;
2497 void *  Unload;
2498 int importType;
2499 int origImportType;
2500 struct __ecereNameSpace__ecere__com__NameSpace privateNameSpace;
2501 struct __ecereNameSpace__ecere__com__NameSpace publicNameSpace;
2502 } __attribute__ ((gcc_struct));
2503
2504 void ComputeModuleClasses(struct __ecereNameSpace__ecere__com__Instance * module)
2505 {
2506 struct __ecereNameSpace__ecere__com__Class * _class;
2507 struct __ecereNameSpace__ecere__sys__OldLink * subModule;
2508
2509 for(subModule = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + 12)))->modules.first; subModule; subModule = subModule->next)
2510 ComputeModuleClasses(subModule->data);
2511 for(_class = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + 12)))->classes.first; _class; _class = _class->next)
2512 ComputeClassMembers(_class, 0x0);
2513 }
2514
2515 extern int targetBits;
2516
2517 extern unsigned int inCompiler;
2518
2519 extern void Compiler_Error(char *  format, ...);
2520
2521 extern char *  __ecereNameSpace__ecere__GetTranslatedString(struct __ecereNameSpace__ecere__com__Instance * module, char *  string, char *  stringAndContext);
2522
2523 extern struct __ecereNameSpace__ecere__com__Instance * __thisModule;
2524
2525 extern int __ecereNameSpace__ecere__com__eClass_GetProperty(struct __ecereNameSpace__ecere__com__Class * _class, char *  name);
2526
2527 int ComputeTypeSize(struct Type * type)
2528 {
2529 unsigned int size = type ? type->size : 0;
2530
2531 if(!size && type && !type->computing)
2532 {
2533 type->computing = 0x1;
2534 switch(type->kind)
2535 {
2536 case 1:
2537 type->alignment = size = sizeof(char);
2538 break;
2539 case 3:
2540 type->alignment = size = sizeof(int);
2541 break;
2542 case 4:
2543 type->alignment = size = sizeof(long long);
2544 break;
2545 case 22:
2546 type->alignment = size = targetBits / 8;
2547 break;
2548 case 5:
2549 type->alignment = size = sizeof(long);
2550 break;
2551 case 2:
2552 type->alignment = size = sizeof(short);
2553 break;
2554 case 6:
2555 type->alignment = size = sizeof(float);
2556 break;
2557 case 7:
2558 type->alignment = size = sizeof(double);
2559 break;
2560 case 8:
2561 {
2562 struct __ecereNameSpace__ecere__com__Class * _class = type->_class ? type->_class->registered : (((void *)0));
2563
2564 if(_class && _class->type == 1)
2565 {
2566 ComputeClassMembers(_class, 0x0);
2567 type->alignment = _class->structAlignment;
2568 size = _class->structSize;
2569 if(type->alignment && size % type->alignment)
2570 size += type->alignment - (size % type->alignment);
2571 }
2572 else if(_class && (_class->type == 3 || _class->type == 4 || _class->type == 2))
2573 {
2574 if(!_class->dataType)
2575 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
2576 size = type->alignment = ComputeTypeSize(_class->dataType);
2577 }
2578 else
2579 size = type->alignment = targetBits / 8;
2580 break;
2581 }
2582 case 13:
2583 case 19:
2584 size = type->alignment = targetBits / 8;
2585 break;
2586 case 12:
2587 if(type->arraySizeExp)
2588 {
2589 ProcessExpressionType(type->arraySizeExp);
2590 ComputeExpression(type->arraySizeExp);
2591 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)))
2592 {
2593 struct Location oldLoc = yylloc;
2594 char expression[10240];
2595
2596 expression[0] = '\0';
2597 type->arraySizeExp->expType = (((void *)0));
2598 yylloc = type->arraySizeExp->loc;
2599 if(inCompiler)
2600 PrintExpression(type->arraySizeExp, expression);
2601 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Array size not constant int (%s)\n", (((void *)0))), expression);
2602 yylloc = oldLoc;
2603 }
2604 GetInt(type->arraySizeExp, &type->arraySize);
2605 }
2606 else if(type->enumClass)
2607 {
2608 if(type->enumClass && type->enumClass->registered && type->enumClass->registered->type == 4)
2609 {
2610 type->arraySize = __ecereNameSpace__ecere__com__eClass_GetProperty(type->enumClass->registered, "enumSize");
2611 }
2612 else
2613 type->arraySize = 0;
2614 }
2615 else
2616 {
2617 type->arraySize = 0;
2618 }
2619 size = ComputeTypeSize(type->type) * type->arraySize;
2620 type->alignment = type->type->alignment;
2621 break;
2622 case 9:
2623 {
2624 struct Type * member;
2625
2626 for(member = type->members.first; member; member = member->next)
2627 {
2628 int __simpleStruct0, __simpleStruct1;
2629 unsigned int addSize = ComputeTypeSize(member);
2630
2631 member->offset = size;
2632 if(member->alignment && size % member->alignment)
2633 member->offset += member->alignment - (size % member->alignment);
2634 size = member->offset;
2635 type->alignment = (__simpleStruct0 = type->alignment, __simpleStruct1 = member->alignment, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
2636 size += addSize;
2637 }
2638 if(type->alignment && size % type->alignment)
2639 size += type->alignment - (size % type->alignment);
2640 break;
2641 }
2642 case 10:
2643 {
2644 struct Type * member;
2645
2646 for(member = type->members.first; member; member = member->next)
2647 {
2648 int __simpleStruct0, __simpleStruct1;
2649 unsigned int addSize = ComputeTypeSize(member);
2650
2651 member->offset = size;
2652 if(member->alignment && size % member->alignment)
2653 member->offset += member->alignment - (size % member->alignment);
2654 size = member->offset;
2655 type->alignment = (__simpleStruct0 = type->alignment, __simpleStruct1 = member->alignment, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
2656 size = ((size > addSize) ? size : addSize);
2657 }
2658 if(type->alignment && size % type->alignment)
2659 size += type->alignment - (size % type->alignment);
2660 break;
2661 }
2662 case 20:
2663 {
2664 struct TemplateParameter * param = type->templateParameter;
2665 struct Type * baseType = ProcessTemplateParameterType(param);
2666
2667 if(baseType)
2668 size = ComputeTypeSize(baseType);
2669 else
2670 size = sizeof(uint64);
2671 break;
2672 }
2673 case 15:
2674 {
2675 size = sizeof(enum
2676 {
2677 test
2678 });
2679 break;
2680 }
2681 case 21:
2682 {
2683 size = targetBits / 8;
2684 break;
2685 }
2686 }
2687 type->size = size;
2688 type->computing = 0x0;
2689 }
2690 return size;
2691 }
2692
2693 extern struct Declarator * MkDeclaratorIdentifier(struct Identifier * id);
2694
2695 extern struct Identifier * MkIdentifier(char *  string);
2696
2697 extern void ListAdd(struct __ecereNameSpace__ecere__sys__OldList * list, void *  item);
2698
2699 extern struct Declarator * MkStructDeclarator(struct Declarator * declarator, struct Expression * exp);
2700
2701 extern struct ClassDef * MkClassDefDeclaration(struct Declaration * decl);
2702
2703 extern struct Declaration * MkStructDeclaration(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct __ecereNameSpace__ecere__sys__OldList * declarators, struct Specifier * extStorage);
2704
2705 void ReplaceThisClassSpecifiers(struct __ecereNameSpace__ecere__sys__OldList * specs, struct __ecereNameSpace__ecere__com__Class * _class);
2706
2707 static void DeclareType(struct Type * type, unsigned int declarePointers, unsigned int declareParams);
2708
2709 extern void FreeType(struct Type * type);
2710
2711 extern struct Specifier * MkStructOrUnion(int type, struct Identifier * id, struct __ecereNameSpace__ecere__sys__OldList * definitions);
2712
2713 extern struct Specifier * MkSpecifier(int specifier);
2714
2715 extern struct Declarator * MkDeclaratorArray(struct Declarator * declarator, struct Expression * exp);
2716
2717 extern struct Expression * MkExpConstant(char *  string);
2718
2719 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)
2720 {
2721 struct __ecereNameSpace__ecere__com__DataMember * topMember = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
2722 unsigned int totalSize = 0;
2723 unsigned int maxSize = 0;
2724 int alignment, size;
2725 struct __ecereNameSpace__ecere__com__DataMember * member;
2726 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
2727
2728 if(!isMember && _class->base)
2729 {
2730 maxSize = _class->structSize;
2731 {
2732 if(_class->type == 1 || _class->type == 5)
2733 AddMembers(declarations, _class->base, 0x0, &totalSize, topClass);
2734 else
2735 maxSize -= _class->base->templateClass ? _class->base->templateClass->structSize : _class->base->structSize;
2736 }
2737 }
2738 for(member = isMember ? topMember->members.first : _class->membersAndProperties.first; member; member = member->next)
2739 {
2740 if(!member->isProperty)
2741 {
2742 switch(member->type)
2743 {
2744 case 0:
2745 {
2746 if(member->dataTypeString)
2747 {
2748 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList(), * decls = MkList();
2749 struct Declarator * decl;
2750
2751 decl = SpecDeclFromString(member->dataTypeString, specs, MkDeclaratorIdentifier(MkIdentifier(member->name)));
2752 ListAdd(decls, MkStructDeclarator(decl, (((void *)0))));
2753 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(specs, decls, (((void *)0)))));
2754 if(!member->dataType)
2755 member->dataType = ProcessType(specs, decl);
2756 ReplaceThisClassSpecifiers(specs, topClass);
2757 {
2758 struct Type * type = ProcessType(specs, decl);
2759
2760 DeclareType(member->dataType, 0x0, 0x0);
2761 FreeType(type);
2762 }
2763 ComputeTypeSize(member->dataType);
2764 size = member->dataType->size;
2765 alignment = member->dataType->alignment;
2766 if(alignment)
2767 {
2768 if(totalSize % alignment)
2769 totalSize += alignment - (totalSize % alignment);
2770 }
2771 totalSize += size;
2772 }
2773 break;
2774 }
2775 case 1:
2776 case 2:
2777 {
2778 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList(), * list = MkList();
2779
2780 size = 0;
2781 AddMembers(list, (struct __ecereNameSpace__ecere__com__Class *)member, 0x1, &size, topClass);
2782 ListAdd(specs, MkStructOrUnion((member->type == 1) ? 4 : 3, (((void *)0)), list));
2783 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(specs, (((void *)0)), (((void *)0)))));
2784 alignment = member->structAlignment;
2785 if(alignment)
2786 {
2787 if(totalSize % alignment)
2788 totalSize += alignment - (totalSize % alignment);
2789 }
2790 totalSize += size;
2791 break;
2792 }
2793 }
2794 }
2795 }
2796 if(retSize)
2797 {
2798 unsigned int __simpleStruct0;
2799
2800 if(topMember && topMember->type == 1)
2801 *retSize = (__simpleStruct0 = *retSize, (__simpleStruct0 > totalSize) ? __simpleStruct0 : totalSize);
2802 else
2803 *retSize += totalSize;
2804 }
2805 else if(totalSize < maxSize && _class->type != 1000)
2806 {
2807 char sizeString[50];
2808
2809 sprintf(sizeString, "%d", maxSize - totalSize);
2810 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(CHAR)), MkListOne(MkDeclaratorArray(MkDeclaratorIdentifier(MkIdentifier("__ecere_padding")), MkExpConstant(sizeString))), (((void *)0)))));
2811 }
2812 if(context)
2813 FinishTemplatesContext(context);
2814 return topMember ? topMember->memberID : _class->memberID;
2815 }
2816
2817 static int DeclareMembers(struct __ecereNameSpace__ecere__com__Class * _class, unsigned int isMember)
2818 {
2819 struct __ecereNameSpace__ecere__com__DataMember * topMember = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
2820 unsigned int totalSize = 0;
2821 struct __ecereNameSpace__ecere__com__DataMember * member;
2822 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
2823
2824 if(!isMember && (_class->type == 1 || _class->type == 5) && _class->base->type != 1000)
2825 DeclareMembers(_class->base, 0x0);
2826 for(member = isMember ? topMember->members.first : _class->membersAndProperties.first; member; member = member->next)
2827 {
2828 if(!member->isProperty)
2829 {
2830 switch(member->type)
2831 {
2832 case 0:
2833 {
2834 if(!member->dataType && member->dataTypeString)
2835 member->dataType = ProcessTypeString(member->dataTypeString, 0x0);
2836 if(member->dataType)
2837 DeclareType(member->dataType, 0x0, 0x0);
2838 break;
2839 }
2840 case 1:
2841 case 2:
2842 {
2843 DeclareMembers((struct __ecereNameSpace__ecere__com__Class *)member, 0x1);
2844 break;
2845 }
2846 }
2847 }
2848 }
2849 if(context)
2850 FinishTemplatesContext(context);
2851 return topMember ? topMember->memberID : _class->memberID;
2852 }
2853
2854 extern struct Symbol * FindClass(char *  name);
2855
2856 extern char *  strchr(char * , int);
2857
2858 extern void FullClassNameCat(char *  output, char *  className, unsigned int includeTemplateParams);
2859
2860 extern void FreeList(struct __ecereNameSpace__ecere__sys__OldList * list, void (* )(void * ));
2861
2862 extern struct External * MkExternalDeclaration(struct Declaration * declaration);
2863
2864 extern struct Declaration * MkDeclaration(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct __ecereNameSpace__ecere__sys__OldList * initDeclarators);
2865
2866 extern char *  strcpy(char * , const char * );
2867
2868 extern void MangleClassName(char *  className);
2869
2870 extern void DeclareClass(struct Symbol * classSym, char *  className);
2871
2872 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move(struct __ecereNameSpace__ecere__sys__OldList * this, void *  item, void *  prevItem);
2873
2874 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(struct __ecereNameSpace__ecere__sys__OldList * this, void *  prevItem, void *  item);
2875
2876 void DeclareStruct(char * name, unsigned int skipNoHead)
2877 {
2878 struct External * external = (((void *)0));
2879 struct Symbol * classSym = FindClass(name);
2880
2881 if(!inCompiler || !classSym)
2882 return (((void *)0));
2883 if(classSym->registered && (classSym->registered->type == 2 || classSym->registered->type == 3 || classSym->registered->type == 4))
2884 return (((void *)0));
2885 if(classSym->registered && classSym->imported && !classSym->declaredStructSym)
2886 {
2887 struct Declaration * decl;
2888 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
2889 struct __ecereNameSpace__ecere__sys__OldList * declarations = (((void *)0));
2890 char structName[1024];
2891
2892 external = (classSym->registered && classSym->registered->type == 1) ? classSym->pointerExternal : classSym->structExternal;
2893 classSym->declaring++;
2894 if(strchr(classSym->string, '<'))
2895 {
2896 if(classSym->registered->templateClass)
2897 {
2898 DeclareStruct(classSym->registered->templateClass->fullName, skipNoHead);
2899 classSym->declaring--;
2900 }
2901 return (((void *)0));
2902 }
2903 DeclareMembers(classSym->registered, 0x0);
2904 structName[0] = (char)0;
2905 FullClassNameCat(structName, name, 0x0);
2906 if(!skipNoHead)
2907 {
2908 classSym->declaredStructSym = 0x1;
2909 declarations = MkList();
2910 AddMembers(declarations, classSym->registered, 0x0, (((void *)0)), classSym->registered);
2911 if(!(*declarations).count)
2912 {
2913 FreeList(declarations, (((void *)0)));
2914 declarations = (((void *)0));
2915 }
2916 }
2917 if(skipNoHead || declarations)
2918 {
2919 if(external && external->declaration)
2920 {
2921 ((struct Specifier *)(*external->declaration->specifiers).first)->definitions = declarations;
2922 if(curExternal && curExternal->symbol && curExternal->symbol->idCode < classSym->id)
2923 {
2924 if(classSym->structExternal)
2925 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->structExternal, curExternal->prev);
2926 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->pointerExternal, curExternal->prev);
2927 classSym->id = curExternal->symbol->idCode;
2928 classSym->idCode = curExternal->symbol->idCode;
2929 }
2930 }
2931 else
2932 {
2933 if(!external)
2934 external = MkExternalDeclaration((((void *)0)));
2935 specifiers = MkList();
2936 declarators = MkList();
2937 ListAdd(specifiers, MkStructOrUnion(3, MkIdentifier(structName), declarations));
2938 external->declaration = decl = MkDeclaration(specifiers, declarators);
2939 if(decl->symbol && !decl->symbol->pointerExternal)
2940 decl->symbol->pointerExternal = external;
2941 if(classSym->registered && classSym->registered->type == 1)
2942 {
2943 char className[1024];
2944
2945 strcpy(className, "__ecereClass_");
2946 FullClassNameCat(className, classSym->string, 0x1);
2947 MangleClassName(className);
2948 DeclareClass(classSym, className);
2949 external->symbol = classSym;
2950 classSym->pointerExternal = external;
2951 classSym->id = (curExternal && curExternal->symbol) ? curExternal->symbol->idCode : 0;
2952 classSym->idCode = (curExternal && curExternal->symbol) ? curExternal->symbol->idCode : 0;
2953 }
2954 else
2955 {
2956 char className[1024];
2957
2958 strcpy(className, "__ecereClass_");
2959 FullClassNameCat(className, classSym->string, 0x1);
2960 MangleClassName(className);
2961 classSym->structExternal = external;
2962 DeclareClass(classSym, className);
2963 external->symbol = classSym;
2964 }
2965 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal ? curExternal->prev : (((void *)0)), external);
2966 }
2967 }
2968 classSym->declaring--;
2969 }
2970 else if(curExternal && curExternal->symbol && curExternal->symbol->idCode < classSym->id)
2971 {
2972 classSym->declaring++;
2973 {
2974 if(classSym->registered)
2975 DeclareMembers(classSym->registered, 0x0);
2976 }
2977 if(classSym->registered && (classSym->registered->type == 1 || classSym->registered->type == 5))
2978 {
2979 if(classSym->structExternal)
2980 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->structExternal, curExternal->prev);
2981 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->pointerExternal, curExternal->prev);
2982 classSym->id = curExternal->symbol->idCode;
2983 classSym->idCode = curExternal->symbol->idCode;
2984 }
2985 classSym->declaring--;
2986 }
2987 }
2988
2989 extern char *  strcat(char * , const char * );
2990
2991 extern struct ModuleImport * FindModule(struct __ecereNameSpace__ecere__com__Instance * moduleToFind);
2992
2993 extern struct ModuleImport * mainModule;
2994
2995 extern struct Specifier * MkSpecifierName(char *  name);
2996
2997 extern struct Declarator * MkDeclaratorBrackets(struct Declarator * declarator);
2998
2999 extern struct Declarator * PlugDeclarator(struct Declarator * decl, struct Declarator * baseDecl);
3000
3001 extern struct Declarator * MkDeclaratorFunction(struct Declarator * declarator, struct __ecereNameSpace__ecere__sys__OldList * parameters);
3002
3003 extern struct InitDeclarator * MkInitDeclarator(struct Declarator * declarator, struct Initializer * initializer);
3004
3005 extern void FreeDeclarator(struct Declarator * decl);
3006
3007 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_PropertyImport;
3008
3009 struct PropertyImport
3010 {
3011 struct PropertyImport * prev;
3012 struct PropertyImport * next;
3013 char *  name;
3014 unsigned int isVirtual;
3015 unsigned int hasSet;
3016 unsigned int hasGet;
3017 } __attribute__ ((gcc_struct));
3018
3019 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(struct __ecereNameSpace__ecere__sys__OldList * this, void *  item);
3020
3021 void DeclareProperty(struct __ecereNameSpace__ecere__com__Property * prop, char * setName, char * getName)
3022 {
3023 void * __ecereTemp1;
3024 struct Symbol * symbol = prop->symbol;
3025 char propName[1024];
3026
3027 strcpy(setName, "__ecereProp_");
3028 FullClassNameCat(setName, prop->_class->fullName, 0x0);
3029 strcat(setName, "_Set_");
3030 FullClassNameCat(setName, prop->name, 0x1);
3031 strcpy(getName, "__ecereProp_");
3032 FullClassNameCat(getName, prop->_class->fullName, 0x0);
3033 strcat(getName, "_Get_");
3034 FullClassNameCat(getName, prop->name, 0x1);
3035 strcpy(propName, "__ecereProp_");
3036 FullClassNameCat(propName, prop->_class->fullName, 0x0);
3037 strcat(propName, "_");
3038 FullClassNameCat(propName, prop->name, 0x1);
3039 MangleClassName(getName);
3040 MangleClassName(setName);
3041 MangleClassName(propName);
3042 if(prop->_class->type == 1)
3043 DeclareStruct(prop->_class->fullName, 0x0);
3044 if(!symbol || curExternal->symbol->idCode < symbol->id)
3045 {
3046 unsigned int imported = 0x0;
3047 unsigned int dllImport = 0x0;
3048
3049 if(!symbol || symbol->_import)
3050 {
3051 if(!symbol)
3052 {
3053 struct Symbol * classSym;
3054
3055 if(!prop->_class->symbol)
3056 prop->_class->symbol = FindClass(prop->_class->fullName);
3057 classSym = prop->_class->symbol;
3058 if(classSym && !classSym->_import)
3059 {
3060 struct ModuleImport * module;
3061
3062 if(prop->_class->module)
3063 module = FindModule(prop->_class->module);
3064 else
3065 module = mainModule;
3066 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));
3067 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->classes, classSym->_import);
3068 }
3069 symbol = prop->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
3070 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));
3071 if(classSym)
3072 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&classSym->_import->properties, symbol->_import);
3073 }
3074 imported = 0x1;
3075 if(prop->_class->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)prop->_class->module + 12)))->importType != 1)
3076 dllImport = 0x1;
3077 }
3078 if(!symbol->type)
3079 {
3080 struct Context * context = SetupTemplatesContext(prop->_class);
3081
3082 symbol->type = ProcessTypeString(prop->dataTypeString, 0x0);
3083 FinishTemplatesContext(context);
3084 }
3085 if(prop->Get)
3086 {
3087 if(!symbol->externalGet || symbol->externalGet->type == 0)
3088 {
3089 struct Declaration * decl;
3090 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
3091 struct Declarator * d;
3092 struct __ecereNameSpace__ecere__sys__OldList * params;
3093 struct Specifier * spec;
3094 struct External * external;
3095 struct Declarator * typeDecl;
3096 unsigned int simple = 0x0;
3097
3098 specifiers = MkList();
3099 declarators = MkList();
3100 params = MkList();
3101 ListAdd(params, MkTypeName(MkListOne(MkSpecifierName(prop->_class->fullName)), MkDeclaratorIdentifier(MkIdentifier("this"))));
3102 d = MkDeclaratorIdentifier(MkIdentifier(getName));
3103 if(dllImport)
3104 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
3105 {
3106 struct Context * context = SetupTemplatesContext(prop->_class);
3107
3108 typeDecl = SpecDeclFromString(prop->dataTypeString, specifiers, (((void *)0)));
3109 FinishTemplatesContext(context);
3110 }
3111 for(spec = (*specifiers).first; spec; spec = spec->next)
3112 {
3113 if(spec->type == 1)
3114 {
3115 if((!typeDecl || typeDecl->type == 1))
3116 {
3117 struct Symbol * classSym = spec->symbol;
3118
3119 symbol->_class = classSym->registered;
3120 if(classSym->registered && classSym->registered->type == 1)
3121 {
3122 DeclareStruct(spec->name, 0x0);
3123 simple = 0x1;
3124 }
3125 }
3126 }
3127 }
3128 if(!simple)
3129 d = PlugDeclarator(typeDecl, d);
3130 else
3131 {
3132 ListAdd(params, MkTypeName(specifiers, PlugDeclarator(typeDecl, MkDeclaratorIdentifier(MkIdentifier("value")))));
3133 specifiers = MkList();
3134 }
3135 d = MkDeclaratorFunction(d, params);
3136 if(dllImport)
3137 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
3138 else if(prop->_class->symbol && ((struct Symbol *)prop->_class->symbol)->isStatic)
3139 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
3140 if(simple)
3141 ListAdd(specifiers, MkSpecifier(VOID));
3142 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
3143 decl = MkDeclaration(specifiers, declarators);
3144 external = MkExternalDeclaration(decl);
3145 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
3146 external->symbol = symbol;
3147 symbol->externalGet = external;
3148 ReplaceThisClassSpecifiers(specifiers, prop->_class);
3149 if(typeDecl)
3150 FreeDeclarator(typeDecl);
3151 }
3152 else
3153 {
3154 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->externalGet, curExternal->prev);
3155 }
3156 }
3157 if(prop->Set)
3158 {
3159 if(!symbol->externalSet || symbol->externalSet->type == 0)
3160 {
3161 struct Declaration * decl;
3162 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
3163 struct Declarator * d;
3164 struct __ecereNameSpace__ecere__sys__OldList * params;
3165 struct Specifier * spec;
3166 struct External * external;
3167 struct Declarator * typeDecl;
3168
3169 declarators = MkList();
3170 params = MkList();
3171 if(!prop->conversion || prop->_class->type == 1)
3172 {
3173 ListAdd(params, MkTypeName(MkListOne(MkSpecifierName(prop->_class->fullName)), MkDeclaratorIdentifier(MkIdentifier("this"))));
3174 }
3175 specifiers = MkList();
3176 {
3177 struct Context * context = SetupTemplatesContext(prop->_class);
3178
3179 typeDecl = d = SpecDeclFromString(prop->dataTypeString, specifiers, MkDeclaratorIdentifier(MkIdentifier("value")));
3180 FinishTemplatesContext(context);
3181 }
3182 ListAdd(params, MkTypeName(specifiers, d));
3183 d = MkDeclaratorIdentifier(MkIdentifier(setName));
3184 if(dllImport)
3185 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
3186 d = MkDeclaratorFunction(d, params);
3187 for(spec = (*specifiers).first; spec; spec = spec->next)
3188 {
3189 if(spec->type == 1)
3190 {
3191 if((!typeDecl || typeDecl->type == 1))
3192 {
3193 struct Symbol * classSym = spec->symbol;
3194
3195 symbol->_class = classSym->registered;
3196 if(classSym->registered && classSym->registered->type == 1)
3197 DeclareStruct(spec->name, 0x0);
3198 }
3199 }
3200 }
3201 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
3202 specifiers = MkList();
3203 if(dllImport)
3204 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
3205 else if(prop->_class->symbol && ((struct Symbol *)prop->_class->symbol)->isStatic)
3206 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
3207 if(!prop->conversion || prop->_class->type == 1)
3208 ListAdd(specifiers, MkSpecifier(VOID));
3209 else
3210 ListAdd(specifiers, MkSpecifierName(prop->_class->fullName));
3211 decl = MkDeclaration(specifiers, declarators);
3212 external = MkExternalDeclaration(decl);
3213 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
3214 external->symbol = symbol;
3215 symbol->externalSet = external;
3216 ReplaceThisClassSpecifiers(specifiers, prop->_class);
3217 }
3218 else
3219 {
3220 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->externalSet, curExternal->prev);
3221 }
3222 }
3223 if(!symbol->externalPtr)
3224 {
3225 struct Declaration * decl;
3226 struct External * external;
3227 struct __ecereNameSpace__ecere__sys__OldList * specifiers = MkList();
3228
3229 if(imported)
3230 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
3231 else
3232 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
3233 ListAdd(specifiers, MkSpecifierName("Property"));
3234 {
3235 struct __ecereNameSpace__ecere__sys__OldList * list = MkList();
3236
3237 ListAdd(list, MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier(propName))), (((void *)0))));
3238 if(!imported)
3239 {
3240 strcpy(propName, "__ecerePropM_");
3241 FullClassNameCat(propName, prop->_class->fullName, 0x0);
3242 strcat(propName, "_");
3243 FullClassNameCat(propName, prop->name, 0x1);
3244 MangleClassName(propName);
3245 ListAdd(list, MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier(propName))), (((void *)0))));
3246 }
3247 decl = MkDeclaration(specifiers, list);
3248 }
3249 external = MkExternalDeclaration(decl);
3250 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
3251 external->symbol = symbol;
3252 symbol->externalPtr = external;
3253 }
3254 else
3255 {
3256 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->externalPtr, curExternal->prev);
3257 }
3258 symbol->id = curExternal->symbol->idCode;
3259 }
3260 }
3261
3262 struct Type * Dereference(struct Type * source)
3263 {
3264 void * __ecereTemp1;
3265 struct Type * type = (((void *)0));
3266
3267 if(source)
3268 {
3269 if(source->kind == 13 || source->kind == 12)
3270 {
3271 type = source->type;
3272 source->type->refCount++;
3273 }
3274 else if(source->kind == 8 && !strcmp(source->_class->string, "String"))
3275 {
3276 type = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->kind = 1, ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1));
3277 }
3278 else if(source->kind == 8 && source->_class && source->_class->registered && source->_class->registered->type == 5)
3279 {
3280 type = source;
3281 source->refCount++;
3282 }
3283 else
3284 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "cannot dereference type\n", (((void *)0))));
3285 }
3286 return type;
3287 }
3288
3289 static struct Type * Reference(struct Type * source)
3290 {
3291 void * __ecereTemp1;
3292 struct Type * type = (((void *)0));
3293
3294 if(source)
3295 {
3296 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));
3297 source->refCount++;
3298 }
3299 return type;
3300 }
3301
3302 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);
3303
3304 extern void *  memcpy(void * , const void * , unsigned int size);
3305
3306 void ProcessMethodType(struct __ecereNameSpace__ecere__com__Method * method);
3307
3308 extern void FreeExpression(struct Expression * exp);
3309
3310 extern void __ecereNameSpace__ecere__sys__ChangeCh(char *  string, char ch1, char ch2);
3311
3312 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);
3313
3314 static void ProcessInitializer(struct Initializer * init, struct Type * type);
3315
3316 extern struct Type * MkClassType(char *  name);
3317
3318 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);
3319
3320 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)
3321 {
3322 struct Identifier * ident = member->identifiers ? (*member->identifiers).first : (((void *)0));
3323 unsigned int found = 0x0;
3324 struct __ecereNameSpace__ecere__com__DataMember * dataMember = (((void *)0));
3325 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
3326 unsigned int freeType = 0x0;
3327
3328 yylloc = member->loc;
3329 if(!ident)
3330 {
3331 if(curMember)
3332 {
3333 __ecereNameSpace__ecere__com__eClass_FindNextMember(_class, curClass, curMember, subMemberStack, subMemberStackPos);
3334 if(*curMember)
3335 {
3336 found = 0x1;
3337 dataMember = *curMember;
3338 }
3339 }
3340 }
3341 else
3342 {
3343 struct __ecereNameSpace__ecere__com__DataMember * thisMember = (struct __ecereNameSpace__ecere__com__DataMember *)__ecereNameSpace__ecere__com__eClass_FindProperty(_class, ident->string, privateModule);
3344 struct __ecereNameSpace__ecere__com__DataMember * _subMemberStack[256];
3345 int _subMemberStackPos = 0;
3346
3347 if(!thisMember)
3348 thisMember = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, ident->string, privateModule, _subMemberStack, &_subMemberStackPos);
3349 if(thisMember)
3350 {
3351 dataMember = thisMember;
3352 if(curMember && thisMember->memberAccess == 1)
3353 {
3354 *curMember = thisMember;
3355 *curClass = thisMember->_class;
3356 memcpy(subMemberStack, _subMemberStack, sizeof(int) * _subMemberStackPos);
3357 *subMemberStackPos = _subMemberStackPos;
3358 }
3359 found = 0x1;
3360 }
3361 else
3362 {
3363 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, ident->string, privateModule);
3364 if(method && method->type == 1)
3365 found = 0x1;
3366 else
3367 method = (((void *)0));
3368 }
3369 }
3370 if(found)
3371 {
3372 struct Type * type = (((void *)0));
3373
3374 if(dataMember)
3375 {
3376 if(!dataMember->dataType && dataMember->dataTypeString)
3377 {
3378 struct Context * context = SetupTemplatesContext(_class);
3379
3380 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
3381 FinishTemplatesContext(context);
3382 }
3383 type = dataMember->dataType;
3384 }
3385 else if(method)
3386 {
3387 if(!method->dataType)
3388 ProcessMethodType(method);
3389 type = method->dataType;
3390 }
3391 if(ident && ident->next)
3392 {
3393 for(ident = ident->next; ident && type; ident = ident->next)
3394 {
3395 if(type->kind == 8)
3396 {
3397 dataMember = (struct __ecereNameSpace__ecere__com__DataMember *)__ecereNameSpace__ecere__com__eClass_FindProperty(type->_class->registered, ident->string, privateModule);
3398 if(!dataMember)
3399 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMember(type->_class->registered, ident->string, privateModule, (((void *)0)), (((void *)0)));
3400 if(dataMember)
3401 type = dataMember->dataType;
3402 }
3403 else if(type->kind == 9 || type->kind == 10)
3404 {
3405 struct Type * memberType;
3406
3407 for(memberType = type->members.first; memberType; memberType = memberType->next)
3408 {
3409 if(!strcmp(memberType->name, ident->string))
3410 {
3411 type = memberType;
3412 break;
3413 }
3414 }
3415 }
3416 }
3417 }
3418 if(type && type->kind == 20 && type->templateParameter->type == 0 && _class->templateArgs)
3419 {
3420 int id = 0;
3421 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
3422 struct __ecereNameSpace__ecere__com__Class * sClass;
3423
3424 for(sClass = _class; sClass; sClass = sClass->base)
3425 {
3426 id = 0;
3427 if(sClass->templateClass)
3428 sClass = sClass->templateClass;
3429 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
3430 {
3431 if(curParam->type == 0 && !strcmp(type->templateParameter->identifier->string, curParam->name))
3432 {
3433 for(sClass = sClass->base; sClass; sClass = sClass->base)
3434 {
3435 if(sClass->templateClass)
3436 sClass = sClass->templateClass;
3437 id += sClass->templateParams.count;
3438 }
3439 break;
3440 }
3441 id++;
3442 }
3443 if(curParam)
3444 break;
3445 }
3446 if(curParam)
3447 {
3448 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = _class->templateArgs[id];
3449
3450 if(arg.dataTypeString)
3451 {
3452 type = ProcessTypeString(arg.dataTypeString, 0x0);
3453 freeType = 0x1;
3454 if(type && _class->templateClass)
3455 type->passAsTemplate = 0x1;
3456 if(type)
3457 {
3458 }
3459 }
3460 }
3461 }
3462 if(type && type->kind == 8 && type->_class && type->_class->registered && strchr(type->_class->registered->fullName, '<'))
3463 {
3464 struct __ecereNameSpace__ecere__com__Class * expClass = type->_class->registered;
3465 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
3466 int c;
3467 int paramCount = 0;
3468 int lastParam = -1;
3469 char templateString[1024];
3470 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
3471
3472 sprintf(templateString, "%s<", expClass->templateClass->fullName);
3473 for(cClass = expClass; cClass; cClass = cClass->base)
3474 {
3475 int p = 0;
3476
3477 if(cClass->templateClass)
3478 cClass = cClass->templateClass;
3479 for(param = cClass->templateParams.first; param; param = param->next)
3480 {
3481 int id = p;
3482 struct __ecereNameSpace__ecere__com__Class * sClass;
3483 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
3484
3485 for(sClass = cClass->base; sClass; sClass = sClass->base)
3486 {
3487 if(sClass->templateClass)
3488 sClass = sClass->templateClass;
3489 id += sClass->templateParams.count;
3490 }
3491 arg = expClass->templateArgs[id];
3492 for(sClass = _class; sClass; sClass = sClass->base)
3493 {
3494 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * cParam;
3495 int p = 0;
3496 struct __ecereNameSpace__ecere__com__Class * nextClass;
3497
3498 if(sClass->templateClass)
3499 sClass = sClass->templateClass;
3500 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
3501 {
3502 if(nextClass->templateClass)
3503 nextClass = nextClass->templateClass;
3504 p += nextClass->templateParams.count;
3505 }
3506 for(cParam = sClass->templateParams.first; cParam; cParam = cParam->next, p++)
3507 {
3508 if(cParam->type == 0 && arg.dataTypeString && !strcmp(cParam->name, arg.dataTypeString))
3509 {
3510 if(_class->templateArgs && arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
3511 {
3512 arg.dataTypeString = _class->templateArgs[p].dataTypeString;
3513 arg.dataTypeClass = _class->templateArgs[p].dataTypeClass;
3514 break;
3515 }
3516 }
3517 }
3518 }
3519 {
3520 char argument[256];
3521
3522 argument[0] = '\0';
3523 switch(param->type)
3524 {
3525 case 2:
3526 {
3527 char expString[1024];
3528 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
3529 struct Declarator * decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
3530 struct Expression * exp;
3531 char * string = PrintHexUInt64(arg.expression.ui64);
3532
3533 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
3534 ProcessExpressionType(exp);
3535 ComputeExpression(exp);
3536 expString[0] = '\0';
3537 PrintExpression(exp, expString);
3538 strcat(argument, expString);
3539 FreeExpression(exp);
3540 break;
3541 }
3542 case 1:
3543 {
3544 strcat(argument, arg.member->name);
3545 break;
3546 }
3547 case 0:
3548 {
3549 if(arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
3550 strcat(argument, arg.dataTypeString);
3551 break;
3552 }
3553 }
3554 if(argument[0])
3555 {
3556 if(paramCount)
3557 strcat(templateString, ", ");
3558 if(lastParam != p - 1)
3559 {
3560 strcat(templateString, param->name);
3561 strcat(templateString, " = ");
3562 }
3563 strcat(templateString, argument);
3564 paramCount++;
3565 lastParam = p;
3566 }
3567 p++;
3568 }
3569 }
3570 }
3571 {
3572 int len = strlen(templateString);
3573
3574 if(templateString[len - 1] == '<')
3575 len--;
3576 else
3577 {
3578 if(templateString[len - 1] == '>')
3579 templateString[len++] = ' ';
3580 templateString[len++] = '>';
3581 }
3582 templateString[len++] = '\0';
3583 }
3584 {
3585 struct Context * context = SetupTemplatesContext(_class);
3586
3587 if(freeType)
3588 FreeType(type);
3589 type = ProcessTypeString(templateString, 0x0);
3590 freeType = 0x1;
3591 FinishTemplatesContext(context);
3592 }
3593 }
3594 if(method && member->initializer && member->initializer->type == 0 && member->initializer->exp)
3595 {
3596 ProcessExpressionType(member->initializer->exp);
3597 if(!member->initializer->exp->expType)
3598 {
3599 if(inCompiler)
3600 {
3601 char expString[10240];
3602
3603 expString[0] = '\0';
3604 PrintExpression(member->initializer->exp, expString);
3605 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
3606 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "unresolved symbol used as an instance method %s\n", (((void *)0))), expString);
3607 }
3608 }
3609 else if(!MatchTypes(member->initializer->exp->expType, type, (((void *)0)), (((void *)0)), _class, 0x1, 0x1, 0x0, 0x0))
3610 {
3611 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible instance method %s\n", (((void *)0))), ident->string);
3612 }
3613 }
3614 else if(member->initializer)
3615 {
3616 ProcessInitializer(member->initializer, type);
3617 }
3618 if(freeType)
3619 FreeType(type);
3620 }
3621 else
3622 {
3623 if(_class && _class->type == 3)
3624 {
3625 if(member->initializer)
3626 {
3627 struct Type * type = MkClassType(_class->fullName);
3628
3629 ProcessInitializer(member->initializer, type);
3630 FreeType(type);
3631 }
3632 }
3633 else
3634 {
3635 if(member->initializer)
3636 {
3637 ProcessInitializer(member->initializer, (((void *)0)));
3638 }
3639 if(ident)
3640 {
3641 if(method)
3642 {
3643 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't find virtual method %s in class %s\n", (((void *)0))), ident->string, _class->fullName);
3644 }
3645 else if(_class)
3646 {
3647 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't find member %s in class %s\n", (((void *)0))), ident->string, _class->fullName);
3648 if(inCompiler)
3649 __ecereNameSpace__ecere__com__eClass_AddDataMember(_class, ident->string, "int", 0, 0, 1);
3650 }
3651 }
3652 else if(_class)
3653 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "too many initializers for instantiation of class %s\n", (((void *)0))), _class->fullName);
3654 }
3655 }
3656 }
3657
3658 extern struct Identifier * GetDeclId(struct Declarator * decl);
3659
3660 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);
3661
3662 extern void FreeSpecifier(struct Specifier * spec);
3663
3664 static void ProcessFunction(struct FunctionDefinition * function);
3665
3666 extern struct __ecereNameSpace__ecere__sys__OldList *  CopyList(struct __ecereNameSpace__ecere__sys__OldList *  source, void *  (* )(void * ));
3667
3668 extern struct Specifier * CopySpecifier(struct Specifier * spec);
3669
3670 extern struct Declarator * CopyDeclarator(struct Declarator * declarator);
3671
3672 extern void FreeClassFunction(struct ClassFunction * func);
3673
3674 extern struct MemberInit * MkMemberInit(struct __ecereNameSpace__ecere__sys__OldList * ids, struct Initializer * initializer);
3675
3676 extern struct Initializer * MkInitializerAssignment(struct Expression * exp);
3677
3678 void ProcessInstantiationType(struct Instantiation * inst)
3679 {
3680 yylloc = inst->loc;
3681 if(inst->_class)
3682 {
3683 struct MembersInit * members;
3684 struct Symbol * classSym;
3685 struct __ecereNameSpace__ecere__com__Class * _class;
3686
3687 classSym = inst->_class->symbol;
3688 _class = classSym ? classSym->registered : (((void *)0));
3689 if(!_class || _class->type != 5)
3690 DeclareStruct(inst->_class->name, 0x0);
3691 afterExternal = afterExternal ? afterExternal : curExternal;
3692 if(inst->exp)
3693 ProcessExpressionType(inst->exp);
3694 inst->isConstant = 0x1;
3695 if(inst->members)
3696 {
3697 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
3698 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
3699 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
3700 int subMemberStackPos = 0;
3701
3702 for(members = (*inst->members).first; members; members = members->next)
3703 {
3704 switch(members->type)
3705 {
3706 case 1:
3707 {
3708 char name[1024];
3709 static unsigned int instMethodID = 0;
3710 struct External * external = curExternal;
3711 struct Context * context = curContext;
3712 struct Declarator * declarator = members->function->declarator;
3713 struct Identifier * nameID = GetDeclId(declarator);
3714 char * unmangled = nameID ? nameID->string : (((void *)0));
3715 struct Expression * exp;
3716 struct External * createdExternal = (((void *)0));
3717
3718 if(inCompiler)
3719 {
3720 char number[16];
3721
3722 strcpy(name, "__ecereInstMeth_");
3723 FullClassNameCat(name, _class ? _class->fullName : "_UNKNOWNCLASS", 0x0);
3724 strcat(name, "_");
3725 strcat(name, nameID->string);
3726 strcat(name, "_");
3727 sprintf(number, "_%08d", instMethodID++);
3728 strcat(name, number);
3729 nameID->string = __ecereNameSpace__ecere__sys__CopyString(name);
3730 }
3731 if(declarator)
3732 {
3733 struct Symbol * symbol = declarator->symbol;
3734 struct __ecereNameSpace__ecere__com__Method * method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, unmangled, privateModule);
3735
3736 if(method && method->type == 1)
3737 {
3738 symbol->method = method;
3739 ProcessMethodType(method);
3740 if(!symbol->type->thisClass)
3741 {
3742 if(method->dataType->thisClass && currentClass && __ecereNameSpace__ecere__com__eClass_IsDerived(currentClass, method->dataType->thisClass->registered))
3743 {
3744 if(!currentClass->symbol)
3745 currentClass->symbol = FindClass(currentClass->fullName);
3746 symbol->type->thisClass = currentClass->symbol;
3747 }
3748 else
3749 {
3750 if(!_class->symbol)
3751 _class->symbol = FindClass(_class->fullName);
3752 symbol->type->thisClass = _class->symbol;
3753 }
3754 }
3755 DeclareType(symbol->type, 0x1, 0x1);
3756 }
3757 else if(classSym)
3758 {
3759 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't find virtual method %s in class %s\n", (((void *)0))), unmangled, classSym->string);
3760 }
3761 }
3762 createdExternal = ProcessClassFunction(classSym ? classSym->registered : (((void *)0)), members->function, ast, afterExternal, 0x1);
3763 if(nameID)
3764 {
3765 FreeSpecifier(nameID->_class);
3766 nameID->_class = (((void *)0));
3767 }
3768 if(inCompiler)
3769 {
3770 struct Type * type = declarator->symbol->type;
3771 struct External * oldExternal = curExternal;
3772
3773 declarator->symbol->id = declarator->symbol->idCode = curExternal->symbol->idCode;
3774 {
3775 struct External * externalDecl;
3776
3777 externalDecl = MkExternalDeclaration((((void *)0)));
3778 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), oldExternal->prev, externalDecl);
3779 if(createdExternal->function)
3780 {
3781 ProcessFunction(createdExternal->function);
3782 {
3783 struct Declaration * decl = MkDeclaration(CopyList(createdExternal->function->specifiers, CopySpecifier), MkListOne(MkInitDeclarator(CopyDeclarator(declarator), (((void *)0)))));
3784
3785 externalDecl->declaration = decl;
3786 if(decl->symbol && !decl->symbol->pointerExternal)
3787 decl->symbol->pointerExternal = externalDecl;
3788 declarator->symbol->pointerExternal = externalDecl;
3789 }
3790 }
3791 }
3792 }
3793 else if(declarator)
3794 {
3795 curExternal = declarator->symbol->pointerExternal;
3796 ProcessFunction((struct FunctionDefinition *)members->function);
3797 }
3798 curExternal = external;
3799 curContext = context;
3800 if(inCompiler)
3801 {
3802 FreeClassFunction(members->function);
3803 exp = QMkExpId(name);
3804 members->type = 0;
3805 members->dataMembers = MkListOne(MkMemberInit(MkListOne(MkIdentifier(unmangled)), MkInitializerAssignment(exp)));
3806 (__ecereNameSpace__ecere__com__eSystem_Delete(unmangled), unmangled = 0);
3807 }
3808 break;
3809 }
3810 case 0:
3811 {
3812 if(members->dataMembers && classSym)
3813 {
3814 struct MemberInit * member;
3815 struct Location oldyyloc = yylloc;
3816
3817 for(member = (*members->dataMembers).first; member; member = member->next)
3818 {
3819 ProcessMemberInitData(member, classSym->registered, &curClass, &curMember, subMemberStack, &subMemberStackPos);
3820 if(member->initializer && !member->initializer->isConstant)
3821 inst->isConstant = 0x0;
3822 }
3823 yylloc = oldyyloc;
3824 }
3825 break;
3826 }
3827 }
3828 }
3829 }
3830 }
3831 }
3832
3833 static void DeclareType(struct Type * type, unsigned int declarePointers, unsigned int declareParams)
3834 {
3835 if(inCompiler)
3836 {
3837 if(type->kind == 11)
3838 {
3839 struct Type * param;
3840
3841 if(declareParams)
3842 {
3843 for(param = type->params.first; param; param = param->next)
3844 DeclareType(param, declarePointers, 0x1);
3845 }
3846 DeclareType(type->returnType, declarePointers, 0x1);
3847 }
3848 else if(type->kind == 13 && declarePointers)
3849 DeclareType(type->type, declarePointers, 0x0);
3850 else if(type->kind == 8)
3851 {
3852 if(type->_class->registered && (type->_class->registered->type == 1 || type->_class->registered->type == 5) && !type->_class->declaring)
3853 DeclareStruct(type->_class->registered->fullName, type->_class->registered->type == 5);
3854 }
3855 else if(type->kind == 9 || type->kind == 10)
3856 {
3857 struct Type * member;
3858
3859 for(member = type->members.first; member; member = member->next)
3860 DeclareType(member, 0x0, 0x0);
3861 }
3862 else if(type->kind == 12)
3863 DeclareType(type->arrayType, declarePointers, 0x0);
3864 }
3865 }
3866
3867 extern struct __ecereNameSpace__ecere__com__Class * __ecereNameSpace__ecere__com__eSystem_FindClass(struct __ecereNameSpace__ecere__com__Instance * module, char *  name);
3868
3869 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * FindTemplateArg(struct __ecereNameSpace__ecere__com__Class * _class, struct TemplateParameter * param)
3870 {
3871 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * arg = (((void *)0));
3872 int id = 0;
3873 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
3874 struct __ecereNameSpace__ecere__com__Class * sClass;
3875
3876 for(sClass = _class; sClass; sClass = sClass->base)
3877 {
3878 id = 0;
3879 if(sClass->templateClass)
3880 sClass = sClass->templateClass;
3881 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
3882 {
3883 if(curParam->type == 0 && !strcmp(param->identifier->string, curParam->name))
3884 {
3885 for(sClass = sClass->base; sClass; sClass = sClass->base)
3886 {
3887 if(sClass->templateClass)
3888 sClass = sClass->templateClass;
3889 id += sClass->templateParams.count;
3890 }
3891 break;
3892 }
3893 id++;
3894 }
3895 if(curParam)
3896 break;
3897 }
3898 if(curParam)
3899 {
3900 arg = &_class->templateArgs[id];
3901 if(arg && param->type == 0)
3902 (*arg).dataTypeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, (*arg).dataTypeString);
3903 }
3904 return arg;
3905 }
3906
3907 extern struct Context * PushContext(void);
3908
3909 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplatedType;
3910
3911 struct TemplatedType
3912 {
3913 uintptr_t key;
3914 struct __ecereNameSpace__ecere__sys__BTNode * parent;
3915 struct __ecereNameSpace__ecere__sys__BTNode * left;
3916 struct __ecereNameSpace__ecere__sys__BTNode * right;
3917 int depth;
3918 struct TemplateParameter * param;
3919 } __attribute__ ((gcc_struct));
3920
3921 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(struct __ecereNameSpace__ecere__sys__BinaryTree * this, struct __ecereNameSpace__ecere__sys__BTNode * node);
3922
3923 struct Context * SetupTemplatesContext(struct __ecereNameSpace__ecere__com__Class * _class)
3924 {
3925 void * __ecereTemp1;
3926 struct Context * context = PushContext();
3927
3928 context->templateTypesOnly = 0x1;
3929 if(_class->symbol && ((struct Symbol *)_class->symbol)->templateParams)
3930 {
3931 struct TemplateParameter * param = (*((struct Symbol *)_class->symbol)->templateParams).first;
3932
3933 for(; param; param = param->next)
3934 {
3935 if(param->type == 0 && param->identifier)
3936 {
3937 struct TemplatedType * type = (type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TemplatedType), type->key = (uintptr_t)param->identifier->string, type->param = param, type);
3938
3939 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&curContext->templateTypes, (struct __ecereNameSpace__ecere__sys__BTNode *)type);
3940 }
3941 }
3942 }
3943 else if(_class)
3944 {
3945 struct __ecereNameSpace__ecere__com__Class * sClass;
3946
3947 for(sClass = _class; sClass; sClass = sClass->base)
3948 {
3949 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * p;
3950
3951 for(p = sClass->templateParams.first; p; p = p->next)
3952 {
3953 if(p->type == 0)
3954 {
3955 struct TemplateParameter * param = p->param;
3956 struct TemplatedType * type;
3957
3958 if(!param)
3959 {
3960 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));
3961 }
3962 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));
3963 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&curContext->templateTypes, (struct __ecereNameSpace__ecere__sys__BTNode *)type);
3964 }
3965 }
3966 }
3967 }
3968 return context;
3969 }
3970
3971 extern void PopContext(struct Context * ctx);
3972
3973 extern void FreeContext(struct Context * context);
3974
3975 void FinishTemplatesContext(struct Context * context)
3976 {
3977 PopContext(context);
3978 FreeContext(context);
3979 ((context ? (__ecereClass_Context->Destructor ? __ecereClass_Context->Destructor(context) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(context)) : 0), context = 0);
3980 }
3981
3982 void ProcessMethodType(struct __ecereNameSpace__ecere__com__Method * method)
3983 {
3984 if(!method->dataType)
3985 {
3986 struct Context * context = SetupTemplatesContext(method->_class);
3987
3988 method->dataType = ProcessTypeString(method->dataTypeString, 0x0);
3989 FinishTemplatesContext(context);
3990 if(method->type != 1 && method->dataType)
3991 {
3992 if(!method->dataType->thisClass && !method->dataType->staticMethod)
3993 {
3994 if(!method->_class->symbol)
3995 method->_class->symbol = FindClass(method->_class->fullName);
3996 method->dataType->thisClass = method->_class->symbol;
3997 }
3998 }
3999 }
4000 }
4001
4002 void ProcessPropertyType(struct __ecereNameSpace__ecere__com__Property * prop)
4003 {
4004 if(!prop->dataType)
4005 {
4006 struct Context * context = SetupTemplatesContext(prop->_class);
4007
4008 prop->dataType = ProcessTypeString(prop->dataTypeString, 0x0);
4009 FinishTemplatesContext(context);
4010 }
4011 }
4012
4013 extern struct Declarator * GetFuncDecl(struct Declarator * decl);
4014
4015 extern void FreeTypeName(struct TypeName * typeName);
4016
4017 static void ProcessDeclarator(struct Declarator * decl);
4018
4019 extern struct __ecereNameSpace__ecere__sys__OldList *  excludedSymbols;
4020
4021 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_MethodImport;
4022
4023 struct MethodImport
4024 {
4025 struct MethodImport * prev;
4026 struct MethodImport * next;
4027 char *  name;
4028 unsigned int isVirtual;
4029 } __attribute__ ((gcc_struct));
4030
4031 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(struct __ecereNameSpace__ecere__sys__OldList * this, void *  item);
4032
4033 void DeclareMethod(struct __ecereNameSpace__ecere__com__Method * method, char * name)
4034 {
4035 void * __ecereTemp1;
4036 struct Symbol * symbol = method->symbol;
4037
4038 if(!symbol || (!symbol->pointerExternal && method->type == 1) || symbol->id > (curExternal ? curExternal->symbol->idCode : -1))
4039 {
4040 unsigned int imported = 0x0;
4041 unsigned int dllImport = 0x0;
4042
4043 if(!method->dataType)
4044 method->dataType = ProcessTypeString(method->dataTypeString, 0x0);
4045 if(!symbol || symbol->_import || method->type == 1)
4046 {
4047 if(!symbol || method->type == 1)
4048 {
4049 struct Symbol * classSym;
4050
4051 if(!method->_class->symbol)
4052 method->_class->symbol = FindClass(method->_class->fullName);
4053 classSym = method->_class->symbol;
4054 if(!classSym->_import)
4055 {
4056 struct ModuleImport * module;
4057
4058 if(method->_class->module && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)method->_class->module + 12)))->name)
4059 module = FindModule(method->_class->module);
4060 else
4061 module = mainModule;
4062 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));
4063 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->classes, classSym->_import);
4064 }
4065 if(!symbol)
4066 {
4067 symbol = method->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4068 }
4069 if(!symbol->_import)
4070 {
4071 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));
4072 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&classSym->_import->methods, symbol->_import);
4073 }
4074 if(!symbol)
4075 {
4076 symbol->type = method->dataType;
4077 if(symbol->type)
4078 symbol->type->refCount++;
4079 }
4080 }
4081 if(!method->dataType->dllExport)
4082 {
4083 imported = 0x1;
4084 if(method->_class->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)method->_class->module + 12)))->importType != 1)
4085 dllImport = 0x1;
4086 }
4087 }
4088 if(method->type != 1 && method->dataType)
4089 DeclareType(method->dataType, 0x1, 0x1);
4090 if(!symbol->pointerExternal || symbol->pointerExternal->type == 0)
4091 {
4092 struct Declaration * decl;
4093 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
4094 struct Declarator * d;
4095 struct Declarator * funcDecl;
4096 struct External * external;
4097
4098 specifiers = MkList();
4099 declarators = MkList();
4100 if(dllImport)
4101 ListAdd(specifiers, MkSpecifier(EXTERN));
4102 else if(method->_class->symbol && ((struct Symbol *)method->_class->symbol)->isStatic)
4103 ListAdd(specifiers, MkSpecifier(STATIC));
4104 if(method->type == 1)
4105 {
4106 ListAdd(specifiers, MkSpecifier(INT));
4107 d = MkDeclaratorIdentifier(MkIdentifier(name));
4108 }
4109 else
4110 {
4111 d = MkDeclaratorIdentifier(MkIdentifier(name));
4112 if(dllImport)
4113 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
4114 {
4115 struct Context * context = SetupTemplatesContext(method->_class);
4116
4117 d = SpecDeclFromString(method->dataTypeString, specifiers, d);
4118 FinishTemplatesContext(context);
4119 }
4120 funcDecl = GetFuncDecl(d);
4121 if(dllImport)
4122 {
4123 struct Specifier * spec, * next;
4124
4125 for(spec = (*specifiers).first; spec; spec = next)
4126 {
4127 next = spec->next;
4128 if(spec->type == 5)
4129 {
4130 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*specifiers), spec);
4131 FreeSpecifier(spec);
4132 }
4133 }
4134 }
4135 if(method->dataType && !method->dataType->staticMethod)
4136 {
4137 if(funcDecl && funcDecl->function.parameters && (*funcDecl->function.parameters).count)
4138 {
4139 struct __ecereNameSpace__ecere__com__Class * _class = method->dataType->thisClass ? method->dataType->thisClass->registered : method->_class;
4140 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")));
4141 struct TypeName * firstParam = ((struct TypeName *)(*funcDecl->function.parameters).first);
4142 struct Specifier * firstSpec = firstParam->qualifiers ? (*firstParam->qualifiers).first : (((void *)0));
4143
4144 if(firstSpec && firstSpec->type == 0 && firstSpec->specifier == VOID && !firstParam->declarator)
4145 {
4146 struct TypeName * param = (*funcDecl->function.parameters).first;
4147
4148 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->function.parameters), param);
4149 FreeTypeName(param);
4150 }
4151 if(!funcDecl->function.parameters)
4152 funcDecl->function.parameters = MkList();
4153 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
4154 }
4155 }
4156 }
4157 ProcessDeclarator(d);
4158 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
4159 decl = MkDeclaration(specifiers, declarators);
4160 ReplaceThisClassSpecifiers(specifiers, method->_class);
4161 if(symbol->pointerExternal)
4162 {
4163 struct Symbol * functionSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4164
4165 {
4166 *functionSymbol = *symbol;
4167 functionSymbol->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
4168 if(functionSymbol->type)
4169 functionSymbol->type->refCount++;
4170 }
4171 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*excludedSymbols), functionSymbol);
4172 symbol->pointerExternal->symbol = functionSymbol;
4173 }
4174 external = MkExternalDeclaration(decl);
4175 if(curExternal)
4176 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal ? curExternal->prev : (((void *)0)), external);
4177 external->symbol = symbol;
4178 symbol->pointerExternal = external;
4179 }
4180 else if(ast)
4181 {
4182 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
4183 }
4184 symbol->id = curExternal ? curExternal->symbol->idCode : (((int)0x7fffffff));
4185 }
4186 }
4187
4188 char * ReplaceThisClass(struct __ecereNameSpace__ecere__com__Class * _class)
4189 {
4190 if(thisClassParams && _class->templateParams.count && !_class->templateClass)
4191 {
4192 unsigned int first = 0x1;
4193 int p = 0;
4194 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
4195 int lastParam = -1;
4196 char className[1024];
4197
4198 strcpy(className, _class->fullName);
4199 for(param = _class->templateParams.first; param; param = param->next)
4200 {
4201 {
4202 if(first)
4203 strcat(className, "<");
4204 if(!first)
4205 strcat(className, ", ");
4206 if(lastParam + 1 != p)
4207 {
4208 strcat(className, param->name);
4209 strcat(className, " = ");
4210 }
4211 strcat(className, param->name);
4212 first = 0x0;
4213 lastParam = p;
4214 }
4215 p++;
4216 }
4217 if(!first)
4218 {
4219 int len = strlen(className);
4220
4221 if(className[len - 1] == '>')
4222 className[len++] = ' ';
4223 className[len++] = '>';
4224 className[len++] = '\0';
4225 }
4226 return __ecereNameSpace__ecere__sys__CopyString(className);
4227 }
4228 else
4229 return __ecereNameSpace__ecere__sys__CopyString(_class->fullName);
4230 }
4231
4232 struct Type * ReplaceThisClassType(struct __ecereNameSpace__ecere__com__Class * _class)
4233 {
4234 if(thisClassParams && _class->templateParams.count && !_class->templateClass)
4235 {
4236 unsigned int first = 0x1;
4237 int p = 0;
4238 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
4239 int lastParam = -1;
4240 char className[1024];
4241
4242 strcpy(className, _class->fullName);
4243 for(param = _class->templateParams.first; param; param = param->next)
4244 {
4245 {
4246 if(first)
4247 strcat(className, "<");
4248 if(!first)
4249 strcat(className, ", ");
4250 if(lastParam + 1 != p)
4251 {
4252 strcat(className, param->name);
4253 strcat(className, " = ");
4254 }
4255 strcat(className, param->name);
4256 first = 0x0;
4257 lastParam = p;
4258 }
4259 p++;
4260 }
4261 if(!first)
4262 {
4263 int len = strlen(className);
4264
4265 if(className[len - 1] == '>')
4266 className[len++] = ' ';
4267 className[len++] = '>';
4268 className[len++] = '\0';
4269 }
4270 return MkClassType(className);
4271 }
4272 else
4273 {
4274 return MkClassType(_class->fullName);
4275 }
4276 }
4277
4278 void ReplaceThisClassSpecifiers(struct __ecereNameSpace__ecere__sys__OldList * specs, struct __ecereNameSpace__ecere__com__Class * _class)
4279 {
4280 if(specs != (((void *)0)) && _class)
4281 {
4282 struct Specifier * spec;
4283
4284 for(spec = specs->first; spec; spec = spec->next)
4285 {
4286 if(spec->type == 0 && spec->specifier == THISCLASS)
4287 {
4288 spec->type = 1;
4289 spec->name = ReplaceThisClass(_class);
4290 spec->symbol = FindClass(spec->name);
4291 }
4292 }
4293 }
4294 }
4295
4296 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__GlobalFunction;
4297
4298 struct __ecereNameSpace__ecere__com__GlobalFunction
4299 {
4300 struct __ecereNameSpace__ecere__com__GlobalFunction * prev;
4301 struct __ecereNameSpace__ecere__com__GlobalFunction * next;
4302 char *  name;
4303 int (*  function)();
4304 struct __ecereNameSpace__ecere__com__Instance * module;
4305 struct __ecereNameSpace__ecere__com__NameSpace *  nameSpace;
4306 char *  dataTypeString;
4307 struct Type * dataType;
4308 void *  symbol;
4309 } __attribute__ ((gcc_struct));
4310
4311 extern struct Context * globalContext;
4312
4313 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_FunctionImport;
4314
4315 struct FunctionImport
4316 {
4317 struct FunctionImport * prev;
4318 struct FunctionImport * next;
4319 char *  name;
4320 } __attribute__ ((gcc_struct));
4321
4322 unsigned int DeclareFunction(struct __ecereNameSpace__ecere__com__GlobalFunction * function, char * name)
4323 {
4324 void * __ecereTemp1;
4325 struct Symbol * symbol = function->symbol;
4326
4327 if(curExternal && (!symbol || symbol->id > curExternal->symbol->idCode))
4328 {
4329 unsigned int imported = 0x0;
4330 unsigned int dllImport = 0x0;
4331
4332 if(!function->dataType)
4333 {
4334 function->dataType = ProcessTypeString(function->dataTypeString, 0x0);
4335 if(!function->dataType->thisClass)
4336 function->dataType->staticMethod = 0x1;
4337 }
4338 if(inCompiler)
4339 {
4340 if(!symbol)
4341 {
4342 struct ModuleImport * module = FindModule(function->module);
4343
4344 symbol = function->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4345 if(module->name)
4346 {
4347 if(!function->dataType->dllExport)
4348 {
4349 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));
4350 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->functions, symbol->_import);
4351 }
4352 }
4353 {
4354 symbol->type = ProcessTypeString(function->dataTypeString, 0x0);
4355 if(!symbol->type->thisClass)
4356 symbol->type->staticMethod = 0x1;
4357 }
4358 }
4359 imported = symbol->_import ? 0x1 : 0x0;
4360 if(imported && function->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + 12)))->importType != 1)
4361 dllImport = 0x1;
4362 }
4363 DeclareType(function->dataType, 0x1, 0x1);
4364 if(inCompiler)
4365 {
4366 if(!symbol->pointerExternal || symbol->pointerExternal->type == 0)
4367 {
4368 struct Declaration * decl;
4369 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
4370 struct Declarator * d;
4371 struct Declarator * funcDecl;
4372 struct External * external;
4373
4374 specifiers = MkList();
4375 declarators = MkList();
4376 ListAdd(specifiers, MkSpecifier(EXTERN));
4377 d = MkDeclaratorIdentifier(MkIdentifier(imported ? name : function->name));
4378 if(dllImport)
4379 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
4380 d = SpecDeclFromString(function->dataTypeString, specifiers, d);
4381 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + 12)))->importType == 1)
4382 {
4383 struct Specifier * spec;
4384
4385 for(spec = (*specifiers).first; spec; spec = spec->next)
4386 if(spec->type == 5 && spec->extDecl && spec->extDecl->type == 0 && !strcmp(spec->extDecl->s, "dllexport"))
4387 {
4388 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*specifiers), spec);
4389 FreeSpecifier(spec);
4390 break;
4391 }
4392 }
4393 funcDecl = GetFuncDecl(d);
4394 if(funcDecl && !funcDecl->function.parameters)
4395 {
4396 funcDecl->function.parameters = MkList();
4397 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), MkTypeName(MkListOne(MkSpecifier(VOID)), (((void *)0))));
4398 }
4399 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
4400 {
4401 struct Context * oldCtx = curContext;
4402
4403 curContext = globalContext;
4404 decl = MkDeclaration(specifiers, declarators);
4405 curContext = oldCtx;
4406 }
4407 if(symbol->pointerExternal)
4408 {
4409 struct Symbol * functionSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4410
4411 {
4412 *functionSymbol = *symbol;
4413 functionSymbol->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
4414 if(functionSymbol->type)
4415 functionSymbol->type->refCount++;
4416 }
4417 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*excludedSymbols), functionSymbol);
4418 symbol->pointerExternal->symbol = functionSymbol;
4419 }
4420 external = MkExternalDeclaration(decl);
4421 if(curExternal)
4422 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
4423 external->symbol = symbol;
4424 symbol->pointerExternal = external;
4425 }
4426 else
4427 {
4428 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
4429 }
4430 if(curExternal)
4431 symbol->id = curExternal->symbol->idCode;
4432 }
4433 }
4434 return (symbol && symbol->_import && function->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + 12)))->importType != 1) ? 0x1 : 0x0;
4435 }
4436
4437 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_GlobalData;
4438
4439 struct GlobalData
4440 {
4441 uintptr_t key;
4442 struct __ecereNameSpace__ecere__sys__BTNode * parent;
4443 struct __ecereNameSpace__ecere__sys__BTNode * left;
4444 struct __ecereNameSpace__ecere__sys__BTNode * right;
4445 int depth;
4446 struct __ecereNameSpace__ecere__com__Instance * module;
4447 char *  dataTypeString;
4448 struct Type * dataType;
4449 void *  symbol;
4450 char *  fullName;
4451 } __attribute__ ((gcc_struct));
4452
4453 void DeclareGlobalData(struct GlobalData * data)
4454 {
4455 struct Symbol * symbol = data->symbol;
4456
4457 if(curExternal && (!symbol || symbol->id > curExternal->symbol->idCode))
4458 {
4459 if(inCompiler)
4460 {
4461 if(!symbol)
4462 symbol = data->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4463 }
4464 if(!data->dataType)
4465 data->dataType = ProcessTypeString(data->dataTypeString, 0x0);
4466 DeclareType(data->dataType, 0x1, 0x1);
4467 if(inCompiler)
4468 {
4469 if(!symbol->pointerExternal)
4470 {
4471 struct Declaration * decl;
4472 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
4473 struct Declarator * d;
4474 struct External * external;
4475
4476 specifiers = MkList();
4477 declarators = MkList();
4478 ListAdd(specifiers, MkSpecifier(EXTERN));
4479 d = MkDeclaratorIdentifier(MkIdentifier(data->fullName));
4480 d = SpecDeclFromString(data->dataTypeString, specifiers, d);
4481 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
4482 decl = MkDeclaration(specifiers, declarators);
4483 external = MkExternalDeclaration(decl);
4484 if(curExternal)
4485 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
4486 external->symbol = symbol;
4487 symbol->pointerExternal = external;
4488 }
4489 else
4490 {
4491 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
4492 }
4493 if(curExternal)
4494 symbol->id = curExternal->symbol->idCode;
4495 }
4496 }
4497 }
4498
4499 struct Conversion
4500 {
4501 struct Conversion * prev, * next;
4502 struct __ecereNameSpace__ecere__com__Property * convert;
4503 unsigned int isGet;
4504 struct Type * resultType;
4505 } __attribute__ ((gcc_struct));
4506
4507 static struct __ecereNameSpace__ecere__com__Class * __ecereClass_Conversion;
4508
4509 extern void Compiler_Warning(char *  format, ...);
4510
4511 void PrintType(struct Type * type, char *  string, unsigned int printName, unsigned int fullName);
4512
4513 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)
4514 {
4515 if(source && dest)
4516 {
4517 if(source->kind == 20 && dest->kind != 20)
4518 {
4519 struct Type * type = ProcessTemplateParameterType(source->templateParameter);
4520
4521 if(type)
4522 source = type;
4523 }
4524 if(dest->kind == 20 && source->kind != 20)
4525 {
4526 struct Type * type = ProcessTemplateParameterType(dest->templateParameter);
4527
4528 if(type)
4529 dest = type;
4530 }
4531 if((dest->classObjectType == 2 && source->classObjectType != 3) || (dest->classObjectType == 3 && source->classObjectType != 2))
4532 {
4533 return 0x1;
4534 }
4535 if(source->classObjectType == 3 && dest->classObjectType != 2)
4536 {
4537 return 0x1;
4538 }
4539 if((dest->kind == 9 && source->kind == 9) || (dest->kind == 10 && source->kind == 10))
4540 {
4541 if((dest->enumName && source->enumName && !strcmp(dest->enumName, source->enumName)) || (source->members.first && source->members.first == dest->members.first))
4542 return 0x1;
4543 }
4544 if(dest->kind == 14 && source->kind != 0)
4545 return 0x1;
4546 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))
4547 return 0x1;
4548 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))
4549 return 0x1;
4550 if(((source->kind == 8 && dest->kind == 8) || (source->kind == 19 && dest->kind == 19)) && source->_class)
4551 {
4552 if(source->_class->registered && source->_class->registered->type == 3)
4553 {
4554 if(conversions != (((void *)0)))
4555 {
4556 if(source->_class->registered == dest->_class->registered)
4557 return 0x1;
4558 }
4559 else
4560 {
4561 struct __ecereNameSpace__ecere__com__Class * sourceBase, * destBase;
4562
4563 for(sourceBase = source->_class->registered; sourceBase && sourceBase->base->type != 1000; sourceBase = sourceBase->base)
4564 ;
4565 for(destBase = dest->_class->registered; destBase && destBase->base->type != 1000; destBase = destBase->base)
4566 ;
4567 if(sourceBase == destBase)
4568 return 0x1;
4569 }
4570 }
4571 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))
4572 return 0x1;
4573 else
4574 {
4575 if(enumBaseType && dest->_class && dest->_class->registered && dest->_class->registered->type == 4 && source->_class && source->_class->registered && source->_class->registered->type != 4)
4576 {
4577 if(__ecereNameSpace__ecere__com__eClass_IsDerived(dest->_class->registered, source->_class->registered))
4578 {
4579 return 0x1;
4580 }
4581 }
4582 }
4583 }
4584 if(source->kind == 19 && dest->kind == 8 && dest->_class && !strcmp(dest->_class->string, "ecere::com::Class"))
4585 return 0x1;
4586 if(doConversion)
4587 {
4588 if(source->kind == 8)
4589 {
4590 struct __ecereNameSpace__ecere__com__Class * _class;
4591
4592 for(_class = source->_class ? source->_class->registered : (((void *)0)); _class; _class = _class->base)
4593 {
4594 struct __ecereNameSpace__ecere__com__Property * convert;
4595
4596 for(convert = _class->conversions.first; convert; convert = convert->next)
4597 {
4598 if(convert->memberAccess == 1 || _class->module == privateModule)
4599 {
4600 struct Conversion * after = (conversions != (((void *)0))) ? conversions->last : (((void *)0));
4601
4602 if(!convert->dataType)
4603 convert->dataType = ProcessTypeString(convert->dataTypeString, 0x0);
4604 if(MatchTypes(convert->dataType, dest, conversions, (((void *)0)), (((void *)0)), 0x0, 0x1, 0x0, 0x1))
4605 {
4606 if(!conversions && !convert->Get)
4607 return 0x1;
4608 else if(conversions != (((void *)0)))
4609 {
4610 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))
4611 return 0x1;
4612 else
4613 {
4614 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv->isGet = 0x1, conv);
4615
4616 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(conversions, after, conv);
4617 return 0x1;
4618 }
4619 }
4620 }
4621 }
4622 }
4623 }
4624 }
4625 if(dest->kind == 8)
4626 {
4627 struct __ecereNameSpace__ecere__com__Class * _class;
4628
4629 for(_class = dest->_class ? dest->_class->registered : (((void *)0)); _class; _class = _class->base)
4630 {
4631 struct __ecereNameSpace__ecere__com__Property * convert;
4632
4633 for(convert = _class->conversions.first; convert; convert = convert->next)
4634 {
4635 if(convert->memberAccess == 1 || _class->module == privateModule)
4636 {
4637 if(!convert->dataType)
4638 convert->dataType = ProcessTypeString(convert->dataTypeString, 0x0);
4639 if(convert->dataType != dest && MatchTypes(source, convert->dataType, conversions, (((void *)0)), (((void *)0)), 0x1, 0x0, 0x0, 0x1))
4640 {
4641 if(!conversions && !convert->Set)
4642 return 0x1;
4643 else if(conversions != (((void *)0)))
4644 {
4645 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))
4646 return 0x1;
4647 else
4648 {
4649 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv);
4650
4651 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(conversions, conv);
4652 return 0x1;
4653 }
4654 }
4655 }
4656 }
4657 }
4658 }
4659 if(enumBaseType && dest->_class && dest->_class->registered && dest->_class->registered->type == 4)
4660 {
4661 if(!dest->_class->registered->dataType)
4662 dest->_class->registered->dataType = ProcessTypeString(dest->_class->registered->dataTypeString, 0x0);
4663 if(dest->_class->registered->dataType->kind == 8 || source->truth || dest->truth)
4664 {
4665 if(MatchTypes(source, dest->_class->registered->dataType, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
4666 {
4667 return 0x1;
4668 }
4669 }
4670 }
4671 }
4672 if(source->kind == 8)
4673 {
4674 struct __ecereNameSpace__ecere__com__Class * _class;
4675
4676 for(_class = source->_class ? source->_class->registered : (((void *)0)); _class; _class = _class->base)
4677 {
4678 struct __ecereNameSpace__ecere__com__Property * convert;
4679
4680 for(convert = _class->conversions.first; convert; convert = convert->next)
4681 {
4682 if(convert->memberAccess == 1 || _class->module == privateModule)
4683 {
4684 struct Conversion * after = (conversions != (((void *)0))) ? conversions->last : (((void *)0));
4685
4686 if(!convert->dataType)
4687 convert->dataType = ProcessTypeString(convert->dataTypeString, 0x0);
4688 if(convert->dataType != source && MatchTypes(convert->dataType, dest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x1))
4689 {
4690 if(!conversions && !convert->Get)
4691 return 0x1;
4692 else if(conversions != (((void *)0)))
4693 {
4694 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))
4695 return 0x1;
4696 else
4697 {
4698 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv->isGet = 0x1, conv);
4699
4700 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(conversions, after, conv);
4701 return 0x1;
4702 }
4703 }
4704 }
4705 }
4706 }
4707 }
4708 if(enumBaseType && source->_class && source->_class->registered && source->_class->registered->type == 4)
4709 {
4710 if(!source->_class->registered->dataType)
4711 source->_class->registered->dataType = ProcessTypeString(source->_class->registered->dataTypeString, 0x0);
4712 if(MatchTypes(source->_class->registered->dataType, dest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
4713 {
4714 return 0x1;
4715 }
4716 }
4717 }
4718 }
4719 if(source->kind == 8 || source->kind == 19)
4720 ;
4721 else if(dest->kind == source->kind && (dest->kind != 9 && dest->kind != 10 && dest->kind != 11 && dest->kind != 12 && dest->kind != 13 && dest->kind != 16))
4722 return 0x1;
4723 else if(dest->kind == 7 && source->kind == 6)
4724 return 0x1;
4725 else if(dest->kind == 2 && source->kind == 1)
4726 return 0x1;
4727 else if(dest->kind == 3 && (source->kind == 2 || source->kind == 1))
4728 return 0x1;
4729 else if(dest->kind == 4 && (source->kind == 2 || source->kind == 1 || source->kind == 3))
4730 return 0x1;
4731 else if(dest->kind == 22 && (source->kind == 2 || source->kind == 1 || source->kind == 3))
4732 return 0x1;
4733 else if(source->kind == 15 && (dest->kind == 3 || dest->kind == 2 || dest->kind == 1 || dest->kind == 5 || dest->kind == 4 || dest->kind == 22))
4734 return 0x1;
4735 else if(dest->kind == 15 && (source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 5 || source->kind == 4 || source->kind == 22))
4736 return 0x1;
4737 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)))
4738 {
4739 struct Type * paramSource, * paramDest;
4740
4741 if(dest->kind == 16)
4742 owningClassDest = dest->methodClass ? dest->methodClass : dest->method->_class;
4743 if(source->kind == 16)
4744 owningClassSource = source->methodClass ? source->methodClass : source->method->_class;
4745 if(dest->kind == 13 && dest->type->kind == 11)
4746 dest = dest->type;
4747 if(source->kind == 13 && source->type->kind == 11)
4748 source = source->type;
4749 if(dest->kind == 16)
4750 dest = dest->method->dataType;
4751 if(source->kind == 16)
4752 source = source->method->dataType;
4753 paramSource = source->params.first;
4754 if(paramSource && paramSource->kind == 0)
4755 paramSource = (((void *)0));
4756 paramDest = dest->params.first;
4757 if(paramDest && paramDest->kind == 0)
4758 paramDest = (((void *)0));
4759 if((dest->staticMethod || (!dest->thisClass && !owningClassDest)) && !(source->staticMethod || (!source->thisClass && !owningClassSource)))
4760 {
4761 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))))
4762 {
4763 if(paramDest && paramDest->kind == 8)
4764 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "method class must be derived from %s\n", (((void *)0))), paramDest->_class->string);
4765 else
4766 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "method class should not take an object\n", (((void *)0))));
4767 return 0x0;
4768 }
4769 paramDest = paramDest->next;
4770 }
4771 else if(!dest->staticMethod && (dest->thisClass || owningClassDest))
4772 {
4773 if((source->staticMethod || (!source->thisClass && !owningClassSource)))
4774 {
4775 if(dest->thisClass)
4776 {
4777 if(!paramSource || paramSource->kind != 8 || !__ecereNameSpace__ecere__com__eClass_IsDerived(paramSource->_class->registered, dest->thisClass->registered))
4778 {
4779 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "method class must be derived from %s\n", (((void *)0))), dest->thisClass->string);
4780 return 0x0;
4781 }
4782 }
4783 else
4784 {
4785 if(!paramSource || paramSource->kind != 8 || (owningClassDest && !__ecereNameSpace__ecere__com__eClass_IsDerived(paramSource->_class->registered, owningClassDest)))
4786 {
4787 if(owningClassDest)
4788 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "%s expected to be derived from method class\n", (((void *)0))), owningClassDest->fullName);
4789 else
4790 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "overriding class expected to be derived from method class\n", (((void *)0))));
4791 return 0x0;
4792 }
4793 }
4794 paramSource = paramSource->next;
4795 }
4796 else
4797 {
4798 if(dest->thisClass)
4799 {
4800 if(!__ecereNameSpace__ecere__com__eClass_IsDerived(source->thisClass ? source->thisClass->registered : owningClassSource, dest->thisClass->registered))
4801 {
4802 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "method class must be derived from %s\n", (((void *)0))), dest->thisClass->string);
4803 return 0x0;
4804 }
4805 }
4806 else
4807 {
4808 if(source->thisClass && source->thisClass->registered && owningClassDest && !__ecereNameSpace__ecere__com__eClass_IsDerived(source->thisClass->registered, owningClassDest))
4809 {
4810 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "%s expected to be derived from method class\n", (((void *)0))), source->thisClass->registered->fullName);
4811 return 0x0;
4812 }
4813 }
4814 }
4815 }
4816 if(!MatchTypes(source->returnType, dest->returnType, (((void *)0)), (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
4817 {
4818 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible return type for function\n", (((void *)0))));
4819 return 0x0;
4820 }
4821 for(; paramDest; paramDest = paramDest->next)
4822 {
4823 if(!paramSource)
4824 {
4825 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "not enough parameters\n", (((void *)0))));
4826 return 0x0;
4827 }
4828 {
4829 struct Type * paramDestType = paramDest;
4830 struct Type * paramSourceType = paramSource;
4831 struct Type * type = paramDestType;
4832
4833 if(paramDest->kind == 20 && paramDest->templateParameter->type == 0 && owningClassSource && paramSource->kind != 20)
4834 {
4835 int id = 0;
4836 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
4837 struct __ecereNameSpace__ecere__com__Class * sClass;
4838
4839 for(sClass = owningClassSource; sClass; sClass = sClass->base)
4840 {
4841 id = 0;
4842 if(sClass->templateClass)
4843 sClass = sClass->templateClass;
4844 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
4845 {
4846 if(curParam->type == 0 && !strcmp(type->templateParameter->identifier->string, curParam->name))
4847 {
4848 for(sClass = sClass->base; sClass; sClass = sClass->base)
4849 {
4850 if(sClass->templateClass)
4851 sClass = sClass->templateClass;
4852 id += sClass->templateParams.count;
4853 }
4854 break;
4855 }
4856 id++;
4857 }
4858 if(curParam)
4859 break;
4860 }
4861 if(curParam)
4862 {
4863 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = owningClassSource->templateArgs[id];
4864
4865 paramDestType = type = ProcessTypeString(arg.dataTypeString, 0x0);
4866 }
4867 }
4868 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)))
4869 {
4870 char type[1024];
4871
4872 type[0] = (char)0;
4873 PrintType(paramDest, type, 0x0, 0x1);
4874 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible parameter %s (expected %s)\n", (((void *)0))), paramSource->name, type);
4875 if(paramDestType != paramDest)
4876 FreeType(paramDestType);
4877 return 0x0;
4878 }
4879 if(paramDestType != paramDest)
4880 FreeType(paramDestType);
4881 }
4882 paramSource = paramSource->next;
4883 }
4884 if(paramSource)
4885 {
4886 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "too many parameters\n", (((void *)0))));
4887 return 0x0;
4888 }
4889 return 0x1;
4890 }
4891 else if((dest->kind == 11 || (dest->kind == 13 && dest->type->kind == 11) || dest->kind == 16) && (source->kind == 13 && source->type->kind == 0))
4892 {
4893 return 0x1;
4894 }
4895 else if((dest->kind == 13 || dest->kind == 12) && (source->kind == 12 || source->kind == 13))
4896 {
4897 if(MatchTypes(source->type, dest->type, (((void *)0)), (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
4898 return 0x1;
4899 }
4900 }
4901 return 0x0;
4902 }
4903
4904 static void FreeConvert(struct Conversion * convert)
4905 {
4906 if(convert->resultType)
4907 FreeType(convert->resultType);
4908 }
4909
4910 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__BTNamedLink;
4911
4912 struct __ecereNameSpace__ecere__com__BTNamedLink
4913 {
4914 char *  name;
4915 struct __ecereNameSpace__ecere__com__BTNamedLink * parent;
4916 struct __ecereNameSpace__ecere__com__BTNamedLink * left;
4917 struct __ecereNameSpace__ecere__com__BTNamedLink * right;
4918 int depth;
4919 void *  data;
4920 } __attribute__ ((gcc_struct));
4921
4922 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__EnumClassData;
4923
4924 struct __ecereNameSpace__ecere__com__EnumClassData
4925 {
4926 struct __ecereNameSpace__ecere__sys__OldList values;
4927 int largest;
4928 } __attribute__ ((gcc_struct));
4929
4930 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__NamedLink;
4931
4932 struct __ecereNameSpace__ecere__sys__NamedLink
4933 {
4934 struct __ecereNameSpace__ecere__sys__NamedLink * prev;
4935 struct __ecereNameSpace__ecere__sys__NamedLink * next;
4936 char *  name;
4937 void *  data;
4938 } __attribute__ ((gcc_struct));
4939
4940 extern void FreeExpContents(struct Expression * exp);
4941
4942 struct __ecereNameSpace__ecere__sys__BTNode * __ecereProp___ecereNameSpace__ecere__sys__BinaryTree_Get_first(struct __ecereNameSpace__ecere__sys__BinaryTree * this);
4943
4944 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp___ecereNameSpace__ecere__sys__BinaryTree_first;
4945
4946 struct __ecereNameSpace__ecere__sys__BTNode * __ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_next(struct __ecereNameSpace__ecere__sys__BTNode * this);
4947
4948 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp___ecereNameSpace__ecere__sys__BTNode_next;
4949
4950 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(struct __ecereNameSpace__ecere__sys__OldList * this, void (*  freeFn)(void * ));
4951
4952 unsigned int MatchWithEnums_NameSpace(struct __ecereNameSpace__ecere__com__NameSpace * nameSpace, struct Expression * sourceExp, struct Type * dest, char * string, struct __ecereNameSpace__ecere__sys__OldList * conversions)
4953 {
4954 struct __ecereNameSpace__ecere__com__BTNamedLink * link;
4955
4956 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)))
4957 {
4958 struct __ecereNameSpace__ecere__com__Class * _class = link->data;
4959
4960 if(_class->type == 4)
4961 {
4962 struct __ecereNameSpace__ecere__sys__OldList converts = 
4963 {
4964 0, 0, 0, 0, 0
4965 };
4966 struct Type * type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
4967
4968 type->kind = 8;
4969 if(!_class->symbol)
4970 _class->symbol = FindClass(_class->fullName);
4971 type->_class = _class->symbol;
4972 if(MatchTypes(type, dest, &converts, (((void *)0)), (((void *)0)), 0x1, 0x0, 0x0, 0x0))
4973 {
4974 struct __ecereNameSpace__ecere__sys__NamedLink * value;
4975 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
4976
4977 if(enumClass)
4978 {
4979 struct __ecereNameSpace__ecere__com__Class * baseClass;
4980
4981 for(baseClass = _class; baseClass && baseClass->type == 4; baseClass = baseClass->base)
4982 {
4983 struct __ecereNameSpace__ecere__com__EnumClassData * e = (baseClass ? ((void *)(((char *)baseClass->data) + enumClass->offsetClass)) : (((void *)0)));
4984
4985 for(value = e->values.first; value; value = value->next)
4986 {
4987 if(!strcmp(value->name, string))
4988 break;
4989 }
4990 if(value)
4991 {
4992 FreeExpContents(sourceExp);
4993 FreeType(sourceExp->expType);
4994 sourceExp->isConstant = 0x1;
4995 sourceExp->expType = MkClassType(baseClass->fullName);
4996 {
4997 char constant[256];
4998
4999 sourceExp->type = 2;
5000 if(!strcmp(baseClass->dataTypeString, "int"))
5001 sprintf(constant, "%d", value->data);
5002 else
5003 sprintf(constant, "0x%X", value->data);
5004 sourceExp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
5005 }
5006 while(converts.first)
5007 {
5008 struct Conversion * convert = converts.first;
5009
5010 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(&converts, convert);
5011 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(conversions, convert);
5012 }
5013 ((type ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(type) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(type)) : 0), type = 0);
5014 return 0x1;
5015 }
5016 }
5017 }
5018 }
5019 if(converts.first)
5020 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(&converts, FreeConvert);
5021 ((type ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(type) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(type)) : 0), type = 0);
5022 }
5023 }
5024 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)))
5025 if(MatchWithEnums_NameSpace(nameSpace, sourceExp, dest, string, conversions))
5026 return 0x1;
5027 return 0x0;
5028 }
5029
5030 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__SubModule;
5031
5032 struct __ecereNameSpace__ecere__com__SubModule
5033 {
5034 struct __ecereNameSpace__ecere__com__SubModule * prev;
5035 struct __ecereNameSpace__ecere__com__SubModule * next;
5036 struct __ecereNameSpace__ecere__com__Instance * module;
5037 int importMode;
5038 } __attribute__ ((gcc_struct));
5039
5040 unsigned int ModuleVisibility(struct __ecereNameSpace__ecere__com__Instance * searchIn, struct __ecereNameSpace__ecere__com__Instance * searchFor)
5041 {
5042 struct __ecereNameSpace__ecere__com__SubModule * subModule;
5043
5044 if(searchFor == searchIn)
5045 return 0x1;
5046 for(subModule = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)searchIn + 12)))->modules.first; subModule; subModule = subModule->next)
5047 {
5048 if(subModule->importMode == 1 || searchIn == ((struct __ecereNameSpace__ecere__com__Module *)(((char *)searchIn + 12)))->application)
5049 {
5050 if(ModuleVisibility(subModule->module, searchFor))
5051 return 0x1;
5052 }
5053 }
5054 return 0x0;
5055 }
5056
5057 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Application;
5058
5059 struct __ecereNameSpace__ecere__com__Application
5060 {
5061 int argc;
5062 char * *  argv;
5063 int exitCode;
5064 unsigned int isGUIApp;
5065 struct __ecereNameSpace__ecere__sys__OldList allModules;
5066 char *  parsedCommand;
5067 struct __ecereNameSpace__ecere__com__NameSpace systemNameSpace;
5068 } __attribute__ ((gcc_struct));
5069
5070 unsigned int MatchWithEnums_Module(struct __ecereNameSpace__ecere__com__Instance * mainModule, struct Expression * sourceExp, struct Type * dest, char * string, struct __ecereNameSpace__ecere__sys__OldList * conversions)
5071 {
5072 struct __ecereNameSpace__ecere__com__Instance * module;
5073
5074 if(MatchWithEnums_NameSpace(&((struct __ecereNameSpace__ecere__com__Application *)(((char *)((struct __ecereNameSpace__ecere__com__Module *)(((char *)mainModule + 12)))->application + 300)))->systemNameSpace, sourceExp, dest, string, conversions))
5075 return 0x1;
5076 if(MatchWithEnums_NameSpace(&((struct __ecereNameSpace__ecere__com__Module *)(((char *)((struct __ecereNameSpace__ecere__com__Module *)(((char *)mainModule + 12)))->application + 12)))->privateNameSpace, sourceExp, dest, string, conversions))
5077 return 0x1;
5078 if(MatchWithEnums_NameSpace(&((struct __ecereNameSpace__ecere__com__Module *)(((char *)((struct __ecereNameSpace__ecere__com__Module *)(((char *)mainModule + 12)))->application + 12)))->publicNameSpace, sourceExp, dest, string, conversions))
5079 return 0x1;
5080 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)
5081 {
5082 if(ModuleVisibility(mainModule, module) && MatchWithEnums_NameSpace(&((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + 12)))->publicNameSpace, sourceExp, dest, string, conversions))
5083 return 0x1;
5084 }
5085 return 0x0;
5086 }
5087
5088 extern unsigned long strtoul(const char *  nptr, char * *  endptr, int base);
5089
5090 void ReadString(char *  output, char *  string);
5091
5092 extern struct Specifier * MkEnum(struct Identifier * id, struct __ecereNameSpace__ecere__sys__OldList * list);
5093
5094 extern struct TypeName * QMkClass(char *  spec, struct Declarator * decl);
5095
5096 extern struct Expression * MkExpBrackets(struct __ecereNameSpace__ecere__sys__OldList * expressions);
5097
5098 unsigned int MatchTypeExpression(struct Expression * sourceExp, struct Type * dest, struct __ecereNameSpace__ecere__sys__OldList * conversions, unsigned int skipUnitBla)
5099 {
5100 void * __ecereTemp1;
5101 struct Type * source = sourceExp->expType;
5102 struct Type * realDest = dest;
5103
5104 if(dest->kind == 13 && sourceExp->type == 2 && !strtoul(sourceExp->constant, (((void *)0)), 0))
5105 return 0x1;
5106 if(!skipUnitBla && source && dest && source->kind == 8 && dest->kind == 8)
5107 {
5108 if(source->_class && source->_class->registered && source->_class->registered->type == 3)
5109 {
5110 struct __ecereNameSpace__ecere__com__Class * sourceBase, * destBase;
5111
5112 for(sourceBase = source->_class->registered; sourceBase && sourceBase->base && sourceBase->base->type != 1000; sourceBase = sourceBase->base)
5113 ;
5114 for(destBase = dest->_class->registered; destBase && destBase->base && destBase->base->type != 1000; destBase = destBase->base)
5115 ;
5116 if(sourceBase == destBase)
5117 return 0x1;
5118 }
5119 }
5120 if(source)
5121 {
5122 struct __ecereNameSpace__ecere__sys__OldList * specs;
5123 unsigned int flag = 0x0;
5124 long long value = (((int)0x7fffffff));
5125
5126 source->refCount++;
5127 dest->refCount++;
5128 if(sourceExp->type == 2)
5129 {
5130 if(source->isSigned)
5131 value = strtoll(sourceExp->constant, (((void *)0)), 0);
5132 else
5133 value = strtoull(sourceExp->constant, (((void *)0)), 0);
5134 }
5135 else if(sourceExp->type == 4 && sourceExp->op.op == '-' && !sourceExp->op.exp1 && sourceExp->op.exp2 && sourceExp->op.exp2->type == 2)
5136 {
5137 if(source->isSigned)
5138 value = -strtoll(sourceExp->op.exp2->constant, (((void *)0)), 0);
5139 else
5140 value = -strtoull(sourceExp->op.exp2->constant, (((void *)0)), 0);
5141 }
5142 if(dest->kind != 8 && source->kind == 8 && source->_class && source->_class->registered && !strcmp(source->_class->registered->fullName, "ecere::com::unichar"))
5143 {
5144 FreeType(source);
5145 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));
5146 }
5147 if(dest->kind == 8)
5148 {
5149 struct __ecereNameSpace__ecere__com__Class * _class = dest->_class ? dest->_class->registered : (((void *)0));
5150
5151 if(_class && _class->type == 3)
5152 {
5153 if(source->kind != 8)
5154 {
5155 struct Type * tempType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5156 struct Type * tempDest, * tempSource;
5157
5158 for(; _class->base->type != 1000; _class = _class->base)
5159 ;
5160 tempSource = dest;
5161 tempDest = tempType;
5162 tempType->kind = 8;
5163 if(!_class->symbol)
5164 _class->symbol = FindClass(_class->fullName);
5165 tempType->_class = _class->symbol;
5166 tempType->truth = dest->truth;
5167 if(tempType->_class)
5168 MatchTypes(tempSource, tempDest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0);
5169 FreeType(sourceExp->expType);
5170 sourceExp->expType = dest;
5171 dest->refCount++;
5172 flag = 0x1;
5173 ((tempType ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(tempType) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(tempType)) : 0), tempType = 0);
5174 }
5175 }
5176 if(_class && _class->type == 2 && source->kind != 8)
5177 {
5178 if(!dest->_class->registered->dataType)
5179 dest->_class->registered->dataType = ProcessTypeString(dest->_class->registered->dataTypeString, 0x0);
5180 if(MatchTypes(source, dest->_class->registered->dataType, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
5181 {
5182 FreeType(source);
5183 FreeType(sourceExp->expType);
5184 source = sourceExp->expType = MkClassType(dest->_class->string);
5185 source->refCount++;
5186 }
5187 }
5188 if(_class && !strcmp(_class->fullName, "ecere::com::Class") && source->kind == 13 && source->type && source->type->kind == 1 && sourceExp->type == 3)
5189 {
5190 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
5191 struct Declarator * decl;
5192 char string[1024];
5193
5194 ReadString(string, sourceExp->string);
5195 decl = SpecDeclFromString(string, specs, (((void *)0)));
5196 FreeExpContents(sourceExp);
5197 FreeType(sourceExp->expType);
5198 sourceExp->type = 26;
5199 sourceExp->_classExp.specifiers = specs;
5200 sourceExp->_classExp.decl = decl;
5201 sourceExp->expType = dest;
5202 dest->refCount++;
5203 FreeType(source);
5204 FreeType(dest);
5205 return 0x1;
5206 }
5207 }
5208 else if(source->kind == 8)
5209 {
5210 struct __ecereNameSpace__ecere__com__Class * _class = source->_class ? source->_class->registered : (((void *)0));
5211
5212 if(_class && (_class->type == 3 || !strcmp(_class->fullName, "bool") || _class->type == 2))
5213 {
5214 if(dest->kind != 8)
5215 {
5216 struct Type * tempType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5217 struct Type * tempDest, * tempSource;
5218
5219 if(!source->_class->registered->dataType)
5220 source->_class->registered->dataType = ProcessTypeString(source->_class->registered->dataTypeString, 0x0);
5221 for(; _class->base->type != 1000; _class = _class->base)
5222 ;
5223 tempDest = source;
5224 tempSource = tempType;
5225 tempType->kind = 8;
5226 tempType->_class = FindClass(_class->fullName);
5227 tempType->truth = source->truth;
5228 tempType->classObjectType = source->classObjectType;
5229 if(tempType->_class)
5230 MatchTypes(tempSource, tempDest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0);
5231 if(conversions->last)
5232 {
5233 ((struct Conversion *)conversions->last)->resultType = dest;
5234 dest->refCount++;
5235 }
5236 FreeType(sourceExp->expType);
5237 sourceExp->expType = MkClassType(_class->fullName);
5238 sourceExp->expType->truth = source->truth;
5239 sourceExp->expType->classObjectType = source->classObjectType;
5240 if(!sourceExp->destType)
5241 {
5242 FreeType(sourceExp->destType);
5243 sourceExp->destType = sourceExp->expType;
5244 if(sourceExp->expType)
5245 sourceExp->expType->refCount++;
5246 }
5247 if(!_class->dataType)
5248 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
5249 FreeType(dest);
5250 dest = MkClassType(source->_class->string);
5251 dest->truth = source->truth;
5252 dest->classObjectType = source->classObjectType;
5253 FreeType(source);
5254 source = _class->dataType;
5255 source->refCount++;
5256 ((tempType ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(tempType) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(tempType)) : 0), tempType = 0);
5257 }
5258 }
5259 }
5260 if(!flag)
5261 {
5262 if(MatchTypes(source, dest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
5263 {
5264 FreeType(source);
5265 FreeType(dest);
5266 return 0x1;
5267 }
5268 }
5269 if(dest->kind == 8)
5270 {
5271 struct __ecereNameSpace__ecere__com__Class * _class = dest->_class ? dest->_class->registered : (((void *)0));
5272
5273 if(_class && !dest->truth && (_class->type == 3 || !strcmp(_class->fullName, "bool") || (_class->type != 1 && !value && source->kind == 3) || _class->type == 2))
5274 {
5275 if(_class->type == 0 || _class->type == 5)
5276 {
5277 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
5278
5279 *newExp = *sourceExp;
5280 if(sourceExp->destType)
5281 sourceExp->destType->refCount++;
5282 if(sourceExp->expType)
5283 sourceExp->expType->refCount++;
5284 sourceExp->type = 11;
5285 sourceExp->cast.typeName = MkTypeName(MkListOne(MkSpecifier(VOID)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0))));
5286 sourceExp->cast.exp = newExp;
5287 FreeType(sourceExp->expType);
5288 sourceExp->expType = (((void *)0));
5289 ProcessExpressionType(sourceExp);
5290 if(!inCompiler)
5291 {
5292 FreeType(sourceExp->expType);
5293 sourceExp->expType = dest;
5294 }
5295 FreeType(source);
5296 if(inCompiler)
5297 FreeType(dest);
5298 return 0x1;
5299 }
5300 if(!_class->dataType)
5301 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
5302 FreeType(dest);
5303 dest = _class->dataType;
5304 dest->refCount++;
5305 }
5306 if(dest->kind == 7 && (source->kind == 7 || source->kind == 6 || dest->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 1))
5307 {
5308 specs = MkListOne(MkSpecifier(DOUBLE));
5309 }
5310 else if(dest->kind == 6 && (source->kind == 6 || dest->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 7))
5311 {
5312 specs = MkListOne(MkSpecifier(FLOAT));
5313 }
5314 else if(dest->kind == 4 && (source->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 6 || source->kind == 7))
5315 {
5316 specs = MkList();
5317 if(!dest->isSigned)
5318 ListAdd(specs, MkSpecifier(UNSIGNED));
5319 ListAdd(specs, MkSpecifier(INT64));
5320 }
5321 else if(dest->kind == 3 && (source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 6 || source->kind == 7))
5322 {
5323 specs = MkList();
5324 if(!dest->isSigned)
5325 ListAdd(specs, MkSpecifier(UNSIGNED));
5326 ListAdd(specs, MkSpecifier(INT));
5327 }
5328 else if(dest->kind == 2 && (source->kind == 2 || source->kind == 1 || source->kind == 3 || source->kind == 6 || source->kind == 7))
5329 {
5330 specs = MkList();
5331 if(!dest->isSigned)
5332 ListAdd(specs, MkSpecifier(UNSIGNED));
5333 ListAdd(specs, MkSpecifier(SHORT));
5334 }
5335 else if(dest->kind == 1 && (source->kind == 1 || source->kind == 2 || source->kind == 3 || source->kind == 6 || source->kind == 7))
5336 {
5337 specs = MkList();
5338 if(!dest->isSigned)
5339 ListAdd(specs, MkSpecifier(UNSIGNED));
5340 ListAdd(specs, MkSpecifier(CHAR));
5341 }
5342 else
5343 {
5344 FreeType(source);
5345 FreeType(dest);
5346 return 0x0;
5347 }
5348 }
5349 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))
5350 {
5351 specs = MkListOne(MkSpecifier(DOUBLE));
5352 }
5353 else if(dest->kind == 6 && (source->kind == 6 || source->kind == 15 || source->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 1))
5354 {
5355 specs = MkListOne(MkSpecifier(FLOAT));
5356 }
5357 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)))
5358 {
5359 specs = MkList();
5360 if(!dest->isSigned)
5361 ListAdd(specs, MkSpecifier(UNSIGNED));
5362 ListAdd(specs, MkSpecifier(CHAR));
5363 }
5364 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)))))
5365 {
5366 specs = MkList();
5367 if(!dest->isSigned)
5368 ListAdd(specs, MkSpecifier(UNSIGNED));
5369 ListAdd(specs, MkSpecifier(SHORT));
5370 }
5371 else if(dest->kind == 3 && (source->kind == 15 || source->kind == 2 || source->kind == 1 || source->kind == 3))
5372 {
5373 specs = MkList();
5374 if(!dest->isSigned)
5375 ListAdd(specs, MkSpecifier(UNSIGNED));
5376 ListAdd(specs, MkSpecifier(INT));
5377 }
5378 else if(dest->kind == 4 && (source->kind == 15 || source->kind == 2 || source->kind == 1 || source->kind == 3 || source->kind == 4))
5379 {
5380 specs = MkList();
5381 if(!dest->isSigned)
5382 ListAdd(specs, MkSpecifier(UNSIGNED));
5383 ListAdd(specs, MkSpecifier(INT64));
5384 }
5385 else if(dest->kind == 15 && (source->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 1))
5386 {
5387 specs = MkListOne(MkEnum(MkIdentifier(dest->enumName), (((void *)0))));
5388 }
5389 else
5390 {
5391 FreeType(source);
5392 FreeType(dest);
5393 return 0x0;
5394 }
5395 if(!flag)
5396 {
5397 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
5398
5399 *newExp = *sourceExp;
5400 newExp->prev = (((void *)0));
5401 newExp->next = (((void *)0));
5402 if(sourceExp->destType)
5403 sourceExp->destType->refCount++;
5404 if(sourceExp->expType)
5405 sourceExp->expType->refCount++;
5406 sourceExp->type = 11;
5407 if(realDest->kind == 8)
5408 {
5409 sourceExp->cast.typeName = QMkClass(realDest->_class->string, (((void *)0)));
5410 FreeList(specs, FreeSpecifier);
5411 }
5412 else
5413 sourceExp->cast.typeName = MkTypeName(specs, (((void *)0)));
5414 if(newExp->type == 4)
5415 {
5416 sourceExp->cast.exp = MkExpBrackets(MkListOne(newExp));
5417 }
5418 else
5419 sourceExp->cast.exp = newExp;
5420 FreeType(sourceExp->expType);
5421 sourceExp->expType = (((void *)0));
5422 ProcessExpressionType(sourceExp);
5423 }
5424 else
5425 FreeList(specs, FreeSpecifier);
5426 FreeType(dest);
5427 FreeType(source);
5428 return 0x1;
5429 }
5430 else
5431 {
5432 while((sourceExp->type == 5 || sourceExp->type == 34) && sourceExp->list)
5433 sourceExp = (*sourceExp->list).last;
5434 if(sourceExp->type == 0)
5435 {
5436 struct Identifier * id = sourceExp->identifier;
5437
5438 if(dest->kind == 8)
5439 {
5440 if(dest->_class && dest->_class->registered && dest->_class->registered->type == 4)
5441 {
5442 struct __ecereNameSpace__ecere__com__Class * _class = dest->_class->registered;
5443 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
5444
5445 if(enumClass)
5446 {
5447 for(; _class && _class->type == 4; _class = _class->base)
5448 {
5449 struct __ecereNameSpace__ecere__sys__NamedLink * value;
5450 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
5451
5452 for(value = e->values.first; value; value = value->next)
5453 {
5454 if(!strcmp(value->name, id->string))
5455 break;
5456 }
5457 if(value)
5458 {
5459 FreeExpContents(sourceExp);
5460 FreeType(sourceExp->expType);
5461 sourceExp->isConstant = 0x1;
5462 sourceExp->expType = MkClassType(_class->fullName);
5463 {
5464 char constant[256];
5465
5466 sourceExp->type = 2;
5467 if(_class->dataTypeString && !strcmp(_class->dataTypeString, "int"))
5468 sprintf(constant, "%d", value->data);
5469 else
5470 sprintf(constant, "0x%X", value->data);
5471 sourceExp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
5472 }
5473 return 0x1;
5474 }
5475 }
5476 }
5477 }
5478 }
5479 if(dest->classObjectType != 2 && dest->kind == 8 && MatchWithEnums_Module(privateModule, sourceExp, dest, id->string, conversions))
5480 return 0x1;
5481 }
5482 }
5483 return 0x0;
5484 }
5485
5486 static unsigned int IntAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5487 {
5488 int value2 = op2->i;
5489
5490 exp->type = 2;
5491 exp->string = PrintInt(op1->i + value2);
5492 if(!exp->expType)
5493 {
5494 exp->expType = op1->type;
5495 if(op1->type)
5496 op1->type->refCount++;
5497 }
5498 return 0x1;
5499 }
5500
5501 static unsigned int UIntAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5502 {
5503 unsigned int value2 = op2->ui;
5504
5505 exp->type = 2;
5506 exp->string = PrintUInt(op1->ui + value2);
5507 if(!exp->expType)
5508 {
5509 exp->expType = op1->type;
5510 if(op1->type)
5511 op1->type->refCount++;
5512 }
5513 return 0x1;
5514 }
5515
5516 static unsigned int ShortAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5517 {
5518 short value2 = op2->s;
5519
5520 exp->type = 2;
5521 exp->string = PrintShort(op1->s + value2);
5522 if(!exp->expType)
5523 {
5524 exp->expType = op1->type;
5525 if(op1->type)
5526 op1->type->refCount++;
5527 }
5528 return 0x1;
5529 }
5530
5531 static unsigned int UShortAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5532 {
5533 unsigned short value2 = op2->us;
5534
5535 exp->type = 2;
5536 exp->string = PrintUShort(op1->us + value2);
5537 if(!exp->expType)
5538 {
5539 exp->expType = op1->type;
5540 if(op1->type)
5541 op1->type->refCount++;
5542 }
5543 return 0x1;
5544 }
5545
5546 static unsigned int CharAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5547 {
5548 char value2 = op2->c;
5549
5550 exp->type = 2;
5551 exp->string = PrintChar(op1->c + value2);
5552 if(!exp->expType)
5553 {
5554 exp->expType = op1->type;
5555 if(op1->type)
5556 op1->type->refCount++;
5557 }
5558 return 0x1;
5559 }
5560
5561 static unsigned int UCharAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5562 {
5563 unsigned char value2 = op2->uc;
5564
5565 exp->type = 2;
5566 exp->string = PrintUChar(op1->uc + value2);
5567 if(!exp->expType)
5568 {
5569 exp->expType = op1->type;
5570 if(op1->type)
5571 op1->type->refCount++;
5572 }
5573 return 0x1;
5574 }
5575
5576 static unsigned int FloatAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5577 {
5578 float value2 = op2->f;
5579
5580 exp->type = 2;
5581 exp->string = PrintFloat(op1->f + value2);
5582 if(!exp->expType)
5583 {
5584 exp->expType = op1->type;
5585 if(op1->type)
5586 op1->type->refCount++;
5587 }
5588 return 0x1;
5589 }
5590
5591 static unsigned int DoubleAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5592 {
5593 double value2 = op2->d;
5594
5595 exp->type = 2;
5596 exp->string = PrintDouble(op1->d + value2);
5597 if(!exp->expType)
5598 {
5599 exp->expType = op1->type;
5600 if(op1->type)
5601 op1->type->refCount++;
5602 }
5603 return 0x1;
5604 }
5605
5606 static unsigned int IntSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5607 {
5608 int value2 = op2->i;
5609
5610 exp->type = 2;
5611 exp->string = PrintInt(op1->i - value2);
5612 if(!exp->expType)
5613 {
5614 exp->expType = op1->type;
5615 if(op1->type)
5616 op1->type->refCount++;
5617 }
5618 return 0x1;
5619 }
5620
5621 static unsigned int UIntSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5622 {
5623 unsigned int value2 = op2->ui;
5624
5625 exp->type = 2;
5626 exp->string = PrintUInt(op1->ui - value2);
5627 if(!exp->expType)
5628 {
5629 exp->expType = op1->type;
5630 if(op1->type)
5631 op1->type->refCount++;
5632 }
5633 return 0x1;
5634 }
5635
5636 static unsigned int ShortSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5637 {
5638 short value2 = op2->s;
5639
5640 exp->type = 2;
5641 exp->string = PrintShort(op1->s - value2);
5642 if(!exp->expType)
5643 {
5644 exp->expType = op1->type;
5645 if(op1->type)
5646 op1->type->refCount++;
5647 }
5648 return 0x1;
5649 }
5650
5651 static unsigned int UShortSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5652 {
5653 unsigned short value2 = op2->us;
5654
5655 exp->type = 2;
5656 exp->string = PrintUShort(op1->us - value2);
5657 if(!exp->expType)
5658 {
5659 exp->expType = op1->type;
5660 if(op1->type)
5661 op1->type->refCount++;
5662 }
5663 return 0x1;
5664 }
5665
5666 static unsigned int CharSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5667 {
5668 char value2 = op2->c;
5669
5670 exp->type = 2;
5671 exp->string = PrintChar(op1->c - value2);
5672 if(!exp->expType)
5673 {
5674 exp->expType = op1->type;
5675 if(op1->type)
5676 op1->type->refCount++;
5677 }
5678 return 0x1;
5679 }
5680
5681 static unsigned int UCharSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5682 {
5683 unsigned char value2 = op2->uc;
5684
5685 exp->type = 2;
5686 exp->string = PrintUChar(op1->uc - value2);
5687 if(!exp->expType)
5688 {
5689 exp->expType = op1->type;
5690 if(op1->type)
5691 op1->type->refCount++;
5692 }
5693 return 0x1;
5694 }
5695
5696 static unsigned int FloatSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5697 {
5698 float value2 = op2->f;
5699
5700 exp->type = 2;
5701 exp->string = PrintFloat(op1->f - value2);
5702 if(!exp->expType)
5703 {
5704 exp->expType = op1->type;
5705 if(op1->type)
5706 op1->type->refCount++;
5707 }
5708 return 0x1;
5709 }
5710
5711 static unsigned int DoubleSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5712 {
5713 double value2 = op2->d;
5714
5715 exp->type = 2;
5716 exp->string = PrintDouble(op1->d - value2);
5717 if(!exp->expType)
5718 {
5719 exp->expType = op1->type;
5720 if(op1->type)
5721 op1->type->refCount++;
5722 }
5723 return 0x1;
5724 }
5725
5726 static unsigned int IntMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5727 {
5728 int value2 = op2->i;
5729
5730 exp->type = 2;
5731 exp->string = PrintInt(op1->i * value2);
5732 if(!exp->expType)
5733 {
5734 exp->expType = op1->type;
5735 if(op1->type)
5736 op1->type->refCount++;
5737 }
5738 return 0x1;
5739 }
5740
5741 static unsigned int UIntMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5742 {
5743 unsigned int value2 = op2->ui;
5744
5745 exp->type = 2;
5746 exp->string = PrintUInt(op1->ui * value2);
5747 if(!exp->expType)
5748 {
5749 exp->expType = op1->type;
5750 if(op1->type)
5751 op1->type->refCount++;
5752 }
5753 return 0x1;
5754 }
5755
5756 static unsigned int ShortMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5757 {
5758 short value2 = op2->s;
5759
5760 exp->type = 2;
5761 exp->string = PrintShort(op1->s * value2);
5762 if(!exp->expType)
5763 {
5764 exp->expType = op1->type;
5765 if(op1->type)
5766 op1->type->refCount++;
5767 }
5768 return 0x1;
5769 }
5770
5771 static unsigned int UShortMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5772 {
5773 unsigned short value2 = op2->us;
5774
5775 exp->type = 2;
5776 exp->string = PrintUShort(op1->us * value2);
5777 if(!exp->expType)
5778 {
5779 exp->expType = op1->type;
5780 if(op1->type)
5781 op1->type->refCount++;
5782 }
5783 return 0x1;
5784 }
5785
5786 static unsigned int CharMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5787 {
5788 char value2 = op2->c;
5789
5790 exp->type = 2;
5791 exp->string = PrintChar(op1->c * value2);
5792 if(!exp->expType)
5793 {
5794 exp->expType = op1->type;
5795 if(op1->type)
5796 op1->type->refCount++;
5797 }
5798 return 0x1;
5799 }
5800
5801 static unsigned int UCharMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5802 {
5803 unsigned char value2 = op2->uc;
5804
5805 exp->type = 2;
5806 exp->string = PrintUChar(op1->uc * value2);
5807 if(!exp->expType)
5808 {
5809 exp->expType = op1->type;
5810 if(op1->type)
5811 op1->type->refCount++;
5812 }
5813 return 0x1;
5814 }
5815
5816 static unsigned int FloatMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5817 {
5818 float value2 = op2->f;
5819
5820 exp->type = 2;
5821 exp->string = PrintFloat(op1->f * value2);
5822 if(!exp->expType)
5823 {
5824 exp->expType = op1->type;
5825 if(op1->type)
5826 op1->type->refCount++;
5827 }
5828 return 0x1;
5829 }
5830
5831 static unsigned int DoubleMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5832 {
5833 double value2 = op2->d;
5834
5835 exp->type = 2;
5836 exp->string = PrintDouble(op1->d * value2);
5837 if(!exp->expType)
5838 {
5839 exp->expType = op1->type;
5840 if(op1->type)
5841 op1->type->refCount++;
5842 }
5843 return 0x1;
5844 }
5845
5846 static unsigned int IntDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5847 {
5848 int value2 = op2->i;
5849
5850 exp->type = 2;
5851 exp->string = PrintInt(value2 ? (op1->i / value2) : 0);
5852 if(!exp->expType)
5853 {
5854 exp->expType = op1->type;
5855 if(op1->type)
5856 op1->type->refCount++;
5857 }
5858 return 0x1;
5859 }
5860
5861 static unsigned int UIntDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5862 {
5863 unsigned int value2 = op2->ui;
5864
5865 exp->type = 2;
5866 exp->string = PrintUInt(value2 ? (op1->ui / value2) : 0);
5867 if(!exp->expType)
5868 {
5869 exp->expType = op1->type;
5870 if(op1->type)
5871 op1->type->refCount++;
5872 }
5873 return 0x1;
5874 }
5875
5876 static unsigned int ShortDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5877 {
5878 short value2 = op2->s;
5879
5880 exp->type = 2;
5881 exp->string = PrintShort(value2 ? (op1->s / value2) : (short)0);
5882 if(!exp->expType)
5883 {
5884 exp->expType = op1->type;
5885 if(op1->type)
5886 op1->type->refCount++;
5887 }
5888 return 0x1;
5889 }
5890
5891 static unsigned int UShortDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5892 {
5893 unsigned short value2 = op2->us;
5894
5895 exp->type = 2;
5896 exp->string = PrintUShort(value2 ? (op1->us / value2) : (unsigned short)0);
5897 if(!exp->expType)
5898 {
5899 exp->expType = op1->type;
5900 if(op1->type)
5901 op1->type->refCount++;
5902 }
5903 return 0x1;
5904 }
5905
5906 static unsigned int CharDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5907 {
5908 char value2 = op2->c;
5909
5910 exp->type = 2;
5911 exp->string = PrintChar(value2 ? (op1->c / value2) : (char)0);
5912 if(!exp->expType)
5913 {
5914 exp->expType = op1->type;
5915 if(op1->type)
5916 op1->type->refCount++;
5917 }
5918 return 0x1;
5919 }
5920
5921 static unsigned int UCharDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5922 {
5923 unsigned char value2 = op2->uc;
5924
5925 exp->type = 2;
5926 exp->string = PrintUChar(value2 ? (op1->uc / value2) : (unsigned char)0);
5927 if(!exp->expType)
5928 {
5929 exp->expType = op1->type;
5930 if(op1->type)
5931 op1->type->refCount++;
5932 }
5933 return 0x1;
5934 }
5935
5936 static unsigned int FloatDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5937 {
5938 float value2 = op2->f;
5939
5940 exp->type = 2;
5941 exp->string = PrintFloat(value2 ? (op1->f / value2) : (float)0);
5942 if(!exp->expType)
5943 {
5944 exp->expType = op1->type;
5945 if(op1->type)
5946 op1->type->refCount++;
5947 }
5948 return 0x1;
5949 }
5950
5951 static unsigned int DoubleDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5952 {
5953 double value2 = op2->d;
5954
5955 exp->type = 2;
5956 exp->string = PrintDouble(value2 ? (op1->d / value2) : (double)0);
5957 if(!exp->expType)
5958 {
5959 exp->expType = op1->type;
5960 if(op1->type)
5961 op1->type->refCount++;
5962 }
5963 return 0x1;
5964 }
5965
5966 static unsigned int IntMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5967 {
5968 int value2 = op2->i;
5969
5970 exp->type = 2;
5971 exp->string = PrintInt(value2 ? (op1->i % value2) : 0);
5972 if(!exp->expType)
5973 {
5974 exp->expType = op1->type;
5975 if(op1->type)
5976 op1->type->refCount++;
5977 }
5978 return 0x1;
5979 }
5980
5981 static unsigned int UIntMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5982 {
5983 unsigned int value2 = op2->ui;
5984
5985 exp->type = 2;
5986 exp->string = PrintUInt(value2 ? (op1->ui % value2) : 0);
5987 if(!exp->expType)
5988 {
5989 exp->expType = op1->type;
5990 if(op1->type)
5991 op1->type->refCount++;
5992 }
5993 return 0x1;
5994 }
5995
5996 static unsigned int ShortMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5997 {
5998 short value2 = op2->s;
5999
6000 exp->type = 2;
6001 exp->string = PrintShort(value2 ? (op1->s % value2) : (short)0);
6002 if(!exp->expType)
6003 {
6004 exp->expType = op1->type;
6005 if(op1->type)
6006 op1->type->refCount++;
6007 }
6008 return 0x1;
6009 }
6010
6011 static unsigned int UShortMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6012 {
6013 unsigned short value2 = op2->us;
6014
6015 exp->type = 2;
6016 exp->string = PrintUShort(value2 ? (op1->us % value2) : (unsigned short)0);
6017 if(!exp->expType)
6018 {
6019 exp->expType = op1->type;
6020 if(op1->type)
6021 op1->type->refCount++;
6022 }
6023 return 0x1;
6024 }
6025
6026 static unsigned int CharMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6027 {
6028 char value2 = op2->c;
6029
6030 exp->type = 2;
6031 exp->string = PrintChar(value2 ? (op1->c % value2) : (char)0);
6032 if(!exp->expType)
6033 {
6034 exp->expType = op1->type;
6035 if(op1->type)
6036 op1->type->refCount++;
6037 }
6038 return 0x1;
6039 }
6040
6041 static unsigned int UCharMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6042 {
6043 unsigned char value2 = op2->uc;
6044
6045 exp->type = 2;
6046 exp->string = PrintUChar(value2 ? (op1->uc % value2) : (unsigned char)0);
6047 if(!exp->expType)
6048 {
6049 exp->expType = op1->type;
6050 if(op1->type)
6051 op1->type->refCount++;
6052 }
6053 return 0x1;
6054 }
6055
6056 static unsigned int IntNeg(struct Expression * exp, struct Operand * op1)
6057 {
6058 exp->type = 2;
6059 exp->string = PrintInt(-op1->i);
6060 if(!exp->expType)
6061 {
6062 exp->expType = op1->type;
6063 if(op1->type)
6064 op1->type->refCount++;
6065 }
6066 return 0x1;
6067 }
6068
6069 static unsigned int UIntNeg(struct Expression * exp, struct Operand * op1)
6070 {
6071 exp->type = 2;
6072 exp->string = PrintUInt(-op1->ui);
6073 if(!exp->expType)
6074 {
6075 exp->expType = op1->type;
6076 if(op1->type)
6077 op1->type->refCount++;
6078 }
6079 return 0x1;
6080 }
6081
6082 static unsigned int ShortNeg(struct Expression * exp, struct Operand * op1)
6083 {
6084 exp->type = 2;
6085 exp->string = PrintShort(-op1->s);
6086 if(!exp->expType)
6087 {
6088 exp->expType = op1->type;
6089 if(op1->type)
6090 op1->type->refCount++;
6091 }
6092 return 0x1;
6093 }
6094
6095 static unsigned int UShortNeg(struct Expression * exp, struct Operand * op1)
6096 {
6097 exp->type = 2;
6098 exp->string = PrintUShort(-op1->us);
6099 if(!exp->expType)
6100 {
6101 exp->expType = op1->type;
6102 if(op1->type)
6103 op1->type->refCount++;
6104 }
6105 return 0x1;
6106 }
6107
6108 static unsigned int CharNeg(struct Expression * exp, struct Operand * op1)
6109 {
6110 exp->type = 2;
6111 exp->string = PrintChar(-op1->c);
6112 if(!exp->expType)
6113 {
6114 exp->expType = op1->type;
6115 if(op1->type)
6116 op1->type->refCount++;
6117 }
6118 return 0x1;
6119 }
6120
6121 static unsigned int UCharNeg(struct Expression * exp, struct Operand * op1)
6122 {
6123 exp->type = 2;
6124 exp->string = PrintUChar(-op1->uc);
6125 if(!exp->expType)
6126 {
6127 exp->expType = op1->type;
6128 if(op1->type)
6129 op1->type->refCount++;
6130 }
6131 return 0x1;
6132 }
6133
6134 static unsigned int FloatNeg(struct Expression * exp, struct Operand * op1)
6135 {
6136 exp->type = 2;
6137 exp->string = PrintFloat(-op1->f);
6138 if(!exp->expType)
6139 {
6140 exp->expType = op1->type;
6141 if(op1->type)
6142 op1->type->refCount++;
6143 }
6144 return 0x1;
6145 }
6146
6147 static unsigned int DoubleNeg(struct Expression * exp, struct Operand * op1)
6148 {
6149 exp->type = 2;
6150 exp->string = PrintDouble(-op1->d);
6151 if(!exp->expType)
6152 {
6153 exp->expType = op1->type;
6154 if(op1->type)
6155 op1->type->refCount++;
6156 }
6157 return 0x1;
6158 }
6159
6160 static unsigned int IntInc(struct Expression * exp, struct Operand * op1)
6161 {
6162 exp->type = 2;
6163 exp->string = PrintInt(++op1->i);
6164 if(!exp->expType)
6165 {
6166 exp->expType = op1->type;
6167 if(op1->type)
6168 op1->type->refCount++;
6169 }
6170 return 0x1;
6171 }
6172
6173 static unsigned int UIntInc(struct Expression * exp, struct Operand * op1)
6174 {
6175 exp->type = 2;
6176 exp->string = PrintUInt(++op1->ui);
6177 if(!exp->expType)
6178 {
6179 exp->expType = op1->type;
6180 if(op1->type)
6181 op1->type->refCount++;
6182 }
6183 return 0x1;
6184 }
6185
6186 static unsigned int ShortInc(struct Expression * exp, struct Operand * op1)
6187 {
6188 exp->type = 2;
6189 exp->string = PrintShort(++op1->s);
6190 if(!exp->expType)
6191 {
6192 exp->expType = op1->type;
6193 if(op1->type)
6194 op1->type->refCount++;
6195 }
6196 return 0x1;
6197 }
6198
6199 static unsigned int UShortInc(struct Expression * exp, struct Operand * op1)
6200 {
6201 exp->type = 2;
6202 exp->string = PrintUShort(++op1->us);
6203 if(!exp->expType)
6204 {
6205 exp->expType = op1->type;
6206 if(op1->type)
6207 op1->type->refCount++;
6208 }
6209 return 0x1;
6210 }
6211
6212 static unsigned int CharInc(struct Expression * exp, struct Operand * op1)
6213 {
6214 exp->type = 2;
6215 exp->string = PrintChar(++op1->c);
6216 if(!exp->expType)
6217 {
6218 exp->expType = op1->type;
6219 if(op1->type)
6220 op1->type->refCount++;
6221 }
6222 return 0x1;
6223 }
6224
6225 static unsigned int UCharInc(struct Expression * exp, struct Operand * op1)
6226 {
6227 exp->type = 2;
6228 exp->string = PrintUChar(++op1->uc);
6229 if(!exp->expType)
6230 {
6231 exp->expType = op1->type;
6232 if(op1->type)
6233 op1->type->refCount++;
6234 }
6235 return 0x1;
6236 }
6237
6238 static unsigned int FloatInc(struct Expression * exp, struct Operand * op1)
6239 {
6240 exp->type = 2;
6241 exp->string = PrintFloat(++op1->f);
6242 if(!exp->expType)
6243 {
6244 exp->expType = op1->type;
6245 if(op1->type)
6246 op1->type->refCount++;
6247 }
6248 return 0x1;
6249 }
6250
6251 static unsigned int DoubleInc(struct Expression * exp, struct Operand * op1)
6252 {
6253 exp->type = 2;
6254 exp->string = PrintDouble(++op1->d);
6255 if(!exp->expType)
6256 {
6257 exp->expType = op1->type;
6258 if(op1->type)
6259 op1->type->refCount++;
6260 }
6261 return 0x1;
6262 }
6263
6264 static unsigned int IntDec(struct Expression * exp, struct Operand * op1)
6265 {
6266 exp->type = 2;
6267 exp->string = PrintInt(--op1->i);
6268 if(!exp->expType)
6269 {
6270 exp->expType = op1->type;
6271 if(op1->type)
6272 op1->type->refCount++;
6273 }
6274 return 0x1;
6275 }
6276
6277 static unsigned int UIntDec(struct Expression * exp, struct Operand * op1)
6278 {
6279 exp->type = 2;
6280 exp->string = PrintUInt(--op1->ui);
6281 if(!exp->expType)
6282 {
6283 exp->expType = op1->type;
6284 if(op1->type)
6285 op1->type->refCount++;
6286 }
6287 return 0x1;
6288 }
6289
6290 static unsigned int ShortDec(struct Expression * exp, struct Operand * op1)
6291 {
6292 exp->type = 2;
6293 exp->string = PrintShort(--op1->s);
6294 if(!exp->expType)
6295 {
6296 exp->expType = op1->type;
6297 if(op1->type)
6298 op1->type->refCount++;
6299 }
6300 return 0x1;
6301 }
6302
6303 static unsigned int UShortDec(struct Expression * exp, struct Operand * op1)
6304 {
6305 exp->type = 2;
6306 exp->string = PrintUShort(--op1->us);
6307 if(!exp->expType)
6308 {
6309 exp->expType = op1->type;
6310 if(op1->type)
6311 op1->type->refCount++;
6312 }
6313 return 0x1;
6314 }
6315
6316 static unsigned int CharDec(struct Expression * exp, struct Operand * op1)
6317 {
6318 exp->type = 2;
6319 exp->string = PrintChar(--op1->c);
6320 if(!exp->expType)
6321 {
6322 exp->expType = op1->type;
6323 if(op1->type)
6324 op1->type->refCount++;
6325 }
6326 return 0x1;
6327 }
6328
6329 static unsigned int UCharDec(struct Expression * exp, struct Operand * op1)
6330 {
6331 exp->type = 2;
6332 exp->string = PrintUChar(--op1->uc);
6333 if(!exp->expType)
6334 {
6335 exp->expType = op1->type;
6336 if(op1->type)
6337 op1->type->refCount++;
6338 }
6339 return 0x1;
6340 }
6341
6342 static unsigned int FloatDec(struct Expression * exp, struct Operand * op1)
6343 {
6344 exp->type = 2;
6345 exp->string = PrintFloat(--op1->f);
6346 if(!exp->expType)
6347 {
6348 exp->expType = op1->type;
6349 if(op1->type)
6350 op1->type->refCount++;
6351 }
6352 return 0x1;
6353 }
6354
6355 static unsigned int DoubleDec(struct Expression * exp, struct Operand * op1)
6356 {
6357 exp->type = 2;
6358 exp->string = PrintDouble(--op1->d);
6359 if(!exp->expType)
6360 {
6361 exp->expType = op1->type;
6362 if(op1->type)
6363 op1->type->refCount++;
6364 }
6365 return 0x1;
6366 }
6367
6368 static unsigned int IntAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6369 {
6370 int value2 = op2->i;
6371
6372 exp->type = 2;
6373 exp->string = PrintInt(op1->i = value2);
6374 if(!exp->expType)
6375 {
6376 exp->expType = op1->type;
6377 if(op1->type)
6378 op1->type->refCount++;
6379 }
6380 return 0x1;
6381 }
6382
6383 static unsigned int UIntAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6384 {
6385 unsigned int value2 = op2->ui;
6386
6387 exp->type = 2;
6388 exp->string = PrintUInt(op1->ui = value2);
6389 if(!exp->expType)
6390 {
6391 exp->expType = op1->type;
6392 if(op1->type)
6393 op1->type->refCount++;
6394 }
6395 return 0x1;
6396 }
6397
6398 static unsigned int ShortAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6399 {
6400 short value2 = op2->s;
6401
6402 exp->type = 2;
6403 exp->string = PrintShort(op1->s = value2);
6404 if(!exp->expType)
6405 {
6406 exp->expType = op1->type;
6407 if(op1->type)
6408 op1->type->refCount++;
6409 }
6410 return 0x1;
6411 }
6412
6413 static unsigned int UShortAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6414 {
6415 unsigned short value2 = op2->us;
6416
6417 exp->type = 2;
6418 exp->string = PrintUShort(op1->us = value2);
6419 if(!exp->expType)
6420 {
6421 exp->expType = op1->type;
6422 if(op1->type)
6423 op1->type->refCount++;
6424 }
6425 return 0x1;
6426 }
6427
6428 static unsigned int CharAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6429 {
6430 char value2 = op2->c;
6431
6432 exp->type = 2;
6433 exp->string = PrintChar(op1->c = value2);
6434 if(!exp->expType)
6435 {
6436 exp->expType = op1->type;
6437 if(op1->type)
6438 op1->type->refCount++;
6439 }
6440 return 0x1;
6441 }
6442
6443 static unsigned int UCharAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6444 {
6445 unsigned char value2 = op2->uc;
6446
6447 exp->type = 2;
6448 exp->string = PrintUChar(op1->uc = value2);
6449 if(!exp->expType)
6450 {
6451 exp->expType = op1->type;
6452 if(op1->type)
6453 op1->type->refCount++;
6454 }
6455 return 0x1;
6456 }
6457
6458 static unsigned int FloatAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6459 {
6460 float value2 = op2->f;
6461
6462 exp->type = 2;
6463 exp->string = PrintFloat(op1->f = value2);
6464 if(!exp->expType)
6465 {
6466 exp->expType = op1->type;
6467 if(op1->type)
6468 op1->type->refCount++;
6469 }
6470 return 0x1;
6471 }
6472
6473 static unsigned int DoubleAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6474 {
6475 double value2 = op2->d;
6476
6477 exp->type = 2;
6478 exp->string = PrintDouble(op1->d = value2);
6479 if(!exp->expType)
6480 {
6481 exp->expType = op1->type;
6482 if(op1->type)
6483 op1->type->refCount++;
6484 }
6485 return 0x1;
6486 }
6487
6488 static unsigned int IntAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6489 {
6490 int value2 = op2->i;
6491
6492 exp->type = 2;
6493 exp->string = PrintInt(op1->i += value2);
6494 if(!exp->expType)
6495 {
6496 exp->expType = op1->type;
6497 if(op1->type)
6498 op1->type->refCount++;
6499 }
6500 return 0x1;
6501 }
6502
6503 static unsigned int UIntAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6504 {
6505 unsigned int value2 = op2->ui;
6506
6507 exp->type = 2;
6508 exp->string = PrintUInt(op1->ui += value2);
6509 if(!exp->expType)
6510 {
6511 exp->expType = op1->type;
6512 if(op1->type)
6513 op1->type->refCount++;
6514 }
6515 return 0x1;
6516 }
6517
6518 static unsigned int ShortAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6519 {
6520 short value2 = op2->s;
6521
6522 exp->type = 2;
6523 exp->string = PrintShort(op1->s += value2);
6524 if(!exp->expType)
6525 {
6526 exp->expType = op1->type;
6527 if(op1->type)
6528 op1->type->refCount++;
6529 }
6530 return 0x1;
6531 }
6532
6533 static unsigned int UShortAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6534 {
6535 unsigned short value2 = op2->us;
6536
6537 exp->type = 2;
6538 exp->string = PrintUShort(op1->us += value2);
6539 if(!exp->expType)
6540 {
6541 exp->expType = op1->type;
6542 if(op1->type)
6543 op1->type->refCount++;
6544 }
6545 return 0x1;
6546 }
6547
6548 static unsigned int CharAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6549 {
6550 char value2 = op2->c;
6551
6552 exp->type = 2;
6553 exp->string = PrintChar(op1->c += value2);
6554 if(!exp->expType)
6555 {
6556 exp->expType = op1->type;
6557 if(op1->type)
6558 op1->type->refCount++;
6559 }
6560 return 0x1;
6561 }
6562
6563 static unsigned int UCharAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6564 {
6565 unsigned char value2 = op2->uc;
6566
6567 exp->type = 2;
6568 exp->string = PrintUChar(op1->uc += value2);
6569 if(!exp->expType)
6570 {
6571 exp->expType = op1->type;
6572 if(op1->type)
6573 op1->type->refCount++;
6574 }
6575 return 0x1;
6576 }
6577
6578 static unsigned int FloatAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6579 {
6580 float value2 = op2->f;
6581
6582 exp->type = 2;
6583 exp->string = PrintFloat(op1->f += value2);
6584 if(!exp->expType)
6585 {
6586 exp->expType = op1->type;
6587 if(op1->type)
6588 op1->type->refCount++;
6589 }
6590 return 0x1;
6591 }
6592
6593 static unsigned int DoubleAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6594 {
6595 double value2 = op2->d;
6596
6597 exp->type = 2;
6598 exp->string = PrintDouble(op1->d += value2);
6599 if(!exp->expType)
6600 {
6601 exp->expType = op1->type;
6602 if(op1->type)
6603 op1->type->refCount++;
6604 }
6605 return 0x1;
6606 }
6607
6608 static unsigned int IntSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6609 {
6610 int value2 = op2->i;
6611
6612 exp->type = 2;
6613 exp->string = PrintInt(op1->i -= value2);
6614 if(!exp->expType)
6615 {
6616 exp->expType = op1->type;
6617 if(op1->type)
6618 op1->type->refCount++;
6619 }
6620 return 0x1;
6621 }
6622
6623 static unsigned int UIntSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6624 {
6625 unsigned int value2 = op2->ui;
6626
6627 exp->type = 2;
6628 exp->string = PrintUInt(op1->ui -= value2);
6629 if(!exp->expType)
6630 {
6631 exp->expType = op1->type;
6632 if(op1->type)
6633 op1->type->refCount++;
6634 }
6635 return 0x1;
6636 }
6637
6638 static unsigned int ShortSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6639 {
6640 short value2 = op2->s;
6641
6642 exp->type = 2;
6643 exp->string = PrintShort(op1->s -= value2);
6644 if(!exp->expType)
6645 {
6646 exp->expType = op1->type;
6647 if(op1->type)
6648 op1->type->refCount++;
6649 }
6650 return 0x1;
6651 }
6652
6653 static unsigned int UShortSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6654 {
6655 unsigned short value2 = op2->us;
6656
6657 exp->type = 2;
6658 exp->string = PrintUShort(op1->us -= value2);
6659 if(!exp->expType)
6660 {
6661 exp->expType = op1->type;
6662 if(op1->type)
6663 op1->type->refCount++;
6664 }
6665 return 0x1;
6666 }
6667
6668 static unsigned int CharSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6669 {
6670 char value2 = op2->c;
6671
6672 exp->type = 2;
6673 exp->string = PrintChar(op1->c -= value2);
6674 if(!exp->expType)
6675 {
6676 exp->expType = op1->type;
6677 if(op1->type)
6678 op1->type->refCount++;
6679 }
6680 return 0x1;
6681 }
6682
6683 static unsigned int UCharSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6684 {
6685 unsigned char value2 = op2->uc;
6686
6687 exp->type = 2;
6688 exp->string = PrintUChar(op1->uc -= value2);
6689 if(!exp->expType)
6690 {
6691 exp->expType = op1->type;
6692 if(op1->type)
6693 op1->type->refCount++;
6694 }
6695 return 0x1;
6696 }
6697
6698 static unsigned int FloatSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6699 {
6700 float value2 = op2->f;
6701
6702 exp->type = 2;
6703 exp->string = PrintFloat(op1->f -= value2);
6704 if(!exp->expType)
6705 {
6706 exp->expType = op1->type;
6707 if(op1->type)
6708 op1->type->refCount++;
6709 }
6710 return 0x1;
6711 }
6712
6713 static unsigned int DoubleSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6714 {
6715 double value2 = op2->d;
6716
6717 exp->type = 2;
6718 exp->string = PrintDouble(op1->d -= value2);
6719 if(!exp->expType)
6720 {
6721 exp->expType = op1->type;
6722 if(op1->type)
6723 op1->type->refCount++;
6724 }
6725 return 0x1;
6726 }
6727
6728 static unsigned int IntMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6729 {
6730 int value2 = op2->i;
6731
6732 exp->type = 2;
6733 exp->string = PrintInt(op1->i *= value2);
6734 if(!exp->expType)
6735 {
6736 exp->expType = op1->type;
6737 if(op1->type)
6738 op1->type->refCount++;
6739 }
6740 return 0x1;
6741 }
6742
6743 static unsigned int UIntMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6744 {
6745 unsigned int value2 = op2->ui;
6746
6747 exp->type = 2;
6748 exp->string = PrintUInt(op1->ui *= value2);
6749 if(!exp->expType)
6750 {
6751 exp->expType = op1->type;
6752 if(op1->type)
6753 op1->type->refCount++;
6754 }
6755 return 0x1;
6756 }
6757
6758 static unsigned int ShortMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6759 {
6760 short value2 = op2->s;
6761
6762 exp->type = 2;
6763 exp->string = PrintShort(op1->s *= value2);
6764 if(!exp->expType)
6765 {
6766 exp->expType = op1->type;
6767 if(op1->type)
6768 op1->type->refCount++;
6769 }
6770 return 0x1;
6771 }
6772
6773 static unsigned int UShortMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6774 {
6775 unsigned short value2 = op2->us;
6776
6777 exp->type = 2;
6778 exp->string = PrintUShort(op1->us *= value2);
6779 if(!exp->expType)
6780 {
6781 exp->expType = op1->type;
6782 if(op1->type)
6783 op1->type->refCount++;
6784 }
6785 return 0x1;
6786 }
6787
6788 static unsigned int CharMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6789 {
6790 char value2 = op2->c;
6791
6792 exp->type = 2;
6793 exp->string = PrintChar(op1->c *= value2);
6794 if(!exp->expType)
6795 {
6796 exp->expType = op1->type;
6797 if(op1->type)
6798 op1->type->refCount++;
6799 }
6800 return 0x1;
6801 }
6802
6803 static unsigned int UCharMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6804 {
6805 unsigned char value2 = op2->uc;
6806
6807 exp->type = 2;
6808 exp->string = PrintUChar(op1->uc *= value2);
6809 if(!exp->expType)
6810 {
6811 exp->expType = op1->type;
6812 if(op1->type)
6813 op1->type->refCount++;
6814 }
6815 return 0x1;
6816 }
6817
6818 static unsigned int FloatMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6819 {
6820 float value2 = op2->f;
6821
6822 exp->type = 2;
6823 exp->string = PrintFloat(op1->f *= value2);
6824 if(!exp->expType)
6825 {
6826 exp->expType = op1->type;
6827 if(op1->type)
6828 op1->type->refCount++;
6829 }
6830 return 0x1;
6831 }
6832
6833 static unsigned int DoubleMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6834 {
6835 double value2 = op2->d;
6836
6837 exp->type = 2;
6838 exp->string = PrintDouble(op1->d *= value2);
6839 if(!exp->expType)
6840 {
6841 exp->expType = op1->type;
6842 if(op1->type)
6843 op1->type->refCount++;
6844 }
6845 return 0x1;
6846 }
6847
6848 static unsigned int IntDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6849 {
6850 int value2 = op2->i;
6851
6852 exp->type = 2;
6853 exp->string = PrintInt(value2 ? (op1->i /= value2) : 0);
6854 if(!exp->expType)
6855 {
6856 exp->expType = op1->type;
6857 if(op1->type)
6858 op1->type->refCount++;
6859 }
6860 return 0x1;
6861 }
6862
6863 static unsigned int UIntDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6864 {
6865 unsigned int value2 = op2->ui;
6866
6867 exp->type = 2;
6868 exp->string = PrintUInt(value2 ? (op1->ui /= value2) : 0);
6869 if(!exp->expType)
6870 {
6871 exp->expType = op1->type;
6872 if(op1->type)
6873 op1->type->refCount++;
6874 }
6875 return 0x1;
6876 }
6877
6878 static unsigned int ShortDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6879 {
6880 short value2 = op2->s;
6881
6882 exp->type = 2;
6883 exp->string = PrintShort(value2 ? (op1->s /= value2) : (short)0);
6884 if(!exp->expType)
6885 {
6886 exp->expType = op1->type;
6887 if(op1->type)
6888 op1->type->refCount++;
6889 }
6890 return 0x1;
6891 }
6892
6893 static unsigned int UShortDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6894 {
6895 unsigned short value2 = op2->us;
6896
6897 exp->type = 2;
6898 exp->string = PrintUShort(value2 ? (op1->us /= value2) : (unsigned short)0);
6899 if(!exp->expType)
6900 {
6901 exp->expType = op1->type;
6902 if(op1->type)
6903 op1->type->refCount++;
6904 }
6905 return 0x1;
6906 }
6907
6908 static unsigned int CharDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6909 {
6910 char value2 = op2->c;
6911
6912 exp->type = 2;
6913 exp->string = PrintChar(value2 ? (op1->c /= value2) : (char)0);
6914 if(!exp->expType)
6915 {
6916 exp->expType = op1->type;
6917 if(op1->type)
6918 op1->type->refCount++;
6919 }
6920 return 0x1;
6921 }
6922
6923 static unsigned int UCharDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6924 {
6925 unsigned char value2 = op2->uc;
6926
6927 exp->type = 2;
6928 exp->string = PrintUChar(value2 ? (op1->uc /= value2) : (unsigned char)0);
6929 if(!exp->expType)
6930 {
6931 exp->expType = op1->type;
6932 if(op1->type)
6933 op1->type->refCount++;
6934 }
6935 return 0x1;
6936 }
6937
6938 static unsigned int FloatDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6939 {
6940 float value2 = op2->f;
6941
6942 exp->type = 2;
6943 exp->string = PrintFloat(value2 ? (op1->f /= value2) : (float)0);
6944 if(!exp->expType)
6945 {
6946 exp->expType = op1->type;
6947 if(op1->type)
6948 op1->type->refCount++;
6949 }
6950 return 0x1;
6951 }
6952
6953 static unsigned int DoubleDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6954 {
6955 double value2 = op2->d;
6956
6957 exp->type = 2;
6958 exp->string = PrintDouble(value2 ? (op1->d /= value2) : (double)0);
6959 if(!exp->expType)
6960 {
6961 exp->expType = op1->type;
6962 if(op1->type)
6963 op1->type->refCount++;
6964 }
6965 return 0x1;
6966 }
6967
6968 static unsigned int IntModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6969 {
6970 int value2 = op2->i;
6971
6972 exp->type = 2;
6973 exp->string = PrintInt(value2 ? (op1->i %= value2) : 0);
6974 if(!exp->expType)
6975 {
6976 exp->expType = op1->type;
6977 if(op1->type)
6978 op1->type->refCount++;
6979 }
6980 return 0x1;
6981 }
6982
6983 static unsigned int UIntModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6984 {
6985 unsigned int value2 = op2->ui;
6986
6987 exp->type = 2;
6988 exp->string = PrintUInt(value2 ? (op1->ui %= value2) : 0);
6989 if(!exp->expType)
6990 {
6991 exp->expType = op1->type;
6992 if(op1->type)
6993 op1->type->refCount++;
6994 }
6995 return 0x1;
6996 }
6997
6998 static unsigned int ShortModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6999 {
7000 short value2 = op2->s;
7001
7002 exp->type = 2;
7003 exp->string = PrintShort(value2 ? (op1->s %= value2) : (short)0);
7004 if(!exp->expType)
7005 {
7006 exp->expType = op1->type;
7007 if(op1->type)
7008 op1->type->refCount++;
7009 }
7010 return 0x1;
7011 }
7012
7013 static unsigned int UShortModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7014 {
7015 unsigned short value2 = op2->us;
7016
7017 exp->type = 2;
7018 exp->string = PrintUShort(value2 ? (op1->us %= value2) : (unsigned short)0);
7019 if(!exp->expType)
7020 {
7021 exp->expType = op1->type;
7022 if(op1->type)
7023 op1->type->refCount++;
7024 }
7025 return 0x1;
7026 }
7027
7028 static unsigned int CharModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7029 {
7030 char value2 = op2->c;
7031
7032 exp->type = 2;
7033 exp->string = PrintChar(value2 ? (op1->c %= value2) : (char)0);
7034 if(!exp->expType)
7035 {
7036 exp->expType = op1->type;
7037 if(op1->type)
7038 op1->type->refCount++;
7039 }
7040 return 0x1;
7041 }
7042
7043 static unsigned int UCharModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7044 {
7045 unsigned char value2 = op2->uc;
7046
7047 exp->type = 2;
7048 exp->string = PrintUChar(value2 ? (op1->uc %= value2) : (unsigned char)0);
7049 if(!exp->expType)
7050 {
7051 exp->expType = op1->type;
7052 if(op1->type)
7053 op1->type->refCount++;
7054 }
7055 return 0x1;
7056 }
7057
7058 static unsigned int IntBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7059 {
7060 int value2 = op2->i;
7061
7062 exp->type = 2;
7063 exp->string = PrintInt(op1->i & value2);
7064 if(!exp->expType)
7065 {
7066 exp->expType = op1->type;
7067 if(op1->type)
7068 op1->type->refCount++;
7069 }
7070 return 0x1;
7071 }
7072
7073 static unsigned int UIntBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7074 {
7075 unsigned int value2 = op2->ui;
7076
7077 exp->type = 2;
7078 exp->string = PrintUInt(op1->ui & value2);
7079 if(!exp->expType)
7080 {
7081 exp->expType = op1->type;
7082 if(op1->type)
7083 op1->type->refCount++;
7084 }
7085 return 0x1;
7086 }
7087
7088 static unsigned int ShortBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7089 {
7090 short value2 = op2->s;
7091
7092 exp->type = 2;
7093 exp->string = PrintShort(op1->s & value2);
7094 if(!exp->expType)
7095 {
7096 exp->expType = op1->type;
7097 if(op1->type)
7098 op1->type->refCount++;
7099 }
7100 return 0x1;
7101 }
7102
7103 static unsigned int UShortBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7104 {
7105 unsigned short value2 = op2->us;
7106
7107 exp->type = 2;
7108 exp->string = PrintUShort(op1->us & value2);
7109 if(!exp->expType)
7110 {
7111 exp->expType = op1->type;
7112 if(op1->type)
7113 op1->type->refCount++;
7114 }
7115 return 0x1;
7116 }
7117
7118 static unsigned int CharBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7119 {
7120 char value2 = op2->c;
7121
7122 exp->type = 2;
7123 exp->string = PrintChar(op1->c & value2);
7124 if(!exp->expType)
7125 {
7126 exp->expType = op1->type;
7127 if(op1->type)
7128 op1->type->refCount++;
7129 }
7130 return 0x1;
7131 }
7132
7133 static unsigned int UCharBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7134 {
7135 unsigned char value2 = op2->uc;
7136
7137 exp->type = 2;
7138 exp->string = PrintUChar(op1->uc & value2);
7139 if(!exp->expType)
7140 {
7141 exp->expType = op1->type;
7142 if(op1->type)
7143 op1->type->refCount++;
7144 }
7145 return 0x1;
7146 }
7147
7148 static unsigned int IntBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7149 {
7150 int value2 = op2->i;
7151
7152 exp->type = 2;
7153 exp->string = PrintInt(op1->i | value2);
7154 if(!exp->expType)
7155 {
7156 exp->expType = op1->type;
7157 if(op1->type)
7158 op1->type->refCount++;
7159 }
7160 return 0x1;
7161 }
7162
7163 static unsigned int UIntBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7164 {
7165 unsigned int value2 = op2->ui;
7166
7167 exp->type = 2;
7168 exp->string = PrintUInt(op1->ui | value2);
7169 if(!exp->expType)
7170 {
7171 exp->expType = op1->type;
7172 if(op1->type)
7173 op1->type->refCount++;
7174 }
7175 return 0x1;
7176 }
7177
7178 static unsigned int ShortBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7179 {
7180 short value2 = op2->s;
7181
7182 exp->type = 2;
7183 exp->string = PrintShort(op1->s | value2);
7184 if(!exp->expType)
7185 {
7186 exp->expType = op1->type;
7187 if(op1->type)
7188 op1->type->refCount++;
7189 }
7190 return 0x1;
7191 }
7192
7193 static unsigned int UShortBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7194 {
7195 unsigned short value2 = op2->us;
7196
7197 exp->type = 2;
7198 exp->string = PrintUShort(op1->us | value2);
7199 if(!exp->expType)
7200 {
7201 exp->expType = op1->type;
7202 if(op1->type)
7203 op1->type->refCount++;
7204 }
7205 return 0x1;
7206 }
7207
7208 static unsigned int CharBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7209 {
7210 char value2 = op2->c;
7211
7212 exp->type = 2;
7213 exp->string = PrintChar(op1->c | value2);
7214 if(!exp->expType)
7215 {
7216 exp->expType = op1->type;
7217 if(op1->type)
7218 op1->type->refCount++;
7219 }
7220 return 0x1;
7221 }
7222
7223 static unsigned int UCharBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7224 {
7225 unsigned char value2 = op2->uc;
7226
7227 exp->type = 2;
7228 exp->string = PrintUChar(op1->uc | value2);
7229 if(!exp->expType)
7230 {
7231 exp->expType = op1->type;
7232 if(op1->type)
7233 op1->type->refCount++;
7234 }
7235 return 0x1;
7236 }
7237
7238 static unsigned int IntBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7239 {
7240 int value2 = op2->i;
7241
7242 exp->type = 2;
7243 exp->string = PrintInt(op1->i ^ value2);
7244 if(!exp->expType)
7245 {
7246 exp->expType = op1->type;
7247 if(op1->type)
7248 op1->type->refCount++;
7249 }
7250 return 0x1;
7251 }
7252
7253 static unsigned int UIntBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7254 {
7255 unsigned int value2 = op2->ui;
7256
7257 exp->type = 2;
7258 exp->string = PrintUInt(op1->ui ^ value2);
7259 if(!exp->expType)
7260 {
7261 exp->expType = op1->type;
7262 if(op1->type)
7263 op1->type->refCount++;
7264 }
7265 return 0x1;
7266 }
7267
7268 static unsigned int ShortBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7269 {
7270 short value2 = op2->s;
7271
7272 exp->type = 2;
7273 exp->string = PrintShort(op1->s ^ value2);
7274 if(!exp->expType)
7275 {
7276 exp->expType = op1->type;
7277 if(op1->type)
7278 op1->type->refCount++;
7279 }
7280 return 0x1;
7281 }
7282
7283 static unsigned int UShortBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7284 {
7285 unsigned short value2 = op2->us;
7286
7287 exp->type = 2;
7288 exp->string = PrintUShort(op1->us ^ value2);
7289 if(!exp->expType)
7290 {
7291 exp->expType = op1->type;
7292 if(op1->type)
7293 op1->type->refCount++;
7294 }
7295 return 0x1;
7296 }
7297
7298 static unsigned int CharBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7299 {
7300 char value2 = op2->c;
7301
7302 exp->type = 2;
7303 exp->string = PrintChar(op1->c ^ value2);
7304 if(!exp->expType)
7305 {
7306 exp->expType = op1->type;
7307 if(op1->type)
7308 op1->type->refCount++;
7309 }
7310 return 0x1;
7311 }
7312
7313 static unsigned int UCharBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7314 {
7315 unsigned char value2 = op2->uc;
7316
7317 exp->type = 2;
7318 exp->string = PrintUChar(op1->uc ^ value2);
7319 if(!exp->expType)
7320 {
7321 exp->expType = op1->type;
7322 if(op1->type)
7323 op1->type->refCount++;
7324 }
7325 return 0x1;
7326 }
7327
7328 static unsigned int IntLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7329 {
7330 int value2 = op2->i;
7331
7332 exp->type = 2;
7333 exp->string = PrintInt(op1->i << value2);
7334 if(!exp->expType)
7335 {
7336 exp->expType = op1->type;
7337 if(op1->type)
7338 op1->type->refCount++;
7339 }
7340 return 0x1;
7341 }
7342
7343 static unsigned int UIntLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7344 {
7345 unsigned int value2 = op2->ui;
7346
7347 exp->type = 2;
7348 exp->string = PrintUInt(op1->ui << value2);
7349 if(!exp->expType)
7350 {
7351 exp->expType = op1->type;
7352 if(op1->type)
7353 op1->type->refCount++;
7354 }
7355 return 0x1;
7356 }
7357
7358 static unsigned int ShortLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7359 {
7360 short value2 = op2->s;
7361
7362 exp->type = 2;
7363 exp->string = PrintShort(op1->s << value2);
7364 if(!exp->expType)
7365 {
7366 exp->expType = op1->type;
7367 if(op1->type)
7368 op1->type->refCount++;
7369 }
7370 return 0x1;
7371 }
7372
7373 static unsigned int UShortLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7374 {
7375 unsigned short value2 = op2->us;
7376
7377 exp->type = 2;
7378 exp->string = PrintUShort(op1->us << value2);
7379 if(!exp->expType)
7380 {
7381 exp->expType = op1->type;
7382 if(op1->type)
7383 op1->type->refCount++;
7384 }
7385 return 0x1;
7386 }
7387
7388 static unsigned int CharLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7389 {
7390 char value2 = op2->c;
7391
7392 exp->type = 2;
7393 exp->string = PrintChar(op1->c << value2);
7394 if(!exp->expType)
7395 {
7396 exp->expType = op1->type;
7397 if(op1->type)
7398 op1->type->refCount++;
7399 }
7400 return 0x1;
7401 }
7402
7403 static unsigned int UCharLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7404 {
7405 unsigned char value2 = op2->uc;
7406
7407 exp->type = 2;
7408 exp->string = PrintUChar(op1->uc << value2);
7409 if(!exp->expType)
7410 {
7411 exp->expType = op1->type;
7412 if(op1->type)
7413 op1->type->refCount++;
7414 }
7415 return 0x1;
7416 }
7417
7418 static unsigned int IntRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7419 {
7420 int value2 = op2->i;
7421
7422 exp->type = 2;
7423 exp->string = PrintInt(op1->i >> value2);
7424 if(!exp->expType)
7425 {
7426 exp->expType = op1->type;
7427 if(op1->type)
7428 op1->type->refCount++;
7429 }
7430 return 0x1;
7431 }
7432
7433 static unsigned int UIntRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7434 {
7435 unsigned int value2 = op2->ui;
7436
7437 exp->type = 2;
7438 exp->string = PrintUInt(op1->ui >> value2);
7439 if(!exp->expType)
7440 {
7441 exp->expType = op1->type;
7442 if(op1->type)
7443 op1->type->refCount++;
7444 }
7445 return 0x1;
7446 }
7447
7448 static unsigned int ShortRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7449 {
7450 short value2 = op2->s;
7451
7452 exp->type = 2;
7453 exp->string = PrintShort(op1->s >> value2);
7454 if(!exp->expType)
7455 {
7456 exp->expType = op1->type;
7457 if(op1->type)
7458 op1->type->refCount++;
7459 }
7460 return 0x1;
7461 }
7462
7463 static unsigned int UShortRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7464 {
7465 unsigned short value2 = op2->us;
7466
7467 exp->type = 2;
7468 exp->string = PrintUShort(op1->us >> value2);
7469 if(!exp->expType)
7470 {
7471 exp->expType = op1->type;
7472 if(op1->type)
7473 op1->type->refCount++;
7474 }
7475 return 0x1;
7476 }
7477
7478 static unsigned int CharRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7479 {
7480 char value2 = op2->c;
7481
7482 exp->type = 2;
7483 exp->string = PrintChar(op1->c >> value2);
7484 if(!exp->expType)
7485 {
7486 exp->expType = op1->type;
7487 if(op1->type)
7488 op1->type->refCount++;
7489 }
7490 return 0x1;
7491 }
7492
7493 static unsigned int UCharRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7494 {
7495 unsigned char value2 = op2->uc;
7496
7497 exp->type = 2;
7498 exp->string = PrintUChar(op1->uc >> value2);
7499 if(!exp->expType)
7500 {
7501 exp->expType = op1->type;
7502 if(op1->type)
7503 op1->type->refCount++;
7504 }
7505 return 0x1;
7506 }
7507
7508 static unsigned int IntBitNot(struct Expression * exp, struct Operand * op1)
7509 {
7510 exp->type = 2;
7511 exp->string = PrintInt(~op1->i);
7512 if(!exp->expType)
7513 {
7514 exp->expType = op1->type;
7515 if(op1->type)
7516 op1->type->refCount++;
7517 }
7518 return 0x1;
7519 }
7520
7521 static unsigned int UIntBitNot(struct Expression * exp, struct Operand * op1)
7522 {
7523 exp->type = 2;
7524 exp->string = PrintUInt(~op1->ui);
7525 if(!exp->expType)
7526 {
7527 exp->expType = op1->type;
7528 if(op1->type)
7529 op1->type->refCount++;
7530 }
7531 return 0x1;
7532 }
7533
7534 static unsigned int ShortBitNot(struct Expression * exp, struct Operand * op1)
7535 {
7536 exp->type = 2;
7537 exp->string = PrintShort(~op1->s);
7538 if(!exp->expType)
7539 {
7540 exp->expType = op1->type;
7541 if(op1->type)
7542 op1->type->refCount++;
7543 }
7544 return 0x1;
7545 }
7546
7547 static unsigned int UShortBitNot(struct Expression * exp, struct Operand * op1)
7548 {
7549 exp->type = 2;
7550 exp->string = PrintUShort(~op1->us);
7551 if(!exp->expType)
7552 {
7553 exp->expType = op1->type;
7554 if(op1->type)
7555 op1->type->refCount++;
7556 }
7557 return 0x1;
7558 }
7559
7560 static unsigned int CharBitNot(struct Expression * exp, struct Operand * op1)
7561 {
7562 exp->type = 2;
7563 exp->string = PrintChar(~op1->c);
7564 if(!exp->expType)
7565 {
7566 exp->expType = op1->type;
7567 if(op1->type)
7568 op1->type->refCount++;
7569 }
7570 return 0x1;
7571 }
7572
7573 static unsigned int UCharBitNot(struct Expression * exp, struct Operand * op1)
7574 {
7575 exp->type = 2;
7576 exp->string = PrintUChar(~op1->uc);
7577 if(!exp->expType)
7578 {
7579 exp->expType = op1->type;
7580 if(op1->type)
7581 op1->type->refCount++;
7582 }
7583 return 0x1;
7584 }
7585
7586 static unsigned int IntAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7587 {
7588 int value2 = op2->i;
7589
7590 exp->type = 2;
7591 exp->string = PrintInt(op1->i &= value2);
7592 if(!exp->expType)
7593 {
7594 exp->expType = op1->type;
7595 if(op1->type)
7596 op1->type->refCount++;
7597 }
7598 return 0x1;
7599 }
7600
7601 static unsigned int UIntAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7602 {
7603 unsigned int value2 = op2->ui;
7604
7605 exp->type = 2;
7606 exp->string = PrintUInt(op1->ui &= value2);
7607 if(!exp->expType)
7608 {
7609 exp->expType = op1->type;
7610 if(op1->type)
7611 op1->type->refCount++;
7612 }
7613 return 0x1;
7614 }
7615
7616 static unsigned int ShortAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7617 {
7618 short value2 = op2->s;
7619
7620 exp->type = 2;
7621 exp->string = PrintShort(op1->s &= value2);
7622 if(!exp->expType)
7623 {
7624 exp->expType = op1->type;
7625 if(op1->type)
7626 op1->type->refCount++;
7627 }
7628 return 0x1;
7629 }
7630
7631 static unsigned int UShortAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7632 {
7633 unsigned short value2 = op2->us;
7634
7635 exp->type = 2;
7636 exp->string = PrintUShort(op1->us &= value2);
7637 if(!exp->expType)
7638 {
7639 exp->expType = op1->type;
7640 if(op1->type)
7641 op1->type->refCount++;
7642 }
7643 return 0x1;
7644 }
7645
7646 static unsigned int CharAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7647 {
7648 char value2 = op2->c;
7649
7650 exp->type = 2;
7651 exp->string = PrintChar(op1->c &= value2);
7652 if(!exp->expType)
7653 {
7654 exp->expType = op1->type;
7655 if(op1->type)
7656 op1->type->refCount++;
7657 }
7658 return 0x1;
7659 }
7660
7661 static unsigned int UCharAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7662 {
7663 unsigned char value2 = op2->uc;
7664
7665 exp->type = 2;
7666 exp->string = PrintUChar(op1->uc &= value2);
7667 if(!exp->expType)
7668 {
7669 exp->expType = op1->type;
7670 if(op1->type)
7671 op1->type->refCount++;
7672 }
7673 return 0x1;
7674 }
7675
7676 static unsigned int IntOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7677 {
7678 int value2 = op2->i;
7679
7680 exp->type = 2;
7681 exp->string = PrintInt(op1->i |= value2);
7682 if(!exp->expType)
7683 {
7684 exp->expType = op1->type;
7685 if(op1->type)
7686 op1->type->refCount++;
7687 }
7688 return 0x1;
7689 }
7690
7691 static unsigned int UIntOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7692 {
7693 unsigned int value2 = op2->ui;
7694
7695 exp->type = 2;
7696 exp->string = PrintUInt(op1->ui |= value2);
7697 if(!exp->expType)
7698 {
7699 exp->expType = op1->type;
7700 if(op1->type)
7701 op1->type->refCount++;
7702 }
7703 return 0x1;
7704 }
7705
7706 static unsigned int ShortOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7707 {
7708 short value2 = op2->s;
7709
7710 exp->type = 2;
7711 exp->string = PrintShort(op1->s |= value2);
7712 if(!exp->expType)
7713 {
7714 exp->expType = op1->type;
7715 if(op1->type)
7716 op1->type->refCount++;
7717 }
7718 return 0x1;
7719 }
7720
7721 static unsigned int UShortOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7722 {
7723 unsigned short value2 = op2->us;
7724
7725 exp->type = 2;
7726 exp->string = PrintUShort(op1->us |= value2);
7727 if(!exp->expType)
7728 {
7729 exp->expType = op1->type;
7730 if(op1->type)
7731 op1->type->refCount++;
7732 }
7733 return 0x1;
7734 }
7735
7736 static unsigned int CharOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7737 {
7738 char value2 = op2->c;
7739
7740 exp->type = 2;
7741 exp->string = PrintChar(op1->c |= value2);
7742 if(!exp->expType)
7743 {
7744 exp->expType = op1->type;
7745 if(op1->type)
7746 op1->type->refCount++;
7747 }
7748 return 0x1;
7749 }
7750
7751 static unsigned int UCharOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7752 {
7753 unsigned char value2 = op2->uc;
7754
7755 exp->type = 2;
7756 exp->string = PrintUChar(op1->uc |= value2);
7757 if(!exp->expType)
7758 {
7759 exp->expType = op1->type;
7760 if(op1->type)
7761 op1->type->refCount++;
7762 }
7763 return 0x1;
7764 }
7765
7766 static unsigned int IntXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7767 {
7768 int value2 = op2->i;
7769
7770 exp->type = 2;
7771 exp->string = PrintInt(op1->i ^= value2);
7772 if(!exp->expType)
7773 {
7774 exp->expType = op1->type;
7775 if(op1->type)
7776 op1->type->refCount++;
7777 }
7778 return 0x1;
7779 }
7780
7781 static unsigned int UIntXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7782 {
7783 unsigned int value2 = op2->ui;
7784
7785 exp->type = 2;
7786 exp->string = PrintUInt(op1->ui ^= value2);
7787 if(!exp->expType)
7788 {
7789 exp->expType = op1->type;
7790 if(op1->type)
7791 op1->type->refCount++;
7792 }
7793 return 0x1;
7794 }
7795
7796 static unsigned int ShortXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7797 {
7798 short value2 = op2->s;
7799
7800 exp->type = 2;
7801 exp->string = PrintShort(op1->s ^= value2);
7802 if(!exp->expType)
7803 {
7804 exp->expType = op1->type;
7805 if(op1->type)
7806 op1->type->refCount++;
7807 }
7808 return 0x1;
7809 }
7810
7811 static unsigned int UShortXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7812 {
7813 unsigned short value2 = op2->us;
7814
7815 exp->type = 2;
7816 exp->string = PrintUShort(op1->us ^= value2);
7817 if(!exp->expType)
7818 {
7819 exp->expType = op1->type;
7820 if(op1->type)
7821 op1->type->refCount++;
7822 }
7823 return 0x1;
7824 }
7825
7826 static unsigned int CharXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7827 {
7828 char value2 = op2->c;
7829
7830 exp->type = 2;
7831 exp->string = PrintChar(op1->c ^= value2);
7832 if(!exp->expType)
7833 {
7834 exp->expType = op1->type;
7835 if(op1->type)
7836 op1->type->refCount++;
7837 }
7838 return 0x1;
7839 }
7840
7841 static unsigned int UCharXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7842 {
7843 unsigned char value2 = op2->uc;
7844
7845 exp->type = 2;
7846 exp->string = PrintUChar(op1->uc ^= value2);
7847 if(!exp->expType)
7848 {
7849 exp->expType = op1->type;
7850 if(op1->type)
7851 op1->type->refCount++;
7852 }
7853 return 0x1;
7854 }
7855
7856 static unsigned int IntLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7857 {
7858 int value2 = op2->i;
7859
7860 exp->type = 2;
7861 exp->string = PrintInt(op1->i <<= value2);
7862 if(!exp->expType)
7863 {
7864 exp->expType = op1->type;
7865 if(op1->type)
7866 op1->type->refCount++;
7867 }
7868 return 0x1;
7869 }
7870
7871 static unsigned int UIntLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7872 {
7873 unsigned int value2 = op2->ui;
7874
7875 exp->type = 2;
7876 exp->string = PrintUInt(op1->ui <<= value2);
7877 if(!exp->expType)
7878 {
7879 exp->expType = op1->type;
7880 if(op1->type)
7881 op1->type->refCount++;
7882 }
7883 return 0x1;
7884 }
7885
7886 static unsigned int ShortLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7887 {
7888 short value2 = op2->s;
7889
7890 exp->type = 2;
7891 exp->string = PrintShort(op1->s <<= value2);
7892 if(!exp->expType)
7893 {
7894 exp->expType = op1->type;
7895 if(op1->type)
7896 op1->type->refCount++;
7897 }
7898 return 0x1;
7899 }
7900
7901 static unsigned int UShortLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7902 {
7903 unsigned short value2 = op2->us;
7904
7905 exp->type = 2;
7906 exp->string = PrintUShort(op1->us <<= value2);
7907 if(!exp->expType)
7908 {
7909 exp->expType = op1->type;
7910 if(op1->type)
7911 op1->type->refCount++;
7912 }
7913 return 0x1;
7914 }
7915
7916 static unsigned int CharLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7917 {
7918 char value2 = op2->c;
7919
7920 exp->type = 2;
7921 exp->string = PrintChar(op1->c <<= value2);
7922 if(!exp->expType)
7923 {
7924 exp->expType = op1->type;
7925 if(op1->type)
7926 op1->type->refCount++;
7927 }
7928 return 0x1;
7929 }
7930
7931 static unsigned int UCharLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7932 {
7933 unsigned char value2 = op2->uc;
7934
7935 exp->type = 2;
7936 exp->string = PrintUChar(op1->uc <<= value2);
7937 if(!exp->expType)
7938 {
7939 exp->expType = op1->type;
7940 if(op1->type)
7941 op1->type->refCount++;
7942 }
7943 return 0x1;
7944 }
7945
7946 static unsigned int IntRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7947 {
7948 int value2 = op2->i;
7949
7950 exp->type = 2;
7951 exp->string = PrintInt(op1->i >>= value2);
7952 if(!exp->expType)
7953 {
7954 exp->expType = op1->type;
7955 if(op1->type)
7956 op1->type->refCount++;
7957 }
7958 return 0x1;
7959 }
7960
7961 static unsigned int UIntRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7962 {
7963 unsigned int value2 = op2->ui;
7964
7965 exp->type = 2;
7966 exp->string = PrintUInt(op1->ui >>= value2);
7967 if(!exp->expType)
7968 {
7969 exp->expType = op1->type;
7970 if(op1->type)
7971 op1->type->refCount++;
7972 }
7973 return 0x1;
7974 }
7975
7976 static unsigned int ShortRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7977 {
7978 short value2 = op2->s;
7979
7980 exp->type = 2;
7981 exp->string = PrintShort(op1->s >>= value2);
7982 if(!exp->expType)
7983 {
7984 exp->expType = op1->type;
7985 if(op1->type)
7986 op1->type->refCount++;
7987 }
7988 return 0x1;
7989 }
7990
7991 static unsigned int UShortRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7992 {
7993 unsigned short value2 = op2->us;
7994
7995 exp->type = 2;
7996 exp->string = PrintUShort(op1->us >>= value2);
7997 if(!exp->expType)
7998 {
7999 exp->expType = op1->type;
8000 if(op1->type)
8001 op1->type->refCount++;
8002 }
8003 return 0x1;
8004 }
8005
8006 static unsigned int CharRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8007 {
8008 char value2 = op2->c;
8009
8010 exp->type = 2;
8011 exp->string = PrintChar(op1->c >>= value2);
8012 if(!exp->expType)
8013 {
8014 exp->expType = op1->type;
8015 if(op1->type)
8016 op1->type->refCount++;
8017 }
8018 return 0x1;
8019 }
8020
8021 static unsigned int UCharRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8022 {
8023 unsigned char value2 = op2->uc;
8024
8025 exp->type = 2;
8026 exp->string = PrintUChar(op1->uc >>= value2);
8027 if(!exp->expType)
8028 {
8029 exp->expType = op1->type;
8030 if(op1->type)
8031 op1->type->refCount++;
8032 }
8033 return 0x1;
8034 }
8035
8036 static unsigned int IntNot(struct Expression * exp, struct Operand * op1)
8037 {
8038 exp->type = 2;
8039 exp->string = PrintInt(!op1->i);
8040 if(!exp->expType)
8041 {
8042 exp->expType = op1->type;
8043 if(op1->type)
8044 op1->type->refCount++;
8045 }
8046 return 0x1;
8047 }
8048
8049 static unsigned int UIntNot(struct Expression * exp, struct Operand * op1)
8050 {
8051 exp->type = 2;
8052 exp->string = PrintUInt(!op1->ui);
8053 if(!exp->expType)
8054 {
8055 exp->expType = op1->type;
8056 if(op1->type)
8057 op1->type->refCount++;
8058 }
8059 return 0x1;
8060 }
8061
8062 static unsigned int ShortNot(struct Expression * exp, struct Operand * op1)
8063 {
8064 exp->type = 2;
8065 exp->string = PrintShort(!op1->s);
8066 if(!exp->expType)
8067 {
8068 exp->expType = op1->type;
8069 if(op1->type)
8070 op1->type->refCount++;
8071 }
8072 return 0x1;
8073 }
8074
8075 static unsigned int UShortNot(struct Expression * exp, struct Operand * op1)
8076 {
8077 exp->type = 2;
8078 exp->string = PrintUShort(!op1->us);
8079 if(!exp->expType)
8080 {
8081 exp->expType = op1->type;
8082 if(op1->type)
8083 op1->type->refCount++;
8084 }
8085 return 0x1;
8086 }
8087
8088 static unsigned int CharNot(struct Expression * exp, struct Operand * op1)
8089 {
8090 exp->type = 2;
8091 exp->string = PrintChar(!op1->c);
8092 if(!exp->expType)
8093 {
8094 exp->expType = op1->type;
8095 if(op1->type)
8096 op1->type->refCount++;
8097 }
8098 return 0x1;
8099 }
8100
8101 static unsigned int UCharNot(struct Expression * exp, struct Operand * op1)
8102 {
8103 exp->type = 2;
8104 exp->string = PrintUChar(!op1->uc);
8105 if(!exp->expType)
8106 {
8107 exp->expType = op1->type;
8108 if(op1->type)
8109 op1->type->refCount++;
8110 }
8111 return 0x1;
8112 }
8113
8114 static unsigned int IntEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8115 {
8116 int value2 = op2->i;
8117
8118 exp->type = 2;
8119 exp->string = PrintInt(op1->i == value2);
8120 if(!exp->expType)
8121 {
8122 exp->expType = op1->type;
8123 if(op1->type)
8124 op1->type->refCount++;
8125 }
8126 return 0x1;
8127 }
8128
8129 static unsigned int UIntEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8130 {
8131 unsigned int value2 = op2->ui;
8132
8133 exp->type = 2;
8134 exp->string = PrintUInt(op1->ui == value2);
8135 if(!exp->expType)
8136 {
8137 exp->expType = op1->type;
8138 if(op1->type)
8139 op1->type->refCount++;
8140 }
8141 return 0x1;
8142 }
8143
8144 static unsigned int ShortEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8145 {
8146 short value2 = op2->s;
8147
8148 exp->type = 2;
8149 exp->string = PrintShort(op1->s == value2);
8150 if(!exp->expType)
8151 {
8152 exp->expType = op1->type;
8153 if(op1->type)
8154 op1->type->refCount++;
8155 }
8156 return 0x1;
8157 }
8158
8159 static unsigned int UShortEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8160 {
8161 unsigned short value2 = op2->us;
8162
8163 exp->type = 2;
8164 exp->string = PrintUShort(op1->us == value2);
8165 if(!exp->expType)
8166 {
8167 exp->expType = op1->type;
8168 if(op1->type)
8169 op1->type->refCount++;
8170 }
8171 return 0x1;
8172 }
8173
8174 static unsigned int CharEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8175 {
8176 char value2 = op2->c;
8177
8178 exp->type = 2;
8179 exp->string = PrintChar(op1->c == value2);
8180 if(!exp->expType)
8181 {
8182 exp->expType = op1->type;
8183 if(op1->type)
8184 op1->type->refCount++;
8185 }
8186 return 0x1;
8187 }
8188
8189 static unsigned int UCharEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8190 {
8191 unsigned char value2 = op2->uc;
8192
8193 exp->type = 2;
8194 exp->string = PrintUChar(op1->uc == value2);
8195 if(!exp->expType)
8196 {
8197 exp->expType = op1->type;
8198 if(op1->type)
8199 op1->type->refCount++;
8200 }
8201 return 0x1;
8202 }
8203
8204 static unsigned int FloatEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8205 {
8206 float value2 = op2->f;
8207
8208 exp->type = 2;
8209 exp->string = PrintFloat(op1->f == value2);
8210 if(!exp->expType)
8211 {
8212 exp->expType = op1->type;
8213 if(op1->type)
8214 op1->type->refCount++;
8215 }
8216 return 0x1;
8217 }
8218
8219 static unsigned int DoubleEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8220 {
8221 double value2 = op2->d;
8222
8223 exp->type = 2;
8224 exp->string = PrintDouble(op1->d == value2);
8225 if(!exp->expType)
8226 {
8227 exp->expType = op1->type;
8228 if(op1->type)
8229 op1->type->refCount++;
8230 }
8231 return 0x1;
8232 }
8233
8234 static unsigned int IntNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8235 {
8236 int value2 = op2->i;
8237
8238 exp->type = 2;
8239 exp->string = PrintInt(op1->i != value2);
8240 if(!exp->expType)
8241 {
8242 exp->expType = op1->type;
8243 if(op1->type)
8244 op1->type->refCount++;
8245 }
8246 return 0x1;
8247 }
8248
8249 static unsigned int UIntNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8250 {
8251 unsigned int value2 = op2->ui;
8252
8253 exp->type = 2;
8254 exp->string = PrintUInt(op1->ui != value2);
8255 if(!exp->expType)
8256 {
8257 exp->expType = op1->type;
8258 if(op1->type)
8259 op1->type->refCount++;
8260 }
8261 return 0x1;
8262 }
8263
8264 static unsigned int ShortNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8265 {
8266 short value2 = op2->s;
8267
8268 exp->type = 2;
8269 exp->string = PrintShort(op1->s != value2);
8270 if(!exp->expType)
8271 {
8272 exp->expType = op1->type;
8273 if(op1->type)
8274 op1->type->refCount++;
8275 }
8276 return 0x1;
8277 }
8278
8279 static unsigned int UShortNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8280 {
8281 unsigned short value2 = op2->us;
8282
8283 exp->type = 2;
8284 exp->string = PrintUShort(op1->us != value2);
8285 if(!exp->expType)
8286 {
8287 exp->expType = op1->type;
8288 if(op1->type)
8289 op1->type->refCount++;
8290 }
8291 return 0x1;
8292 }
8293
8294 static unsigned int CharNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8295 {
8296 char value2 = op2->c;
8297
8298 exp->type = 2;
8299 exp->string = PrintChar(op1->c != value2);
8300 if(!exp->expType)
8301 {
8302 exp->expType = op1->type;
8303 if(op1->type)
8304 op1->type->refCount++;
8305 }
8306 return 0x1;
8307 }
8308
8309 static unsigned int UCharNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8310 {
8311 unsigned char value2 = op2->uc;
8312
8313 exp->type = 2;
8314 exp->string = PrintUChar(op1->uc != value2);
8315 if(!exp->expType)
8316 {
8317 exp->expType = op1->type;
8318 if(op1->type)
8319 op1->type->refCount++;
8320 }
8321 return 0x1;
8322 }
8323
8324 static unsigned int FloatNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8325 {
8326 float value2 = op2->f;
8327
8328 exp->type = 2;
8329 exp->string = PrintFloat(op1->f != value2);
8330 if(!exp->expType)
8331 {
8332 exp->expType = op1->type;
8333 if(op1->type)
8334 op1->type->refCount++;
8335 }
8336 return 0x1;
8337 }
8338
8339 static unsigned int DoubleNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8340 {
8341 double value2 = op2->d;
8342
8343 exp->type = 2;
8344 exp->string = PrintDouble(op1->d != value2);
8345 if(!exp->expType)
8346 {
8347 exp->expType = op1->type;
8348 if(op1->type)
8349 op1->type->refCount++;
8350 }
8351 return 0x1;
8352 }
8353
8354 static unsigned int IntAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8355 {
8356 int value2 = op2->i;
8357
8358 exp->type = 2;
8359 exp->string = PrintInt(op1->i && value2);
8360 if(!exp->expType)
8361 {
8362 exp->expType = op1->type;
8363 if(op1->type)
8364 op1->type->refCount++;
8365 }
8366 return 0x1;
8367 }
8368
8369 static unsigned int UIntAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8370 {
8371 unsigned int value2 = op2->ui;
8372
8373 exp->type = 2;
8374 exp->string = PrintUInt(op1->ui && value2);
8375 if(!exp->expType)
8376 {
8377 exp->expType = op1->type;
8378 if(op1->type)
8379 op1->type->refCount++;
8380 }
8381 return 0x1;
8382 }
8383
8384 static unsigned int ShortAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8385 {
8386 short value2 = op2->s;
8387
8388 exp->type = 2;
8389 exp->string = PrintShort(op1->s && value2);
8390 if(!exp->expType)
8391 {
8392 exp->expType = op1->type;
8393 if(op1->type)
8394 op1->type->refCount++;
8395 }
8396 return 0x1;
8397 }
8398
8399 static unsigned int UShortAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8400 {
8401 unsigned short value2 = op2->us;
8402
8403 exp->type = 2;
8404 exp->string = PrintUShort(op1->us && value2);
8405 if(!exp->expType)
8406 {
8407 exp->expType = op1->type;
8408 if(op1->type)
8409 op1->type->refCount++;
8410 }
8411 return 0x1;
8412 }
8413
8414 static unsigned int CharAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8415 {
8416 char value2 = op2->c;
8417
8418 exp->type = 2;
8419 exp->string = PrintChar(op1->c && value2);
8420 if(!exp->expType)
8421 {
8422 exp->expType = op1->type;
8423 if(op1->type)
8424 op1->type->refCount++;
8425 }
8426 return 0x1;
8427 }
8428
8429 static unsigned int UCharAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8430 {
8431 unsigned char value2 = op2->uc;
8432
8433 exp->type = 2;
8434 exp->string = PrintUChar(op1->uc && value2);
8435 if(!exp->expType)
8436 {
8437 exp->expType = op1->type;
8438 if(op1->type)
8439 op1->type->refCount++;
8440 }
8441 return 0x1;
8442 }
8443
8444 static unsigned int FloatAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8445 {
8446 float value2 = op2->f;
8447
8448 exp->type = 2;
8449 exp->string = PrintFloat(op1->f && value2);
8450 if(!exp->expType)
8451 {
8452 exp->expType = op1->type;
8453 if(op1->type)
8454 op1->type->refCount++;
8455 }
8456 return 0x1;
8457 }
8458
8459 static unsigned int DoubleAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8460 {
8461 double value2 = op2->d;
8462
8463 exp->type = 2;
8464 exp->string = PrintDouble(op1->d && value2);
8465 if(!exp->expType)
8466 {
8467 exp->expType = op1->type;
8468 if(op1->type)
8469 op1->type->refCount++;
8470 }
8471 return 0x1;
8472 }
8473
8474 static unsigned int IntOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8475 {
8476 int value2 = op2->i;
8477
8478 exp->type = 2;
8479 exp->string = PrintInt(op1->i || value2);
8480 if(!exp->expType)
8481 {
8482 exp->expType = op1->type;
8483 if(op1->type)
8484 op1->type->refCount++;
8485 }
8486 return 0x1;
8487 }
8488
8489 static unsigned int UIntOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8490 {
8491 unsigned int value2 = op2->ui;
8492
8493 exp->type = 2;
8494 exp->string = PrintUInt(op1->ui || value2);
8495 if(!exp->expType)
8496 {
8497 exp->expType = op1->type;
8498 if(op1->type)
8499 op1->type->refCount++;
8500 }
8501 return 0x1;
8502 }
8503
8504 static unsigned int ShortOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8505 {
8506 short value2 = op2->s;
8507
8508 exp->type = 2;
8509 exp->string = PrintShort(op1->s || value2);
8510 if(!exp->expType)
8511 {
8512 exp->expType = op1->type;
8513 if(op1->type)
8514 op1->type->refCount++;
8515 }
8516 return 0x1;
8517 }
8518
8519 static unsigned int UShortOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8520 {
8521 unsigned short value2 = op2->us;
8522
8523 exp->type = 2;
8524 exp->string = PrintUShort(op1->us || value2);
8525 if(!exp->expType)
8526 {
8527 exp->expType = op1->type;
8528 if(op1->type)
8529 op1->type->refCount++;
8530 }
8531 return 0x1;
8532 }
8533
8534 static unsigned int CharOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8535 {
8536 char value2 = op2->c;
8537
8538 exp->type = 2;
8539 exp->string = PrintChar(op1->c || value2);
8540 if(!exp->expType)
8541 {
8542 exp->expType = op1->type;
8543 if(op1->type)
8544 op1->type->refCount++;
8545 }
8546 return 0x1;
8547 }
8548
8549 static unsigned int UCharOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8550 {
8551 unsigned char value2 = op2->uc;
8552
8553 exp->type = 2;
8554 exp->string = PrintUChar(op1->uc || value2);
8555 if(!exp->expType)
8556 {
8557 exp->expType = op1->type;
8558 if(op1->type)
8559 op1->type->refCount++;
8560 }
8561 return 0x1;
8562 }
8563
8564 static unsigned int FloatOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8565 {
8566 float value2 = op2->f;
8567
8568 exp->type = 2;
8569 exp->string = PrintFloat(op1->f || value2);
8570 if(!exp->expType)
8571 {
8572 exp->expType = op1->type;
8573 if(op1->type)
8574 op1->type->refCount++;
8575 }
8576 return 0x1;
8577 }
8578
8579 static unsigned int DoubleOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8580 {
8581 double value2 = op2->d;
8582
8583 exp->type = 2;
8584 exp->string = PrintDouble(op1->d || value2);
8585 if(!exp->expType)
8586 {
8587 exp->expType = op1->type;
8588 if(op1->type)
8589 op1->type->refCount++;
8590 }
8591 return 0x1;
8592 }
8593
8594 static unsigned int IntGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8595 {
8596 int value2 = op2->i;
8597
8598 exp->type = 2;
8599 exp->string = PrintInt(op1->i > value2);
8600 if(!exp->expType)
8601 {
8602 exp->expType = op1->type;
8603 if(op1->type)
8604 op1->type->refCount++;
8605 }
8606 return 0x1;
8607 }
8608
8609 static unsigned int UIntGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8610 {
8611 unsigned int value2 = op2->ui;
8612
8613 exp->type = 2;
8614 exp->string = PrintUInt(op1->ui > value2);
8615 if(!exp->expType)
8616 {
8617 exp->expType = op1->type;
8618 if(op1->type)
8619 op1->type->refCount++;
8620 }
8621 return 0x1;
8622 }
8623
8624 static unsigned int ShortGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8625 {
8626 short value2 = op2->s;
8627
8628 exp->type = 2;
8629 exp->string = PrintShort(op1->s > value2);
8630 if(!exp->expType)
8631 {
8632 exp->expType = op1->type;
8633 if(op1->type)
8634 op1->type->refCount++;
8635 }
8636 return 0x1;
8637 }
8638
8639 static unsigned int UShortGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8640 {
8641 unsigned short value2 = op2->us;
8642
8643 exp->type = 2;
8644 exp->string = PrintUShort(op1->us > value2);
8645 if(!exp->expType)
8646 {
8647 exp->expType = op1->type;
8648 if(op1->type)
8649 op1->type->refCount++;
8650 }
8651 return 0x1;
8652 }
8653
8654 static unsigned int CharGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8655 {
8656 char value2 = op2->c;
8657
8658 exp->type = 2;
8659 exp->string = PrintChar(op1->c > value2);
8660 if(!exp->expType)
8661 {
8662 exp->expType = op1->type;
8663 if(op1->type)
8664 op1->type->refCount++;
8665 }
8666 return 0x1;
8667 }
8668
8669 static unsigned int UCharGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8670 {
8671 unsigned char value2 = op2->uc;
8672
8673 exp->type = 2;
8674 exp->string = PrintUChar(op1->uc > value2);
8675 if(!exp->expType)
8676 {
8677 exp->expType = op1->type;
8678 if(op1->type)
8679 op1->type->refCount++;
8680 }
8681 return 0x1;
8682 }
8683
8684 static unsigned int FloatGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8685 {
8686 float value2 = op2->f;
8687
8688 exp->type = 2;
8689 exp->string = PrintFloat(op1->f > value2);
8690 if(!exp->expType)
8691 {
8692 exp->expType = op1->type;
8693 if(op1->type)
8694 op1->type->refCount++;
8695 }
8696 return 0x1;
8697 }
8698
8699 static unsigned int DoubleGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8700 {
8701 double value2 = op2->d;
8702
8703 exp->type = 2;
8704 exp->string = PrintDouble(op1->d > value2);
8705 if(!exp->expType)
8706 {
8707 exp->expType = op1->type;
8708 if(op1->type)
8709 op1->type->refCount++;
8710 }
8711 return 0x1;
8712 }
8713
8714 static unsigned int IntSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8715 {
8716 int value2 = op2->i;
8717
8718 exp->type = 2;
8719 exp->string = PrintInt(op1->i < value2);
8720 if(!exp->expType)
8721 {
8722 exp->expType = op1->type;
8723 if(op1->type)
8724 op1->type->refCount++;
8725 }
8726 return 0x1;
8727 }
8728
8729 static unsigned int UIntSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8730 {
8731 unsigned int value2 = op2->ui;
8732
8733 exp->type = 2;
8734 exp->string = PrintUInt(op1->ui < value2);
8735 if(!exp->expType)
8736 {
8737 exp->expType = op1->type;
8738 if(op1->type)
8739 op1->type->refCount++;
8740 }
8741 return 0x1;
8742 }
8743
8744 static unsigned int ShortSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8745 {
8746 short value2 = op2->s;
8747
8748 exp->type = 2;
8749 exp->string = PrintShort(op1->s < value2);
8750 if(!exp->expType)
8751 {
8752 exp->expType = op1->type;
8753 if(op1->type)
8754 op1->type->refCount++;
8755 }
8756 return 0x1;
8757 }
8758
8759 static unsigned int UShortSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8760 {
8761 unsigned short value2 = op2->us;
8762
8763 exp->type = 2;
8764 exp->string = PrintUShort(op1->us < value2);
8765 if(!exp->expType)
8766 {
8767 exp->expType = op1->type;
8768 if(op1->type)
8769 op1->type->refCount++;
8770 }
8771 return 0x1;
8772 }
8773
8774 static unsigned int CharSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8775 {
8776 char value2 = op2->c;
8777
8778 exp->type = 2;
8779 exp->string = PrintChar(op1->c < value2);
8780 if(!exp->expType)
8781 {
8782 exp->expType = op1->type;
8783 if(op1->type)
8784 op1->type->refCount++;
8785 }
8786 return 0x1;
8787 }
8788
8789 static unsigned int UCharSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8790 {
8791 unsigned char value2 = op2->uc;
8792
8793 exp->type = 2;
8794 exp->string = PrintUChar(op1->uc < value2);
8795 if(!exp->expType)
8796 {
8797 exp->expType = op1->type;
8798 if(op1->type)
8799 op1->type->refCount++;
8800 }
8801 return 0x1;
8802 }
8803
8804 static unsigned int FloatSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8805 {
8806 float value2 = op2->f;
8807
8808 exp->type = 2;
8809 exp->string = PrintFloat(op1->f < value2);
8810 if(!exp->expType)
8811 {
8812 exp->expType = op1->type;
8813 if(op1->type)
8814 op1->type->refCount++;
8815 }
8816 return 0x1;
8817 }
8818
8819 static unsigned int DoubleSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8820 {
8821 double value2 = op2->d;
8822
8823 exp->type = 2;
8824 exp->string = PrintDouble(op1->d < value2);
8825 if(!exp->expType)
8826 {
8827 exp->expType = op1->type;
8828 if(op1->type)
8829 op1->type->refCount++;
8830 }
8831 return 0x1;
8832 }
8833
8834 static unsigned int IntGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8835 {
8836 int value2 = op2->i;
8837
8838 exp->type = 2;
8839 exp->string = PrintInt(op1->i >= value2);
8840 if(!exp->expType)
8841 {
8842 exp->expType = op1->type;
8843 if(op1->type)
8844 op1->type->refCount++;
8845 }
8846 return 0x1;
8847 }
8848
8849 static unsigned int UIntGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8850 {
8851 unsigned int value2 = op2->ui;
8852
8853 exp->type = 2;
8854 exp->string = PrintUInt(op1->ui >= value2);
8855 if(!exp->expType)
8856 {
8857 exp->expType = op1->type;
8858 if(op1->type)
8859 op1->type->refCount++;
8860 }
8861 return 0x1;
8862 }
8863
8864 static unsigned int ShortGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8865 {
8866 short value2 = op2->s;
8867
8868 exp->type = 2;
8869 exp->string = PrintShort(op1->s >= value2);
8870 if(!exp->expType)
8871 {
8872 exp->expType = op1->type;
8873 if(op1->type)
8874 op1->type->refCount++;
8875 }
8876 return 0x1;
8877 }
8878
8879 static unsigned int UShortGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8880 {
8881 unsigned short value2 = op2->us;
8882
8883 exp->type = 2;
8884 exp->string = PrintUShort(op1->us >= value2);
8885 if(!exp->expType)
8886 {
8887 exp->expType = op1->type;
8888 if(op1->type)
8889 op1->type->refCount++;
8890 }
8891 return 0x1;
8892 }
8893
8894 static unsigned int CharGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8895 {
8896 char value2 = op2->c;
8897
8898 exp->type = 2;
8899 exp->string = PrintChar(op1->c >= value2);
8900 if(!exp->expType)
8901 {
8902 exp->expType = op1->type;
8903 if(op1->type)
8904 op1->type->refCount++;
8905 }
8906 return 0x1;
8907 }
8908
8909 static unsigned int UCharGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8910 {
8911 unsigned char value2 = op2->uc;
8912
8913 exp->type = 2;
8914 exp->string = PrintUChar(op1->uc >= value2);
8915 if(!exp->expType)
8916 {
8917 exp->expType = op1->type;
8918 if(op1->type)
8919 op1->type->refCount++;
8920 }
8921 return 0x1;
8922 }
8923
8924 static unsigned int FloatGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8925 {
8926 float value2 = op2->f;
8927
8928 exp->type = 2;
8929 exp->string = PrintFloat(op1->f >= value2);
8930 if(!exp->expType)
8931 {
8932 exp->expType = op1->type;
8933 if(op1->type)
8934 op1->type->refCount++;
8935 }
8936 return 0x1;
8937 }
8938
8939 static unsigned int DoubleGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8940 {
8941 double value2 = op2->d;
8942
8943 exp->type = 2;
8944 exp->string = PrintDouble(op1->d >= value2);
8945 if(!exp->expType)
8946 {
8947 exp->expType = op1->type;
8948 if(op1->type)
8949 op1->type->refCount++;
8950 }
8951 return 0x1;
8952 }
8953
8954 static unsigned int IntSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8955 {
8956 int value2 = op2->i;
8957
8958 exp->type = 2;
8959 exp->string = PrintInt(op1->i <= value2);
8960 if(!exp->expType)
8961 {
8962 exp->expType = op1->type;
8963 if(op1->type)
8964 op1->type->refCount++;
8965 }
8966 return 0x1;
8967 }
8968
8969 static unsigned int UIntSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8970 {
8971 unsigned int value2 = op2->ui;
8972
8973 exp->type = 2;
8974 exp->string = PrintUInt(op1->ui <= value2);
8975 if(!exp->expType)
8976 {
8977 exp->expType = op1->type;
8978 if(op1->type)
8979 op1->type->refCount++;
8980 }
8981 return 0x1;
8982 }
8983
8984 static unsigned int ShortSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8985 {
8986 short value2 = op2->s;
8987
8988 exp->type = 2;
8989 exp->string = PrintShort(op1->s <= value2);
8990 if(!exp->expType)
8991 {
8992 exp->expType = op1->type;
8993 if(op1->type)
8994 op1->type->refCount++;
8995 }
8996 return 0x1;
8997 }
8998
8999 static unsigned int UShortSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9000 {
9001 unsigned short value2 = op2->us;
9002
9003 exp->type = 2;
9004 exp->string = PrintUShort(op1->us <= value2);
9005 if(!exp->expType)
9006 {
9007 exp->expType = op1->type;
9008 if(op1->type)
9009 op1->type->refCount++;
9010 }
9011 return 0x1;
9012 }
9013
9014 static unsigned int CharSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9015 {
9016 char value2 = op2->c;
9017
9018 exp->type = 2;
9019 exp->string = PrintChar(op1->c <= value2);
9020 if(!exp->expType)
9021 {
9022 exp->expType = op1->type;
9023 if(op1->type)
9024 op1->type->refCount++;
9025 }
9026 return 0x1;
9027 }
9028
9029 static unsigned int UCharSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9030 {
9031 unsigned char value2 = op2->uc;
9032
9033 exp->type = 2;
9034 exp->string = PrintUChar(op1->uc <= value2);
9035 if(!exp->expType)
9036 {
9037 exp->expType = op1->type;
9038 if(op1->type)
9039 op1->type->refCount++;
9040 }
9041 return 0x1;
9042 }
9043
9044 static unsigned int FloatSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9045 {
9046 float value2 = op2->f;
9047
9048 exp->type = 2;
9049 exp->string = PrintFloat(op1->f <= value2);
9050 if(!exp->expType)
9051 {
9052 exp->expType = op1->type;
9053 if(op1->type)
9054 op1->type->refCount++;
9055 }
9056 return 0x1;
9057 }
9058
9059 static unsigned int DoubleSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9060 {
9061 double value2 = op2->d;
9062
9063 exp->type = 2;
9064 exp->string = PrintDouble(op1->d <= value2);
9065 if(!exp->expType)
9066 {
9067 exp->expType = op1->type;
9068 if(op1->type)
9069 op1->type->refCount++;
9070 }
9071 return 0x1;
9072 }
9073
9074 static unsigned int IntCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
9075 {
9076 exp->type = 2;
9077 exp->string = PrintInt(op1->i ? op2->i : op3->i);
9078 if(!exp->expType)
9079 {
9080 exp->expType = op1->type;
9081 if(op1->type)
9082 op1->type->refCount++;
9083 }
9084 return 0x1;
9085 }
9086
9087 static unsigned int UIntCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
9088 {
9089 exp->type = 2;
9090 exp->string = PrintUInt(op1->ui ? op2->ui : op3->ui);
9091 if(!exp->expType)
9092 {
9093 exp->expType = op1->type;
9094 if(op1->type)
9095 op1->type->refCount++;
9096 }
9097 return 0x1;
9098 }
9099
9100 static unsigned int ShortCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
9101 {
9102 exp->type = 2;
9103 exp->string = PrintShort(op1->s ? op2->s : op3->s);
9104 if(!exp->expType)
9105 {
9106 exp->expType = op1->type;
9107 if(op1->type)
9108 op1->type->refCount++;
9109 }
9110 return 0x1;
9111 }
9112
9113 static unsigned int UShortCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
9114 {
9115 exp->type = 2;
9116 exp->string = PrintUShort(op1->us ? op2->us : op3->us);
9117 if(!exp->expType)
9118 {
9119 exp->expType = op1->type;
9120 if(op1->type)
9121 op1->type->refCount++;
9122 }
9123 return 0x1;
9124 }
9125
9126 static unsigned int CharCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
9127 {
9128 exp->type = 2;
9129 exp->string = PrintChar(op1->c ? op2->c : op3->c);
9130 if(!exp->expType)
9131 {
9132 exp->expType = op1->type;
9133 if(op1->type)
9134 op1->type->refCount++;
9135 }
9136 return 0x1;
9137 }
9138
9139 static unsigned int UCharCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
9140 {
9141 exp->type = 2;
9142 exp->string = PrintUChar(op1->uc ? op2->uc : op3->uc);
9143 if(!exp->expType)
9144 {
9145 exp->expType = op1->type;
9146 if(op1->type)
9147 op1->type->refCount++;
9148 }
9149 return 0x1;
9150 }
9151
9152 static unsigned int FloatCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
9153 {
9154 exp->type = 2;
9155 exp->string = PrintFloat(op1->f ? op2->f : op3->f);
9156 if(!exp->expType)
9157 {
9158 exp->expType = op1->type;
9159 if(op1->type)
9160 op1->type->refCount++;
9161 }
9162 return 0x1;
9163 }
9164
9165 static unsigned int DoubleCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
9166 {
9167 exp->type = 2;
9168 exp->string = PrintDouble(op1->d ? op2->d : op3->d);
9169 if(!exp->expType)
9170 {
9171 exp->expType = op1->type;
9172 if(op1->type)
9173 op1->type->refCount++;
9174 }
9175 return 0x1;
9176 }
9177
9178 struct OpTable intOps = 
9179 {
9180 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
9181 };
9182
9183 struct OpTable uintOps = 
9184 {
9185 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
9186 };
9187
9188 struct OpTable shortOps = 
9189 {
9190 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
9191 };
9192
9193 struct OpTable ushortOps = 
9194 {
9195 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
9196 };
9197
9198 struct OpTable floatOps = 
9199 {
9200 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
9201 };
9202
9203 struct OpTable doubleOps = 
9204 {
9205 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
9206 };
9207
9208 struct OpTable charOps = 
9209 {
9210 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
9211 };
9212
9213 struct OpTable ucharOps = 
9214 {
9215 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
9216 };
9217
9218 void ReadString(char * output, char * string)
9219 {
9220 int len = strlen(string);
9221 int c, d = 0;
9222 unsigned int quoted = 0x0, escaped = 0x0;
9223
9224 for(c = 0; c < len; c++)
9225 {
9226 char ch = string[c];
9227
9228 if(escaped)
9229 {
9230 switch(ch)
9231 {
9232 case 'n':
9233 output[d] = '\n';
9234 break;
9235 case 't':
9236 output[d] = '\t';
9237 break;
9238 case 'a':
9239 output[d] = '\a';
9240 break;
9241 case 'b':
9242 output[d] = '\b';
9243 break;
9244 case 'f':
9245 output[d] = '\f';
9246 break;
9247 case 'r':
9248 output[d] = '\r';
9249 break;
9250 case 'v':
9251 output[d] = '\v';
9252 break;
9253 case '\\':
9254 output[d] = '\\';
9255 break;
9256 case '\"':
9257 output[d] = '\"';
9258 break;
9259 default:
9260 output[d++] = '\\';
9261 output[d] = ch;
9262 }
9263 d++;
9264 escaped = 0x0;
9265 }
9266 else
9267 {
9268 if(ch == '\"')
9269 quoted ^= 0x1;
9270 else if(quoted)
9271 {
9272 if(ch == '\\')
9273 escaped = 0x1;
9274 else
9275 output[d++] = ch;
9276 }
9277 }
9278 }
9279 output[d] = '\0';
9280 }
9281
9282 extern double strtod(char * , char * * );
9283
9284 struct Operand GetOperand(struct Expression * exp)
9285 {
9286 struct Operand op = 
9287 {
9288 0, 0, 0, 0, 
9289 {
9290 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
9291 }
9292 };
9293 struct Type * type = exp->expType;
9294
9295 if(type)
9296 {
9297 while(type->kind == 8 && type->_class->registered && (type->_class->registered->type == 2 || type->_class->registered->type == 3 || type->_class->registered->type == 4))
9298 {
9299 if(!type->_class->registered->dataType)
9300 type->_class->registered->dataType = ProcessTypeString(type->_class->registered->dataTypeString, 0x0);
9301 type = type->_class->registered->dataType;
9302 }
9303 op.kind = type->kind;
9304 op.type = exp->expType;
9305 if(exp->isConstant && exp->type == 2)
9306 {
9307 switch(op.kind)
9308 {
9309 case 1:
9310 {
9311 if(exp->constant[0] == '\'')
9312 op.c = exp->constant[1];
9313 else if(type->isSigned)
9314 {
9315 op.c = (char)strtol(exp->constant, (((void *)0)), 0);
9316 op.ops = charOps;
9317 }
9318 else
9319 {
9320 op.uc = (unsigned char)strtoul(exp->constant, (((void *)0)), 0);
9321 op.ops = ucharOps;
9322 }
9323 break;
9324 }
9325 case 2:
9326 if(type->isSigned)
9327 {
9328 op.s = (short)strtol(exp->constant, (((void *)0)), 0);
9329 op.ops = shortOps;
9330 }
9331 else
9332 {
9333 op.us = (unsigned short)strtoul(exp->constant, (((void *)0)), 0);
9334 op.ops = ushortOps;
9335 }
9336 break;
9337 case 3:
9338 case 5:
9339 if(type->isSigned)
9340 {
9341 op.i = strtol(exp->constant, (((void *)0)), 0);
9342 op.ops = intOps;
9343 }
9344 else
9345 {
9346 op.ui = strtoul(exp->constant, (((void *)0)), 0);
9347 op.ops = uintOps;
9348 }
9349 op.kind = 3;
9350 break;
9351 case 4:
9352 if(type->isSigned)
9353 {
9354 op.i64 = _strtoi64(exp->constant, (((void *)0)), 0);
9355 op.ops = intOps;
9356 }
9357 else
9358 {
9359 op.ui64 = _strtoui64(exp->constant, (((void *)0)), 0);
9360 op.ops = uintOps;
9361 }
9362 op.kind = 3;
9363 break;
9364 case 22:
9365 if(type->isSigned)
9366 {
9367 op.iptr = (intptr_t)_strtoi64(exp->constant, (((void *)0)), 0);
9368 op.ops = intOps;
9369 }
9370 else
9371 {
9372 op.uiptr = (uintptr_t)_strtoui64(exp->constant, (((void *)0)), 0);
9373 op.ops = uintOps;
9374 }
9375 op.kind = 3;
9376 break;
9377 case 6:
9378 op.f = (float)strtod(exp->constant, (((void *)0)));
9379 op.ops = floatOps;
9380 break;
9381 case 7:
9382 op.d = (double)strtod(exp->constant, (((void *)0)));
9383 op.ops = doubleOps;
9384 break;
9385 case 12:
9386 case 13:
9387 case 8:
9388 op.p = (unsigned char *)strtoul(exp->constant, (((void *)0)), 0);
9389 op.kind = 13;
9390 op.ops = uintOps;
9391 break;
9392 }
9393 }
9394 }
9395 return op;
9396 }
9397
9398 int __ecereVMethodID_class_OnGetString;
9399
9400 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_int;
9401
9402 static void UnusedFunction()
9403 {
9404 int a;
9405
9406 ((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);
9407 }
9408
9409 extern int __ecereVMethodID_class_OnGetString;
9410
9411 static void PopulateInstanceProcessMember(struct Instantiation * inst, struct __ecereNameSpace__ecere__sys__OldList * memberList, struct __ecereNameSpace__ecere__com__DataMember * parentDataMember, unsigned int offset)
9412 {
9413 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
9414
9415 for(dataMember = parentDataMember->members.first; dataMember; dataMember = dataMember->next)
9416 {
9417 if(!dataMember->name && (dataMember->type == 2 || dataMember->type == 1))
9418 PopulateInstanceProcessMember(inst, memberList, dataMember, offset + dataMember->offset);
9419 else
9420 {
9421 struct Expression * exp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
9422 struct MemberInit * member = MkMemberInit(MkListOne(MkIdentifier(dataMember->name)), MkInitializerAssignment(exp));
9423 struct Type * type;
9424 void * ptr = inst->data + dataMember->offset + offset;
9425 char * result = (((void *)0));
9426
9427 exp->loc = member->loc = inst->loc;
9428 ((struct Identifier *)(*member->identifiers).first)->loc = inst->loc;
9429 if(!dataMember->dataType)
9430 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
9431 type = dataMember->dataType;
9432 if(type->kind == 8)
9433 {
9434 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
9435
9436 if(_class->type == 4)
9437 {
9438 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
9439
9440 if(enumClass)
9441 {
9442 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
9443 struct __ecereNameSpace__ecere__sys__NamedLink * item;
9444
9445 for(item = e->values.first; item; item = item->next)
9446 {
9447 if((int)item->data == *(int *)ptr)
9448 {
9449 result = item->name;
9450 break;
9451 }
9452 }
9453 if(result)
9454 {
9455 exp->identifier = MkIdentifier(result);
9456 exp->type = 0;
9457 exp->destType = MkClassType(_class->fullName);
9458 ProcessExpressionType(exp);
9459 }
9460 }
9461 }
9462 if(_class->type == 4 || _class->type == 3 || _class->type == 2)
9463 {
9464 if(!_class->dataType)
9465 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
9466 type = _class->dataType;
9467 }
9468 }
9469 if(!result)
9470 {
9471 switch(type->kind)
9472 {
9473 case 6:
9474 {
9475 FreeExpContents(exp);
9476 exp->constant = PrintFloat(*(float *)ptr);
9477 exp->type = 2;
9478 break;
9479 }
9480 case 7:
9481 {
9482 FreeExpContents(exp);
9483 exp->constant = PrintDouble(*(double *)ptr);
9484 exp->type = 2;
9485 break;
9486 }
9487 case 3:
9488 {
9489 FreeExpContents(exp);
9490 exp->constant = PrintInt(*(int *)ptr);
9491 exp->type = 2;
9492 break;
9493 }
9494 case 4:
9495 {
9496 FreeExpContents(exp);
9497 exp->constant = PrintInt64(*(long long *)ptr);
9498 exp->type = 2;
9499 break;
9500 }
9501 case 22:
9502 {
9503 FreeExpContents(exp);
9504 exp->constant = PrintInt64((long long)*(intptr_t *)ptr);
9505 exp->type = 2;
9506 break;
9507 }
9508 default:
9509 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Unhandled type populating instance\n", (((void *)0))));
9510 }
9511 }
9512 ListAdd(memberList, member);
9513 }
9514 if(parentDataMember->type == 1)
9515 break;
9516 }
9517 }
9518
9519 extern struct MembersInit * MkMembersInitList(struct __ecereNameSpace__ecere__sys__OldList * dataMembers);
9520
9521 void PopulateInstance(struct Instantiation * inst)
9522 {
9523 struct Symbol * classSym = inst->_class->symbol;
9524 struct __ecereNameSpace__ecere__com__Class * _class = classSym->registered;
9525 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
9526 struct __ecereNameSpace__ecere__sys__OldList * memberList = MkList();
9527
9528 inst->members = MkListOne(MkMembersInitList(memberList));
9529 for(dataMember = _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
9530 {
9531 if(!dataMember->isProperty)
9532 {
9533 if(!dataMember->name && (dataMember->type == 2 || dataMember->type == 1))
9534 PopulateInstanceProcessMember(inst, memberList, dataMember, dataMember->offset);
9535 else
9536 {
9537 struct Expression * exp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
9538 struct MemberInit * member = MkMemberInit(MkListOne(MkIdentifier(dataMember->name)), MkInitializerAssignment(exp));
9539 struct Type * type;
9540 void * ptr = inst->data + dataMember->offset;
9541 char * result = (((void *)0));
9542
9543 exp->loc = member->loc = inst->loc;
9544 ((struct Identifier *)(*member->identifiers).first)->loc = inst->loc;
9545 if(!dataMember->dataType)
9546 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
9547 type = dataMember->dataType;
9548 if(type->kind == 8)
9549 {
9550 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
9551
9552 if(_class->type == 4)
9553 {
9554 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
9555
9556 if(enumClass)
9557 {
9558 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
9559 struct __ecereNameSpace__ecere__sys__NamedLink * item;
9560
9561 for(item = e->values.first; item; item = item->next)
9562 {
9563 if((int)item->data == *(int *)ptr)
9564 {
9565 result = item->name;
9566 break;
9567 }
9568 }
9569 }
9570 if(result)
9571 {
9572 exp->identifier = MkIdentifier(result);
9573 exp->type = 0;
9574 exp->destType = MkClassType(_class->fullName);
9575 ProcessExpressionType(exp);
9576 }
9577 }
9578 if(_class->type == 4 || _class->type == 3 || _class->type == 2)
9579 {
9580 if(!_class->dataType)
9581 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
9582 type = _class->dataType;
9583 }
9584 }
9585 if(!result)
9586 {
9587 switch(type->kind)
9588 {
9589 case 6:
9590 {
9591 exp->constant = PrintFloat(*(float *)ptr);
9592 exp->type = 2;
9593 break;
9594 }
9595 case 7:
9596 {
9597 exp->constant = PrintDouble(*(double *)ptr);
9598 exp->type = 2;
9599 break;
9600 }
9601 case 3:
9602 {
9603 exp->constant = PrintInt(*(int *)ptr);
9604 exp->type = 2;
9605 break;
9606 }
9607 case 4:
9608 {
9609 exp->constant = PrintInt64(*(long long *)ptr);
9610 exp->type = 2;
9611 break;
9612 }
9613 case 22:
9614 {
9615 exp->constant = PrintInt64((long long)*(intptr_t *)ptr);
9616 exp->type = 2;
9617 break;
9618 }
9619 default:
9620 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Unhandled type populating instance\n", (((void *)0))));
9621 }
9622 }
9623 ListAdd(memberList, member);
9624 }
9625 }
9626 }
9627 }
9628
9629 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);
9630
9631 extern void FreeInstance(struct Instantiation * inst);
9632
9633 void ComputeInstantiation(struct Expression * exp)
9634 {
9635 struct Instantiation * inst = exp->instance;
9636 struct MembersInit * members;
9637 struct Symbol * classSym = inst->_class ? inst->_class->symbol : (((void *)0));
9638 struct __ecereNameSpace__ecere__com__Class * _class = classSym ? classSym->registered : (((void *)0));
9639 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
9640 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
9641 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
9642 int subMemberStackPos = 0;
9643 uint64 bits = 0;
9644
9645 if(_class && (_class->type == 1 || _class->type == 0 || _class->type == 5))
9646 {
9647 if(inst->data)
9648 return ;
9649 if(_class->type == 0 || _class->type == 5)
9650 inst->data = (unsigned char *)__ecereNameSpace__ecere__com__eInstance_New(_class);
9651 else
9652 inst->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
9653 }
9654 if(inst->members)
9655 {
9656 for(members = (*inst->members).first; members; members = members->next)
9657 {
9658 switch(members->type)
9659 {
9660 case 0:
9661 {
9662 if(members->dataMembers)
9663 {
9664 struct MemberInit * member;
9665
9666 for(member = (*members->dataMembers).first; member; member = member->next)
9667 {
9668 struct Identifier * ident = member->identifiers ? (*member->identifiers).first : (((void *)0));
9669 unsigned int found = 0x0;
9670 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
9671 struct __ecereNameSpace__ecere__com__DataMember * dataMember = (((void *)0));
9672 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
9673 unsigned int dataMemberOffset;
9674
9675 if(!ident)
9676 {
9677 __ecereNameSpace__ecere__com__eClass_FindNextMember(_class, &curClass, &curMember, subMemberStack, &subMemberStackPos);
9678 if(curMember)
9679 {
9680 if(curMember->isProperty)
9681 prop = (struct __ecereNameSpace__ecere__com__Property *)curMember;
9682 else
9683 {
9684 dataMember = curMember;
9685 __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(_class, dataMember->name, &dataMemberOffset, privateModule, (((void *)0)), (((void *)0)));
9686 }
9687 found = 0x1;
9688 }
9689 }
9690 else
9691 {
9692 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, ident->string, privateModule);
9693 if(prop)
9694 {
9695 found = 0x1;
9696 if(prop->memberAccess == 1)
9697 {
9698 curMember = (struct __ecereNameSpace__ecere__com__DataMember *)prop;
9699 curClass = prop->_class;
9700 }
9701 }
9702 else
9703 {
9704 struct __ecereNameSpace__ecere__com__DataMember * _subMemberStack[256];
9705 int _subMemberStackPos = 0;
9706
9707 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(_class, ident->string, &dataMemberOffset, privateModule, _subMemberStack, &_subMemberStackPos);
9708 if(dataMember)
9709 {
9710 found = 0x1;
9711 if(dataMember->memberAccess == 1)
9712 {
9713 curMember = dataMember;
9714 curClass = dataMember->_class;
9715 memcpy(subMemberStack, _subMemberStack, sizeof(int) * _subMemberStackPos);
9716 subMemberStackPos = _subMemberStackPos;
9717 }
9718 }
9719 }
9720 }
9721 if(found && member->initializer && member->initializer->type == 0)
9722 {
9723 struct Expression * value = member->initializer->exp;
9724 struct Type * type = (((void *)0));
9725
9726 if(prop)
9727 {
9728 type = prop->dataType;
9729 }
9730 else if(dataMember)
9731 {
9732 if(!dataMember->dataType)
9733 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
9734 type = dataMember->dataType;
9735 }
9736 if(ident && ident->next)
9737 {
9738 for(ident = ident->next; ident && type; ident = ident->next)
9739 {
9740 if(type->kind == 8)
9741 {
9742 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(type->_class->registered, ident->string, privateModule);
9743 if(prop)
9744 type = prop->dataType;
9745 else
9746 {
9747 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(type->_class->registered, ident->string, &dataMemberOffset, privateModule, (((void *)0)), (((void *)0)));
9748 if(dataMember)
9749 type = dataMember->dataType;
9750 }
9751 }
9752 else if(type->kind == 9 || type->kind == 10)
9753 {
9754 struct Type * memberType;
9755
9756 for(memberType = type->members.first; memberType; memberType = memberType->next)
9757 {
9758 if(!strcmp(memberType->name, ident->string))
9759 {
9760 type = memberType;
9761 break;
9762 }
9763 }
9764 }
9765 }
9766 }
9767 if(value)
9768 {
9769 FreeType(value->destType);
9770 value->destType = type;
9771 if(type)
9772 type->refCount++;
9773 ComputeExpression(value);
9774 }
9775 if(value && (_class->type == 1 || _class->type == 0 || _class->type == 5))
9776 {
9777 if(type->kind == 8)
9778 {
9779 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
9780
9781 if(_class->type == 2 || _class->type == 3 || _class->type == 4)
9782 {
9783 if(!_class->dataType)
9784 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
9785 type = _class->dataType;
9786 }
9787 }
9788 if(dataMember)
9789 {
9790 void * ptr = inst->data + dataMemberOffset;
9791
9792 if(value->type == 2)
9793 {
9794 switch(type->kind)
9795 {
9796 case 3:
9797 {
9798 GetInt(value, (int *)ptr);
9799 break;
9800 }
9801 case 4:
9802 {
9803 GetInt64(value, (long long *)ptr);
9804 break;
9805 }
9806 case 22:
9807 {
9808 GetIntPtr(value, (intptr_t *)ptr);
9809 break;
9810 }
9811 case 6:
9812 {
9813 GetFloat(value, (float *)ptr);
9814 break;
9815 }
9816 case 7:
9817 {
9818 GetDouble(value, (double *)ptr);
9819 break;
9820 }
9821 }
9822 }
9823 else if(value->type == 1)
9824 {
9825 if(type->kind == 8)
9826 {
9827 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
9828
9829 if(_class->type == 1)
9830 {
9831 ComputeTypeSize(type);
9832 if(value->instance->data)
9833 memcpy(ptr, value->instance->data, type->size);
9834 }
9835 }
9836 }
9837 }
9838 else if(prop)
9839 {
9840 if(value->type == 1 && value->instance->data)
9841 {
9842 void (* Set)(void *, void *) = (void *)prop->Set;
9843
9844 Set(inst->data, value->instance->data);
9845 PopulateInstance(inst);
9846 }
9847 else if(value->type == 2)
9848 {
9849 switch(type->kind)
9850 {
9851 case 7:
9852 {
9853 void (* Set)(void *, double) = (void *)prop->Set;
9854
9855 Set(inst->data, strtod(value->constant, (((void *)0))));
9856 break;
9857 }
9858 case 6:
9859 {
9860 void (* Set)(void *, float) = (void *)prop->Set;
9861
9862 Set(inst->data, (float)(strtod(value->constant, (((void *)0)))));
9863 break;
9864 }
9865 case 3:
9866 {
9867 void (* Set)(void *, int) = (void *)prop->Set;
9868
9869 Set(inst->data, strtol(value->constant, (((void *)0)), 0));
9870 break;
9871 }
9872 case 4:
9873 {
9874 void (* Set)(void *, long long) = (void *)prop->Set;
9875
9876 Set(inst->data, _strtoi64(value->constant, (((void *)0)), 0));
9877 break;
9878 }
9879 case 22:
9880 {
9881 void (* Set)(void *, intptr_t) = (void *)prop->Set;
9882
9883 Set(inst->data, (intptr_t)_strtoi64(value->constant, (((void *)0)), 0));
9884 break;
9885 }
9886 }
9887 }
9888 else if(value->type == 3)
9889 {
9890 char temp[1024];
9891
9892 ReadString(temp, value->string);
9893 prop->Set(inst->data, temp);
9894 }
9895 }
9896 }
9897 else if(_class->type == 3)
9898 {
9899 if(prop)
9900 {
9901 if(value->type == 2)
9902 {
9903 if(type->kind == 8)
9904 {
9905 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
9906
9907 if(_class->type == 3)
9908 {
9909 if(!_class->dataType)
9910 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
9911 type = _class->dataType;
9912 }
9913 }
9914 switch(type->kind)
9915 {
9916 case 6:
9917 {
9918 float fValue;
9919 float (* Set)(float) = (void *)prop->Set;
9920
9921 GetFloat(member->initializer->exp, &fValue);
9922 exp->constant = PrintFloat(Set(fValue));
9923 exp->type = 2;
9924 break;
9925 }
9926 case 7:
9927 {
9928 double dValue;
9929 double (* Set)(double) = (void *)prop->Set;
9930
9931 GetDouble(member->initializer->exp, &dValue);
9932 exp->constant = PrintDouble(Set(dValue));
9933 exp->type = 2;
9934 break;
9935 }
9936 }
9937 }
9938 }
9939 }
9940 else if(_class->type == 2)
9941 {
9942 if(prop)
9943 {
9944 if(value->type == 1 && value->instance->data)
9945 {
9946 unsigned int (* Set)(void *) = (void *)prop->Set;
9947
9948 bits = Set(value->instance->data);
9949 }
9950 else if(value->type == 2)
9951 {
9952 }
9953 }
9954 else if(dataMember)
9955 {
9956 struct __ecereNameSpace__ecere__com__BitMember * bitMember = (struct __ecereNameSpace__ecere__com__BitMember *)dataMember;
9957 struct Type * type;
9958 int part = 0;
9959
9960 GetInt(value, &part);
9961 bits = (bits & ~bitMember->mask);
9962 if(!bitMember->dataType)
9963 bitMember->dataType = ProcessTypeString(bitMember->dataTypeString, 0x0);
9964 type = bitMember->dataType;
9965 if(type->kind == 8 && type->_class && type->_class->registered)
9966 {
9967 if(!type->_class->registered->dataType)
9968 type->_class->registered->dataType = ProcessTypeString(type->_class->registered->dataTypeString, 0x0);
9969 type = type->_class->registered->dataType;
9970 }
9971 switch(type->kind)
9972 {
9973 case 1:
9974 if(type->isSigned)
9975 bits |= ((char)part << bitMember->pos);
9976 else
9977 bits |= ((unsigned char)part << bitMember->pos);
9978 break;
9979 case 2:
9980 if(type->isSigned)
9981 bits |= ((short)part << bitMember->pos);
9982 else
9983 bits |= ((unsigned short)part << bitMember->pos);
9984 break;
9985 case 3:
9986 case 5:
9987 if(type->isSigned)
9988 bits |= (part << bitMember->pos);
9989 else
9990 bits |= ((unsigned int)part << bitMember->pos);
9991 break;
9992 case 4:
9993 if(type->isSigned)
9994 bits |= ((long long)part << bitMember->pos);
9995 else
9996 bits |= ((uint64)part << bitMember->pos);
9997 break;
9998 case 22:
9999 if(type->isSigned)
10000 bits |= ((intptr_t)part << bitMember->pos);
10001 else
10002 bits |= ((uintptr_t)part << bitMember->pos);
10003 break;
10004 }
10005 }
10006 }
10007 }
10008 else
10009 {
10010 if(_class && _class->type == 3)
10011 {
10012 ComputeExpression(member->initializer->exp);
10013 exp->constant = member->initializer->exp->constant;
10014 exp->type = 2;
10015 member->initializer->exp->constant = (((void *)0));
10016 }
10017 }
10018 }
10019 }
10020 break;
10021 }
10022 }
10023 }
10024 }
10025 if(_class && _class->type == 2)
10026 {
10027 exp->constant = PrintHexUInt(bits);
10028 exp->type = 2;
10029 }
10030 if(exp->type != 1)
10031 {
10032 FreeInstance(inst);
10033 }
10034 }
10035
10036 void CallOperator(struct Expression * exp, struct Expression * exp1, struct Expression * exp2, struct Operand * op1, struct Operand * op2)
10037 {
10038 if(exp->op.op == SIZEOF)
10039 {
10040 FreeExpContents(exp);
10041 exp->type = 2;
10042 exp->constant = PrintUInt(ComputeTypeSize(op1->type));
10043 }
10044 else
10045 {
10046 if(!exp->op.exp1)
10047 {
10048 switch(exp->op.op)
10049 {
10050 case '+':
10051 {
10052 struct Expression * exp2 = exp->op.exp2;
10053
10054 exp->op.exp2 = (((void *)0));
10055 FreeExpContents(exp);
10056 FreeType(exp->expType);
10057 FreeType(exp->destType);
10058 *exp = *exp2;
10059 ((exp2 ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(exp2) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(exp2)) : 0), exp2 = 0);
10060 break;
10061 }
10062 case '-':
10063 if(op1->ops.Neg)
10064 {
10065 FreeExpContents(exp);
10066 op1->ops.Neg(exp, op1);
10067 }
10068 break;
10069 case '~':
10070 if(op1->ops.BitNot)
10071 {
10072 FreeExpContents(exp);
10073 op1->ops.BitNot(exp, op1);
10074 }
10075 break;
10076 case '!':
10077 if(op1->ops.Not)
10078 {
10079 FreeExpContents(exp);
10080 op1->ops.Not(exp, op1);
10081 }
10082 break;
10083 }
10084 }
10085 else
10086 {
10087 switch(exp->op.op)
10088 {
10089 case '+':
10090 if(op1->ops.Add)
10091 {
10092 FreeExpContents(exp);
10093 op1->ops.Add(exp, op1, op2);
10094 }
10095 break;
10096 case '-':
10097 if(op1->ops.Sub)
10098 {
10099 FreeExpContents(exp);
10100 op1->ops.Sub(exp, op1, op2);
10101 }
10102 break;
10103 case '*':
10104 if(op1->ops.Mul)
10105 {
10106 FreeExpContents(exp);
10107 op1->ops.Mul(exp, op1, op2);
10108 }
10109 break;
10110 case '/':
10111 if(op1->ops.Div)
10112 {
10113 FreeExpContents(exp);
10114 op1->ops.Div(exp, op1, op2);
10115 }
10116 break;
10117 case '%':
10118 if(op1->ops.Mod)
10119 {
10120 FreeExpContents(exp);
10121 op1->ops.Mod(exp, op1, op2);
10122 }
10123 break;
10124 case '&':
10125 if(exp->op.exp2)
10126 {
10127 if(op1->ops.BitAnd)
10128 {
10129 FreeExpContents(exp);
10130 op1->ops.BitAnd(exp, op1, op2);
10131 }
10132 }
10133 break;
10134 case '|':
10135 if(op1->ops.BitOr)
10136 {
10137 FreeExpContents(exp);
10138 op1->ops.BitOr(exp, op1, op2);
10139 }
10140 break;
10141 case '^':
10142 if(op1->ops.BitXor)
10143 {
10144 FreeExpContents(exp);
10145 op1->ops.BitXor(exp, op1, op2);
10146 }
10147 break;
10148 case LEFT_OP:
10149 if(op1->ops.LShift)
10150 {
10151 FreeExpContents(exp);
10152 op1->ops.LShift(exp, op1, op2);
10153 }
10154 break;
10155 case RIGHT_OP:
10156 if(op1->ops.RShift)
10157 {
10158 FreeExpContents(exp);
10159 op1->ops.RShift(exp, op1, op2);
10160 }
10161 break;
10162 case EQ_OP:
10163 if(op1->ops.Equ)
10164 {
10165 FreeExpContents(exp);
10166 op1->ops.Equ(exp, op1, op2);
10167 }
10168 break;
10169 case NE_OP:
10170 if(op1->ops.Nqu)
10171 {
10172 FreeExpContents(exp);
10173 op1->ops.Nqu(exp, op1, op2);
10174 }
10175 break;
10176 case AND_OP:
10177 if(op1->ops.And)
10178 {
10179 FreeExpContents(exp);
10180 op1->ops.And(exp, op1, op2);
10181 }
10182 break;
10183 case OR_OP:
10184 if(op1->ops.Or)
10185 {
10186 FreeExpContents(exp);
10187 op1->ops.Or(exp, op1, op2);
10188 }
10189 break;
10190 case '>':
10191 if(op1->ops.Grt)
10192 {
10193 FreeExpContents(exp);
10194 op1->ops.Grt(exp, op1, op2);
10195 }
10196 break;
10197 case '<':
10198 if(op1->ops.Sma)
10199 {
10200 FreeExpContents(exp);
10201 op1->ops.Sma(exp, op1, op2);
10202 }
10203 break;
10204 case GE_OP:
10205 if(op1->ops.GrtEqu)
10206 {
10207 FreeExpContents(exp);
10208 op1->ops.GrtEqu(exp, op1, op2);
10209 }
10210 break;
10211 case LE_OP:
10212 if(op1->ops.SmaEqu)
10213 {
10214 FreeExpContents(exp);
10215 op1->ops.SmaEqu(exp, op1, op2);
10216 }
10217 break;
10218 }
10219 }
10220 }
10221 }
10222
10223 extern struct Expression * MkExpIdentifier(struct Identifier * id);
10224
10225 void ComputeExpression(struct Expression * exp)
10226 {
10227 char expString[10240];
10228
10229 expString[0] = '\0';
10230 switch(exp->type)
10231 {
10232 case 1:
10233 {
10234 ComputeInstantiation(exp);
10235 break;
10236 }
10237 case 4:
10238 {
10239 struct Expression * exp1, * exp2 = (((void *)0));
10240 struct Operand op1 = 
10241 {
10242 0, 0, 0, 0, 
10243 {
10244 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
10245 }
10246 };
10247 struct Operand op2 = 
10248 {
10249 0, 0, 0, 0, 
10250 {
10251 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
10252 }
10253 };
10254
10255 if(exp->op.exp2)
10256 ComputeExpression(exp->op.exp2);
10257 if(exp->op.exp1)
10258 {
10259 ComputeExpression(exp->op.exp1);
10260 exp1 = exp->op.exp1;
10261 exp2 = exp->op.exp2;
10262 op1 = GetOperand(exp1);
10263 if(op1.type)
10264 op1.type->refCount++;
10265 if(exp2)
10266 {
10267 op2 = GetOperand(exp2);
10268 if(op2.type)
10269 op2.type->refCount++;
10270 }
10271 }
10272 else
10273 {
10274 exp1 = exp->op.exp2;
10275 op1 = GetOperand(exp1);
10276 if(op1.type)
10277 op1.type->refCount++;
10278 }
10279 CallOperator(exp, exp1, exp2, &op1, &op2);
10280 if(op1.type)
10281 FreeType(op1.type);
10282 if(op2.type)
10283 FreeType(op2.type);
10284 break;
10285 }
10286 case 5:
10287 case 34:
10288 {
10289 struct Expression * e, * n;
10290
10291 for(e = (*exp->list).first; e; e = n)
10292 {
10293 n = e->next;
10294 if(!n)
10295 {
10296 struct __ecereNameSpace__ecere__sys__OldList * list = exp->list;
10297
10298 ComputeExpression(e);
10299 FreeType(exp->expType);
10300 FreeType(exp->destType);
10301 *exp = *e;
10302 ((e ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(e) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(e)) : 0), e = 0);
10303 (__ecereNameSpace__ecere__com__eSystem_Delete(list), list = 0);
10304 }
10305 else
10306 {
10307 FreeExpression(e);
10308 }
10309 }
10310 break;
10311 }
10312 case 8:
10313 {
10314 struct Expression * memberExp = exp->member.exp;
10315 struct Identifier * memberID = exp->member.member;
10316 struct Type * type;
10317
10318 ComputeExpression(exp->member.exp);
10319 type = exp->member.exp->expType;
10320 if(type)
10321 {
10322 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)));
10323 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
10324 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
10325 struct __ecereNameSpace__ecere__com__Class * convertTo = (((void *)0));
10326
10327 if(type->kind == 19 && exp->member.exp->type == 26)
10328 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "ecere::com::Class");
10329 if(!_class)
10330 {
10331 char string[256];
10332 struct Symbol * classSym;
10333
10334 string[0] = '\0';
10335 PrintType(type, string, 0x0, 0x1);
10336 classSym = FindClass(string);
10337 _class = classSym ? classSym->registered : (((void *)0));
10338 }
10339 if(exp->member.member)
10340 {
10341 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, exp->member.member->string, privateModule);
10342 if(!prop)
10343 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, exp->member.member->string, privateModule, (((void *)0)), (((void *)0)));
10344 }
10345 if(!prop && !member && _class && exp->member.member)
10346 {
10347 struct Symbol * classSym = FindClass(exp->member.member->string);
10348
10349 convertTo = _class;
10350 _class = classSym ? classSym->registered : (((void *)0));
10351 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, convertTo->fullName, privateModule);
10352 }
10353 if(prop)
10354 {
10355 if(prop->compiled)
10356 {
10357 struct Type * type = prop->dataType;
10358
10359 if(_class->type == 3)
10360 {
10361 if(type->kind == 8)
10362 {
10363 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
10364
10365 if(_class->type == 3)
10366 {
10367 if(!_class->dataType)
10368 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
10369 type = _class->dataType;
10370 }
10371 }
10372 switch(type->kind)
10373 {
10374 case 6:
10375 {
10376 float value;
10377 float (* Get)(float) = (void *)prop->Get;
10378
10379 GetFloat(exp->member.exp, &value);
10380 exp->constant = PrintFloat(Get ? Get(value) : value);
10381 exp->type = 2;
10382 break;
10383 }
10384 case 7:
10385 {
10386 double value;
10387 double (* Get)(double);
10388
10389 GetDouble(exp->member.exp, &value);
10390 if(convertTo)
10391 Get = (void *)prop->Set;
10392 else
10393 Get = (void *)prop->Get;
10394 exp->constant = PrintDouble(Get ? Get(value) : value);
10395 exp->type = 2;
10396 break;
10397 }
10398 }
10399 }
10400 else
10401 {
10402 if(convertTo)
10403 {
10404 struct Expression * value = exp->member.exp;
10405 struct Type * type;
10406
10407 if(!prop->dataType)
10408 ProcessPropertyType(prop);
10409 type = prop->dataType;
10410 if(!type)
10411 {
10412 }
10413 else if(_class->type == 1)
10414 {
10415 switch(type->kind)
10416 {
10417 case 8:
10418 {
10419 struct __ecereNameSpace__ecere__com__Class * propertyClass = type->_class->registered;
10420
10421 if(propertyClass->type == 1 && value->type == 1)
10422 {
10423 void (* Set)(void *, void *) = (void *)prop->Set;
10424
10425 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10426 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10427 exp->instance->_class = MkSpecifierName(_class->fullName);
10428 exp->instance->loc = exp->loc;
10429 exp->type = 1;
10430 Set(exp->instance->data, value->instance->data);
10431 PopulateInstance(exp->instance);
10432 }
10433 break;
10434 }
10435 case 3:
10436 {
10437 int intValue;
10438 void (* Set)(void *, int) = (void *)prop->Set;
10439
10440 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10441 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10442 exp->instance->_class = MkSpecifierName(_class->fullName);
10443 exp->instance->loc = exp->loc;
10444 exp->type = 1;
10445 GetInt(value, &intValue);
10446 Set(exp->instance->data, intValue);
10447 PopulateInstance(exp->instance);
10448 break;
10449 }
10450 case 4:
10451 {
10452 long long intValue;
10453 void (* Set)(void *, long long) = (void *)prop->Set;
10454
10455 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10456 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10457 exp->instance->_class = MkSpecifierName(_class->fullName);
10458 exp->instance->loc = exp->loc;
10459 exp->type = 1;
10460 GetInt64(value, &intValue);
10461 Set(exp->instance->data, intValue);
10462 PopulateInstance(exp->instance);
10463 break;
10464 }
10465 case 22:
10466 {
10467 intptr_t intValue;
10468 void (* Set)(void *, intptr_t) = (void *)prop->Set;
10469
10470 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10471 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10472 exp->instance->_class = MkSpecifierName(_class->fullName);
10473 exp->instance->loc = exp->loc;
10474 exp->type = 1;
10475 GetIntPtr(value, &intValue);
10476 Set(exp->instance->data, intValue);
10477 PopulateInstance(exp->instance);
10478 break;
10479 }
10480 case 7:
10481 {
10482 double doubleValue;
10483 void (* Set)(void *, double) = (void *)prop->Set;
10484
10485 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10486 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10487 exp->instance->_class = MkSpecifierName(_class->fullName);
10488 exp->instance->loc = exp->loc;
10489 exp->type = 1;
10490 GetDouble(value, &doubleValue);
10491 Set(exp->instance->data, doubleValue);
10492 PopulateInstance(exp->instance);
10493 break;
10494 }
10495 }
10496 }
10497 else if(_class->type == 2)
10498 {
10499 switch(type->kind)
10500 {
10501 case 8:
10502 {
10503 struct __ecereNameSpace__ecere__com__Class * propertyClass = type->_class->registered;
10504
10505 if(propertyClass->type == 1 && value->instance->data)
10506 {
10507 unsigned int (* Set)(void *) = (void *)prop->Set;
10508 unsigned int bits = Set(value->instance->data);
10509
10510 exp->constant = PrintHexUInt(bits);
10511 exp->type = 2;
10512 break;
10513 }
10514 else if(_class->type == 2)
10515 {
10516 unsigned int value;
10517 unsigned int (* Set)(unsigned int) = (void *)prop->Set;
10518 unsigned int bits;
10519
10520 GetUInt(exp->member.exp, &value);
10521 bits = Set(value);
10522 exp->constant = PrintHexUInt(bits);
10523 exp->type = 2;
10524 }
10525 }
10526 }
10527 }
10528 }
10529 else
10530 {
10531 if(_class->type == 2)
10532 {
10533 unsigned int value;
10534
10535 GetUInt(exp->member.exp, &value);
10536 switch(type->kind)
10537 {
10538 case 8:
10539 {
10540 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
10541
10542 if(_class->type == 1)
10543 {
10544 void (* Get)(unsigned int, void *) = (void *)prop->Get;
10545
10546 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10547 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10548 exp->instance->_class = MkSpecifierName(_class->fullName);
10549 exp->instance->loc = exp->loc;
10550 exp->type = 1;
10551 Get(value, exp->instance->data);
10552 PopulateInstance(exp->instance);
10553 }
10554 else if(_class->type == 2)
10555 {
10556 unsigned int (* Get)(unsigned int) = (void *)prop->Get;
10557 uint64 bits = Get(value);
10558
10559 exp->constant = PrintHexUInt64(bits);
10560 exp->type = 2;
10561 }
10562 break;
10563 }
10564 }
10565 }
10566 else if(_class->type == 1)
10567 {
10568 char * value = (exp->member.exp->type == 1) ? exp->member.exp->instance->data : (((void *)0));
10569
10570 switch(type->kind)
10571 {
10572 case 8:
10573 {
10574 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
10575
10576 if(_class->type == 1 && value)
10577 {
10578 void (* Get)(void *, void *) = (void *)prop->Get;
10579
10580 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10581 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10582 exp->instance->_class = MkSpecifierName(_class->fullName);
10583 exp->instance->loc = exp->loc;
10584 exp->type = 1;
10585 Get(value, exp->instance->data);
10586 PopulateInstance(exp->instance);
10587 }
10588 break;
10589 }
10590 }
10591 }
10592 }
10593 }
10594 }
10595 else
10596 {
10597 exp->isConstant = 0x0;
10598 }
10599 }
10600 else if(member)
10601 {
10602 }
10603 }
10604 if(exp->type != 8)
10605 {
10606 FreeExpression(memberExp);
10607 FreeIdentifier(memberID);
10608 }
10609 break;
10610 }
10611 case 10:
10612 {
10613 struct Type * type = ProcessType(exp->typeName->qualifiers, exp->typeName->declarator);
10614
10615 FreeExpContents(exp);
10616 exp->constant = PrintUInt(ComputeTypeSize(type));
10617 exp->type = 2;
10618 FreeType(type);
10619 break;
10620 }
10621 case 15:
10622 {
10623 struct Symbol * classSym = exp->_class->symbol;
10624
10625 if(classSym && classSym->registered)
10626 {
10627 if(classSym->registered->fixed)
10628 {
10629 FreeSpecifier(exp->_class);
10630 exp->constant = PrintUInt(classSym->registered->templateClass ? classSym->registered->templateClass->structSize : classSym->registered->structSize);
10631 exp->type = 2;
10632 }
10633 else
10634 {
10635 char className[1024];
10636
10637 strcpy(className, "__ecereClass_");
10638 FullClassNameCat(className, classSym->string, 0x1);
10639 MangleClassName(className);
10640 FreeExpContents(exp);
10641 exp->type = 9;
10642 exp->member.exp = MkExpIdentifier(MkIdentifier(className));
10643 exp->member.member = MkIdentifier("structSize");
10644 }
10645 }
10646 break;
10647 }
10648 case 11:
10649 {
10650 struct Type * type;
10651 struct Expression * e = exp;
10652
10653 if(exp->type == 11)
10654 {
10655 if(exp->cast.exp)
10656 ComputeExpression(exp->cast.exp);
10657 e = exp->cast.exp;
10658 }
10659 if(e && exp->expType)
10660 {
10661 type = exp->expType;
10662 if(type->kind == 8)
10663 {
10664 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
10665
10666 if(_class && (_class->type == 3 || _class->type == 2))
10667 {
10668 if(!_class->dataType)
10669 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
10670 type = _class->dataType;
10671 }
10672 }
10673 switch(type->kind)
10674 {
10675 case 1:
10676 if(type->isSigned)
10677 {
10678 char value;
10679
10680 GetChar(e, &value);
10681 FreeExpContents(exp);
10682 exp->constant = PrintChar(value);
10683 exp->type = 2;
10684 }
10685 else
10686 {
10687 unsigned char value;
10688
10689 GetUChar(e, &value);
10690 FreeExpContents(exp);
10691 exp->constant = PrintUChar(value);
10692 exp->type = 2;
10693 }
10694 break;
10695 case 2:
10696 if(type->isSigned)
10697 {
10698 short value;
10699
10700 GetShort(e, &value);
10701 FreeExpContents(exp);
10702 exp->constant = PrintShort(value);
10703 exp->type = 2;
10704 }
10705 else
10706 {
10707 unsigned short value;
10708
10709 GetUShort(e, &value);
10710 FreeExpContents(exp);
10711 exp->constant = PrintUShort(value);
10712 exp->type = 2;
10713 }
10714 break;
10715 case 3:
10716 if(type->isSigned)
10717 {
10718 int value;
10719
10720 GetInt(e, &value);
10721 FreeExpContents(exp);
10722 exp->constant = PrintInt(value);
10723 exp->type = 2;
10724 }
10725 else
10726 {
10727 unsigned int value;
10728
10729 GetUInt(e, &value);
10730 FreeExpContents(exp);
10731 exp->constant = PrintUInt(value);
10732 exp->type = 2;
10733 }
10734 break;
10735 case 4:
10736 if(type->isSigned)
10737 {
10738 long long value;
10739
10740 GetInt64(e, &value);
10741 FreeExpContents(exp);
10742 exp->constant = PrintInt64(value);
10743 exp->type = 2;
10744 }
10745 else
10746 {
10747 uint64 value;
10748
10749 GetUInt64(e, &value);
10750 FreeExpContents(exp);
10751 exp->constant = PrintUInt64(value);
10752 exp->type = 2;
10753 }
10754 break;
10755 case 22:
10756 if(type->isSigned)
10757 {
10758 intptr_t value;
10759
10760 GetIntPtr(e, &value);
10761 FreeExpContents(exp);
10762 exp->constant = PrintInt64((long long)value);
10763 exp->type = 2;
10764 }
10765 else
10766 {
10767 uintptr_t value;
10768
10769 GetUIntPtr(e, &value);
10770 FreeExpContents(exp);
10771 exp->constant = PrintUInt64((uint64)value);
10772 exp->type = 2;
10773 }
10774 break;
10775 case 6:
10776 {
10777 float value;
10778
10779 GetFloat(e, &value);
10780 FreeExpContents(exp);
10781 exp->constant = PrintFloat(value);
10782 exp->type = 2;
10783 break;
10784 }
10785 case 7:
10786 {
10787 double value;
10788
10789 GetDouble(e, &value);
10790 FreeExpContents(exp);
10791 exp->constant = PrintDouble(value);
10792 exp->type = 2;
10793 break;
10794 }
10795 }
10796 }
10797 break;
10798 }
10799 case 12:
10800 {
10801 struct Operand op1 = 
10802 {
10803 0, 0, 0, 0, 
10804 {
10805 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
10806 }
10807 };
10808 struct Operand op2 = 
10809 {
10810 0, 0, 0, 0, 
10811 {
10812 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
10813 }
10814 };
10815 struct Operand op3 = 
10816 {
10817 0, 0, 0, 0, 
10818 {
10819 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
10820 }
10821 };
10822
10823 if(exp->cond.exp)
10824 ComputeExpression((*exp->cond.exp).last);
10825 if(exp->cond.elseExp)
10826 ComputeExpression(exp->cond.elseExp);
10827 if(exp->cond.cond)
10828 ComputeExpression(exp->cond.cond);
10829 op1 = GetOperand(exp->cond.cond);
10830 if(op1.type)
10831 op1.type->refCount++;
10832 op2 = GetOperand((*exp->cond.exp).last);
10833 if(op2.type)
10834 op2.type->refCount++;
10835 op3 = GetOperand(exp->cond.elseExp);
10836 if(op3.type)
10837 op3.type->refCount++;
10838 if(op1.ops.Cond)
10839 {
10840 FreeExpContents(exp);
10841 op1.ops.Cond(exp, &op1, &op2, &op3);
10842 }
10843 if(op1.type)
10844 FreeType(op1.type);
10845 if(op2.type)
10846 FreeType(op2.type);
10847 if(op3.type)
10848 FreeType(op3.type);
10849 break;
10850 }
10851 }
10852 }
10853
10854 void ApplyAnyObjectLogic(struct Expression * e);
10855
10856 extern void CopyTypeInto(struct Type * type, struct Type * src);
10857
10858 static unsigned int CheckExpressionType(struct Expression * exp, struct Type * destType, unsigned int skipUnitBla)
10859 {
10860 unsigned int result = 0x1;
10861
10862 if(destType)
10863 {
10864 struct __ecereNameSpace__ecere__sys__OldList converts = 
10865 {
10866 0, 0, 0, 0, 0
10867 };
10868 struct Conversion * convert;
10869
10870 if(destType->kind == 0)
10871 return 0x0;
10872 if(!MatchTypeExpression(exp, destType, &converts, skipUnitBla))
10873 result = 0x0;
10874 if(converts.count)
10875 {
10876 for(convert = converts.first; convert; convert = convert->next)
10877 {
10878 unsigned int empty = !(convert->isGet ? (void *)convert->convert->Get : (void *)convert->convert->Set);
10879
10880 if(!empty)
10881 {
10882 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
10883 int objectType = exp->expType ? exp->expType->classObjectType : 0;
10884
10885 *newExp = *exp;
10886 newExp->destType = (((void *)0));
10887 if(convert->isGet)
10888 {
10889 exp->type = 8;
10890 exp->addedThis = 0x1;
10891 exp->member.exp = newExp;
10892 FreeType(exp->member.exp->expType);
10893 exp->member.exp->expType = MkClassType(convert->convert->_class->fullName);
10894 exp->member.exp->expType->classObjectType = objectType;
10895 exp->member.member = MkIdentifier(convert->convert->dataTypeString);
10896 exp->member.memberType = 1;
10897 exp->expType = convert->resultType ? convert->resultType : convert->convert->dataType;
10898 exp->needCast = 0x1;
10899 if(exp->expType)
10900 exp->expType->refCount++;
10901 ApplyAnyObjectLogic(exp->member.exp);
10902 }
10903 else
10904 {
10905 {
10906 exp->type = 8;
10907 exp->addedThis = 0x1;
10908 exp->member.exp = newExp;
10909 if(newExp->expType && newExp->expType->kind == 8 && newExp->expType->_class && newExp->expType->_class->registered && newExp->expType->_class->registered->type == 5)
10910 {
10911 newExp->byReference = 0x1;
10912 }
10913 FreeType(exp->member.exp->expType);
10914 exp->member.exp->expType = (((void *)0));
10915 if(convert->convert->dataType)
10916 {
10917 exp->member.exp->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
10918 CopyTypeInto(exp->member.exp->expType, convert->convert->dataType);
10919 exp->member.exp->expType->refCount = 1;
10920 exp->member.exp->expType->classObjectType = objectType;
10921 ApplyAnyObjectLogic(exp->member.exp);
10922 }
10923 exp->member.member = MkIdentifier(convert->convert->_class->fullName);
10924 exp->member.memberType = 4;
10925 exp->expType = convert->resultType ? convert->resultType : MkClassType(convert->convert->_class->fullName);
10926 exp->needCast = 0x1;
10927 if(convert->resultType)
10928 convert->resultType->refCount++;
10929 }
10930 }
10931 }
10932 else
10933 {
10934 FreeType(exp->expType);
10935 if(convert->isGet)
10936 {
10937 exp->expType = convert->resultType ? convert->resultType : convert->convert->dataType;
10938 exp->needCast = 0x1;
10939 if(exp->expType)
10940 exp->expType->refCount++;
10941 }
10942 else
10943 {
10944 exp->expType = convert->resultType ? convert->resultType : MkClassType(convert->convert->_class->fullName);
10945 exp->needCast = 0x1;
10946 if(convert->resultType)
10947 convert->resultType->refCount++;
10948 }
10949 }
10950 }
10951 if(exp->isConstant && inCompiler)
10952 ComputeExpression(exp);
10953 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(&converts, FreeConvert);
10954 }
10955 if(!result && exp->expType && converts.count)
10956 {
10957 result = MatchTypes(exp->expType, exp->destType, (((void *)0)), (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0);
10958 }
10959 if(!result && exp->expType && exp->destType)
10960 {
10961 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))
10962 result = 0x1;
10963 }
10964 }
10965 return result;
10966 }
10967
10968 extern struct Statement * MkCompoundStmt(struct __ecereNameSpace__ecere__sys__OldList * declarations, struct __ecereNameSpace__ecere__sys__OldList * statements);
10969
10970 extern struct Statement * MkExpressionStmt(struct __ecereNameSpace__ecere__sys__OldList * expressions);
10971
10972 extern struct Expression * MkExpMember(struct Expression * expression, struct Identifier * member);
10973
10974 void CheckTemplateTypes(struct Expression * exp)
10975 {
10976 if(exp->destType && exp->destType->passAsTemplate && exp->expType && exp->expType->kind != 20 && !exp->expType->passAsTemplate)
10977 {
10978 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
10979 struct Statement * compound;
10980 struct Context * context;
10981
10982 *newExp = *exp;
10983 if(exp->destType)
10984 exp->destType->refCount++;
10985 if(exp->expType)
10986 exp->expType->refCount++;
10987 newExp->prev = (((void *)0));
10988 newExp->next = (((void *)0));
10989 switch(exp->expType->kind)
10990 {
10991 case 7:
10992 if(exp->destType->classObjectType)
10993 {
10994 if(exp->destType)
10995 exp->destType->refCount--;
10996 if(exp->expType)
10997 exp->expType->refCount--;
10998 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
10999 }
11000 else
11001 {
11002 struct __ecereNameSpace__ecere__sys__OldList * specs;
11003 struct __ecereNameSpace__ecere__sys__OldList * unionDefs = MkList();
11004 struct __ecereNameSpace__ecere__sys__OldList * statements = MkList();
11005
11006 context = PushContext();
11007 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(DOUBLE)), MkListOne(MkDeclaratorIdentifier(MkIdentifier("d"))), (((void *)0)))));
11008 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifierName("uint64")), MkListOne(MkDeclaratorIdentifier(MkIdentifier("i"))), (((void *)0)))));
11009 specs = MkListOne(MkStructOrUnion(4, (((void *)0)), unionDefs));
11010 exp->type = 25;
11011 exp->compound = MkCompoundStmt(MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internal_union")), (((void *)0)))))), statements);
11012 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("d")), '=', newExp))));
11013 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("i")))));
11014 exp->compound->compound.context = context;
11015 PopContext(context);
11016 }
11017 break;
11018 default:
11019 exp->type = 11;
11020 exp->cast.typeName = MkTypeName(MkListOne(MkSpecifierName("uint64")), (((void *)0)));
11021 exp->cast.exp = MkExpBrackets(MkListOne(newExp));
11022 break;
11023 }
11024 }
11025 else if(exp->expType && exp->expType->passAsTemplate && exp->destType && ((unsigned int)((exp->usage & 0x1) >> 0)) && exp->destType->kind != 20 && !exp->destType->passAsTemplate)
11026 {
11027 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
11028 struct Statement * compound;
11029 struct Context * context;
11030
11031 *newExp = *exp;
11032 if(exp->destType)
11033 exp->destType->refCount++;
11034 if(exp->expType)
11035 exp->expType->refCount++;
11036 newExp->prev = (((void *)0));
11037 newExp->next = (((void *)0));
11038 switch(exp->expType->kind)
11039 {
11040 case 7:
11041 if(exp->destType->classObjectType)
11042 {
11043 if(exp->destType)
11044 exp->destType->refCount--;
11045 if(exp->expType)
11046 exp->expType->refCount--;
11047 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
11048 }
11049 else
11050 {
11051 struct __ecereNameSpace__ecere__sys__OldList * specs;
11052 struct __ecereNameSpace__ecere__sys__OldList * unionDefs = MkList();
11053 struct __ecereNameSpace__ecere__sys__OldList * statements = MkList();
11054
11055 context = PushContext();
11056 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(DOUBLE)), MkListOne(MkDeclaratorIdentifier(MkIdentifier("d"))), (((void *)0)))));
11057 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifierName("uint64")), MkListOne(MkDeclaratorIdentifier(MkIdentifier("i"))), (((void *)0)))));
11058 specs = MkListOne(MkStructOrUnion(4, (((void *)0)), unionDefs));
11059 exp->type = 25;
11060 exp->compound = MkCompoundStmt(MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internal_union")), (((void *)0)))))), statements);
11061 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("i")), '=', newExp))));
11062 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("d")))));
11063 exp->compound->compound.context = context;
11064 PopContext(context);
11065 }
11066 break;
11067 case 8:
11068 {
11069 if(exp->expType->_class && exp->expType->_class->registered && exp->expType->_class->registered->type == 1)
11070 {
11071 exp->type = 5;
11072 exp->list = MkListOne(MkExpOp((((void *)0)), '*', MkExpCast(MkTypeName(MkListOne(MkSpecifierName(exp->expType->_class->string)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), newExp)));
11073 ProcessExpressionType((*exp->list).first);
11074 break;
11075 }
11076 else
11077 {
11078 exp->type = 5;
11079 exp->list = MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName(exp->expType->_class->string)), (((void *)0))), newExp));
11080 newExp->needCast = 0x1;
11081 ProcessExpressionType((*exp->list).first);
11082 break;
11083 }
11084 }
11085 default:
11086 {
11087 if(exp->expType->kind == 20)
11088 {
11089 struct Type * type = ProcessTemplateParameterType(exp->expType->templateParameter);
11090
11091 if(type)
11092 {
11093 FreeType(exp->destType);
11094 FreeType(exp->expType);
11095 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
11096 break;
11097 }
11098 }
11099 if(newExp->type == 8 && newExp->member.memberType == 3)
11100 {
11101 exp->type = 4;
11102 exp->op.op = '*';
11103 exp->op.exp1 = (((void *)0));
11104 exp->op.exp2 = MkExpCast(MkTypeName(MkListOne(MkSpecifierName("uint64")), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), MkExpBrackets(MkListOne(MkExpOp((((void *)0)), '&', newExp))));
11105 }
11106 else
11107 {
11108 char typeString[1024];
11109 struct Declarator * decl;
11110 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
11111
11112 typeString[0] = '\0';
11113 PrintType(exp->expType, typeString, 0x0, 0x0);
11114 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
11115 exp->type = 11;
11116 exp->cast.typeName = MkTypeName(specs, decl);
11117 exp->cast.exp = MkExpBrackets(MkListOne(newExp));
11118 exp->cast.exp->needCast = 0x1;
11119 }
11120 break;
11121 }
11122 }
11123 }
11124 }
11125
11126 extern int strncmp(const char * , const char * , int n);
11127
11128 struct __ecereNameSpace__ecere__sys__BTNode * __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindPrefix(struct __ecereNameSpace__ecere__sys__BinaryTree * this, char *  key);
11129
11130 static struct Symbol * ScanWithNameSpace(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, char * nameSpace, char * name)
11131 {
11132 int nsLen = strlen(nameSpace);
11133 struct Symbol * symbol;
11134
11135 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)))
11136 {
11137 char * s = symbol->string;
11138
11139 if(!strncmp(s, nameSpace, nsLen))
11140 {
11141 int c;
11142 char * namePart;
11143
11144 for(c = strlen(s) - 1; c >= 0; c--)
11145 if(s[c] == ':')
11146 break;
11147 namePart = s + c + 1;
11148 if(!strcmp(namePart, name))
11149 {
11150 return symbol;
11151 }
11152 }
11153 else
11154 break;
11155 }
11156 return (((void *)0));
11157 }
11158
11159 static struct Symbol * FindWithNameSpace(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, char * name)
11160 {
11161 int c;
11162 char nameSpace[1024];
11163 char * namePart;
11164 unsigned int gotColon = 0x0;
11165
11166 nameSpace[0] = '\0';
11167 for(c = strlen(name) - 1; c >= 0; c--)
11168 if(name[c] == ':')
11169 {
11170 gotColon = 0x1;
11171 break;
11172 }
11173 namePart = name + c + 1;
11174 while(c >= 0 && name[c] == ':')
11175 c--;
11176 if(c >= 0)
11177 {
11178 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, name);
11179
11180 if(symbol)
11181 return symbol;
11182 memcpy(nameSpace, name, c + 1);
11183 nameSpace[c + 1] = (char)0;
11184 return ScanWithNameSpace(tree, nameSpace, namePart);
11185 }
11186 else if(gotColon)
11187 {
11188 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, namePart);
11189
11190 return symbol;
11191 }
11192 else
11193 {
11194 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, namePart);
11195
11196 if(symbol)
11197 return symbol;
11198 return ScanWithNameSpace(tree, "", namePart);
11199 }
11200 return (((void *)0));
11201 }
11202
11203 static void ProcessDeclaration(struct Declaration * decl);
11204
11205 struct Symbol * FindSymbol(char * name, struct Context * startContext, struct Context * endContext, unsigned int isStruct, unsigned int globalNameSpace)
11206 {
11207 struct Context * ctx;
11208 struct Symbol * symbol = (((void *)0));
11209
11210 for(ctx = startContext; ctx && !symbol; ctx = ctx->parent)
11211 {
11212 if(ctx == globalContext && !globalNameSpace && ctx->hasNameSpace)
11213 {
11214 symbol = (((void *)0));
11215 if(thisNameSpace)
11216 {
11217 char curName[1024];
11218
11219 strcpy(curName, thisNameSpace);
11220 strcat(curName, "::");
11221 strcat(curName, name);
11222 symbol = FindWithNameSpace(isStruct ? &ctx->structSymbols : &ctx->symbols, curName);
11223 }
11224 if(!symbol)
11225 symbol = FindWithNameSpace(isStruct ? &ctx->structSymbols : &ctx->symbols, name);
11226 }
11227 else
11228 symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString((isStruct ? &ctx->structSymbols : &ctx->symbols), name);
11229 if(symbol || ctx == endContext)
11230 break;
11231 }
11232 if(inCompiler && curExternal && symbol && ctx == globalContext && curExternal->symbol && symbol->id > curExternal->symbol->idCode && symbol->pointerExternal)
11233 {
11234 if(symbol->pointerExternal->type == 0)
11235 {
11236 struct FunctionDefinition * function = symbol->pointerExternal->function;
11237 struct Context * tmpContext = curContext;
11238
11239 curContext = (((void *)0));
11240 symbol->pointerExternal = MkExternalDeclaration(MkDeclaration(CopyList(function->specifiers, CopySpecifier), MkListOne(MkInitDeclarator(CopyDeclarator(function->declarator), (((void *)0))))));
11241 curContext = tmpContext;
11242 symbol->pointerExternal->symbol = symbol;
11243 DeclareType(symbol->type, 0x1, 0x1);
11244 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, symbol->pointerExternal);
11245 symbol->id = curExternal->symbol->idCode;
11246 }
11247 else if(symbol->pointerExternal->type == 1 && curExternal->symbol->idCode < symbol->pointerExternal->symbol->id)
11248 {
11249 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
11250 symbol->id = curExternal->symbol->idCode;
11251 }
11252 }
11253 return symbol;
11254 }
11255
11256 static void GetTypeSpecs(struct Type * type, struct __ecereNameSpace__ecere__sys__OldList * specs)
11257 {
11258 if(!type->isSigned && type->kind != 22)
11259 ListAdd(specs, MkSpecifier(UNSIGNED));
11260 switch(type->kind)
11261 {
11262 case 8:
11263 {
11264 if(type->_class->registered)
11265 {
11266 if(!type->_class->registered->dataType)
11267 type->_class->registered->dataType = ProcessTypeString(type->_class->registered->dataTypeString, 0x0);
11268 GetTypeSpecs(type->_class->registered->dataType, specs);
11269 }
11270 break;
11271 }
11272 case 7:
11273 ListAdd(specs, MkSpecifier(DOUBLE));
11274 break;
11275 case 6:
11276 ListAdd(specs, MkSpecifier(FLOAT));
11277 break;
11278 case 1:
11279 ListAdd(specs, MkSpecifier(CHAR));
11280 break;
11281 case 2:
11282 ListAdd(specs, MkSpecifier(SHORT));
11283 break;
11284 case 4:
11285 ListAdd(specs, MkSpecifier(INT64));
11286 break;
11287 case 22:
11288 ListAdd(specs, MkSpecifierName(type->isSigned ? "intptr" : "uintptr"));
11289 break;
11290 case 3:
11291 default:
11292 ListAdd(specs, MkSpecifier(INT));
11293 break;
11294 }
11295 }
11296
11297 extern char *  __ecereNameSpace__ecere__sys__RSearchString(char *  buffer, char *  subStr, int maxLen, unsigned int matchCase, unsigned int matchWord);
11298
11299 static void _PrintType(struct Type * type, char * string, unsigned int printName, unsigned int printFunction, unsigned int fullName)
11300 {
11301 if(type)
11302 {
11303 switch(type->kind)
11304 {
11305 case 8:
11306 if(type->_class && type->_class->string)
11307 {
11308 if(type->classObjectType == 2)
11309 strcat(string, "typed_object");
11310 else if(fullName)
11311 strcat(string, type->_class->string);
11312 else
11313 {
11314 if(type->_class->registered)
11315 strcat(string, type->_class->registered->name);
11316 else
11317 strcat(string, type->_class->string);
11318 }
11319 }
11320 break;
11321 case 13:
11322 {
11323 {
11324 _PrintType(type->type, string, 0x0, printFunction, fullName);
11325 strcat(string, " *");
11326 }
11327 break;
11328 }
11329 case 0:
11330 strcat(string, "void");
11331 break;
11332 case 3:
11333 strcat(string, type->isSigned ? "int" : "uint");
11334 break;
11335 case 4:
11336 strcat(string, type->isSigned ? "int64" : "uint64");
11337 break;
11338 case 22:
11339 strcat(string, type->isSigned ? "intptr" : "uintptr");
11340 break;
11341 case 1:
11342 strcat(string, type->isSigned ? "char" : "byte");
11343 break;
11344 case 2:
11345 strcat(string, type->isSigned ? "short" : "uint16");
11346 break;
11347 case 6:
11348 strcat(string, "float");
11349 break;
11350 case 7:
11351 strcat(string, "double");
11352 break;
11353 case 9:
11354 if(type->enumName)
11355 {
11356 strcat(string, "struct ");
11357 strcat(string, type->enumName);
11358 }
11359 else if(type->typeName)
11360 {
11361 strcat(string, type->typeName);
11362 }
11363 else
11364 {
11365 struct Type * member;
11366
11367 strcat(string, "struct {");
11368 for(member = type->members.first; member; member = member->next)
11369 {
11370 PrintType(member, string, 0x1, fullName);
11371 strcat(string, "; ");
11372 }
11373 strcat(string, "}");
11374 }
11375 break;
11376 case 10:
11377 if(type->enumName)
11378 {
11379 strcat(string, "union ");
11380 strcat(string, type->enumName);
11381 }
11382 else if(type->typeName)
11383 {
11384 strcat(string, type->typeName);
11385 }
11386 else
11387 {
11388 strcat(string, "union ");
11389 strcat(string, "(unnamed)");
11390 }
11391 break;
11392 case 15:
11393 if(type->enumName)
11394 {
11395 strcat(string, "enum ");
11396 strcat(string, type->enumName);
11397 }
11398 else if(type->typeName)
11399 {
11400 strcat(string, type->typeName);
11401 }
11402 else
11403 strcat(string, "enum");
11404 break;
11405 case 11:
11406 {
11407 if(printFunction)
11408 {
11409 if(type->dllExport)
11410 strcat(string, "dllexport ");
11411 PrintType(type->returnType, string, 0x0, fullName);
11412 strcat(string, " ");
11413 }
11414 if(printName)
11415 {
11416 if(type->name)
11417 {
11418 if(fullName)
11419 strcat(string, type->name);
11420 else
11421 {
11422 char * name = __ecereNameSpace__ecere__sys__RSearchString(type->name, "::", strlen(type->name), 0x1, 0x0);
11423
11424 if(name)
11425 name += 2;
11426 else
11427 name = type->name;
11428 strcat(string, name);
11429 }
11430 }
11431 }
11432 if(printFunction)
11433 {
11434 struct Type * param;
11435
11436 strcat(string, "(");
11437 for(param = type->params.first; param; param = param->next)
11438 {
11439 PrintType(param, string, 0x1, fullName);
11440 if(param->next)
11441 strcat(string, ", ");
11442 }
11443 strcat(string, ")");
11444 }
11445 break;
11446 }
11447 case 12:
11448 {
11449 {
11450 char baseType[1024], size[256];
11451 struct Type * arrayType = type;
11452
11453 baseType[0] = '\0';
11454 size[0] = '\0';
11455 while(arrayType->kind == 12)
11456 {
11457 strcat(size, "[");
11458 if(arrayType->enumClass)
11459 strcat(size, arrayType->enumClass->string);
11460 else if(arrayType->arraySizeExp)
11461 PrintExpression(arrayType->arraySizeExp, size);
11462 strcat(size, "]");
11463 arrayType = arrayType->arrayType;
11464 }
11465 _PrintType(arrayType, baseType, printName, printFunction, fullName);
11466 strcat(string, baseType);
11467 strcat(string, size);
11468 }
11469 printName = 0x0;
11470 break;
11471 }
11472 case 14:
11473 strcat(string, "...");
11474 break;
11475 case 16:
11476 _PrintType(type->method->dataType, string, 0x0, printFunction, fullName);
11477 break;
11478 case 19:
11479 strcat(string, "subclass(");
11480 strcat(string, type->_class ? type->_class->string : "int");
11481 strcat(string, ")");
11482 break;
11483 case 20:
11484 strcat(string, type->templateParameter->identifier->string);
11485 break;
11486 case 21:
11487 strcat(string, "thisclass");
11488 break;
11489 case 17:
11490 strcat(string, "__builtin_va_list");
11491 break;
11492 }
11493 if(type->name && printName && type->kind != 11 && (type->kind != 13 || type->type->kind != 11))
11494 {
11495 strcat(string, " ");
11496 strcat(string, type->name);
11497 }
11498 }
11499 }
11500
11501 void PrintType(struct Type * type, char * string, unsigned int printName, unsigned int fullName)
11502 {
11503 struct Type * funcType;
11504
11505 for(funcType = type; funcType && (funcType->kind == 13 || funcType->kind == 12); funcType = funcType->type)
11506 ;
11507 if(funcType && funcType->kind == 11 && type != funcType)
11508 {
11509 char typeString[1024];
11510 struct Type * param;
11511
11512 PrintType(funcType->returnType, string, 0x0, fullName);
11513 strcat(string, "(");
11514 _PrintType(type, string, printName, 0x0, fullName);
11515 strcat(string, ")");
11516 strcat(string, "(");
11517 for(param = funcType->params.first; param; param = param->next)
11518 {
11519 PrintType(param, string, 0x1, fullName);
11520 if(param->next)
11521 strcat(string, ", ");
11522 }
11523 strcat(string, ")");
11524 }
11525 else
11526 _PrintType(type, string, printName, 0x1, fullName);
11527 if(type->bitFieldCount)
11528 {
11529 char count[100];
11530
11531 sprintf(count, ":%d", type->bitFieldCount);
11532 strcat(string, count);
11533 }
11534 }
11535
11536 static struct Type * FindMember(struct Type * type, char * string)
11537 {
11538 struct Type * memberType;
11539
11540 for(memberType = type->members.first; memberType; memberType = memberType->next)
11541 {
11542 if(!memberType->name)
11543 {
11544 struct Type * subType = FindMember(memberType, string);
11545
11546 if(subType)
11547 return subType;
11548 }
11549 else if(!strcmp(memberType->name, string))
11550 return memberType;
11551 }
11552 return (((void *)0));
11553 }
11554
11555 struct Type * FindMemberAndOffset(struct Type * type, char * string, unsigned int * offset)
11556 {
11557 struct Type * memberType;
11558
11559 for(memberType = type->members.first; memberType; memberType = memberType->next)
11560 {
11561 if(!memberType->name)
11562 {
11563 struct Type * subType = FindMember(memberType, string);
11564
11565 if(subType)
11566 {
11567 *offset += memberType->offset;
11568 return subType;
11569 }
11570 }
11571 else if(!strcmp(memberType->name, string))
11572 {
11573 *offset += memberType->offset;
11574 return memberType;
11575 }
11576 }
11577 return (((void *)0));
11578 }
11579
11580 extern struct __ecereNameSpace__ecere__com__Instance * fileInput;
11581
11582 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Write;
11583
11584 struct Expression * ParseExpressionString(char * expression)
11585 {
11586 fileInput = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
11587 ((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));
11588 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))fileInput->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(fileInput, 0, 0);
11589 echoOn = 0x0;
11590 parsedExpression = (((void *)0));
11591 resetScanner();
11592 expression_yyparse();
11593 (__ecereNameSpace__ecere__com__eInstance_DecRef(fileInput), fileInput = 0);
11594 return parsedExpression;
11595 }
11596
11597 extern char *  QMkString(char *  source);
11598
11599 static unsigned int ResolveIdWithClass(struct Expression * exp, struct __ecereNameSpace__ecere__com__Class * _class, unsigned int skipIDClassCheck)
11600 {
11601 void * __ecereTemp1;
11602 struct Identifier * id = exp->identifier;
11603 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
11604 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
11605 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
11606 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
11607
11608 if(_class && _class->type == 4)
11609 {
11610 struct __ecereNameSpace__ecere__sys__NamedLink * value = (((void *)0));
11611 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
11612
11613 if(enumClass)
11614 {
11615 struct __ecereNameSpace__ecere__com__Class * baseClass;
11616
11617 for(baseClass = _class; baseClass && baseClass->type == 4; baseClass = baseClass->base)
11618 {
11619 struct __ecereNameSpace__ecere__com__EnumClassData * e = (baseClass ? ((void *)(((char *)baseClass->data) + enumClass->offsetClass)) : (((void *)0)));
11620
11621 for(value = e->values.first; value; value = value->next)
11622 {
11623 if(!strcmp(value->name, id->string))
11624 break;
11625 }
11626 if(value)
11627 {
11628 char constant[256];
11629
11630 FreeExpContents(exp);
11631 exp->type = 2;
11632 exp->isConstant = 0x1;
11633 if(!strcmp(baseClass->dataTypeString, "int"))
11634 sprintf(constant, "%d", value->data);
11635 else
11636 sprintf(constant, "0x%X", value->data);
11637 exp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
11638 exp->expType = MkClassType(baseClass->fullName);
11639 break;
11640 }
11641 }
11642 }
11643 if(value)
11644 return 0x1;
11645 }
11646 if((method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule)))
11647 {
11648 ProcessMethodType(method);
11649 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));
11650 return 0x1;
11651 }
11652 else if((prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule)))
11653 {
11654 if(!prop->dataType)
11655 ProcessPropertyType(prop);
11656 exp->expType = prop->dataType;
11657 if(prop->dataType)
11658 prop->dataType->refCount++;
11659 return 0x1;
11660 }
11661 else if((member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)))))
11662 {
11663 if(!member->dataType)
11664 member->dataType = ProcessTypeString(member->dataTypeString, 0x0);
11665 exp->expType = member->dataType;
11666 if(member->dataType)
11667 member->dataType->refCount++;
11668 return 0x1;
11669 }
11670 else if((classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(_class, id->string)))
11671 {
11672 if(!classProp->dataType)
11673 classProp->dataType = ProcessTypeString(classProp->dataTypeString, 0x0);
11674 if(classProp->constant)
11675 {
11676 FreeExpContents(exp);
11677 exp->isConstant = 0x1;
11678 if(classProp->dataType->kind == 13 && classProp->dataType->type->kind == 1)
11679 {
11680 exp->type = 3;
11681 exp->constant = QMkString((char *)classProp->Get(_class));
11682 }
11683 else
11684 {
11685 char constant[256];
11686
11687 exp->type = 2;
11688 sprintf(constant, "%d", classProp->Get(_class));
11689 exp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
11690 }
11691 }
11692 else
11693 {
11694 }
11695 exp->expType = classProp->dataType;
11696 if(classProp->dataType)
11697 classProp->dataType->refCount++;
11698 return 0x1;
11699 }
11700 return 0x0;
11701 }
11702
11703 static struct GlobalData * ScanGlobalData(struct __ecereNameSpace__ecere__com__NameSpace * nameSpace, char * name)
11704 {
11705 struct __ecereNameSpace__ecere__sys__BinaryTree * tree = &nameSpace->functions;
11706 struct GlobalData * data = (struct GlobalData *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString((&*tree), name);
11707 struct __ecereNameSpace__ecere__com__NameSpace * child;
11708
11709 if(!data)
11710 {
11711 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)))
11712 {
11713 data = ScanGlobalData(child, name);
11714 if(data)
11715 break;
11716 }
11717 }
11718 return data;
11719 }
11720
11721 extern struct __ecereNameSpace__ecere__com__NameSpace *  globalData;
11722
11723 extern char *  strncpy(char * , const char * , int n);
11724
11725 static struct GlobalData * FindGlobalData(char * name)
11726 {
11727 int start = 0, c;
11728 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
11729
11730 nameSpace = globalData;
11731 for(c = 0; name[c]; c++)
11732 {
11733 if(name[c] == '.' || (name[c] == ':' && name[c + 1] == ':'))
11734 {
11735 struct __ecereNameSpace__ecere__com__NameSpace * newSpace;
11736 char * spaceName = __ecereNameSpace__ecere__com__eSystem_New(sizeof(char) * (c - start + 1));
11737
11738 strncpy(spaceName, name + start, c - start);
11739 spaceName[c - start] = '\0';
11740 newSpace = (struct __ecereNameSpace__ecere__com__NameSpace *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(&(*nameSpace).nameSpaces, spaceName);
11741 (__ecereNameSpace__ecere__com__eSystem_Delete(spaceName), spaceName = 0);
11742 if(!newSpace)
11743 return (((void *)0));
11744 nameSpace = newSpace;
11745 if(name[c] == ':')
11746 c++;
11747 start = c + 1;
11748 }
11749 }
11750 if(c - start)
11751 {
11752 return ScanGlobalData(nameSpace, name + start);
11753 }
11754 return (((void *)0));
11755 }
11756
11757 static int definedExpStackPos;
11758
11759 static void * definedExpStack[512];
11760
11761 void ReplaceExpContents(struct Expression * checkedExp, struct Expression * newExp)
11762 {
11763 struct Expression * prev = checkedExp->prev, * next = checkedExp->next;
11764
11765 FreeExpContents(checkedExp);
11766 FreeType(checkedExp->expType);
11767 FreeType(checkedExp->destType);
11768 *checkedExp = *newExp;
11769 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
11770 checkedExp->prev = prev;
11771 checkedExp->next = next;
11772 }
11773
11774 extern struct Expression * MkExpCall(struct Expression * expression, struct __ecereNameSpace__ecere__sys__OldList * arguments);
11775
11776 extern int printf(char * , ...);
11777
11778 void __ecereMethod_Expression_Clear();
11779
11780 void ApplyAnyObjectLogic(struct Expression * e)
11781 {
11782 struct Type * destType = e->destType;
11783
11784 if(destType && (destType->classObjectType == 3))
11785 {
11786 if(e && e->expType)
11787 {
11788 struct Type * type = e->expType;
11789 struct __ecereNameSpace__ecere__com__Class * _class = (((void *)0));
11790
11791 if(type->kind == 8 && type->_class && type->_class->registered)
11792 {
11793 _class = type->_class->registered;
11794 }
11795 else if(type->kind == 19)
11796 {
11797 _class = FindClass("ecere::com::Class")->registered;
11798 }
11799 else
11800 {
11801 char string[1024] = "";
11802 struct Symbol * classSym;
11803
11804 PrintType(type, string, 0x0, 0x1);
11805 classSym = FindClass(string);
11806 if(classSym)
11807 _class = classSym->registered;
11808 }
11809 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)))
11810 {
11811 if(!_class || strcmp(_class->fullName, "char *"))
11812 {
11813 struct Expression * checkedExp = e, * newExp;
11814
11815 while(((checkedExp->type == 5 || checkedExp->type == 34 || checkedExp->type == 25) && checkedExp->list) || checkedExp->type == 11)
11816 {
11817 if(checkedExp->type == 5 || checkedExp->type == 34 || checkedExp->type == 25)
11818 {
11819 if(checkedExp->type == 25)
11820 {
11821 checkedExp = (*((struct Statement *)(*checkedExp->compound->compound.statements).last)->expressions).last;
11822 }
11823 else
11824 checkedExp = (*checkedExp->list).last;
11825 }
11826 else if(checkedExp->type == 11)
11827 checkedExp = checkedExp->cast.exp;
11828 }
11829 if(checkedExp && checkedExp->type == 4 && checkedExp->op.op == '*' && !checkedExp->op.exp1)
11830 {
11831 newExp = checkedExp->op.exp2;
11832 checkedExp->op.exp2 = (((void *)0));
11833 FreeExpContents(checkedExp);
11834 if(e->expType && e->expType->passAsTemplate)
11835 {
11836 char size[100];
11837
11838 ComputeTypeSize(e->expType);
11839 sprintf(size, "%d", e->expType->size);
11840 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))))));
11841 }
11842 ReplaceExpContents(checkedExp, newExp);
11843 e->byReference = 0x1;
11844 }
11845 else if(!e->byReference || (_class && _class->type == 5))
11846 {
11847 struct Expression * checkedExp, * newExp;
11848
11849 {
11850 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;
11851
11852 if(_class && _class->type != 5 && _class->type != 0 && _class->type != 1 && !hasAddress)
11853 {
11854 struct Context * context = PushContext();
11855 struct Declarator * decl;
11856 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
11857 char typeString[1024];
11858 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
11859
11860 typeString[0] = '\0';
11861 *newExp = *e;
11862 newExp->prev = (((void *)0));
11863 newExp->next = (((void *)0));
11864 newExp->expType = (((void *)0));
11865 PrintType(e->expType, typeString, 0x0, 0x1);
11866 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
11867 newExp->destType = ProcessType(specs, decl);
11868 curContext = context;
11869 e->type = 25;
11870 if(curCompound)
11871 {
11872 char name[100];
11873 struct __ecereNameSpace__ecere__sys__OldList * stmts = MkList();
11874
11875 sprintf(name, "__internalValue%03X", internalValueCounter++);
11876 if(!curCompound->compound.declarations)
11877 curCompound->compound.declarations = MkList();
11878 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*curCompound->compound.declarations), (((void *)0)), MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(name)), (((void *)0))))));
11879 ListAdd(stmts, MkExpressionStmt(MkListOne(MkExpOp(MkExpIdentifier(MkIdentifier(name)), '=', newExp))));
11880 ListAdd(stmts, MkExpressionStmt(MkListOne(MkExpIdentifier(MkIdentifier(name)))));
11881 e->compound = MkCompoundStmt((((void *)0)), stmts);
11882 }
11883 else
11884 printf("libec: compiler error, curCompound is null in ApplyAnyObjectLogic\n");
11885 {
11886 struct Type * type = e->destType;
11887
11888 e->destType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
11889 CopyTypeInto(e->destType, type);
11890 e->destType->refCount = 1;
11891 e->destType->classObjectType = 0;
11892 FreeType(type);
11893 }
11894 e->compound->compound.context = context;
11895 PopContext(context);
11896 curContext = context->parent;
11897 }
11898 }
11899 checkedExp = e;
11900 while(((checkedExp->type == 5 || checkedExp->type == 34 || checkedExp->type == 25) && checkedExp->list) || checkedExp->type == 11)
11901 {
11902 if(checkedExp->type == 5 || checkedExp->type == 34 || checkedExp->type == 25)
11903 {
11904 if(checkedExp->type == 25)
11905 {
11906 checkedExp = (*((struct Statement *)(*checkedExp->compound->compound.statements).last)->expressions).last;
11907 }
11908 else
11909 checkedExp = (*checkedExp->list).last;
11910 }
11911 else if(checkedExp->type == 11)
11912 checkedExp = checkedExp->cast.exp;
11913 }
11914 {
11915 struct Expression * operand = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
11916
11917 *operand = *checkedExp;
11918 checkedExp->destType = (((void *)0));
11919 checkedExp->expType = (((void *)0));
11920 __ecereMethod_Expression_Clear(checkedExp);
11921 checkedExp->type = 4;
11922 checkedExp->op.op = '&';
11923 checkedExp->op.exp1 = (((void *)0));
11924 checkedExp->op.exp2 = operand;
11925 }
11926 }
11927 }
11928 }
11929 }
11930 }
11931 {
11932 }
11933 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))))
11934 {
11935 if(e->expType->kind == 8 && e->expType->_class && e->expType->_class->registered && !strcmp(e->expType->_class->registered->name, "class"))
11936 {
11937 return ;
11938 }
11939 else
11940 {
11941 struct Expression * thisExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
11942
11943 *thisExp = *e;
11944 thisExp->prev = (((void *)0));
11945 thisExp->next = (((void *)0));
11946 __ecereMethod_Expression_Clear(e);
11947 e->type = 5;
11948 e->list = MkListOne(MkExpOp((((void *)0)), '*', MkExpBrackets(MkListOne(thisExp))));
11949 if(thisExp->expType->kind == 8 && thisExp->expType->_class && thisExp->expType->_class->registered && thisExp->expType->_class->registered->type == 5)
11950 ((struct Expression *)(*e->list).first)->byReference = 0x1;
11951 {
11952 e->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
11953 CopyTypeInto(e->expType, thisExp->expType);
11954 e->expType->byReference = 0x0;
11955 e->expType->refCount = 1;
11956 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))
11957 {
11958 e->expType->classObjectType = 0;
11959 }
11960 }
11961 }
11962 }
11963 else if(destType && e->expType && (e->expType->classObjectType == 3 || e->expType->classObjectType == 2) && !destType->classObjectType && destType->kind != 0)
11964 {
11965 if(destType->kind == 14)
11966 {
11967 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Unspecified type\n", (((void *)0))));
11968 }
11969 else if(!(destType->truth && e->expType->kind == 8 && e->expType->_class && e->expType->_class->registered && e->expType->_class->registered->type == 1))
11970 {
11971 unsigned int byReference = e->expType->byReference;
11972 struct Expression * thisExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
11973 struct Declarator * decl;
11974 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
11975 char typeString[1024];
11976 struct Type * type;
11977 int backupClassObjectType;
11978
11979 if(e->expType->kind == 8 && e->expType->_class && e->expType->_class->registered && strcmp(e->expType->_class->registered->name, "class"))
11980 type = e->expType;
11981 else
11982 type = destType;
11983 backupClassObjectType = type->classObjectType;
11984 type->classObjectType = 0;
11985 typeString[0] = '\0';
11986 PrintType(type, typeString, 0x0, 0x1);
11987 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
11988 type->classObjectType = backupClassObjectType;
11989 *thisExp = *e;
11990 thisExp->prev = (((void *)0));
11991 thisExp->next = (((void *)0));
11992 __ecereMethod_Expression_Clear(e);
11993 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)))
11994 {
11995 e->type = 4;
11996 e->op.op = '*';
11997 e->op.exp1 = (((void *)0));
11998 e->op.exp2 = MkExpCast(MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl)), thisExp);
11999 }
12000 else
12001 {
12002 e->type = 11;
12003 e->cast.typeName = MkTypeName(specs, decl);
12004 e->cast.exp = thisExp;
12005 e->byReference = 0x1;
12006 }
12007 e->expType = type;
12008 e->destType = destType;
12009 type->refCount++;
12010 destType->refCount++;
12011 }
12012 }
12013 }
12014
12015 extern char *  strstr(char * , const char * );
12016
12017 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__DefinedExpression;
12018
12019 struct __ecereNameSpace__ecere__com__DefinedExpression
12020 {
12021 struct __ecereNameSpace__ecere__com__DefinedExpression * prev;
12022 struct __ecereNameSpace__ecere__com__DefinedExpression * next;
12023 char *  name;
12024 char *  value;
12025 struct __ecereNameSpace__ecere__com__NameSpace *  nameSpace;
12026 } __attribute__ ((gcc_struct));
12027
12028 extern struct __ecereNameSpace__ecere__com__DefinedExpression * __ecereNameSpace__ecere__com__eSystem_FindDefine(struct __ecereNameSpace__ecere__com__Instance * module, char *  name);
12029
12030 extern struct __ecereNameSpace__ecere__com__GlobalFunction * __ecereNameSpace__ecere__com__eSystem_FindFunction(struct __ecereNameSpace__ecere__com__Instance * module, char *  name);
12031
12032 extern unsigned int __ecereNameSpace__ecere__sys__UTF8GetChar(char *  string, int *  numBytes);
12033
12034 extern struct Expression * GetTemplateArgExp(struct TemplateParameter * param, struct __ecereNameSpace__ecere__com__Class * curClass, unsigned int pointer);
12035
12036 extern struct Expression * MkExpCondition(struct Expression * cond, struct __ecereNameSpace__ecere__sys__OldList * expressions, struct Expression * elseExp);
12037
12038 extern struct Expression * CopyExpression(struct Expression * exp);
12039
12040 extern struct Expression * MkExpTypeSize(struct TypeName * typeName);
12041
12042 extern struct Expression * MkExpClass(struct __ecereNameSpace__ecere__sys__OldList *  specifiers, struct Declarator * decl);
12043
12044 static void ProcessStatement(struct Statement * stmt);
12045
12046 extern struct Expression * MkExpExtensionInitializer(struct TypeName * typeName, struct Initializer * initializer);
12047
12048 extern struct Initializer * MkInitializerList(struct __ecereNameSpace__ecere__sys__OldList * list);
12049
12050 extern char *  __ecereNameSpace__ecere__com__PrintString(struct __ecereNameSpace__ecere__com__Class * class, void * object, ...);
12051
12052 extern char *  sourceFile;
12053
12054 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear(struct __ecereNameSpace__ecere__sys__OldList * this);
12055
12056 void ProcessExpressionType(struct Expression * exp)
12057 {
12058 void * __ecereTemp2;
12059 void * __ecereTemp1;
12060 unsigned int unresolved = 0x0;
12061 struct Location oldyylloc = yylloc;
12062 unsigned int notByReference = 0x0;
12063
12064 if(!exp || exp->expType)
12065 return ;
12066 yylloc = exp->loc;
12067 switch(exp->type)
12068 {
12069 case 0:
12070 {
12071 struct Identifier * id = exp->identifier;
12072
12073 if(!id)
12074 return ;
12075 if(id->_class && id->_class->name)
12076 {
12077 id->classSym = id->_class->symbol;
12078 }
12079 if(strstr(id->string, "__ecereClass") == id->string)
12080 {
12081 exp->expType = ProcessTypeString("ecere::com::Class", 0x1);
12082 break;
12083 }
12084 else if(id->_class && (id->classSym || (id->_class->name && !strcmp(id->_class->name, "property"))))
12085 {
12086 ReplaceClassMembers(exp, thisClass);
12087 if(exp->type != 0)
12088 {
12089 ProcessExpressionType(exp);
12090 break;
12091 }
12092 if(id->classSym && ResolveIdWithClass(exp, id->classSym->registered, 0x0))
12093 break;
12094 }
12095 else
12096 {
12097 struct Symbol * symbol = FindSymbol(id->string, curContext, topContext, 0x0, id->_class && id->_class->name == (((void *)0)));
12098
12099 if(!symbol)
12100 {
12101 if(exp->destType && CheckExpressionType(exp, exp->destType, 0x0))
12102 break;
12103 else
12104 {
12105 if(thisClass)
12106 {
12107 ReplaceClassMembers(exp, thisClass ? thisClass : currentClass);
12108 if(exp->type != 0)
12109 {
12110 ProcessExpressionType(exp);
12111 break;
12112 }
12113 }
12114 else if(currentClass && !id->_class)
12115 {
12116 if(ResolveIdWithClass(exp, currentClass, 0x1))
12117 break;
12118 }
12119 symbol = FindSymbol(id->string, topContext->parent, globalContext, 0x0, id->_class && id->_class->name == (((void *)0)));
12120 }
12121 }
12122 if(symbol)
12123 {
12124 struct Type * type = symbol->type;
12125 struct __ecereNameSpace__ecere__com__Class * _class = (type && type->kind == 8 && type->_class) ? type->_class->registered : (((void *)0));
12126
12127 if(_class && !strcmp(id->string, "this") && !type->classObjectType)
12128 {
12129 struct Context * context = SetupTemplatesContext(_class);
12130
12131 type = ReplaceThisClassType(_class);
12132 FinishTemplatesContext(context);
12133 if(type)
12134 type->refCount = 0;
12135 }
12136 FreeSpecifier(id->_class);
12137 id->_class = (((void *)0));
12138 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
12139 id->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
12140 id->classSym = (((void *)0));
12141 exp->expType = type;
12142 if(type)
12143 type->refCount++;
12144 if(type && (type->kind == 15 || (_class && _class->type == 4)))
12145 exp->isConstant = 0x1;
12146 if(symbol->isParam || !strcmp(id->string, "this"))
12147 {
12148 if(_class && _class->type == 1)
12149 exp->byReference = 0x1;
12150 }
12151 if(symbol->isIterator)
12152 {
12153 if(symbol->isIterator == 3)
12154 {
12155 exp->type = 5;
12156 exp->list = MkListOne(MkExpOp((((void *)0)), '*', MkExpIdentifier(exp->identifier)));
12157 ((struct Expression *)(*exp->list).first)->op.exp2->expType = exp->expType;
12158 exp->expType = (((void *)0));
12159 ProcessExpressionType(exp);
12160 }
12161 else if(symbol->isIterator != 4)
12162 {
12163 exp->type = 8;
12164 exp->member.exp = MkExpIdentifier(exp->identifier);
12165 exp->member.exp->expType = exp->expType;
12166 exp->member.member = MkIdentifier("data");
12167 exp->expType = (((void *)0));
12168 ProcessExpressionType(exp);
12169 }
12170 }
12171 break;
12172 }
12173 else
12174 {
12175 struct __ecereNameSpace__ecere__com__DefinedExpression * definedExp = (((void *)0));
12176
12177 if(thisNameSpace && !(id->_class && !id->_class->name))
12178 {
12179 char name[1024];
12180
12181 strcpy(name, thisNameSpace);
12182 strcat(name, "::");
12183 strcat(name, id->string);
12184 definedExp = __ecereNameSpace__ecere__com__eSystem_FindDefine(privateModule, name);
12185 }
12186 if(!definedExp)
12187 definedExp = __ecereNameSpace__ecere__com__eSystem_FindDefine(privateModule, id->string);
12188 if(definedExp)
12189 {
12190 int c;
12191
12192 for(c = 0; c < definedExpStackPos; c++)
12193 if(definedExpStack[c] == definedExp)
12194 break;
12195 if(c == definedExpStackPos && c < sizeof definedExpStack / sizeof(void *))
12196 {
12197 struct Location backupYylloc = yylloc;
12198
12199 definedExpStack[definedExpStackPos++] = definedExp;
12200 fileInput = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
12201 ((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));
12202 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))fileInput->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(fileInput, 0, 0);
12203 echoOn = 0x0;
12204 parsedExpression = (((void *)0));
12205 resetScanner();
12206 expression_yyparse();
12207 (__ecereNameSpace__ecere__com__eInstance_DecRef(fileInput), fileInput = 0);
12208 yylloc = backupYylloc;
12209 if(parsedExpression)
12210 {
12211 FreeIdentifier(id);
12212 exp->type = 5;
12213 exp->list = MkListOne(parsedExpression);
12214 parsedExpression->loc = yylloc;
12215 ProcessExpressionType(exp);
12216 definedExpStackPos--;
12217 return ;
12218 }
12219 definedExpStackPos--;
12220 }
12221 else
12222 {
12223 if(inCompiler)
12224 {
12225 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Recursion in defined expression %s\n", (((void *)0))), id->string);
12226 }
12227 }
12228 }
12229 else
12230 {
12231 struct GlobalData * data = (((void *)0));
12232
12233 if(thisNameSpace && !(id->_class && !id->_class->name))
12234 {
12235 char name[1024];
12236
12237 strcpy(name, thisNameSpace);
12238 strcat(name, "::");
12239 strcat(name, id->string);
12240 data = FindGlobalData(name);
12241 }
12242 if(!data)
12243 data = FindGlobalData(id->string);
12244 if(data)
12245 {
12246 DeclareGlobalData(data);
12247 exp->expType = data->dataType;
12248 if(data->dataType)
12249 data->dataType->refCount++;
12250 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
12251 id->string = __ecereNameSpace__ecere__sys__CopyString(data->fullName);
12252 FreeSpecifier(id->_class);
12253 id->_class = (((void *)0));
12254 break;
12255 }
12256 else
12257 {
12258 struct __ecereNameSpace__ecere__com__GlobalFunction * function = (((void *)0));
12259
12260 if(thisNameSpace && !(id->_class && !id->_class->name))
12261 {
12262 char name[1024];
12263
12264 strcpy(name, thisNameSpace);
12265 strcat(name, "::");
12266 strcat(name, id->string);
12267 function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, name);
12268 }
12269 if(!function)
12270 function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, id->string);
12271 if(function)
12272 {
12273 char name[1024];
12274
12275 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
12276 id->string = __ecereNameSpace__ecere__sys__CopyString(function->name);
12277 name[0] = (char)0;
12278 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + 12)))->importType != 1 && (!function->dataType || !function->dataType->dllExport))
12279 strcpy(name, "__ecereFunction_");
12280 FullClassNameCat(name, id->string, 0x0);
12281 if(DeclareFunction(function, name))
12282 {
12283 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
12284 id->string = __ecereNameSpace__ecere__sys__CopyString(name);
12285 }
12286 exp->expType = function->dataType;
12287 if(function->dataType)
12288 function->dataType->refCount++;
12289 FreeSpecifier(id->_class);
12290 id->_class = (((void *)0));
12291 break;
12292 }
12293 }
12294 }
12295 }
12296 }
12297 unresolved = 0x1;
12298 break;
12299 }
12300 case 1:
12301 {
12302 struct __ecereNameSpace__ecere__com__Class * _class;
12303
12304 if(!exp->instance->_class)
12305 {
12306 if(exp->destType && exp->destType->kind == 8 && exp->destType->_class)
12307 {
12308 exp->instance->_class = MkSpecifierName(exp->destType->_class->string);
12309 }
12310 }
12311 ProcessInstantiationType(exp->instance);
12312 exp->isConstant = exp->instance->isConstant;
12313 if(exp->instance->_class)
12314 {
12315 exp->expType = MkClassType(exp->instance->_class->name);
12316 }
12317 break;
12318 }
12319 case 2:
12320 {
12321 if(!exp->expType)
12322 {
12323 struct Type * type = (type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), type->refCount = 1, type->constant = 0x1, type);
12324
12325 exp->expType = type;
12326 if(exp->constant[0] == '\'')
12327 {
12328 if((int)((unsigned char *)exp->constant)[1] > 127)
12329 {
12330 int nb;
12331 unsigned int ch = __ecereNameSpace__ecere__sys__UTF8GetChar(exp->constant + 1, &nb);
12332
12333 if(nb < 2)
12334 ch = exp->constant[1];
12335 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->constant), exp->constant = 0);
12336 exp->constant = PrintUInt(ch);
12337 type->kind = 8;
12338 type->_class = FindClass("unichar");
12339 type->isSigned = 0x0;
12340 }
12341 else
12342 {
12343 type->kind = 1;
12344 type->isSigned = 0x1;
12345 }
12346 }
12347 else if(strchr(exp->constant, '.'))
12348 {
12349 char ch = exp->constant[strlen(exp->constant) - 1];
12350
12351 if(ch == 'f')
12352 type->kind = 6;
12353 else
12354 type->kind = 7;
12355 type->isSigned = 0x1;
12356 }
12357 else
12358 {
12359 if(exp->constant[0] == '0' && exp->constant[1])
12360 type->isSigned = 0x0;
12361 else if(strchr(exp->constant, 'L') || strchr(exp->constant, 'l'))
12362 type->isSigned = 0x0;
12363 else if(strtoll(exp->constant, (((void *)0)), 0) > (((int)0x7fffffff)))
12364 type->isSigned = 0x0;
12365 else
12366 type->isSigned = 0x1;
12367 type->kind = 3;
12368 }
12369 exp->isConstant = 0x1;
12370 }
12371 break;
12372 }
12373 case 3:
12374 {
12375 exp->isConstant = 0x1;
12376 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));
12377 break;
12378 }
12379 case 13:
12380 case 28:
12381 ProcessExpressionType(exp->_new.size);
12382 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));
12383 DeclareType(exp->expType->type, 0x0, 0x0);
12384 break;
12385 case 14:
12386 case 29:
12387 ProcessExpressionType(exp->_renew.size);
12388 ProcessExpressionType(exp->_renew.exp);
12389 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));
12390 DeclareType(exp->expType->type, 0x0, 0x0);
12391 break;
12392 case 4:
12393 {
12394 unsigned int assign = 0x0, boolResult = 0x0, boolOps = 0x0;
12395 struct Type * type1 = (((void *)0)), * type2 = (((void *)0));
12396 unsigned int useDestType = 0x0, useSideType = 0x0;
12397 struct Location oldyylloc = yylloc;
12398 unsigned int useSideUnit = 0x0;
12399 struct Type * dummy = (dummy = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), dummy->count = (unsigned int)1, dummy->refCount = 1, dummy);
12400
12401 switch(exp->op.op)
12402 {
12403 case '=':
12404 case MUL_ASSIGN:
12405 case DIV_ASSIGN:
12406 case MOD_ASSIGN:
12407 case ADD_ASSIGN:
12408 case SUB_ASSIGN:
12409 case LEFT_ASSIGN:
12410 case RIGHT_ASSIGN:
12411 case AND_ASSIGN:
12412 case XOR_ASSIGN:
12413 case OR_ASSIGN:
12414 assign = 0x1;
12415 break;
12416 case '!':
12417 break;
12418 case AND_OP:
12419 case OR_OP:
12420 boolOps = 0x1;
12421 boolResult = 0x1;
12422 break;
12423 case EQ_OP:
12424 case '<':
12425 case '>':
12426 case LE_OP:
12427 case GE_OP:
12428 case NE_OP:
12429 boolResult = 0x1;
12430 useSideType = 0x1;
12431 break;
12432 case '+':
12433 case '-':
12434 useSideUnit = 0x1;
12435 case '|':
12436 case '&':
12437 case '^':
12438 case '/':
12439 case '%':
12440 case '*':
12441 if(exp->op.op != '*' || exp->op.exp1)
12442 {
12443 useSideType = 0x1;
12444 useDestType = 0x1;
12445 }
12446 break;
12447 }
12448 if(exp->op.op == '&')
12449 {
12450 if(!exp->op.exp1 && exp->op.exp2 && exp->op.exp2->type == 0 && exp->op.exp2->identifier)
12451 {
12452 struct Identifier * id = exp->op.exp2->identifier;
12453 struct Symbol * symbol = FindSymbol(id->string, curContext, topContext, 0x0, id->_class && id->_class->name == (((void *)0)));
12454
12455 if(symbol && symbol->isIterator == 2)
12456 {
12457 exp->type = 8;
12458 exp->member.exp = exp->op.exp2;
12459 exp->member.member = MkIdentifier("key");
12460 exp->expType = (((void *)0));
12461 exp->op.exp2->expType = symbol->type;
12462 symbol->type->refCount++;
12463 ProcessExpressionType(exp);
12464 FreeType(dummy);
12465 break;
12466 }
12467 }
12468 }
12469 if(exp->op.exp1)
12470 {
12471 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))
12472 {
12473 if(exp->op.exp1->destType)
12474 FreeType(exp->op.exp1->destType);
12475 exp->op.exp1->destType = exp->destType;
12476 if(exp->destType)
12477 exp->destType->refCount++;
12478 }
12479 else if(!assign)
12480 {
12481 if(exp->op.exp1->destType)
12482 FreeType(exp->op.exp1->destType);
12483 exp->op.exp1->destType = dummy;
12484 dummy->refCount++;
12485 }
12486 if(exp->op.exp1->destType && exp->op.op != '=')
12487 exp->op.exp1->destType->count++;
12488 ProcessExpressionType(exp->op.exp1);
12489 if(exp->op.exp1->destType && exp->op.op != '=')
12490 exp->op.exp1->destType->count--;
12491 if(exp->op.exp1->destType == dummy)
12492 {
12493 FreeType(dummy);
12494 exp->op.exp1->destType = (((void *)0));
12495 }
12496 type1 = exp->op.exp1->expType;
12497 }
12498 if(exp->op.exp2)
12499 {
12500 char expString[10240];
12501
12502 expString[0] = '\0';
12503 if(exp->op.exp2->type == 1 && !exp->op.exp2->instance->_class)
12504 {
12505 if(exp->op.exp1)
12506 {
12507 exp->op.exp2->destType = exp->op.exp1->expType;
12508 if(exp->op.exp1->expType)
12509 exp->op.exp1->expType->refCount++;
12510 }
12511 else
12512 {
12513 exp->op.exp2->destType = exp->destType;
12514 if(exp->destType)
12515 exp->destType->refCount++;
12516 }
12517 if(type1)
12518 type1->refCount++;
12519 exp->expType = type1;
12520 }
12521 else if(assign)
12522 {
12523 if(inCompiler)
12524 PrintExpression(exp->op.exp2, expString);
12525 if(type1 && type1->kind == 13)
12526 {
12527 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)
12528 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "operator %s illegal on pointer\n", (((void *)0))), exp->op.op);
12529 else if(exp->op.op == '=')
12530 {
12531 if(exp->op.exp2->destType)
12532 FreeType(exp->op.exp2->destType);
12533 exp->op.exp2->destType = type1;
12534 if(type1)
12535 type1->refCount++;
12536 }
12537 }
12538 else
12539 {
12540 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)
12541 ;
12542 else
12543 {
12544 if(exp->op.exp2->destType)
12545 FreeType(exp->op.exp2->destType);
12546 exp->op.exp2->destType = type1;
12547 if(type1)
12548 type1->refCount++;
12549 }
12550 }
12551 if(type1)
12552 type1->refCount++;
12553 exp->expType = type1;
12554 }
12555 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)))
12556 {
12557 if(exp->op.exp2->destType)
12558 FreeType(exp->op.exp2->destType);
12559 exp->op.exp2->destType = exp->destType;
12560 if(exp->destType)
12561 exp->destType->refCount++;
12562 }
12563 else
12564 {
12565 if(exp->op.exp2->destType)
12566 FreeType(exp->op.exp2->destType);
12567 exp->op.exp2->destType = dummy;
12568 dummy->refCount++;
12569 }
12570 if(type1 && boolResult && useSideType && type1->kind == 8 && type1->_class && type1->_class->registered && (type1->_class->registered->type == 2 || type1->_class->registered->type == 4))
12571 {
12572 FreeType(exp->op.exp2->destType);
12573 exp->op.exp2->destType = type1;
12574 type1->refCount++;
12575 }
12576 if(exp->op.exp2->destType && exp->op.op != '=')
12577 exp->op.exp2->destType->count++;
12578 ProcessExpressionType(exp->op.exp2);
12579 if(exp->op.exp2->destType && exp->op.op != '=')
12580 exp->op.exp2->destType->count--;
12581 if(assign && type1 && type1->kind == 13 && exp->op.exp2->expType)
12582 {
12583 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)
12584 {
12585 if(exp->op.op != '=' && type1->type->kind == 0)
12586 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "void *: unknown size\n", (((void *)0))));
12587 }
12588 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)))
12589 {
12590 if(exp->op.op == ADD_ASSIGN)
12591 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "cannot add two pointers\n", (((void *)0))));
12592 }
12593 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))
12594 {
12595 if(exp->op.op == ADD_ASSIGN)
12596 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "cannot add two pointers\n", (((void *)0))));
12597 }
12598 else if(inCompiler)
12599 {
12600 char type1String[1024];
12601 char type2String[1024];
12602
12603 type1String[0] = '\0';
12604 type2String[0] = '\0';
12605 PrintType(exp->op.exp2->expType, type1String, 0x0, 0x1);
12606 PrintType(type1, type2String, 0x0, 0x1);
12607 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
12608 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible expression %s (%s); expected %s\n", (((void *)0))), expString, type1String, type2String);
12609 }
12610 }
12611 if(exp->op.exp2->destType == dummy)
12612 {
12613 FreeType(dummy);
12614 exp->op.exp2->destType = (((void *)0));
12615 }
12616 type2 = exp->op.exp2->expType;
12617 }
12618 dummy->kind = 0;
12619 if(exp->op.op == SIZEOF)
12620 {
12621 exp->expType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1)->kind = 3, ((struct Type *)__ecereTemp1));
12622 exp->isConstant = 0x1;
12623 }
12624 else if(exp->op.op == '*' && !exp->op.exp1)
12625 {
12626 exp->expType = Dereference(type2);
12627 if(type2 && type2->kind == 8)
12628 notByReference = 0x1;
12629 }
12630 else if(exp->op.op == '&' && !exp->op.exp1)
12631 exp->expType = Reference(type2);
12632 else if(!assign)
12633 {
12634 if(boolOps)
12635 {
12636 if(exp->op.exp1)
12637 {
12638 if(exp->op.exp1->destType)
12639 FreeType(exp->op.exp1->destType);
12640 exp->op.exp1->destType = MkClassType("bool");
12641 exp->op.exp1->destType->truth = 0x1;
12642 if(!exp->op.exp1->expType)
12643 ProcessExpressionType(exp->op.exp1);
12644 else
12645 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
12646 FreeType(exp->op.exp1->expType);
12647 exp->op.exp1->expType = MkClassType("bool");
12648 exp->op.exp1->expType->truth = 0x1;
12649 }
12650 if(exp->op.exp2)
12651 {
12652 if(exp->op.exp2->destType)
12653 FreeType(exp->op.exp2->destType);
12654 exp->op.exp2->destType = MkClassType("bool");
12655 exp->op.exp2->destType->truth = 0x1;
12656 if(!exp->op.exp2->expType)
12657 ProcessExpressionType(exp->op.exp2);
12658 else
12659 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
12660 FreeType(exp->op.exp2->expType);
12661 exp->op.exp2->expType = MkClassType("bool");
12662 exp->op.exp2->expType->truth = 0x1;
12663 }
12664 }
12665 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")))))
12666 {
12667 if(type1 && type2 && ((type1->kind == 8 && type1->_class && strcmp(type1->_class->string, "String")) == (type2->kind == 8 && type2->_class && strcmp(type2->_class->string, "String"))))
12668 {
12669 if(exp->op.exp2->destType)
12670 FreeType(exp->op.exp2->destType);
12671 exp->op.exp2->destType = type1;
12672 type1->refCount++;
12673 if(exp->op.exp1->destType)
12674 FreeType(exp->op.exp1->destType);
12675 exp->op.exp1->destType = type2;
12676 type2->refCount++;
12677 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)
12678 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);
12679 if(type1->kind == 13 && type1->type->kind == 20 && type2->kind != 13)
12680 {
12681 struct Expression * argExp = GetTemplateArgExp(type1->type->templateParameter, thisClass, 0x1);
12682
12683 if(argExp)
12684 {
12685 struct Expression * classExp = MkExpMember(argExp, MkIdentifier("dataTypeClass"));
12686
12687 exp->op.exp1 = MkExpBrackets(MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName("byte")), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), exp->op.exp1)));
12688 ProcessExpressionType(exp->op.exp1);
12689 if(type2->kind != 13)
12690 {
12691 ProcessExpressionType(classExp);
12692 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"))))))));
12693 if(!exp->op.exp2->expType)
12694 type2 = exp->op.exp2->expType = ProcessTypeString("int", 0x0);
12695 ProcessExpressionType(exp->op.exp2);
12696 }
12697 }
12698 }
12699 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)))
12700 {
12701 if(type1->kind != 8 && type1->type->kind == 0)
12702 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "void *: unknown size\n", (((void *)0))));
12703 exp->expType = type1;
12704 if(type1)
12705 type1->refCount++;
12706 }
12707 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)))
12708 {
12709 if(type2->kind != 8 && type2->type->kind == 0)
12710 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "void *: unknown size\n", (((void *)0))));
12711 exp->expType = type2;
12712 if(type2)
12713 type2->refCount++;
12714 }
12715 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))
12716 {
12717 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "different levels of indirection\n", (((void *)0))));
12718 }
12719 else
12720 {
12721 unsigned int success = 0x0;
12722
12723 if(type1->kind == 13 && type2->kind == 13)
12724 {
12725 if(exp->op.op == '+')
12726 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "cannot add two pointers\n", (((void *)0))));
12727 else if(exp->op.op == '-')
12728 {
12729 if(MatchTypes(type1->type, type2->type, (((void *)0)), (((void *)0)), (((void *)0)), 0x0, 0x0, 0x0, 0x0))
12730 {
12731 exp->expType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->kind = 3, ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1));
12732 success = 0x1;
12733 if(type1->type->kind == 20)
12734 {
12735 struct Expression * argExp = GetTemplateArgExp(type1->type->templateParameter, thisClass, 0x1);
12736
12737 if(argExp)
12738 {
12739 struct Expression * classExp = MkExpMember(argExp, MkIdentifier("dataTypeClass"));
12740
12741 ProcessExpressionType(classExp);
12742 exp->type = 5;
12743 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")))))));
12744 ProcessExpressionType(((struct Expression *)(*exp->list).first)->op.exp2);
12745 FreeType(dummy);
12746 return ;
12747 }
12748 }
12749 }
12750 }
12751 }
12752 if(!success && exp->op.exp1->type == 2)
12753 {
12754 if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
12755 {
12756 if(exp->expType)
12757 FreeType(exp->expType);
12758 exp->expType = exp->op.exp1->destType;
12759 if(exp->op.exp1->destType)
12760 exp->op.exp1->destType->refCount++;
12761 success = 0x1;
12762 }
12763 else if(CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0))
12764 {
12765 if(exp->expType)
12766 FreeType(exp->expType);
12767 exp->expType = exp->op.exp2->destType;
12768 if(exp->op.exp2->destType)
12769 exp->op.exp2->destType->refCount++;
12770 success = 0x1;
12771 }
12772 }
12773 else if(!success)
12774 {
12775 if(CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0))
12776 {
12777 if(exp->expType)
12778 FreeType(exp->expType);
12779 exp->expType = exp->op.exp2->destType;
12780 if(exp->op.exp2->destType)
12781 exp->op.exp2->destType->refCount++;
12782 success = 0x1;
12783 }
12784 else if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
12785 {
12786 if(exp->expType)
12787 FreeType(exp->expType);
12788 exp->expType = exp->op.exp1->destType;
12789 if(exp->op.exp1->destType)
12790 exp->op.exp1->destType->refCount++;
12791 success = 0x1;
12792 }
12793 }
12794 if(!success)
12795 {
12796 char expString1[10240];
12797 char expString2[10240];
12798 char type1[1024];
12799 char type2[1024];
12800
12801 expString1[0] = '\0';
12802 expString2[0] = '\0';
12803 type1[0] = '\0';
12804 type2[0] = '\0';
12805 if(inCompiler)
12806 {
12807 PrintExpression(exp->op.exp1, expString1);
12808 __ecereNameSpace__ecere__sys__ChangeCh(expString1, '\n', ' ');
12809 PrintExpression(exp->op.exp2, expString2);
12810 __ecereNameSpace__ecere__sys__ChangeCh(expString2, '\n', ' ');
12811 PrintType(exp->op.exp1->expType, type1, 0x0, 0x1);
12812 PrintType(exp->op.exp2->expType, type2, 0x0, 0x1);
12813 }
12814 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible expressions %s (%s) and %s (%s)\n", (((void *)0))), expString1, type1, expString2, type2);
12815 }
12816 }
12817 }
12818 else if(!boolResult && (!useSideUnit) && type2 && type1 && type2->kind == 8 && type1->kind != 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 3)
12819 {
12820 if(exp->op.exp1->destType)
12821 FreeType(exp->op.exp1->destType);
12822 exp->op.exp1->destType = type2->_class->registered->dataType;
12823 if(type2->_class->registered->dataType)
12824 type2->_class->registered->dataType->refCount++;
12825 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
12826 exp->expType = type2;
12827 if(type2)
12828 type2->refCount++;
12829 }
12830 else if(!boolResult && (!useSideUnit) && type1 && type2 && type1->kind == 8 && type2->kind != 8 && type1->_class && type1->_class->registered && type1->_class->registered->type == 3)
12831 {
12832 if(exp->op.exp2->destType)
12833 FreeType(exp->op.exp2->destType);
12834 exp->op.exp2->destType = type1->_class->registered->dataType;
12835 if(type1->_class->registered->dataType)
12836 type1->_class->registered->dataType->refCount++;
12837 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
12838 exp->expType = type1;
12839 if(type1)
12840 type1->refCount++;
12841 }
12842 else if(type1)
12843 {
12844 unsigned int valid = 0x0;
12845
12846 if(!boolResult && useSideUnit && type1 && type1->kind == 8 && type1->_class->registered && type1->_class->registered->type == 3 && type2 && type2->kind != 8)
12847 {
12848 if(exp->op.exp2->destType)
12849 FreeType(exp->op.exp2->destType);
12850 if(!type1->_class->registered->dataType)
12851 type1->_class->registered->dataType = ProcessTypeString(type1->_class->registered->dataTypeString, 0x0);
12852 exp->op.exp2->destType = type1->_class->registered->dataType;
12853 exp->op.exp2->destType->refCount++;
12854 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
12855 type2 = exp->op.exp2->destType;
12856 exp->expType = type2;
12857 type2->refCount++;
12858 }
12859 if(!boolResult && useSideUnit && type2 && type2->kind == 8 && type2->_class->registered && type2->_class->registered->type == 3 && type1 && type1->kind != 8)
12860 {
12861 if(exp->op.exp1->destType)
12862 FreeType(exp->op.exp1->destType);
12863 if(!type2->_class->registered->dataType)
12864 type2->_class->registered->dataType = ProcessTypeString(type2->_class->registered->dataTypeString, 0x0);
12865 exp->op.exp1->destType = type2->_class->registered->dataType;
12866 exp->op.exp1->destType->refCount++;
12867 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
12868 type1 = exp->op.exp1->destType;
12869 exp->expType = type1;
12870 type1->refCount++;
12871 }
12872 if(!boolResult || exp->op.op == '>' || exp->op.op == '<')
12873 {
12874 if(type1->kind == 8 && type1->_class && type1->_class->registered && type1->_class->registered->type == 4 && exp->op.exp2->expType)
12875 {
12876 if(CheckExpressionType(exp->op.exp1, exp->op.exp2->expType, 0x0))
12877 {
12878 if(exp->expType)
12879 FreeType(exp->expType);
12880 exp->expType = exp->op.exp1->expType;
12881 if(exp->op.exp2->expType)
12882 exp->op.exp1->expType->refCount++;
12883 valid = 0x1;
12884 }
12885 }
12886 else if(type2 && (type2->kind == 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 4 && exp->op.exp1->expType))
12887 {
12888 if(CheckExpressionType(exp->op.exp2, exp->op.exp1->expType, 0x0))
12889 {
12890 if(exp->expType)
12891 FreeType(exp->expType);
12892 exp->expType = exp->op.exp2->expType;
12893 if(exp->op.exp2->expType)
12894 exp->op.exp2->expType->refCount++;
12895 valid = 0x1;
12896 }
12897 }
12898 }
12899 if(!valid)
12900 {
12901 if(exp->op.exp2->destType)
12902 FreeType(exp->op.exp2->destType);
12903 exp->op.exp2->destType = type1;
12904 type1->refCount++;
12905 if(CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0))
12906 {
12907 if(exp->expType)
12908 FreeType(exp->expType);
12909 exp->expType = exp->op.exp2->destType;
12910 if(exp->op.exp2->destType)
12911 exp->op.exp2->destType->refCount++;
12912 }
12913 else if(type1 && type2)
12914 {
12915 char expString1[10240];
12916 char expString2[10240];
12917 char type1String[1024];
12918 char type2String[1024];
12919
12920 expString1[0] = '\0';
12921 expString2[0] = '\0';
12922 type1String[0] = '\0';
12923 type2String[0] = '\0';
12924 if(inCompiler)
12925 {
12926 PrintExpression(exp->op.exp1, expString1);
12927 __ecereNameSpace__ecere__sys__ChangeCh(expString1, '\n', ' ');
12928 PrintExpression(exp->op.exp2, expString2);
12929 __ecereNameSpace__ecere__sys__ChangeCh(expString2, '\n', ' ');
12930 PrintType(exp->op.exp1->expType, type1String, 0x0, 0x1);
12931 PrintType(exp->op.exp2->expType, type2String, 0x0, 0x1);
12932 }
12933 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible expressions %s (%s) and %s (%s)\n", (((void *)0))), expString1, type1String, expString2, type2String);
12934 if(type1->kind == 8 && type1->_class && type1->_class->registered && type1->_class->registered->type == 4)
12935 {
12936 exp->expType = exp->op.exp1->expType;
12937 if(exp->op.exp1->expType)
12938 exp->op.exp1->expType->refCount++;
12939 }
12940 else if(type2->kind == 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 4)
12941 {
12942 exp->expType = exp->op.exp2->expType;
12943 if(exp->op.exp2->expType)
12944 exp->op.exp2->expType->refCount++;
12945 }
12946 }
12947 }
12948 }
12949 else if(type2)
12950 {
12951 if(type2->kind == 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 4)
12952 {
12953 struct Type * oldType = exp->op.exp1->expType;
12954
12955 exp->op.exp1->expType = (((void *)0));
12956 if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
12957 FreeType(oldType);
12958 else
12959 exp->op.exp1->expType = oldType;
12960 }
12961 if(exp->op.exp1->destType)
12962 FreeType(exp->op.exp1->destType);
12963 exp->op.exp1->destType = type2;
12964 type2->refCount++;
12965 if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
12966 {
12967 if(exp->expType)
12968 FreeType(exp->expType);
12969 exp->expType = exp->op.exp1->destType;
12970 if(exp->op.exp1->destType)
12971 exp->op.exp1->destType->refCount++;
12972 }
12973 }
12974 }
12975 else if(type2 && (!type1 || (type2->kind == 8 && type1->kind != 8)))
12976 {
12977 if(type1 && type2->_class && type2->_class->registered && type2->_class->registered->type == 3)
12978 {
12979 if(exp->op.exp1->destType)
12980 FreeType(exp->op.exp1->destType);
12981 exp->op.exp1->destType = type2->_class->registered->dataType;
12982 if(type2->_class->registered->dataType)
12983 type2->_class->registered->dataType->refCount++;
12984 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
12985 }
12986 if(exp->op.op == '!')
12987 {
12988 exp->expType = MkClassType("bool");
12989 exp->expType->truth = 0x1;
12990 }
12991 else
12992 {
12993 exp->expType = type2;
12994 if(type2)
12995 type2->refCount++;
12996 }
12997 }
12998 else if(type1 && (!type2 || (type1->kind == 8 && type2->kind != 8)))
12999 {
13000 if(type2 && type1->_class && type1->_class->registered && type1->_class->registered->type == 3)
13001 {
13002 if(exp->op.exp2->destType)
13003 FreeType(exp->op.exp2->destType);
13004 exp->op.exp2->destType = type1->_class->registered->dataType;
13005 if(type1->_class->registered->dataType)
13006 type1->_class->registered->dataType->refCount++;
13007 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
13008 }
13009 exp->expType = type1;
13010 if(type1)
13011 type1->refCount++;
13012 }
13013 }
13014 yylloc = exp->loc;
13015 if(exp->op.exp1 && !exp->op.exp1->expType)
13016 {
13017 char expString[10000];
13018
13019 expString[0] = '\0';
13020 if(inCompiler)
13021 {
13022 PrintExpression(exp->op.exp1, expString);
13023 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
13024 }
13025 if(expString[0])
13026 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't determine type of %s\n", (((void *)0))), expString);
13027 }
13028 if(exp->op.exp2 && !exp->op.exp2->expType)
13029 {
13030 char expString[10240];
13031
13032 expString[0] = '\0';
13033 if(inCompiler)
13034 {
13035 PrintExpression(exp->op.exp2, expString);
13036 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
13037 }
13038 if(expString[0])
13039 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't determine type of %s\n", (((void *)0))), expString);
13040 }
13041 if(boolResult)
13042 {
13043 FreeType(exp->expType);
13044 exp->expType = MkClassType("bool");
13045 exp->expType->truth = 0x1;
13046 }
13047 if(exp->op.op != SIZEOF)
13048 exp->isConstant = (!exp->op.exp1 || exp->op.exp1->isConstant) && (!exp->op.exp2 || exp->op.exp2->isConstant);
13049 if(exp->op.op == SIZEOF && exp->op.exp2->expType)
13050 {
13051 DeclareType(exp->op.exp2->expType, 0x0, 0x0);
13052 }
13053 yylloc = oldyylloc;
13054 FreeType(dummy);
13055 break;
13056 }
13057 case 5:
13058 case 34:
13059 {
13060 struct Expression * e;
13061
13062 exp->isConstant = 0x1;
13063 for(e = (*exp->list).first; e; e = e->next)
13064 {
13065 unsigned int inced = 0x0;
13066
13067 if(!e->next)
13068 {
13069 FreeType(e->destType);
13070 e->destType = exp->destType;
13071 if(e->destType)
13072 {
13073 exp->destType->refCount++;
13074 e->destType->count++;
13075 inced = 0x1;
13076 }
13077 }
13078 ProcessExpressionType(e);
13079 if(inced)
13080 exp->destType->count--;
13081 if(!exp->expType && !e->next)
13082 {
13083 exp->expType = e->expType;
13084 if(e->expType)
13085 e->expType->refCount++;
13086 }
13087 if(!e->isConstant)
13088 exp->isConstant = 0x0;
13089 }
13090 e = (*exp->list).first;
13091 if(!e->next && e->type == 8)
13092 {
13093 struct Expression * next = exp->next, * prev = exp->prev;
13094
13095 FreeType(exp->expType);
13096 FreeType(exp->destType);
13097 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->list), exp->list = 0);
13098 *exp = *e;
13099 exp->prev = prev;
13100 exp->next = next;
13101 ((e ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(e) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(e)) : 0), e = 0);
13102 ProcessExpressionType(exp);
13103 }
13104 break;
13105 }
13106 case 6:
13107 {
13108 struct Expression * e;
13109
13110 exp->isConstant = 0x1;
13111 ProcessExpressionType(exp->index.exp);
13112 if(!exp->index.exp->isConstant)
13113 exp->isConstant = 0x0;
13114 if(exp->index.exp->expType)
13115 {
13116 struct Type * source = exp->index.exp->expType;
13117
13118 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)
13119 {
13120 struct __ecereNameSpace__ecere__com__Class * _class = source->_class->registered;
13121
13122 exp->expType = ProcessTypeString(_class->templateArgs[2].dataTypeString, 0x0);
13123 if(exp->index.index && (*exp->index.index).last)
13124 {
13125 ((struct Expression *)(*exp->index.index).last)->destType = ProcessTypeString(_class->templateArgs[1].dataTypeString, 0x0);
13126 }
13127 }
13128 }
13129 for(e = (*exp->index.index).first; e; e = e->next)
13130 {
13131 if(!e->next && exp->index.exp->expType && exp->index.exp->expType->kind == 12 && exp->index.exp->expType->enumClass)
13132 {
13133 if(e->destType)
13134 FreeType(e->destType);
13135 e->destType = MkClassType(exp->index.exp->expType->enumClass->string);
13136 }
13137 ProcessExpressionType(e);
13138 if(!e->next)
13139 {
13140 }
13141 if(!e->isConstant)
13142 exp->isConstant = 0x0;
13143 }
13144 if(!exp->expType)
13145 exp->expType = Dereference(exp->index.exp->expType);
13146 if(exp->expType)
13147 DeclareType(exp->expType, 0x0, 0x0);
13148 break;
13149 }
13150 case 7:
13151 {
13152 struct Expression * e;
13153 struct Type * functionType;
13154 struct Type * methodType = (((void *)0));
13155 char name[1024];
13156
13157 name[0] = '\0';
13158 if(inCompiler)
13159 {
13160 PrintExpression(exp->call.exp, name);
13161 if(exp->call.exp->expType && !exp->call.exp->expType->returnType)
13162 {
13163 PrintExpression(exp->call.exp, name);
13164 }
13165 }
13166 if(exp->call.exp->type == 0)
13167 {
13168 struct Expression * idExp = exp->call.exp;
13169 struct Identifier * id = idExp->identifier;
13170
13171 if(!strcmp(id->string, "__ENDIAN_PAD"))
13172 {
13173 exp->expType = ProcessTypeString("int", 0x1);
13174 if(exp->call.arguments && (*exp->call.arguments).first)
13175 ProcessExpressionType((*exp->call.arguments).first);
13176 break;
13177 }
13178 else if(!strcmp(id->string, "Max") || !strcmp(id->string, "Min") || !strcmp(id->string, "Sgn") || !strcmp(id->string, "Abs"))
13179 {
13180 struct Expression * a = (((void *)0));
13181 struct Expression * b = (((void *)0));
13182 struct Expression * tempExp1 = (((void *)0)), * tempExp2 = (((void *)0));
13183
13184 if((!strcmp(id->string, "Max") || !strcmp(id->string, "Min")) && (*exp->call.arguments).count == 2)
13185 {
13186 a = (*exp->call.arguments).first;
13187 b = (*exp->call.arguments).last;
13188 tempExp1 = a;
13189 tempExp2 = b;
13190 }
13191 else if((*exp->call.arguments).count == 1)
13192 {
13193 a = (*exp->call.arguments).first;
13194 tempExp1 = a;
13195 }
13196 if(a)
13197 {
13198 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear((&*exp->call.arguments));
13199 idExp->identifier = (((void *)0));
13200 FreeExpContents(exp);
13201 ProcessExpressionType(a);
13202 if(b)
13203 ProcessExpressionType(b);
13204 exp->type = 5;
13205 exp->list = MkList();
13206 if(a->expType && (!b || b->expType))
13207 {
13208 if((!a->isConstant && a->type != 0) || (b && !b->isConstant && b->type != 0))
13209 {
13210 if(inCompiler)
13211 {
13212 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13213 struct __ecereNameSpace__ecere__sys__OldList * decls = MkList();
13214 struct Declaration * decl;
13215 char temp1[1024], temp2[1024];
13216
13217 GetTypeSpecs(a->expType, specs);
13218 if(a && !a->isConstant && a->type != 0)
13219 {
13220 sprintf(temp1, "__simpleStruct%d", curContext->simpleID++);
13221 ListAdd(decls, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(temp1)), (((void *)0))));
13222 tempExp1 = QMkExpId(temp1);
13223 tempExp1->expType = a->expType;
13224 if(a->expType)
13225 a->expType->refCount++;
13226 ListAdd(exp->list, MkExpOp(CopyExpression(tempExp1), '=', a));
13227 }
13228 if(b && !b->isConstant && b->type != 0)
13229 {
13230 sprintf(temp2, "__simpleStruct%d", curContext->simpleID++);
13231 ListAdd(decls, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(temp2)), (((void *)0))));
13232 tempExp2 = QMkExpId(temp2);
13233 tempExp2->expType = b->expType;
13234 if(b->expType)
13235 b->expType->refCount++;
13236 ListAdd(exp->list, MkExpOp(CopyExpression(tempExp2), '=', b));
13237 }
13238 decl = MkDeclaration(specs, decls);
13239 if(!curCompound->compound.declarations)
13240 curCompound->compound.declarations = MkList();
13241 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*curCompound->compound.declarations), (((void *)0)), decl);
13242 }
13243 }
13244 }
13245 if(!strcmp(id->string, "Max") || !strcmp(id->string, "Min"))
13246 {
13247 int op = (!strcmp(id->string, "Max")) ? '>' : '<';
13248
13249 ListAdd(exp->list, MkExpCondition(MkExpBrackets(MkListOne(MkExpOp(CopyExpression(tempExp1), op, CopyExpression(tempExp2)))), MkListOne(CopyExpression(tempExp1)), CopyExpression(tempExp2)));
13250 exp->expType = a->expType;
13251 if(a->expType)
13252 a->expType->refCount++;
13253 }
13254 else if(!strcmp(id->string, "Abs"))
13255 {
13256 ListAdd(exp->list, MkExpCondition(MkExpBrackets(MkListOne(MkExpOp(CopyExpression(tempExp1), '<', MkExpConstant("0")))), MkListOne(MkExpOp((((void *)0)), '-', CopyExpression(tempExp1))), CopyExpression(tempExp1)));
13257 exp->expType = a->expType;
13258 if(a->expType)
13259 a->expType->refCount++;
13260 }
13261 else if(!strcmp(id->string, "Sgn"))
13262 {
13263 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"))))));
13264 exp->expType = ProcessTypeString("int", 0x0);
13265 }
13266 FreeExpression(tempExp1);
13267 if(tempExp2)
13268 FreeExpression(tempExp2);
13269 FreeIdentifier(id);
13270 break;
13271 }
13272 }
13273 }
13274 {
13275 struct Type * dummy = (dummy = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), dummy->count = (unsigned int)1, dummy->refCount = 1, dummy);
13276
13277 if(!exp->call.exp->destType)
13278 {
13279 exp->call.exp->destType = dummy;
13280 dummy->refCount++;
13281 }
13282 ProcessExpressionType(exp->call.exp);
13283 if(exp->call.exp->destType == dummy)
13284 {
13285 FreeType(dummy);
13286 exp->call.exp->destType = (((void *)0));
13287 }
13288 FreeType(dummy);
13289 }
13290 functionType = exp->call.exp->expType;
13291 if(functionType && functionType->kind == 16)
13292 {
13293 methodType = functionType;
13294 functionType = methodType->method->dataType;
13295 if(exp->call.exp->expType->usedClass)
13296 {
13297 char typeString[1024];
13298
13299 typeString[0] = '\0';
13300 PrintType(functionType, typeString, 0x1, 0x1);
13301 if(strstr(typeString, "thisclass"))
13302 {
13303 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13304 struct Declarator * decl;
13305
13306 {
13307 struct Context * context = SetupTemplatesContext(exp->call.exp->expType->usedClass);
13308
13309 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
13310 if(thisClass != (exp->call.exp->expType->usedClass->templateClass ? exp->call.exp->expType->usedClass->templateClass : exp->call.exp->expType->usedClass))
13311 thisClassParams = 0x0;
13312 ReplaceThisClassSpecifiers(specs, exp->call.exp->expType->usedClass);
13313 {
13314 struct __ecereNameSpace__ecere__com__Class * backupThisClass = thisClass;
13315
13316 thisClass = exp->call.exp->expType->usedClass;
13317 ProcessDeclarator(decl);
13318 thisClass = backupThisClass;
13319 }
13320 thisClassParams = 0x1;
13321 functionType = ProcessType(specs, decl);
13322 functionType->refCount = 0;
13323 FinishTemplatesContext(context);
13324 }
13325 FreeList(specs, FreeSpecifier);
13326 FreeDeclarator(decl);
13327 }
13328 }
13329 }
13330 if(functionType && functionType->kind == 13 && functionType->type && functionType->type->kind == 11)
13331 {
13332 struct Type * type = functionType->type;
13333
13334 if(!functionType->refCount)
13335 {
13336 functionType->type = (((void *)0));
13337 FreeType(functionType);
13338 }
13339 functionType = type;
13340 }
13341 if(functionType && functionType->kind != 11)
13342 {
13343 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "called object %s is not a function\n", (((void *)0))), name);
13344 }
13345 else if(functionType)
13346 {
13347 unsigned int emptyParams = 0x0, noParams = 0x0;
13348 struct Expression * e = exp->call.arguments ? (*exp->call.arguments).first : (((void *)0));
13349 struct Type * type = functionType->params.first;
13350 struct Expression * memberExp = (exp->call.exp->type == 8) ? exp->call.exp : (((void *)0));
13351 int extra = 0;
13352 struct Location oldyylloc = yylloc;
13353
13354 if(!type)
13355 emptyParams = 0x1;
13356 if(functionType->extraParam && e)
13357 {
13358 e->destType = MkClassType(functionType->thisClass->string);
13359 e = e->next;
13360 }
13361 if(!functionType->staticMethod)
13362 {
13363 if(memberExp && memberExp->member.exp && memberExp->member.exp->expType && memberExp->member.exp->expType->kind == 19 && memberExp->member.exp->expType->_class)
13364 {
13365 type = MkClassType(memberExp->member.exp->expType->_class->string);
13366 if(e)
13367 {
13368 e->destType = type;
13369 e = e->next;
13370 type = functionType->params.first;
13371 }
13372 else
13373 type->refCount = 0;
13374 }
13375 else if(!memberExp && (functionType->thisClass || (methodType && methodType->methodClass)))
13376 {
13377 type = MkClassType(functionType->thisClass ? functionType->thisClass->string : (methodType ? methodType->methodClass->fullName : (((void *)0))));
13378 if(e)
13379 {
13380 e->destType = type;
13381 e = e->next;
13382 type = functionType->params.first;
13383 }
13384 else
13385 type->refCount = 0;
13386 }
13387 }
13388 if(type && type->kind == 0)
13389 {
13390 noParams = 0x1;
13391 if(!type->refCount)
13392 FreeType(type);
13393 type = (((void *)0));
13394 }
13395 for(; e; e = e->next)
13396 {
13397 if(!type && !emptyParams)
13398 {
13399 yylloc = e->loc;
13400 if(methodType && methodType->methodClass)
13401 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);
13402 else
13403 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);
13404 break;
13405 }
13406 if(methodType && type && type->kind == 20 && type->templateParameter->type == 0)
13407 {
13408 struct Type * templatedType = (((void *)0));
13409 struct __ecereNameSpace__ecere__com__Class * _class = methodType->usedClass;
13410 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
13411 int id = 0;
13412
13413 if(_class && _class->templateArgs)
13414 {
13415 struct __ecereNameSpace__ecere__com__Class * sClass;
13416
13417 for(sClass = _class; sClass; sClass = sClass->base)
13418 {
13419 if(sClass->templateClass)
13420 sClass = sClass->templateClass;
13421 id = 0;
13422 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
13423 {
13424 if(curParam->type == 0 && !strcmp(type->templateParameter->identifier->string, curParam->name))
13425 {
13426 struct __ecereNameSpace__ecere__com__Class * nextClass;
13427
13428 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
13429 {
13430 if(nextClass->templateClass)
13431 nextClass = nextClass->templateClass;
13432 id += nextClass->templateParams.count;
13433 }
13434 break;
13435 }
13436 id++;
13437 }
13438 if(curParam)
13439 break;
13440 }
13441 }
13442 if(curParam && _class->templateArgs[id].dataTypeString)
13443 {
13444 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = _class->templateArgs[id];
13445
13446 {
13447 struct Context * context = SetupTemplatesContext(_class);
13448
13449 templatedType = ProcessTypeString(arg.dataTypeString, 0x0);
13450 FinishTemplatesContext(context);
13451 }
13452 e->destType = templatedType;
13453 if(templatedType)
13454 {
13455 templatedType->passAsTemplate = 0x1;
13456 }
13457 }
13458 else
13459 {
13460 e->destType = type;
13461 if(type)
13462 type->refCount++;
13463 }
13464 }
13465 else
13466 {
13467 e->destType = type;
13468 if(type)
13469 type->refCount++;
13470 }
13471 if(type && type->kind != 14)
13472 {
13473 struct Type * next = type->next;
13474
13475 if(!type->refCount)
13476 FreeType(type);
13477 type = next;
13478 }
13479 }
13480 if(type && type->kind != 14)
13481 {
13482 if(methodType && methodType->methodClass)
13483 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);
13484 else
13485 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);
13486 }
13487 yylloc = oldyylloc;
13488 if(type && !type->refCount)
13489 FreeType(type);
13490 }
13491 else
13492 {
13493 functionType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->refCount = 0, ((struct Type *)__ecereTemp1)->kind = 11, ((struct Type *)__ecereTemp1));
13494 if(exp->call.exp->type == 0)
13495 {
13496 char * string = exp->call.exp->identifier->string;
13497
13498 if(inCompiler)
13499 {
13500 struct Symbol * symbol;
13501 struct Location oldyylloc = yylloc;
13502
13503 yylloc = exp->call.exp->identifier->loc;
13504 if(strstr(string, "__builtin_") == string)
13505 ;
13506 else
13507 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "%s undefined; assuming extern returning int\n", (((void *)0))), string);
13508 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));
13509 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)symbol);
13510 if(strstr(symbol->string, "::"))
13511 globalContext->hasNameSpace = 0x1;
13512 yylloc = oldyylloc;
13513 }
13514 }
13515 else if(exp->call.exp->type == 8)
13516 {
13517 }
13518 else
13519 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "callable object undefined; extern assuming returning int\n", (((void *)0))));
13520 if(!functionType->returnType)
13521 {
13522 functionType->returnType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1)->kind = 3, ((struct Type *)__ecereTemp1));
13523 }
13524 }
13525 if(functionType && functionType->kind == 11)
13526 {
13527 exp->expType = functionType->returnType;
13528 if(functionType->returnType)
13529 functionType->returnType->refCount++;
13530 if(!functionType->refCount)
13531 FreeType(functionType);
13532 }
13533 if(exp->call.arguments)
13534 {
13535 for(e = (*exp->call.arguments).first; e; e = e->next)
13536 {
13537 struct Type * destType = e->destType;
13538
13539 ProcessExpressionType(e);
13540 }
13541 }
13542 break;
13543 }
13544 case 8:
13545 {
13546 struct Type * type;
13547 struct Location oldyylloc = yylloc;
13548 unsigned int thisPtr = (exp->member.exp && exp->member.exp->type == 0 && !strcmp(exp->member.exp->identifier->string, "this"));
13549
13550 exp->thisPtr = thisPtr;
13551 if(exp->member.member && exp->member.member->_class && exp->member.member->_class->name)
13552 {
13553 exp->member.member->classSym = exp->member.member->_class->symbol;
13554 }
13555 ProcessExpressionType(exp->member.exp);
13556 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)
13557 {
13558 exp->isConstant = 0x0;
13559 }
13560 else
13561 exp->isConstant = exp->member.exp->isConstant;
13562 type = exp->member.exp->expType;
13563 yylloc = exp->loc;
13564 if(type && (type->kind == 20))
13565 {
13566 struct __ecereNameSpace__ecere__com__Class * _class = thisClass ? thisClass : currentClass;
13567 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param = (((void *)0));
13568
13569 if(_class)
13570 {
13571 for(param = _class->templateParams.first; param; param = param->next)
13572 {
13573 if(param->type == 1 && exp->member.member && exp->member.member->string && !strcmp(param->name, exp->member.member->string))
13574 break;
13575 }
13576 }
13577 if(param && param->defaultArg.member)
13578 {
13579 struct Expression * argExp = GetTemplateArgExpByName(param->name, thisClass, 1);
13580
13581 if(argExp)
13582 {
13583 struct Expression * expMember = exp->member.exp;
13584 struct Declarator * decl;
13585 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13586 char thisClassTypeString[1024];
13587
13588 FreeIdentifier(exp->member.member);
13589 ProcessExpressionType(argExp);
13590 {
13591 char * colon = strstr(param->defaultArg.memberString, "::");
13592
13593 if(colon)
13594 {
13595 char className[1024];
13596 struct __ecereNameSpace__ecere__com__Class * sClass;
13597
13598 memcpy(thisClassTypeString, param->defaultArg.memberString, colon - param->defaultArg.memberString);
13599 thisClassTypeString[colon - param->defaultArg.memberString] = '\0';
13600 }
13601 else
13602 strcpy(thisClassTypeString, _class->fullName);
13603 }
13604 decl = SpecDeclFromString(param->defaultArg.member->dataTypeString, specs, (((void *)0)));
13605 exp->expType = ProcessType(specs, decl);
13606 if(exp->expType->kind == 8 && exp->expType->_class && exp->expType->_class->registered && exp->expType->_class->registered->templateClass)
13607 {
13608 struct __ecereNameSpace__ecere__com__Class * expClass = exp->expType->_class->registered;
13609 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
13610 int c;
13611 int paramCount = 0;
13612 int lastParam = -1;
13613 char templateString[1024];
13614 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
13615
13616 sprintf(templateString, "%s<", expClass->templateClass->fullName);
13617 for(cClass = expClass; cClass; cClass = cClass->base)
13618 {
13619 int p = 0;
13620
13621 for(param = cClass->templateParams.first; param; param = param->next)
13622 {
13623 int id = p;
13624 struct __ecereNameSpace__ecere__com__Class * sClass;
13625 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
13626
13627 for(sClass = cClass->base; sClass; sClass = sClass->base)
13628 id += sClass->templateParams.count;
13629 arg = expClass->templateArgs[id];
13630 for(sClass = _class; sClass; sClass = sClass->base)
13631 {
13632 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * cParam;
13633 int p = 0;
13634 struct __ecereNameSpace__ecere__com__Class * nextClass;
13635
13636 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
13637 p += nextClass->templateParams.count;
13638 for(cParam = sClass->templateParams.first; cParam; cParam = cParam->next, p++)
13639 {
13640 if(cParam->type == 0 && arg.dataTypeString && !strcmp(cParam->name, arg.dataTypeString))
13641 {
13642 if(_class->templateArgs && arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
13643 {
13644 arg.dataTypeString = _class->templateArgs[p].dataTypeString;
13645 arg.dataTypeClass = _class->templateArgs[p].dataTypeClass;
13646 break;
13647 }
13648 }
13649 }
13650 }
13651 {
13652 char argument[256];
13653
13654 argument[0] = '\0';
13655 switch(param->type)
13656 {
13657 case 2:
13658 {
13659 char expString[1024];
13660 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13661 struct Declarator * decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
13662 struct Expression * exp;
13663 char * string = PrintHexUInt64(arg.expression.ui64);
13664
13665 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
13666 ProcessExpressionType(exp);
13667 ComputeExpression(exp);
13668 expString[0] = '\0';
13669 PrintExpression(exp, expString);
13670 strcat(argument, expString);
13671 FreeExpression(exp);
13672 break;
13673 }
13674 case 1:
13675 {
13676 strcat(argument, arg.member->name);
13677 break;
13678 }
13679 case 0:
13680 {
13681 if(arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
13682 {
13683 if(!strcmp(arg.dataTypeString, "thisclass"))
13684 strcat(argument, thisClassTypeString);
13685 else
13686 strcat(argument, arg.dataTypeString);
13687 }
13688 break;
13689 }
13690 }
13691 if(argument[0])
13692 {
13693 if(paramCount)
13694 strcat(templateString, ", ");
13695 if(lastParam != p - 1)
13696 {
13697 strcat(templateString, param->name);
13698 strcat(templateString, " = ");
13699 }
13700 strcat(templateString, argument);
13701 paramCount++;
13702 lastParam = p;
13703 }
13704 p++;
13705 }
13706 }
13707 }
13708 {
13709 int len = strlen(templateString);
13710
13711 if(templateString[len - 1] == '>')
13712 templateString[len++] = ' ';
13713 templateString[len++] = '>';
13714 templateString[len++] = '\0';
13715 }
13716 {
13717 struct Context * context = SetupTemplatesContext(_class);
13718
13719 FreeType(exp->expType);
13720 exp->expType = ProcessTypeString(templateString, 0x0);
13721 FinishTemplatesContext(context);
13722 }
13723 }
13724 exp->type = 5;
13725 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")))))))));
13726 }
13727 }
13728 else if(type->templateParameter && type->templateParameter->type == 0 && (type->templateParameter->dataType || type->templateParameter->dataTypeString))
13729 {
13730 type = ProcessTemplateParameterType(type->templateParameter);
13731 }
13732 }
13733 if(type && (type->kind == 20))
13734 ;
13735 else if(type && (type->kind == 8 || type->kind == 19 || type->kind == 3 || type->kind == 15))
13736 {
13737 struct Identifier * id = exp->member.member;
13738 int typeKind = type->kind;
13739 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));
13740
13741 if(typeKind == 19 && exp->member.exp->type == 26)
13742 {
13743 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "ecere::com::Class");
13744 typeKind = 8;
13745 }
13746 if(id && (typeKind == 3 || typeKind == 15))
13747 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "int");
13748 if(_class && id)
13749 {
13750 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
13751 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
13752 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
13753 struct __ecereNameSpace__ecere__com__Property * revConvert = (((void *)0));
13754 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
13755
13756 if(id && id->_class && id->_class->name && !strcmp(id->_class->name, "property"))
13757 exp->member.memberType = 1;
13758 if(id && id->_class && type->_class && !__ecereNameSpace__ecere__com__eClass_IsDerived(type->_class->registered, _class))
13759 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "invalid class specifier %s for object of class %s\n", (((void *)0))), _class->fullName, type->_class->string);
13760 if(typeKind != 19)
13761 {
13762 if((exp->member.memberType == 0 && thisPtr) || exp->member.memberType == 3)
13763 {
13764 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
13765 if(member && member->_class != (_class->templateClass ? _class->templateClass : _class) && exp->member.memberType != 3)
13766 {
13767 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
13768 if(prop)
13769 member = (((void *)0));
13770 }
13771 if(!member && !prop)
13772 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
13773 if((member && member->_class == (_class->templateClass ? _class->templateClass : _class)) || (prop && prop->_class == (_class->templateClass ? _class->templateClass : _class)))
13774 exp->member.thisPtr = 0x1;
13775 }
13776 else
13777 {
13778 if(!id->classSym)
13779 {
13780 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, (((void *)0)));
13781 if(!id->_class || !id->_class->name || strcmp(id->_class->name, "property"))
13782 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, (((void *)0)), (((void *)0)), (((void *)0)));
13783 }
13784 if(!prop && !member)
13785 {
13786 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, (((void *)0)));
13787 if(!method)
13788 {
13789 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
13790 if(!id->_class || !id->_class->name || strcmp(id->_class->name, "property"))
13791 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
13792 }
13793 }
13794 if(member && prop)
13795 {
13796 if(member->_class != prop->_class && !id->_class && __ecereNameSpace__ecere__com__eClass_IsDerived(member->_class, prop->_class))
13797 prop = (((void *)0));
13798 else
13799 member = (((void *)0));
13800 }
13801 }
13802 }
13803 if(!prop && !member)
13804 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule);
13805 if(!prop && !member && !method)
13806 {
13807 if(typeKind == 19)
13808 {
13809 classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(type->_class->registered, exp->member.member->string);
13810 if(classProp)
13811 {
13812 exp->member.memberType = 5;
13813 exp->expType = ProcessTypeString(classProp->dataTypeString, 0x0);
13814 }
13815 else
13816 {
13817 char structName[1024];
13818 struct Identifier * id = exp->member.member;
13819 struct Expression * classExp = exp->member.exp;
13820
13821 type->refCount++;
13822 FreeType(classExp->expType);
13823 classExp->expType = ProcessTypeString("ecere::com::Class", 0x0);
13824 strcpy(structName, "__ecereClassData_");
13825 FullClassNameCat(structName, type->_class->string, 0x0);
13826 exp->type = 9;
13827 exp->member.member = id;
13828 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"))))))));
13829 FreeType(type);
13830 ProcessExpressionType(exp);
13831 return ;
13832 }
13833 }
13834 else
13835 {
13836 struct Symbol * classSym = FindClass(id->string);
13837
13838 if(classSym)
13839 {
13840 struct __ecereNameSpace__ecere__com__Class * convertClass = classSym->registered;
13841
13842 if(convertClass)
13843 revConvert = __ecereNameSpace__ecere__com__eClass_FindProperty(convertClass, _class->fullName, privateModule);
13844 }
13845 }
13846 }
13847 if(prop)
13848 {
13849 exp->member.memberType = 1;
13850 if(!prop->dataType)
13851 ProcessPropertyType(prop);
13852 exp->expType = prop->dataType;
13853 if(prop->dataType)
13854 prop->dataType->refCount++;
13855 }
13856 else if(member)
13857 {
13858 if(exp->member.exp->expType->classObjectType == 2 && !strcmp(exp->member.member->string, "_class"))
13859 {
13860 FreeExpContents(exp);
13861 exp->type = 0;
13862 exp->identifier = MkIdentifier("class");
13863 ProcessExpressionType(exp);
13864 return ;
13865 }
13866 exp->member.memberType = 3;
13867 DeclareStruct(_class->fullName, 0x0);
13868 if(!member->dataType)
13869 {
13870 struct Context * context = SetupTemplatesContext(_class);
13871
13872 member->dataType = ProcessTypeString(member->dataTypeString, 0x0);
13873 FinishTemplatesContext(context);
13874 }
13875 exp->expType = member->dataType;
13876 if(member->dataType)
13877 member->dataType->refCount++;
13878 }
13879 else if(revConvert)
13880 {
13881 exp->member.memberType = 4;
13882 exp->expType = MkClassType(revConvert->_class->fullName);
13883 }
13884 else if(method)
13885 {
13886 if(inCompiler)
13887 {
13888 exp->member.memberType = 2;
13889 }
13890 if(!method->dataType)
13891 ProcessMethodType(method);
13892 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));
13893 exp->expType->methodClass = (id && id->_class) ? _class : (((void *)0));
13894 exp->expType->usedClass = _class;
13895 }
13896 else if(!classProp)
13897 {
13898 if(exp->member.exp->expType->classObjectType == 2 && !strcmp(exp->member.member->string, "_class"))
13899 {
13900 FreeExpContents(exp);
13901 exp->type = 0;
13902 exp->identifier = MkIdentifier("class");
13903 ProcessExpressionType(exp);
13904 return ;
13905 }
13906 yylloc = exp->member.member->loc;
13907 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't find member %s in class %s\n", (((void *)0))), id->string, _class->fullName);
13908 if(inCompiler)
13909 __ecereNameSpace__ecere__com__eClass_AddDataMember(_class, id->string, "int", 0, 0, 1);
13910 }
13911 if(_class && exp->expType)
13912 {
13913 struct __ecereNameSpace__ecere__com__Class * tClass;
13914
13915 tClass = _class;
13916 while(tClass && !tClass->templateClass)
13917 tClass = tClass->base;
13918 if(tClass && exp->expType->kind == 20 && exp->expType->templateParameter->type == 0)
13919 {
13920 int id = 0;
13921 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
13922 struct __ecereNameSpace__ecere__com__Class * sClass;
13923
13924 for(sClass = tClass; sClass; sClass = sClass->base)
13925 {
13926 id = 0;
13927 if(sClass->templateClass)
13928 sClass = sClass->templateClass;
13929 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
13930 {
13931 if(curParam->type == 0 && !strcmp(exp->expType->templateParameter->identifier->string, curParam->name))
13932 {
13933 for(sClass = sClass->base; sClass; sClass = sClass->base)
13934 id += sClass->templateParams.count;
13935 break;
13936 }
13937 id++;
13938 }
13939 if(curParam)
13940 break;
13941 }
13942 if(curParam && tClass->templateArgs[id].dataTypeString)
13943 {
13944 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = tClass->templateArgs[id];
13945 struct Context * context = SetupTemplatesContext(tClass);
13946
13947 FreeType(exp->expType);
13948 exp->expType = ProcessTypeString(arg.dataTypeString, 0x0);
13949 if(exp->expType)
13950 {
13951 if(exp->expType->kind == 21)
13952 {
13953 FreeType(exp->expType);
13954 exp->expType = ReplaceThisClassType(_class);
13955 }
13956 if(tClass->templateClass)
13957 exp->expType->passAsTemplate = 0x1;
13958 if(!exp->destType)
13959 {
13960 exp->destType = ProcessTypeString(arg.dataTypeString, 0x0);
13961 if(exp->destType->kind == 21)
13962 {
13963 FreeType(exp->destType);
13964 exp->destType = ReplaceThisClassType(_class);
13965 }
13966 }
13967 }
13968 FinishTemplatesContext(context);
13969 }
13970 }
13971 else if(tClass && exp->expType->kind == 13 && exp->expType->type && exp->expType->type->kind == 20 && exp->expType->type->templateParameter->type == 0)
13972 {
13973 int id = 0;
13974 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
13975 struct __ecereNameSpace__ecere__com__Class * sClass;
13976
13977 for(sClass = tClass; sClass; sClass = sClass->base)
13978 {
13979 id = 0;
13980 if(sClass->templateClass)
13981 sClass = sClass->templateClass;
13982 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
13983 {
13984 if(curParam->type == 0 && !strcmp(exp->expType->type->templateParameter->identifier->string, curParam->name))
13985 {
13986 for(sClass = sClass->base; sClass; sClass = sClass->base)
13987 id += sClass->templateParams.count;
13988 break;
13989 }
13990 id++;
13991 }
13992 if(curParam)
13993 break;
13994 }
13995 if(curParam)
13996 {
13997 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = tClass->templateArgs[id];
13998 struct Context * context = SetupTemplatesContext(tClass);
13999 struct Type * basicType;
14000
14001 basicType = ProcessTypeString(arg.dataTypeString, 0x0);
14002 if(basicType)
14003 {
14004 if(basicType->kind == 21)
14005 {
14006 FreeType(basicType);
14007 basicType = ReplaceThisClassType(_class);
14008 }
14009 FreeType(exp->expType);
14010 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));
14011 if(!exp->destType)
14012 {
14013 exp->destType = exp->expType;
14014 exp->destType->refCount++;
14015 }
14016 {
14017 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
14018 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
14019 struct Declarator * decl;
14020
14021 decl = SpecDeclFromString(arg.dataTypeString, specs, (((void *)0)));
14022 *newExp = *exp;
14023 if(exp->destType)
14024 exp->destType->refCount++;
14025 if(exp->expType)
14026 exp->expType->refCount++;
14027 exp->type = 11;
14028 exp->cast.typeName = MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl));
14029 exp->cast.exp = newExp;
14030 }
14031 }
14032 FinishTemplatesContext(context);
14033 }
14034 }
14035 else if(tClass && exp->expType->kind == 8 && exp->expType->_class && strchr(exp->expType->_class->string, '<'))
14036 {
14037 struct __ecereNameSpace__ecere__com__Class * expClass = exp->expType->_class->registered;
14038
14039 if(expClass)
14040 {
14041 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
14042 int c;
14043 int p = 0;
14044 int paramCount = 0;
14045 int lastParam = -1;
14046 char templateString[1024];
14047 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
14048
14049 sprintf(templateString, "%s<", expClass->templateClass->fullName);
14050 while(cClass != expClass)
14051 {
14052 struct __ecereNameSpace__ecere__com__Class * sClass;
14053
14054 for(sClass = expClass; sClass && sClass->base != cClass; sClass = sClass->base)
14055 ;
14056 cClass = sClass;
14057 for(param = cClass->templateParams.first; param; param = param->next)
14058 {
14059 struct __ecereNameSpace__ecere__com__Class * cClassCur = (((void *)0));
14060 int c;
14061 int cp = 0;
14062 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * paramCur = (((void *)0));
14063 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
14064
14065 while(cClassCur != tClass && !paramCur)
14066 {
14067 struct __ecereNameSpace__ecere__com__Class * sClassCur;
14068
14069 for(sClassCur = tClass; sClassCur && sClassCur->base != cClassCur; sClassCur = sClassCur->base)
14070 ;
14071 cClassCur = sClassCur;
14072 for(paramCur = cClassCur->templateParams.first; paramCur; paramCur = paramCur->next)
14073 {
14074 if(!strcmp(paramCur->name, param->name))
14075 {
14076 break;
14077 }
14078 cp++;
14079 }
14080 }
14081 if(paramCur && paramCur->type == 0)
14082 arg = tClass->templateArgs[cp];
14083 else
14084 arg = expClass->templateArgs[p];
14085 {
14086 char argument[256];
14087
14088 argument[0] = '\0';
14089 switch(param->type)
14090 {
14091 case 2:
14092 {
14093 char expString[1024];
14094 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
14095 struct Declarator * decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
14096 struct Expression * exp;
14097 char * string = PrintHexUInt64(arg.expression.ui64);
14098
14099 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
14100 ProcessExpressionType(exp);
14101 ComputeExpression(exp);
14102 expString[0] = '\0';
14103 PrintExpression(exp, expString);
14104 strcat(argument, expString);
14105 FreeExpression(exp);
14106 break;
14107 }
14108 case 1:
14109 {
14110 strcat(argument, arg.member->name);
14111 break;
14112 }
14113 case 0:
14114 {
14115 if(arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
14116 strcat(argument, arg.dataTypeString);
14117 break;
14118 }
14119 }
14120 if(argument[0])
14121 {
14122 if(paramCount)
14123 strcat(templateString, ", ");
14124 if(lastParam != p - 1)
14125 {
14126 strcat(templateString, param->name);
14127 strcat(templateString, " = ");
14128 }
14129 strcat(templateString, argument);
14130 paramCount++;
14131 lastParam = p;
14132 }
14133 }
14134 p++;
14135 }
14136 }
14137 {
14138 int len = strlen(templateString);
14139
14140 if(templateString[len - 1] == '>')
14141 templateString[len++] = ' ';
14142 templateString[len++] = '>';
14143 templateString[len++] = '\0';
14144 }
14145 FreeType(exp->expType);
14146 {
14147 struct Context * context = SetupTemplatesContext(tClass);
14148
14149 exp->expType = ProcessTypeString(templateString, 0x0);
14150 FinishTemplatesContext(context);
14151 }
14152 }
14153 }
14154 }
14155 }
14156 else
14157 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)");
14158 }
14159 else if(type && (type->kind == 9 || type->kind == 10))
14160 {
14161 struct Type * memberType = exp->member.member ? FindMember(type, exp->member.member->string) : (((void *)0));
14162
14163 if(memberType)
14164 {
14165 exp->expType = memberType;
14166 if(memberType)
14167 memberType->refCount++;
14168 }
14169 }
14170 else
14171 {
14172 char expString[10240];
14173
14174 expString[0] = '\0';
14175 if(inCompiler)
14176 {
14177 PrintExpression(exp, expString);
14178 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14179 }
14180 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "member operator on non-structure type expression %s\n", (((void *)0))), expString);
14181 }
14182 if(exp->expType && exp->expType->kind == 21 && (!exp->destType || exp->destType->kind != 21))
14183 {
14184 if(type && (type->kind == 8 || type->kind == 19 || type->kind == 3 || type->kind == 15))
14185 {
14186 struct Identifier * id = exp->member.member;
14187 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));
14188
14189 if(_class)
14190 {
14191 FreeType(exp->expType);
14192 exp->expType = ReplaceThisClassType(_class);
14193 }
14194 }
14195 }
14196 yylloc = oldyylloc;
14197 break;
14198 }
14199 case 9:
14200 {
14201 struct Type * destType = exp->destType;
14202
14203 if(exp->member.member && exp->member.member->_class && exp->member.member->_class->name)
14204 {
14205 exp->member.member->classSym = exp->member.member->_class->symbol;
14206 }
14207 exp->member.exp = MkExpBrackets(MkListOne(MkExpOp((((void *)0)), '*', exp->member.exp)));
14208 exp->type = 8;
14209 if(destType)
14210 destType->count++;
14211 ProcessExpressionType(exp);
14212 if(destType)
14213 destType->count--;
14214 break;
14215 }
14216 case 15:
14217 {
14218 struct Symbol * classSym = exp->_class->symbol;
14219
14220 if(classSym && classSym->registered)
14221 {
14222 if(classSym->registered->type == 5)
14223 {
14224 char name[1024];
14225
14226 name[0] = '\0';
14227 DeclareStruct(classSym->string, 0x0);
14228 FreeSpecifier(exp->_class);
14229 exp->type = 10;
14230 FullClassNameCat(name, classSym->string, 0x0);
14231 exp->typeName = MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(name), (((void *)0)))), (((void *)0)));
14232 }
14233 else
14234 {
14235 if(classSym->registered->fixed)
14236 {
14237 FreeSpecifier(exp->_class);
14238 exp->constant = PrintUInt(classSym->registered->templateClass ? classSym->registered->templateClass->structSize : classSym->registered->structSize);
14239 exp->type = 2;
14240 }
14241 else
14242 {
14243 char className[1024];
14244
14245 strcpy(className, "__ecereClass_");
14246 FullClassNameCat(className, classSym->string, 0x1);
14247 MangleClassName(className);
14248 DeclareClass(classSym, className);
14249 FreeExpContents(exp);
14250 exp->type = 9;
14251 exp->member.exp = MkExpIdentifier(MkIdentifier(className));
14252 exp->member.member = MkIdentifier("structSize");
14253 }
14254 }
14255 }
14256 exp->expType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1)->kind = 3, ((struct Type *)__ecereTemp1));
14257 break;
14258 }
14259 case 10:
14260 {
14261 struct Type * type = ProcessType(exp->typeName->qualifiers, exp->typeName->declarator);
14262
14263 exp->expType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1)->kind = 3, ((struct Type *)__ecereTemp1));
14264 exp->isConstant = 0x1;
14265 DeclareType(type, 0x0, 0x0);
14266 FreeType(type);
14267 break;
14268 }
14269 case 11:
14270 {
14271 struct Type * type = ProcessType(exp->cast.typeName->qualifiers, exp->cast.typeName->declarator);
14272
14273 type->count = (unsigned int)1;
14274 FreeType(exp->cast.exp->destType);
14275 exp->cast.exp->destType = type;
14276 type->refCount++;
14277 ProcessExpressionType(exp->cast.exp);
14278 type->count = (unsigned int)0;
14279 exp->expType = type;
14280 if(!exp->cast.exp->needCast && !NeedCast(exp->cast.exp->expType, type))
14281 {
14282 void * prev = exp->prev, * next = exp->next;
14283 struct Type * expType = exp->cast.exp->destType;
14284 struct Expression * castExp = exp->cast.exp;
14285 struct Type * destType = exp->destType;
14286
14287 if(expType)
14288 expType->refCount++;
14289 FreeType(exp->expType);
14290 FreeTypeName(exp->cast.typeName);
14291 *exp = *castExp;
14292 FreeType(exp->expType);
14293 FreeType(exp->destType);
14294 exp->expType = expType;
14295 exp->destType = destType;
14296 ((castExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(castExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(castExp)) : 0), castExp = 0);
14297 exp->prev = prev;
14298 exp->next = next;
14299 }
14300 else
14301 {
14302 exp->isConstant = exp->cast.exp->isConstant;
14303 }
14304 break;
14305 }
14306 case 35:
14307 {
14308 struct Type * type = ProcessType(exp->initializer.typeName->qualifiers, exp->initializer.typeName->declarator);
14309
14310 type->refCount++;
14311 exp->expType = type;
14312 break;
14313 }
14314 case 36:
14315 {
14316 struct Type * type = ProcessType(exp->vaArg.typeName->qualifiers, exp->vaArg.typeName->declarator);
14317
14318 ProcessExpressionType(exp->vaArg.exp);
14319 type->refCount++;
14320 exp->expType = type;
14321 break;
14322 }
14323 case 12:
14324 {
14325 struct Expression * e;
14326
14327 exp->isConstant = 0x1;
14328 FreeType(exp->cond.cond->destType);
14329 exp->cond.cond->destType = MkClassType("bool");
14330 exp->cond.cond->destType->truth = 0x1;
14331 ProcessExpressionType(exp->cond.cond);
14332 if(!exp->cond.cond->isConstant)
14333 exp->isConstant = 0x0;
14334 for(e = (*exp->cond.exp).first; e; e = e->next)
14335 {
14336 if(!e->next)
14337 {
14338 FreeType(e->destType);
14339 e->destType = exp->destType;
14340 if(e->destType)
14341 e->destType->refCount++;
14342 }
14343 ProcessExpressionType(e);
14344 if(!e->next)
14345 {
14346 exp->expType = e->expType;
14347 if(e->expType)
14348 e->expType->refCount++;
14349 }
14350 if(!e->isConstant)
14351 exp->isConstant = 0x0;
14352 }
14353 FreeType(exp->cond.elseExp->destType);
14354 exp->cond.elseExp->destType = exp->destType ? exp->destType : exp->expType;
14355 if(exp->cond.elseExp->destType)
14356 exp->cond.elseExp->destType->refCount++;
14357 ProcessExpressionType(exp->cond.elseExp);
14358 if(!exp->cond.elseExp->isConstant)
14359 exp->isConstant = 0x0;
14360 break;
14361 }
14362 case 25:
14363 {
14364 if(exp->compound && exp->compound->compound.statements && (*exp->compound->compound.statements).last)
14365 {
14366 struct Statement * last = (*exp->compound->compound.statements).last;
14367
14368 if(last->type == 3 && last->expressions && (*last->expressions).last)
14369 {
14370 ((struct Expression *)(*last->expressions).last)->destType = exp->destType;
14371 if(exp->destType)
14372 exp->destType->refCount++;
14373 }
14374 ProcessStatement(exp->compound);
14375 exp->expType = ((struct Expression *)(*last->expressions).last)->expType;
14376 if(((struct Expression *)(*last->expressions).last)->expType)
14377 exp->expType->refCount++;
14378 }
14379 break;
14380 }
14381 case 26:
14382 {
14383 struct Specifier * spec = (*exp->_classExp.specifiers).first;
14384
14385 if(spec && spec->type == 1)
14386 {
14387 exp->expType = MkClassType(spec->name);
14388 exp->expType->kind = 19;
14389 exp->byReference = 0x1;
14390 }
14391 else
14392 {
14393 exp->expType = MkClassType("ecere::com::Class");
14394 exp->byReference = 0x1;
14395 }
14396 break;
14397 }
14398 case 27:
14399 {
14400 struct __ecereNameSpace__ecere__com__Class * _class = thisClass ? thisClass : currentClass;
14401
14402 if(_class)
14403 {
14404 struct Identifier * id = exp->classData.id;
14405 char structName[1024];
14406 struct Expression * classExp;
14407
14408 strcpy(structName, "__ecereClassData_");
14409 FullClassNameCat(structName, _class->fullName, 0x0);
14410 exp->type = 9;
14411 exp->member.member = id;
14412 if(curCompound && FindSymbol("this", curContext, curCompound->compound.context, 0x0, 0x0))
14413 classExp = MkExpMember(MkExpIdentifier(MkIdentifier("this")), MkIdentifier("_class"));
14414 else
14415 classExp = MkExpIdentifier(MkIdentifier("class"));
14416 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"))))))));
14417 ProcessExpressionType(exp);
14418 return ;
14419 }
14420 break;
14421 }
14422 case 37:
14423 {
14424 struct Type * type = (((void *)0));
14425 char * typeString = (((void *)0));
14426 char typeStringBuf[1024];
14427
14428 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))
14429 {
14430 struct __ecereNameSpace__ecere__com__Class * templateClass = exp->destType->_class->registered;
14431
14432 typeString = templateClass->templateArgs[2].dataTypeString;
14433 }
14434 else if(exp->list)
14435 {
14436 struct Expression * e;
14437
14438 for(e = (*exp->list).first; e; e = e->next)
14439 {
14440 ProcessExpressionType(e);
14441 if(e->expType)
14442 {
14443 if(!type)
14444 {
14445 type = e->expType;
14446 type->refCount++;
14447 }
14448 else
14449 {
14450 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
14451 {
14452 FreeType(type);
14453 type = e->expType;
14454 e->expType = (((void *)0));
14455 e = (*exp->list).first;
14456 ProcessExpressionType(e);
14457 if(e->expType)
14458 {
14459 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
14460 {
14461 FreeType(e->expType);
14462 e->expType = (((void *)0));
14463 FreeType(type);
14464 type = (((void *)0));
14465 break;
14466 }
14467 }
14468 }
14469 }
14470 if(e->expType)
14471 {
14472 FreeType(e->expType);
14473 e->expType = (((void *)0));
14474 }
14475 }
14476 }
14477 if(type)
14478 {
14479 typeStringBuf[0] = '\0';
14480 PrintType(type, typeStringBuf, 0x0, 0x1);
14481 typeString = typeStringBuf;
14482 FreeType(type);
14483 type = (((void *)0));
14484 }
14485 }
14486 if(typeString)
14487 {
14488 char templateString[1024];
14489 struct __ecereNameSpace__ecere__sys__OldList * initializers = MkList();
14490 struct __ecereNameSpace__ecere__sys__OldList * structInitializers = MkList();
14491 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
14492 struct Expression * expExt;
14493 struct Declarator * decl = SpecDeclFromString(typeString, specs, (((void *)0)));
14494
14495 sprintf(templateString, "Container<%s>", typeString);
14496 if(exp->list)
14497 {
14498 struct Expression * e;
14499
14500 type = ProcessTypeString(typeString, 0x0);
14501 while(e = (*exp->list).first)
14502 {
14503 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*exp->list), e);
14504 e->destType = type;
14505 type->refCount++;
14506 ProcessExpressionType(e);
14507 ListAdd(initializers, MkInitializerAssignment(e));
14508 }
14509 FreeType(type);
14510 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->list), exp->list = 0);
14511 }
14512 DeclareStruct("ecere::com::BuiltInContainer", 0x0);
14513 ListAdd(structInitializers, MkInitializerAssignment(MkExpMember(MkExpClass(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0))), MkIdentifier("_vTbl"))));
14514 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
14515 ListAdd(structInitializers, MkInitializerAssignment(MkExpClass(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0)))));
14516 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
14517 ListAdd(structInitializers, MkInitializerAssignment(MkExpConstant("0")));
14518 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
14519 ListAdd(structInitializers, MkInitializerAssignment(MkExpExtensionInitializer(MkTypeName(specs, MkDeclaratorArray(decl, (((void *)0)))), MkInitializerList(initializers))));
14520 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
14521 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))));
14522 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
14523 ListAdd(structInitializers, MkInitializerAssignment(MkExpClass(CopyList(specs, CopySpecifier), CopyDeclarator(decl))));
14524 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
14525 exp->expType = ProcessTypeString(templateString, 0x0);
14526 exp->type = 5;
14527 exp->list = MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName(templateString)), (((void *)0))), MkExpOp((((void *)0)), '&', expExt = MkExpExtensionInitializer(MkTypeName(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0))), MkInitializerList(structInitializers)))));
14528 ProcessExpressionType(expExt);
14529 }
14530 else
14531 {
14532 exp->expType = ProcessTypeString("Container", 0x0);
14533 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Couldn't determine type of array elements\n", (((void *)0))));
14534 }
14535 break;
14536 }
14537 }
14538 if(exp->expType && exp->expType->kind == 21 && thisClass && (!exp->destType || exp->destType->kind != 21))
14539 {
14540 FreeType(exp->expType);
14541 exp->expType = ReplaceThisClassType(thisClass);
14542 }
14543 if(exp->expType && (exp->expType->kind == 9 || exp->expType->kind == 10 || exp->expType->kind == 15) && !exp->expType->members.first && exp->expType->enumName)
14544 {
14545 struct Symbol * symbol = FindSymbol(exp->expType->enumName, curContext, globalContext, 0x1, 0x0);
14546
14547 if(symbol)
14548 {
14549 if(exp->expType->kind != 15)
14550 {
14551 struct Type * member;
14552 char * enumName = __ecereNameSpace__ecere__sys__CopyString(exp->expType->enumName);
14553
14554 FreeType(exp->expType);
14555 exp->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14556 exp->expType->kind = symbol->type->kind;
14557 exp->expType->refCount++;
14558 exp->expType->enumName = enumName;
14559 exp->expType->members = symbol->type->members;
14560 for(member = symbol->type->members.first; member; member = member->next)
14561 member->refCount++;
14562 }
14563 else
14564 {
14565 struct __ecereNameSpace__ecere__sys__NamedLink * member;
14566
14567 for(member = symbol->type->members.first; member; member = member->next)
14568 {
14569 struct __ecereNameSpace__ecere__sys__NamedLink * value = (value = __ecereNameSpace__ecere__com__eSystem_New0(16), value->name = __ecereNameSpace__ecere__sys__CopyString(member->name), value);
14570
14571 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&exp->expType->members, value);
14572 }
14573 }
14574 }
14575 }
14576 yylloc = exp->loc;
14577 if(exp->destType && (exp->destType->kind == 0 || exp->destType->kind == 18))
14578 ;
14579 else if(exp->destType && !exp->destType->keepCast)
14580 {
14581 if(!CheckExpressionType(exp, exp->destType, 0x0))
14582 {
14583 if(!exp->destType->count || unresolved)
14584 {
14585 if(!exp->expType)
14586 {
14587 yylloc = exp->loc;
14588 if(exp->destType->kind != 14)
14589 {
14590 char type2[1024];
14591
14592 type2[0] = '\0';
14593 if(inCompiler)
14594 {
14595 char expString[10240];
14596
14597 expString[0] = '\0';
14598 PrintType(exp->destType, type2, 0x0, 0x1);
14599 if(inCompiler)
14600 {
14601 PrintExpression(exp, expString);
14602 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14603 }
14604 if(unresolved)
14605 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "unresolved identifier %s; expected %s\n", (((void *)0))), expString, type2);
14606 else if(exp->type != 16)
14607 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't determine type of %s; expected %s\n", (((void *)0))), expString, type2);
14608 }
14609 }
14610 else
14611 {
14612 char expString[10240];
14613
14614 expString[0] = '\0';
14615 if(inCompiler)
14616 {
14617 PrintExpression(exp, expString);
14618 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14619 }
14620 if(unresolved)
14621 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "unresolved identifier %s\n", (((void *)0))), expString);
14622 else if(exp->type != 16)
14623 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't determine type of %s\n", (((void *)0))), expString);
14624 }
14625 }
14626 else
14627 {
14628 char type1[1024];
14629 char type2[1024];
14630
14631 type1[0] = '\0';
14632 type2[0] = '\0';
14633 if(inCompiler)
14634 {
14635 PrintType(exp->expType, type1, 0x0, 0x1);
14636 PrintType(exp->destType, type2, 0x0, 0x1);
14637 }
14638 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)))
14639 ;
14640 else
14641 {
14642 char expString[10240];
14643
14644 expString[0] = '\0';
14645 if(inCompiler)
14646 {
14647 PrintExpression(exp, expString);
14648 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14649 }
14650 if(!sourceFile || (strcmp(sourceFile, "src\\lexer.ec") && strcmp(sourceFile, "src/lexer.ec") && strcmp(sourceFile, "src\\grammar.ec") && strcmp(sourceFile, "src/grammar.ec")))
14651 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible expression %s (%s); expected %s\n", (((void *)0))), expString, type1, type2);
14652 FreeType(exp->expType);
14653 exp->destType->refCount++;
14654 exp->expType = exp->destType;
14655 }
14656 }
14657 }
14658 }
14659 else if(exp->destType && exp->destType->kind == 14 && exp->expType && exp->expType->passAsTemplate)
14660 {
14661 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
14662 char typeString[1024];
14663 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
14664 struct Declarator * decl;
14665
14666 typeString[0] = '\0';
14667 *newExp = *exp;
14668 if(exp->expType)
14669 exp->expType->refCount++;
14670 if(exp->expType)
14671 exp->expType->refCount++;
14672 exp->type = 11;
14673 newExp->destType = exp->expType;
14674 PrintType(exp->expType, typeString, 0x0, 0x0);
14675 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
14676 exp->cast.typeName = MkTypeName(specs, decl);
14677 exp->cast.exp = newExp;
14678 }
14679 }
14680 else if(unresolved)
14681 {
14682 if(exp->identifier->_class && exp->identifier->_class->name)
14683 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "unresolved identifier %s::%s\n", (((void *)0))), exp->identifier->_class->name, exp->identifier->string);
14684 else if(exp->identifier->string && exp->identifier->string[0])
14685 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "unresolved identifier %s\n", (((void *)0))), exp->identifier->string);
14686 }
14687 else if(!exp->expType && exp->type != 16)
14688 {
14689 char expString[10240];
14690
14691 expString[0] = '\0';
14692 if(inCompiler)
14693 {
14694 PrintExpression(exp, expString);
14695 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14696 }
14697 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't determine type of %s\n", (((void *)0))), expString);
14698 }
14699 ApplyAnyObjectLogic(exp);
14700 if(!notByReference && exp->expType && exp->expType->kind == 8 && exp->expType->_class && exp->expType->_class->registered && exp->expType->_class->registered->type == 5)
14701 {
14702 exp->byReference = 0x1;
14703 }
14704 yylloc = oldyylloc;
14705 }
14706
14707 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)
14708 {
14709 if(*curMember)
14710 {
14711 *curMember = (*curMember)->next;
14712 if(subMemberStackPos && *subMemberStackPos > 0 && subMemberStack[*subMemberStackPos - 1]->type == 1)
14713 {
14714 *curMember = subMemberStack[--(*subMemberStackPos)];
14715 *curMember = (*curMember)->next;
14716 }
14717 while((*curMember) && (*curMember)->isProperty)
14718 *curMember = (*curMember)->next;
14719 if(subMemberStackPos)
14720 {
14721 while((*curMember) && !(*curMember)->isProperty && !(*curMember)->name && ((*curMember)->type == 2 || (*curMember)->type == 1))
14722 {
14723 subMemberStack[(*subMemberStackPos)++] = *curMember;
14724 *curMember = (*curMember)->members.first;
14725 while(*curMember && (*curMember)->isProperty)
14726 *curMember = (*curMember)->next;
14727 }
14728 }
14729 }
14730 while(!*curMember)
14731 {
14732 if(!*curMember)
14733 {
14734 if(subMemberStackPos && *subMemberStackPos)
14735 {
14736 *curMember = subMemberStack[--(*subMemberStackPos)];
14737 *curMember = (*curMember)->next;
14738 }
14739 else
14740 {
14741 struct __ecereNameSpace__ecere__com__Class * lastCurClass = *curClass;
14742
14743 if(*curClass == _class)
14744 break;
14745 for(*curClass = _class; (*curClass)->base != lastCurClass && (*curClass)->base->type != 1000; *curClass = (*curClass)->base)
14746 ;
14747 *curMember = (*curClass)->membersAndProperties.first;
14748 }
14749 while((*curMember) && (*curMember)->isProperty)
14750 *curMember = (*curMember)->next;
14751 if(subMemberStackPos)
14752 {
14753 while((*curMember) && !(*curMember)->isProperty && !(*curMember)->name && ((*curMember)->type == 2 || (*curMember)->type == 1))
14754 {
14755 subMemberStack[(*subMemberStackPos)++] = *curMember;
14756 *curMember = (*curMember)->members.first;
14757 while(*curMember && (*curMember)->isProperty)
14758 *curMember = (*curMember)->next;
14759 }
14760 }
14761 }
14762 }
14763 }
14764
14765 static void ProcessInitializer(struct Initializer * init, struct Type * type)
14766 {
14767 switch(init->type)
14768 {
14769 case 0:
14770 if(!init->exp || init->exp->type != 1 || !init->exp->instance || init->exp->instance->_class || !type || type->kind == 8)
14771 {
14772 if(init->exp && !init->exp->destType)
14773 {
14774 FreeType(init->exp->destType);
14775 init->exp->destType = type;
14776 if(type)
14777 type->refCount++;
14778 }
14779 if(init->exp)
14780 {
14781 ProcessExpressionType(init->exp);
14782 init->isConstant = init->exp->isConstant;
14783 }
14784 break;
14785 }
14786 else
14787 {
14788 struct Expression * exp = init->exp;
14789 struct Instantiation * inst = exp->instance;
14790 struct MembersInit * members;
14791
14792 init->type = 1;
14793 init->list = MkList();
14794 if(inst->members)
14795 {
14796 for(members = (*inst->members).first; members; members = members->next)
14797 {
14798 if(members->type == 0)
14799 {
14800 struct MemberInit * member;
14801
14802 for(member = (*members->dataMembers).first; member; member = member->next)
14803 {
14804 ListAdd(init->list, member->initializer);
14805 member->initializer = (((void *)0));
14806 }
14807 }
14808 }
14809 }
14810 FreeExpression(exp);
14811 }
14812 case 1:
14813 {
14814 struct Initializer * i;
14815 struct Type * initializerType = (((void *)0));
14816 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
14817 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
14818 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
14819 int subMemberStackPos = 0;
14820
14821 if(type && type->kind == 12)
14822 initializerType = Dereference(type);
14823 else if(type && (type->kind == 9 || type->kind == 10))
14824 initializerType = type->members.first;
14825 for(i = (*init->list).first; i; i = i->next)
14826 {
14827 if(type && type->kind == 8 && type->_class && type->_class->registered)
14828 {
14829 FindNextDataMember(type->_class->registered, &curClass, &curMember, subMemberStack, &subMemberStackPos);
14830 if(curMember)
14831 {
14832 if(!curMember->dataType)
14833 curMember->dataType = ProcessTypeString(curMember->dataTypeString, 0x0);
14834 initializerType = curMember->dataType;
14835 }
14836 }
14837 ProcessInitializer(i, initializerType);
14838 if(initializerType && type && (type->kind == 9 || type->kind == 10))
14839 initializerType = initializerType->next;
14840 if(!i->isConstant)
14841 init->isConstant = 0x0;
14842 }
14843 if(type && type->kind == 12)
14844 FreeType(initializerType);
14845 if(type && type->kind != 12 && type->kind != 9 && type->kind != 10 && (type->kind != 8 || !type->_class->registered || type->_class->registered->type != 1))
14846 {
14847 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Assigning list initializer to non list\n", (((void *)0))));
14848 }
14849 break;
14850 }
14851 }
14852 }
14853
14854 extern struct Symbol * FindType(struct Context * ctx, char *  name);
14855
14856 static void ProcessClass(struct __ecereNameSpace__ecere__sys__OldList * definitions, struct Symbol * symbol);
14857
14858 static void ProcessSpecifier(struct Specifier * spec, unsigned int declareStruct)
14859 {
14860 switch(spec->type)
14861 {
14862 case 0:
14863 {
14864 if(spec->specifier == THISCLASS)
14865 {
14866 if(thisClass)
14867 {
14868 spec->type = 1;
14869 spec->name = ReplaceThisClass(thisClass);
14870 spec->symbol = FindClass(spec->name);
14871 ProcessSpecifier(spec, declareStruct);
14872 }
14873 }
14874 break;
14875 }
14876 case 1:
14877 {
14878 struct Symbol * symbol = FindType(curContext, spec->name);
14879
14880 if(symbol)
14881 DeclareType(symbol->type, 0x1, 0x1);
14882 else if((symbol = spec->symbol) && symbol->registered && symbol->registered->type == 1 && declareStruct)
14883 DeclareStruct(spec->name, 0x0);
14884 break;
14885 }
14886 case 2:
14887 {
14888 struct Enumerator * e;
14889
14890 if(spec->list)
14891 {
14892 for(e = (*spec->list).first; e; e = e->next)
14893 {
14894 if(e->exp)
14895 ProcessExpressionType(e->exp);
14896 }
14897 }
14898 break;
14899 }
14900 case 3:
14901 case 4:
14902 {
14903 if(spec->definitions)
14904 {
14905 struct ClassDef * def;
14906 struct Symbol * symbol = spec->id ? FindClass(spec->id->string) : (((void *)0));
14907
14908 ProcessClass(spec->definitions, symbol);
14909 }
14910 break;
14911 }
14912 }
14913 }
14914
14915 static void ProcessDeclarator(struct Declarator * decl)
14916 {
14917 switch(decl->type)
14918 {
14919 case 1:
14920 if(decl->identifier->classSym)
14921 {
14922 FreeSpecifier(decl->identifier->_class);
14923 decl->identifier->_class = (((void *)0));
14924 }
14925 break;
14926 case 3:
14927 if(decl->array.exp)
14928 ProcessExpressionType(decl->array.exp);
14929 case 0:
14930 case 2:
14931 case 4:
14932 case 5:
14933 case 6:
14934 case 7:
14935 if(decl->declarator)
14936 ProcessDeclarator(decl->declarator);
14937 if(decl->type == 4)
14938 {
14939 struct Identifier * id = GetDeclId(decl);
14940
14941 if(id && id->_class)
14942 {
14943 struct TypeName * param = (param = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TypeName), param->qualifiers = MkListOne(id->_class), param->declarator = (((void *)0)), param);
14944
14945 if(!decl->function.parameters)
14946 decl->function.parameters = MkList();
14947 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*decl->function.parameters), (((void *)0)), param);
14948 id->_class = (((void *)0));
14949 }
14950 if(decl->function.parameters)
14951 {
14952 struct TypeName * param;
14953
14954 for(param = (*decl->function.parameters).first; param; param = param->next)
14955 {
14956 if(param->qualifiers && (*param->qualifiers).first)
14957 {
14958 struct Specifier * spec = (*param->qualifiers).first;
14959
14960 if(spec && spec->specifier == TYPED_OBJECT)
14961 {
14962 struct Declarator * d = param->declarator;
14963 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);
14964
14965 FreeList(param->qualifiers, FreeSpecifier);
14966 param->qualifiers = MkListOne(MkStructOrUnion(3, MkIdentifier("__ecereNameSpace__ecere__com__Class"), (((void *)0))));
14967 param->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier("class")));
14968 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*decl->function.parameters), param, newParam);
14969 param = newParam;
14970 }
14971 else if(spec && spec->specifier == ANY_OBJECT)
14972 {
14973 struct Declarator * d = param->declarator;
14974
14975 FreeList(param->qualifiers, FreeSpecifier);
14976 param->qualifiers = MkListOne(MkSpecifier(VOID));
14977 param->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d);
14978 }
14979 else if(spec->specifier == THISCLASS)
14980 {
14981 if(thisClass)
14982 {
14983 spec->type = 1;
14984 spec->name = ReplaceThisClass(thisClass);
14985 spec->symbol = FindClass(spec->name);
14986 ProcessSpecifier(spec, 0x0);
14987 }
14988 }
14989 }
14990 if(param->declarator)
14991 ProcessDeclarator(param->declarator);
14992 }
14993 }
14994 }
14995 break;
14996 }
14997 }
14998
14999 extern struct Identifier * CopyIdentifier(struct Identifier * id);
15000
15001 extern void FreeInitDeclarator(struct InitDeclarator * decl);
15002
15003 static void ProcessDeclaration(struct Declaration * decl)
15004 {
15005 yylloc = decl->loc;
15006 switch(decl->type)
15007 {
15008 case 1:
15009 {
15010 unsigned int declareStruct = 0x0;
15011
15012 if(decl->declarators)
15013 {
15014 struct InitDeclarator * d;
15015
15016 for(d = (*decl->declarators).first; d; d = d->next)
15017 {
15018 struct Type * type, * subType;
15019
15020 ProcessDeclarator(d->declarator);
15021 type = ProcessType(decl->specifiers, d->declarator);
15022 if(d->initializer)
15023 {
15024 ProcessInitializer(d->initializer, type);
15025 if((*decl->declarators).count == 1 && d->initializer->type == 0 && d->initializer->exp->type == 1)
15026 {
15027 if(type->kind == 8 && type->_class == d->initializer->exp->expType->_class)
15028 {
15029 struct Instantiation * inst = d->initializer->exp->instance;
15030
15031 inst->exp = MkExpIdentifier(CopyIdentifier(GetDeclId(d->declarator)));
15032 d->initializer->exp->instance = (((void *)0));
15033 if(decl->specifiers)
15034 FreeList(decl->specifiers, FreeSpecifier);
15035 FreeList(decl->declarators, FreeInitDeclarator);
15036 d = (((void *)0));
15037 decl->type = 2;
15038 decl->inst = inst;
15039 }
15040 }
15041 }
15042 for(subType = type; subType; )
15043 {
15044 if(subType->kind == 8)
15045 {
15046 declareStruct = 0x1;
15047 break;
15048 }
15049 else if(subType->kind == 13)
15050 break;
15051 else if(subType->kind == 12)
15052 subType = subType->arrayType;
15053 else
15054 break;
15055 }
15056 FreeType(type);
15057 if(!d)
15058 break;
15059 }
15060 }
15061 if(decl->specifiers)
15062 {
15063 struct Specifier * s;
15064
15065 for(s = (*decl->specifiers).first; s; s = s->next)
15066 {
15067 ProcessSpecifier(s, declareStruct);
15068 }
15069 }
15070 break;
15071 }
15072 case 2:
15073 {
15074 ProcessInstantiationType(decl->inst);
15075 break;
15076 }
15077 case 0:
15078 {
15079 struct Specifier * spec;
15080 struct Declarator * d;
15081 unsigned int declareStruct = 0x0;
15082
15083 if(decl->declarators)
15084 {
15085 for(d = (*decl->declarators).first; d; d = d->next)
15086 {
15087 struct Type * type = ProcessType(decl->specifiers, d->declarator);
15088 struct Type * subType;
15089
15090 ProcessDeclarator(d);
15091 for(subType = type; subType; )
15092 {
15093 if(subType->kind == 8)
15094 {
15095 declareStruct = 0x1;
15096 break;
15097 }
15098 else if(subType->kind == 13)
15099 break;
15100 else if(subType->kind == 12)
15101 subType = subType->arrayType;
15102 else
15103 break;
15104 }
15105 FreeType(type);
15106 }
15107 }
15108 if(decl->specifiers)
15109 {
15110 for(spec = (*decl->specifiers).first; spec; spec = spec->next)
15111 ProcessSpecifier(spec, declareStruct);
15112 }
15113 break;
15114 }
15115 }
15116 }
15117
15118 static struct FunctionDefinition * curFunction;
15119
15120 static void CreateFireWatcher(struct __ecereNameSpace__ecere__com__Property * prop, struct Expression * object, struct Statement * stmt)
15121 {
15122 char propName[1024], propNameM[1024];
15123 char getName[1024], setName[1024];
15124 struct __ecereNameSpace__ecere__sys__OldList * args;
15125
15126 DeclareProperty(prop, setName, getName);
15127 strcpy(propName, "__ecereProp_");
15128 FullClassNameCat(propName, prop->_class->fullName, 0x0);
15129 strcat(propName, "_");
15130 FullClassNameCat(propName, prop->name, 0x1);
15131 MangleClassName(propName);
15132 strcpy(propNameM, "__ecerePropM_");
15133 FullClassNameCat(propNameM, prop->_class->fullName, 0x0);
15134 strcat(propNameM, "_");
15135 FullClassNameCat(propNameM, prop->name, 0x1);
15136 MangleClassName(propNameM);
15137 if(prop->isWatchable)
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_FireWatchers")), 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_FireWatchers")), args));
15147 }
15148 {
15149 args = MkList();
15150 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
15151 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
15152 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireSelfWatchers")), args));
15153 args = MkList();
15154 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
15155 ListAdd(args, MkExpIdentifier(MkIdentifier(propNameM)));
15156 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireSelfWatchers")), args));
15157 }
15158 if(curFunction->propSet && !strcmp(curFunction->propSet->string, prop->name) && (!object || (object->type == 0 && !strcmp(object->identifier->string, "this"))))
15159 curFunction->propSet->fireWatchersDone = 0x1;
15160 }
15161
15162 extern struct Declaration * MkDeclarationInst(struct Instantiation * inst);
15163
15164 extern struct Instantiation * MkInstantiationNamed(struct __ecereNameSpace__ecere__sys__OldList * specs, struct Expression * exp, struct __ecereNameSpace__ecere__sys__OldList * members);
15165
15166 extern struct Statement * MkIfStmt(struct __ecereNameSpace__ecere__sys__OldList * exp, struct Statement * statement, struct Statement * elseStmt);
15167
15168 extern struct Statement * MkForStmt(struct Statement * init, struct Statement * check, struct __ecereNameSpace__ecere__sys__OldList * inc, struct Statement * statement);
15169
15170 extern struct Statement * MkWhileStmt(struct __ecereNameSpace__ecere__sys__OldList * exp, struct Statement * statement);
15171
15172 extern struct ClassFunction * MkClassFunction(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct Specifier * _class, struct Declarator * decl, struct __ecereNameSpace__ecere__sys__OldList * declList);
15173
15174 extern void ProcessClassFunctionBody(struct ClassFunction * func, struct Statement * body);
15175
15176 extern void FreePropertyWatch(struct PropertyWatch * watcher);
15177
15178 static void ProcessStatement(struct Statement * stmt)
15179 {
15180 yylloc = stmt->loc;
15181 switch(stmt->type)
15182 {
15183 case 0:
15184 ProcessStatement(stmt->labeled.stmt);
15185 break;
15186 case 1:
15187 if(stmt->caseStmt.exp)
15188 {
15189 FreeType(stmt->caseStmt.exp->destType);
15190 stmt->caseStmt.exp->destType = curSwitchType;
15191 if(curSwitchType)
15192 curSwitchType->refCount++;
15193 ProcessExpressionType(stmt->caseStmt.exp);
15194 ComputeExpression(stmt->caseStmt.exp);
15195 }
15196 if(stmt->caseStmt.stmt)
15197 ProcessStatement(stmt->caseStmt.stmt);
15198 break;
15199 case 2:
15200 {
15201 if(stmt->compound.context)
15202 {
15203 struct Declaration * decl;
15204 struct Statement * s;
15205 struct Statement * prevCompound = curCompound;
15206 struct Context * prevContext = curContext;
15207
15208 if(!stmt->compound.isSwitch)
15209 {
15210 curCompound = stmt;
15211 curContext = stmt->compound.context;
15212 }
15213 if(stmt->compound.declarations)
15214 {
15215 for(decl = (*stmt->compound.declarations).first; decl; decl = decl->next)
15216 ProcessDeclaration(decl);
15217 }
15218 if(stmt->compound.statements)
15219 {
15220 for(s = (*stmt->compound.statements).first; s; s = s->next)
15221 ProcessStatement(s);
15222 }
15223 curContext = prevContext;
15224 curCompound = prevCompound;
15225 }
15226 break;
15227 }
15228 case 3:
15229 {
15230 struct Expression * exp;
15231
15232 if(stmt->expressions)
15233 {
15234 for(exp = (*stmt->expressions).first; exp; exp = exp->next)
15235 ProcessExpressionType(exp);
15236 }
15237 break;
15238 }
15239 case 4:
15240 {
15241 struct Expression * exp;
15242
15243 FreeType(((struct Expression *)(*stmt->ifStmt.exp).last)->destType);
15244 ((struct Expression *)(*stmt->ifStmt.exp).last)->destType = MkClassType("bool");
15245 ((struct Expression *)(*stmt->ifStmt.exp).last)->destType->truth = 0x1;
15246 for(exp = (*stmt->ifStmt.exp).first; exp; exp = exp->next)
15247 {
15248 ProcessExpressionType(exp);
15249 }
15250 if(stmt->ifStmt.stmt)
15251 ProcessStatement(stmt->ifStmt.stmt);
15252 if(stmt->ifStmt.elseStmt)
15253 ProcessStatement(stmt->ifStmt.elseStmt);
15254 break;
15255 }
15256 case 5:
15257 {
15258 struct Type * oldSwitchType = curSwitchType;
15259
15260 if(stmt->switchStmt.exp)
15261 {
15262 struct Expression * exp;
15263
15264 for(exp = (*stmt->switchStmt.exp).first; exp; exp = exp->next)
15265 {
15266 if(!exp->next)
15267 {
15268 ProcessExpressionType(exp);
15269 }
15270 if(!exp->next)
15271 curSwitchType = exp->expType;
15272 }
15273 }
15274 ProcessStatement(stmt->switchStmt.stmt);
15275 curSwitchType = oldSwitchType;
15276 break;
15277 }
15278 case 6:
15279 {
15280 if(stmt->whileStmt.exp)
15281 {
15282 struct Expression * exp;
15283
15284 FreeType(((struct Expression *)(*stmt->whileStmt.exp).last)->destType);
15285 ((struct Expression *)(*stmt->whileStmt.exp).last)->destType = MkClassType("bool");
15286 ((struct Expression *)(*stmt->whileStmt.exp).last)->destType->truth = 0x1;
15287 for(exp = (*stmt->whileStmt.exp).first; exp; exp = exp->next)
15288 {
15289 ProcessExpressionType(exp);
15290 }
15291 }
15292 if(stmt->whileStmt.stmt)
15293 ProcessStatement(stmt->whileStmt.stmt);
15294 break;
15295 }
15296 case 7:
15297 {
15298 if(stmt->doWhile.exp)
15299 {
15300 struct Expression * exp;
15301
15302 if((*stmt->doWhile.exp).last)
15303 {
15304 FreeType(((struct Expression *)(*stmt->doWhile.exp).last)->destType);
15305 ((struct Expression *)(*stmt->doWhile.exp).last)->destType = MkClassType("bool");
15306 ((struct Expression *)(*stmt->doWhile.exp).last)->destType->truth = 0x1;
15307 }
15308 for(exp = (*stmt->doWhile.exp).first; exp; exp = exp->next)
15309 {
15310 ProcessExpressionType(exp);
15311 }
15312 }
15313 if(stmt->doWhile.stmt)
15314 ProcessStatement(stmt->doWhile.stmt);
15315 break;
15316 }
15317 case 8:
15318 {
15319 struct Expression * exp;
15320
15321 if(stmt->forStmt.init)
15322 ProcessStatement(stmt->forStmt.init);
15323 if(stmt->forStmt.check && stmt->forStmt.check->expressions)
15324 {
15325 FreeType(((struct Expression *)(*stmt->forStmt.check->expressions).last)->destType);
15326 ((struct Expression *)(*stmt->forStmt.check->expressions).last)->destType = MkClassType("bool");
15327 ((struct Expression *)(*stmt->forStmt.check->expressions).last)->destType->truth = 0x1;
15328 }
15329 if(stmt->forStmt.check)
15330 ProcessStatement(stmt->forStmt.check);
15331 if(stmt->forStmt.increment)
15332 {
15333 for(exp = (*stmt->forStmt.increment).first; exp; exp = exp->next)
15334 ProcessExpressionType(exp);
15335 }
15336 if(stmt->forStmt.stmt)
15337 ProcessStatement(stmt->forStmt.stmt);
15338 break;
15339 }
15340 case 18:
15341 {
15342 struct Identifier * id = stmt->forEachStmt.id;
15343 struct __ecereNameSpace__ecere__sys__OldList * exp = stmt->forEachStmt.exp;
15344 struct __ecereNameSpace__ecere__sys__OldList * filter = stmt->forEachStmt.filter;
15345 struct Statement * block = stmt->forEachStmt.stmt;
15346 char iteratorType[1024];
15347 struct Type * source;
15348 struct Expression * e;
15349 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));
15350 struct Expression * arrayExp;
15351 char * typeString = (((void *)0));
15352 int builtinCount = 0;
15353
15354 for(e = exp ? (*exp).first : (((void *)0)); e; e = e->next)
15355 {
15356 if(!e->next)
15357 {
15358 FreeType(e->destType);
15359 e->destType = ProcessTypeString("Container", 0x0);
15360 }
15361 if(!isBuiltin || e->next)
15362 ProcessExpressionType(e);
15363 }
15364 source = (exp && (*exp).last) ? ((struct Expression *)(*exp).last)->expType : (((void *)0));
15365 if(isBuiltin || (source && source->kind == 8 && source->_class && source->_class->registered && source->_class->registered != containerClass && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, containerClass)))
15366 {
15367 struct __ecereNameSpace__ecere__com__Class * _class = source ? source->_class->registered : (((void *)0));
15368 struct Symbol * symbol;
15369 struct Expression * expIt = (((void *)0));
15370 unsigned int isMap = 0x0, isArray = 0x0, isLinkList = 0x0, isList = 0x0, isCustomAVLTree = 0x0, isAVLTree = 0x0;
15371 struct __ecereNameSpace__ecere__com__Class * arrayClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "Array");
15372 struct __ecereNameSpace__ecere__com__Class * linkListClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "LinkList");
15373 struct __ecereNameSpace__ecere__com__Class * customAVLTreeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "CustomAVLTree");
15374
15375 stmt->type = 2;
15376 stmt->compound.context = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Context);
15377 stmt->compound.context->parent = curContext;
15378 curContext = stmt->compound.context;
15379 if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, customAVLTreeClass))
15380 {
15381 struct __ecereNameSpace__ecere__com__Class * mapClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "Map");
15382 struct __ecereNameSpace__ecere__com__Class * avlTreeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "AVLTree");
15383
15384 isCustomAVLTree = 0x1;
15385 if(__ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, avlTreeClass))
15386 isAVLTree = 0x1;
15387 else if(__ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, mapClass))
15388 isMap = 0x1;
15389 }
15390 else if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, arrayClass))
15391 isArray = 0x1;
15392 else if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, linkListClass))
15393 {
15394 struct __ecereNameSpace__ecere__com__Class * listClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "List");
15395
15396 isLinkList = 0x1;
15397 isList = __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, listClass);
15398 }
15399 if(isArray)
15400 {
15401 struct Declarator * decl;
15402 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15403
15404 decl = SpecDeclFromString(_class->templateArgs[2].dataTypeString, specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(id)));
15405 stmt->compound.declarations = MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(decl, (((void *)0))))));
15406 ListAdd(stmt->compound.declarations, MkDeclaration(MkListOne(MkSpecifierName(source->_class->registered->fullName)), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internalArray")), MkInitializerAssignment(MkExpBrackets(exp))))));
15407 }
15408 else if(isBuiltin)
15409 {
15410 struct Type * type = (((void *)0));
15411 char typeStringBuf[1024];
15412
15413 arrayExp = (((struct Expression *)(*exp).last)->type == 37) ? (struct Expression *)(*exp).last : ((struct Expression *)(*exp).last)->cast.exp;
15414 if(((struct Expression *)(*exp).last)->type == 11)
15415 {
15416 struct TypeName * typeName = ((struct Expression *)(*exp).last)->cast.typeName;
15417
15418 if(typeName)
15419 arrayExp->destType = ProcessType(typeName->qualifiers, typeName->declarator);
15420 }
15421 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)
15422 {
15423 struct __ecereNameSpace__ecere__com__Class * templateClass = arrayExp->destType->_class->registered;
15424
15425 typeString = templateClass->templateArgs[2].dataTypeString;
15426 }
15427 else if(arrayExp->list)
15428 {
15429 struct Expression * e;
15430
15431 for(e = (*arrayExp->list).first; e; e = e->next)
15432 {
15433 ProcessExpressionType(e);
15434 if(e->expType)
15435 {
15436 if(!type)
15437 {
15438 type = e->expType;
15439 type->refCount++;
15440 }
15441 else
15442 {
15443 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
15444 {
15445 FreeType(type);
15446 type = e->expType;
15447 e->expType = (((void *)0));
15448 e = (*arrayExp->list).first;
15449 ProcessExpressionType(e);
15450 if(e->expType)
15451 {
15452 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
15453 {
15454 FreeType(e->expType);
15455 e->expType = (((void *)0));
15456 FreeType(type);
15457 type = (((void *)0));
15458 break;
15459 }
15460 }
15461 }
15462 }
15463 if(e->expType)
15464 {
15465 FreeType(e->expType);
15466 e->expType = (((void *)0));
15467 }
15468 }
15469 }
15470 if(type)
15471 {
15472 typeStringBuf[0] = '\0';
15473 PrintType(type, typeStringBuf, 0x0, 0x1);
15474 typeString = typeStringBuf;
15475 FreeType(type);
15476 }
15477 }
15478 if(typeString)
15479 {
15480 struct __ecereNameSpace__ecere__sys__OldList * initializers = MkList();
15481 struct Declarator * decl;
15482 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15483
15484 if(arrayExp->list)
15485 {
15486 struct Expression * e;
15487
15488 builtinCount = (*arrayExp->list).count;
15489 type = ProcessTypeString(typeString, 0x0);
15490 while(e = (*arrayExp->list).first)
15491 {
15492 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*arrayExp->list), e);
15493 e->destType = type;
15494 type->refCount++;
15495 ProcessExpressionType(e);
15496 ListAdd(initializers, MkInitializerAssignment(e));
15497 }
15498 FreeType(type);
15499 (__ecereNameSpace__ecere__com__eSystem_Delete(arrayExp->list), arrayExp->list = 0);
15500 }
15501 decl = SpecDeclFromString(typeString, specs, MkDeclaratorIdentifier(id));
15502 stmt->compound.declarations = MkListOne(MkDeclaration(CopyList(specs, CopySpecifier), MkListOne(MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl), (((void *)0))))));
15503 ListAdd(stmt->compound.declarations, MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorArray(PlugDeclarator(decl, MkDeclaratorIdentifier(MkIdentifier("__internalArray"))), (((void *)0))), MkInitializerList(initializers)))));
15504 FreeList(exp, FreeExpression);
15505 }
15506 else
15507 {
15508 arrayExp->expType = ProcessTypeString("Container", 0x0);
15509 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Couldn't determine type of array elements\n", (((void *)0))));
15510 }
15511 }
15512 else if(isLinkList && !isList)
15513 {
15514 struct Declarator * decl;
15515 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15516
15517 decl = SpecDeclFromString(_class->templateArgs[3].dataTypeString, specs, MkDeclaratorIdentifier(id));
15518 stmt->compound.declarations = MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(decl, (((void *)0))))));
15519 ListAdd(stmt->compound.declarations, MkDeclaration(MkListOne(MkSpecifierName(source->_class->registered->fullName)), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internalLinkList")), MkInitializerAssignment(MkExpBrackets(exp))))));
15520 }
15521 else if(_class->templateArgs)
15522 {
15523 if(isMap)
15524 sprintf(iteratorType, "MapIterator<%s, %s >", _class->templateArgs[5].dataTypeString, _class->templateArgs[6].dataTypeString);
15525 else
15526 sprintf(iteratorType, "Iterator<%s, %s >", _class->templateArgs[2].dataTypeString, _class->templateArgs[1].dataTypeString);
15527 stmt->compound.declarations = MkListOne(MkDeclarationInst(MkInstantiationNamed(MkListOne(MkSpecifierName(iteratorType)), MkExpIdentifier(id), MkListOne(MkMembersInitList(MkListOne(MkMemberInit(isMap ? MkListOne(MkIdentifier("map")) : (((void *)0)), MkInitializerAssignment(MkExpBrackets(exp)))))))));
15528 }
15529 symbol = FindSymbol(id->string, curContext, curContext, 0x0, 0x0);
15530 if(block && block->type == 2 && block->compound.context)
15531 {
15532 block->compound.context->parent = stmt->compound.context;
15533 }
15534 if(filter)
15535 {
15536 block = MkIfStmt(filter, block, (((void *)0)));
15537 }
15538 if(isArray)
15539 {
15540 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));
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(isBuiltin)
15546 {
15547 char count[128];
15548
15549 sprintf(count, "%d", builtinCount);
15550 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));
15551 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.init);
15552 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.check);
15553 ProcessExpressionType((*((struct Statement *)(*stmt->compound.statements).first)->forStmt.increment).first);
15554 }
15555 else if(isLinkList && !isList)
15556 {
15557 struct __ecereNameSpace__ecere__com__Class * typeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, _class->templateArgs[3].dataTypeString);
15558 struct __ecereNameSpace__ecere__com__Class * listItemClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, "ListItem");
15559
15560 if(typeClass && __ecereNameSpace__ecere__com__eClass_IsDerived(typeClass, listItemClass) && _class->templateArgs[5].dataTypeString && !strcmp(_class->templateArgs[5].dataTypeString, "LT::link"))
15561 {
15562 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));
15563 }
15564 else
15565 {
15566 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15567 struct Declarator * decl = SpecDeclFromString(_class->templateArgs[3].dataTypeString, specs, (((void *)0)));
15568
15569 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));
15570 }
15571 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.init);
15572 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.check);
15573 ProcessExpressionType((*((struct Statement *)(*stmt->compound.statements).first)->forStmt.increment).first);
15574 }
15575 else
15576 {
15577 stmt->compound.statements = MkListOne(MkWhileStmt(MkListOne(MkExpCall(MkExpMember(expIt = MkExpIdentifier(CopyIdentifier(id)), MkIdentifier("Next")), (((void *)0)))), block));
15578 }
15579 ProcessExpressionType(expIt);
15580 if((*stmt->compound.declarations).first)
15581 ProcessDeclaration((*stmt->compound.declarations).first);
15582 if(symbol)
15583 symbol->isIterator = isMap ? 2 : ((isArray || isBuiltin) ? 3 : (isLinkList ? (isList ? 5 : 4) : (isCustomAVLTree ? 6 : 1)));
15584 ProcessStatement(stmt);
15585 curContext = stmt->compound.context->parent;
15586 break;
15587 }
15588 else
15589 {
15590 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Expression is not a container\n", (((void *)0))));
15591 }
15592 break;
15593 }
15594 case 9:
15595 break;
15596 case 10:
15597 break;
15598 case 11:
15599 break;
15600 case 12:
15601 {
15602 struct Expression * exp;
15603
15604 if(stmt->expressions)
15605 {
15606 for(exp = (*stmt->expressions).first; exp; exp = exp->next)
15607 {
15608 if(!exp->next)
15609 {
15610 if(curFunction && !curFunction->type)
15611 curFunction->type = ProcessType(curFunction->specifiers, curFunction->declarator);
15612 FreeType(exp->destType);
15613 exp->destType = (curFunction && curFunction->type && curFunction->type->kind == 11) ? curFunction->type->returnType : (((void *)0));
15614 if(exp->destType)
15615 exp->destType->refCount++;
15616 }
15617 ProcessExpressionType(exp);
15618 }
15619 }
15620 break;
15621 }
15622 case 14:
15623 {
15624 ProcessDeclaration(stmt->decl);
15625 break;
15626 }
15627 case 13:
15628 {
15629 struct AsmField * field;
15630
15631 if(stmt->asmStmt.inputFields)
15632 {
15633 for(field = (*stmt->asmStmt.inputFields).first; field; field = field->next)
15634 if(field->expression)
15635 ProcessExpressionType(field->expression);
15636 }
15637 if(stmt->asmStmt.outputFields)
15638 {
15639 for(field = (*stmt->asmStmt.outputFields).first; field; field = field->next)
15640 if(field->expression)
15641 ProcessExpressionType(field->expression);
15642 }
15643 if(stmt->asmStmt.clobberedFields)
15644 {
15645 for(field = (*stmt->asmStmt.clobberedFields).first; field; field = field->next)
15646 {
15647 if(field->expression)
15648 ProcessExpressionType(field->expression);
15649 }
15650 }
15651 break;
15652 }
15653 case 17:
15654 {
15655 struct PropertyWatch * propWatch;
15656 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->_watch.watches;
15657 struct Expression * object = stmt->_watch.object;
15658 struct Expression * watcher = stmt->_watch.watcher;
15659
15660 if(watcher)
15661 ProcessExpressionType(watcher);
15662 if(object)
15663 ProcessExpressionType(object);
15664 if(inCompiler)
15665 {
15666 if(watcher || thisClass)
15667 {
15668 struct External * external = curExternal;
15669 struct Context * context = curContext;
15670
15671 stmt->type = 3;
15672 stmt->expressions = MkList();
15673 curExternal = external->prev;
15674 for(propWatch = (*watches).first; propWatch; propWatch = propWatch->next)
15675 {
15676 struct ClassFunction * func;
15677 char watcherName[1024];
15678 struct __ecereNameSpace__ecere__com__Class * watcherClass = watcher ? ((watcher->expType && watcher->expType->kind == 8 && watcher->expType->_class) ? watcher->expType->_class->registered : (((void *)0))) : thisClass;
15679 struct External * createdExternal;
15680 struct External * externalDecl = MkExternalDeclaration((((void *)0)));
15681
15682 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, externalDecl);
15683 sprintf(watcherName, "__ecerePropertyWatcher_%d", propWatcherID++);
15684 if(propWatch->deleteWatch)
15685 strcat(watcherName, "_delete");
15686 else
15687 {
15688 struct Identifier * propID;
15689
15690 for(propID = (*propWatch->properties).first; propID; propID = propID->next)
15691 {
15692 strcat(watcherName, "_");
15693 strcat(watcherName, propID->string);
15694 }
15695 }
15696 if(object && object->expType && object->expType->kind == 8 && object->expType->_class && object->expType->_class->registered)
15697 {
15698 func = MkClassFunction(MkListOne(MkSpecifier(VOID)), (((void *)0)), MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(watcherName)), MkListOne(MkTypeName(MkListOne(MkSpecifierName(object->expType->_class->string)), MkDeclaratorIdentifier(MkIdentifier("value"))))), (((void *)0)));
15699 ProcessClassFunctionBody(func, propWatch->compound);
15700 propWatch->compound = (((void *)0));
15701 createdExternal = ProcessClassFunction(watcherClass, func, ast, curExternal, 0x1);
15702 createdExternal->symbol->idCode = external->symbol->idCode;
15703 curExternal = createdExternal;
15704 ProcessFunction(createdExternal->function);
15705 {
15706 struct Declaration * decl = MkDeclaration(CopyList(createdExternal->function->specifiers, CopySpecifier), MkListOne(MkInitDeclarator(CopyDeclarator(createdExternal->function->declarator), (((void *)0)))));
15707
15708 externalDecl->declaration = decl;
15709 if(decl->symbol && !decl->symbol->pointerExternal)
15710 decl->symbol->pointerExternal = externalDecl;
15711 }
15712 if(propWatch->deleteWatch)
15713 {
15714 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
15715
15716 ListAdd(args, CopyExpression(object));
15717 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
15718 ListAdd(args, MkExpIdentifier(MkIdentifier(watcherName)));
15719 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_WatchDestruction")), args));
15720 }
15721 else
15722 {
15723 struct __ecereNameSpace__ecere__com__Class * _class = object->expType->_class->registered;
15724 struct Identifier * propID;
15725
15726 for(propID = (*propWatch->properties).first; propID; propID = propID->next)
15727 {
15728 char propName[1024];
15729 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
15730
15731 if(prop)
15732 {
15733 char getName[1024], setName[1024];
15734 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
15735
15736 DeclareProperty(prop, setName, getName);
15737 strcpy(propName, "__ecereProp_");
15738 FullClassNameCat(propName, prop->_class->fullName, 0x0);
15739 strcat(propName, "_");
15740 FullClassNameCat(propName, prop->name, 0x1);
15741 ListAdd(args, CopyExpression(object));
15742 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
15743 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
15744 ListAdd(args, MkExpIdentifier(MkIdentifier(watcherName)));
15745 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_Watch")), args));
15746 }
15747 else
15748 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Property %s not found in class %s\n", (((void *)0))), prop->name, _class->fullName);
15749 }
15750 }
15751 }
15752 else
15753 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Invalid watched object\n", (((void *)0))));
15754 }
15755 curExternal = external;
15756 curContext = context;
15757 if(watcher)
15758 FreeExpression(watcher);
15759 if(object)
15760 FreeExpression(object);
15761 FreeList(watches, FreePropertyWatch);
15762 }
15763 else
15764 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "No observer specified and not inside a _class\n", (((void *)0))));
15765 }
15766 else
15767 {
15768 for(propWatch = (*watches).first; propWatch; propWatch = propWatch->next)
15769 {
15770 ProcessStatement(propWatch->compound);
15771 }
15772 }
15773 break;
15774 }
15775 case 15:
15776 {
15777 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->_watch.watches;
15778 struct Expression * object = stmt->_watch.object;
15779 struct __ecereNameSpace__ecere__com__Class * _class;
15780
15781 if(object)
15782 ProcessExpressionType(object);
15783 if(inCompiler)
15784 {
15785 _class = object ? ((object->expType && object->expType->kind == 8 && object->expType->_class) ? object->expType->_class->registered : (((void *)0))) : thisClass;
15786 if(_class)
15787 {
15788 struct Identifier * propID;
15789
15790 stmt->type = 3;
15791 stmt->expressions = MkList();
15792 if(!watches && curFunction->propSet && (!object || (object->type == 0 && !strcmp(object->identifier->string, "this"))))
15793 {
15794 watches = MkListOne(MkIdentifier(curFunction->propSet->string));
15795 }
15796 else if(!watches)
15797 {
15798 }
15799 if(watches)
15800 {
15801 for(propID = (*watches).first; propID; propID = propID->next)
15802 {
15803 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
15804
15805 if(prop)
15806 {
15807 CreateFireWatcher(prop, object, stmt);
15808 }
15809 else
15810 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Property %s not found in class %s\n", (((void *)0))), propID->string, _class->fullName);
15811 }
15812 }
15813 else
15814 {
15815 struct __ecereNameSpace__ecere__com__Property * prop;
15816 struct __ecereNameSpace__ecere__com__Class * base;
15817
15818 for(base = _class; base; base = base->base)
15819 {
15820 for(prop = base->membersAndProperties.first; prop; prop = prop->next)
15821 {
15822 if(prop->isProperty && prop->isWatchable)
15823 {
15824 CreateFireWatcher(prop, object, stmt);
15825 }
15826 }
15827 }
15828 }
15829 if(object)
15830 FreeExpression(object);
15831 FreeList(watches, FreeIdentifier);
15832 }
15833 else
15834 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Invalid object specified and not inside a class\n", (((void *)0))));
15835 }
15836 break;
15837 }
15838 case 16:
15839 {
15840 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->_watch.watches;
15841 struct Expression * object = stmt->_watch.object;
15842 struct Expression * watcher = stmt->_watch.watcher;
15843 struct __ecereNameSpace__ecere__com__Class * _class;
15844
15845 if(object)
15846 ProcessExpressionType(object);
15847 if(watcher)
15848 ProcessExpressionType(watcher);
15849 if(inCompiler)
15850 {
15851 _class = (object && object->expType && object->expType->kind == 8 && object->expType->_class) ? object->expType->_class->registered : (((void *)0));
15852 if(watcher || thisClass)
15853 {
15854 if(_class)
15855 {
15856 struct Identifier * propID;
15857
15858 stmt->type = 3;
15859 stmt->expressions = MkList();
15860 if(!watches)
15861 {
15862 struct __ecereNameSpace__ecere__sys__OldList * args;
15863
15864 args = MkList();
15865 ListAdd(args, CopyExpression(object));
15866 ListAdd(args, MkExpConstant("0"));
15867 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
15868 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_StopWatching")), args));
15869 }
15870 else
15871 {
15872 for(propID = (*watches).first; propID; propID = propID->next)
15873 {
15874 char propName[1024];
15875 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
15876
15877 if(prop)
15878 {
15879 char getName[1024], setName[1024];
15880 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
15881
15882 DeclareProperty(prop, setName, getName);
15883 strcpy(propName, "__ecereProp_");
15884 FullClassNameCat(propName, prop->_class->fullName, 0x0);
15885 strcat(propName, "_");
15886 FullClassNameCat(propName, prop->name, 0x1);
15887 MangleClassName(propName);
15888 ListAdd(args, CopyExpression(object));
15889 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
15890 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
15891 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_StopWatching")), args));
15892 }
15893 else
15894 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Property %s not found in class %s\n", (((void *)0))), prop->name, _class->fullName);
15895 }
15896 }
15897 if(object)
15898 FreeExpression(object);
15899 if(watcher)
15900 FreeExpression(watcher);
15901 FreeList(watches, FreeIdentifier);
15902 }
15903 else
15904 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Invalid object specified and not inside a class\n", (((void *)0))));
15905 }
15906 else
15907 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "No observer specified and not inside a class\n", (((void *)0))));
15908 }
15909 break;
15910 }
15911 }
15912 }
15913
15914 extern struct Expression * QBrackets(struct Expression * exp);
15915
15916 extern struct TypeName * QMkType(char *  spec, struct Declarator * decl);
15917
15918 extern struct Declarator * QMkPtrDecl(char *  id);
15919
15920 extern struct Expression * MkExpPointer(struct Expression * expression, struct Identifier * member);
15921
15922 extern struct Expression * QMkExpCond(struct Expression * cond, struct Expression * exp, struct Expression * elseExp);
15923
15924 extern struct Statement * MkFireWatchersStmt(struct Expression * object, struct __ecereNameSpace__ecere__sys__OldList * watches);
15925
15926 static void ProcessFunction(struct FunctionDefinition * function)
15927 {
15928 void * __ecereTemp2;
15929 void * __ecereTemp1;
15930 struct Identifier * id = GetDeclId(function->declarator);
15931 struct Symbol * symbol = function->declarator ? function->declarator->symbol : (((void *)0));
15932 struct Type * type = symbol ? symbol->type : (((void *)0));
15933 struct __ecereNameSpace__ecere__com__Class * oldThisClass = thisClass;
15934 struct Context * oldTopContext = topContext;
15935
15936 yylloc = function->loc;
15937 if(type && type->thisClass)
15938 {
15939 struct Symbol * classSym = type->thisClass;
15940 struct __ecereNameSpace__ecere__com__Class * _class = type->thisClass->registered;
15941 char className[1024];
15942 char structName[1024];
15943 struct Declarator * funcDecl;
15944 struct Symbol * thisSymbol;
15945 unsigned int typedObject = 0x0;
15946
15947 if(_class && !_class->base)
15948 {
15949 _class = currentClass;
15950 if(_class && !_class->symbol)
15951 _class->symbol = FindClass(_class->fullName);
15952 classSym = _class ? _class->symbol : (((void *)0));
15953 typedObject = 0x1;
15954 }
15955 thisClass = _class;
15956 if(inCompiler && _class)
15957 {
15958 if(type->kind == 11)
15959 {
15960 if(symbol->type->params.count == 1 && ((struct Type *)symbol->type->params.first)->kind == 0)
15961 {
15962 struct Type * param = symbol->type->params.first;
15963
15964 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(&symbol->type->params, param);
15965 FreeType(param);
15966 }
15967 if(type->classObjectType != 1)
15968 {
15969 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(&symbol->type->params, (((void *)0)), MkClassType(_class->fullName));
15970 symbol->type->staticMethod = 0x1;
15971 symbol->type->thisClass = (((void *)0));
15972 symbol->type->extraParam = 0x0;
15973 }
15974 }
15975 strcpy(className, "__ecereClass_");
15976 FullClassNameCat(className, _class->fullName, 0x1);
15977 MangleClassName(className);
15978 structName[0] = (char)0;
15979 FullClassNameCat(structName, _class->fullName, 0x0);
15980 funcDecl = GetFuncDecl(function->declarator);
15981 if(funcDecl)
15982 {
15983 if(funcDecl->function.parameters && (*funcDecl->function.parameters).count == 1)
15984 {
15985 struct TypeName * param = (*funcDecl->function.parameters).first;
15986
15987 if(param->qualifiers && (*param->qualifiers).count == 1 && ((struct Specifier *)(*param->qualifiers).first)->specifier == VOID && !param->declarator)
15988 {
15989 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->function.parameters), param);
15990 FreeTypeName(param);
15991 }
15992 }
15993 if(!function->propertyNoThis)
15994 {
15995 struct TypeName * thisParam;
15996
15997 if(type->classObjectType != 1)
15998 {
15999 thisParam = QMkClass(_class->fullName, MkDeclaratorIdentifier(MkIdentifier("this")));
16000 if(!funcDecl->function.parameters)
16001 funcDecl->function.parameters = MkList();
16002 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
16003 }
16004 if(typedObject)
16005 {
16006 if(type->classObjectType != 1)
16007 {
16008 if(type->byReference || _class->type == 3 || _class->type == 1000 || _class->type == 4 || _class->type == 2)
16009 thisParam->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), thisParam->declarator);
16010 }
16011 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));
16012 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
16013 }
16014 }
16015 }
16016 if(symbol && symbol->pointerExternal && symbol->pointerExternal->type == 1)
16017 {
16018 struct InitDeclarator * initDecl = (*symbol->pointerExternal->declaration->declarators).first;
16019
16020 funcDecl = GetFuncDecl(initDecl->declarator);
16021 if(funcDecl)
16022 {
16023 if(funcDecl->function.parameters && (*funcDecl->function.parameters).count == 1)
16024 {
16025 struct TypeName * param = (*funcDecl->function.parameters).first;
16026
16027 if(param->qualifiers && (*param->qualifiers).count == 1 && ((struct Specifier *)(*param->qualifiers).first)->specifier == VOID && !param->declarator)
16028 {
16029 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->function.parameters), param);
16030 FreeTypeName(param);
16031 }
16032 }
16033 if(type->classObjectType != 1)
16034 {
16035 if((_class->type != 2 && _class->type != 3 && _class->type != 4) || function != (struct FunctionDefinition *)symbol->externalSet)
16036 {
16037 struct TypeName * thisParam = QMkClass(_class->fullName, MkDeclaratorIdentifier(MkIdentifier("this")));
16038
16039 if(!funcDecl->function.parameters)
16040 funcDecl->function.parameters = MkList();
16041 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
16042 }
16043 }
16044 }
16045 }
16046 }
16047 if(function->body)
16048 {
16049 if(type->classObjectType != 1)
16050 {
16051 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));
16052 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&function->body->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
16053 if(typedObject && thisSymbol->type)
16054 {
16055 thisSymbol->type->classObjectType = 2;
16056 thisSymbol->type->byReference = type->byReference;
16057 }
16058 }
16059 }
16060 if(inCompiler && _class && (_class->type == 0) && type->classObjectType != 1)
16061 {
16062 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
16063
16064 {
16065 struct __ecereNameSpace__ecere__com__Class * base;
16066
16067 for(base = _class; base && base->type != 1000; base = base->next)
16068 {
16069 for(member = base->membersAndProperties.first; member; member = member->next)
16070 if(!member->isProperty)
16071 break;
16072 if(member)
16073 break;
16074 }
16075 }
16076 for(member = _class->membersAndProperties.first; member; member = member->next)
16077 if(!member->isProperty)
16078 break;
16079 if(member)
16080 {
16081 char pointerName[1024];
16082 struct Declaration * decl;
16083 struct Initializer * initializer;
16084 struct Expression * exp, * bytePtr;
16085
16086 strcpy(pointerName, "__ecerePointer_");
16087 FullClassNameCat(pointerName, _class->fullName, 0x0);
16088 {
16089 char className[1024];
16090
16091 strcpy(className, "__ecereClass_");
16092 FullClassNameCat(className, classSym->string, 0x1);
16093 MangleClassName(className);
16094 DeclareClass(classSym, className);
16095 }
16096 bytePtr = QBrackets(MkExpCast(QMkType("char", QMkPtrDecl((((void *)0)))), QMkExpId("this")));
16097 if(_class->fixed)
16098 {
16099 char string[256];
16100
16101 sprintf(string, "%d", _class->offset);
16102 exp = QBrackets(MkExpOp(bytePtr, '+', MkExpConstant(string)));
16103 }
16104 else
16105 {
16106 exp = QBrackets(MkExpOp(bytePtr, '+', MkExpPointer(QMkExpId(className), MkIdentifier("offset"))));
16107 }
16108 exp = QBrackets(QMkExpCond(QMkExpId("this"), exp, MkExpConstant("0")));
16109 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));
16110 if(function->body)
16111 {
16112 yylloc = function->body->loc;
16113 initializer = MkInitializerAssignment(MkExpCast(MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(structName), (((void *)0)))), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), exp));
16114 {
16115 struct Context * prevContext = curContext;
16116
16117 curContext = function->body->compound.context;
16118 decl = MkDeclaration(MkListOne(MkStructOrUnion(3, MkIdentifier(structName), (((void *)0)))), MkListOne(MkInitDeclarator(QMkPtrDecl(pointerName), initializer)));
16119 curContext = prevContext;
16120 }
16121 decl->symbol = (((void *)0));
16122 if(!function->body->compound.declarations)
16123 function->body->compound.declarations = MkList();
16124 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*function->body->compound.declarations), (((void *)0)), decl);
16125 }
16126 }
16127 }
16128 }
16129 else
16130 thisClass = (((void *)0));
16131 if(id)
16132 {
16133 FreeSpecifier(id->_class);
16134 id->_class = (((void *)0));
16135 if(symbol && symbol->pointerExternal && symbol->pointerExternal->type == 1)
16136 {
16137 struct InitDeclarator * initDecl = (*symbol->pointerExternal->declaration->declarators).first;
16138
16139 id = GetDeclId(initDecl->declarator);
16140 FreeSpecifier(id->_class);
16141 id->_class = (((void *)0));
16142 }
16143 }
16144 if(function->body)
16145 topContext = function->body->compound.context;
16146 {
16147 struct FunctionDefinition * oldFunction = curFunction;
16148
16149 curFunction = function;
16150 if(function->body)
16151 ProcessStatement(function->body);
16152 if(inCompiler && function->propSet && !function->propSet->fireWatchersDone)
16153 {
16154 struct Statement * prevCompound = curCompound;
16155 struct Context * prevContext = curContext;
16156 struct Statement * fireWatchers = MkFireWatchersStmt((((void *)0)), (((void *)0)));
16157
16158 if(!function->body->compound.statements)
16159 function->body->compound.statements = MkList();
16160 ListAdd(function->body->compound.statements, fireWatchers);
16161 curCompound = function->body;
16162 curContext = function->body->compound.context;
16163 ProcessStatement(fireWatchers);
16164 curContext = prevContext;
16165 curCompound = prevCompound;
16166 }
16167 curFunction = oldFunction;
16168 }
16169 if(function->declarator)
16170 {
16171 ProcessDeclarator(function->declarator);
16172 }
16173 topContext = oldTopContext;
16174 thisClass = oldThisClass;
16175 }
16176
16177 extern void FreeSymbol(struct Symbol * symbol);
16178
16179 void __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Remove(struct __ecereNameSpace__ecere__sys__BinaryTree * this, struct __ecereNameSpace__ecere__sys__BTNode * node);
16180
16181 static void ProcessClass(struct __ecereNameSpace__ecere__sys__OldList * definitions, struct Symbol * symbol)
16182 {
16183 struct ClassDef * def;
16184 struct External * external = curExternal;
16185 struct __ecereNameSpace__ecere__com__Class * regClass = symbol ? symbol->registered : (((void *)0));
16186
16187 for(def = definitions->first; def; def = def->next)
16188 {
16189 if(def->type == 0)
16190 {
16191 if(def->function->declarator)
16192 curExternal = def->function->declarator->symbol->pointerExternal;
16193 else
16194 curExternal = external;
16195 ProcessFunction((struct FunctionDefinition *)def->function);
16196 }
16197 else if(def->type == 2)
16198 {
16199 if(def->decl->type == 2)
16200 {
16201 thisClass = regClass;
16202 ProcessInstantiationType(def->decl->inst);
16203 thisClass = (((void *)0));
16204 }
16205 else
16206 {
16207 struct __ecereNameSpace__ecere__com__Class * backThisClass = thisClass;
16208
16209 if(regClass)
16210 thisClass = regClass;
16211 ProcessDeclaration(def->decl);
16212 thisClass = backThisClass;
16213 }
16214 }
16215 else if(def->type == 1 && def->defProperties)
16216 {
16217 struct MemberInit * defProperty;
16218 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);
16219
16220 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
16221 for(defProperty = (*def->defProperties).first; defProperty; defProperty = defProperty->next)
16222 {
16223 thisClass = regClass;
16224 ProcessMemberInitData(defProperty, regClass, (((void *)0)), (((void *)0)), (((void *)0)), (((void *)0)));
16225 thisClass = (((void *)0));
16226 }
16227 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Remove(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
16228 FreeSymbol(thisSymbol);
16229 }
16230 else if(def->type == 3 && def->propertyDef)
16231 {
16232 struct PropertyDef * prop = def->propertyDef;
16233
16234 thisClass = regClass;
16235 if(prop->setStmt)
16236 {
16237 if(regClass)
16238 {
16239 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
16240
16241 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->setStmt->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
16242 }
16243 curExternal = prop->symbol ? prop->symbol->externalSet : (((void *)0));
16244 ProcessStatement(prop->setStmt);
16245 }
16246 if(prop->getStmt)
16247 {
16248 if(regClass)
16249 {
16250 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
16251
16252 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->getStmt->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
16253 }
16254 curExternal = prop->symbol ? prop->symbol->externalGet : (((void *)0));
16255 ProcessStatement(prop->getStmt);
16256 }
16257 if(prop->issetStmt)
16258 {
16259 if(regClass)
16260 {
16261 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
16262
16263 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->issetStmt->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
16264 }
16265 curExternal = prop->symbol ? prop->symbol->externalIsSet : (((void *)0));
16266 ProcessStatement(prop->issetStmt);
16267 }
16268 thisClass = (((void *)0));
16269 }
16270 else if(def->type == 4 && def->propertyWatch)
16271 {
16272 struct PropertyWatch * propertyWatch = def->propertyWatch;
16273
16274 thisClass = regClass;
16275 if(propertyWatch->compound)
16276 {
16277 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);
16278
16279 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&propertyWatch->compound->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
16280 curExternal = (((void *)0));
16281 ProcessStatement(propertyWatch->compound);
16282 }
16283 thisClass = (((void *)0));
16284 }
16285 }
16286 }
16287
16288 void DeclareFunctionUtil(char * s)
16289 {
16290 struct __ecereNameSpace__ecere__com__GlobalFunction * function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, s);
16291
16292 if(function)
16293 {
16294 char name[1024];
16295
16296 name[0] = (char)0;
16297 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + 12)))->importType != 1 && (!function->dataType || !function->dataType->dllExport))
16298 strcpy(name, "__ecereFunction_");
16299 FullClassNameCat(name, s, 0x0);
16300 DeclareFunction(function, name);
16301 }
16302 }
16303
16304 extern struct __ecereNameSpace__ecere__com__Instance * GetPrivateModule(void);
16305
16306 void ComputeDataTypes()
16307 {
16308 void * __ecereTemp1;
16309 struct External * external;
16310 struct External * temp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_External);
16311
16312 currentClass = (((void *)0));
16313 containerClass = __ecereNameSpace__ecere__com__eSystem_FindClass(GetPrivateModule(), "Container");
16314 temp->symbol = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), ((struct Symbol *)__ecereTemp1)->id = -1000, ((struct Symbol *)__ecereTemp1)->idCode = -1000, ((struct Symbol *)__ecereTemp1));
16315 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), (((void *)0)), temp);
16316 curExternal = temp;
16317 DeclareFunctionUtil("eSystem_New");
16318 DeclareFunctionUtil("eSystem_New0");
16319 DeclareFunctionUtil("eSystem_Renew");
16320 DeclareFunctionUtil("eSystem_Renew0");
16321 DeclareStruct("ecere::com::Class", 0x0);
16322 DeclareStruct("ecere::com::Instance", 0x0);
16323 DeclareStruct("ecere::com::Property", 0x0);
16324 DeclareStruct("ecere::com::DataMember", 0x0);
16325 DeclareStruct("ecere::com::Method", 0x0);
16326 DeclareStruct("ecere::com::SerialBuffer", 0x0);
16327 DeclareStruct("ecere::com::ClassTemplateArgument", 0x0);
16328 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*ast), temp);
16329 for(external = (*ast).first; external; external = external->next)
16330 {
16331 afterExternal = curExternal = external;
16332 if(external->type == 0)
16333 {
16334 currentClass = external->function->_class;
16335 ProcessFunction(external->function);
16336 }
16337 else if(external->type == 1)
16338 {
16339 currentClass = (((void *)0));
16340 ProcessDeclaration(external->declaration);
16341 }
16342 else if(external->type == 2)
16343 {
16344 struct ClassDefinition * _class = external->_class;
16345
16346 currentClass = external->symbol->registered;
16347 if(_class->definitions)
16348 {
16349 ProcessClass(_class->definitions, _class->symbol);
16350 }
16351 if(inCompiler)
16352 {
16353 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*ast), external);
16354 ((external ? (__ecereClass_External->Destructor ? __ecereClass_External->Destructor(external) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(external)) : 0), external = 0);
16355 }
16356 }
16357 else if(external->type == 4)
16358 {
16359 thisNameSpace = external->id->string;
16360 }
16361 }
16362 currentClass = (((void *)0));
16363 thisNameSpace = (((void *)0));
16364 ((temp->symbol ? (__ecereClass_Symbol->Destructor ? __ecereClass_Symbol->Destructor(temp->symbol) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(temp->symbol)) : 0), temp->symbol = 0);
16365 ((temp ? (__ecereClass_External->Destructor ? __ecereClass_External->Destructor(temp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(temp)) : 0), temp = 0);
16366 }
16367
16368 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);
16369
16370 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);
16371
16372 void __ecereRegisterModule_pass15(struct __ecereNameSpace__ecere__com__Instance * module)
16373 {
16374 struct __ecereNameSpace__ecere__com__Class * class;
16375
16376 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetYydebug", "void SetYydebug(bool b)", SetYydebug, module, 1);
16377 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetThisClass", "void SetThisClass(ecere::com::Class c)", SetThisClass, module, 1);
16378 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetThisClass", "ecere::com::Class GetThisClass(void)", GetThisClass, module, 1);
16379 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintExpression", "void PrintExpression(Expression exp, char * string)", PrintExpression, module, 1);
16380 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("_strtoi64", "int64 _strtoi64(char * string, char * * endString, int base)", _strtoi64, module, 2);
16381 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("_strtoui64", "uint64 _strtoui64(char * string, char * * endString, int base)", _strtoui64, module, 2);
16382 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessTemplateParameterType", "Type ProcessTemplateParameterType(TemplateParameter param)", ProcessTemplateParameterType, module, 2);
16383 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("NeedCast", "bool NeedCast(Type type1, Type type2)", NeedCast, module, 2);
16384 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintInt", "char * PrintInt(int64 result)", PrintInt, module, 1);
16385 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUInt", "char * PrintUInt(uint64 result)", PrintUInt, module, 1);
16386 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintInt64", "char * PrintInt64(int64 result)", PrintInt64, module, 1);
16387 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUInt64", "char * PrintUInt64(uint64 result)", PrintUInt64, module, 1);
16388 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintHexUInt", "char * PrintHexUInt(uint64 result)", PrintHexUInt, module, 1);
16389 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintHexUInt64", "char * PrintHexUInt64(uint64 result)", PrintHexUInt64, module, 1);
16390 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintShort", "char * PrintShort(short result)", PrintShort, module, 1);
16391 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUShort", "char * PrintUShort(uint16 result)", PrintUShort, module, 1);
16392 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintChar", "char * PrintChar(char result)", PrintChar, module, 1);
16393 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUChar", "char * PrintUChar(byte result)", PrintUChar, module, 1);
16394 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintFloat", "char * PrintFloat(float result)", PrintFloat, module, 1);
16395 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintDouble", "char * PrintDouble(double result)", PrintDouble, module, 1);
16396 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetInt", "bool GetInt(Expression exp, int * value2)", GetInt, module, 1);
16397 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUInt", "bool GetUInt(Expression exp, uint * value2)", GetUInt, module, 1);
16398 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetInt64", "bool GetInt64(Expression exp, int64 * value2)", GetInt64, module, 1);
16399 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUInt64", "bool GetUInt64(Expression exp, uint64 * value2)", GetUInt64, module, 1);
16400 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetIntPtr", "bool GetIntPtr(Expression exp, intptr * value2)", GetIntPtr, module, 1);
16401 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUIntPtr", "bool GetUIntPtr(Expression exp, uintptr * value2)", GetUIntPtr, module, 1);
16402 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetShort", "bool GetShort(Expression exp, short * value2)", GetShort, module, 1);
16403 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUShort", "bool GetUShort(Expression exp, uint16 * value2)", GetUShort, module, 1);
16404 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetChar", "bool GetChar(Expression exp, char * value2)", GetChar, module, 1);
16405 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUChar", "bool GetUChar(Expression exp, byte * value2)", GetUChar, module, 1);
16406 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetFloat", "bool GetFloat(Expression exp, float * value2)", GetFloat, module, 1);
16407 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetDouble", "bool GetDouble(Expression exp, double * value2)", GetDouble, module, 1);
16408 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeClassMembers", "void ComputeClassMembers(ecere::com::Class _class, bool isMember)", ComputeClassMembers, module, 2);
16409 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeModuleClasses", "void ComputeModuleClasses(ecere::com::Module module)", ComputeModuleClasses, module, 1);
16410 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeTypeSize", "int ComputeTypeSize(Type type)", ComputeTypeSize, module, 1);
16411 __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);
16412 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareStruct", "void DeclareStruct(char * name, bool skipNoHead)", DeclareStruct, module, 2);
16413 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareProperty", "void DeclareProperty(ecere::com::Property prop, char * setName, char * getName)", DeclareProperty, module, 2);
16414 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("Dereference", "Type Dereference(Type source)", Dereference, module, 1);
16415 __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);
16416 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessInstantiationType", "void ProcessInstantiationType(Instantiation inst)", ProcessInstantiationType, module, 2);
16417 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindTemplateArg", "ecere::com::ClassTemplateArgument * FindTemplateArg(ecere::com::Class _class, TemplateParameter param)", FindTemplateArg, module, 2);
16418 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetupTemplatesContext", "Context SetupTemplatesContext(ecere::com::Class _class)", SetupTemplatesContext, module, 1);
16419 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FinishTemplatesContext", "void FinishTemplatesContext(Context context)", FinishTemplatesContext, module, 1);
16420 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessMethodType", "void ProcessMethodType(ecere::com::Method method)", ProcessMethodType, module, 1);
16421 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessPropertyType", "void ProcessPropertyType(ecere::com::Property prop)", ProcessPropertyType, module, 1);
16422 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareMethod", "void DeclareMethod(ecere::com::Method method, char * name)", DeclareMethod, module, 1);
16423 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClass", "char * ReplaceThisClass(ecere::com::Class _class)", ReplaceThisClass, module, 2);
16424 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClassType", "Type ReplaceThisClassType(ecere::com::Class _class)", ReplaceThisClassType, module, 2);
16425 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClassSpecifiers", "void ReplaceThisClassSpecifiers(ecere::sys::OldList specs, ecere::com::Class _class)", ReplaceThisClassSpecifiers, module, 2);
16426 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareFunction", "bool DeclareFunction(ecere::com::GlobalFunction function, char * name)", DeclareFunction, module, 2);
16427 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareGlobalData", "void DeclareGlobalData(GlobalData data)", DeclareGlobalData, module, 2);
16428 class = __ecereNameSpace__ecere__com__eSystem_RegisterClass(5, "Conversion", 0, sizeof(struct Conversion), 0, 0, 0, module, 2, 1);
16429 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + 12)))->application == ((struct __ecereNameSpace__ecere__com__Module *)(((char *)__thisModule + 12)))->application && class)
16430 __ecereClass_Conversion = class;
16431 __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);
16432 __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);
16433 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ModuleVisibility", "bool ModuleVisibility(ecere::com::Module searchIn, ecere::com::Module searchFor)", ModuleVisibility, module, 1);
16434 __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);
16435 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("MatchTypeExpression", "bool MatchTypeExpression(Expression sourceExp, Type dest, ecere::sys::OldList conversions, bool skipUnitBla)", MatchTypeExpression, module, 2);
16436 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReadString", "void ReadString(char * output, char * string)", ReadString, module, 1);
16437 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOperand", "Operand GetOperand(Expression exp)", GetOperand, module, 1);
16438 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PopulateInstance", "void PopulateInstance(Instantiation inst)", PopulateInstance, module, 1);
16439 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeInstantiation", "void ComputeInstantiation(Expression exp)", ComputeInstantiation, module, 1);
16440 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CallOperator", "void CallOperator(Expression exp, Expression exp1, Expression exp2, Operand op1, Operand op2)", CallOperator, module, 1);
16441 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeExpression", "void ComputeExpression(Expression exp)", ComputeExpression, module, 1);
16442 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CheckTemplateTypes", "void CheckTemplateTypes(Expression exp)", CheckTemplateTypes, module, 1);
16443 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindSymbol", "Symbol FindSymbol(char * name, Context startContext, Context endContext, bool isStruct, bool globalNameSpace)", FindSymbol, module, 1);
16444 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintType", "void PrintType(Type type, char * string, bool printName, bool fullName)", PrintType, module, 1);
16445 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindMemberAndOffset", "Type FindMemberAndOffset(Type type, char * string, uint * offset)", FindMemberAndOffset, module, 1);
16446 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ParseExpressionString", "Expression ParseExpressionString(char * expression)", ParseExpressionString, module, 1);
16447 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceExpContents", "void ReplaceExpContents(Expression checkedExp, Expression newExp)", ReplaceExpContents, module, 1);
16448 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ApplyAnyObjectLogic", "void ApplyAnyObjectLogic(Expression e)", ApplyAnyObjectLogic, module, 1);
16449 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessExpressionType", "void ProcessExpressionType(Expression exp)", ProcessExpressionType, module, 1);
16450 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareFunctionUtil", "void DeclareFunctionUtil(String s)", DeclareFunctionUtil, module, 1);
16451 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeDataTypes", "void ComputeDataTypes(void)", ComputeDataTypes, module, 1);
16452 }
16453
16454 void __ecereUnregisterModule_pass15(struct __ecereNameSpace__ecere__com__Instance * module)
16455 {
16456
16457 }
16458