compiler/i18n: Added i18n strings to libec/ecc/ecp/ecs
[sdk] / compiler / bootstrap / libec / bootstrap / pass15.c
1 #if defined(__GNUC__)
2 typedef long long int64;
3 typedef unsigned long long uint64;
4 #elif defined(__TINYC__)
5 #include <stdarg.h>
6 #define __builtin_va_list va_list
7 #define __builtin_va_start va_start
8 #define __builtin_va_end va_end
9 #ifdef _WIN32
10 #define strcasecmp stricmp
11 #define strncasecmp strnicmp
12 #define __declspec(x) __attribute__((x))
13 #endif
14 typedef long long int64;
15 typedef unsigned long long uint64;
16 #else
17 typedef __int64 int64;
18 typedef unsigned __int64 uint64;
19 #endif
20 #ifdef __BIG_ENDIAN__
21 #define __ENDIAN_PAD(x) (8 - (x))
22 #else
23 #define __ENDIAN_PAD(x) 0
24 #endif
25 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__BTNode;
26
27 struct __ecereNameSpace__ecere__sys__BTNode;
28
29 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__BinaryTree;
30
31 struct __ecereNameSpace__ecere__sys__BinaryTree
32 {
33 struct __ecereNameSpace__ecere__sys__BTNode * root;
34 int count;
35 int (*  CompareKey)(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, unsigned int a, unsigned int b);
36 void (*  FreeKey)(void *  key);
37 };
38
39 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__OldList;
40
41 struct __ecereNameSpace__ecere__sys__OldList
42 {
43 void *  first;
44 void *  last;
45 int count;
46 unsigned int offset;
47 unsigned int circ;
48 };
49
50 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Method;
51
52 struct __ecereNameSpace__ecere__com__Method
53 {
54 char *  name;
55 struct __ecereNameSpace__ecere__com__Method * parent;
56 struct __ecereNameSpace__ecere__com__Method * left;
57 struct __ecereNameSpace__ecere__com__Method * right;
58 int depth;
59 int (*  function)();
60 int vid;
61 int type;
62 struct __ecereNameSpace__ecere__com__Class * _class;
63 void *  symbol;
64 char *  dataTypeString;
65 struct Type * dataType;
66 int memberAccess;
67 };
68
69 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Property;
70
71 struct __ecereNameSpace__ecere__com__Property
72 {
73 struct __ecereNameSpace__ecere__com__Property * prev;
74 struct __ecereNameSpace__ecere__com__Property * next;
75 char *  name;
76 unsigned int isProperty;
77 int memberAccess;
78 int id;
79 struct __ecereNameSpace__ecere__com__Class * _class;
80 char *  dataTypeString;
81 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
82 struct Type * dataType;
83 void (*  Set)();
84 int (*  Get)();
85 unsigned int (*  IsSet)();
86 void *  data;
87 void *  symbol;
88 int vid;
89 unsigned int conversion;
90 unsigned int watcherOffset;
91 char *  category;
92 unsigned int compiled;
93 unsigned int selfWatchable;
94 unsigned int isWatchable;
95 };
96
97 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_CodePosition;
98
99 struct CodePosition
100 {
101 int line;
102 int charPos;
103 int pos;
104 unsigned int included;
105 };
106
107 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Location;
108
109 struct Location
110 {
111 struct CodePosition start;
112 struct CodePosition end;
113 };
114
115 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassDefinition;
116
117 struct ClassDefinition
118 {
119 struct ClassDefinition * prev;
120 struct ClassDefinition * next;
121 struct Location loc;
122 struct Specifier * _class;
123 struct __ecereNameSpace__ecere__sys__OldList *  baseSpecs;
124 struct __ecereNameSpace__ecere__sys__OldList *  definitions;
125 struct Symbol * symbol;
126 struct Location blockStart;
127 struct Location nameLoc;
128 int endid;
129 int declMode;
130 unsigned int deleteWatchable;
131 };
132
133 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Context;
134
135 struct Context
136 {
137 struct Context * parent;
138 struct __ecereNameSpace__ecere__sys__BinaryTree types;
139 struct __ecereNameSpace__ecere__sys__BinaryTree classes;
140 struct __ecereNameSpace__ecere__sys__BinaryTree symbols;
141 struct __ecereNameSpace__ecere__sys__BinaryTree structSymbols;
142 int nextID;
143 int simpleID;
144 struct __ecereNameSpace__ecere__sys__BinaryTree templateTypes;
145 struct ClassDefinition * classDef;
146 unsigned int templateTypesOnly;
147 unsigned int hasNameSpace;
148 };
149
150 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Instantiation;
151
152 struct Instantiation
153 {
154 struct Instantiation * prev;
155 struct Instantiation * next;
156 struct Location loc;
157 struct Specifier * _class;
158 struct Expression * exp;
159 struct __ecereNameSpace__ecere__sys__OldList *  members;
160 struct Symbol * symbol;
161 unsigned int fullSet;
162 unsigned int isConstant;
163 unsigned char *  data;
164 struct Location nameLoc;
165 struct Location insideLoc;
166 unsigned int built;
167 };
168
169 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Declaration;
170
171 struct Declaration
172 {
173 struct Declaration * prev;
174 struct Declaration * next;
175 struct Location loc;
176 int type;
177 union
178 {
179 struct
180 {
181 struct __ecereNameSpace__ecere__sys__OldList *  specifiers;
182 struct __ecereNameSpace__ecere__sys__OldList *  declarators;
183 };
184 struct Instantiation * inst;
185 struct
186 {
187 struct Identifier * id;
188 struct Expression * exp;
189 };
190 };
191 struct Specifier * extStorage;
192 struct Symbol * symbol;
193 int declMode;
194 };
195
196 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Statement;
197
198 struct Statement
199 {
200 struct Statement * prev;
201 struct Statement * next;
202 struct Location loc;
203 int type;
204 union
205 {
206 struct __ecereNameSpace__ecere__sys__OldList *  expressions;
207 struct
208 {
209 struct Identifier * id;
210 struct Statement * stmt;
211 } labeled;
212 struct
213 {
214 struct Expression * exp;
215 struct Statement * stmt;
216 } caseStmt;
217 struct
218 {
219 struct __ecereNameSpace__ecere__sys__OldList * declarations;
220 struct __ecereNameSpace__ecere__sys__OldList * statements;
221 struct Context * context;
222 unsigned int isSwitch;
223 } compound;
224 struct
225 {
226 struct __ecereNameSpace__ecere__sys__OldList * exp;
227 struct Statement * stmt;
228 struct Statement * elseStmt;
229 } ifStmt;
230 struct
231 {
232 struct __ecereNameSpace__ecere__sys__OldList * exp;
233 struct Statement * stmt;
234 } switchStmt;
235 struct
236 {
237 struct __ecereNameSpace__ecere__sys__OldList * exp;
238 struct Statement * stmt;
239 } whileStmt;
240 struct
241 {
242 struct __ecereNameSpace__ecere__sys__OldList * exp;
243 struct Statement * stmt;
244 } doWhile;
245 struct
246 {
247 struct Statement * init;
248 struct Statement * check;
249 struct __ecereNameSpace__ecere__sys__OldList * increment;
250 struct Statement * stmt;
251 } forStmt;
252 struct
253 {
254 struct Identifier * id;
255 } gotoStmt;
256 struct
257 {
258 struct Specifier * spec;
259 char * statements;
260 struct __ecereNameSpace__ecere__sys__OldList * inputFields;
261 struct __ecereNameSpace__ecere__sys__OldList * outputFields;
262 struct __ecereNameSpace__ecere__sys__OldList * clobberedFields;
263 } asmStmt;
264 struct
265 {
266 struct Expression * watcher;
267 struct Expression * object;
268 struct __ecereNameSpace__ecere__sys__OldList * watches;
269 } _watch;
270 struct
271 {
272 struct Identifier * id;
273 struct __ecereNameSpace__ecere__sys__OldList * exp;
274 struct __ecereNameSpace__ecere__sys__OldList * filter;
275 struct Statement * stmt;
276 } forEachStmt;
277 struct Declaration * decl;
278 };
279 };
280
281 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TypeName;
282
283 struct TypeName
284 {
285 struct TypeName * prev;
286 struct TypeName * next;
287 struct Location loc;
288 struct __ecereNameSpace__ecere__sys__OldList *  qualifiers;
289 struct Declarator * declarator;
290 int classObjectType;
291 struct Expression * bitCount;
292 };
293
294 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Initializer;
295
296 struct Initializer
297 {
298 struct Initializer * prev;
299 struct Initializer * next;
300 struct Location loc;
301 int type;
302 union
303 {
304 struct Expression * exp;
305 struct __ecereNameSpace__ecere__sys__OldList *  list;
306 };
307 unsigned int isConstant;
308 };
309
310 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__DataValue;
311
312 struct __ecereNameSpace__ecere__com__DataValue
313 {
314 union
315 {
316 char c;
317 unsigned char uc;
318 short s;
319 unsigned short us;
320 int i;
321 unsigned int ui;
322 void *  p;
323 float f;
324 double d;
325 long long i64;
326 uint64 ui64;
327 };
328 };
329
330 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Expression;
331
332 struct Expression
333 {
334 struct Expression * prev;
335 struct Expression * next;
336 struct Location loc;
337 int type;
338 union
339 {
340 struct
341 {
342 char *  constant;
343 struct Identifier * identifier;
344 };
345 struct Statement * compound;
346 struct Instantiation * instance;
347 char *  string;
348 struct __ecereNameSpace__ecere__sys__OldList *  list;
349 struct
350 {
351 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
352 struct Declarator * decl;
353 } _classExp;
354 struct
355 {
356 struct Identifier * id;
357 } classData;
358 struct
359 {
360 struct Expression * exp;
361 struct __ecereNameSpace__ecere__sys__OldList * arguments;
362 struct Location argLoc;
363 } call;
364 struct
365 {
366 struct Expression * exp;
367 struct __ecereNameSpace__ecere__sys__OldList * index;
368 } index;
369 struct
370 {
371 struct Expression * exp;
372 struct Identifier * member;
373 int memberType;
374 unsigned int thisPtr;
375 } member;
376 struct
377 {
378 int op;
379 struct Expression * exp1;
380 struct Expression * exp2;
381 } op;
382 struct TypeName * typeName;
383 struct Specifier * _class;
384 struct
385 {
386 struct TypeName * typeName;
387 struct Expression * exp;
388 } cast;
389 struct
390 {
391 struct Expression * cond;
392 struct __ecereNameSpace__ecere__sys__OldList * exp;
393 struct Expression * elseExp;
394 } cond;
395 struct
396 {
397 struct TypeName * typeName;
398 struct Expression * size;
399 } _new;
400 struct
401 {
402 struct TypeName * typeName;
403 struct Expression * size;
404 struct Expression * exp;
405 } _renew;
406 struct
407 {
408 char * table;
409 struct Identifier * id;
410 } db;
411 struct
412 {
413 struct Expression * ds;
414 struct Expression * name;
415 } dbopen;
416 struct
417 {
418 struct TypeName * typeName;
419 struct Initializer * initializer;
420 } initializer;
421 struct
422 {
423 struct Expression * exp;
424 struct TypeName * typeName;
425 } vaArg;
426 };
427 unsigned int debugValue;
428 struct __ecereNameSpace__ecere__com__DataValue val;
429 unsigned int address;
430 unsigned int hasAddress;
431 struct Type * expType;
432 struct Type * destType;
433 unsigned int usage;
434 int tempCount;
435 unsigned int byReference;
436 unsigned int isConstant;
437 unsigned int addedThis;
438 unsigned int needCast;
439 unsigned int thisPtr;
440 };
441
442 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplateDatatype;
443
444 struct TemplateDatatype
445 {
446 struct __ecereNameSpace__ecere__sys__OldList *  specifiers;
447 struct Declarator * decl;
448 };
449
450 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplateArgument;
451
452 struct TemplateArgument;
453
454 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplateParameter;
455
456 struct TemplateParameter
457 {
458 struct TemplateParameter * prev;
459 struct TemplateParameter * next;
460 struct Location loc;
461 int type;
462 struct Identifier * identifier;
463 union
464 {
465 struct TemplateDatatype * dataType;
466 int memberType;
467 };
468 struct TemplateArgument * defaultArgument;
469 char *  dataTypeString;
470 struct Type * baseType;
471 };
472
473 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Specifier;
474
475 struct Specifier
476 {
477 struct Specifier * prev;
478 struct Specifier * next;
479 struct Location loc;
480 int type;
481 union
482 {
483 int specifier;
484 struct
485 {
486 char *  name;
487 struct Symbol * symbol;
488 struct __ecereNameSpace__ecere__sys__OldList *  templateArgs;
489 };
490 struct
491 {
492 struct Identifier * id;
493 struct __ecereNameSpace__ecere__sys__OldList *  list;
494 struct __ecereNameSpace__ecere__sys__OldList *  baseSpecs;
495 struct __ecereNameSpace__ecere__sys__OldList *  definitions;
496 unsigned int addNameSpace;
497 struct Context * ctx;
498 };
499 struct Expression * expression;
500 struct Specifier * _class;
501 struct TemplateParameter * templateParameter;
502 };
503 };
504
505 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Identifier;
506
507 struct Identifier
508 {
509 struct Identifier * prev;
510 struct Identifier * next;
511 struct Location loc;
512 struct Symbol * classSym;
513 struct Specifier * _class;
514 char *  string;
515 struct Identifier * badID;
516 };
517
518 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Pointer;
519
520 struct Pointer;
521
522 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Declarator;
523
524 struct Declarator
525 {
526 struct Declarator * prev;
527 struct Declarator * next;
528 struct Location loc;
529 int type;
530 struct Symbol * symbol;
531 struct Declarator * declarator;
532 union
533 {
534 struct Identifier * identifier;
535 struct
536 {
537 struct Expression * exp;
538 struct Expression * posExp;
539 char * attrib;
540 } structDecl;
541 struct
542 {
543 struct Expression * exp;
544 struct Specifier * enumClass;
545 } array;
546 struct
547 {
548 struct __ecereNameSpace__ecere__sys__OldList * parameters;
549 } function;
550 struct
551 {
552 struct Pointer * pointer;
553 } pointer;
554 struct
555 {
556 char * extended;
557 } extended;
558 };
559 };
560
561 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_FunctionDefinition;
562
563 struct FunctionDefinition
564 {
565 struct FunctionDefinition * prev;
566 struct FunctionDefinition * next;
567 struct Location loc;
568 struct __ecereNameSpace__ecere__sys__OldList *  specifiers;
569 struct Declarator * declarator;
570 struct __ecereNameSpace__ecere__sys__OldList *  declarations;
571 struct Statement * body;
572 struct __ecereNameSpace__ecere__com__Class * _class;
573 struct __ecereNameSpace__ecere__sys__OldList attached;
574 int declMode;
575 struct Type * type;
576 struct Symbol * propSet;
577 int tempCount;
578 unsigned int propertyNoThis;
579 };
580
581 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_DBTableDef;
582
583 struct DBTableDef;
584
585 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_External;
586
587 struct External
588 {
589 struct External * prev;
590 struct External * next;
591 struct Location loc;
592 int type;
593 struct Symbol * symbol;
594 union
595 {
596 struct FunctionDefinition * function;
597 struct ClassDefinition * _class;
598 struct Declaration * declaration;
599 char *  importString;
600 struct Identifier * id;
601 struct DBTableDef * table;
602 };
603 int importType;
604 };
605
606 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ModuleImport;
607
608 struct ModuleImport
609 {
610 struct ModuleImport * prev;
611 struct ModuleImport * next;
612 char *  name;
613 struct __ecereNameSpace__ecere__sys__OldList classes;
614 struct __ecereNameSpace__ecere__sys__OldList functions;
615 int importType;
616 int importAccess;
617 };
618
619 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassImport;
620
621 struct ClassImport
622 {
623 struct ClassImport * prev;
624 struct ClassImport * next;
625 char *  name;
626 struct __ecereNameSpace__ecere__sys__OldList methods;
627 struct __ecereNameSpace__ecere__sys__OldList properties;
628 unsigned int itself;
629 unsigned int isRemote;
630 };
631
632 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Symbol;
633
634 struct Symbol
635 {
636 char *  string;
637 struct Symbol * parent;
638 struct Symbol * left;
639 struct Symbol * right;
640 int depth;
641 struct Type * type;
642 union
643 {
644 struct __ecereNameSpace__ecere__com__Method * method;
645 struct __ecereNameSpace__ecere__com__Property * _property;
646 struct __ecereNameSpace__ecere__com__Class * registered;
647 };
648 int id;
649 int idCode;
650 union
651 {
652 struct
653 {
654 struct External * pointerExternal;
655 struct External * structExternal;
656 };
657 struct
658 {
659 struct External * externalGet;
660 struct External * externalSet;
661 struct External * externalPtr;
662 struct External * externalIsSet;
663 };
664 struct
665 {
666 struct External * methodExternal;
667 struct External * methodCodeExternal;
668 };
669 };
670 unsigned int imported;
671 unsigned int declaredStructSym;
672 struct __ecereNameSpace__ecere__com__Class * _class;
673 unsigned int declaredStruct;
674 unsigned int needConstructor;
675 unsigned int needDestructor;
676 char *  constructorName;
677 char *  structName;
678 char *  className;
679 char *  destructorName;
680 struct ModuleImport * module;
681 struct ClassImport * _import;
682 struct Location nameLoc;
683 unsigned int isParam;
684 unsigned int isRemote;
685 unsigned int isStruct;
686 unsigned int fireWatchersDone;
687 int declaring;
688 unsigned int classData;
689 unsigned int isStatic;
690 char *  shortName;
691 struct __ecereNameSpace__ecere__sys__OldList *  templateParams;
692 struct __ecereNameSpace__ecere__sys__OldList templatedClasses;
693 struct Context * ctx;
694 int isIterator;
695 struct Expression * propCategory;
696 };
697
698 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Type;
699
700 struct Type
701 {
702 struct Type * prev;
703 struct Type * next;
704 int refCount;
705 union
706 {
707 struct Symbol * _class;
708 struct
709 {
710 struct __ecereNameSpace__ecere__sys__OldList members;
711 char *  enumName;
712 };
713 struct
714 {
715 struct Type * returnType;
716 struct __ecereNameSpace__ecere__sys__OldList params;
717 struct Symbol * thisClass;
718 unsigned int staticMethod;
719 struct TemplateParameter * thisClassTemplate;
720 };
721 struct
722 {
723 struct __ecereNameSpace__ecere__com__Method * method;
724 struct __ecereNameSpace__ecere__com__Class * methodClass;
725 struct __ecereNameSpace__ecere__com__Class * usedClass;
726 };
727 struct
728 {
729 struct Type * arrayType;
730 int arraySize;
731 struct Expression * arraySizeExp;
732 unsigned int freeExp;
733 struct Symbol * enumClass;
734 };
735 struct Type * type;
736 struct TemplateParameter * templateParameter;
737 };
738 unsigned int isSigned;
739 int kind;
740 unsigned int constant;
741 unsigned int size;
742 char *  name;
743 char *  typeName;
744 unsigned int count;
745 unsigned int truth;
746 int classObjectType;
747 unsigned int byReference;
748 unsigned int extraParam;
749 int alignment;
750 unsigned int directClassAccess;
751 unsigned int computing;
752 unsigned int dllExport;
753 unsigned int offset;
754 unsigned int keepCast;
755 unsigned int passAsTemplate;
756 int bitFieldCount;
757 };
758
759 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Class;
760
761 struct __ecereNameSpace__ecere__com__Class
762 {
763 struct __ecereNameSpace__ecere__com__Class * prev;
764 struct __ecereNameSpace__ecere__com__Class * next;
765 char *  name;
766 int offset;
767 int structSize;
768 int (* *  _vTbl)();
769 int vTblSize;
770 int (*  Constructor)(struct __ecereNameSpace__ecere__com__Instance *);
771 void (*  Destructor)(struct __ecereNameSpace__ecere__com__Instance *);
772 int offsetClass;
773 int sizeClass;
774 struct __ecereNameSpace__ecere__com__Class * base;
775 struct __ecereNameSpace__ecere__sys__BinaryTree methods;
776 struct __ecereNameSpace__ecere__sys__BinaryTree members;
777 struct __ecereNameSpace__ecere__sys__BinaryTree prop;
778 struct __ecereNameSpace__ecere__sys__OldList membersAndProperties;
779 struct __ecereNameSpace__ecere__sys__BinaryTree classProperties;
780 struct __ecereNameSpace__ecere__sys__OldList derivatives;
781 int memberID;
782 int startMemberID;
783 int type;
784 struct __ecereNameSpace__ecere__com__Instance * module;
785 struct __ecereNameSpace__ecere__com__NameSpace *  nameSpace;
786 char *  dataTypeString;
787 struct Type * dataType;
788 int typeSize;
789 int defaultAlignment;
790 void (*  Initialize)();
791 int memberOffset;
792 struct __ecereNameSpace__ecere__sys__OldList selfWatchers;
793 char *  designerClass;
794 unsigned int noExpansion;
795 char *  defaultProperty;
796 unsigned int comRedefinition;
797 int count;
798 unsigned int isRemote;
799 unsigned int internalDecl;
800 void *  data;
801 unsigned int computeSize;
802 int structAlignment;
803 int destructionWatchOffset;
804 unsigned int fixed;
805 struct __ecereNameSpace__ecere__sys__OldList delayedCPValues;
806 int inheritanceAccess;
807 char *  fullName;
808 void *  symbol;
809 struct __ecereNameSpace__ecere__sys__OldList conversions;
810 struct __ecereNameSpace__ecere__sys__OldList templateParams;
811 struct __ecereNameSpace__ecere__com__ClassTemplateArgument *  templateArgs;
812 struct __ecereNameSpace__ecere__com__Class * templateClass;
813 struct __ecereNameSpace__ecere__sys__OldList templatized;
814 int numParams;
815 };
816
817 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Instance;
818
819 struct __ecereNameSpace__ecere__com__Instance
820 {
821 int (* *  _vTbl)();
822 struct __ecereNameSpace__ecere__com__Class * _class;
823 int _refCount;
824 };
825
826 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__DataMember;
827
828 struct __ecereNameSpace__ecere__com__DataMember
829 {
830 struct __ecereNameSpace__ecere__com__DataMember * prev;
831 struct __ecereNameSpace__ecere__com__DataMember * next;
832 char *  name;
833 unsigned int isProperty;
834 int memberAccess;
835 int id;
836 struct __ecereNameSpace__ecere__com__Class * _class;
837 char *  dataTypeString;
838 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
839 struct Type * dataType;
840 int type;
841 int offset;
842 int memberID;
843 struct __ecereNameSpace__ecere__sys__OldList members;
844 struct __ecereNameSpace__ecere__sys__BinaryTree membersAlpha;
845 int memberOffset;
846 int structAlignment;
847 };
848
849 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__SerialBuffer;
850
851 struct __ecereNameSpace__ecere__com__SerialBuffer
852 {
853 unsigned char *  _buffer;
854 unsigned int count;
855 unsigned int _size;
856 unsigned int pos;
857 };
858
859 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__ClassTemplateArgument;
860
861 struct __ecereNameSpace__ecere__com__ClassTemplateArgument
862 {
863 union
864 {
865 struct
866 {
867 char *  dataTypeString;
868 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
869 };
870 struct __ecereNameSpace__ecere__com__DataValue expression;
871 struct
872 {
873 char *  memberString;
874 union
875 {
876 struct __ecereNameSpace__ecere__com__DataMember * member;
877 struct __ecereNameSpace__ecere__com__Property * prop;
878 struct __ecereNameSpace__ecere__com__Method * method;
879 };
880 };
881 };
882 };
883
884 typedef unsigned int size_t;
885
886 void exit(int status);
887
888 void * calloc(size_t nmemb, size_t size);
889
890 void free(void * ptr);
891
892 void * malloc(size_t size);
893
894 void * realloc(void * ptr, size_t size);
895
896 long int strtol(const char * nptr, char ** endptr, int base);
897
898 long long int strtoll(const char * nptr, char ** endptr, int base);
899
900 unsigned long long int strtoull(const char * nptr, char ** endptr, int base);
901
902 enum yytokentype
903 {
904 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, EXT_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
905 };
906
907 typedef union YYSTYPE
908 {
909 int specifierType;
910 int i;
911 int declMode;
912 struct Identifier * id;
913 struct Expression * exp;
914 struct Specifier * specifier;
915 struct __ecereNameSpace__ecere__sys__OldList * list;
916 struct Enumerator * enumerator;
917 struct Declarator * declarator;
918 struct Pointer * pointer;
919 struct Initializer * initializer;
920 struct InitDeclarator * initDeclarator;
921 struct TypeName * typeName;
922 struct Declaration * declaration;
923 struct Statement * stmt;
924 struct FunctionDefinition * function;
925 struct External * external;
926 struct Context * context;
927 struct AsmField * asmField;
928 struct Instantiation * instance;
929 struct MembersInit * membersInit;
930 struct MemberInit * memberInit;
931 struct ClassFunction * classFunction;
932 struct ClassDefinition * _class;
933 struct ClassDef * classDef;
934 struct PropertyDef * prop;
935 char * string;
936 struct Symbol * symbol;
937 struct PropertyWatch * propertyWatch;
938 struct TemplateParameter * templateParameter;
939 struct TemplateArgument * templateArgument;
940 struct TemplateDatatype * templateDatatype;
941 struct DBTableEntry * dbtableEntry;
942 struct DBIndexItem * dbindexItem;
943 struct DBTableDef * dbtableDef;
944 } YYSTYPE;
945
946 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Enumerator;
947
948 struct Enumerator
949 {
950 struct Enumerator * prev;
951 struct Enumerator * next;
952 struct Location loc;
953 struct Identifier * id;
954 struct Expression * exp;
955 };
956
957 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_InitDeclarator;
958
959 struct InitDeclarator
960 {
961 struct InitDeclarator * prev;
962 struct InitDeclarator * next;
963 struct Location loc;
964 struct Declarator * declarator;
965 struct Initializer * initializer;
966 };
967
968 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_AsmField;
969
970 struct AsmField
971 {
972 struct AsmField * prev;
973 struct AsmField * next;
974 struct Location loc;
975 char *  command;
976 struct Expression * expression;
977 };
978
979 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassFunction;
980
981 struct ClassFunction
982 {
983 struct ClassFunction * prev;
984 struct ClassFunction * next;
985 struct Location loc;
986 struct __ecereNameSpace__ecere__sys__OldList *  specifiers;
987 struct Declarator * declarator;
988 struct __ecereNameSpace__ecere__sys__OldList *  declarations;
989 struct Statement * body;
990 struct __ecereNameSpace__ecere__com__Class * _class;
991 struct __ecereNameSpace__ecere__sys__OldList attached;
992 int declMode;
993 struct Type * type;
994 struct Symbol * propSet;
995 unsigned int isVirtual;
996 unsigned int isConstructor;
997 unsigned int isDestructor;
998 unsigned int dontMangle;
999 int id;
1000 int idCode;
1001 };
1002
1003 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_MembersInit;
1004
1005 struct MembersInit
1006 {
1007 struct MembersInit * prev;
1008 struct MembersInit * next;
1009 struct Location loc;
1010 int type;
1011 union
1012 {
1013 struct __ecereNameSpace__ecere__sys__OldList *  dataMembers;
1014 struct ClassFunction * function;
1015 };
1016 };
1017
1018 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_MemberInit;
1019
1020 struct MemberInit
1021 {
1022 struct MemberInit * prev;
1023 struct MemberInit * next;
1024 struct Location loc;
1025 struct Location realLoc;
1026 struct __ecereNameSpace__ecere__sys__OldList *  identifiers;
1027 struct Initializer * initializer;
1028 unsigned int used;
1029 unsigned int variable;
1030 unsigned int takeOutExp;
1031 };
1032
1033 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_PropertyDef;
1034
1035 struct PropertyDef
1036 {
1037 struct PropertyDef * prev;
1038 struct PropertyDef * next;
1039 struct Location loc;
1040 struct __ecereNameSpace__ecere__sys__OldList *  specifiers;
1041 struct Declarator * declarator;
1042 struct Identifier * id;
1043 struct Statement * getStmt;
1044 struct Statement * setStmt;
1045 struct Statement * issetStmt;
1046 struct Symbol * symbol;
1047 unsigned int conversion;
1048 unsigned int isWatchable;
1049 struct Expression * category;
1050 };
1051
1052 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_PropertyWatch;
1053
1054 struct PropertyWatch
1055 {
1056 struct PropertyWatch * prev;
1057 struct PropertyWatch * next;
1058 struct Location loc;
1059 struct Statement * compound;
1060 struct __ecereNameSpace__ecere__sys__OldList *  properties;
1061 unsigned int deleteWatch;
1062 };
1063
1064 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassDef;
1065
1066 struct ClassDef
1067 {
1068 struct ClassDef * prev;
1069 struct ClassDef * next;
1070 struct Location loc;
1071 int type;
1072 union
1073 {
1074 struct Declaration * decl;
1075 struct ClassFunction * function;
1076 struct __ecereNameSpace__ecere__sys__OldList *  defProperties;
1077 struct PropertyDef * propertyDef;
1078 struct PropertyWatch * propertyWatch;
1079 char *  designer;
1080 struct Identifier * defaultProperty;
1081 struct
1082 {
1083 struct Identifier * id;
1084 struct Initializer * initializer;
1085 };
1086 };
1087 int memberAccess;
1088 void *  object;
1089 };
1090
1091 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_DBTableEntry;
1092
1093 struct DBTableEntry;
1094
1095 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_DBIndexItem;
1096
1097 struct DBIndexItem;
1098
1099 extern YYSTYPE yylval;
1100
1101 extern struct Location yylloc;
1102
1103 extern struct __ecereNameSpace__ecere__sys__OldList * ast;
1104
1105 extern int returnCode;
1106
1107 extern struct Expression * parsedExpression;
1108
1109 extern unsigned int yydebug;
1110
1111 void SetYydebug(unsigned int b)
1112 {
1113 yydebug = b;
1114 }
1115
1116 extern unsigned int echoOn;
1117
1118 void resetScanner();
1119
1120 int propWatcherID;
1121
1122 int expression_yyparse();
1123
1124 static struct Statement * curCompound;
1125
1126 struct External * curExternal, * afterExternal;
1127
1128 static struct Type * curSwitchType;
1129
1130 static struct __ecereNameSpace__ecere__com__Class * currentClass;
1131
1132 struct __ecereNameSpace__ecere__com__Class * thisClass;
1133
1134 void SetThisClass(struct __ecereNameSpace__ecere__com__Class * c)
1135 {
1136 thisClass = c;
1137 }
1138
1139 struct __ecereNameSpace__ecere__com__Class * GetThisClass()
1140 {
1141 return thisClass;
1142 }
1143
1144 static char * thisNameSpace;
1145
1146 struct __ecereNameSpace__ecere__com__Class * containerClass;
1147
1148 unsigned int thisClassParams = 0x1;
1149
1150 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__TempFile;
1151
1152 struct __ecereNameSpace__ecere__sys__TempFile
1153 {
1154 char __ecere_padding[24];
1155 };
1156
1157 extern void OutputExpression(struct Expression * exp, struct __ecereNameSpace__ecere__com__Instance * f);
1158
1159 extern int strlen(const char * );
1160
1161 extern void *  __ecereNameSpace__ecere__com__eInstance_New(struct __ecereNameSpace__ecere__com__Class * _class);
1162
1163 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek;
1164
1165 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Read;
1166
1167 extern void __ecereNameSpace__ecere__com__eInstance_DecRef(struct __ecereNameSpace__ecere__com__Instance * instance);
1168
1169 void PrintExpression(struct Expression * exp, char * string)
1170 {
1171 {
1172 struct __ecereNameSpace__ecere__com__Instance * f = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
1173 int count;
1174
1175 if(exp)
1176 OutputExpression(exp, f);
1177 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))f->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(f, 0, 0);
1178 count = strlen(string);
1179 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);
1180 string[count] = '\0';
1181 (__ecereNameSpace__ecere__com__eInstance_DecRef(f), f = 0);
1182 }
1183 }
1184
1185 extern int isspace(int c);
1186
1187 long long _strtoi64(char * string, char ** endString, int base)
1188 {
1189 long long value = 0;
1190 int sign = 1;
1191 int c;
1192 char ch;
1193
1194 for(c = 0; (ch = string[c]) && isspace(ch); c++)
1195 ;
1196 if(ch == '+')
1197 c++;
1198 else if(ch == '-')
1199 {
1200 sign = -1;
1201 c++;
1202 }
1203 ;
1204 if(!base)
1205 {
1206 if(ch == (char)0 && string[c + 1] == 'x')
1207 {
1208 base = 16;
1209 c += 2;
1210 }
1211 else if(ch == '0')
1212 {
1213 base = 8;
1214 c++;
1215 }
1216 else
1217 base = 10;
1218 }
1219 for(; (ch = string[c]); c++)
1220 {
1221 if(ch == '0')
1222 ch = (char)0;
1223 else if(ch >= '1' && ch <= '9')
1224 ch -= '1';
1225 else if(ch >= 'a' && ch <= 'z')
1226 ch -= 'a';
1227 else if(ch >= 'A' && ch <= 'Z')
1228 ch -= 'A';
1229 else
1230 {
1231 *endString = string + c;
1232 break;
1233 }
1234 if(ch < base)
1235 {
1236 value *= base;
1237 value += ch;
1238 }
1239 else
1240 {
1241 *endString = string + c;
1242 break;
1243 }
1244 }
1245 return sign * value;
1246 }
1247
1248 uint64 _strtoui64(char * string, char ** endString, int base)
1249 {
1250 uint64 value = 0;
1251 int sign = 1;
1252 int c;
1253 char ch;
1254
1255 for(c = 0; (ch = string[c]) && isspace(ch); c++)
1256 ;
1257 if(ch == '+')
1258 c++;
1259 else if(ch == '-')
1260 {
1261 sign = -1;
1262 c++;
1263 }
1264 ;
1265 if(!base)
1266 {
1267 if(ch == (char)0 && string[c + 1] == 'x')
1268 {
1269 base = 16;
1270 c += 2;
1271 }
1272 else if(ch == '0')
1273 {
1274 base = 8;
1275 c++;
1276 }
1277 else
1278 base = 10;
1279 }
1280 for(; (ch = string[c]); c++)
1281 {
1282 if(ch == '0')
1283 ch = (char)0;
1284 else if(ch >= '1' && ch <= '9')
1285 ch -= '1';
1286 else if(ch >= 'a' && ch <= 'z')
1287 ch -= 'a';
1288 else if(ch >= 'A' && ch <= 'Z')
1289 ch -= 'A';
1290 else
1291 {
1292 if(endString)
1293 *endString = string + c;
1294 break;
1295 }
1296 if(ch < base)
1297 {
1298 value *= base;
1299 value += ch;
1300 }
1301 else
1302 {
1303 if(endString)
1304 *endString = string + c;
1305 break;
1306 }
1307 }
1308 return sign * value;
1309 }
1310
1311 extern struct Type * ProcessTypeString(char *  string, unsigned int staticMethod);
1312
1313 extern struct Type * ProcessType(struct __ecereNameSpace__ecere__sys__OldList * specs, struct Declarator * decl);
1314
1315 struct Type * ProcessTemplateParameterType(struct TemplateParameter * param)
1316 {
1317 if(param && param->type == 0 && (param->dataType || param->dataTypeString))
1318 {
1319 if(!param->baseType)
1320 {
1321 if(param->dataTypeString)
1322 param->baseType = ProcessTypeString(param->dataTypeString, 0x0);
1323 else
1324 param->baseType = ProcessType(param->dataType->specifiers, param->dataType->decl);
1325 }
1326 return param->baseType;
1327 }
1328 return (((void *)0));
1329 }
1330
1331 unsigned int NeedCast(struct Type * type1, struct Type * type2)
1332 {
1333 if(!type1 || !type2 || type1->keepCast || type2->keepCast)
1334 return 0x1;
1335 if(type1->kind == 20 && type2->kind == 4 && type2->passAsTemplate == 0x0)
1336 {
1337 return 0x0;
1338 }
1339 if(type1->kind == type2->kind)
1340 {
1341 switch(type1->kind)
1342 {
1343 case 1:
1344 case 2:
1345 case 3:
1346 case 4:
1347 if(type1->passAsTemplate && !type2->passAsTemplate)
1348 return 0x1;
1349 return type1->isSigned != type2->isSigned;
1350 case 8:
1351 return type1->_class != type2->_class;
1352 case 13:
1353 return NeedCast(type1->type, type2->type);
1354 default:
1355 return 0x1;
1356 }
1357 }
1358 return 0x1;
1359 }
1360
1361 extern int strcmp(const char * , const char * );
1362
1363 extern struct Context * curContext;
1364
1365 extern struct Context * topContext;
1366
1367 extern unsigned int __ecereNameSpace__ecere__com__eClass_IsDerived(struct __ecereNameSpace__ecere__com__Class * _class, struct __ecereNameSpace__ecere__com__Class * from);
1368
1369 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);
1370
1371 extern struct __ecereNameSpace__ecere__com__Instance * privateModule;
1372
1373 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);
1374
1375 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);
1376
1377 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__ClassProperty;
1378
1379 struct __ecereNameSpace__ecere__com__ClassProperty
1380 {
1381 char *  name;
1382 struct __ecereNameSpace__ecere__com__ClassProperty * parent;
1383 struct __ecereNameSpace__ecere__com__ClassProperty * left;
1384 struct __ecereNameSpace__ecere__com__ClassProperty * right;
1385 int depth;
1386 void (*  Set)(struct __ecereNameSpace__ecere__com__Class *, int);
1387 int (*  Get)(struct __ecereNameSpace__ecere__com__Class *);
1388 char *  dataTypeString;
1389 struct Type * dataType;
1390 unsigned int constant;
1391 };
1392
1393 extern struct __ecereNameSpace__ecere__com__ClassProperty * __ecereNameSpace__ecere__com__eClass_FindClassProperty(struct __ecereNameSpace__ecere__com__Class * _class, char *  name);
1394
1395 extern struct Expression * QMkExpId(char *  id);
1396
1397 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__ClassTemplateParameter;
1398
1399 struct __ecereNameSpace__ecere__com__ClassTemplateParameter
1400 {
1401 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * prev;
1402 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * next;
1403 char *  name;
1404 int type;
1405 union
1406 {
1407 char *  dataTypeString;
1408 int memberType;
1409 };
1410 struct __ecereNameSpace__ecere__com__ClassTemplateArgument defaultArg;
1411 void *  param;
1412 char __ecere_padding[4];
1413 };
1414
1415 extern struct Expression * GetTemplateArgExpByName(char *  paramName, struct __ecereNameSpace__ecere__com__Class * curClass, int tplType);
1416
1417 extern struct __ecereNameSpace__ecere__sys__OldList *  MkList(void);
1418
1419 extern void FreeIdentifier(struct Identifier * id);
1420
1421 void ProcessExpressionType(struct Expression * exp);
1422
1423 extern struct Declarator * SpecDeclFromString(char *  string, struct __ecereNameSpace__ecere__sys__OldList *  specs, struct Declarator * baseDecl);
1424
1425 extern struct __ecereNameSpace__ecere__sys__OldList *  MkListOne(void *  item);
1426
1427 extern struct Expression * MkExpOp(struct Expression * exp1, int op, struct Expression * exp2);
1428
1429 extern struct Expression * MkExpCast(struct TypeName * typeName, struct Expression * expression);
1430
1431 extern struct TypeName * MkTypeName(struct __ecereNameSpace__ecere__sys__OldList * qualifiers, struct Declarator * declarator);
1432
1433 extern struct Declarator * MkDeclaratorPointer(struct Pointer * pointer, struct Declarator * declarator);
1434
1435 extern struct Pointer * MkPointer(struct __ecereNameSpace__ecere__sys__OldList * qualifiers, struct Pointer * pointer);
1436
1437 struct __ecereNameSpace__ecere__sys__BTNode * __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(struct __ecereNameSpace__ecere__sys__BinaryTree * this, char *  key);
1438
1439 static void ReplaceClassMembers(struct Expression * exp, struct __ecereNameSpace__ecere__com__Class * _class)
1440 {
1441 if(exp->type == 0 && exp->identifier)
1442 {
1443 struct Identifier * id = exp->identifier;
1444 struct Context * ctx;
1445 struct Symbol * symbol = (((void *)0));
1446
1447 if(!id->_class || !id->_class->name || strcmp(id->_class->name, "property"))
1448 {
1449 for(ctx = curContext; ctx != topContext->parent && !symbol; ctx = ctx->parent)
1450 {
1451 symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(&ctx->symbols, id->string);
1452 if(symbol)
1453 break;
1454 }
1455 }
1456 if(!symbol && ((!id->_class || (id->_class->name && !strcmp(id->_class->name, "property"))) || (id->classSym && __ecereNameSpace__ecere__com__eClass_IsDerived(_class, id->classSym->registered))))
1457 {
1458 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
1459 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
1460 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
1461 struct __ecereNameSpace__ecere__com__ClassProperty * classProp;
1462
1463 if(!prop)
1464 {
1465 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule);
1466 }
1467 if(!prop && !method)
1468 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
1469 if(!prop && !method && !member)
1470 {
1471 classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(_class, id->string);
1472 }
1473 if(prop || method || member || classProp)
1474 {
1475 exp->type = 8;
1476 exp->member.member = id;
1477 exp->member.memberType = 0;
1478 exp->member.exp = QMkExpId("this");
1479 exp->addedThis = 0x1;
1480 }
1481 else if(_class && _class->templateParams.first)
1482 {
1483 struct __ecereNameSpace__ecere__com__Class * sClass;
1484
1485 for(sClass = _class; sClass; sClass = sClass->base)
1486 {
1487 if(sClass->templateParams.first)
1488 {
1489 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
1490
1491 for(param = sClass->templateParams.first; param; param = param->next)
1492 {
1493 if(param->type == 2 && !strcmp(param->name, id->string))
1494 {
1495 struct Expression * argExp = GetTemplateArgExpByName(param->name, _class, 2);
1496
1497 if(argExp)
1498 {
1499 struct Declarator * decl;
1500 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
1501
1502 FreeIdentifier(exp->member.member);
1503 ProcessExpressionType(argExp);
1504 decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
1505 exp->expType = ProcessType(specs, decl);
1506 exp->type = 5;
1507 exp->list = MkListOne(MkExpOp((((void *)0)), '*', MkExpCast(MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl)), MkExpOp((((void *)0)), '&', argExp))));
1508 }
1509 }
1510 }
1511 }
1512 }
1513 }
1514 }
1515 }
1516 }
1517
1518 extern int sprintf(char * , char * , ...);
1519
1520 extern int __ecereNameSpace__ecere__com__GetRuntimePlatform(void);
1521
1522 extern char *  __ecereNameSpace__ecere__sys__CopyString(char *  string);
1523
1524 char * PrintInt(long long result)
1525 {
1526 char temp[100];
1527
1528 if(result > (((long long)0x7fffffffffffffffLL)))
1529 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1530 else
1531 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "%I64dLL" : "%lldLL"), result);
1532 return __ecereNameSpace__ecere__sys__CopyString(temp);
1533 }
1534
1535 char * PrintUInt(uint64 result)
1536 {
1537 char temp[100];
1538
1539 if(result > (0xffffffff))
1540 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1541 else if(result > (((int)0x7fffffff)))
1542 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64X" : "0x%llX"), result);
1543 else
1544 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "%I64d" : "%lld"), result);
1545 return __ecereNameSpace__ecere__sys__CopyString(temp);
1546 }
1547
1548 char * PrintInt64(long long result)
1549 {
1550 char temp[100];
1551
1552 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "%I64dLL" : "%lldLL"), result);
1553 return __ecereNameSpace__ecere__sys__CopyString(temp);
1554 }
1555
1556 char * PrintUInt64(uint64 result)
1557 {
1558 char temp[100];
1559
1560 if(result > (((long long)0x7fffffffffffffffLL)))
1561 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1562 else
1563 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "%I64dLL" : "%lldLL"), result);
1564 return __ecereNameSpace__ecere__sys__CopyString(temp);
1565 }
1566
1567 char * PrintHexUInt(uint64 result)
1568 {
1569 char temp[100];
1570
1571 if(result > (0xffffffff))
1572 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1573 else
1574 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64X" : "0x%llX"), result);
1575 return __ecereNameSpace__ecere__sys__CopyString(temp);
1576 }
1577
1578 char * PrintHexUInt64(uint64 result)
1579 {
1580 char temp[100];
1581
1582 if(result > (0xffffffff))
1583 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1584 else
1585 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64X" : "0x%llX"), result);
1586 return __ecereNameSpace__ecere__sys__CopyString(temp);
1587 }
1588
1589 char * PrintShort(short result)
1590 {
1591 char temp[100];
1592
1593 sprintf(temp, "%d", (unsigned short)result);
1594 return __ecereNameSpace__ecere__sys__CopyString(temp);
1595 }
1596
1597 char * PrintUShort(unsigned short result)
1598 {
1599 char temp[100];
1600
1601 if(result > (unsigned short)32767)
1602 sprintf(temp, "0x%X", (int)result);
1603 else
1604 sprintf(temp, "%d", result);
1605 return __ecereNameSpace__ecere__sys__CopyString(temp);
1606 }
1607
1608 extern int isprint(int c);
1609
1610 char * PrintChar(char result)
1611 {
1612 char temp[100];
1613
1614 if(result > (char)0 && isprint(result))
1615 sprintf(temp, "'%c'", result);
1616 else if(result < (char)0)
1617 sprintf(temp, "%d", result);
1618 else
1619 sprintf(temp, "0x%X", (unsigned char)result);
1620 return __ecereNameSpace__ecere__sys__CopyString(temp);
1621 }
1622
1623 char * PrintUChar(unsigned char result)
1624 {
1625 char temp[100];
1626
1627 sprintf(temp, "0x%X", result);
1628 return __ecereNameSpace__ecere__sys__CopyString(temp);
1629 }
1630
1631 char * PrintFloat(float result)
1632 {
1633 char temp[100];
1634
1635 sprintf(temp, "%.16ff", result);
1636 return __ecereNameSpace__ecere__sys__CopyString(temp);
1637 }
1638
1639 char * PrintDouble(double result)
1640 {
1641 char temp[100];
1642
1643 sprintf(temp, "%.16f", result);
1644 return __ecereNameSpace__ecere__sys__CopyString(temp);
1645 }
1646
1647 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_OpTable;
1648
1649 struct OpTable
1650 {
1651 unsigned int (*  Add)(struct Expression *, struct Operand *, struct Operand *);
1652 unsigned int (*  Sub)(struct Expression *, struct Operand *, struct Operand *);
1653 unsigned int (*  Mul)(struct Expression *, struct Operand *, struct Operand *);
1654 unsigned int (*  Div)(struct Expression *, struct Operand *, struct Operand *);
1655 unsigned int (*  Mod)(struct Expression *, struct Operand *, struct Operand *);
1656 unsigned int (*  Neg)(struct Expression *, struct Operand *);
1657 unsigned int (*  Inc)(struct Expression *, struct Operand *);
1658 unsigned int (*  Dec)(struct Expression *, struct Operand *);
1659 unsigned int (*  Asign)(struct Expression *, struct Operand *, struct Operand *);
1660 unsigned int (*  AddAsign)(struct Expression *, struct Operand *, struct Operand *);
1661 unsigned int (*  SubAsign)(struct Expression *, struct Operand *, struct Operand *);
1662 unsigned int (*  MulAsign)(struct Expression *, struct Operand *, struct Operand *);
1663 unsigned int (*  DivAsign)(struct Expression *, struct Operand *, struct Operand *);
1664 unsigned int (*  ModAsign)(struct Expression *, struct Operand *, struct Operand *);
1665 unsigned int (*  BitAnd)(struct Expression *, struct Operand *, struct Operand *);
1666 unsigned int (*  BitOr)(struct Expression *, struct Operand *, struct Operand *);
1667 unsigned int (*  BitXor)(struct Expression *, struct Operand *, struct Operand *);
1668 unsigned int (*  LShift)(struct Expression *, struct Operand *, struct Operand *);
1669 unsigned int (*  RShift)(struct Expression *, struct Operand *, struct Operand *);
1670 unsigned int (*  BitNot)(struct Expression *, struct Operand *);
1671 unsigned int (*  AndAsign)(struct Expression *, struct Operand *, struct Operand *);
1672 unsigned int (*  OrAsign)(struct Expression *, struct Operand *, struct Operand *);
1673 unsigned int (*  XorAsign)(struct Expression *, struct Operand *, struct Operand *);
1674 unsigned int (*  LShiftAsign)(struct Expression *, struct Operand *, struct Operand *);
1675 unsigned int (*  RShiftAsign)(struct Expression *, struct Operand *, struct Operand *);
1676 unsigned int (*  Not)(struct Expression *, struct Operand *);
1677 unsigned int (*  Equ)(struct Expression *, struct Operand *, struct Operand *);
1678 unsigned int (*  Nqu)(struct Expression *, struct Operand *, struct Operand *);
1679 unsigned int (*  And)(struct Expression *, struct Operand *, struct Operand *);
1680 unsigned int (*  Or)(struct Expression *, struct Operand *, struct Operand *);
1681 unsigned int (*  Grt)(struct Expression *, struct Operand *, struct Operand *);
1682 unsigned int (*  Sma)(struct Expression *, struct Operand *, struct Operand *);
1683 unsigned int (*  GrtEqu)(struct Expression *, struct Operand *, struct Operand *);
1684 unsigned int (*  SmaEqu)(struct Expression *, struct Operand *, struct Operand *);
1685 unsigned int (*  Cond)(struct Expression *, struct Operand *, struct Operand *, struct Operand *);
1686 };
1687
1688 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Operand;
1689
1690 struct Operand
1691 {
1692 int kind;
1693 struct Type * type;
1694 unsigned int ptrSize;
1695 union
1696 {
1697 char c;
1698 unsigned char uc;
1699 short s;
1700 unsigned short us;
1701 int i;
1702 unsigned int ui;
1703 float f;
1704 double d;
1705 unsigned char *  p;
1706 long long i64;
1707 uint64 ui64;
1708 };
1709 struct OpTable ops;
1710 };
1711
1712 struct Operand GetOperand(struct Expression * exp);
1713
1714 unsigned int GetInt(struct Expression * exp, int * value2)
1715 {
1716 struct Operand op2 = GetOperand(exp);
1717
1718 if(op2.kind == 3 && op2.type->isSigned)
1719 *value2 = op2.i;
1720 else if(op2.kind == 3)
1721 *value2 = (int)op2.ui;
1722 if(op2.kind == 4 && op2.type->isSigned)
1723 *value2 = (int)op2.i64;
1724 else if(op2.kind == 4)
1725 *value2 = (int)op2.ui64;
1726 else if(op2.kind == 2 && op2.type->isSigned)
1727 *value2 = (int)op2.s;
1728 else if(op2.kind == 2)
1729 *value2 = (int)op2.us;
1730 else if(op2.kind == 1 && op2.type->isSigned)
1731 *value2 = (int)op2.c;
1732 else if(op2.kind == 1)
1733 *value2 = (int)op2.uc;
1734 else if(op2.kind == 6)
1735 *value2 = (int)op2.f;
1736 else if(op2.kind == 7)
1737 *value2 = (int)op2.d;
1738 else if(op2.kind == 13)
1739 *value2 = (int)op2.ui;
1740 else
1741 return 0x0;
1742 return 0x1;
1743 }
1744
1745 unsigned int GetUInt(struct Expression * exp, unsigned int * value2)
1746 {
1747 struct Operand op2 = GetOperand(exp);
1748
1749 if(op2.kind == 3 && op2.type->isSigned)
1750 *value2 = (unsigned int)op2.i;
1751 else if(op2.kind == 3)
1752 *value2 = op2.ui;
1753 if(op2.kind == 4 && op2.type->isSigned)
1754 *value2 = (unsigned int)op2.i64;
1755 else if(op2.kind == 4)
1756 *value2 = (unsigned int)op2.ui64;
1757 else if(op2.kind == 2 && op2.type->isSigned)
1758 *value2 = (unsigned int)op2.s;
1759 else if(op2.kind == 2)
1760 *value2 = (unsigned int)op2.us;
1761 else if(op2.kind == 1 && op2.type->isSigned)
1762 *value2 = (unsigned int)op2.c;
1763 else if(op2.kind == 1)
1764 *value2 = (unsigned int)op2.uc;
1765 else if(op2.kind == 6)
1766 *value2 = (unsigned int)op2.f;
1767 else if(op2.kind == 7)
1768 *value2 = (unsigned int)op2.d;
1769 else if(op2.kind == 13)
1770 *value2 = op2.ui;
1771 else
1772 return 0x0;
1773 return 0x1;
1774 }
1775
1776 unsigned int GetInt64(struct Expression * exp, long long * value2)
1777 {
1778 struct Operand op2 = GetOperand(exp);
1779
1780 if(op2.kind == 3 && op2.type->isSigned)
1781 *value2 = (long long)op2.i;
1782 else if(op2.kind == 3)
1783 *value2 = (long long)op2.ui;
1784 if(op2.kind == 4 && op2.type->isSigned)
1785 *value2 = op2.i64;
1786 else if(op2.kind == 4)
1787 *value2 = (long long)op2.ui64;
1788 else if(op2.kind == 2 && op2.type->isSigned)
1789 *value2 = (long long)op2.s;
1790 else if(op2.kind == 2)
1791 *value2 = (long long)op2.us;
1792 else if(op2.kind == 1 && op2.type->isSigned)
1793 *value2 = (long long)op2.c;
1794 else if(op2.kind == 1)
1795 *value2 = (long long)op2.uc;
1796 else if(op2.kind == 6)
1797 *value2 = (long long)op2.f;
1798 else if(op2.kind == 7)
1799 *value2 = (long long)op2.d;
1800 else if(op2.kind == 13)
1801 *value2 = (long long)op2.ui;
1802 else
1803 return 0x0;
1804 return 0x1;
1805 }
1806
1807 unsigned int GetUInt64(struct Expression * exp, uint64 * value2)
1808 {
1809 struct Operand op2 = GetOperand(exp);
1810
1811 if(op2.kind == 3 && op2.type->isSigned)
1812 *value2 = (uint64)op2.i;
1813 else if(op2.kind == 3)
1814 *value2 = (uint64)op2.ui;
1815 if(op2.kind == 4 && op2.type->isSigned)
1816 *value2 = (uint64)op2.i64;
1817 else if(op2.kind == 4)
1818 *value2 = op2.ui64;
1819 else if(op2.kind == 2 && op2.type->isSigned)
1820 *value2 = (uint64)op2.s;
1821 else if(op2.kind == 2)
1822 *value2 = (uint64)op2.us;
1823 else if(op2.kind == 1 && op2.type->isSigned)
1824 *value2 = (uint64)op2.c;
1825 else if(op2.kind == 1)
1826 *value2 = (uint64)op2.uc;
1827 else if(op2.kind == 6)
1828 *value2 = (uint64)op2.f;
1829 else if(op2.kind == 7)
1830 *value2 = (uint64)op2.d;
1831 else if(op2.kind == 13)
1832 *value2 = (uint64)op2.ui;
1833 else
1834 return 0x0;
1835 return 0x1;
1836 }
1837
1838 unsigned int GetShort(struct Expression * exp, short * value2)
1839 {
1840 struct Operand op2 = GetOperand(exp);
1841
1842 if(op2.kind == 3 && op2.type->isSigned)
1843 *value2 = (short)op2.i;
1844 else if(op2.kind == 3)
1845 *value2 = (short)op2.ui;
1846 if(op2.kind == 4 && op2.type->isSigned)
1847 *value2 = (short)op2.i64;
1848 else if(op2.kind == 4)
1849 *value2 = (short)op2.ui64;
1850 else if(op2.kind == 2 && op2.type->isSigned)
1851 *value2 = op2.s;
1852 else if(op2.kind == 2)
1853 *value2 = (short)op2.us;
1854 else if(op2.kind == 1 && op2.type->isSigned)
1855 *value2 = (short)op2.c;
1856 else if(op2.kind == 1)
1857 *value2 = (short)op2.uc;
1858 else if(op2.kind == 6)
1859 *value2 = (short)op2.f;
1860 else if(op2.kind == 7)
1861 *value2 = (short)op2.d;
1862 else if(op2.kind == 13)
1863 *value2 = (short)op2.ui;
1864 else
1865 return 0x0;
1866 return 0x1;
1867 }
1868
1869 unsigned int GetUShort(struct Expression * exp, unsigned short * value2)
1870 {
1871 struct Operand op2 = GetOperand(exp);
1872
1873 if(op2.kind == 3 && op2.type->isSigned)
1874 *value2 = (unsigned short)op2.i;
1875 else if(op2.kind == 3)
1876 *value2 = (unsigned short)op2.ui;
1877 if(op2.kind == 4 && op2.type->isSigned)
1878 *value2 = (unsigned short)op2.i64;
1879 else if(op2.kind == 4)
1880 *value2 = (unsigned short)op2.ui64;
1881 else if(op2.kind == 2 && op2.type->isSigned)
1882 *value2 = (unsigned short)op2.s;
1883 else if(op2.kind == 2)
1884 *value2 = op2.us;
1885 else if(op2.kind == 1 && op2.type->isSigned)
1886 *value2 = (unsigned short)op2.c;
1887 else if(op2.kind == 1)
1888 *value2 = (unsigned short)op2.uc;
1889 else if(op2.kind == 6)
1890 *value2 = (unsigned short)op2.f;
1891 else if(op2.kind == 7)
1892 *value2 = (unsigned short)op2.d;
1893 else if(op2.kind == 13)
1894 *value2 = (unsigned short)op2.ui;
1895 else
1896 return 0x0;
1897 return 0x1;
1898 }
1899
1900 unsigned int GetChar(struct Expression * exp, char * value2)
1901 {
1902 struct Operand op2 = GetOperand(exp);
1903
1904 if(op2.kind == 3 && op2.type->isSigned)
1905 *value2 = (char)op2.i;
1906 else if(op2.kind == 3)
1907 *value2 = (char)op2.ui;
1908 if(op2.kind == 4 && op2.type->isSigned)
1909 *value2 = (char)op2.i64;
1910 else if(op2.kind == 4)
1911 *value2 = (char)op2.ui64;
1912 else if(op2.kind == 2 && op2.type->isSigned)
1913 *value2 = (char)op2.s;
1914 else if(op2.kind == 2)
1915 *value2 = (char)op2.us;
1916 else if(op2.kind == 1 && op2.type->isSigned)
1917 *value2 = op2.c;
1918 else if(op2.kind == 1)
1919 *value2 = (char)op2.uc;
1920 else if(op2.kind == 6)
1921 *value2 = (char)op2.f;
1922 else if(op2.kind == 7)
1923 *value2 = (char)op2.d;
1924 else if(op2.kind == 13)
1925 *value2 = (char)op2.ui;
1926 else
1927 return 0x0;
1928 return 0x1;
1929 }
1930
1931 unsigned int GetUChar(struct Expression * exp, unsigned char * value2)
1932 {
1933 struct Operand op2 = GetOperand(exp);
1934
1935 if(op2.kind == 3 && op2.type->isSigned)
1936 *value2 = (unsigned char)op2.i;
1937 else if(op2.kind == 3)
1938 *value2 = (unsigned char)op2.ui;
1939 if(op2.kind == 4 && op2.type->isSigned)
1940 *value2 = (unsigned char)op2.i64;
1941 else if(op2.kind == 4)
1942 *value2 = (unsigned char)op2.ui64;
1943 else if(op2.kind == 2 && op2.type->isSigned)
1944 *value2 = (unsigned char)op2.s;
1945 else if(op2.kind == 2)
1946 *value2 = (unsigned char)op2.us;
1947 else if(op2.kind == 1 && op2.type->isSigned)
1948 *value2 = (unsigned char)op2.c;
1949 else if(op2.kind == 1)
1950 *value2 = op2.uc;
1951 else if(op2.kind == 6)
1952 *value2 = (unsigned char)op2.f;
1953 else if(op2.kind == 7)
1954 *value2 = (unsigned char)op2.d;
1955 else if(op2.kind == 13)
1956 *value2 = (unsigned char)op2.ui;
1957 else
1958 return 0x0;
1959 return 0x1;
1960 }
1961
1962 unsigned int GetFloat(struct Expression * exp, float * value2)
1963 {
1964 struct Operand op2 = GetOperand(exp);
1965
1966 if(op2.kind == 3 && op2.type->isSigned)
1967 *value2 = (float)(float)op2.i;
1968 else if(op2.kind == 3)
1969 *value2 = (float)(float)op2.ui;
1970 if(op2.kind == 4 && op2.type->isSigned)
1971 *value2 = (float)(float)op2.i64;
1972 else if(op2.kind == 4)
1973 *value2 = (float)(float)op2.ui64;
1974 else if(op2.kind == 2 && op2.type->isSigned)
1975 *value2 = (float)(float)op2.s;
1976 else if(op2.kind == 2)
1977 *value2 = (float)(float)op2.us;
1978 else if(op2.kind == 1 && op2.type->isSigned)
1979 *value2 = (float)(float)op2.c;
1980 else if(op2.kind == 1)
1981 *value2 = (float)(float)op2.uc;
1982 else if(op2.kind == 6)
1983 *value2 = (float)op2.f;
1984 else if(op2.kind == 7)
1985 *value2 = (float)op2.d;
1986 else if(op2.kind == 13)
1987 *value2 = (float)(float)op2.ui;
1988 else
1989 return 0x0;
1990 return 0x1;
1991 }
1992
1993 unsigned int GetDouble(struct Expression * exp, double * value2)
1994 {
1995 struct Operand op2 = GetOperand(exp);
1996
1997 if(op2.kind == 3 && op2.type->isSigned)
1998 *value2 = (double)(double)op2.i;
1999 else if(op2.kind == 3)
2000 *value2 = (double)(double)op2.ui;
2001 if(op2.kind == 4 && op2.type->isSigned)
2002 *value2 = (double)(double)op2.i64;
2003 else if(op2.kind == 4)
2004 *value2 = (double)(double)op2.ui64;
2005 else if(op2.kind == 2 && op2.type->isSigned)
2006 *value2 = (double)(double)op2.s;
2007 else if(op2.kind == 2)
2008 *value2 = (double)(double)op2.us;
2009 else if(op2.kind == 1 && op2.type->isSigned)
2010 *value2 = (double)(double)op2.c;
2011 else if(op2.kind == 1)
2012 *value2 = (double)(double)op2.uc;
2013 else if(op2.kind == 6)
2014 *value2 = (double)op2.f;
2015 else if(op2.kind == 7)
2016 *value2 = (double)op2.d;
2017 else if(op2.kind == 13)
2018 *value2 = (double)(double)op2.ui;
2019 else
2020 return 0x0;
2021 return 0x1;
2022 }
2023
2024 void ComputeExpression(struct Expression * exp);
2025
2026 struct Context * SetupTemplatesContext(struct __ecereNameSpace__ecere__com__Class * _class);
2027
2028 int ComputeTypeSize(struct Type * type);
2029
2030 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__BitMember;
2031
2032 struct __ecereNameSpace__ecere__com__BitMember
2033 {
2034 struct __ecereNameSpace__ecere__com__BitMember * prev;
2035 struct __ecereNameSpace__ecere__com__BitMember * next;
2036 char *  name;
2037 unsigned int isProperty;
2038 int memberAccess;
2039 int id;
2040 struct __ecereNameSpace__ecere__com__Class * _class;
2041 char *  dataTypeString;
2042 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
2043 struct Type * dataType;
2044 int type;
2045 int size;
2046 int pos;
2047 uint64 mask;
2048 };
2049
2050 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__OldLink;
2051
2052 struct __ecereNameSpace__ecere__sys__OldLink
2053 {
2054 struct __ecereNameSpace__ecere__sys__OldLink * prev;
2055 struct __ecereNameSpace__ecere__sys__OldLink * next;
2056 void *  data;
2057 };
2058
2059 void FinishTemplatesContext(struct Context * context);
2060
2061 void ComputeClassMembers(struct __ecereNameSpace__ecere__com__Class * _class, unsigned int isMember)
2062 {
2063 struct __ecereNameSpace__ecere__com__DataMember * member = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
2064 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
2065
2066 if(member || ((_class->type == 2 || _class->type == 0 || _class->type == 1 || _class->type == 5) && (_class->type == 2 || _class->structSize == _class->offset) && _class->computeSize))
2067 {
2068 int c;
2069 int unionMemberOffset = 0;
2070 int bitFields = 0;
2071
2072 if(!member && _class->destructionWatchOffset)
2073 _class->memberOffset += sizeof(struct __ecereNameSpace__ecere__sys__OldList);
2074 {
2075 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
2076
2077 for(dataMember = member ? member->members.first : _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
2078 {
2079 if(!dataMember->isProperty)
2080 {
2081 if(dataMember->type == 0 && dataMember->dataTypeString && !dataMember->dataType)
2082 {
2083 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
2084 }
2085 }
2086 }
2087 }
2088 {
2089 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
2090
2091 for(dataMember = member ? member->members.first : _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
2092 {
2093 if(!dataMember->isProperty && (dataMember->type != 0 || dataMember->dataTypeString))
2094 {
2095 if(!isMember && _class->type == 2 && dataMember->dataType)
2096 {
2097 struct __ecereNameSpace__ecere__com__BitMember * bitMember = (struct __ecereNameSpace__ecere__com__BitMember *)dataMember;
2098 uint64 mask = 0;
2099 int d;
2100
2101 ComputeTypeSize(dataMember->dataType);
2102 if(bitMember->pos == -1)
2103 bitMember->pos = _class->memberOffset;
2104 if(!bitMember->size)
2105 bitMember->size = dataMember->dataType->size * 8;
2106 _class->memberOffset = bitMember->pos + bitMember->size;
2107 for(d = 0; d < bitMember->size; d++)
2108 {
2109 if(d)
2110 mask <<= 1;
2111 mask |= 1;
2112 }
2113 bitMember->mask = mask << bitMember->pos;
2114 }
2115 else if(dataMember->type == 0 && dataMember->dataType)
2116 {
2117 int size;
2118 int alignment = 0;
2119
2120 if(dataMember->dataType->kind != 8 || ((!dataMember->dataType->_class || !dataMember->dataType->_class->registered || dataMember->dataType->_class->registered != _class || _class->type != 1)))
2121 ComputeTypeSize(dataMember->dataType);
2122 if(dataMember->dataType->bitFieldCount)
2123 {
2124 bitFields += dataMember->dataType->bitFieldCount;
2125 size = 0;
2126 }
2127 else
2128 {
2129 if(bitFields)
2130 {
2131 int size = (bitFields + 7) / 8;
2132
2133 if(isMember)
2134 {
2135 int __simpleStruct0;
2136
2137 if(alignment)
2138 {
2139 int __simpleStruct0;
2140
2141 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2142 if(member->memberOffset % alignment)
2143 member->memberOffset += alignment - (member->memberOffset % alignment);
2144 }
2145 dataMember->offset = member->memberOffset;
2146 if(member->type == 1)
2147 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2148 else
2149 {
2150 member->memberOffset += size;
2151 }
2152 }
2153 else
2154 {
2155 if(alignment)
2156 {
2157 int __simpleStruct0;
2158
2159 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2160 if(_class->memberOffset % alignment)
2161 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2162 }
2163 dataMember->offset = _class->memberOffset;
2164 _class->memberOffset += size;
2165 }
2166 bitFields = 0;
2167 }
2168 size = dataMember->dataType->size;
2169 alignment = dataMember->dataType->alignment;
2170 }
2171 if(isMember)
2172 {
2173 int __simpleStruct0;
2174
2175 if(alignment)
2176 {
2177 int __simpleStruct0;
2178
2179 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2180 if(member->memberOffset % alignment)
2181 member->memberOffset += alignment - (member->memberOffset % alignment);
2182 }
2183 dataMember->offset = member->memberOffset;
2184 if(member->type == 1)
2185 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2186 else
2187 {
2188 member->memberOffset += size;
2189 }
2190 }
2191 else
2192 {
2193 if(alignment)
2194 {
2195 int __simpleStruct0;
2196
2197 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2198 if(_class->memberOffset % alignment)
2199 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2200 }
2201 dataMember->offset = _class->memberOffset;
2202 _class->memberOffset += size;
2203 }
2204 }
2205 else
2206 {
2207 ComputeClassMembers((struct __ecereNameSpace__ecere__com__Class *)dataMember, 0x1);
2208 if(isMember)
2209 {
2210 int __simpleStruct2;
2211 int __simpleStruct0, __simpleStruct1;
2212
2213 member->structAlignment = (__simpleStruct0 = member->structAlignment, __simpleStruct1 = dataMember->structAlignment, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
2214 dataMember->offset = member->memberOffset;
2215 if(member->type == 1)
2216 unionMemberOffset = (__simpleStruct2 = dataMember->memberOffset, (unionMemberOffset > __simpleStruct2) ? unionMemberOffset : __simpleStruct2);
2217 else
2218 member->memberOffset += dataMember->memberOffset;
2219 }
2220 else
2221 {
2222 int __simpleStruct0, __simpleStruct1;
2223
2224 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, __simpleStruct1 = dataMember->structAlignment, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
2225 dataMember->offset = _class->memberOffset;
2226 _class->memberOffset += dataMember->memberOffset;
2227 }
2228 }
2229 }
2230 }
2231 if(bitFields)
2232 {
2233 int alignment = 0;
2234 int size = (bitFields + 7) / 8;
2235
2236 if(isMember)
2237 {
2238 int __simpleStruct0;
2239
2240 if(alignment)
2241 {
2242 int __simpleStruct0;
2243
2244 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2245 if(member->memberOffset % alignment)
2246 member->memberOffset += alignment - (member->memberOffset % alignment);
2247 }
2248 if(member->type == 1)
2249 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2250 else
2251 {
2252 member->memberOffset += size;
2253 }
2254 }
2255 else
2256 {
2257 if(alignment)
2258 {
2259 int __simpleStruct0;
2260
2261 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2262 if(_class->memberOffset % alignment)
2263 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2264 }
2265 _class->memberOffset += size;
2266 }
2267 bitFields = 0;
2268 }
2269 }
2270 if(member && member->type == 1)
2271 {
2272 member->memberOffset = unionMemberOffset;
2273 }
2274 if(!isMember)
2275 {
2276 if(_class->type != 2)
2277 {
2278 _class->structSize = (_class->base ? (_class->base->templateClass ? _class->base->templateClass->structSize : _class->base->structSize) : 0) + _class->memberOffset;
2279 if(!member)
2280 {
2281 struct __ecereNameSpace__ecere__com__Property * prop;
2282
2283 for(prop = _class->membersAndProperties.first; prop; prop = prop->next)
2284 {
2285 if(prop->isProperty && prop->isWatchable)
2286 {
2287 prop->watcherOffset = _class->structSize;
2288 _class->structSize += sizeof(struct __ecereNameSpace__ecere__sys__OldList);
2289 }
2290 }
2291 }
2292 {
2293 struct __ecereNameSpace__ecere__sys__OldLink * derivative;
2294
2295 for(derivative = _class->derivatives.first; derivative; derivative = derivative->next)
2296 {
2297 struct __ecereNameSpace__ecere__com__Class * deriv = derivative->data;
2298
2299 if(deriv->computeSize)
2300 {
2301 deriv->offset = _class->structSize;
2302 deriv->memberOffset = 0;
2303 deriv->structSize = deriv->offset;
2304 ComputeClassMembers(deriv, 0x0);
2305 }
2306 }
2307 }
2308 }
2309 }
2310 }
2311 if(context)
2312 FinishTemplatesContext(context);
2313 }
2314
2315 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__NameSpace;
2316
2317 struct __ecereNameSpace__ecere__com__NameSpace
2318 {
2319 char *  name;
2320 struct __ecereNameSpace__ecere__com__NameSpace *  btParent;
2321 struct __ecereNameSpace__ecere__com__NameSpace *  left;
2322 struct __ecereNameSpace__ecere__com__NameSpace *  right;
2323 int depth;
2324 struct __ecereNameSpace__ecere__com__NameSpace *  parent;
2325 struct __ecereNameSpace__ecere__sys__BinaryTree nameSpaces;
2326 struct __ecereNameSpace__ecere__sys__BinaryTree classes;
2327 struct __ecereNameSpace__ecere__sys__BinaryTree defines;
2328 struct __ecereNameSpace__ecere__sys__BinaryTree functions;
2329 };
2330
2331 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Module;
2332
2333 struct __ecereNameSpace__ecere__com__Module
2334 {
2335 struct __ecereNameSpace__ecere__com__Instance * application;
2336 struct __ecereNameSpace__ecere__sys__OldList classes;
2337 struct __ecereNameSpace__ecere__sys__OldList defines;
2338 struct __ecereNameSpace__ecere__sys__OldList functions;
2339 struct __ecereNameSpace__ecere__sys__OldList modules;
2340 struct __ecereNameSpace__ecere__com__Instance * prev;
2341 struct __ecereNameSpace__ecere__com__Instance * next;
2342 char *  name;
2343 void *  library;
2344 void *  Unload;
2345 int importType;
2346 struct __ecereNameSpace__ecere__com__NameSpace privateNameSpace;
2347 struct __ecereNameSpace__ecere__com__NameSpace publicNameSpace;
2348 };
2349
2350 void ComputeModuleClasses(struct __ecereNameSpace__ecere__com__Instance * module)
2351 {
2352 struct __ecereNameSpace__ecere__com__Class * _class;
2353 struct __ecereNameSpace__ecere__sys__OldLink * subModule;
2354
2355 for(subModule = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + 12)))->modules.first; subModule; subModule = subModule->next)
2356 ComputeModuleClasses(subModule->data);
2357 for(_class = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + 12)))->classes.first; _class; _class = _class->next)
2358 ComputeClassMembers(_class, 0x0);
2359 }
2360
2361 extern unsigned int inCompiler;
2362
2363 extern void Compiler_Error(char *  format, ...);
2364
2365 extern char *  __ecereNameSpace__ecere__GetTranslatedString(struct __ecereNameSpace__ecere__com__Instance * module, char *  string, char *  stringAndContext);
2366
2367 extern struct __ecereNameSpace__ecere__com__Instance * __thisModule;
2368
2369 extern int __ecereNameSpace__ecere__com__eClass_GetProperty(struct __ecereNameSpace__ecere__com__Class * _class, char *  name);
2370
2371 int ComputeTypeSize(struct Type * type)
2372 {
2373 unsigned int size = type ? type->size : 0;
2374
2375 if(!size && type && !type->computing)
2376 {
2377 type->computing = 0x1;
2378 switch(type->kind)
2379 {
2380 case 1:
2381 type->alignment = size = sizeof(char);
2382 break;
2383 case 3:
2384 type->alignment = size = sizeof(int);
2385 break;
2386 case 4:
2387 type->alignment = size = sizeof(long long);
2388 break;
2389 case 5:
2390 type->alignment = size = sizeof(long);
2391 break;
2392 case 2:
2393 type->alignment = size = sizeof(short);
2394 break;
2395 case 6:
2396 type->alignment = size = sizeof(float);
2397 break;
2398 case 7:
2399 type->alignment = size = sizeof(double);
2400 break;
2401 case 8:
2402 {
2403 struct __ecereNameSpace__ecere__com__Class * _class = type->_class ? type->_class->registered : (((void *)0));
2404
2405 if(_class && _class->type == 1)
2406 {
2407 ComputeClassMembers(_class, 0x0);
2408 type->alignment = _class->structAlignment;
2409 size = _class->structSize;
2410 if(type->alignment && size % type->alignment)
2411 size += type->alignment - (size % type->alignment);
2412 }
2413 else if(_class && (_class->type == 3 || _class->type == 4 || _class->type == 2))
2414 {
2415 if(!_class->dataType)
2416 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
2417 size = type->alignment = ComputeTypeSize(_class->dataType);
2418 }
2419 else
2420 size = type->alignment = sizeof(struct __ecereNameSpace__ecere__com__Instance **);
2421 break;
2422 }
2423 case 13:
2424 case 19:
2425 size = type->alignment = sizeof(void *);
2426 break;
2427 case 12:
2428 if(type->arraySizeExp)
2429 {
2430 ProcessExpressionType(type->arraySizeExp);
2431 ComputeExpression(type->arraySizeExp);
2432 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)))
2433 {
2434 struct Location oldLoc = yylloc;
2435 char expression[10240];
2436
2437 expression[0] = '\0';
2438 type->arraySizeExp->expType = (((void *)0));
2439 yylloc = type->arraySizeExp->loc;
2440 if(inCompiler)
2441 PrintExpression(type->arraySizeExp, expression);
2442 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Array size not constant int (%s)\n", (((void *)0))), expression);
2443 yylloc = oldLoc;
2444 }
2445 GetInt(type->arraySizeExp, &type->arraySize);
2446 }
2447 else if(type->enumClass)
2448 {
2449 if(type->enumClass && type->enumClass->registered && type->enumClass->registered->type == 4)
2450 {
2451 type->arraySize = __ecereNameSpace__ecere__com__eClass_GetProperty(type->enumClass->registered, "enumSize");
2452 }
2453 else
2454 type->arraySize = 0;
2455 }
2456 else
2457 {
2458 type->arraySize = 0;
2459 }
2460 size = ComputeTypeSize(type->type) * type->arraySize;
2461 type->alignment = type->type->alignment;
2462 break;
2463 case 9:
2464 {
2465 struct Type * member;
2466
2467 for(member = type->members.first; member; member = member->next)
2468 {
2469 int __simpleStruct0, __simpleStruct1;
2470 unsigned int addSize = ComputeTypeSize(member);
2471
2472 member->offset = size;
2473 if(member->alignment && size % member->alignment)
2474 member->offset += member->alignment - (size % member->alignment);
2475 size = member->offset;
2476 type->alignment = (__simpleStruct0 = type->alignment, __simpleStruct1 = member->alignment, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
2477 size += addSize;
2478 }
2479 if(type->alignment && size % type->alignment)
2480 size += type->alignment - (size % type->alignment);
2481 break;
2482 }
2483 case 10:
2484 {
2485 struct Type * member;
2486
2487 for(member = type->members.first; member; member = member->next)
2488 {
2489 int __simpleStruct0, __simpleStruct1;
2490 unsigned int addSize = ComputeTypeSize(member);
2491
2492 member->offset = size;
2493 if(member->alignment && size % member->alignment)
2494 member->offset += member->alignment - (size % member->alignment);
2495 size = member->offset;
2496 type->alignment = (__simpleStruct0 = type->alignment, __simpleStruct1 = member->alignment, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
2497 size = ((size > addSize) ? size : addSize);
2498 }
2499 if(type->alignment && size % type->alignment)
2500 size += type->alignment - (size % type->alignment);
2501 break;
2502 }
2503 case 20:
2504 {
2505 struct TemplateParameter * param = type->templateParameter;
2506 struct Type * baseType = ProcessTemplateParameterType(param);
2507
2508 if(baseType)
2509 size = ComputeTypeSize(baseType);
2510 else
2511 size = sizeof(uint64);
2512 break;
2513 }
2514 case 15:
2515 {
2516 size = sizeof(enum
2517 {
2518 test
2519 });
2520 break;
2521 }
2522 case 21:
2523 {
2524 size = sizeof(void *);
2525 break;
2526 }
2527 }
2528 type->size = size;
2529 type->computing = 0x0;
2530 }
2531 return size;
2532 }
2533
2534 extern struct Declarator * MkDeclaratorIdentifier(struct Identifier * id);
2535
2536 extern struct Identifier * MkIdentifier(char *  string);
2537
2538 extern void ListAdd(struct __ecereNameSpace__ecere__sys__OldList * list, void *  item);
2539
2540 extern struct Declarator * MkStructDeclarator(struct Declarator * declarator, struct Expression * exp);
2541
2542 extern struct ClassDef * MkClassDefDeclaration(struct Declaration * decl);
2543
2544 extern struct Declaration * MkStructDeclaration(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct __ecereNameSpace__ecere__sys__OldList * declarators, struct Specifier * extStorage);
2545
2546 void ReplaceThisClassSpecifiers(struct __ecereNameSpace__ecere__sys__OldList * specs, struct __ecereNameSpace__ecere__com__Class * _class);
2547
2548 static void DeclareType(struct Type * type, unsigned int declarePointers, unsigned int declareParams);
2549
2550 extern void FreeType(struct Type * type);
2551
2552 extern struct Specifier * MkStructOrUnion(int type, struct Identifier * id, struct __ecereNameSpace__ecere__sys__OldList * definitions);
2553
2554 extern struct Specifier * MkSpecifier(int specifier);
2555
2556 extern struct Declarator * MkDeclaratorArray(struct Declarator * declarator, struct Expression * exp);
2557
2558 extern struct Expression * MkExpConstant(char *  string);
2559
2560 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)
2561 {
2562 struct __ecereNameSpace__ecere__com__DataMember * topMember = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
2563 unsigned int totalSize = 0;
2564 unsigned int maxSize = 0;
2565 int alignment, size;
2566 struct __ecereNameSpace__ecere__com__DataMember * member;
2567 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
2568
2569 if(!isMember && _class->base)
2570 {
2571 maxSize = _class->structSize;
2572 {
2573 if(_class->type == 1 || _class->type == 5)
2574 AddMembers(declarations, _class->base, 0x0, &totalSize, topClass);
2575 else
2576 maxSize -= _class->base->templateClass ? _class->base->templateClass->structSize : _class->base->structSize;
2577 }
2578 }
2579 for(member = isMember ? topMember->members.first : _class->membersAndProperties.first; member; member = member->next)
2580 {
2581 if(!member->isProperty)
2582 {
2583 switch(member->type)
2584 {
2585 case 0:
2586 {
2587 if(member->dataTypeString)
2588 {
2589 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList(), * decls = MkList();
2590 struct Declarator * decl;
2591
2592 decl = SpecDeclFromString(member->dataTypeString, specs, MkDeclaratorIdentifier(MkIdentifier(member->name)));
2593 ListAdd(decls, MkStructDeclarator(decl, (((void *)0))));
2594 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(specs, decls, (((void *)0)))));
2595 if(!member->dataType)
2596 member->dataType = ProcessType(specs, decl);
2597 ReplaceThisClassSpecifiers(specs, topClass);
2598 {
2599 struct Type * type = ProcessType(specs, decl);
2600
2601 DeclareType(member->dataType, 0x0, 0x0);
2602 FreeType(type);
2603 }
2604 ComputeTypeSize(member->dataType);
2605 size = member->dataType->size;
2606 alignment = member->dataType->alignment;
2607 if(alignment)
2608 {
2609 if(totalSize % alignment)
2610 totalSize += alignment - (totalSize % alignment);
2611 }
2612 totalSize += size;
2613 }
2614 break;
2615 }
2616 case 1:
2617 case 2:
2618 {
2619 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList(), * list = MkList();
2620
2621 size = 0;
2622 AddMembers(list, (struct __ecereNameSpace__ecere__com__Class *)member, 0x1, &size, topClass);
2623 ListAdd(specs, MkStructOrUnion((member->type == 1) ? 4 : 3, (((void *)0)), list));
2624 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(specs, (((void *)0)), (((void *)0)))));
2625 alignment = member->structAlignment;
2626 if(alignment)
2627 {
2628 if(totalSize % alignment)
2629 totalSize += alignment - (totalSize % alignment);
2630 }
2631 totalSize += size;
2632 break;
2633 }
2634 }
2635 }
2636 }
2637 if(retSize)
2638 {
2639 unsigned int __simpleStruct0;
2640
2641 if(topMember && topMember->type == 1)
2642 *retSize = (__simpleStruct0 = *retSize, (__simpleStruct0 > totalSize) ? __simpleStruct0 : totalSize);
2643 else
2644 *retSize += totalSize;
2645 }
2646 else if(totalSize < maxSize && _class->type != 1000)
2647 {
2648 char sizeString[50];
2649
2650 sprintf(sizeString, "%d", maxSize - totalSize);
2651 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(CHAR)), MkListOne(MkDeclaratorArray(MkDeclaratorIdentifier(MkIdentifier("__ecere_padding")), MkExpConstant(sizeString))), (((void *)0)))));
2652 }
2653 if(context)
2654 FinishTemplatesContext(context);
2655 return topMember ? topMember->memberID : _class->memberID;
2656 }
2657
2658 static int DeclareMembers(struct __ecereNameSpace__ecere__com__Class * _class, unsigned int isMember)
2659 {
2660 struct __ecereNameSpace__ecere__com__DataMember * topMember = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
2661 unsigned int totalSize = 0;
2662 struct __ecereNameSpace__ecere__com__DataMember * member;
2663 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
2664
2665 if(!isMember && (_class->type == 1 || _class->type == 5) && _class->base->type != 1000)
2666 DeclareMembers(_class->base, 0x0);
2667 for(member = isMember ? topMember->members.first : _class->membersAndProperties.first; member; member = member->next)
2668 {
2669 if(!member->isProperty)
2670 {
2671 switch(member->type)
2672 {
2673 case 0:
2674 {
2675 if(!member->dataType && member->dataTypeString)
2676 member->dataType = ProcessTypeString(member->dataTypeString, 0x0);
2677 if(member->dataType)
2678 DeclareType(member->dataType, 0x0, 0x0);
2679 break;
2680 }
2681 case 1:
2682 case 2:
2683 {
2684 DeclareMembers((struct __ecereNameSpace__ecere__com__Class *)member, 0x1);
2685 break;
2686 }
2687 }
2688 }
2689 }
2690 if(context)
2691 FinishTemplatesContext(context);
2692 return topMember ? topMember->memberID : _class->memberID;
2693 }
2694
2695 extern struct Symbol * FindClass(char *  name);
2696
2697 extern char *  strchr(char * , int);
2698
2699 extern void FullClassNameCat(char *  output, char *  className, unsigned int includeTemplateParams);
2700
2701 extern void FreeList(struct __ecereNameSpace__ecere__sys__OldList * list, void (* )(void * ));
2702
2703 extern struct External * MkExternalDeclaration(struct Declaration * declaration);
2704
2705 extern struct Declaration * MkDeclaration(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct __ecereNameSpace__ecere__sys__OldList * initDeclarators);
2706
2707 extern char *  strcpy(char * , const char * );
2708
2709 extern void MangleClassName(char *  className);
2710
2711 extern void DeclareClass(struct Symbol * classSym, char *  className);
2712
2713 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move(struct __ecereNameSpace__ecere__sys__OldList * this, void *  item, void *  prevItem);
2714
2715 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(struct __ecereNameSpace__ecere__sys__OldList * this, void *  prevItem, void *  item);
2716
2717 void DeclareStruct(char * name, unsigned int skipNoHead)
2718 {
2719 struct External * external = (((void *)0));
2720 struct Symbol * classSym = FindClass(name);
2721
2722 if(!inCompiler || !classSym)
2723 return (((void *)0));
2724 if(classSym->registered && (classSym->registered->type == 2 || classSym->registered->type == 3 || classSym->registered->type == 4))
2725 return (((void *)0));
2726 if(classSym->registered && classSym->imported && !classSym->declaredStructSym)
2727 {
2728 struct Declaration * decl;
2729 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
2730 struct __ecereNameSpace__ecere__sys__OldList * declarations = (((void *)0));
2731 char structName[1024];
2732
2733 external = (classSym->registered && classSym->registered->type == 1) ? classSym->pointerExternal : classSym->structExternal;
2734 classSym->declaring++;
2735 if(strchr(classSym->string, '<'))
2736 {
2737 if(classSym->registered->templateClass)
2738 {
2739 DeclareStruct(classSym->registered->templateClass->fullName, skipNoHead);
2740 classSym->declaring--;
2741 }
2742 return (((void *)0));
2743 }
2744 DeclareMembers(classSym->registered, 0x0);
2745 structName[0] = (char)0;
2746 FullClassNameCat(structName, name, 0x0);
2747 if(!skipNoHead)
2748 {
2749 classSym->declaredStructSym = 0x1;
2750 declarations = MkList();
2751 AddMembers(declarations, classSym->registered, 0x0, (((void *)0)), classSym->registered);
2752 if(!(*declarations).count)
2753 {
2754 FreeList(declarations, (((void *)0)));
2755 declarations = (((void *)0));
2756 }
2757 }
2758 if(skipNoHead || declarations)
2759 {
2760 if(external && external->declaration)
2761 {
2762 ((struct Specifier *)(*external->declaration->specifiers).first)->definitions = declarations;
2763 if(curExternal && curExternal->symbol && curExternal->symbol->idCode < classSym->id)
2764 {
2765 if(classSym->structExternal)
2766 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->structExternal, curExternal->prev);
2767 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->pointerExternal, curExternal->prev);
2768 classSym->id = curExternal->symbol->idCode;
2769 classSym->idCode = curExternal->symbol->idCode;
2770 }
2771 }
2772 else
2773 {
2774 if(!external)
2775 external = MkExternalDeclaration((((void *)0)));
2776 specifiers = MkList();
2777 declarators = MkList();
2778 ListAdd(specifiers, MkStructOrUnion(3, MkIdentifier(structName), declarations));
2779 external->declaration = decl = MkDeclaration(specifiers, declarators);
2780 if(decl->symbol && !decl->symbol->pointerExternal)
2781 decl->symbol->pointerExternal = external;
2782 if(classSym->registered && classSym->registered->type == 1)
2783 {
2784 char className[1024];
2785
2786 strcpy(className, "__ecereClass_");
2787 FullClassNameCat(className, classSym->string, 0x1);
2788 MangleClassName(className);
2789 DeclareClass(classSym, className);
2790 external->symbol = classSym;
2791 classSym->pointerExternal = external;
2792 classSym->id = (curExternal && curExternal->symbol) ? curExternal->symbol->idCode : 0;
2793 classSym->idCode = (curExternal && curExternal->symbol) ? curExternal->symbol->idCode : 0;
2794 }
2795 else
2796 {
2797 char className[1024];
2798
2799 strcpy(className, "__ecereClass_");
2800 FullClassNameCat(className, classSym->string, 0x1);
2801 MangleClassName(className);
2802 classSym->structExternal = external;
2803 DeclareClass(classSym, className);
2804 external->symbol = classSym;
2805 }
2806 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal ? curExternal->prev : (((void *)0)), external);
2807 }
2808 }
2809 classSym->declaring--;
2810 }
2811 else if(curExternal && curExternal->symbol && curExternal->symbol->idCode < classSym->id)
2812 {
2813 classSym->declaring++;
2814 {
2815 if(classSym->registered)
2816 DeclareMembers(classSym->registered, 0x0);
2817 }
2818 if(classSym->registered && (classSym->registered->type == 1 || classSym->registered->type == 5))
2819 {
2820 if(classSym->structExternal)
2821 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->structExternal, curExternal->prev);
2822 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->pointerExternal, curExternal->prev);
2823 classSym->id = curExternal->symbol->idCode;
2824 classSym->idCode = curExternal->symbol->idCode;
2825 }
2826 classSym->declaring--;
2827 }
2828 }
2829
2830 extern char *  strcat(char * , const char * );
2831
2832 extern struct ModuleImport * FindModule(struct __ecereNameSpace__ecere__com__Instance * moduleToFind);
2833
2834 extern struct ModuleImport * mainModule;
2835
2836 extern struct Specifier * MkSpecifierName(char *  name);
2837
2838 extern struct Declarator * MkDeclaratorBrackets(struct Declarator * declarator);
2839
2840 extern struct Declarator * PlugDeclarator(struct Declarator * decl, struct Declarator * baseDecl);
2841
2842 extern struct Declarator * MkDeclaratorFunction(struct Declarator * declarator, struct __ecereNameSpace__ecere__sys__OldList * parameters);
2843
2844 extern struct InitDeclarator * MkInitDeclarator(struct Declarator * declarator, struct Initializer * initializer);
2845
2846 extern void FreeDeclarator(struct Declarator * decl);
2847
2848 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_PropertyImport;
2849
2850 struct PropertyImport
2851 {
2852 struct PropertyImport * prev;
2853 struct PropertyImport * next;
2854 char *  name;
2855 unsigned int isVirtual;
2856 unsigned int hasSet;
2857 unsigned int hasGet;
2858 };
2859
2860 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(struct __ecereNameSpace__ecere__sys__OldList * this, void *  item);
2861
2862 void DeclareProperty(struct __ecereNameSpace__ecere__com__Property * prop, char * setName, char * getName)
2863 {
2864 void * __ecereTemp1;
2865 struct Symbol * symbol = prop->symbol;
2866 char propName[1024];
2867
2868 strcpy(setName, "__ecereProp_");
2869 FullClassNameCat(setName, prop->_class->fullName, 0x0);
2870 strcat(setName, "_Set_");
2871 FullClassNameCat(setName, prop->name, 0x1);
2872 strcpy(getName, "__ecereProp_");
2873 FullClassNameCat(getName, prop->_class->fullName, 0x0);
2874 strcat(getName, "_Get_");
2875 FullClassNameCat(getName, prop->name, 0x1);
2876 strcpy(propName, "__ecereProp_");
2877 FullClassNameCat(propName, prop->_class->fullName, 0x0);
2878 strcat(propName, "_");
2879 FullClassNameCat(propName, prop->name, 0x1);
2880 MangleClassName(getName);
2881 MangleClassName(setName);
2882 MangleClassName(propName);
2883 if(prop->_class->type == 1)
2884 DeclareStruct(prop->_class->fullName, 0x0);
2885 if(!symbol || curExternal->symbol->idCode < symbol->id)
2886 {
2887 unsigned int imported = 0x0;
2888 unsigned int dllImport = 0x0;
2889
2890 if(!symbol || symbol->_import)
2891 {
2892 if(!symbol)
2893 {
2894 struct Symbol * classSym;
2895
2896 if(!prop->_class->symbol)
2897 prop->_class->symbol = FindClass(prop->_class->fullName);
2898 classSym = prop->_class->symbol;
2899 if(classSym && !classSym->_import)
2900 {
2901 struct ModuleImport * module;
2902
2903 if(prop->_class->module)
2904 module = FindModule(prop->_class->module);
2905 else
2906 module = mainModule;
2907 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));
2908 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->classes, classSym->_import);
2909 }
2910 symbol = prop->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
2911 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));
2912 if(classSym)
2913 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&classSym->_import->properties, symbol->_import);
2914 }
2915 imported = 0x1;
2916 if(prop->_class->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)prop->_class->module + 12)))->importType != 1)
2917 dllImport = 0x1;
2918 }
2919 if(!symbol->type)
2920 {
2921 struct Context * context = SetupTemplatesContext(prop->_class);
2922
2923 symbol->type = ProcessTypeString(prop->dataTypeString, 0x0);
2924 FinishTemplatesContext(context);
2925 }
2926 if(prop->Get)
2927 {
2928 if(!symbol->externalGet || symbol->externalGet->type == 0)
2929 {
2930 struct Declaration * decl;
2931 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
2932 struct Declarator * d;
2933 struct __ecereNameSpace__ecere__sys__OldList * params;
2934 struct Specifier * spec;
2935 struct External * external;
2936 struct Declarator * typeDecl;
2937 unsigned int simple = 0x0;
2938
2939 specifiers = MkList();
2940 declarators = MkList();
2941 params = MkList();
2942 ListAdd(params, MkTypeName(MkListOne(MkSpecifierName(prop->_class->fullName)), MkDeclaratorIdentifier(MkIdentifier("this"))));
2943 d = MkDeclaratorIdentifier(MkIdentifier(getName));
2944 if(dllImport)
2945 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
2946 {
2947 struct Context * context = SetupTemplatesContext(prop->_class);
2948
2949 typeDecl = SpecDeclFromString(prop->dataTypeString, specifiers, (((void *)0)));
2950 FinishTemplatesContext(context);
2951 }
2952 for(spec = (*specifiers).first; spec; spec = spec->next)
2953 {
2954 if(spec->type == 1)
2955 {
2956 if((!typeDecl || typeDecl->type == 1))
2957 {
2958 struct Symbol * classSym = spec->symbol;
2959
2960 symbol->_class = classSym->registered;
2961 if(classSym->registered && classSym->registered->type == 1)
2962 {
2963 DeclareStruct(spec->name, 0x0);
2964 simple = 0x1;
2965 }
2966 }
2967 }
2968 }
2969 if(!simple)
2970 d = PlugDeclarator(typeDecl, d);
2971 else
2972 {
2973 ListAdd(params, MkTypeName(specifiers, PlugDeclarator(typeDecl, MkDeclaratorIdentifier(MkIdentifier("value")))));
2974 specifiers = MkList();
2975 }
2976 d = MkDeclaratorFunction(d, params);
2977 if(dllImport)
2978 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
2979 else if(prop->_class->symbol && ((struct Symbol *)prop->_class->symbol)->isStatic)
2980 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
2981 if(simple)
2982 ListAdd(specifiers, MkSpecifier(VOID));
2983 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
2984 decl = MkDeclaration(specifiers, declarators);
2985 external = MkExternalDeclaration(decl);
2986 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
2987 external->symbol = symbol;
2988 symbol->externalGet = external;
2989 ReplaceThisClassSpecifiers(specifiers, prop->_class);
2990 if(typeDecl)
2991 FreeDeclarator(typeDecl);
2992 }
2993 else
2994 {
2995 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->externalGet, curExternal->prev);
2996 }
2997 }
2998 if(prop->Set)
2999 {
3000 if(!symbol->externalSet || symbol->externalSet->type == 0)
3001 {
3002 struct Declaration * decl;
3003 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
3004 struct Declarator * d;
3005 struct __ecereNameSpace__ecere__sys__OldList * params;
3006 struct Specifier * spec;
3007 struct External * external;
3008 struct Declarator * typeDecl;
3009
3010 declarators = MkList();
3011 params = MkList();
3012 if(!prop->conversion || prop->_class->type == 1)
3013 {
3014 ListAdd(params, MkTypeName(MkListOne(MkSpecifierName(prop->_class->fullName)), MkDeclaratorIdentifier(MkIdentifier("this"))));
3015 }
3016 specifiers = MkList();
3017 {
3018 struct Context * context = SetupTemplatesContext(prop->_class);
3019
3020 typeDecl = d = SpecDeclFromString(prop->dataTypeString, specifiers, MkDeclaratorIdentifier(MkIdentifier("value")));
3021 FinishTemplatesContext(context);
3022 }
3023 ListAdd(params, MkTypeName(specifiers, d));
3024 d = MkDeclaratorIdentifier(MkIdentifier(setName));
3025 if(dllImport)
3026 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
3027 d = MkDeclaratorFunction(d, params);
3028 for(spec = (*specifiers).first; spec; spec = spec->next)
3029 {
3030 if(spec->type == 1)
3031 {
3032 if((!typeDecl || typeDecl->type == 1))
3033 {
3034 struct Symbol * classSym = spec->symbol;
3035
3036 symbol->_class = classSym->registered;
3037 if(classSym->registered && classSym->registered->type == 1)
3038 DeclareStruct(spec->name, 0x0);
3039 }
3040 }
3041 }
3042 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
3043 specifiers = MkList();
3044 if(dllImport)
3045 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
3046 else if(prop->_class->symbol && ((struct Symbol *)prop->_class->symbol)->isStatic)
3047 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
3048 if(!prop->conversion || prop->_class->type == 1)
3049 ListAdd(specifiers, MkSpecifier(VOID));
3050 else
3051 ListAdd(specifiers, MkSpecifierName(prop->_class->fullName));
3052 decl = MkDeclaration(specifiers, declarators);
3053 external = MkExternalDeclaration(decl);
3054 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
3055 external->symbol = symbol;
3056 symbol->externalSet = external;
3057 ReplaceThisClassSpecifiers(specifiers, prop->_class);
3058 }
3059 else
3060 {
3061 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->externalSet, curExternal->prev);
3062 }
3063 }
3064 if(!symbol->externalPtr)
3065 {
3066 struct Declaration * decl;
3067 struct External * external;
3068 struct __ecereNameSpace__ecere__sys__OldList * specifiers = MkList();
3069
3070 if(imported)
3071 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
3072 else
3073 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
3074 ListAdd(specifiers, MkSpecifierName("Property"));
3075 {
3076 struct __ecereNameSpace__ecere__sys__OldList * list = MkList();
3077
3078 ListAdd(list, MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier(propName))), (((void *)0))));
3079 if(!imported)
3080 {
3081 strcpy(propName, "__ecerePropM_");
3082 FullClassNameCat(propName, prop->_class->fullName, 0x0);
3083 strcat(propName, "_");
3084 FullClassNameCat(propName, prop->name, 0x1);
3085 MangleClassName(propName);
3086 ListAdd(list, MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier(propName))), (((void *)0))));
3087 }
3088 decl = MkDeclaration(specifiers, list);
3089 }
3090 external = MkExternalDeclaration(decl);
3091 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
3092 external->symbol = symbol;
3093 symbol->externalPtr = external;
3094 }
3095 else
3096 {
3097 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->externalPtr, curExternal->prev);
3098 }
3099 symbol->id = curExternal->symbol->idCode;
3100 }
3101 }
3102
3103 struct Type * Dereference(struct Type * source)
3104 {
3105 void * __ecereTemp1;
3106 struct Type * type = (((void *)0));
3107
3108 if(source)
3109 {
3110 if(source->kind == 13 || source->kind == 12)
3111 {
3112 type = source->type;
3113 source->type->refCount++;
3114 }
3115 else if(source->kind == 8 && !strcmp(source->_class->string, "String"))
3116 {
3117 type = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->kind = 1, ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1));
3118 }
3119 else if(source->kind == 8 && source->_class && source->_class->registered && source->_class->registered->type == 5)
3120 {
3121 type = source;
3122 source->refCount++;
3123 }
3124 else
3125 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "cannot dereference type\n", (((void *)0))));
3126 }
3127 return type;
3128 }
3129
3130 static struct Type * Reference(struct Type * source)
3131 {
3132 void * __ecereTemp1;
3133 struct Type * type = (((void *)0));
3134
3135 if(source)
3136 {
3137 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));
3138 source->refCount++;
3139 }
3140 return type;
3141 }
3142
3143 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);
3144
3145 extern void *  memcpy(void * , const void * , unsigned int size);
3146
3147 void ProcessMethodType(struct __ecereNameSpace__ecere__com__Method * method);
3148
3149 extern void FreeExpression(struct Expression * exp);
3150
3151 extern void __ecereNameSpace__ecere__sys__ChangeCh(char *  string, char ch1, char ch2);
3152
3153 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);
3154
3155 static void ProcessInitializer(struct Initializer * init, struct Type * type);
3156
3157 extern struct Type * MkClassType(char *  name);
3158
3159 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);
3160
3161 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)
3162 {
3163 struct Identifier * ident = member->identifiers ? (*member->identifiers).first : (((void *)0));
3164 unsigned int found = 0x0;
3165 struct __ecereNameSpace__ecere__com__DataMember * dataMember = (((void *)0));
3166 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
3167 unsigned int freeType = 0x0;
3168
3169 yylloc = member->loc;
3170 if(!ident)
3171 {
3172 if(curMember)
3173 {
3174 __ecereNameSpace__ecere__com__eClass_FindNextMember(_class, curClass, curMember, subMemberStack, subMemberStackPos);
3175 if(*curMember)
3176 {
3177 found = 0x1;
3178 dataMember = *curMember;
3179 }
3180 }
3181 }
3182 else
3183 {
3184 struct __ecereNameSpace__ecere__com__DataMember * thisMember = (struct __ecereNameSpace__ecere__com__DataMember *)__ecereNameSpace__ecere__com__eClass_FindProperty(_class, ident->string, privateModule);
3185 struct __ecereNameSpace__ecere__com__DataMember * _subMemberStack[256];
3186 int _subMemberStackPos = 0;
3187
3188 if(!thisMember)
3189 thisMember = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, ident->string, privateModule, _subMemberStack, &_subMemberStackPos);
3190 if(thisMember)
3191 {
3192 dataMember = thisMember;
3193 if(curMember && thisMember->memberAccess == 1)
3194 {
3195 *curMember = thisMember;
3196 *curClass = thisMember->_class;
3197 memcpy(subMemberStack, _subMemberStack, sizeof(int) * _subMemberStackPos);
3198 *subMemberStackPos = _subMemberStackPos;
3199 }
3200 found = 0x1;
3201 }
3202 else
3203 {
3204 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, ident->string, privateModule);
3205 if(method && method->type == 1)
3206 found = 0x1;
3207 else
3208 method = (((void *)0));
3209 }
3210 }
3211 if(found)
3212 {
3213 struct Type * type = (((void *)0));
3214
3215 if(dataMember)
3216 {
3217 if(!dataMember->dataType && dataMember->dataTypeString)
3218 {
3219 struct Context * context = SetupTemplatesContext(_class);
3220
3221 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
3222 FinishTemplatesContext(context);
3223 }
3224 type = dataMember->dataType;
3225 }
3226 else if(method)
3227 {
3228 if(!method->dataType)
3229 ProcessMethodType(method);
3230 type = method->dataType;
3231 }
3232 if(ident && ident->next)
3233 {
3234 for(ident = ident->next; ident && type; ident = ident->next)
3235 {
3236 if(type->kind == 8)
3237 {
3238 dataMember = (struct __ecereNameSpace__ecere__com__DataMember *)__ecereNameSpace__ecere__com__eClass_FindProperty(type->_class->registered, ident->string, privateModule);
3239 if(!dataMember)
3240 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMember(type->_class->registered, ident->string, privateModule, (((void *)0)), (((void *)0)));
3241 if(dataMember)
3242 type = dataMember->dataType;
3243 }
3244 else if(type->kind == 9 || type->kind == 10)
3245 {
3246 struct Type * memberType;
3247
3248 for(memberType = type->members.first; memberType; memberType = memberType->next)
3249 {
3250 if(!strcmp(memberType->name, ident->string))
3251 {
3252 type = memberType;
3253 break;
3254 }
3255 }
3256 }
3257 }
3258 }
3259 if(type && type->kind == 20 && type->templateParameter->type == 0 && _class->templateArgs)
3260 {
3261 int id = 0;
3262 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam;
3263 struct __ecereNameSpace__ecere__com__Class * sClass;
3264
3265 for(sClass = _class; sClass; sClass = sClass->base)
3266 {
3267 id = 0;
3268 if(sClass->templateClass)
3269 sClass = sClass->templateClass;
3270 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
3271 {
3272 if(curParam->type == 0 && !strcmp(type->templateParameter->identifier->string, curParam->name))
3273 {
3274 for(sClass = sClass->base; sClass; sClass = sClass->base)
3275 {
3276 if(sClass->templateClass)
3277 sClass = sClass->templateClass;
3278 id += sClass->templateParams.count;
3279 }
3280 break;
3281 }
3282 id++;
3283 }
3284 if(curParam)
3285 break;
3286 }
3287 if(curParam)
3288 {
3289 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = _class->templateArgs[id];
3290
3291 if(arg.dataTypeString)
3292 {
3293 type = ProcessTypeString(arg.dataTypeString, 0x0);
3294 freeType = 0x1;
3295 if(type && _class->templateClass)
3296 type->passAsTemplate = 0x1;
3297 if(type)
3298 {
3299 }
3300 }
3301 }
3302 }
3303 if(type && type->kind == 8 && type->_class && type->_class->registered && strchr(type->_class->registered->fullName, '<'))
3304 {
3305 struct __ecereNameSpace__ecere__com__Class * expClass = type->_class->registered;
3306 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
3307 int c;
3308 int paramCount = 0;
3309 int lastParam = -1;
3310 char templateString[1024];
3311 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
3312
3313 sprintf(templateString, "%s<", expClass->templateClass->fullName);
3314 for(cClass = expClass; cClass; cClass = cClass->base)
3315 {
3316 int p = 0;
3317
3318 if(cClass->templateClass)
3319 cClass = cClass->templateClass;
3320 for(param = cClass->templateParams.first; param; param = param->next)
3321 {
3322 int id = p;
3323 struct __ecereNameSpace__ecere__com__Class * sClass;
3324 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
3325
3326 for(sClass = cClass->base; sClass; sClass = sClass->base)
3327 {
3328 if(sClass->templateClass)
3329 sClass = sClass->templateClass;
3330 id += sClass->templateParams.count;
3331 }
3332 arg = expClass->templateArgs[id];
3333 for(sClass = _class; sClass; sClass = sClass->base)
3334 {
3335 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * cParam;
3336 int p = 0;
3337 struct __ecereNameSpace__ecere__com__Class * nextClass;
3338
3339 if(sClass->templateClass)
3340 sClass = sClass->templateClass;
3341 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
3342 {
3343 if(nextClass->templateClass)
3344 nextClass = nextClass->templateClass;
3345 p += nextClass->templateParams.count;
3346 }
3347 for(cParam = sClass->templateParams.first; cParam; cParam = cParam->next, p++)
3348 {
3349 if(cParam->type == 0 && arg.dataTypeString && !strcmp(cParam->name, arg.dataTypeString))
3350 {
3351 if(_class->templateArgs && arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
3352 {
3353 arg.dataTypeString = _class->templateArgs[p].dataTypeString;
3354 arg.dataTypeClass = _class->templateArgs[p].dataTypeClass;
3355 break;
3356 }
3357 }
3358 }
3359 }
3360 {
3361 char argument[256];
3362
3363 argument[0] = '\0';
3364 switch(param->type)
3365 {
3366 case 2:
3367 {
3368 char expString[1024];
3369 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
3370 struct Declarator * decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
3371 struct Expression * exp;
3372 char * string = PrintHexUInt64(arg.expression.ui64);
3373
3374 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
3375 ProcessExpressionType(exp);
3376 ComputeExpression(exp);
3377 expString[0] = '\0';
3378 PrintExpression(exp, expString);
3379 strcat(argument, expString);
3380 FreeExpression(exp);
3381 break;
3382 }
3383 case 1:
3384 {
3385 strcat(argument, arg.member->name);
3386 break;
3387 }
3388 case 0:
3389 {
3390 if(arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
3391 strcat(argument, arg.dataTypeString);
3392 break;
3393 }
3394 }
3395 if(argument[0])
3396 {
3397 if(paramCount)
3398 strcat(templateString, ", ");
3399 if(lastParam != p - 1)
3400 {
3401 strcat(templateString, param->name);
3402 strcat(templateString, " = ");
3403 }
3404 strcat(templateString, argument);
3405 paramCount++;
3406 lastParam = p;
3407 }
3408 p++;
3409 }
3410 }
3411 }
3412 {
3413 int len = strlen(templateString);
3414
3415 if(templateString[len - 1] == '<')
3416 len--;
3417 else
3418 {
3419 if(templateString[len - 1] == '>')
3420 templateString[len++] = ' ';
3421 templateString[len++] = '>';
3422 }
3423 templateString[len++] = '\0';
3424 }
3425 {
3426 struct Context * context = SetupTemplatesContext(_class);
3427
3428 if(freeType)
3429 FreeType(type);
3430 type = ProcessTypeString(templateString, 0x0);
3431 freeType = 0x1;
3432 FinishTemplatesContext(context);
3433 }
3434 }
3435 if(method && member->initializer && member->initializer->type == 0 && member->initializer->exp)
3436 {
3437 ProcessExpressionType(member->initializer->exp);
3438 if(!member->initializer->exp->expType)
3439 {
3440 if(inCompiler)
3441 {
3442 char expString[10240];
3443
3444 expString[0] = '\0';
3445 PrintExpression(member->initializer->exp, expString);
3446 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
3447 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "unresolved symbol used as an instance method %s\n", (((void *)0))), expString);
3448 }
3449 }
3450 else if(!MatchTypes(member->initializer->exp->expType, type, (((void *)0)), (((void *)0)), _class, 0x1, 0x1, 0x0, 0x0))
3451 {
3452 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible instance method %s\n", (((void *)0))), ident->string);
3453 }
3454 }
3455 else if(member->initializer)
3456 {
3457 ProcessInitializer(member->initializer, type);
3458 }
3459 if(freeType)
3460 FreeType(type);
3461 }
3462 else
3463 {
3464 if(_class && _class->type == 3)
3465 {
3466 if(member->initializer)
3467 {
3468 struct Type * type = MkClassType(_class->fullName);
3469
3470 ProcessInitializer(member->initializer, type);
3471 FreeType(type);
3472 }
3473 }
3474 else
3475 {
3476 if(member->initializer)
3477 {
3478 ProcessInitializer(member->initializer, (((void *)0)));
3479 }
3480 if(ident)
3481 {
3482 if(method)
3483 {
3484 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't find virtual method %s in class %s\n", (((void *)0))), ident->string, _class->fullName);
3485 }
3486 else if(_class)
3487 {
3488 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't find member %s in class %s\n", (((void *)0))), ident->string, _class->fullName);
3489 if(inCompiler)
3490 __ecereNameSpace__ecere__com__eClass_AddDataMember(_class, ident->string, "int", 0, 0, 1);
3491 }
3492 }
3493 else if(_class)
3494 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "too many initializers for instantiation of class %s\n", (((void *)0))), _class->fullName);
3495 }
3496 }
3497 }
3498
3499 extern struct Identifier * GetDeclId(struct Declarator * decl);
3500
3501 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);
3502
3503 extern void FreeSpecifier(struct Specifier * spec);
3504
3505 static void ProcessFunction(struct FunctionDefinition * function);
3506
3507 extern struct __ecereNameSpace__ecere__sys__OldList *  CopyList(struct __ecereNameSpace__ecere__sys__OldList *  source, void *  (* )(void * ));
3508
3509 extern struct Specifier * CopySpecifier(struct Specifier * spec);
3510
3511 extern struct Declarator * CopyDeclarator(struct Declarator * declarator);
3512
3513 extern void FreeClassFunction(struct ClassFunction * func);
3514
3515 extern struct MemberInit * MkMemberInit(struct __ecereNameSpace__ecere__sys__OldList * ids, struct Initializer * initializer);
3516
3517 extern struct Initializer * MkInitializerAssignment(struct Expression * exp);
3518
3519 void ProcessInstantiationType(struct Instantiation * inst)
3520 {
3521 yylloc = inst->loc;
3522 if(inst->_class)
3523 {
3524 struct MembersInit * members;
3525 struct Symbol * classSym;
3526 struct __ecereNameSpace__ecere__com__Class * _class;
3527
3528 classSym = inst->_class->symbol;
3529 _class = classSym ? classSym->registered : (((void *)0));
3530 if(!_class || _class->type != 5)
3531 DeclareStruct(inst->_class->name, 0x0);
3532 afterExternal = afterExternal ? afterExternal : curExternal;
3533 if(inst->exp)
3534 ProcessExpressionType(inst->exp);
3535 inst->isConstant = 0x1;
3536 if(inst->members)
3537 {
3538 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
3539 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
3540 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
3541 int subMemberStackPos = 0;
3542
3543 for(members = (*inst->members).first; members; members = members->next)
3544 {
3545 switch(members->type)
3546 {
3547 case 1:
3548 {
3549 char name[1024];
3550 static unsigned int instMethodID = 0;
3551 struct External * external = curExternal;
3552 struct Context * context = curContext;
3553 struct Declarator * declarator = members->function->declarator;
3554 struct Identifier * nameID = GetDeclId(declarator);
3555 char * unmangled = nameID ? nameID->string : (((void *)0));
3556 struct Expression * exp;
3557 struct External * createdExternal = (((void *)0));
3558
3559 if(inCompiler)
3560 {
3561 char number[16];
3562
3563 strcpy(name, "__ecereInstMeth_");
3564 FullClassNameCat(name, _class ? _class->fullName : "_UNKNOWNCLASS", 0x0);
3565 strcat(name, "_");
3566 strcat(name, nameID->string);
3567 strcat(name, "_");
3568 sprintf(number, "_%08d", instMethodID++);
3569 strcat(name, number);
3570 nameID->string = __ecereNameSpace__ecere__sys__CopyString(name);
3571 }
3572 if(declarator)
3573 {
3574 struct Symbol * symbol = declarator->symbol;
3575 struct __ecereNameSpace__ecere__com__Method * method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, unmangled, privateModule);
3576
3577 if(method && method->type == 1)
3578 {
3579 symbol->method = method;
3580 ProcessMethodType(method);
3581 if(!symbol->type->thisClass)
3582 {
3583 if(method->dataType->thisClass && currentClass && __ecereNameSpace__ecere__com__eClass_IsDerived(currentClass, method->dataType->thisClass->registered))
3584 {
3585 if(!currentClass->symbol)
3586 currentClass->symbol = FindClass(currentClass->fullName);
3587 symbol->type->thisClass = currentClass->symbol;
3588 }
3589 else
3590 {
3591 if(!_class->symbol)
3592 _class->symbol = FindClass(_class->fullName);
3593 symbol->type->thisClass = _class->symbol;
3594 }
3595 }
3596 DeclareType(symbol->type, 0x1, 0x1);
3597 }
3598 else if(classSym)
3599 {
3600 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't find virtual method %s in class %s\n", (((void *)0))), unmangled, classSym->string);
3601 }
3602 }
3603 createdExternal = ProcessClassFunction(classSym ? classSym->registered : (((void *)0)), members->function, ast, afterExternal, 0x1);
3604 if(nameID)
3605 {
3606 FreeSpecifier(nameID->_class);
3607 nameID->_class = (((void *)0));
3608 }
3609 if(inCompiler)
3610 {
3611 struct Type * type = declarator->symbol->type;
3612 struct External * oldExternal = curExternal;
3613
3614 declarator->symbol->id = declarator->symbol->idCode = curExternal->symbol->idCode;
3615 {
3616 struct External * externalDecl;
3617
3618 externalDecl = MkExternalDeclaration((((void *)0)));
3619 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), oldExternal->prev, externalDecl);
3620 if(createdExternal->function)
3621 {
3622 ProcessFunction(createdExternal->function);
3623 {
3624 struct Declaration * decl = MkDeclaration(CopyList(createdExternal->function->specifiers, CopySpecifier), MkListOne(MkInitDeclarator(CopyDeclarator(declarator), (((void *)0)))));
3625
3626 externalDecl->declaration = decl;
3627 if(decl->symbol && !decl->symbol->pointerExternal)
3628 decl->symbol->pointerExternal = externalDecl;
3629 declarator->symbol->pointerExternal = externalDecl;
3630 }
3631 }
3632 }
3633 }
3634 else if(declarator)
3635 {
3636 curExternal = declarator->symbol->pointerExternal;
3637 ProcessFunction((struct FunctionDefinition *)members->function);
3638 }
3639 curExternal = external;
3640 curContext = context;
3641 if(inCompiler)
3642 {
3643 FreeClassFunction(members->function);
3644 exp = QMkExpId(name);
3645 members->type = 0;
3646 members->dataMembers = MkListOne(MkMemberInit(MkListOne(MkIdentifier(unmangled)), MkInitializerAssignment(exp)));
3647 (__ecereNameSpace__ecere__com__eSystem_Delete(unmangled), unmangled = 0);
3648 }
3649 break;
3650 }
3651 case 0:
3652 {
3653 if(members->dataMembers && classSym)
3654 {
3655 struct MemberInit * member;
3656 struct Location oldyyloc = yylloc;
3657
3658 for(member = (*members->dataMembers).first; member; member = member->next)
3659 {
3660 ProcessMemberInitData(member, classSym->registered, &curClass, &curMember, subMemberStack, &subMemberStackPos);
3661 if(member->initializer && !member->initializer->isConstant)
3662 inst->isConstant = 0x0;
3663 }
3664 yylloc = oldyyloc;
3665 }
3666 break;
3667 }
3668 }
3669 }
3670 }
3671 }
3672 }
3673
3674 static void DeclareType(struct Type * type, unsigned int declarePointers, unsigned int declareParams)
3675 {
3676 if(inCompiler)
3677 {
3678 if(type->kind == 11)
3679 {
3680 struct Type * param;
3681
3682 if(declareParams)
3683 {
3684 for(param = type->params.first; param; param = param->next)
3685 DeclareType(param, declarePointers, 0x1);
3686 }
3687 DeclareType(type->returnType, declarePointers, 0x1);
3688 }
3689 else if(type->kind == 13 && declarePointers)
3690 DeclareType(type->type, declarePointers, 0x0);
3691 else if(type->kind == 8)
3692 {
3693 if(type->_class->registered && (type->_class->registered->type == 1 || type->_class->registered->type == 5) && !type->_class->declaring)
3694 DeclareStruct(type->_class->registered->fullName, type->_class->registered->type == 5);
3695 }
3696 else if(type->kind == 9 || type->kind == 10)
3697 {
3698 struct Type * member;
3699
3700 for(member = type->members.first; member; member = member->next)
3701 DeclareType(member, 0x0, 0x0);
3702 }
3703 else if(type->kind == 12)
3704 DeclareType(type->arrayType, declarePointers, 0x0);
3705 }
3706 }
3707
3708 extern struct __ecereNameSpace__ecere__com__Class * __ecereNameSpace__ecere__com__eSystem_FindClass(struct __ecereNameSpace__ecere__com__Instance * module, char *  name);
3709
3710 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * FindTemplateArg(struct __ecereNameSpace__ecere__com__Class * _class, struct TemplateParameter * param)
3711 {
3712 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * arg = (((void *)0));
3713 int id = 0;
3714 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam;
3715 struct __ecereNameSpace__ecere__com__Class * sClass;
3716
3717 for(sClass = _class; sClass; sClass = sClass->base)
3718 {
3719 id = 0;
3720 if(sClass->templateClass)
3721 sClass = sClass->templateClass;
3722 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
3723 {
3724 if(curParam->type == 0 && !strcmp(param->identifier->string, curParam->name))
3725 {
3726 for(sClass = sClass->base; sClass; sClass = sClass->base)
3727 {
3728 if(sClass->templateClass)
3729 sClass = sClass->templateClass;
3730 id += sClass->templateParams.count;
3731 }
3732 break;
3733 }
3734 id++;
3735 }
3736 if(curParam)
3737 break;
3738 }
3739 if(curParam)
3740 {
3741 arg = &_class->templateArgs[id];
3742 if(arg && param->type == 0)
3743 (*arg).dataTypeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, (*arg).dataTypeString);
3744 }
3745 return arg;
3746 }
3747
3748 extern struct Context * PushContext(void);
3749
3750 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplatedType;
3751
3752 struct TemplatedType
3753 {
3754 unsigned int key;
3755 struct __ecereNameSpace__ecere__sys__BTNode * parent;
3756 struct __ecereNameSpace__ecere__sys__BTNode * left;
3757 struct __ecereNameSpace__ecere__sys__BTNode * right;
3758 int depth;
3759 struct TemplateParameter * param;
3760 };
3761
3762 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(struct __ecereNameSpace__ecere__sys__BinaryTree * this, struct __ecereNameSpace__ecere__sys__BTNode * node);
3763
3764 struct Context * SetupTemplatesContext(struct __ecereNameSpace__ecere__com__Class * _class)
3765 {
3766 void * __ecereTemp1;
3767 struct Context * context = PushContext();
3768
3769 context->templateTypesOnly = 0x1;
3770 if(_class->symbol && ((struct Symbol *)_class->symbol)->templateParams)
3771 {
3772 struct TemplateParameter * param = (*((struct Symbol *)_class->symbol)->templateParams).first;
3773
3774 for(; param; param = param->next)
3775 {
3776 if(param->type == 0 && param->identifier)
3777 {
3778 struct TemplatedType * type = (type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TemplatedType), type->key = (unsigned int)param->identifier->string, type->param = param, type);
3779
3780 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&curContext->templateTypes, (struct __ecereNameSpace__ecere__sys__BTNode *)type);
3781 }
3782 }
3783 }
3784 else if(_class)
3785 {
3786 struct __ecereNameSpace__ecere__com__Class * sClass;
3787
3788 for(sClass = _class; sClass; sClass = sClass->base)
3789 {
3790 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * p;
3791
3792 for(p = sClass->templateParams.first; p; p = p->next)
3793 {
3794 if(p->type == 0)
3795 {
3796 struct TemplateParameter * param = p->param;
3797 struct TemplatedType * type;
3798
3799 if(!param)
3800 {
3801 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));
3802 }
3803 type = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TemplatedType), ((struct TemplatedType *)__ecereTemp1)->key = (unsigned int)p->name, ((struct TemplatedType *)__ecereTemp1)->param = param, ((struct TemplatedType *)__ecereTemp1));
3804 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&curContext->templateTypes, (struct __ecereNameSpace__ecere__sys__BTNode *)type);
3805 }
3806 }
3807 }
3808 }
3809 return context;
3810 }
3811
3812 extern void PopContext(struct Context * ctx);
3813
3814 extern void FreeContext(struct Context * context);
3815
3816 void FinishTemplatesContext(struct Context * context)
3817 {
3818 PopContext(context);
3819 FreeContext(context);
3820 ((context ? (__ecereClass_Context->Destructor ? __ecereClass_Context->Destructor(context) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(context)) : 0), context = 0);
3821 }
3822
3823 void ProcessMethodType(struct __ecereNameSpace__ecere__com__Method * method)
3824 {
3825 if(!method->dataType)
3826 {
3827 struct Context * context = SetupTemplatesContext(method->_class);
3828
3829 method->dataType = ProcessTypeString(method->dataTypeString, 0x0);
3830 FinishTemplatesContext(context);
3831 if(method->type != 1 && method->dataType)
3832 {
3833 if(!method->dataType->thisClass && !method->dataType->staticMethod)
3834 {
3835 if(!method->_class->symbol)
3836 method->_class->symbol = FindClass(method->_class->fullName);
3837 method->dataType->thisClass = method->_class->symbol;
3838 }
3839 }
3840 }
3841 }
3842
3843 void ProcessPropertyType(struct __ecereNameSpace__ecere__com__Property * prop)
3844 {
3845 if(!prop->dataType)
3846 {
3847 struct Context * context = SetupTemplatesContext(prop->_class);
3848
3849 prop->dataType = ProcessTypeString(prop->dataTypeString, 0x0);
3850 FinishTemplatesContext(context);
3851 }
3852 }
3853
3854 extern struct Declarator * GetFuncDecl(struct Declarator * decl);
3855
3856 extern void FreeTypeName(struct TypeName * typeName);
3857
3858 static void ProcessDeclarator(struct Declarator * decl);
3859
3860 extern struct __ecereNameSpace__ecere__sys__OldList *  excludedSymbols;
3861
3862 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_MethodImport;
3863
3864 struct MethodImport
3865 {
3866 struct MethodImport * prev;
3867 struct MethodImport * next;
3868 char *  name;
3869 unsigned int isVirtual;
3870 };
3871
3872 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(struct __ecereNameSpace__ecere__sys__OldList * this, void *  item);
3873
3874 void DeclareMethod(struct __ecereNameSpace__ecere__com__Method * method, char * name)
3875 {
3876 void * __ecereTemp1;
3877 struct Symbol * symbol = method->symbol;
3878
3879 if(!symbol || (!symbol->pointerExternal && method->type == 1) || symbol->id > (curExternal ? curExternal->symbol->idCode : -1))
3880 {
3881 unsigned int imported = 0x0;
3882 unsigned int dllImport = 0x0;
3883
3884 if(!method->dataType)
3885 method->dataType = ProcessTypeString(method->dataTypeString, 0x0);
3886 if(!symbol || symbol->_import || method->type == 1)
3887 {
3888 if(!symbol || method->type == 1)
3889 {
3890 struct Symbol * classSym;
3891
3892 if(!method->_class->symbol)
3893 method->_class->symbol = FindClass(method->_class->fullName);
3894 classSym = method->_class->symbol;
3895 if(!classSym->_import)
3896 {
3897 struct ModuleImport * module;
3898
3899 if(method->_class->module && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)method->_class->module + 12)))->name)
3900 module = FindModule(method->_class->module);
3901 else
3902 module = mainModule;
3903 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));
3904 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->classes, classSym->_import);
3905 }
3906 if(!symbol)
3907 {
3908 symbol = method->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
3909 }
3910 if(!symbol->_import)
3911 {
3912 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));
3913 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&classSym->_import->methods, symbol->_import);
3914 }
3915 if(!symbol)
3916 {
3917 symbol->type = method->dataType;
3918 if(symbol->type)
3919 symbol->type->refCount++;
3920 }
3921 }
3922 if(!method->dataType->dllExport)
3923 {
3924 imported = 0x1;
3925 if(method->_class->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)method->_class->module + 12)))->importType != 1)
3926 dllImport = 0x1;
3927 }
3928 }
3929 if(method->type != 1 && method->dataType)
3930 DeclareType(method->dataType, 0x1, 0x1);
3931 if(!symbol->pointerExternal || symbol->pointerExternal->type == 0)
3932 {
3933 struct Declaration * decl;
3934 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
3935 struct Declarator * d;
3936 struct Declarator * funcDecl;
3937 struct External * external;
3938
3939 specifiers = MkList();
3940 declarators = MkList();
3941 if(dllImport)
3942 ListAdd(specifiers, MkSpecifier(EXTERN));
3943 else if(method->_class->symbol && ((struct Symbol *)method->_class->symbol)->isStatic)
3944 ListAdd(specifiers, MkSpecifier(STATIC));
3945 if(method->type == 1)
3946 {
3947 ListAdd(specifiers, MkSpecifier(INT));
3948 d = MkDeclaratorIdentifier(MkIdentifier(name));
3949 }
3950 else
3951 {
3952 d = MkDeclaratorIdentifier(MkIdentifier(name));
3953 if(dllImport)
3954 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
3955 {
3956 struct Context * context = SetupTemplatesContext(method->_class);
3957
3958 d = SpecDeclFromString(method->dataTypeString, specifiers, d);
3959 FinishTemplatesContext(context);
3960 }
3961 funcDecl = GetFuncDecl(d);
3962 if(dllImport)
3963 {
3964 struct Specifier * spec, * next;
3965
3966 for(spec = (*specifiers).first; spec; spec = next)
3967 {
3968 next = spec->next;
3969 if(spec->type == 5)
3970 {
3971 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*specifiers), spec);
3972 FreeSpecifier(spec);
3973 }
3974 }
3975 }
3976 if(method->dataType && !method->dataType->staticMethod)
3977 {
3978 if(funcDecl && funcDecl->function.parameters && (*funcDecl->function.parameters).count)
3979 {
3980 struct __ecereNameSpace__ecere__com__Class * _class = method->dataType->thisClass ? method->dataType->thisClass->registered : method->_class;
3981 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")));
3982 struct TypeName * firstParam = ((struct TypeName *)(*funcDecl->function.parameters).first);
3983 struct Specifier * firstSpec = firstParam->qualifiers ? (*firstParam->qualifiers).first : (((void *)0));
3984
3985 if(firstSpec && firstSpec->type == 0 && firstSpec->specifier == VOID && !firstParam->declarator)
3986 {
3987 struct TypeName * param = (*funcDecl->function.parameters).first;
3988
3989 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->function.parameters), param);
3990 FreeTypeName(param);
3991 }
3992 if(!funcDecl->function.parameters)
3993 funcDecl->function.parameters = MkList();
3994 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
3995 }
3996 }
3997 }
3998 ProcessDeclarator(d);
3999 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
4000 decl = MkDeclaration(specifiers, declarators);
4001 ReplaceThisClassSpecifiers(specifiers, method->_class);
4002 if(symbol->pointerExternal)
4003 {
4004 struct Symbol * functionSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4005
4006 {
4007 *functionSymbol = *symbol;
4008 functionSymbol->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
4009 if(functionSymbol->type)
4010 functionSymbol->type->refCount++;
4011 }
4012 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*excludedSymbols), functionSymbol);
4013 symbol->pointerExternal->symbol = functionSymbol;
4014 }
4015 external = MkExternalDeclaration(decl);
4016 if(curExternal)
4017 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal ? curExternal->prev : (((void *)0)), external);
4018 external->symbol = symbol;
4019 symbol->pointerExternal = external;
4020 }
4021 else if(ast)
4022 {
4023 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
4024 }
4025 symbol->id = curExternal ? curExternal->symbol->idCode : (((int)0x7fffffff));
4026 }
4027 }
4028
4029 char * ReplaceThisClass(struct __ecereNameSpace__ecere__com__Class * _class)
4030 {
4031 if(thisClassParams && _class->templateParams.count && !_class->templateClass)
4032 {
4033 unsigned int first = 0x1;
4034 int p = 0;
4035 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
4036 int lastParam = -1;
4037 char className[1024];
4038
4039 strcpy(className, _class->fullName);
4040 for(param = _class->templateParams.first; param; param = param->next)
4041 {
4042 {
4043 if(first)
4044 strcat(className, "<");
4045 if(!first)
4046 strcat(className, ", ");
4047 if(lastParam + 1 != p)
4048 {
4049 strcat(className, param->name);
4050 strcat(className, " = ");
4051 }
4052 strcat(className, param->name);
4053 first = 0x0;
4054 lastParam = p;
4055 }
4056 p++;
4057 }
4058 if(!first)
4059 {
4060 int len = strlen(className);
4061
4062 if(className[len - 1] == '>')
4063 className[len++] = ' ';
4064 className[len++] = '>';
4065 className[len++] = '\0';
4066 }
4067 return __ecereNameSpace__ecere__sys__CopyString(className);
4068 }
4069 else
4070 return __ecereNameSpace__ecere__sys__CopyString(_class->fullName);
4071 }
4072
4073 struct Type * ReplaceThisClassType(struct __ecereNameSpace__ecere__com__Class * _class)
4074 {
4075 if(thisClassParams && _class->templateParams.count && !_class->templateClass)
4076 {
4077 unsigned int first = 0x1;
4078 int p = 0;
4079 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
4080 int lastParam = -1;
4081 char className[1024];
4082
4083 strcpy(className, _class->fullName);
4084 for(param = _class->templateParams.first; param; param = param->next)
4085 {
4086 {
4087 if(first)
4088 strcat(className, "<");
4089 if(!first)
4090 strcat(className, ", ");
4091 if(lastParam + 1 != p)
4092 {
4093 strcat(className, param->name);
4094 strcat(className, " = ");
4095 }
4096 strcat(className, param->name);
4097 first = 0x0;
4098 lastParam = p;
4099 }
4100 p++;
4101 }
4102 if(!first)
4103 {
4104 int len = strlen(className);
4105
4106 if(className[len - 1] == '>')
4107 className[len++] = ' ';
4108 className[len++] = '>';
4109 className[len++] = '\0';
4110 }
4111 return MkClassType(className);
4112 }
4113 else
4114 {
4115 return MkClassType(_class->fullName);
4116 }
4117 }
4118
4119 void ReplaceThisClassSpecifiers(struct __ecereNameSpace__ecere__sys__OldList * specs, struct __ecereNameSpace__ecere__com__Class * _class)
4120 {
4121 if(specs != (((void *)0)) && _class)
4122 {
4123 struct Specifier * spec;
4124
4125 for(spec = specs->first; spec; spec = spec->next)
4126 {
4127 if(spec->type == 0 && spec->specifier == THISCLASS)
4128 {
4129 spec->type = 1;
4130 spec->name = ReplaceThisClass(_class);
4131 spec->symbol = FindClass(spec->name);
4132 }
4133 }
4134 }
4135 }
4136
4137 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__GlobalFunction;
4138
4139 struct __ecereNameSpace__ecere__com__GlobalFunction
4140 {
4141 struct __ecereNameSpace__ecere__com__GlobalFunction * prev;
4142 struct __ecereNameSpace__ecere__com__GlobalFunction * next;
4143 char *  name;
4144 int (*  function)();
4145 struct __ecereNameSpace__ecere__com__Instance * module;
4146 struct __ecereNameSpace__ecere__com__NameSpace *  nameSpace;
4147 char *  dataTypeString;
4148 struct Type * dataType;
4149 void *  symbol;
4150 };
4151
4152 extern struct Context * globalContext;
4153
4154 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_FunctionImport;
4155
4156 struct FunctionImport
4157 {
4158 struct FunctionImport * prev;
4159 struct FunctionImport * next;
4160 char *  name;
4161 };
4162
4163 unsigned int DeclareFunction(struct __ecereNameSpace__ecere__com__GlobalFunction * function, char * name)
4164 {
4165 void * __ecereTemp1;
4166 struct Symbol * symbol = function->symbol;
4167
4168 if(curExternal && (!symbol || symbol->id > curExternal->symbol->idCode))
4169 {
4170 unsigned int imported = 0x0;
4171 unsigned int dllImport = 0x0;
4172
4173 if(!function->dataType)
4174 {
4175 function->dataType = ProcessTypeString(function->dataTypeString, 0x0);
4176 if(!function->dataType->thisClass)
4177 function->dataType->staticMethod = 0x1;
4178 }
4179 if(inCompiler)
4180 {
4181 if(!symbol)
4182 {
4183 struct ModuleImport * module = FindModule(function->module);
4184
4185 symbol = function->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4186 if(module->name)
4187 {
4188 if(!function->dataType->dllExport)
4189 {
4190 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));
4191 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->functions, symbol->_import);
4192 }
4193 }
4194 {
4195 symbol->type = ProcessTypeString(function->dataTypeString, 0x0);
4196 if(!symbol->type->thisClass)
4197 symbol->type->staticMethod = 0x1;
4198 }
4199 }
4200 imported = symbol->_import ? 0x1 : 0x0;
4201 if(imported && function->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + 12)))->importType != 1)
4202 dllImport = 0x1;
4203 }
4204 DeclareType(function->dataType, 0x1, 0x1);
4205 if(inCompiler)
4206 {
4207 if(!symbol->pointerExternal || symbol->pointerExternal->type == 0)
4208 {
4209 struct Declaration * decl;
4210 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
4211 struct Declarator * d;
4212 struct Declarator * funcDecl;
4213 struct External * external;
4214
4215 specifiers = MkList();
4216 declarators = MkList();
4217 ListAdd(specifiers, MkSpecifier(EXTERN));
4218 d = MkDeclaratorIdentifier(MkIdentifier(imported ? name : function->name));
4219 if(dllImport)
4220 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
4221 d = SpecDeclFromString(function->dataTypeString, specifiers, d);
4222 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + 12)))->importType == 1)
4223 {
4224 struct Specifier * spec;
4225
4226 for(spec = (*specifiers).first; spec; spec = spec->next)
4227 if(spec->type == 5 && !strcmp(spec->name, "dllexport"))
4228 {
4229 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*specifiers), spec);
4230 FreeSpecifier(spec);
4231 break;
4232 }
4233 }
4234 funcDecl = GetFuncDecl(d);
4235 if(funcDecl && !funcDecl->function.parameters)
4236 {
4237 funcDecl->function.parameters = MkList();
4238 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), MkTypeName(MkListOne(MkSpecifier(VOID)), (((void *)0))));
4239 }
4240 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
4241 {
4242 struct Context * oldCtx = curContext;
4243
4244 curContext = globalContext;
4245 decl = MkDeclaration(specifiers, declarators);
4246 curContext = oldCtx;
4247 }
4248 if(symbol->pointerExternal)
4249 {
4250 struct Symbol * functionSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4251
4252 {
4253 *functionSymbol = *symbol;
4254 functionSymbol->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
4255 if(functionSymbol->type)
4256 functionSymbol->type->refCount++;
4257 }
4258 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*excludedSymbols), functionSymbol);
4259 symbol->pointerExternal->symbol = functionSymbol;
4260 }
4261 external = MkExternalDeclaration(decl);
4262 if(curExternal)
4263 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
4264 external->symbol = symbol;
4265 symbol->pointerExternal = external;
4266 }
4267 else
4268 {
4269 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
4270 }
4271 if(curExternal)
4272 symbol->id = curExternal->symbol->idCode;
4273 }
4274 }
4275 return (symbol && symbol->_import && function->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + 12)))->importType != 1) ? 0x1 : 0x0;
4276 }
4277
4278 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_GlobalData;
4279
4280 struct GlobalData
4281 {
4282 unsigned int key;
4283 struct __ecereNameSpace__ecere__sys__BTNode * parent;
4284 struct __ecereNameSpace__ecere__sys__BTNode * left;
4285 struct __ecereNameSpace__ecere__sys__BTNode * right;
4286 int depth;
4287 struct __ecereNameSpace__ecere__com__Instance * module;
4288 char *  dataTypeString;
4289 struct Type * dataType;
4290 void *  symbol;
4291 char *  fullName;
4292 };
4293
4294 void DeclareGlobalData(struct GlobalData * data)
4295 {
4296 struct Symbol * symbol = data->symbol;
4297
4298 if(curExternal && (!symbol || symbol->id > curExternal->symbol->idCode))
4299 {
4300 if(inCompiler)
4301 {
4302 if(!symbol)
4303 symbol = data->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4304 }
4305 if(!data->dataType)
4306 data->dataType = ProcessTypeString(data->dataTypeString, 0x0);
4307 DeclareType(data->dataType, 0x1, 0x1);
4308 if(inCompiler)
4309 {
4310 if(!symbol->pointerExternal)
4311 {
4312 struct Declaration * decl;
4313 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
4314 struct Declarator * d;
4315 struct External * external;
4316
4317 specifiers = MkList();
4318 declarators = MkList();
4319 ListAdd(specifiers, MkSpecifier(EXTERN));
4320 d = MkDeclaratorIdentifier(MkIdentifier(data->fullName));
4321 d = SpecDeclFromString(data->dataTypeString, specifiers, d);
4322 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
4323 decl = MkDeclaration(specifiers, declarators);
4324 external = MkExternalDeclaration(decl);
4325 if(curExternal)
4326 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
4327 external->symbol = symbol;
4328 symbol->pointerExternal = external;
4329 }
4330 else
4331 {
4332 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
4333 }
4334 if(curExternal)
4335 symbol->id = curExternal->symbol->idCode;
4336 }
4337 }
4338 }
4339
4340 struct Conversion
4341 {
4342 struct Conversion * prev, * next;
4343 struct __ecereNameSpace__ecere__com__Property * convert;
4344 unsigned int isGet;
4345 struct Type * resultType;
4346 };
4347
4348 static struct __ecereNameSpace__ecere__com__Class * __ecereClass_Conversion;
4349
4350 extern void Compiler_Warning(char *  format, ...);
4351
4352 void PrintType(struct Type * type, char *  string, unsigned int printName, unsigned int fullName);
4353
4354 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)
4355 {
4356 if(source && dest)
4357 {
4358 if(source->kind == 20 && dest->kind != 20)
4359 {
4360 struct Type * type = ProcessTemplateParameterType(source->templateParameter);
4361
4362 if(type)
4363 source = type;
4364 }
4365 if(dest->kind == 20 && source->kind != 20)
4366 {
4367 struct Type * type = ProcessTemplateParameterType(dest->templateParameter);
4368
4369 if(type)
4370 dest = type;
4371 }
4372 if((dest->classObjectType == 2 && source->classObjectType != 3) || (dest->classObjectType == 3 && source->classObjectType != 2))
4373 {
4374 return 0x1;
4375 }
4376 if(source->classObjectType == 3 && dest->classObjectType != 2)
4377 {
4378 return 0x1;
4379 }
4380 if((dest->kind == 9 && source->kind == 9) || (dest->kind == 10 && source->kind == 10))
4381 {
4382 if((dest->enumName && source->enumName && !strcmp(dest->enumName, source->enumName)) || (source->members.first && source->members.first == dest->members.first))
4383 return 0x1;
4384 }
4385 if(dest->kind == 14 && source->kind != 0)
4386 return 0x1;
4387 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))
4388 return 0x1;
4389 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))
4390 return 0x1;
4391 if(((source->kind == 8 && dest->kind == 8) || (source->kind == 19 && dest->kind == 19)) && source->_class)
4392 {
4393 if(source->_class->registered && source->_class->registered->type == 3)
4394 {
4395 if(conversions != (((void *)0)))
4396 {
4397 if(source->_class->registered == dest->_class->registered)
4398 return 0x1;
4399 }
4400 else
4401 {
4402 struct __ecereNameSpace__ecere__com__Class * sourceBase, * destBase;
4403
4404 for(sourceBase = source->_class->registered; sourceBase && sourceBase->base->type != 1000; sourceBase = sourceBase->base)
4405 ;
4406 for(destBase = dest->_class->registered; destBase && destBase->base->type != 1000; destBase = destBase->base)
4407 ;
4408 if(sourceBase == destBase)
4409 return 0x1;
4410 }
4411 }
4412 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))
4413 return 0x1;
4414 else
4415 {
4416 if(enumBaseType && dest->_class && dest->_class->registered && dest->_class->registered->type == 4 && source->_class && source->_class->registered && source->_class->registered->type != 4)
4417 {
4418 if(__ecereNameSpace__ecere__com__eClass_IsDerived(dest->_class->registered, source->_class->registered))
4419 {
4420 return 0x1;
4421 }
4422 }
4423 }
4424 }
4425 if(source->kind == 19 && dest->kind == 8 && dest->_class && !strcmp(dest->_class->string, "ecere::com::Class"))
4426 return 0x1;
4427 if(doConversion)
4428 {
4429 if(source->kind == 8)
4430 {
4431 struct __ecereNameSpace__ecere__com__Class * _class;
4432
4433 for(_class = source->_class ? source->_class->registered : (((void *)0)); _class; _class = _class->base)
4434 {
4435 struct __ecereNameSpace__ecere__com__Property * convert;
4436
4437 for(convert = _class->conversions.first; convert; convert = convert->next)
4438 {
4439 if(convert->memberAccess == 1 || _class->module == privateModule)
4440 {
4441 struct Conversion * after = (conversions != (((void *)0))) ? conversions->last : (((void *)0));
4442
4443 if(!convert->dataType)
4444 convert->dataType = ProcessTypeString(convert->dataTypeString, 0x0);
4445 if(MatchTypes(convert->dataType, dest, conversions, (((void *)0)), (((void *)0)), 0x0, 0x1, 0x0, 0x1))
4446 {
4447 if(!conversions && !convert->Get)
4448 return 0x1;
4449 else if(conversions != (((void *)0)))
4450 {
4451 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))
4452 return 0x1;
4453 else
4454 {
4455 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv->isGet = 0x1, conv);
4456
4457 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(conversions, after, conv);
4458 return 0x1;
4459 }
4460 }
4461 }
4462 }
4463 }
4464 }
4465 }
4466 if(dest->kind == 8)
4467 {
4468 struct __ecereNameSpace__ecere__com__Class * _class;
4469
4470 for(_class = dest->_class ? dest->_class->registered : (((void *)0)); _class; _class = _class->base)
4471 {
4472 struct __ecereNameSpace__ecere__com__Property * convert;
4473
4474 for(convert = _class->conversions.first; convert; convert = convert->next)
4475 {
4476 if(convert->memberAccess == 1 || _class->module == privateModule)
4477 {
4478 if(!convert->dataType)
4479 convert->dataType = ProcessTypeString(convert->dataTypeString, 0x0);
4480 if(convert->dataType != dest && MatchTypes(source, convert->dataType, conversions, (((void *)0)), (((void *)0)), 0x1, 0x0, 0x0, 0x1))
4481 {
4482 if(!conversions && !convert->Set)
4483 return 0x1;
4484 else if(conversions != (((void *)0)))
4485 {
4486 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))
4487 return 0x1;
4488 else
4489 {
4490 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv);
4491
4492 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(conversions, conv);
4493 return 0x1;
4494 }
4495 }
4496 }
4497 }
4498 }
4499 }
4500 if(enumBaseType && dest->_class && dest->_class->registered && dest->_class->registered->type == 4)
4501 {
4502 if(!dest->_class->registered->dataType)
4503 dest->_class->registered->dataType = ProcessTypeString(dest->_class->registered->dataTypeString, 0x0);
4504 if(dest->_class->registered->dataType->kind == 8 || source->truth || dest->truth)
4505 {
4506 if(MatchTypes(source, dest->_class->registered->dataType, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
4507 {
4508 return 0x1;
4509 }
4510 }
4511 }
4512 }
4513 if(source->kind == 8)
4514 {
4515 struct __ecereNameSpace__ecere__com__Class * _class;
4516
4517 for(_class = source->_class ? source->_class->registered : (((void *)0)); _class; _class = _class->base)
4518 {
4519 struct __ecereNameSpace__ecere__com__Property * convert;
4520
4521 for(convert = _class->conversions.first; convert; convert = convert->next)
4522 {
4523 if(convert->memberAccess == 1 || _class->module == privateModule)
4524 {
4525 struct Conversion * after = (conversions != (((void *)0))) ? conversions->last : (((void *)0));
4526
4527 if(!convert->dataType)
4528 convert->dataType = ProcessTypeString(convert->dataTypeString, 0x0);
4529 if(convert->dataType != source && MatchTypes(convert->dataType, dest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x1))
4530 {
4531 if(!conversions && !convert->Get)
4532 return 0x1;
4533 else if(conversions != (((void *)0)))
4534 {
4535 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))
4536 return 0x1;
4537 else
4538 {
4539 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv->isGet = 0x1, conv);
4540
4541 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(conversions, after, conv);
4542 return 0x1;
4543 }
4544 }
4545 }
4546 }
4547 }
4548 }
4549 if(enumBaseType && source->_class && source->_class->registered && source->_class->registered->type == 4)
4550 {
4551 if(!source->_class->registered->dataType)
4552 source->_class->registered->dataType = ProcessTypeString(source->_class->registered->dataTypeString, 0x0);
4553 if(MatchTypes(source->_class->registered->dataType, dest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
4554 {
4555 return 0x1;
4556 }
4557 }
4558 }
4559 }
4560 if(source->kind == 8 || source->kind == 19)
4561 ;
4562 else if(dest->kind == source->kind && (dest->kind != 9 && dest->kind != 10 && dest->kind != 11 && dest->kind != 12 && dest->kind != 13 && dest->kind != 16))
4563 return 0x1;
4564 else if(dest->kind == 7 && source->kind == 6)
4565 return 0x1;
4566 else if(dest->kind == 2 && source->kind == 1)
4567 return 0x1;
4568 else if(dest->kind == 3 && (source->kind == 2 || source->kind == 1))
4569 return 0x1;
4570 else if(dest->kind == 4 && (source->kind == 2 || source->kind == 1 || source->kind == 3))
4571 return 0x1;
4572 else if(source->kind == 15 && (dest->kind == 3 || dest->kind == 2 || dest->kind == 1 || dest->kind == 5 || dest->kind == 4))
4573 return 0x1;
4574 else if(dest->kind == 15 && (source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 5 || dest->kind == 4))
4575 return 0x1;
4576 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)))
4577 {
4578 struct Type * paramSource, * paramDest;
4579
4580 if(dest->kind == 16)
4581 owningClassDest = dest->methodClass ? dest->methodClass : dest->method->_class;
4582 if(source->kind == 16)
4583 owningClassSource = source->methodClass ? source->methodClass : source->method->_class;
4584 if(dest->kind == 13 && dest->type->kind == 11)
4585 dest = dest->type;
4586 if(source->kind == 13 && source->type->kind == 11)
4587 source = source->type;
4588 if(dest->kind == 16)
4589 dest = dest->method->dataType;
4590 if(source->kind == 16)
4591 source = source->method->dataType;
4592 paramSource = source->params.first;
4593 if(paramSource && paramSource->kind == 0)
4594 paramSource = (((void *)0));
4595 paramDest = dest->params.first;
4596 if(paramDest && paramDest->kind == 0)
4597 paramDest = (((void *)0));
4598 if((dest->staticMethod || (!dest->thisClass && !owningClassDest)) && !(source->staticMethod || (!source->thisClass && !owningClassSource)))
4599 {
4600 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))))
4601 {
4602 if(paramDest && paramDest->kind == 8)
4603 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "method class must be derived from %s\n", (((void *)0))), paramDest->_class->string);
4604 else
4605 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "method class should not take an object\n", (((void *)0))));
4606 return 0x0;
4607 }
4608 paramDest = paramDest->next;
4609 }
4610 else if(!dest->staticMethod && (dest->thisClass || owningClassDest))
4611 {
4612 if((source->staticMethod || (!source->thisClass && !owningClassSource)))
4613 {
4614 if(dest->thisClass)
4615 {
4616 if(!paramSource || paramSource->kind != 8 || !__ecereNameSpace__ecere__com__eClass_IsDerived(paramSource->_class->registered, dest->thisClass->registered))
4617 {
4618 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "method class must be derived from %s\n", (((void *)0))), dest->thisClass->string);
4619 return 0x0;
4620 }
4621 }
4622 else
4623 {
4624 if(!paramSource || paramSource->kind != 8 || (owningClassDest && !__ecereNameSpace__ecere__com__eClass_IsDerived(paramSource->_class->registered, owningClassDest)))
4625 {
4626 if(owningClassDest)
4627 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "%s expected to be derived from method class\n", (((void *)0))), owningClassDest->fullName);
4628 else
4629 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "overriding class expected to be derived from method class\n", (((void *)0))));
4630 return 0x0;
4631 }
4632 }
4633 paramSource = paramSource->next;
4634 }
4635 else
4636 {
4637 if(dest->thisClass)
4638 {
4639 if(!__ecereNameSpace__ecere__com__eClass_IsDerived(source->thisClass ? source->thisClass->registered : owningClassSource, dest->thisClass->registered))
4640 {
4641 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "method class must be derived from %s\n", (((void *)0))), dest->thisClass->string);
4642 return 0x0;
4643 }
4644 }
4645 else
4646 {
4647 if(source->thisClass && source->thisClass->registered && owningClassDest && !__ecereNameSpace__ecere__com__eClass_IsDerived(source->thisClass->registered, owningClassDest))
4648 {
4649 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "%s expected to be derived from method class\n", (((void *)0))), source->thisClass->registered->fullName);
4650 return 0x0;
4651 }
4652 }
4653 }
4654 }
4655 if(!MatchTypes(source->returnType, dest->returnType, (((void *)0)), (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
4656 {
4657 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible return type for function\n", (((void *)0))));
4658 return 0x0;
4659 }
4660 for(; paramDest; paramDest = paramDest->next)
4661 {
4662 if(!paramSource)
4663 {
4664 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "not enough parameters\n", (((void *)0))));
4665 return 0x0;
4666 }
4667 {
4668 struct Type * paramDestType = paramDest;
4669 struct Type * paramSourceType = paramSource;
4670 struct Type * type = paramDestType;
4671
4672 if(paramDest->kind == 20 && paramDest->templateParameter->type == 0 && owningClassSource && paramSource->kind != 20)
4673 {
4674 int id = 0;
4675 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam;
4676 struct __ecereNameSpace__ecere__com__Class * sClass;
4677
4678 for(sClass = owningClassSource; sClass; sClass = sClass->base)
4679 {
4680 id = 0;
4681 if(sClass->templateClass)
4682 sClass = sClass->templateClass;
4683 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
4684 {
4685 if(curParam->type == 0 && !strcmp(type->templateParameter->identifier->string, curParam->name))
4686 {
4687 for(sClass = sClass->base; sClass; sClass = sClass->base)
4688 {
4689 if(sClass->templateClass)
4690 sClass = sClass->templateClass;
4691 id += sClass->templateParams.count;
4692 }
4693 break;
4694 }
4695 id++;
4696 }
4697 if(curParam)
4698 break;
4699 }
4700 if(curParam)
4701 {
4702 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = owningClassSource->templateArgs[id];
4703
4704 paramDestType = type = ProcessTypeString(arg.dataTypeString, 0x0);
4705 }
4706 }
4707 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)))
4708 {
4709 char type[1024];
4710
4711 type[0] = (char)0;
4712 PrintType(paramDest, type, 0x0, 0x1);
4713 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible parameter %s (expected %s)\n", (((void *)0))), paramSource->name, type);
4714 if(paramDestType != paramDest)
4715 FreeType(paramDestType);
4716 return 0x0;
4717 }
4718 if(paramDestType != paramDest)
4719 FreeType(paramDestType);
4720 }
4721 paramSource = paramSource->next;
4722 }
4723 if(paramSource)
4724 {
4725 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "too many parameters\n", (((void *)0))));
4726 return 0x0;
4727 }
4728 return 0x1;
4729 }
4730 else if((dest->kind == 11 || (dest->kind == 13 && dest->type->kind == 11) || dest->kind == 16) && (source->kind == 13 && source->type->kind == 0))
4731 {
4732 return 0x1;
4733 }
4734 else if((dest->kind == 13 || dest->kind == 12) && (source->kind == 12 || source->kind == 13))
4735 {
4736 if(MatchTypes(source->type, dest->type, (((void *)0)), (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
4737 return 0x1;
4738 }
4739 }
4740 return 0x0;
4741 }
4742
4743 static void FreeConvert(struct Conversion * convert)
4744 {
4745 if(convert->resultType)
4746 FreeType(convert->resultType);
4747 }
4748
4749 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__BTNamedLink;
4750
4751 struct __ecereNameSpace__ecere__com__BTNamedLink
4752 {
4753 char *  name;
4754 struct __ecereNameSpace__ecere__com__BTNamedLink * parent;
4755 struct __ecereNameSpace__ecere__com__BTNamedLink * left;
4756 struct __ecereNameSpace__ecere__com__BTNamedLink * right;
4757 int depth;
4758 void *  data;
4759 };
4760
4761 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__EnumClassData;
4762
4763 struct __ecereNameSpace__ecere__com__EnumClassData
4764 {
4765 struct __ecereNameSpace__ecere__sys__OldList values;
4766 int largest;
4767 };
4768
4769 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__NamedLink;
4770
4771 struct __ecereNameSpace__ecere__sys__NamedLink
4772 {
4773 struct __ecereNameSpace__ecere__sys__NamedLink * prev;
4774 struct __ecereNameSpace__ecere__sys__NamedLink * next;
4775 char *  name;
4776 void *  data;
4777 };
4778
4779 extern void FreeExpContents(struct Expression * exp);
4780
4781 struct __ecereNameSpace__ecere__sys__BTNode * __ecereProp___ecereNameSpace__ecere__sys__BinaryTree_Get_first(struct __ecereNameSpace__ecere__sys__BinaryTree * this);
4782
4783 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp___ecereNameSpace__ecere__sys__BinaryTree_first;
4784
4785 struct __ecereNameSpace__ecere__sys__BTNode * __ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_next(struct __ecereNameSpace__ecere__sys__BTNode * this);
4786
4787 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp___ecereNameSpace__ecere__sys__BTNode_next;
4788
4789 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(struct __ecereNameSpace__ecere__sys__OldList * this, void (*  freeFn)(void * ));
4790
4791 unsigned int MatchWithEnums_NameSpace(struct __ecereNameSpace__ecere__com__NameSpace * nameSpace, struct Expression * sourceExp, struct Type * dest, char * string, struct __ecereNameSpace__ecere__sys__OldList * conversions)
4792 {
4793 struct __ecereNameSpace__ecere__com__BTNamedLink * link;
4794
4795 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)))
4796 {
4797 struct __ecereNameSpace__ecere__com__Class * _class = link->data;
4798
4799 if(_class->type == 4)
4800 {
4801 struct __ecereNameSpace__ecere__sys__OldList converts = 
4802 {
4803 0, 0, 0, 0, 0
4804 };
4805 struct Type * type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
4806
4807 type->kind = 8;
4808 if(!_class->symbol)
4809 _class->symbol = FindClass(_class->fullName);
4810 type->_class = _class->symbol;
4811 if(MatchTypes(type, dest, &converts, (((void *)0)), (((void *)0)), 0x1, 0x0, 0x0, 0x0))
4812 {
4813 struct __ecereNameSpace__ecere__sys__NamedLink * value;
4814 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
4815
4816 if(enumClass)
4817 {
4818 struct __ecereNameSpace__ecere__com__Class * baseClass;
4819
4820 for(baseClass = _class; baseClass && baseClass->type == 4; baseClass = baseClass->base)
4821 {
4822 struct __ecereNameSpace__ecere__com__EnumClassData * e = (baseClass ? ((void *)(((char *)baseClass->data) + enumClass->offsetClass)) : (((void *)0)));
4823
4824 for(value = e->values.first; value; value = value->next)
4825 {
4826 if(!strcmp(value->name, string))
4827 break;
4828 }
4829 if(value)
4830 {
4831 FreeExpContents(sourceExp);
4832 FreeType(sourceExp->expType);
4833 sourceExp->isConstant = 0x1;
4834 sourceExp->expType = MkClassType(baseClass->fullName);
4835 {
4836 char constant[256];
4837
4838 sourceExp->type = 2;
4839 if(!strcmp(baseClass->dataTypeString, "int"))
4840 sprintf(constant, "%d", value->data);
4841 else
4842 sprintf(constant, "0x%X", value->data);
4843 sourceExp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
4844 }
4845 while(converts.first)
4846 {
4847 struct Conversion * convert = converts.first;
4848
4849 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(&converts, convert);
4850 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(conversions, convert);
4851 }
4852 ((type ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(type) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(type)) : 0), type = 0);
4853 return 0x1;
4854 }
4855 }
4856 }
4857 }
4858 if(converts.first)
4859 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(&converts, FreeConvert);
4860 ((type ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(type) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(type)) : 0), type = 0);
4861 }
4862 }
4863 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)))
4864 if(MatchWithEnums_NameSpace(nameSpace, sourceExp, dest, string, conversions))
4865 return 0x1;
4866 return 0x0;
4867 }
4868
4869 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__SubModule;
4870
4871 struct __ecereNameSpace__ecere__com__SubModule
4872 {
4873 struct __ecereNameSpace__ecere__com__SubModule * prev;
4874 struct __ecereNameSpace__ecere__com__SubModule * next;
4875 struct __ecereNameSpace__ecere__com__Instance * module;
4876 int importMode;
4877 };
4878
4879 unsigned int ModuleVisibility(struct __ecereNameSpace__ecere__com__Instance * searchIn, struct __ecereNameSpace__ecere__com__Instance * searchFor)
4880 {
4881 struct __ecereNameSpace__ecere__com__SubModule * subModule;
4882
4883 if(searchFor == searchIn)
4884 return 0x1;
4885 for(subModule = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)searchIn + 12)))->modules.first; subModule; subModule = subModule->next)
4886 {
4887 if(subModule->importMode == 1 || searchIn == ((struct __ecereNameSpace__ecere__com__Module *)(((char *)searchIn + 12)))->application)
4888 {
4889 if(ModuleVisibility(subModule->module, searchFor))
4890 return 0x1;
4891 }
4892 }
4893 return 0x0;
4894 }
4895
4896 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Application;
4897
4898 struct __ecereNameSpace__ecere__com__Application
4899 {
4900 int argc;
4901 char * *  argv;
4902 int exitCode;
4903 unsigned int isGUIApp;
4904 struct __ecereNameSpace__ecere__sys__OldList allModules;
4905 char *  parsedCommand;
4906 struct __ecereNameSpace__ecere__com__NameSpace systemNameSpace;
4907 };
4908
4909 unsigned int MatchWithEnums_Module(struct __ecereNameSpace__ecere__com__Instance * mainModule, struct Expression * sourceExp, struct Type * dest, char * string, struct __ecereNameSpace__ecere__sys__OldList * conversions)
4910 {
4911 struct __ecereNameSpace__ecere__com__Instance * module;
4912
4913 if(MatchWithEnums_NameSpace(&((struct __ecereNameSpace__ecere__com__Application *)(((char *)((struct __ecereNameSpace__ecere__com__Module *)(((char *)mainModule + 12)))->application + 296)))->systemNameSpace, sourceExp, dest, string, conversions))
4914 return 0x1;
4915 if(MatchWithEnums_NameSpace(&((struct __ecereNameSpace__ecere__com__Module *)(((char *)((struct __ecereNameSpace__ecere__com__Module *)(((char *)mainModule + 12)))->application + 12)))->privateNameSpace, sourceExp, dest, string, conversions))
4916 return 0x1;
4917 if(MatchWithEnums_NameSpace(&((struct __ecereNameSpace__ecere__com__Module *)(((char *)((struct __ecereNameSpace__ecere__com__Module *)(((char *)mainModule + 12)))->application + 12)))->publicNameSpace, sourceExp, dest, string, conversions))
4918 return 0x1;
4919 for(module = ((struct __ecereNameSpace__ecere__com__Application *)(((char *)((struct __ecereNameSpace__ecere__com__Module *)(((char *)mainModule + 12)))->application + 296)))->allModules.first; module; module = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + 12)))->next)
4920 {
4921 if(ModuleVisibility(mainModule, module) && MatchWithEnums_NameSpace(&((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + 12)))->publicNameSpace, sourceExp, dest, string, conversions))
4922 return 0x1;
4923 }
4924 return 0x0;
4925 }
4926
4927 extern unsigned long strtoul(const char *  nptr, char * *  endptr, int base);
4928
4929 void ReadString(char *  output, char *  string);
4930
4931 extern struct Specifier * MkEnum(struct Identifier * id, struct __ecereNameSpace__ecere__sys__OldList * list);
4932
4933 extern struct TypeName * QMkClass(char *  spec, struct Declarator * decl);
4934
4935 extern struct Expression * MkExpBrackets(struct __ecereNameSpace__ecere__sys__OldList * expressions);
4936
4937 unsigned int MatchTypeExpression(struct Expression * sourceExp, struct Type * dest, struct __ecereNameSpace__ecere__sys__OldList * conversions, unsigned int skipUnitBla)
4938 {
4939 void * __ecereTemp1;
4940 struct Type * source = sourceExp->expType;
4941 struct Type * realDest = dest;
4942
4943 if(dest->kind == 13 && sourceExp->type == 2 && !strtoul(sourceExp->constant, (((void *)0)), 0))
4944 return 0x1;
4945 if(!skipUnitBla && source && dest && source->kind == 8 && dest->kind == 8)
4946 {
4947 if(source->_class && source->_class->registered && source->_class->registered->type == 3)
4948 {
4949 struct __ecereNameSpace__ecere__com__Class * sourceBase, * destBase;
4950
4951 for(sourceBase = source->_class->registered; sourceBase && sourceBase->base && sourceBase->base->type != 1000; sourceBase = sourceBase->base)
4952 ;
4953 for(destBase = dest->_class->registered; destBase && destBase->base && destBase->base->type != 1000; destBase = destBase->base)
4954 ;
4955 if(sourceBase == destBase)
4956 return 0x1;
4957 }
4958 }
4959 if(source)
4960 {
4961 struct __ecereNameSpace__ecere__sys__OldList * specs;
4962 unsigned int flag = 0x0;
4963 long long value = (((int)0x7fffffff));
4964
4965 source->refCount++;
4966 dest->refCount++;
4967 if(sourceExp->type == 2)
4968 {
4969 if(source->isSigned)
4970 value = strtoll(sourceExp->constant, (((void *)0)), 0);
4971 else
4972 value = strtoull(sourceExp->constant, (((void *)0)), 0);
4973 }
4974 else if(sourceExp->type == 4 && sourceExp->op.op == '-' && !sourceExp->op.exp1 && sourceExp->op.exp2 && sourceExp->op.exp2->type == 2)
4975 {
4976 if(source->isSigned)
4977 value = -strtoll(sourceExp->op.exp2->constant, (((void *)0)), 0);
4978 else
4979 value = -strtoull(sourceExp->op.exp2->constant, (((void *)0)), 0);
4980 }
4981 if(dest->kind != 8 && source->kind == 8 && source->_class && source->_class->registered && !strcmp(source->_class->registered->fullName, "ecere::com::unichar"))
4982 {
4983 FreeType(source);
4984 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));
4985 }
4986 if(dest->kind == 8)
4987 {
4988 struct __ecereNameSpace__ecere__com__Class * _class = dest->_class ? dest->_class->registered : (((void *)0));
4989
4990 if(_class && _class->type == 3)
4991 {
4992 if(source->kind != 8)
4993 {
4994 struct Type * tempType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
4995 struct Type * tempDest, * tempSource;
4996
4997 for(; _class->base->type != 1000; _class = _class->base)
4998 ;
4999 tempSource = dest;
5000 tempDest = tempType;
5001 tempType->kind = 8;
5002 if(!_class->symbol)
5003 _class->symbol = FindClass(_class->fullName);
5004 tempType->_class = _class->symbol;
5005 tempType->truth = dest->truth;
5006 if(tempType->_class)
5007 MatchTypes(tempSource, tempDest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0);
5008 FreeType(sourceExp->expType);
5009 sourceExp->expType = dest;
5010 dest->refCount++;
5011 flag = 0x1;
5012 ((tempType ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(tempType) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(tempType)) : 0), tempType = 0);
5013 }
5014 }
5015 if(_class && _class->type == 2 && source->kind != 8)
5016 {
5017 if(!dest->_class->registered->dataType)
5018 dest->_class->registered->dataType = ProcessTypeString(dest->_class->registered->dataTypeString, 0x0);
5019 if(MatchTypes(source, dest->_class->registered->dataType, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
5020 {
5021 FreeType(source);
5022 FreeType(sourceExp->expType);
5023 source = sourceExp->expType = MkClassType(dest->_class->string);
5024 source->refCount++;
5025 }
5026 }
5027 if(_class && !strcmp(_class->fullName, "ecere::com::Class") && source->kind == 13 && source->type && source->type->kind == 1 && sourceExp->type == 3)
5028 {
5029 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
5030 struct Declarator * decl;
5031 char string[1024];
5032
5033 ReadString(string, sourceExp->string);
5034 decl = SpecDeclFromString(string, specs, (((void *)0)));
5035 FreeExpContents(sourceExp);
5036 FreeType(sourceExp->expType);
5037 sourceExp->type = 26;
5038 sourceExp->_classExp.specifiers = specs;
5039 sourceExp->_classExp.decl = decl;
5040 sourceExp->expType = dest;
5041 dest->refCount++;
5042 FreeType(source);
5043 FreeType(dest);
5044 return 0x1;
5045 }
5046 }
5047 else if(source->kind == 8)
5048 {
5049 struct __ecereNameSpace__ecere__com__Class * _class = source->_class ? source->_class->registered : (((void *)0));
5050
5051 if(_class && (_class->type == 3 || !strcmp(_class->fullName, "bool") || _class->type == 2))
5052 {
5053 if(dest->kind != 8)
5054 {
5055 struct Type * tempType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5056 struct Type * tempDest, * tempSource;
5057
5058 if(!source->_class->registered->dataType)
5059 source->_class->registered->dataType = ProcessTypeString(source->_class->registered->dataTypeString, 0x0);
5060 for(; _class->base->type != 1000; _class = _class->base)
5061 ;
5062 tempDest = source;
5063 tempSource = tempType;
5064 tempType->kind = 8;
5065 tempType->_class = FindClass(_class->fullName);
5066 tempType->truth = source->truth;
5067 tempType->classObjectType = source->classObjectType;
5068 if(tempType->_class)
5069 MatchTypes(tempSource, tempDest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0);
5070 if(conversions->last)
5071 {
5072 ((struct Conversion *)conversions->last)->resultType = dest;
5073 dest->refCount++;
5074 }
5075 FreeType(sourceExp->expType);
5076 sourceExp->expType = MkClassType(_class->fullName);
5077 sourceExp->expType->truth = source->truth;
5078 sourceExp->expType->classObjectType = source->classObjectType;
5079 if(!sourceExp->destType)
5080 {
5081 FreeType(sourceExp->destType);
5082 sourceExp->destType = sourceExp->expType;
5083 if(sourceExp->expType)
5084 sourceExp->expType->refCount++;
5085 }
5086 if(!_class->dataType)
5087 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
5088 FreeType(dest);
5089 dest = MkClassType(source->_class->string);
5090 dest->truth = source->truth;
5091 dest->classObjectType = source->classObjectType;
5092 FreeType(source);
5093 source = _class->dataType;
5094 source->refCount++;
5095 ((tempType ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(tempType) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(tempType)) : 0), tempType = 0);
5096 }
5097 }
5098 }
5099 if(!flag)
5100 {
5101 if(MatchTypes(source, dest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
5102 {
5103 FreeType(source);
5104 FreeType(dest);
5105 return 0x1;
5106 }
5107 }
5108 if(dest->kind == 8)
5109 {
5110 struct __ecereNameSpace__ecere__com__Class * _class = dest->_class ? dest->_class->registered : (((void *)0));
5111
5112 if(_class && !dest->truth && (_class->type == 3 || !strcmp(_class->fullName, "bool") || (_class->type != 1 && !value && source->kind == 3) || _class->type == 2))
5113 {
5114 if(_class->type == 0 || _class->type == 5)
5115 {
5116 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
5117
5118 *newExp = *sourceExp;
5119 if(sourceExp->destType)
5120 sourceExp->destType->refCount++;
5121 if(sourceExp->expType)
5122 sourceExp->expType->refCount++;
5123 sourceExp->type = 11;
5124 sourceExp->cast.typeName = MkTypeName(MkListOne(MkSpecifier(VOID)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0))));
5125 sourceExp->cast.exp = newExp;
5126 FreeType(sourceExp->expType);
5127 sourceExp->expType = (((void *)0));
5128 ProcessExpressionType(sourceExp);
5129 if(!inCompiler)
5130 {
5131 FreeType(sourceExp->expType);
5132 sourceExp->expType = dest;
5133 }
5134 FreeType(source);
5135 if(inCompiler)
5136 FreeType(dest);
5137 return 0x1;
5138 }
5139 if(!_class->dataType)
5140 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
5141 FreeType(dest);
5142 dest = _class->dataType;
5143 dest->refCount++;
5144 }
5145 if(dest->kind == 7 && (source->kind == 7 || source->kind == 6 || dest->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 1))
5146 {
5147 specs = MkListOne(MkSpecifier(DOUBLE));
5148 }
5149 else if(dest->kind == 6 && (source->kind == 6 || dest->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 7))
5150 {
5151 specs = MkListOne(MkSpecifier(FLOAT));
5152 }
5153 else if(dest->kind == 4 && (source->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 6 || source->kind == 7))
5154 {
5155 specs = MkList();
5156 if(!dest->isSigned)
5157 ListAdd(specs, MkSpecifier(UNSIGNED));
5158 ListAdd(specs, MkSpecifier(INT64));
5159 }
5160 else if(dest->kind == 3 && (source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 6 || source->kind == 7))
5161 {
5162 specs = MkList();
5163 if(!dest->isSigned)
5164 ListAdd(specs, MkSpecifier(UNSIGNED));
5165 ListAdd(specs, MkSpecifier(INT));
5166 }
5167 else if(dest->kind == 2 && (source->kind == 2 || source->kind == 1 || source->kind == 3 || source->kind == 6 || source->kind == 7))
5168 {
5169 specs = MkList();
5170 if(!dest->isSigned)
5171 ListAdd(specs, MkSpecifier(UNSIGNED));
5172 ListAdd(specs, MkSpecifier(SHORT));
5173 }
5174 else if(dest->kind == 1 && (source->kind == 1 || source->kind == 2 || source->kind == 3 || source->kind == 6 || source->kind == 7))
5175 {
5176 specs = MkList();
5177 if(!dest->isSigned)
5178 ListAdd(specs, MkSpecifier(UNSIGNED));
5179 ListAdd(specs, MkSpecifier(CHAR));
5180 }
5181 else
5182 {
5183 FreeType(source);
5184 FreeType(dest);
5185 return 0x0;
5186 }
5187 }
5188 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))
5189 {
5190 specs = MkListOne(MkSpecifier(DOUBLE));
5191 }
5192 else if(dest->kind == 6 && (source->kind == 6 || source->kind == 15 || source->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 1))
5193 {
5194 specs = MkListOne(MkSpecifier(FLOAT));
5195 }
5196 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)))
5197 {
5198 specs = MkList();
5199 if(!dest->isSigned)
5200 ListAdd(specs, MkSpecifier(UNSIGNED));
5201 ListAdd(specs, MkSpecifier(CHAR));
5202 }
5203 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)))))
5204 {
5205 specs = MkList();
5206 if(!dest->isSigned)
5207 ListAdd(specs, MkSpecifier(UNSIGNED));
5208 ListAdd(specs, MkSpecifier(SHORT));
5209 }
5210 else if(dest->kind == 3 && (source->kind == 15 || source->kind == 2 || source->kind == 1 || source->kind == 3))
5211 {
5212 specs = MkList();
5213 if(!dest->isSigned)
5214 ListAdd(specs, MkSpecifier(UNSIGNED));
5215 ListAdd(specs, MkSpecifier(INT));
5216 }
5217 else if(dest->kind == 4 && (source->kind == 15 || source->kind == 2 || source->kind == 1 || source->kind == 3 || source->kind == 4))
5218 {
5219 specs = MkList();
5220 if(!dest->isSigned)
5221 ListAdd(specs, MkSpecifier(UNSIGNED));
5222 ListAdd(specs, MkSpecifier(INT64));
5223 }
5224 else if(dest->kind == 15 && (source->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 1))
5225 {
5226 specs = MkListOne(MkEnum(MkIdentifier(dest->enumName), (((void *)0))));
5227 }
5228 else
5229 {
5230 FreeType(source);
5231 FreeType(dest);
5232 return 0x0;
5233 }
5234 if(!flag)
5235 {
5236 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
5237
5238 *newExp = *sourceExp;
5239 newExp->prev = (((void *)0));
5240 newExp->next = (((void *)0));
5241 if(sourceExp->destType)
5242 sourceExp->destType->refCount++;
5243 if(sourceExp->expType)
5244 sourceExp->expType->refCount++;
5245 sourceExp->type = 11;
5246 if(realDest->kind == 8)
5247 {
5248 sourceExp->cast.typeName = QMkClass(realDest->_class->string, (((void *)0)));
5249 FreeList(specs, FreeSpecifier);
5250 }
5251 else
5252 sourceExp->cast.typeName = MkTypeName(specs, (((void *)0)));
5253 if(newExp->type == 4)
5254 {
5255 sourceExp->cast.exp = MkExpBrackets(MkListOne(newExp));
5256 }
5257 else
5258 sourceExp->cast.exp = newExp;
5259 FreeType(sourceExp->expType);
5260 sourceExp->expType = (((void *)0));
5261 ProcessExpressionType(sourceExp);
5262 }
5263 else
5264 FreeList(specs, FreeSpecifier);
5265 FreeType(dest);
5266 FreeType(source);
5267 return 0x1;
5268 }
5269 else
5270 {
5271 while((sourceExp->type == 5 || sourceExp->type == 34) && sourceExp->list)
5272 sourceExp = (*sourceExp->list).last;
5273 if(sourceExp->type == 0)
5274 {
5275 struct Identifier * id = sourceExp->identifier;
5276
5277 if(dest->kind == 8)
5278 {
5279 if(dest->_class && dest->_class->registered && dest->_class->registered->type == 4)
5280 {
5281 struct __ecereNameSpace__ecere__com__Class * _class = dest->_class->registered;
5282 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
5283
5284 if(enumClass)
5285 {
5286 for(; _class && _class->type == 4; _class = _class->base)
5287 {
5288 struct __ecereNameSpace__ecere__sys__NamedLink * value;
5289 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
5290
5291 for(value = e->values.first; value; value = value->next)
5292 {
5293 if(!strcmp(value->name, id->string))
5294 break;
5295 }
5296 if(value)
5297 {
5298 FreeExpContents(sourceExp);
5299 FreeType(sourceExp->expType);
5300 sourceExp->isConstant = 0x1;
5301 sourceExp->expType = MkClassType(_class->fullName);
5302 {
5303 char constant[256];
5304
5305 sourceExp->type = 2;
5306 if(_class->dataTypeString && !strcmp(_class->dataTypeString, "int"))
5307 sprintf(constant, "%d", value->data);
5308 else
5309 sprintf(constant, "0x%X", value->data);
5310 sourceExp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
5311 }
5312 return 0x1;
5313 }
5314 }
5315 }
5316 }
5317 }
5318 if(dest->classObjectType != 2 && dest->kind == 8 && MatchWithEnums_Module(privateModule, sourceExp, dest, id->string, conversions))
5319 return 0x1;
5320 }
5321 }
5322 return 0x0;
5323 }
5324
5325 static unsigned int IntAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5326 {
5327 int value2 = op2->i;
5328
5329 exp->type = 2;
5330 exp->string = PrintInt(op1->i + value2);
5331 if(!exp->expType)
5332 {
5333 exp->expType = op1->type;
5334 if(op1->type)
5335 op1->type->refCount++;
5336 }
5337 return 0x1;
5338 }
5339
5340 static unsigned int UIntAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5341 {
5342 unsigned int value2 = op2->ui;
5343
5344 exp->type = 2;
5345 exp->string = PrintUInt(op1->ui + value2);
5346 if(!exp->expType)
5347 {
5348 exp->expType = op1->type;
5349 if(op1->type)
5350 op1->type->refCount++;
5351 }
5352 return 0x1;
5353 }
5354
5355 static unsigned int ShortAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5356 {
5357 short value2 = op2->s;
5358
5359 exp->type = 2;
5360 exp->string = PrintShort(op1->s + value2);
5361 if(!exp->expType)
5362 {
5363 exp->expType = op1->type;
5364 if(op1->type)
5365 op1->type->refCount++;
5366 }
5367 return 0x1;
5368 }
5369
5370 static unsigned int UShortAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5371 {
5372 unsigned short value2 = op2->us;
5373
5374 exp->type = 2;
5375 exp->string = PrintUShort(op1->us + value2);
5376 if(!exp->expType)
5377 {
5378 exp->expType = op1->type;
5379 if(op1->type)
5380 op1->type->refCount++;
5381 }
5382 return 0x1;
5383 }
5384
5385 static unsigned int CharAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5386 {
5387 char value2 = op2->c;
5388
5389 exp->type = 2;
5390 exp->string = PrintChar(op1->c + value2);
5391 if(!exp->expType)
5392 {
5393 exp->expType = op1->type;
5394 if(op1->type)
5395 op1->type->refCount++;
5396 }
5397 return 0x1;
5398 }
5399
5400 static unsigned int UCharAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5401 {
5402 unsigned char value2 = op2->uc;
5403
5404 exp->type = 2;
5405 exp->string = PrintUChar(op1->uc + value2);
5406 if(!exp->expType)
5407 {
5408 exp->expType = op1->type;
5409 if(op1->type)
5410 op1->type->refCount++;
5411 }
5412 return 0x1;
5413 }
5414
5415 static unsigned int FloatAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5416 {
5417 float value2 = op2->f;
5418
5419 exp->type = 2;
5420 exp->string = PrintFloat(op1->f + value2);
5421 if(!exp->expType)
5422 {
5423 exp->expType = op1->type;
5424 if(op1->type)
5425 op1->type->refCount++;
5426 }
5427 return 0x1;
5428 }
5429
5430 static unsigned int DoubleAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5431 {
5432 double value2 = op2->d;
5433
5434 exp->type = 2;
5435 exp->string = PrintDouble(op1->d + value2);
5436 if(!exp->expType)
5437 {
5438 exp->expType = op1->type;
5439 if(op1->type)
5440 op1->type->refCount++;
5441 }
5442 return 0x1;
5443 }
5444
5445 static unsigned int IntSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5446 {
5447 int value2 = op2->i;
5448
5449 exp->type = 2;
5450 exp->string = PrintInt(op1->i - value2);
5451 if(!exp->expType)
5452 {
5453 exp->expType = op1->type;
5454 if(op1->type)
5455 op1->type->refCount++;
5456 }
5457 return 0x1;
5458 }
5459
5460 static unsigned int UIntSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5461 {
5462 unsigned int value2 = op2->ui;
5463
5464 exp->type = 2;
5465 exp->string = PrintUInt(op1->ui - value2);
5466 if(!exp->expType)
5467 {
5468 exp->expType = op1->type;
5469 if(op1->type)
5470 op1->type->refCount++;
5471 }
5472 return 0x1;
5473 }
5474
5475 static unsigned int ShortSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5476 {
5477 short value2 = op2->s;
5478
5479 exp->type = 2;
5480 exp->string = PrintShort(op1->s - value2);
5481 if(!exp->expType)
5482 {
5483 exp->expType = op1->type;
5484 if(op1->type)
5485 op1->type->refCount++;
5486 }
5487 return 0x1;
5488 }
5489
5490 static unsigned int UShortSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5491 {
5492 unsigned short value2 = op2->us;
5493
5494 exp->type = 2;
5495 exp->string = PrintUShort(op1->us - value2);
5496 if(!exp->expType)
5497 {
5498 exp->expType = op1->type;
5499 if(op1->type)
5500 op1->type->refCount++;
5501 }
5502 return 0x1;
5503 }
5504
5505 static unsigned int CharSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5506 {
5507 char value2 = op2->c;
5508
5509 exp->type = 2;
5510 exp->string = PrintChar(op1->c - value2);
5511 if(!exp->expType)
5512 {
5513 exp->expType = op1->type;
5514 if(op1->type)
5515 op1->type->refCount++;
5516 }
5517 return 0x1;
5518 }
5519
5520 static unsigned int UCharSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5521 {
5522 unsigned char value2 = op2->uc;
5523
5524 exp->type = 2;
5525 exp->string = PrintUChar(op1->uc - value2);
5526 if(!exp->expType)
5527 {
5528 exp->expType = op1->type;
5529 if(op1->type)
5530 op1->type->refCount++;
5531 }
5532 return 0x1;
5533 }
5534
5535 static unsigned int FloatSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5536 {
5537 float value2 = op2->f;
5538
5539 exp->type = 2;
5540 exp->string = PrintFloat(op1->f - value2);
5541 if(!exp->expType)
5542 {
5543 exp->expType = op1->type;
5544 if(op1->type)
5545 op1->type->refCount++;
5546 }
5547 return 0x1;
5548 }
5549
5550 static unsigned int DoubleSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5551 {
5552 double value2 = op2->d;
5553
5554 exp->type = 2;
5555 exp->string = PrintDouble(op1->d - value2);
5556 if(!exp->expType)
5557 {
5558 exp->expType = op1->type;
5559 if(op1->type)
5560 op1->type->refCount++;
5561 }
5562 return 0x1;
5563 }
5564
5565 static unsigned int IntMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5566 {
5567 int value2 = op2->i;
5568
5569 exp->type = 2;
5570 exp->string = PrintInt(op1->i * value2);
5571 if(!exp->expType)
5572 {
5573 exp->expType = op1->type;
5574 if(op1->type)
5575 op1->type->refCount++;
5576 }
5577 return 0x1;
5578 }
5579
5580 static unsigned int UIntMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5581 {
5582 unsigned int value2 = op2->ui;
5583
5584 exp->type = 2;
5585 exp->string = PrintUInt(op1->ui * value2);
5586 if(!exp->expType)
5587 {
5588 exp->expType = op1->type;
5589 if(op1->type)
5590 op1->type->refCount++;
5591 }
5592 return 0x1;
5593 }
5594
5595 static unsigned int ShortMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5596 {
5597 short value2 = op2->s;
5598
5599 exp->type = 2;
5600 exp->string = PrintShort(op1->s * value2);
5601 if(!exp->expType)
5602 {
5603 exp->expType = op1->type;
5604 if(op1->type)
5605 op1->type->refCount++;
5606 }
5607 return 0x1;
5608 }
5609
5610 static unsigned int UShortMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5611 {
5612 unsigned short value2 = op2->us;
5613
5614 exp->type = 2;
5615 exp->string = PrintUShort(op1->us * value2);
5616 if(!exp->expType)
5617 {
5618 exp->expType = op1->type;
5619 if(op1->type)
5620 op1->type->refCount++;
5621 }
5622 return 0x1;
5623 }
5624
5625 static unsigned int CharMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5626 {
5627 char value2 = op2->c;
5628
5629 exp->type = 2;
5630 exp->string = PrintChar(op1->c * value2);
5631 if(!exp->expType)
5632 {
5633 exp->expType = op1->type;
5634 if(op1->type)
5635 op1->type->refCount++;
5636 }
5637 return 0x1;
5638 }
5639
5640 static unsigned int UCharMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5641 {
5642 unsigned char value2 = op2->uc;
5643
5644 exp->type = 2;
5645 exp->string = PrintUChar(op1->uc * value2);
5646 if(!exp->expType)
5647 {
5648 exp->expType = op1->type;
5649 if(op1->type)
5650 op1->type->refCount++;
5651 }
5652 return 0x1;
5653 }
5654
5655 static unsigned int FloatMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5656 {
5657 float value2 = op2->f;
5658
5659 exp->type = 2;
5660 exp->string = PrintFloat(op1->f * value2);
5661 if(!exp->expType)
5662 {
5663 exp->expType = op1->type;
5664 if(op1->type)
5665 op1->type->refCount++;
5666 }
5667 return 0x1;
5668 }
5669
5670 static unsigned int DoubleMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5671 {
5672 double value2 = op2->d;
5673
5674 exp->type = 2;
5675 exp->string = PrintDouble(op1->d * value2);
5676 if(!exp->expType)
5677 {
5678 exp->expType = op1->type;
5679 if(op1->type)
5680 op1->type->refCount++;
5681 }
5682 return 0x1;
5683 }
5684
5685 static unsigned int IntDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5686 {
5687 int value2 = op2->i;
5688
5689 exp->type = 2;
5690 exp->string = PrintInt(value2 ? (op1->i / value2) : 0);
5691 if(!exp->expType)
5692 {
5693 exp->expType = op1->type;
5694 if(op1->type)
5695 op1->type->refCount++;
5696 }
5697 return 0x1;
5698 }
5699
5700 static unsigned int UIntDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5701 {
5702 unsigned int value2 = op2->ui;
5703
5704 exp->type = 2;
5705 exp->string = PrintUInt(value2 ? (op1->ui / value2) : 0);
5706 if(!exp->expType)
5707 {
5708 exp->expType = op1->type;
5709 if(op1->type)
5710 op1->type->refCount++;
5711 }
5712 return 0x1;
5713 }
5714
5715 static unsigned int ShortDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5716 {
5717 short value2 = op2->s;
5718
5719 exp->type = 2;
5720 exp->string = PrintShort(value2 ? (op1->s / value2) : (short)0);
5721 if(!exp->expType)
5722 {
5723 exp->expType = op1->type;
5724 if(op1->type)
5725 op1->type->refCount++;
5726 }
5727 return 0x1;
5728 }
5729
5730 static unsigned int UShortDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5731 {
5732 unsigned short value2 = op2->us;
5733
5734 exp->type = 2;
5735 exp->string = PrintUShort(value2 ? (op1->us / value2) : (unsigned short)0);
5736 if(!exp->expType)
5737 {
5738 exp->expType = op1->type;
5739 if(op1->type)
5740 op1->type->refCount++;
5741 }
5742 return 0x1;
5743 }
5744
5745 static unsigned int CharDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5746 {
5747 char value2 = op2->c;
5748
5749 exp->type = 2;
5750 exp->string = PrintChar(value2 ? (op1->c / value2) : (char)0);
5751 if(!exp->expType)
5752 {
5753 exp->expType = op1->type;
5754 if(op1->type)
5755 op1->type->refCount++;
5756 }
5757 return 0x1;
5758 }
5759
5760 static unsigned int UCharDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5761 {
5762 unsigned char value2 = op2->uc;
5763
5764 exp->type = 2;
5765 exp->string = PrintUChar(value2 ? (op1->uc / value2) : (unsigned char)0);
5766 if(!exp->expType)
5767 {
5768 exp->expType = op1->type;
5769 if(op1->type)
5770 op1->type->refCount++;
5771 }
5772 return 0x1;
5773 }
5774
5775 static unsigned int FloatDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5776 {
5777 float value2 = op2->f;
5778
5779 exp->type = 2;
5780 exp->string = PrintFloat(value2 ? (op1->f / value2) : (float)0);
5781 if(!exp->expType)
5782 {
5783 exp->expType = op1->type;
5784 if(op1->type)
5785 op1->type->refCount++;
5786 }
5787 return 0x1;
5788 }
5789
5790 static unsigned int DoubleDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5791 {
5792 double value2 = op2->d;
5793
5794 exp->type = 2;
5795 exp->string = PrintDouble(value2 ? (op1->d / value2) : (double)0);
5796 if(!exp->expType)
5797 {
5798 exp->expType = op1->type;
5799 if(op1->type)
5800 op1->type->refCount++;
5801 }
5802 return 0x1;
5803 }
5804
5805 static unsigned int IntMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5806 {
5807 int value2 = op2->i;
5808
5809 exp->type = 2;
5810 exp->string = PrintInt(value2 ? (op1->i % value2) : 0);
5811 if(!exp->expType)
5812 {
5813 exp->expType = op1->type;
5814 if(op1->type)
5815 op1->type->refCount++;
5816 }
5817 return 0x1;
5818 }
5819
5820 static unsigned int UIntMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5821 {
5822 unsigned int value2 = op2->ui;
5823
5824 exp->type = 2;
5825 exp->string = PrintUInt(value2 ? (op1->ui % value2) : 0);
5826 if(!exp->expType)
5827 {
5828 exp->expType = op1->type;
5829 if(op1->type)
5830 op1->type->refCount++;
5831 }
5832 return 0x1;
5833 }
5834
5835 static unsigned int ShortMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5836 {
5837 short value2 = op2->s;
5838
5839 exp->type = 2;
5840 exp->string = PrintShort(value2 ? (op1->s % value2) : (short)0);
5841 if(!exp->expType)
5842 {
5843 exp->expType = op1->type;
5844 if(op1->type)
5845 op1->type->refCount++;
5846 }
5847 return 0x1;
5848 }
5849
5850 static unsigned int UShortMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5851 {
5852 unsigned short value2 = op2->us;
5853
5854 exp->type = 2;
5855 exp->string = PrintUShort(value2 ? (op1->us % value2) : (unsigned short)0);
5856 if(!exp->expType)
5857 {
5858 exp->expType = op1->type;
5859 if(op1->type)
5860 op1->type->refCount++;
5861 }
5862 return 0x1;
5863 }
5864
5865 static unsigned int CharMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5866 {
5867 char value2 = op2->c;
5868
5869 exp->type = 2;
5870 exp->string = PrintChar(value2 ? (op1->c % value2) : (char)0);
5871 if(!exp->expType)
5872 {
5873 exp->expType = op1->type;
5874 if(op1->type)
5875 op1->type->refCount++;
5876 }
5877 return 0x1;
5878 }
5879
5880 static unsigned int UCharMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5881 {
5882 unsigned char value2 = op2->uc;
5883
5884 exp->type = 2;
5885 exp->string = PrintUChar(value2 ? (op1->uc % value2) : (unsigned char)0);
5886 if(!exp->expType)
5887 {
5888 exp->expType = op1->type;
5889 if(op1->type)
5890 op1->type->refCount++;
5891 }
5892 return 0x1;
5893 }
5894
5895 static unsigned int IntNeg(struct Expression * exp, struct Operand * op1)
5896 {
5897 exp->type = 2;
5898 exp->string = PrintInt(-op1->i);
5899 if(!exp->expType)
5900 {
5901 exp->expType = op1->type;
5902 if(op1->type)
5903 op1->type->refCount++;
5904 }
5905 return 0x1;
5906 }
5907
5908 static unsigned int UIntNeg(struct Expression * exp, struct Operand * op1)
5909 {
5910 exp->type = 2;
5911 exp->string = PrintUInt(-op1->ui);
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 ShortNeg(struct Expression * exp, struct Operand * op1)
5922 {
5923 exp->type = 2;
5924 exp->string = PrintShort(-op1->s);
5925 if(!exp->expType)
5926 {
5927 exp->expType = op1->type;
5928 if(op1->type)
5929 op1->type->refCount++;
5930 }
5931 return 0x1;
5932 }
5933
5934 static unsigned int UShortNeg(struct Expression * exp, struct Operand * op1)
5935 {
5936 exp->type = 2;
5937 exp->string = PrintUShort(-op1->us);
5938 if(!exp->expType)
5939 {
5940 exp->expType = op1->type;
5941 if(op1->type)
5942 op1->type->refCount++;
5943 }
5944 return 0x1;
5945 }
5946
5947 static unsigned int CharNeg(struct Expression * exp, struct Operand * op1)
5948 {
5949 exp->type = 2;
5950 exp->string = PrintChar(-op1->c);
5951 if(!exp->expType)
5952 {
5953 exp->expType = op1->type;
5954 if(op1->type)
5955 op1->type->refCount++;
5956 }
5957 return 0x1;
5958 }
5959
5960 static unsigned int UCharNeg(struct Expression * exp, struct Operand * op1)
5961 {
5962 exp->type = 2;
5963 exp->string = PrintUChar(-op1->uc);
5964 if(!exp->expType)
5965 {
5966 exp->expType = op1->type;
5967 if(op1->type)
5968 op1->type->refCount++;
5969 }
5970 return 0x1;
5971 }
5972
5973 static unsigned int FloatNeg(struct Expression * exp, struct Operand * op1)
5974 {
5975 exp->type = 2;
5976 exp->string = PrintFloat(-op1->f);
5977 if(!exp->expType)
5978 {
5979 exp->expType = op1->type;
5980 if(op1->type)
5981 op1->type->refCount++;
5982 }
5983 return 0x1;
5984 }
5985
5986 static unsigned int DoubleNeg(struct Expression * exp, struct Operand * op1)
5987 {
5988 exp->type = 2;
5989 exp->string = PrintDouble(-op1->d);
5990 if(!exp->expType)
5991 {
5992 exp->expType = op1->type;
5993 if(op1->type)
5994 op1->type->refCount++;
5995 }
5996 return 0x1;
5997 }
5998
5999 static unsigned int IntInc(struct Expression * exp, struct Operand * op1)
6000 {
6001 exp->type = 2;
6002 exp->string = PrintInt(++op1->i);
6003 if(!exp->expType)
6004 {
6005 exp->expType = op1->type;
6006 if(op1->type)
6007 op1->type->refCount++;
6008 }
6009 return 0x1;
6010 }
6011
6012 static unsigned int UIntInc(struct Expression * exp, struct Operand * op1)
6013 {
6014 exp->type = 2;
6015 exp->string = PrintUInt(++op1->ui);
6016 if(!exp->expType)
6017 {
6018 exp->expType = op1->type;
6019 if(op1->type)
6020 op1->type->refCount++;
6021 }
6022 return 0x1;
6023 }
6024
6025 static unsigned int ShortInc(struct Expression * exp, struct Operand * op1)
6026 {
6027 exp->type = 2;
6028 exp->string = PrintShort(++op1->s);
6029 if(!exp->expType)
6030 {
6031 exp->expType = op1->type;
6032 if(op1->type)
6033 op1->type->refCount++;
6034 }
6035 return 0x1;
6036 }
6037
6038 static unsigned int UShortInc(struct Expression * exp, struct Operand * op1)
6039 {
6040 exp->type = 2;
6041 exp->string = PrintUShort(++op1->us);
6042 if(!exp->expType)
6043 {
6044 exp->expType = op1->type;
6045 if(op1->type)
6046 op1->type->refCount++;
6047 }
6048 return 0x1;
6049 }
6050
6051 static unsigned int CharInc(struct Expression * exp, struct Operand * op1)
6052 {
6053 exp->type = 2;
6054 exp->string = PrintChar(++op1->c);
6055 if(!exp->expType)
6056 {
6057 exp->expType = op1->type;
6058 if(op1->type)
6059 op1->type->refCount++;
6060 }
6061 return 0x1;
6062 }
6063
6064 static unsigned int UCharInc(struct Expression * exp, struct Operand * op1)
6065 {
6066 exp->type = 2;
6067 exp->string = PrintUChar(++op1->uc);
6068 if(!exp->expType)
6069 {
6070 exp->expType = op1->type;
6071 if(op1->type)
6072 op1->type->refCount++;
6073 }
6074 return 0x1;
6075 }
6076
6077 static unsigned int FloatInc(struct Expression * exp, struct Operand * op1)
6078 {
6079 exp->type = 2;
6080 exp->string = PrintFloat(++op1->f);
6081 if(!exp->expType)
6082 {
6083 exp->expType = op1->type;
6084 if(op1->type)
6085 op1->type->refCount++;
6086 }
6087 return 0x1;
6088 }
6089
6090 static unsigned int DoubleInc(struct Expression * exp, struct Operand * op1)
6091 {
6092 exp->type = 2;
6093 exp->string = PrintDouble(++op1->d);
6094 if(!exp->expType)
6095 {
6096 exp->expType = op1->type;
6097 if(op1->type)
6098 op1->type->refCount++;
6099 }
6100 return 0x1;
6101 }
6102
6103 static unsigned int IntDec(struct Expression * exp, struct Operand * op1)
6104 {
6105 exp->type = 2;
6106 exp->string = PrintInt(--op1->i);
6107 if(!exp->expType)
6108 {
6109 exp->expType = op1->type;
6110 if(op1->type)
6111 op1->type->refCount++;
6112 }
6113 return 0x1;
6114 }
6115
6116 static unsigned int UIntDec(struct Expression * exp, struct Operand * op1)
6117 {
6118 exp->type = 2;
6119 exp->string = PrintUInt(--op1->ui);
6120 if(!exp->expType)
6121 {
6122 exp->expType = op1->type;
6123 if(op1->type)
6124 op1->type->refCount++;
6125 }
6126 return 0x1;
6127 }
6128
6129 static unsigned int ShortDec(struct Expression * exp, struct Operand * op1)
6130 {
6131 exp->type = 2;
6132 exp->string = PrintShort(--op1->s);
6133 if(!exp->expType)
6134 {
6135 exp->expType = op1->type;
6136 if(op1->type)
6137 op1->type->refCount++;
6138 }
6139 return 0x1;
6140 }
6141
6142 static unsigned int UShortDec(struct Expression * exp, struct Operand * op1)
6143 {
6144 exp->type = 2;
6145 exp->string = PrintUShort(--op1->us);
6146 if(!exp->expType)
6147 {
6148 exp->expType = op1->type;
6149 if(op1->type)
6150 op1->type->refCount++;
6151 }
6152 return 0x1;
6153 }
6154
6155 static unsigned int CharDec(struct Expression * exp, struct Operand * op1)
6156 {
6157 exp->type = 2;
6158 exp->string = PrintChar(--op1->c);
6159 if(!exp->expType)
6160 {
6161 exp->expType = op1->type;
6162 if(op1->type)
6163 op1->type->refCount++;
6164 }
6165 return 0x1;
6166 }
6167
6168 static unsigned int UCharDec(struct Expression * exp, struct Operand * op1)
6169 {
6170 exp->type = 2;
6171 exp->string = PrintUChar(--op1->uc);
6172 if(!exp->expType)
6173 {
6174 exp->expType = op1->type;
6175 if(op1->type)
6176 op1->type->refCount++;
6177 }
6178 return 0x1;
6179 }
6180
6181 static unsigned int FloatDec(struct Expression * exp, struct Operand * op1)
6182 {
6183 exp->type = 2;
6184 exp->string = PrintFloat(--op1->f);
6185 if(!exp->expType)
6186 {
6187 exp->expType = op1->type;
6188 if(op1->type)
6189 op1->type->refCount++;
6190 }
6191 return 0x1;
6192 }
6193
6194 static unsigned int DoubleDec(struct Expression * exp, struct Operand * op1)
6195 {
6196 exp->type = 2;
6197 exp->string = PrintDouble(--op1->d);
6198 if(!exp->expType)
6199 {
6200 exp->expType = op1->type;
6201 if(op1->type)
6202 op1->type->refCount++;
6203 }
6204 return 0x1;
6205 }
6206
6207 static unsigned int IntAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6208 {
6209 int value2 = op2->i;
6210
6211 exp->type = 2;
6212 exp->string = PrintInt(op1->i = value2);
6213 if(!exp->expType)
6214 {
6215 exp->expType = op1->type;
6216 if(op1->type)
6217 op1->type->refCount++;
6218 }
6219 return 0x1;
6220 }
6221
6222 static unsigned int UIntAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6223 {
6224 unsigned int value2 = op2->ui;
6225
6226 exp->type = 2;
6227 exp->string = PrintUInt(op1->ui = value2);
6228 if(!exp->expType)
6229 {
6230 exp->expType = op1->type;
6231 if(op1->type)
6232 op1->type->refCount++;
6233 }
6234 return 0x1;
6235 }
6236
6237 static unsigned int ShortAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6238 {
6239 short value2 = op2->s;
6240
6241 exp->type = 2;
6242 exp->string = PrintShort(op1->s = value2);
6243 if(!exp->expType)
6244 {
6245 exp->expType = op1->type;
6246 if(op1->type)
6247 op1->type->refCount++;
6248 }
6249 return 0x1;
6250 }
6251
6252 static unsigned int UShortAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6253 {
6254 unsigned short value2 = op2->us;
6255
6256 exp->type = 2;
6257 exp->string = PrintUShort(op1->us = value2);
6258 if(!exp->expType)
6259 {
6260 exp->expType = op1->type;
6261 if(op1->type)
6262 op1->type->refCount++;
6263 }
6264 return 0x1;
6265 }
6266
6267 static unsigned int CharAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6268 {
6269 char value2 = op2->c;
6270
6271 exp->type = 2;
6272 exp->string = PrintChar(op1->c = value2);
6273 if(!exp->expType)
6274 {
6275 exp->expType = op1->type;
6276 if(op1->type)
6277 op1->type->refCount++;
6278 }
6279 return 0x1;
6280 }
6281
6282 static unsigned int UCharAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6283 {
6284 unsigned char value2 = op2->uc;
6285
6286 exp->type = 2;
6287 exp->string = PrintUChar(op1->uc = value2);
6288 if(!exp->expType)
6289 {
6290 exp->expType = op1->type;
6291 if(op1->type)
6292 op1->type->refCount++;
6293 }
6294 return 0x1;
6295 }
6296
6297 static unsigned int FloatAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6298 {
6299 float value2 = op2->f;
6300
6301 exp->type = 2;
6302 exp->string = PrintFloat(op1->f = value2);
6303 if(!exp->expType)
6304 {
6305 exp->expType = op1->type;
6306 if(op1->type)
6307 op1->type->refCount++;
6308 }
6309 return 0x1;
6310 }
6311
6312 static unsigned int DoubleAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6313 {
6314 double value2 = op2->d;
6315
6316 exp->type = 2;
6317 exp->string = PrintDouble(op1->d = value2);
6318 if(!exp->expType)
6319 {
6320 exp->expType = op1->type;
6321 if(op1->type)
6322 op1->type->refCount++;
6323 }
6324 return 0x1;
6325 }
6326
6327 static unsigned int IntAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6328 {
6329 int value2 = op2->i;
6330
6331 exp->type = 2;
6332 exp->string = PrintInt(op1->i += value2);
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 UIntAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6343 {
6344 unsigned int value2 = op2->ui;
6345
6346 exp->type = 2;
6347 exp->string = PrintUInt(op1->ui += value2);
6348 if(!exp->expType)
6349 {
6350 exp->expType = op1->type;
6351 if(op1->type)
6352 op1->type->refCount++;
6353 }
6354 return 0x1;
6355 }
6356
6357 static unsigned int ShortAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6358 {
6359 short value2 = op2->s;
6360
6361 exp->type = 2;
6362 exp->string = PrintShort(op1->s += value2);
6363 if(!exp->expType)
6364 {
6365 exp->expType = op1->type;
6366 if(op1->type)
6367 op1->type->refCount++;
6368 }
6369 return 0x1;
6370 }
6371
6372 static unsigned int UShortAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6373 {
6374 unsigned short value2 = op2->us;
6375
6376 exp->type = 2;
6377 exp->string = PrintUShort(op1->us += value2);
6378 if(!exp->expType)
6379 {
6380 exp->expType = op1->type;
6381 if(op1->type)
6382 op1->type->refCount++;
6383 }
6384 return 0x1;
6385 }
6386
6387 static unsigned int CharAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6388 {
6389 char value2 = op2->c;
6390
6391 exp->type = 2;
6392 exp->string = PrintChar(op1->c += value2);
6393 if(!exp->expType)
6394 {
6395 exp->expType = op1->type;
6396 if(op1->type)
6397 op1->type->refCount++;
6398 }
6399 return 0x1;
6400 }
6401
6402 static unsigned int UCharAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6403 {
6404 unsigned char value2 = op2->uc;
6405
6406 exp->type = 2;
6407 exp->string = PrintUChar(op1->uc += value2);
6408 if(!exp->expType)
6409 {
6410 exp->expType = op1->type;
6411 if(op1->type)
6412 op1->type->refCount++;
6413 }
6414 return 0x1;
6415 }
6416
6417 static unsigned int FloatAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6418 {
6419 float value2 = op2->f;
6420
6421 exp->type = 2;
6422 exp->string = PrintFloat(op1->f += value2);
6423 if(!exp->expType)
6424 {
6425 exp->expType = op1->type;
6426 if(op1->type)
6427 op1->type->refCount++;
6428 }
6429 return 0x1;
6430 }
6431
6432 static unsigned int DoubleAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6433 {
6434 double value2 = op2->d;
6435
6436 exp->type = 2;
6437 exp->string = PrintDouble(op1->d += value2);
6438 if(!exp->expType)
6439 {
6440 exp->expType = op1->type;
6441 if(op1->type)
6442 op1->type->refCount++;
6443 }
6444 return 0x1;
6445 }
6446
6447 static unsigned int IntSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6448 {
6449 int value2 = op2->i;
6450
6451 exp->type = 2;
6452 exp->string = PrintInt(op1->i -= value2);
6453 if(!exp->expType)
6454 {
6455 exp->expType = op1->type;
6456 if(op1->type)
6457 op1->type->refCount++;
6458 }
6459 return 0x1;
6460 }
6461
6462 static unsigned int UIntSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6463 {
6464 unsigned int value2 = op2->ui;
6465
6466 exp->type = 2;
6467 exp->string = PrintUInt(op1->ui -= value2);
6468 if(!exp->expType)
6469 {
6470 exp->expType = op1->type;
6471 if(op1->type)
6472 op1->type->refCount++;
6473 }
6474 return 0x1;
6475 }
6476
6477 static unsigned int ShortSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6478 {
6479 short value2 = op2->s;
6480
6481 exp->type = 2;
6482 exp->string = PrintShort(op1->s -= value2);
6483 if(!exp->expType)
6484 {
6485 exp->expType = op1->type;
6486 if(op1->type)
6487 op1->type->refCount++;
6488 }
6489 return 0x1;
6490 }
6491
6492 static unsigned int UShortSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6493 {
6494 unsigned short value2 = op2->us;
6495
6496 exp->type = 2;
6497 exp->string = PrintUShort(op1->us -= value2);
6498 if(!exp->expType)
6499 {
6500 exp->expType = op1->type;
6501 if(op1->type)
6502 op1->type->refCount++;
6503 }
6504 return 0x1;
6505 }
6506
6507 static unsigned int CharSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6508 {
6509 char value2 = op2->c;
6510
6511 exp->type = 2;
6512 exp->string = PrintChar(op1->c -= value2);
6513 if(!exp->expType)
6514 {
6515 exp->expType = op1->type;
6516 if(op1->type)
6517 op1->type->refCount++;
6518 }
6519 return 0x1;
6520 }
6521
6522 static unsigned int UCharSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6523 {
6524 unsigned char value2 = op2->uc;
6525
6526 exp->type = 2;
6527 exp->string = PrintUChar(op1->uc -= value2);
6528 if(!exp->expType)
6529 {
6530 exp->expType = op1->type;
6531 if(op1->type)
6532 op1->type->refCount++;
6533 }
6534 return 0x1;
6535 }
6536
6537 static unsigned int FloatSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6538 {
6539 float value2 = op2->f;
6540
6541 exp->type = 2;
6542 exp->string = PrintFloat(op1->f -= value2);
6543 if(!exp->expType)
6544 {
6545 exp->expType = op1->type;
6546 if(op1->type)
6547 op1->type->refCount++;
6548 }
6549 return 0x1;
6550 }
6551
6552 static unsigned int DoubleSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6553 {
6554 double value2 = op2->d;
6555
6556 exp->type = 2;
6557 exp->string = PrintDouble(op1->d -= value2);
6558 if(!exp->expType)
6559 {
6560 exp->expType = op1->type;
6561 if(op1->type)
6562 op1->type->refCount++;
6563 }
6564 return 0x1;
6565 }
6566
6567 static unsigned int IntMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6568 {
6569 int value2 = op2->i;
6570
6571 exp->type = 2;
6572 exp->string = PrintInt(op1->i *= value2);
6573 if(!exp->expType)
6574 {
6575 exp->expType = op1->type;
6576 if(op1->type)
6577 op1->type->refCount++;
6578 }
6579 return 0x1;
6580 }
6581
6582 static unsigned int UIntMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6583 {
6584 unsigned int value2 = op2->ui;
6585
6586 exp->type = 2;
6587 exp->string = PrintUInt(op1->ui *= value2);
6588 if(!exp->expType)
6589 {
6590 exp->expType = op1->type;
6591 if(op1->type)
6592 op1->type->refCount++;
6593 }
6594 return 0x1;
6595 }
6596
6597 static unsigned int ShortMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6598 {
6599 short value2 = op2->s;
6600
6601 exp->type = 2;
6602 exp->string = PrintShort(op1->s *= value2);
6603 if(!exp->expType)
6604 {
6605 exp->expType = op1->type;
6606 if(op1->type)
6607 op1->type->refCount++;
6608 }
6609 return 0x1;
6610 }
6611
6612 static unsigned int UShortMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6613 {
6614 unsigned short value2 = op2->us;
6615
6616 exp->type = 2;
6617 exp->string = PrintUShort(op1->us *= value2);
6618 if(!exp->expType)
6619 {
6620 exp->expType = op1->type;
6621 if(op1->type)
6622 op1->type->refCount++;
6623 }
6624 return 0x1;
6625 }
6626
6627 static unsigned int CharMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6628 {
6629 char value2 = op2->c;
6630
6631 exp->type = 2;
6632 exp->string = PrintChar(op1->c *= value2);
6633 if(!exp->expType)
6634 {
6635 exp->expType = op1->type;
6636 if(op1->type)
6637 op1->type->refCount++;
6638 }
6639 return 0x1;
6640 }
6641
6642 static unsigned int UCharMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6643 {
6644 unsigned char value2 = op2->uc;
6645
6646 exp->type = 2;
6647 exp->string = PrintUChar(op1->uc *= value2);
6648 if(!exp->expType)
6649 {
6650 exp->expType = op1->type;
6651 if(op1->type)
6652 op1->type->refCount++;
6653 }
6654 return 0x1;
6655 }
6656
6657 static unsigned int FloatMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6658 {
6659 float value2 = op2->f;
6660
6661 exp->type = 2;
6662 exp->string = PrintFloat(op1->f *= value2);
6663 if(!exp->expType)
6664 {
6665 exp->expType = op1->type;
6666 if(op1->type)
6667 op1->type->refCount++;
6668 }
6669 return 0x1;
6670 }
6671
6672 static unsigned int DoubleMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6673 {
6674 double value2 = op2->d;
6675
6676 exp->type = 2;
6677 exp->string = PrintDouble(op1->d *= value2);
6678 if(!exp->expType)
6679 {
6680 exp->expType = op1->type;
6681 if(op1->type)
6682 op1->type->refCount++;
6683 }
6684 return 0x1;
6685 }
6686
6687 static unsigned int IntDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6688 {
6689 int value2 = op2->i;
6690
6691 exp->type = 2;
6692 exp->string = PrintInt(value2 ? (op1->i /= value2) : 0);
6693 if(!exp->expType)
6694 {
6695 exp->expType = op1->type;
6696 if(op1->type)
6697 op1->type->refCount++;
6698 }
6699 return 0x1;
6700 }
6701
6702 static unsigned int UIntDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6703 {
6704 unsigned int value2 = op2->ui;
6705
6706 exp->type = 2;
6707 exp->string = PrintUInt(value2 ? (op1->ui /= value2) : 0);
6708 if(!exp->expType)
6709 {
6710 exp->expType = op1->type;
6711 if(op1->type)
6712 op1->type->refCount++;
6713 }
6714 return 0x1;
6715 }
6716
6717 static unsigned int ShortDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6718 {
6719 short value2 = op2->s;
6720
6721 exp->type = 2;
6722 exp->string = PrintShort(value2 ? (op1->s /= value2) : (short)0);
6723 if(!exp->expType)
6724 {
6725 exp->expType = op1->type;
6726 if(op1->type)
6727 op1->type->refCount++;
6728 }
6729 return 0x1;
6730 }
6731
6732 static unsigned int UShortDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6733 {
6734 unsigned short value2 = op2->us;
6735
6736 exp->type = 2;
6737 exp->string = PrintUShort(value2 ? (op1->us /= value2) : (unsigned short)0);
6738 if(!exp->expType)
6739 {
6740 exp->expType = op1->type;
6741 if(op1->type)
6742 op1->type->refCount++;
6743 }
6744 return 0x1;
6745 }
6746
6747 static unsigned int CharDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6748 {
6749 char value2 = op2->c;
6750
6751 exp->type = 2;
6752 exp->string = PrintChar(value2 ? (op1->c /= value2) : (char)0);
6753 if(!exp->expType)
6754 {
6755 exp->expType = op1->type;
6756 if(op1->type)
6757 op1->type->refCount++;
6758 }
6759 return 0x1;
6760 }
6761
6762 static unsigned int UCharDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6763 {
6764 unsigned char value2 = op2->uc;
6765
6766 exp->type = 2;
6767 exp->string = PrintUChar(value2 ? (op1->uc /= value2) : (unsigned char)0);
6768 if(!exp->expType)
6769 {
6770 exp->expType = op1->type;
6771 if(op1->type)
6772 op1->type->refCount++;
6773 }
6774 return 0x1;
6775 }
6776
6777 static unsigned int FloatDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6778 {
6779 float value2 = op2->f;
6780
6781 exp->type = 2;
6782 exp->string = PrintFloat(value2 ? (op1->f /= value2) : (float)0);
6783 if(!exp->expType)
6784 {
6785 exp->expType = op1->type;
6786 if(op1->type)
6787 op1->type->refCount++;
6788 }
6789 return 0x1;
6790 }
6791
6792 static unsigned int DoubleDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6793 {
6794 double value2 = op2->d;
6795
6796 exp->type = 2;
6797 exp->string = PrintDouble(value2 ? (op1->d /= value2) : (double)0);
6798 if(!exp->expType)
6799 {
6800 exp->expType = op1->type;
6801 if(op1->type)
6802 op1->type->refCount++;
6803 }
6804 return 0x1;
6805 }
6806
6807 static unsigned int IntModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6808 {
6809 int value2 = op2->i;
6810
6811 exp->type = 2;
6812 exp->string = PrintInt(value2 ? (op1->i %= value2) : 0);
6813 if(!exp->expType)
6814 {
6815 exp->expType = op1->type;
6816 if(op1->type)
6817 op1->type->refCount++;
6818 }
6819 return 0x1;
6820 }
6821
6822 static unsigned int UIntModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6823 {
6824 unsigned int value2 = op2->ui;
6825
6826 exp->type = 2;
6827 exp->string = PrintUInt(value2 ? (op1->ui %= value2) : 0);
6828 if(!exp->expType)
6829 {
6830 exp->expType = op1->type;
6831 if(op1->type)
6832 op1->type->refCount++;
6833 }
6834 return 0x1;
6835 }
6836
6837 static unsigned int ShortModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6838 {
6839 short value2 = op2->s;
6840
6841 exp->type = 2;
6842 exp->string = PrintShort(value2 ? (op1->s %= value2) : (short)0);
6843 if(!exp->expType)
6844 {
6845 exp->expType = op1->type;
6846 if(op1->type)
6847 op1->type->refCount++;
6848 }
6849 return 0x1;
6850 }
6851
6852 static unsigned int UShortModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6853 {
6854 unsigned short value2 = op2->us;
6855
6856 exp->type = 2;
6857 exp->string = PrintUShort(value2 ? (op1->us %= value2) : (unsigned short)0);
6858 if(!exp->expType)
6859 {
6860 exp->expType = op1->type;
6861 if(op1->type)
6862 op1->type->refCount++;
6863 }
6864 return 0x1;
6865 }
6866
6867 static unsigned int CharModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6868 {
6869 char value2 = op2->c;
6870
6871 exp->type = 2;
6872 exp->string = PrintChar(value2 ? (op1->c %= value2) : (char)0);
6873 if(!exp->expType)
6874 {
6875 exp->expType = op1->type;
6876 if(op1->type)
6877 op1->type->refCount++;
6878 }
6879 return 0x1;
6880 }
6881
6882 static unsigned int UCharModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6883 {
6884 unsigned char value2 = op2->uc;
6885
6886 exp->type = 2;
6887 exp->string = PrintUChar(value2 ? (op1->uc %= value2) : (unsigned char)0);
6888 if(!exp->expType)
6889 {
6890 exp->expType = op1->type;
6891 if(op1->type)
6892 op1->type->refCount++;
6893 }
6894 return 0x1;
6895 }
6896
6897 static unsigned int IntBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6898 {
6899 int value2 = op2->i;
6900
6901 exp->type = 2;
6902 exp->string = PrintInt(op1->i & value2);
6903 if(!exp->expType)
6904 {
6905 exp->expType = op1->type;
6906 if(op1->type)
6907 op1->type->refCount++;
6908 }
6909 return 0x1;
6910 }
6911
6912 static unsigned int UIntBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6913 {
6914 unsigned int value2 = op2->ui;
6915
6916 exp->type = 2;
6917 exp->string = PrintUInt(op1->ui & value2);
6918 if(!exp->expType)
6919 {
6920 exp->expType = op1->type;
6921 if(op1->type)
6922 op1->type->refCount++;
6923 }
6924 return 0x1;
6925 }
6926
6927 static unsigned int ShortBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6928 {
6929 short value2 = op2->s;
6930
6931 exp->type = 2;
6932 exp->string = PrintShort(op1->s & value2);
6933 if(!exp->expType)
6934 {
6935 exp->expType = op1->type;
6936 if(op1->type)
6937 op1->type->refCount++;
6938 }
6939 return 0x1;
6940 }
6941
6942 static unsigned int UShortBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6943 {
6944 unsigned short value2 = op2->us;
6945
6946 exp->type = 2;
6947 exp->string = PrintUShort(op1->us & value2);
6948 if(!exp->expType)
6949 {
6950 exp->expType = op1->type;
6951 if(op1->type)
6952 op1->type->refCount++;
6953 }
6954 return 0x1;
6955 }
6956
6957 static unsigned int CharBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6958 {
6959 char value2 = op2->c;
6960
6961 exp->type = 2;
6962 exp->string = PrintChar(op1->c & value2);
6963 if(!exp->expType)
6964 {
6965 exp->expType = op1->type;
6966 if(op1->type)
6967 op1->type->refCount++;
6968 }
6969 return 0x1;
6970 }
6971
6972 static unsigned int UCharBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6973 {
6974 unsigned char value2 = op2->uc;
6975
6976 exp->type = 2;
6977 exp->string = PrintUChar(op1->uc & value2);
6978 if(!exp->expType)
6979 {
6980 exp->expType = op1->type;
6981 if(op1->type)
6982 op1->type->refCount++;
6983 }
6984 return 0x1;
6985 }
6986
6987 static unsigned int IntBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6988 {
6989 int value2 = op2->i;
6990
6991 exp->type = 2;
6992 exp->string = PrintInt(op1->i | value2);
6993 if(!exp->expType)
6994 {
6995 exp->expType = op1->type;
6996 if(op1->type)
6997 op1->type->refCount++;
6998 }
6999 return 0x1;
7000 }
7001
7002 static unsigned int UIntBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7003 {
7004 unsigned int value2 = op2->ui;
7005
7006 exp->type = 2;
7007 exp->string = PrintUInt(op1->ui | value2);
7008 if(!exp->expType)
7009 {
7010 exp->expType = op1->type;
7011 if(op1->type)
7012 op1->type->refCount++;
7013 }
7014 return 0x1;
7015 }
7016
7017 static unsigned int ShortBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7018 {
7019 short value2 = op2->s;
7020
7021 exp->type = 2;
7022 exp->string = PrintShort(op1->s | value2);
7023 if(!exp->expType)
7024 {
7025 exp->expType = op1->type;
7026 if(op1->type)
7027 op1->type->refCount++;
7028 }
7029 return 0x1;
7030 }
7031
7032 static unsigned int UShortBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7033 {
7034 unsigned short value2 = op2->us;
7035
7036 exp->type = 2;
7037 exp->string = PrintUShort(op1->us | value2);
7038 if(!exp->expType)
7039 {
7040 exp->expType = op1->type;
7041 if(op1->type)
7042 op1->type->refCount++;
7043 }
7044 return 0x1;
7045 }
7046
7047 static unsigned int CharBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7048 {
7049 char value2 = op2->c;
7050
7051 exp->type = 2;
7052 exp->string = PrintChar(op1->c | value2);
7053 if(!exp->expType)
7054 {
7055 exp->expType = op1->type;
7056 if(op1->type)
7057 op1->type->refCount++;
7058 }
7059 return 0x1;
7060 }
7061
7062 static unsigned int UCharBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7063 {
7064 unsigned char value2 = op2->uc;
7065
7066 exp->type = 2;
7067 exp->string = PrintUChar(op1->uc | value2);
7068 if(!exp->expType)
7069 {
7070 exp->expType = op1->type;
7071 if(op1->type)
7072 op1->type->refCount++;
7073 }
7074 return 0x1;
7075 }
7076
7077 static unsigned int IntBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7078 {
7079 int value2 = op2->i;
7080
7081 exp->type = 2;
7082 exp->string = PrintInt(op1->i ^ value2);
7083 if(!exp->expType)
7084 {
7085 exp->expType = op1->type;
7086 if(op1->type)
7087 op1->type->refCount++;
7088 }
7089 return 0x1;
7090 }
7091
7092 static unsigned int UIntBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7093 {
7094 unsigned int value2 = op2->ui;
7095
7096 exp->type = 2;
7097 exp->string = PrintUInt(op1->ui ^ value2);
7098 if(!exp->expType)
7099 {
7100 exp->expType = op1->type;
7101 if(op1->type)
7102 op1->type->refCount++;
7103 }
7104 return 0x1;
7105 }
7106
7107 static unsigned int ShortBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7108 {
7109 short value2 = op2->s;
7110
7111 exp->type = 2;
7112 exp->string = PrintShort(op1->s ^ value2);
7113 if(!exp->expType)
7114 {
7115 exp->expType = op1->type;
7116 if(op1->type)
7117 op1->type->refCount++;
7118 }
7119 return 0x1;
7120 }
7121
7122 static unsigned int UShortBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7123 {
7124 unsigned short value2 = op2->us;
7125
7126 exp->type = 2;
7127 exp->string = PrintUShort(op1->us ^ value2);
7128 if(!exp->expType)
7129 {
7130 exp->expType = op1->type;
7131 if(op1->type)
7132 op1->type->refCount++;
7133 }
7134 return 0x1;
7135 }
7136
7137 static unsigned int CharBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7138 {
7139 char value2 = op2->c;
7140
7141 exp->type = 2;
7142 exp->string = PrintChar(op1->c ^ value2);
7143 if(!exp->expType)
7144 {
7145 exp->expType = op1->type;
7146 if(op1->type)
7147 op1->type->refCount++;
7148 }
7149 return 0x1;
7150 }
7151
7152 static unsigned int UCharBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7153 {
7154 unsigned char value2 = op2->uc;
7155
7156 exp->type = 2;
7157 exp->string = PrintUChar(op1->uc ^ value2);
7158 if(!exp->expType)
7159 {
7160 exp->expType = op1->type;
7161 if(op1->type)
7162 op1->type->refCount++;
7163 }
7164 return 0x1;
7165 }
7166
7167 static unsigned int IntLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7168 {
7169 int value2 = op2->i;
7170
7171 exp->type = 2;
7172 exp->string = PrintInt(op1->i << value2);
7173 if(!exp->expType)
7174 {
7175 exp->expType = op1->type;
7176 if(op1->type)
7177 op1->type->refCount++;
7178 }
7179 return 0x1;
7180 }
7181
7182 static unsigned int UIntLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7183 {
7184 unsigned int value2 = op2->ui;
7185
7186 exp->type = 2;
7187 exp->string = PrintUInt(op1->ui << value2);
7188 if(!exp->expType)
7189 {
7190 exp->expType = op1->type;
7191 if(op1->type)
7192 op1->type->refCount++;
7193 }
7194 return 0x1;
7195 }
7196
7197 static unsigned int ShortLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7198 {
7199 short value2 = op2->s;
7200
7201 exp->type = 2;
7202 exp->string = PrintShort(op1->s << value2);
7203 if(!exp->expType)
7204 {
7205 exp->expType = op1->type;
7206 if(op1->type)
7207 op1->type->refCount++;
7208 }
7209 return 0x1;
7210 }
7211
7212 static unsigned int UShortLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7213 {
7214 unsigned short value2 = op2->us;
7215
7216 exp->type = 2;
7217 exp->string = PrintUShort(op1->us << value2);
7218 if(!exp->expType)
7219 {
7220 exp->expType = op1->type;
7221 if(op1->type)
7222 op1->type->refCount++;
7223 }
7224 return 0x1;
7225 }
7226
7227 static unsigned int CharLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7228 {
7229 char value2 = op2->c;
7230
7231 exp->type = 2;
7232 exp->string = PrintChar(op1->c << value2);
7233 if(!exp->expType)
7234 {
7235 exp->expType = op1->type;
7236 if(op1->type)
7237 op1->type->refCount++;
7238 }
7239 return 0x1;
7240 }
7241
7242 static unsigned int UCharLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7243 {
7244 unsigned char value2 = op2->uc;
7245
7246 exp->type = 2;
7247 exp->string = PrintUChar(op1->uc << value2);
7248 if(!exp->expType)
7249 {
7250 exp->expType = op1->type;
7251 if(op1->type)
7252 op1->type->refCount++;
7253 }
7254 return 0x1;
7255 }
7256
7257 static unsigned int IntRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7258 {
7259 int value2 = op2->i;
7260
7261 exp->type = 2;
7262 exp->string = PrintInt(op1->i >> value2);
7263 if(!exp->expType)
7264 {
7265 exp->expType = op1->type;
7266 if(op1->type)
7267 op1->type->refCount++;
7268 }
7269 return 0x1;
7270 }
7271
7272 static unsigned int UIntRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7273 {
7274 unsigned int value2 = op2->ui;
7275
7276 exp->type = 2;
7277 exp->string = PrintUInt(op1->ui >> value2);
7278 if(!exp->expType)
7279 {
7280 exp->expType = op1->type;
7281 if(op1->type)
7282 op1->type->refCount++;
7283 }
7284 return 0x1;
7285 }
7286
7287 static unsigned int ShortRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7288 {
7289 short value2 = op2->s;
7290
7291 exp->type = 2;
7292 exp->string = PrintShort(op1->s >> value2);
7293 if(!exp->expType)
7294 {
7295 exp->expType = op1->type;
7296 if(op1->type)
7297 op1->type->refCount++;
7298 }
7299 return 0x1;
7300 }
7301
7302 static unsigned int UShortRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7303 {
7304 unsigned short value2 = op2->us;
7305
7306 exp->type = 2;
7307 exp->string = PrintUShort(op1->us >> value2);
7308 if(!exp->expType)
7309 {
7310 exp->expType = op1->type;
7311 if(op1->type)
7312 op1->type->refCount++;
7313 }
7314 return 0x1;
7315 }
7316
7317 static unsigned int CharRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7318 {
7319 char value2 = op2->c;
7320
7321 exp->type = 2;
7322 exp->string = PrintChar(op1->c >> value2);
7323 if(!exp->expType)
7324 {
7325 exp->expType = op1->type;
7326 if(op1->type)
7327 op1->type->refCount++;
7328 }
7329 return 0x1;
7330 }
7331
7332 static unsigned int UCharRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7333 {
7334 unsigned char value2 = op2->uc;
7335
7336 exp->type = 2;
7337 exp->string = PrintUChar(op1->uc >> value2);
7338 if(!exp->expType)
7339 {
7340 exp->expType = op1->type;
7341 if(op1->type)
7342 op1->type->refCount++;
7343 }
7344 return 0x1;
7345 }
7346
7347 static unsigned int IntBitNot(struct Expression * exp, struct Operand * op1)
7348 {
7349 exp->type = 2;
7350 exp->string = PrintInt(~op1->i);
7351 if(!exp->expType)
7352 {
7353 exp->expType = op1->type;
7354 if(op1->type)
7355 op1->type->refCount++;
7356 }
7357 return 0x1;
7358 }
7359
7360 static unsigned int UIntBitNot(struct Expression * exp, struct Operand * op1)
7361 {
7362 exp->type = 2;
7363 exp->string = PrintUInt(~op1->ui);
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 ShortBitNot(struct Expression * exp, struct Operand * op1)
7374 {
7375 exp->type = 2;
7376 exp->string = PrintShort(~op1->s);
7377 if(!exp->expType)
7378 {
7379 exp->expType = op1->type;
7380 if(op1->type)
7381 op1->type->refCount++;
7382 }
7383 return 0x1;
7384 }
7385
7386 static unsigned int UShortBitNot(struct Expression * exp, struct Operand * op1)
7387 {
7388 exp->type = 2;
7389 exp->string = PrintUShort(~op1->us);
7390 if(!exp->expType)
7391 {
7392 exp->expType = op1->type;
7393 if(op1->type)
7394 op1->type->refCount++;
7395 }
7396 return 0x1;
7397 }
7398
7399 static unsigned int CharBitNot(struct Expression * exp, struct Operand * op1)
7400 {
7401 exp->type = 2;
7402 exp->string = PrintChar(~op1->c);
7403 if(!exp->expType)
7404 {
7405 exp->expType = op1->type;
7406 if(op1->type)
7407 op1->type->refCount++;
7408 }
7409 return 0x1;
7410 }
7411
7412 static unsigned int UCharBitNot(struct Expression * exp, struct Operand * op1)
7413 {
7414 exp->type = 2;
7415 exp->string = PrintUChar(~op1->uc);
7416 if(!exp->expType)
7417 {
7418 exp->expType = op1->type;
7419 if(op1->type)
7420 op1->type->refCount++;
7421 }
7422 return 0x1;
7423 }
7424
7425 static unsigned int IntAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7426 {
7427 int value2 = op2->i;
7428
7429 exp->type = 2;
7430 exp->string = PrintInt(op1->i &= value2);
7431 if(!exp->expType)
7432 {
7433 exp->expType = op1->type;
7434 if(op1->type)
7435 op1->type->refCount++;
7436 }
7437 return 0x1;
7438 }
7439
7440 static unsigned int UIntAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7441 {
7442 unsigned int value2 = op2->ui;
7443
7444 exp->type = 2;
7445 exp->string = PrintUInt(op1->ui &= value2);
7446 if(!exp->expType)
7447 {
7448 exp->expType = op1->type;
7449 if(op1->type)
7450 op1->type->refCount++;
7451 }
7452 return 0x1;
7453 }
7454
7455 static unsigned int ShortAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7456 {
7457 short value2 = op2->s;
7458
7459 exp->type = 2;
7460 exp->string = PrintShort(op1->s &= value2);
7461 if(!exp->expType)
7462 {
7463 exp->expType = op1->type;
7464 if(op1->type)
7465 op1->type->refCount++;
7466 }
7467 return 0x1;
7468 }
7469
7470 static unsigned int UShortAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7471 {
7472 unsigned short value2 = op2->us;
7473
7474 exp->type = 2;
7475 exp->string = PrintUShort(op1->us &= value2);
7476 if(!exp->expType)
7477 {
7478 exp->expType = op1->type;
7479 if(op1->type)
7480 op1->type->refCount++;
7481 }
7482 return 0x1;
7483 }
7484
7485 static unsigned int CharAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7486 {
7487 char value2 = op2->c;
7488
7489 exp->type = 2;
7490 exp->string = PrintChar(op1->c &= value2);
7491 if(!exp->expType)
7492 {
7493 exp->expType = op1->type;
7494 if(op1->type)
7495 op1->type->refCount++;
7496 }
7497 return 0x1;
7498 }
7499
7500 static unsigned int UCharAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7501 {
7502 unsigned char value2 = op2->uc;
7503
7504 exp->type = 2;
7505 exp->string = PrintUChar(op1->uc &= value2);
7506 if(!exp->expType)
7507 {
7508 exp->expType = op1->type;
7509 if(op1->type)
7510 op1->type->refCount++;
7511 }
7512 return 0x1;
7513 }
7514
7515 static unsigned int IntOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7516 {
7517 int value2 = op2->i;
7518
7519 exp->type = 2;
7520 exp->string = PrintInt(op1->i |= value2);
7521 if(!exp->expType)
7522 {
7523 exp->expType = op1->type;
7524 if(op1->type)
7525 op1->type->refCount++;
7526 }
7527 return 0x1;
7528 }
7529
7530 static unsigned int UIntOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7531 {
7532 unsigned int value2 = op2->ui;
7533
7534 exp->type = 2;
7535 exp->string = PrintUInt(op1->ui |= value2);
7536 if(!exp->expType)
7537 {
7538 exp->expType = op1->type;
7539 if(op1->type)
7540 op1->type->refCount++;
7541 }
7542 return 0x1;
7543 }
7544
7545 static unsigned int ShortOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7546 {
7547 short value2 = op2->s;
7548
7549 exp->type = 2;
7550 exp->string = PrintShort(op1->s |= value2);
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 UShortOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7561 {
7562 unsigned short value2 = op2->us;
7563
7564 exp->type = 2;
7565 exp->string = PrintUShort(op1->us |= value2);
7566 if(!exp->expType)
7567 {
7568 exp->expType = op1->type;
7569 if(op1->type)
7570 op1->type->refCount++;
7571 }
7572 return 0x1;
7573 }
7574
7575 static unsigned int CharOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7576 {
7577 char value2 = op2->c;
7578
7579 exp->type = 2;
7580 exp->string = PrintChar(op1->c |= value2);
7581 if(!exp->expType)
7582 {
7583 exp->expType = op1->type;
7584 if(op1->type)
7585 op1->type->refCount++;
7586 }
7587 return 0x1;
7588 }
7589
7590 static unsigned int UCharOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7591 {
7592 unsigned char value2 = op2->uc;
7593
7594 exp->type = 2;
7595 exp->string = PrintUChar(op1->uc |= value2);
7596 if(!exp->expType)
7597 {
7598 exp->expType = op1->type;
7599 if(op1->type)
7600 op1->type->refCount++;
7601 }
7602 return 0x1;
7603 }
7604
7605 static unsigned int IntXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7606 {
7607 int value2 = op2->i;
7608
7609 exp->type = 2;
7610 exp->string = PrintInt(op1->i ^= value2);
7611 if(!exp->expType)
7612 {
7613 exp->expType = op1->type;
7614 if(op1->type)
7615 op1->type->refCount++;
7616 }
7617 return 0x1;
7618 }
7619
7620 static unsigned int UIntXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7621 {
7622 unsigned int value2 = op2->ui;
7623
7624 exp->type = 2;
7625 exp->string = PrintUInt(op1->ui ^= value2);
7626 if(!exp->expType)
7627 {
7628 exp->expType = op1->type;
7629 if(op1->type)
7630 op1->type->refCount++;
7631 }
7632 return 0x1;
7633 }
7634
7635 static unsigned int ShortXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7636 {
7637 short value2 = op2->s;
7638
7639 exp->type = 2;
7640 exp->string = PrintShort(op1->s ^= value2);
7641 if(!exp->expType)
7642 {
7643 exp->expType = op1->type;
7644 if(op1->type)
7645 op1->type->refCount++;
7646 }
7647 return 0x1;
7648 }
7649
7650 static unsigned int UShortXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7651 {
7652 unsigned short value2 = op2->us;
7653
7654 exp->type = 2;
7655 exp->string = PrintUShort(op1->us ^= value2);
7656 if(!exp->expType)
7657 {
7658 exp->expType = op1->type;
7659 if(op1->type)
7660 op1->type->refCount++;
7661 }
7662 return 0x1;
7663 }
7664
7665 static unsigned int CharXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7666 {
7667 char value2 = op2->c;
7668
7669 exp->type = 2;
7670 exp->string = PrintChar(op1->c ^= value2);
7671 if(!exp->expType)
7672 {
7673 exp->expType = op1->type;
7674 if(op1->type)
7675 op1->type->refCount++;
7676 }
7677 return 0x1;
7678 }
7679
7680 static unsigned int UCharXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7681 {
7682 unsigned char value2 = op2->uc;
7683
7684 exp->type = 2;
7685 exp->string = PrintUChar(op1->uc ^= value2);
7686 if(!exp->expType)
7687 {
7688 exp->expType = op1->type;
7689 if(op1->type)
7690 op1->type->refCount++;
7691 }
7692 return 0x1;
7693 }
7694
7695 static unsigned int IntLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7696 {
7697 int value2 = op2->i;
7698
7699 exp->type = 2;
7700 exp->string = PrintInt(op1->i <<= value2);
7701 if(!exp->expType)
7702 {
7703 exp->expType = op1->type;
7704 if(op1->type)
7705 op1->type->refCount++;
7706 }
7707 return 0x1;
7708 }
7709
7710 static unsigned int UIntLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7711 {
7712 unsigned int value2 = op2->ui;
7713
7714 exp->type = 2;
7715 exp->string = PrintUInt(op1->ui <<= value2);
7716 if(!exp->expType)
7717 {
7718 exp->expType = op1->type;
7719 if(op1->type)
7720 op1->type->refCount++;
7721 }
7722 return 0x1;
7723 }
7724
7725 static unsigned int ShortLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7726 {
7727 short value2 = op2->s;
7728
7729 exp->type = 2;
7730 exp->string = PrintShort(op1->s <<= value2);
7731 if(!exp->expType)
7732 {
7733 exp->expType = op1->type;
7734 if(op1->type)
7735 op1->type->refCount++;
7736 }
7737 return 0x1;
7738 }
7739
7740 static unsigned int UShortLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7741 {
7742 unsigned short value2 = op2->us;
7743
7744 exp->type = 2;
7745 exp->string = PrintUShort(op1->us <<= value2);
7746 if(!exp->expType)
7747 {
7748 exp->expType = op1->type;
7749 if(op1->type)
7750 op1->type->refCount++;
7751 }
7752 return 0x1;
7753 }
7754
7755 static unsigned int CharLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7756 {
7757 char value2 = op2->c;
7758
7759 exp->type = 2;
7760 exp->string = PrintChar(op1->c <<= value2);
7761 if(!exp->expType)
7762 {
7763 exp->expType = op1->type;
7764 if(op1->type)
7765 op1->type->refCount++;
7766 }
7767 return 0x1;
7768 }
7769
7770 static unsigned int UCharLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7771 {
7772 unsigned char value2 = op2->uc;
7773
7774 exp->type = 2;
7775 exp->string = PrintUChar(op1->uc <<= value2);
7776 if(!exp->expType)
7777 {
7778 exp->expType = op1->type;
7779 if(op1->type)
7780 op1->type->refCount++;
7781 }
7782 return 0x1;
7783 }
7784
7785 static unsigned int IntRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7786 {
7787 int value2 = op2->i;
7788
7789 exp->type = 2;
7790 exp->string = PrintInt(op1->i >>= value2);
7791 if(!exp->expType)
7792 {
7793 exp->expType = op1->type;
7794 if(op1->type)
7795 op1->type->refCount++;
7796 }
7797 return 0x1;
7798 }
7799
7800 static unsigned int UIntRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7801 {
7802 unsigned int value2 = op2->ui;
7803
7804 exp->type = 2;
7805 exp->string = PrintUInt(op1->ui >>= value2);
7806 if(!exp->expType)
7807 {
7808 exp->expType = op1->type;
7809 if(op1->type)
7810 op1->type->refCount++;
7811 }
7812 return 0x1;
7813 }
7814
7815 static unsigned int ShortRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7816 {
7817 short value2 = op2->s;
7818
7819 exp->type = 2;
7820 exp->string = PrintShort(op1->s >>= value2);
7821 if(!exp->expType)
7822 {
7823 exp->expType = op1->type;
7824 if(op1->type)
7825 op1->type->refCount++;
7826 }
7827 return 0x1;
7828 }
7829
7830 static unsigned int UShortRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7831 {
7832 unsigned short value2 = op2->us;
7833
7834 exp->type = 2;
7835 exp->string = PrintUShort(op1->us >>= value2);
7836 if(!exp->expType)
7837 {
7838 exp->expType = op1->type;
7839 if(op1->type)
7840 op1->type->refCount++;
7841 }
7842 return 0x1;
7843 }
7844
7845 static unsigned int CharRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7846 {
7847 char value2 = op2->c;
7848
7849 exp->type = 2;
7850 exp->string = PrintChar(op1->c >>= value2);
7851 if(!exp->expType)
7852 {
7853 exp->expType = op1->type;
7854 if(op1->type)
7855 op1->type->refCount++;
7856 }
7857 return 0x1;
7858 }
7859
7860 static unsigned int UCharRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7861 {
7862 unsigned char value2 = op2->uc;
7863
7864 exp->type = 2;
7865 exp->string = PrintUChar(op1->uc >>= value2);
7866 if(!exp->expType)
7867 {
7868 exp->expType = op1->type;
7869 if(op1->type)
7870 op1->type->refCount++;
7871 }
7872 return 0x1;
7873 }
7874
7875 static unsigned int IntNot(struct Expression * exp, struct Operand * op1)
7876 {
7877 exp->type = 2;
7878 exp->string = PrintInt(!op1->i);
7879 if(!exp->expType)
7880 {
7881 exp->expType = op1->type;
7882 if(op1->type)
7883 op1->type->refCount++;
7884 }
7885 return 0x1;
7886 }
7887
7888 static unsigned int UIntNot(struct Expression * exp, struct Operand * op1)
7889 {
7890 exp->type = 2;
7891 exp->string = PrintUInt(!op1->ui);
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 ShortNot(struct Expression * exp, struct Operand * op1)
7902 {
7903 exp->type = 2;
7904 exp->string = PrintShort(!op1->s);
7905 if(!exp->expType)
7906 {
7907 exp->expType = op1->type;
7908 if(op1->type)
7909 op1->type->refCount++;
7910 }
7911 return 0x1;
7912 }
7913
7914 static unsigned int UShortNot(struct Expression * exp, struct Operand * op1)
7915 {
7916 exp->type = 2;
7917 exp->string = PrintUShort(!op1->us);
7918 if(!exp->expType)
7919 {
7920 exp->expType = op1->type;
7921 if(op1->type)
7922 op1->type->refCount++;
7923 }
7924 return 0x1;
7925 }
7926
7927 static unsigned int CharNot(struct Expression * exp, struct Operand * op1)
7928 {
7929 exp->type = 2;
7930 exp->string = PrintChar(!op1->c);
7931 if(!exp->expType)
7932 {
7933 exp->expType = op1->type;
7934 if(op1->type)
7935 op1->type->refCount++;
7936 }
7937 return 0x1;
7938 }
7939
7940 static unsigned int UCharNot(struct Expression * exp, struct Operand * op1)
7941 {
7942 exp->type = 2;
7943 exp->string = PrintUChar(!op1->uc);
7944 if(!exp->expType)
7945 {
7946 exp->expType = op1->type;
7947 if(op1->type)
7948 op1->type->refCount++;
7949 }
7950 return 0x1;
7951 }
7952
7953 static unsigned int IntEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7954 {
7955 int value2 = op2->i;
7956
7957 exp->type = 2;
7958 exp->string = PrintInt(op1->i == value2);
7959 if(!exp->expType)
7960 {
7961 exp->expType = op1->type;
7962 if(op1->type)
7963 op1->type->refCount++;
7964 }
7965 return 0x1;
7966 }
7967
7968 static unsigned int UIntEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7969 {
7970 unsigned int value2 = op2->ui;
7971
7972 exp->type = 2;
7973 exp->string = PrintUInt(op1->ui == value2);
7974 if(!exp->expType)
7975 {
7976 exp->expType = op1->type;
7977 if(op1->type)
7978 op1->type->refCount++;
7979 }
7980 return 0x1;
7981 }
7982
7983 static unsigned int ShortEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7984 {
7985 short value2 = op2->s;
7986
7987 exp->type = 2;
7988 exp->string = PrintShort(op1->s == value2);
7989 if(!exp->expType)
7990 {
7991 exp->expType = op1->type;
7992 if(op1->type)
7993 op1->type->refCount++;
7994 }
7995 return 0x1;
7996 }
7997
7998 static unsigned int UShortEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7999 {
8000 unsigned short value2 = op2->us;
8001
8002 exp->type = 2;
8003 exp->string = PrintUShort(op1->us == value2);
8004 if(!exp->expType)
8005 {
8006 exp->expType = op1->type;
8007 if(op1->type)
8008 op1->type->refCount++;
8009 }
8010 return 0x1;
8011 }
8012
8013 static unsigned int CharEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8014 {
8015 char value2 = op2->c;
8016
8017 exp->type = 2;
8018 exp->string = PrintChar(op1->c == value2);
8019 if(!exp->expType)
8020 {
8021 exp->expType = op1->type;
8022 if(op1->type)
8023 op1->type->refCount++;
8024 }
8025 return 0x1;
8026 }
8027
8028 static unsigned int UCharEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8029 {
8030 unsigned char value2 = op2->uc;
8031
8032 exp->type = 2;
8033 exp->string = PrintUChar(op1->uc == value2);
8034 if(!exp->expType)
8035 {
8036 exp->expType = op1->type;
8037 if(op1->type)
8038 op1->type->refCount++;
8039 }
8040 return 0x1;
8041 }
8042
8043 static unsigned int FloatEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8044 {
8045 float value2 = op2->f;
8046
8047 exp->type = 2;
8048 exp->string = PrintFloat(op1->f == value2);
8049 if(!exp->expType)
8050 {
8051 exp->expType = op1->type;
8052 if(op1->type)
8053 op1->type->refCount++;
8054 }
8055 return 0x1;
8056 }
8057
8058 static unsigned int DoubleEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8059 {
8060 double value2 = op2->d;
8061
8062 exp->type = 2;
8063 exp->string = PrintDouble(op1->d == value2);
8064 if(!exp->expType)
8065 {
8066 exp->expType = op1->type;
8067 if(op1->type)
8068 op1->type->refCount++;
8069 }
8070 return 0x1;
8071 }
8072
8073 static unsigned int IntNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8074 {
8075 int value2 = op2->i;
8076
8077 exp->type = 2;
8078 exp->string = PrintInt(op1->i != value2);
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 UIntNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8089 {
8090 unsigned int value2 = op2->ui;
8091
8092 exp->type = 2;
8093 exp->string = PrintUInt(op1->ui != value2);
8094 if(!exp->expType)
8095 {
8096 exp->expType = op1->type;
8097 if(op1->type)
8098 op1->type->refCount++;
8099 }
8100 return 0x1;
8101 }
8102
8103 static unsigned int ShortNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8104 {
8105 short value2 = op2->s;
8106
8107 exp->type = 2;
8108 exp->string = PrintShort(op1->s != value2);
8109 if(!exp->expType)
8110 {
8111 exp->expType = op1->type;
8112 if(op1->type)
8113 op1->type->refCount++;
8114 }
8115 return 0x1;
8116 }
8117
8118 static unsigned int UShortNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8119 {
8120 unsigned short value2 = op2->us;
8121
8122 exp->type = 2;
8123 exp->string = PrintUShort(op1->us != value2);
8124 if(!exp->expType)
8125 {
8126 exp->expType = op1->type;
8127 if(op1->type)
8128 op1->type->refCount++;
8129 }
8130 return 0x1;
8131 }
8132
8133 static unsigned int CharNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8134 {
8135 char value2 = op2->c;
8136
8137 exp->type = 2;
8138 exp->string = PrintChar(op1->c != value2);
8139 if(!exp->expType)
8140 {
8141 exp->expType = op1->type;
8142 if(op1->type)
8143 op1->type->refCount++;
8144 }
8145 return 0x1;
8146 }
8147
8148 static unsigned int UCharNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8149 {
8150 unsigned char value2 = op2->uc;
8151
8152 exp->type = 2;
8153 exp->string = PrintUChar(op1->uc != value2);
8154 if(!exp->expType)
8155 {
8156 exp->expType = op1->type;
8157 if(op1->type)
8158 op1->type->refCount++;
8159 }
8160 return 0x1;
8161 }
8162
8163 static unsigned int FloatNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8164 {
8165 float value2 = op2->f;
8166
8167 exp->type = 2;
8168 exp->string = PrintFloat(op1->f != value2);
8169 if(!exp->expType)
8170 {
8171 exp->expType = op1->type;
8172 if(op1->type)
8173 op1->type->refCount++;
8174 }
8175 return 0x1;
8176 }
8177
8178 static unsigned int DoubleNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8179 {
8180 double value2 = op2->d;
8181
8182 exp->type = 2;
8183 exp->string = PrintDouble(op1->d != value2);
8184 if(!exp->expType)
8185 {
8186 exp->expType = op1->type;
8187 if(op1->type)
8188 op1->type->refCount++;
8189 }
8190 return 0x1;
8191 }
8192
8193 static unsigned int IntAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8194 {
8195 int value2 = op2->i;
8196
8197 exp->type = 2;
8198 exp->string = PrintInt(op1->i && value2);
8199 if(!exp->expType)
8200 {
8201 exp->expType = op1->type;
8202 if(op1->type)
8203 op1->type->refCount++;
8204 }
8205 return 0x1;
8206 }
8207
8208 static unsigned int UIntAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8209 {
8210 unsigned int value2 = op2->ui;
8211
8212 exp->type = 2;
8213 exp->string = PrintUInt(op1->ui && value2);
8214 if(!exp->expType)
8215 {
8216 exp->expType = op1->type;
8217 if(op1->type)
8218 op1->type->refCount++;
8219 }
8220 return 0x1;
8221 }
8222
8223 static unsigned int ShortAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8224 {
8225 short value2 = op2->s;
8226
8227 exp->type = 2;
8228 exp->string = PrintShort(op1->s && value2);
8229 if(!exp->expType)
8230 {
8231 exp->expType = op1->type;
8232 if(op1->type)
8233 op1->type->refCount++;
8234 }
8235 return 0x1;
8236 }
8237
8238 static unsigned int UShortAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8239 {
8240 unsigned short value2 = op2->us;
8241
8242 exp->type = 2;
8243 exp->string = PrintUShort(op1->us && value2);
8244 if(!exp->expType)
8245 {
8246 exp->expType = op1->type;
8247 if(op1->type)
8248 op1->type->refCount++;
8249 }
8250 return 0x1;
8251 }
8252
8253 static unsigned int CharAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8254 {
8255 char value2 = op2->c;
8256
8257 exp->type = 2;
8258 exp->string = PrintChar(op1->c && value2);
8259 if(!exp->expType)
8260 {
8261 exp->expType = op1->type;
8262 if(op1->type)
8263 op1->type->refCount++;
8264 }
8265 return 0x1;
8266 }
8267
8268 static unsigned int UCharAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8269 {
8270 unsigned char value2 = op2->uc;
8271
8272 exp->type = 2;
8273 exp->string = PrintUChar(op1->uc && value2);
8274 if(!exp->expType)
8275 {
8276 exp->expType = op1->type;
8277 if(op1->type)
8278 op1->type->refCount++;
8279 }
8280 return 0x1;
8281 }
8282
8283 static unsigned int FloatAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8284 {
8285 float value2 = op2->f;
8286
8287 exp->type = 2;
8288 exp->string = PrintFloat(op1->f && value2);
8289 if(!exp->expType)
8290 {
8291 exp->expType = op1->type;
8292 if(op1->type)
8293 op1->type->refCount++;
8294 }
8295 return 0x1;
8296 }
8297
8298 static unsigned int DoubleAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8299 {
8300 double value2 = op2->d;
8301
8302 exp->type = 2;
8303 exp->string = PrintDouble(op1->d && value2);
8304 if(!exp->expType)
8305 {
8306 exp->expType = op1->type;
8307 if(op1->type)
8308 op1->type->refCount++;
8309 }
8310 return 0x1;
8311 }
8312
8313 static unsigned int IntOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8314 {
8315 int value2 = op2->i;
8316
8317 exp->type = 2;
8318 exp->string = PrintInt(op1->i || value2);
8319 if(!exp->expType)
8320 {
8321 exp->expType = op1->type;
8322 if(op1->type)
8323 op1->type->refCount++;
8324 }
8325 return 0x1;
8326 }
8327
8328 static unsigned int UIntOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8329 {
8330 unsigned int value2 = op2->ui;
8331
8332 exp->type = 2;
8333 exp->string = PrintUInt(op1->ui || value2);
8334 if(!exp->expType)
8335 {
8336 exp->expType = op1->type;
8337 if(op1->type)
8338 op1->type->refCount++;
8339 }
8340 return 0x1;
8341 }
8342
8343 static unsigned int ShortOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8344 {
8345 short value2 = op2->s;
8346
8347 exp->type = 2;
8348 exp->string = PrintShort(op1->s || value2);
8349 if(!exp->expType)
8350 {
8351 exp->expType = op1->type;
8352 if(op1->type)
8353 op1->type->refCount++;
8354 }
8355 return 0x1;
8356 }
8357
8358 static unsigned int UShortOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8359 {
8360 unsigned short value2 = op2->us;
8361
8362 exp->type = 2;
8363 exp->string = PrintUShort(op1->us || value2);
8364 if(!exp->expType)
8365 {
8366 exp->expType = op1->type;
8367 if(op1->type)
8368 op1->type->refCount++;
8369 }
8370 return 0x1;
8371 }
8372
8373 static unsigned int CharOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8374 {
8375 char value2 = op2->c;
8376
8377 exp->type = 2;
8378 exp->string = PrintChar(op1->c || value2);
8379 if(!exp->expType)
8380 {
8381 exp->expType = op1->type;
8382 if(op1->type)
8383 op1->type->refCount++;
8384 }
8385 return 0x1;
8386 }
8387
8388 static unsigned int UCharOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8389 {
8390 unsigned char value2 = op2->uc;
8391
8392 exp->type = 2;
8393 exp->string = PrintUChar(op1->uc || value2);
8394 if(!exp->expType)
8395 {
8396 exp->expType = op1->type;
8397 if(op1->type)
8398 op1->type->refCount++;
8399 }
8400 return 0x1;
8401 }
8402
8403 static unsigned int FloatOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8404 {
8405 float value2 = op2->f;
8406
8407 exp->type = 2;
8408 exp->string = PrintFloat(op1->f || value2);
8409 if(!exp->expType)
8410 {
8411 exp->expType = op1->type;
8412 if(op1->type)
8413 op1->type->refCount++;
8414 }
8415 return 0x1;
8416 }
8417
8418 static unsigned int DoubleOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8419 {
8420 double value2 = op2->d;
8421
8422 exp->type = 2;
8423 exp->string = PrintDouble(op1->d || value2);
8424 if(!exp->expType)
8425 {
8426 exp->expType = op1->type;
8427 if(op1->type)
8428 op1->type->refCount++;
8429 }
8430 return 0x1;
8431 }
8432
8433 static unsigned int IntGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8434 {
8435 int value2 = op2->i;
8436
8437 exp->type = 2;
8438 exp->string = PrintInt(op1->i > value2);
8439 if(!exp->expType)
8440 {
8441 exp->expType = op1->type;
8442 if(op1->type)
8443 op1->type->refCount++;
8444 }
8445 return 0x1;
8446 }
8447
8448 static unsigned int UIntGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8449 {
8450 unsigned int value2 = op2->ui;
8451
8452 exp->type = 2;
8453 exp->string = PrintUInt(op1->ui > value2);
8454 if(!exp->expType)
8455 {
8456 exp->expType = op1->type;
8457 if(op1->type)
8458 op1->type->refCount++;
8459 }
8460 return 0x1;
8461 }
8462
8463 static unsigned int ShortGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8464 {
8465 short value2 = op2->s;
8466
8467 exp->type = 2;
8468 exp->string = PrintShort(op1->s > value2);
8469 if(!exp->expType)
8470 {
8471 exp->expType = op1->type;
8472 if(op1->type)
8473 op1->type->refCount++;
8474 }
8475 return 0x1;
8476 }
8477
8478 static unsigned int UShortGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8479 {
8480 unsigned short value2 = op2->us;
8481
8482 exp->type = 2;
8483 exp->string = PrintUShort(op1->us > value2);
8484 if(!exp->expType)
8485 {
8486 exp->expType = op1->type;
8487 if(op1->type)
8488 op1->type->refCount++;
8489 }
8490 return 0x1;
8491 }
8492
8493 static unsigned int CharGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8494 {
8495 char value2 = op2->c;
8496
8497 exp->type = 2;
8498 exp->string = PrintChar(op1->c > value2);
8499 if(!exp->expType)
8500 {
8501 exp->expType = op1->type;
8502 if(op1->type)
8503 op1->type->refCount++;
8504 }
8505 return 0x1;
8506 }
8507
8508 static unsigned int UCharGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8509 {
8510 unsigned char value2 = op2->uc;
8511
8512 exp->type = 2;
8513 exp->string = PrintUChar(op1->uc > value2);
8514 if(!exp->expType)
8515 {
8516 exp->expType = op1->type;
8517 if(op1->type)
8518 op1->type->refCount++;
8519 }
8520 return 0x1;
8521 }
8522
8523 static unsigned int FloatGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8524 {
8525 float value2 = op2->f;
8526
8527 exp->type = 2;
8528 exp->string = PrintFloat(op1->f > value2);
8529 if(!exp->expType)
8530 {
8531 exp->expType = op1->type;
8532 if(op1->type)
8533 op1->type->refCount++;
8534 }
8535 return 0x1;
8536 }
8537
8538 static unsigned int DoubleGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8539 {
8540 double value2 = op2->d;
8541
8542 exp->type = 2;
8543 exp->string = PrintDouble(op1->d > value2);
8544 if(!exp->expType)
8545 {
8546 exp->expType = op1->type;
8547 if(op1->type)
8548 op1->type->refCount++;
8549 }
8550 return 0x1;
8551 }
8552
8553 static unsigned int IntSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8554 {
8555 int value2 = op2->i;
8556
8557 exp->type = 2;
8558 exp->string = PrintInt(op1->i < value2);
8559 if(!exp->expType)
8560 {
8561 exp->expType = op1->type;
8562 if(op1->type)
8563 op1->type->refCount++;
8564 }
8565 return 0x1;
8566 }
8567
8568 static unsigned int UIntSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8569 {
8570 unsigned int value2 = op2->ui;
8571
8572 exp->type = 2;
8573 exp->string = PrintUInt(op1->ui < value2);
8574 if(!exp->expType)
8575 {
8576 exp->expType = op1->type;
8577 if(op1->type)
8578 op1->type->refCount++;
8579 }
8580 return 0x1;
8581 }
8582
8583 static unsigned int ShortSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8584 {
8585 short value2 = op2->s;
8586
8587 exp->type = 2;
8588 exp->string = PrintShort(op1->s < value2);
8589 if(!exp->expType)
8590 {
8591 exp->expType = op1->type;
8592 if(op1->type)
8593 op1->type->refCount++;
8594 }
8595 return 0x1;
8596 }
8597
8598 static unsigned int UShortSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8599 {
8600 unsigned short value2 = op2->us;
8601
8602 exp->type = 2;
8603 exp->string = PrintUShort(op1->us < value2);
8604 if(!exp->expType)
8605 {
8606 exp->expType = op1->type;
8607 if(op1->type)
8608 op1->type->refCount++;
8609 }
8610 return 0x1;
8611 }
8612
8613 static unsigned int CharSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8614 {
8615 char value2 = op2->c;
8616
8617 exp->type = 2;
8618 exp->string = PrintChar(op1->c < value2);
8619 if(!exp->expType)
8620 {
8621 exp->expType = op1->type;
8622 if(op1->type)
8623 op1->type->refCount++;
8624 }
8625 return 0x1;
8626 }
8627
8628 static unsigned int UCharSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8629 {
8630 unsigned char value2 = op2->uc;
8631
8632 exp->type = 2;
8633 exp->string = PrintUChar(op1->uc < value2);
8634 if(!exp->expType)
8635 {
8636 exp->expType = op1->type;
8637 if(op1->type)
8638 op1->type->refCount++;
8639 }
8640 return 0x1;
8641 }
8642
8643 static unsigned int FloatSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8644 {
8645 float value2 = op2->f;
8646
8647 exp->type = 2;
8648 exp->string = PrintFloat(op1->f < value2);
8649 if(!exp->expType)
8650 {
8651 exp->expType = op1->type;
8652 if(op1->type)
8653 op1->type->refCount++;
8654 }
8655 return 0x1;
8656 }
8657
8658 static unsigned int DoubleSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8659 {
8660 double value2 = op2->d;
8661
8662 exp->type = 2;
8663 exp->string = PrintDouble(op1->d < value2);
8664 if(!exp->expType)
8665 {
8666 exp->expType = op1->type;
8667 if(op1->type)
8668 op1->type->refCount++;
8669 }
8670 return 0x1;
8671 }
8672
8673 static unsigned int IntGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8674 {
8675 int value2 = op2->i;
8676
8677 exp->type = 2;
8678 exp->string = PrintInt(op1->i >= value2);
8679 if(!exp->expType)
8680 {
8681 exp->expType = op1->type;
8682 if(op1->type)
8683 op1->type->refCount++;
8684 }
8685 return 0x1;
8686 }
8687
8688 static unsigned int UIntGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8689 {
8690 unsigned int value2 = op2->ui;
8691
8692 exp->type = 2;
8693 exp->string = PrintUInt(op1->ui >= value2);
8694 if(!exp->expType)
8695 {
8696 exp->expType = op1->type;
8697 if(op1->type)
8698 op1->type->refCount++;
8699 }
8700 return 0x1;
8701 }
8702
8703 static unsigned int ShortGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8704 {
8705 short value2 = op2->s;
8706
8707 exp->type = 2;
8708 exp->string = PrintShort(op1->s >= value2);
8709 if(!exp->expType)
8710 {
8711 exp->expType = op1->type;
8712 if(op1->type)
8713 op1->type->refCount++;
8714 }
8715 return 0x1;
8716 }
8717
8718 static unsigned int UShortGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8719 {
8720 unsigned short value2 = op2->us;
8721
8722 exp->type = 2;
8723 exp->string = PrintUShort(op1->us >= value2);
8724 if(!exp->expType)
8725 {
8726 exp->expType = op1->type;
8727 if(op1->type)
8728 op1->type->refCount++;
8729 }
8730 return 0x1;
8731 }
8732
8733 static unsigned int CharGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8734 {
8735 char value2 = op2->c;
8736
8737 exp->type = 2;
8738 exp->string = PrintChar(op1->c >= value2);
8739 if(!exp->expType)
8740 {
8741 exp->expType = op1->type;
8742 if(op1->type)
8743 op1->type->refCount++;
8744 }
8745 return 0x1;
8746 }
8747
8748 static unsigned int UCharGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8749 {
8750 unsigned char value2 = op2->uc;
8751
8752 exp->type = 2;
8753 exp->string = PrintUChar(op1->uc >= value2);
8754 if(!exp->expType)
8755 {
8756 exp->expType = op1->type;
8757 if(op1->type)
8758 op1->type->refCount++;
8759 }
8760 return 0x1;
8761 }
8762
8763 static unsigned int FloatGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8764 {
8765 float value2 = op2->f;
8766
8767 exp->type = 2;
8768 exp->string = PrintFloat(op1->f >= value2);
8769 if(!exp->expType)
8770 {
8771 exp->expType = op1->type;
8772 if(op1->type)
8773 op1->type->refCount++;
8774 }
8775 return 0x1;
8776 }
8777
8778 static unsigned int DoubleGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8779 {
8780 double value2 = op2->d;
8781
8782 exp->type = 2;
8783 exp->string = PrintDouble(op1->d >= value2);
8784 if(!exp->expType)
8785 {
8786 exp->expType = op1->type;
8787 if(op1->type)
8788 op1->type->refCount++;
8789 }
8790 return 0x1;
8791 }
8792
8793 static unsigned int IntSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8794 {
8795 int value2 = op2->i;
8796
8797 exp->type = 2;
8798 exp->string = PrintInt(op1->i <= value2);
8799 if(!exp->expType)
8800 {
8801 exp->expType = op1->type;
8802 if(op1->type)
8803 op1->type->refCount++;
8804 }
8805 return 0x1;
8806 }
8807
8808 static unsigned int UIntSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8809 {
8810 unsigned int value2 = op2->ui;
8811
8812 exp->type = 2;
8813 exp->string = PrintUInt(op1->ui <= value2);
8814 if(!exp->expType)
8815 {
8816 exp->expType = op1->type;
8817 if(op1->type)
8818 op1->type->refCount++;
8819 }
8820 return 0x1;
8821 }
8822
8823 static unsigned int ShortSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8824 {
8825 short value2 = op2->s;
8826
8827 exp->type = 2;
8828 exp->string = PrintShort(op1->s <= value2);
8829 if(!exp->expType)
8830 {
8831 exp->expType = op1->type;
8832 if(op1->type)
8833 op1->type->refCount++;
8834 }
8835 return 0x1;
8836 }
8837
8838 static unsigned int UShortSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8839 {
8840 unsigned short value2 = op2->us;
8841
8842 exp->type = 2;
8843 exp->string = PrintUShort(op1->us <= value2);
8844 if(!exp->expType)
8845 {
8846 exp->expType = op1->type;
8847 if(op1->type)
8848 op1->type->refCount++;
8849 }
8850 return 0x1;
8851 }
8852
8853 static unsigned int CharSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8854 {
8855 char value2 = op2->c;
8856
8857 exp->type = 2;
8858 exp->string = PrintChar(op1->c <= value2);
8859 if(!exp->expType)
8860 {
8861 exp->expType = op1->type;
8862 if(op1->type)
8863 op1->type->refCount++;
8864 }
8865 return 0x1;
8866 }
8867
8868 static unsigned int UCharSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8869 {
8870 unsigned char value2 = op2->uc;
8871
8872 exp->type = 2;
8873 exp->string = PrintUChar(op1->uc <= value2);
8874 if(!exp->expType)
8875 {
8876 exp->expType = op1->type;
8877 if(op1->type)
8878 op1->type->refCount++;
8879 }
8880 return 0x1;
8881 }
8882
8883 static unsigned int FloatSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8884 {
8885 float value2 = op2->f;
8886
8887 exp->type = 2;
8888 exp->string = PrintFloat(op1->f <= value2);
8889 if(!exp->expType)
8890 {
8891 exp->expType = op1->type;
8892 if(op1->type)
8893 op1->type->refCount++;
8894 }
8895 return 0x1;
8896 }
8897
8898 static unsigned int DoubleSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8899 {
8900 double value2 = op2->d;
8901
8902 exp->type = 2;
8903 exp->string = PrintDouble(op1->d <= value2);
8904 if(!exp->expType)
8905 {
8906 exp->expType = op1->type;
8907 if(op1->type)
8908 op1->type->refCount++;
8909 }
8910 return 0x1;
8911 }
8912
8913 static unsigned int IntCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
8914 {
8915 exp->type = 2;
8916 exp->string = PrintInt(op1->i ? op2->i : op3->i);
8917 if(!exp->expType)
8918 {
8919 exp->expType = op1->type;
8920 if(op1->type)
8921 op1->type->refCount++;
8922 }
8923 return 0x1;
8924 }
8925
8926 static unsigned int UIntCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
8927 {
8928 exp->type = 2;
8929 exp->string = PrintUInt(op1->ui ? op2->ui : op3->ui);
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 ShortCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
8940 {
8941 exp->type = 2;
8942 exp->string = PrintShort(op1->s ? op2->s : op3->s);
8943 if(!exp->expType)
8944 {
8945 exp->expType = op1->type;
8946 if(op1->type)
8947 op1->type->refCount++;
8948 }
8949 return 0x1;
8950 }
8951
8952 static unsigned int UShortCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
8953 {
8954 exp->type = 2;
8955 exp->string = PrintUShort(op1->us ? op2->us : op3->us);
8956 if(!exp->expType)
8957 {
8958 exp->expType = op1->type;
8959 if(op1->type)
8960 op1->type->refCount++;
8961 }
8962 return 0x1;
8963 }
8964
8965 static unsigned int CharCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
8966 {
8967 exp->type = 2;
8968 exp->string = PrintChar(op1->c ? op2->c : op3->c);
8969 if(!exp->expType)
8970 {
8971 exp->expType = op1->type;
8972 if(op1->type)
8973 op1->type->refCount++;
8974 }
8975 return 0x1;
8976 }
8977
8978 static unsigned int UCharCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
8979 {
8980 exp->type = 2;
8981 exp->string = PrintUChar(op1->uc ? op2->uc : op3->uc);
8982 if(!exp->expType)
8983 {
8984 exp->expType = op1->type;
8985 if(op1->type)
8986 op1->type->refCount++;
8987 }
8988 return 0x1;
8989 }
8990
8991 static unsigned int FloatCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
8992 {
8993 exp->type = 2;
8994 exp->string = PrintFloat(op1->f ? op2->f : op3->f);
8995 if(!exp->expType)
8996 {
8997 exp->expType = op1->type;
8998 if(op1->type)
8999 op1->type->refCount++;
9000 }
9001 return 0x1;
9002 }
9003
9004 static unsigned int DoubleCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
9005 {
9006 exp->type = 2;
9007 exp->string = PrintDouble(op1->d ? op2->d : op3->d);
9008 if(!exp->expType)
9009 {
9010 exp->expType = op1->type;
9011 if(op1->type)
9012 op1->type->refCount++;
9013 }
9014 return 0x1;
9015 }
9016
9017 struct OpTable intOps = 
9018 {
9019 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
9020 };
9021
9022 struct OpTable uintOps = 
9023 {
9024 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
9025 };
9026
9027 struct OpTable shortOps = 
9028 {
9029 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
9030 };
9031
9032 struct OpTable ushortOps = 
9033 {
9034 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
9035 };
9036
9037 struct OpTable floatOps = 
9038 {
9039 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
9040 };
9041
9042 struct OpTable doubleOps = 
9043 {
9044 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
9045 };
9046
9047 struct OpTable charOps = 
9048 {
9049 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
9050 };
9051
9052 struct OpTable ucharOps = 
9053 {
9054 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
9055 };
9056
9057 void ReadString(char * output, char * string)
9058 {
9059 int len = strlen(string);
9060 int c, d = 0;
9061 unsigned int quoted = 0x0, escaped = 0x0;
9062
9063 for(c = 0; c < len; c++)
9064 {
9065 char ch = string[c];
9066
9067 if(escaped)
9068 {
9069 switch(ch)
9070 {
9071 case 'n':
9072 output[d] = '\n';
9073 break;
9074 case 't':
9075 output[d] = '\t';
9076 break;
9077 case 'a':
9078 output[d] = '\a';
9079 break;
9080 case 'b':
9081 output[d] = '\b';
9082 break;
9083 case 'f':
9084 output[d] = '\f';
9085 break;
9086 case 'r':
9087 output[d] = '\r';
9088 break;
9089 case 'v':
9090 output[d] = '\v';
9091 break;
9092 case '\\':
9093 output[d] = '\\';
9094 break;
9095 case '\"':
9096 output[d] = '\"';
9097 break;
9098 default:
9099 output[d++] = '\\';
9100 output[d] = ch;
9101 }
9102 d++;
9103 escaped = 0x0;
9104 }
9105 else
9106 {
9107 if(ch == '\"')
9108 quoted ^= 0x1;
9109 else if(quoted)
9110 {
9111 if(ch == '\\')
9112 escaped = 0x1;
9113 else
9114 output[d++] = ch;
9115 }
9116 }
9117 }
9118 output[d] = '\0';
9119 }
9120
9121 extern double strtod(char * , char * * );
9122
9123 struct Operand GetOperand(struct Expression * exp)
9124 {
9125 struct Operand op = 
9126 {
9127 0, 0, 0, 0, 
9128 {
9129 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
9130 }
9131 };
9132 struct Type * type = exp->expType;
9133
9134 if(type)
9135 {
9136 while(type->kind == 8 && type->_class->registered && (type->_class->registered->type == 2 || type->_class->registered->type == 3 || type->_class->registered->type == 4))
9137 {
9138 if(!type->_class->registered->dataType)
9139 type->_class->registered->dataType = ProcessTypeString(type->_class->registered->dataTypeString, 0x0);
9140 type = type->_class->registered->dataType;
9141 }
9142 op.kind = type->kind;
9143 op.type = exp->expType;
9144 if(exp->isConstant && exp->type == 2)
9145 {
9146 switch(op.kind)
9147 {
9148 case 1:
9149 {
9150 if(exp->constant[0] == '\'')
9151 op.c = exp->constant[1];
9152 else if(type->isSigned)
9153 {
9154 op.c = (char)strtol(exp->constant, (((void *)0)), 0);
9155 op.ops = charOps;
9156 }
9157 else
9158 {
9159 op.uc = (unsigned char)strtoul(exp->constant, (((void *)0)), 0);
9160 op.ops = ucharOps;
9161 }
9162 break;
9163 }
9164 case 2:
9165 if(type->isSigned)
9166 {
9167 op.s = (short)strtol(exp->constant, (((void *)0)), 0);
9168 op.ops = shortOps;
9169 }
9170 else
9171 {
9172 op.us = (unsigned short)strtoul(exp->constant, (((void *)0)), 0);
9173 op.ops = ushortOps;
9174 }
9175 break;
9176 case 3:
9177 case 5:
9178 if(type->isSigned)
9179 {
9180 op.i = strtol(exp->constant, (((void *)0)), 0);
9181 op.ops = intOps;
9182 }
9183 else
9184 {
9185 op.ui = strtoul(exp->constant, (((void *)0)), 0);
9186 op.ops = uintOps;
9187 }
9188 op.kind = 3;
9189 break;
9190 case 4:
9191 if(type->isSigned)
9192 {
9193 op.i64 = _strtoi64(exp->constant, (((void *)0)), 0);
9194 op.ops = intOps;
9195 }
9196 else
9197 {
9198 op.ui64 = _strtoui64(exp->constant, (((void *)0)), 0);
9199 op.ops = uintOps;
9200 }
9201 op.kind = 3;
9202 break;
9203 case 6:
9204 op.f = (float)strtod(exp->constant, (((void *)0)));
9205 op.ops = floatOps;
9206 break;
9207 case 7:
9208 op.d = (double)strtod(exp->constant, (((void *)0)));
9209 op.ops = doubleOps;
9210 break;
9211 case 12:
9212 case 13:
9213 case 8:
9214 op.p = (unsigned char *)strtoul(exp->constant, (((void *)0)), 0);
9215 op.kind = 13;
9216 op.ops = uintOps;
9217 break;
9218 }
9219 }
9220 }
9221 return op;
9222 }
9223
9224 int __ecereVMethodID_class_OnGetString;
9225
9226 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_int;
9227
9228 static void UnusedFunction()
9229 {
9230 int a;
9231
9232 ((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);
9233 }
9234
9235 extern int __ecereVMethodID_class_OnGetString;
9236
9237 static void PopulateInstanceProcessMember(struct Instantiation * inst, struct __ecereNameSpace__ecere__sys__OldList * memberList, struct __ecereNameSpace__ecere__com__DataMember * parentDataMember, unsigned int offset)
9238 {
9239 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
9240
9241 for(dataMember = parentDataMember->members.first; dataMember; dataMember = dataMember->next)
9242 {
9243 if(!dataMember->name && (dataMember->type == 2 || dataMember->type == 1))
9244 PopulateInstanceProcessMember(inst, memberList, dataMember, offset + dataMember->offset);
9245 else
9246 {
9247 struct Expression * exp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
9248 struct MemberInit * member = MkMemberInit(MkListOne(MkIdentifier(dataMember->name)), MkInitializerAssignment(exp));
9249 struct Type * type;
9250 void * ptr = inst->data + dataMember->offset + offset;
9251 char * result = (((void *)0));
9252
9253 exp->loc = member->loc = inst->loc;
9254 ((struct Identifier *)(*member->identifiers).first)->loc = inst->loc;
9255 if(!dataMember->dataType)
9256 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
9257 type = dataMember->dataType;
9258 if(type->kind == 8)
9259 {
9260 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
9261
9262 if(_class->type == 4)
9263 {
9264 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
9265
9266 if(enumClass)
9267 {
9268 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
9269 struct __ecereNameSpace__ecere__sys__NamedLink * item;
9270
9271 for(item = e->values.first; item; item = item->next)
9272 {
9273 if((int)item->data == *(int *)ptr)
9274 {
9275 result = item->name;
9276 break;
9277 }
9278 }
9279 if(result)
9280 {
9281 exp->identifier = MkIdentifier(result);
9282 exp->type = 0;
9283 exp->destType = MkClassType(_class->fullName);
9284 ProcessExpressionType(exp);
9285 }
9286 }
9287 }
9288 if(_class->type == 4 || _class->type == 3 || _class->type == 2)
9289 {
9290 if(!_class->dataType)
9291 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
9292 type = _class->dataType;
9293 }
9294 }
9295 if(!result)
9296 {
9297 switch(type->kind)
9298 {
9299 case 6:
9300 {
9301 FreeExpContents(exp);
9302 exp->constant = PrintFloat(*(float *)ptr);
9303 exp->type = 2;
9304 break;
9305 }
9306 case 7:
9307 {
9308 FreeExpContents(exp);
9309 exp->constant = PrintDouble(*(double *)ptr);
9310 exp->type = 2;
9311 break;
9312 }
9313 case 3:
9314 {
9315 FreeExpContents(exp);
9316 exp->constant = PrintInt(*(int *)ptr);
9317 exp->type = 2;
9318 break;
9319 }
9320 case 4:
9321 {
9322 FreeExpContents(exp);
9323 exp->constant = PrintInt64(*(long long *)ptr);
9324 exp->type = 2;
9325 break;
9326 }
9327 default:
9328 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Unhandled type populating instance\n", (((void *)0))));
9329 }
9330 }
9331 ListAdd(memberList, member);
9332 }
9333 if(parentDataMember->type == 1)
9334 break;
9335 }
9336 }
9337
9338 extern struct MembersInit * MkMembersInitList(struct __ecereNameSpace__ecere__sys__OldList * dataMembers);
9339
9340 void PopulateInstance(struct Instantiation * inst)
9341 {
9342 struct Symbol * classSym = inst->_class->symbol;
9343 struct __ecereNameSpace__ecere__com__Class * _class = classSym->registered;
9344 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
9345 struct __ecereNameSpace__ecere__sys__OldList * memberList = MkList();
9346
9347 inst->members = MkListOne(MkMembersInitList(memberList));
9348 for(dataMember = _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
9349 {
9350 if(!dataMember->isProperty)
9351 {
9352 if(!dataMember->name && (dataMember->type == 2 || dataMember->type == 1))
9353 PopulateInstanceProcessMember(inst, memberList, dataMember, dataMember->offset);
9354 else
9355 {
9356 struct Expression * exp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
9357 struct MemberInit * member = MkMemberInit(MkListOne(MkIdentifier(dataMember->name)), MkInitializerAssignment(exp));
9358 struct Type * type;
9359 void * ptr = inst->data + dataMember->offset;
9360 char * result = (((void *)0));
9361
9362 exp->loc = member->loc = inst->loc;
9363 ((struct Identifier *)(*member->identifiers).first)->loc = inst->loc;
9364 if(!dataMember->dataType)
9365 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
9366 type = dataMember->dataType;
9367 if(type->kind == 8)
9368 {
9369 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
9370
9371 if(_class->type == 4)
9372 {
9373 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
9374
9375 if(enumClass)
9376 {
9377 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
9378 struct __ecereNameSpace__ecere__sys__NamedLink * item;
9379
9380 for(item = e->values.first; item; item = item->next)
9381 {
9382 if((int)item->data == *(int *)ptr)
9383 {
9384 result = item->name;
9385 break;
9386 }
9387 }
9388 }
9389 if(result)
9390 {
9391 exp->identifier = MkIdentifier(result);
9392 exp->type = 0;
9393 exp->destType = MkClassType(_class->fullName);
9394 ProcessExpressionType(exp);
9395 }
9396 }
9397 if(_class->type == 4 || _class->type == 3 || _class->type == 2)
9398 {
9399 if(!_class->dataType)
9400 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
9401 type = _class->dataType;
9402 }
9403 }
9404 if(!result)
9405 {
9406 switch(type->kind)
9407 {
9408 case 6:
9409 {
9410 exp->constant = PrintFloat(*(float *)ptr);
9411 exp->type = 2;
9412 break;
9413 }
9414 case 7:
9415 {
9416 exp->constant = PrintDouble(*(double *)ptr);
9417 exp->type = 2;
9418 break;
9419 }
9420 case 3:
9421 {
9422 exp->constant = PrintInt(*(int *)ptr);
9423 exp->type = 2;
9424 break;
9425 }
9426 case 4:
9427 {
9428 exp->constant = PrintInt64(*(long long *)ptr);
9429 exp->type = 2;
9430 break;
9431 }
9432 default:
9433 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Unhandled type populating instance\n", (((void *)0))));
9434 }
9435 }
9436 ListAdd(memberList, member);
9437 }
9438 }
9439 }
9440 }
9441
9442 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);
9443
9444 extern void FreeInstance(struct Instantiation * inst);
9445
9446 void ComputeInstantiation(struct Expression * exp)
9447 {
9448 struct Instantiation * inst = exp->instance;
9449 struct MembersInit * members;
9450 struct Symbol * classSym = inst->_class ? inst->_class->symbol : (((void *)0));
9451 struct __ecereNameSpace__ecere__com__Class * _class = classSym ? classSym->registered : (((void *)0));
9452 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
9453 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
9454 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
9455 int subMemberStackPos = 0;
9456 uint64 bits = 0;
9457
9458 if(_class && (_class->type == 1 || _class->type == 0 || _class->type == 5))
9459 {
9460 if(inst->data)
9461 return ;
9462 if(_class->type == 0 || _class->type == 5)
9463 inst->data = (unsigned char *)__ecereNameSpace__ecere__com__eInstance_New(_class);
9464 else
9465 inst->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
9466 }
9467 if(inst->members)
9468 {
9469 for(members = (*inst->members).first; members; members = members->next)
9470 {
9471 switch(members->type)
9472 {
9473 case 0:
9474 {
9475 if(members->dataMembers)
9476 {
9477 struct MemberInit * member;
9478
9479 for(member = (*members->dataMembers).first; member; member = member->next)
9480 {
9481 struct Identifier * ident = member->identifiers ? (*member->identifiers).first : (((void *)0));
9482 unsigned int found = 0x0;
9483 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
9484 struct __ecereNameSpace__ecere__com__DataMember * dataMember = (((void *)0));
9485 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
9486 unsigned int dataMemberOffset;
9487
9488 if(!ident)
9489 {
9490 __ecereNameSpace__ecere__com__eClass_FindNextMember(_class, &curClass, &curMember, subMemberStack, &subMemberStackPos);
9491 if(curMember)
9492 {
9493 if(curMember->isProperty)
9494 prop = (struct __ecereNameSpace__ecere__com__Property *)curMember;
9495 else
9496 {
9497 dataMember = curMember;
9498 __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(_class, dataMember->name, &dataMemberOffset, privateModule, (((void *)0)), (((void *)0)));
9499 }
9500 found = 0x1;
9501 }
9502 }
9503 else
9504 {
9505 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, ident->string, privateModule);
9506 if(prop)
9507 {
9508 found = 0x1;
9509 if(prop->memberAccess == 1)
9510 {
9511 curMember = (struct __ecereNameSpace__ecere__com__DataMember *)prop;
9512 curClass = prop->_class;
9513 }
9514 }
9515 else
9516 {
9517 struct __ecereNameSpace__ecere__com__DataMember * _subMemberStack[256];
9518 int _subMemberStackPos = 0;
9519
9520 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(_class, ident->string, &dataMemberOffset, privateModule, _subMemberStack, &_subMemberStackPos);
9521 if(dataMember)
9522 {
9523 found = 0x1;
9524 if(dataMember->memberAccess == 1)
9525 {
9526 curMember = dataMember;
9527 curClass = dataMember->_class;
9528 memcpy(subMemberStack, _subMemberStack, sizeof(int) * _subMemberStackPos);
9529 subMemberStackPos = _subMemberStackPos;
9530 }
9531 }
9532 }
9533 }
9534 if(found && member->initializer && member->initializer->type == 0)
9535 {
9536 struct Expression * value = member->initializer->exp;
9537 struct Type * type = (((void *)0));
9538
9539 if(prop)
9540 {
9541 type = prop->dataType;
9542 }
9543 else if(dataMember)
9544 {
9545 if(!dataMember->dataType)
9546 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
9547 type = dataMember->dataType;
9548 }
9549 if(ident && ident->next)
9550 {
9551 for(ident = ident->next; ident && type; ident = ident->next)
9552 {
9553 if(type->kind == 8)
9554 {
9555 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(type->_class->registered, ident->string, privateModule);
9556 if(prop)
9557 type = prop->dataType;
9558 else
9559 {
9560 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(type->_class->registered, ident->string, &dataMemberOffset, privateModule, (((void *)0)), (((void *)0)));
9561 if(dataMember)
9562 type = dataMember->dataType;
9563 }
9564 }
9565 else if(type->kind == 9 || type->kind == 10)
9566 {
9567 struct Type * memberType;
9568
9569 for(memberType = type->members.first; memberType; memberType = memberType->next)
9570 {
9571 if(!strcmp(memberType->name, ident->string))
9572 {
9573 type = memberType;
9574 break;
9575 }
9576 }
9577 }
9578 }
9579 }
9580 if(value)
9581 {
9582 FreeType(value->destType);
9583 value->destType = type;
9584 if(type)
9585 type->refCount++;
9586 ComputeExpression(value);
9587 }
9588 if(value && (_class->type == 1 || _class->type == 0 || _class->type == 5))
9589 {
9590 if(type->kind == 8)
9591 {
9592 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
9593
9594 if(_class->type == 2 || _class->type == 3 || _class->type == 4)
9595 {
9596 if(!_class->dataType)
9597 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
9598 type = _class->dataType;
9599 }
9600 }
9601 if(dataMember)
9602 {
9603 void * ptr = inst->data + dataMemberOffset;
9604
9605 if(value->type == 2)
9606 {
9607 switch(type->kind)
9608 {
9609 case 3:
9610 {
9611 GetInt(value, (int *)ptr);
9612 break;
9613 }
9614 case 4:
9615 {
9616 GetInt64(value, (long long *)ptr);
9617 break;
9618 }
9619 case 6:
9620 {
9621 GetFloat(value, (float *)ptr);
9622 break;
9623 }
9624 case 7:
9625 {
9626 GetDouble(value, (double *)ptr);
9627 break;
9628 }
9629 }
9630 }
9631 else if(value->type == 1)
9632 {
9633 if(type->kind == 8)
9634 {
9635 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
9636
9637 if(_class->type == 1)
9638 {
9639 ComputeTypeSize(type);
9640 if(value->instance->data)
9641 memcpy(ptr, value->instance->data, type->size);
9642 }
9643 }
9644 }
9645 }
9646 else if(prop)
9647 {
9648 if(value->type == 1 && value->instance->data)
9649 {
9650 void (* Set)(void *, void *) = (void *)prop->Set;
9651
9652 Set(inst->data, value->instance->data);
9653 PopulateInstance(inst);
9654 }
9655 else if(value->type == 2)
9656 {
9657 switch(type->kind)
9658 {
9659 case 7:
9660 {
9661 void (* Set)(void *, double) = (void *)prop->Set;
9662
9663 Set(inst->data, strtod(value->constant, (((void *)0))));
9664 break;
9665 }
9666 case 6:
9667 {
9668 void (* Set)(void *, float) = (void *)prop->Set;
9669
9670 Set(inst->data, (float)(strtod(value->constant, (((void *)0)))));
9671 break;
9672 }
9673 case 3:
9674 {
9675 void (* Set)(void *, int) = (void *)prop->Set;
9676
9677 Set(inst->data, strtol(value->constant, (((void *)0)), 0));
9678 break;
9679 }
9680 case 4:
9681 {
9682 void (* Set)(void *, long long) = (void *)prop->Set;
9683
9684 Set(inst->data, _strtoi64(value->constant, (((void *)0)), 0));
9685 break;
9686 }
9687 }
9688 }
9689 else if(value->type == 3)
9690 {
9691 char temp[1024];
9692
9693 ReadString(temp, value->string);
9694 prop->Set(inst->data, temp);
9695 }
9696 }
9697 }
9698 else if(_class->type == 3)
9699 {
9700 if(prop)
9701 {
9702 if(value->type == 2)
9703 {
9704 if(type->kind == 8)
9705 {
9706 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
9707
9708 if(_class->type == 3)
9709 {
9710 if(!_class->dataType)
9711 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
9712 type = _class->dataType;
9713 }
9714 }
9715 switch(type->kind)
9716 {
9717 case 6:
9718 {
9719 float fValue;
9720 float (* Set)(float) = (void *)prop->Set;
9721
9722 GetFloat(member->initializer->exp, &fValue);
9723 exp->constant = PrintFloat(Set(fValue));
9724 exp->type = 2;
9725 break;
9726 }
9727 case 7:
9728 {
9729 double dValue;
9730 double (* Set)(double) = (void *)prop->Set;
9731
9732 GetDouble(member->initializer->exp, &dValue);
9733 exp->constant = PrintDouble(Set(dValue));
9734 exp->type = 2;
9735 break;
9736 }
9737 }
9738 }
9739 }
9740 }
9741 else if(_class->type == 2)
9742 {
9743 if(prop)
9744 {
9745 if(value->type == 1 && value->instance->data)
9746 {
9747 unsigned int (* Set)(void *) = (void *)prop->Set;
9748
9749 bits = Set(value->instance->data);
9750 }
9751 else if(value->type == 2)
9752 {
9753 }
9754 }
9755 else if(dataMember)
9756 {
9757 struct __ecereNameSpace__ecere__com__BitMember * bitMember = (struct __ecereNameSpace__ecere__com__BitMember *)dataMember;
9758 struct Type * type;
9759 int part = 0;
9760
9761 GetInt(value, &part);
9762 bits = (bits & ~bitMember->mask);
9763 if(!bitMember->dataType)
9764 bitMember->dataType = ProcessTypeString(bitMember->dataTypeString, 0x0);
9765 type = bitMember->dataType;
9766 if(type->kind == 8 && type->_class && type->_class->registered)
9767 {
9768 if(!type->_class->registered->dataType)
9769 type->_class->registered->dataType = ProcessTypeString(type->_class->registered->dataTypeString, 0x0);
9770 type = type->_class->registered->dataType;
9771 }
9772 switch(type->kind)
9773 {
9774 case 1:
9775 if(type->isSigned)
9776 bits |= ((char)part << bitMember->pos);
9777 else
9778 bits |= ((unsigned char)part << bitMember->pos);
9779 break;
9780 case 2:
9781 if(type->isSigned)
9782 bits |= ((short)part << bitMember->pos);
9783 else
9784 bits |= ((unsigned short)part << bitMember->pos);
9785 break;
9786 case 3:
9787 case 5:
9788 if(type->isSigned)
9789 bits |= (part << bitMember->pos);
9790 else
9791 bits |= ((unsigned int)part << bitMember->pos);
9792 break;
9793 case 4:
9794 if(type->isSigned)
9795 bits |= ((long long)part << bitMember->pos);
9796 else
9797 bits |= ((uint64)part << bitMember->pos);
9798 break;
9799 }
9800 }
9801 }
9802 }
9803 else
9804 {
9805 if(_class && _class->type == 3)
9806 {
9807 ComputeExpression(member->initializer->exp);
9808 exp->constant = member->initializer->exp->constant;
9809 exp->type = 2;
9810 member->initializer->exp->constant = (((void *)0));
9811 }
9812 }
9813 }
9814 }
9815 break;
9816 }
9817 }
9818 }
9819 }
9820 if(_class && _class->type == 2)
9821 {
9822 exp->constant = PrintHexUInt(bits);
9823 exp->type = 2;
9824 }
9825 if(exp->type != 1)
9826 {
9827 FreeInstance(inst);
9828 }
9829 }
9830
9831 void CallOperator(struct Expression * exp, struct Expression * exp1, struct Expression * exp2, struct Operand * op1, struct Operand * op2)
9832 {
9833 if(exp->op.op == SIZEOF)
9834 {
9835 FreeExpContents(exp);
9836 exp->type = 2;
9837 exp->constant = PrintUInt(ComputeTypeSize(op1->type));
9838 }
9839 else
9840 {
9841 if(!exp->op.exp1)
9842 {
9843 switch(exp->op.op)
9844 {
9845 case '+':
9846 {
9847 struct Expression * exp2 = exp->op.exp2;
9848
9849 exp->op.exp2 = (((void *)0));
9850 FreeExpContents(exp);
9851 FreeType(exp->expType);
9852 FreeType(exp->destType);
9853 *exp = *exp2;
9854 ((exp2 ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(exp2) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(exp2)) : 0), exp2 = 0);
9855 break;
9856 }
9857 case '-':
9858 if(op1->ops.Neg)
9859 {
9860 FreeExpContents(exp);
9861 op1->ops.Neg(exp, op1);
9862 }
9863 break;
9864 case '~':
9865 if(op1->ops.BitNot)
9866 {
9867 FreeExpContents(exp);
9868 op1->ops.BitNot(exp, op1);
9869 }
9870 break;
9871 case '!':
9872 if(op1->ops.Not)
9873 {
9874 FreeExpContents(exp);
9875 op1->ops.Not(exp, op1);
9876 }
9877 break;
9878 }
9879 }
9880 else
9881 {
9882 switch(exp->op.op)
9883 {
9884 case '+':
9885 if(op1->ops.Add)
9886 {
9887 FreeExpContents(exp);
9888 op1->ops.Add(exp, op1, op2);
9889 }
9890 break;
9891 case '-':
9892 if(op1->ops.Sub)
9893 {
9894 FreeExpContents(exp);
9895 op1->ops.Sub(exp, op1, op2);
9896 }
9897 break;
9898 case '*':
9899 if(op1->ops.Mul)
9900 {
9901 FreeExpContents(exp);
9902 op1->ops.Mul(exp, op1, op2);
9903 }
9904 break;
9905 case '/':
9906 if(op1->ops.Div)
9907 {
9908 FreeExpContents(exp);
9909 op1->ops.Div(exp, op1, op2);
9910 }
9911 break;
9912 case '%':
9913 if(op1->ops.Mod)
9914 {
9915 FreeExpContents(exp);
9916 op1->ops.Mod(exp, op1, op2);
9917 }
9918 break;
9919 case '&':
9920 if(exp->op.exp2)
9921 {
9922 if(op1->ops.BitAnd)
9923 {
9924 FreeExpContents(exp);
9925 op1->ops.BitAnd(exp, op1, op2);
9926 }
9927 }
9928 break;
9929 case '|':
9930 if(op1->ops.BitOr)
9931 {
9932 FreeExpContents(exp);
9933 op1->ops.BitOr(exp, op1, op2);
9934 }
9935 break;
9936 case '^':
9937 if(op1->ops.BitXor)
9938 {
9939 FreeExpContents(exp);
9940 op1->ops.BitXor(exp, op1, op2);
9941 }
9942 break;
9943 case LEFT_OP:
9944 if(op1->ops.LShift)
9945 {
9946 FreeExpContents(exp);
9947 op1->ops.LShift(exp, op1, op2);
9948 }
9949 break;
9950 case RIGHT_OP:
9951 if(op1->ops.RShift)
9952 {
9953 FreeExpContents(exp);
9954 op1->ops.RShift(exp, op1, op2);
9955 }
9956 break;
9957 case EQ_OP:
9958 if(op1->ops.Equ)
9959 {
9960 FreeExpContents(exp);
9961 op1->ops.Equ(exp, op1, op2);
9962 }
9963 break;
9964 case NE_OP:
9965 if(op1->ops.Nqu)
9966 {
9967 FreeExpContents(exp);
9968 op1->ops.Nqu(exp, op1, op2);
9969 }
9970 break;
9971 case AND_OP:
9972 if(op1->ops.And)
9973 {
9974 FreeExpContents(exp);
9975 op1->ops.And(exp, op1, op2);
9976 }
9977 break;
9978 case OR_OP:
9979 if(op1->ops.Or)
9980 {
9981 FreeExpContents(exp);
9982 op1->ops.Or(exp, op1, op2);
9983 }
9984 break;
9985 case '>':
9986 if(op1->ops.Grt)
9987 {
9988 FreeExpContents(exp);
9989 op1->ops.Grt(exp, op1, op2);
9990 }
9991 break;
9992 case '<':
9993 if(op1->ops.Sma)
9994 {
9995 FreeExpContents(exp);
9996 op1->ops.Sma(exp, op1, op2);
9997 }
9998 break;
9999 case GE_OP:
10000 if(op1->ops.GrtEqu)
10001 {
10002 FreeExpContents(exp);
10003 op1->ops.GrtEqu(exp, op1, op2);
10004 }
10005 break;
10006 case LE_OP:
10007 if(op1->ops.SmaEqu)
10008 {
10009 FreeExpContents(exp);
10010 op1->ops.SmaEqu(exp, op1, op2);
10011 }
10012 break;
10013 }
10014 }
10015 }
10016 }
10017
10018 extern struct Expression * MkExpIdentifier(struct Identifier * id);
10019
10020 void ComputeExpression(struct Expression * exp)
10021 {
10022 char expString[10240];
10023
10024 expString[0] = '\0';
10025 switch(exp->type)
10026 {
10027 case 1:
10028 {
10029 ComputeInstantiation(exp);
10030 break;
10031 }
10032 case 4:
10033 {
10034 struct Expression * exp1, * exp2 = (((void *)0));
10035 struct Operand op1 = 
10036 {
10037 0, 0, 0, 0, 
10038 {
10039 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
10040 }
10041 };
10042 struct Operand op2 = 
10043 {
10044 0, 0, 0, 0, 
10045 {
10046 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
10047 }
10048 };
10049
10050 if(exp->op.exp2)
10051 ComputeExpression(exp->op.exp2);
10052 if(exp->op.exp1)
10053 {
10054 ComputeExpression(exp->op.exp1);
10055 exp1 = exp->op.exp1;
10056 exp2 = exp->op.exp2;
10057 op1 = GetOperand(exp1);
10058 if(op1.type)
10059 op1.type->refCount++;
10060 if(exp2)
10061 {
10062 op2 = GetOperand(exp2);
10063 if(op2.type)
10064 op2.type->refCount++;
10065 }
10066 }
10067 else
10068 {
10069 exp1 = exp->op.exp2;
10070 op1 = GetOperand(exp1);
10071 if(op1.type)
10072 op1.type->refCount++;
10073 }
10074 CallOperator(exp, exp1, exp2, &op1, &op2);
10075 if(op1.type)
10076 FreeType(op1.type);
10077 if(op2.type)
10078 FreeType(op2.type);
10079 break;
10080 }
10081 case 5:
10082 case 34:
10083 {
10084 struct Expression * e, * n;
10085
10086 for(e = (*exp->list).first; e; e = n)
10087 {
10088 n = e->next;
10089 if(!n)
10090 {
10091 struct __ecereNameSpace__ecere__sys__OldList * list = exp->list;
10092
10093 ComputeExpression(e);
10094 FreeType(exp->expType);
10095 FreeType(exp->destType);
10096 *exp = *e;
10097 ((e ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(e) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(e)) : 0), e = 0);
10098 (__ecereNameSpace__ecere__com__eSystem_Delete(list), list = 0);
10099 }
10100 else
10101 {
10102 FreeExpression(e);
10103 }
10104 }
10105 break;
10106 }
10107 case 8:
10108 {
10109 struct Expression * memberExp = exp->member.exp;
10110 struct Identifier * memberID = exp->member.member;
10111 struct Type * type;
10112
10113 ComputeExpression(exp->member.exp);
10114 type = exp->member.exp->expType;
10115 if(type)
10116 {
10117 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)));
10118 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
10119 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
10120 struct __ecereNameSpace__ecere__com__Class * convertTo = (((void *)0));
10121
10122 if(type->kind == 19 && exp->member.exp->type == 26)
10123 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "ecere::com::Class");
10124 if(!_class)
10125 {
10126 char string[256];
10127 struct Symbol * classSym;
10128
10129 string[0] = '\0';
10130 PrintType(type, string, 0x0, 0x1);
10131 classSym = FindClass(string);
10132 _class = classSym ? classSym->registered : (((void *)0));
10133 }
10134 if(exp->member.member)
10135 {
10136 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, exp->member.member->string, privateModule);
10137 if(!prop)
10138 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, exp->member.member->string, privateModule, (((void *)0)), (((void *)0)));
10139 }
10140 if(!prop && !member && _class && exp->member.member)
10141 {
10142 struct Symbol * classSym = FindClass(exp->member.member->string);
10143
10144 convertTo = _class;
10145 _class = classSym ? classSym->registered : (((void *)0));
10146 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, convertTo->fullName, privateModule);
10147 }
10148 if(prop)
10149 {
10150 if(prop->compiled)
10151 {
10152 struct Type * type = prop->dataType;
10153
10154 if(_class->type == 3)
10155 {
10156 if(type->kind == 8)
10157 {
10158 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
10159
10160 if(_class->type == 3)
10161 {
10162 if(!_class->dataType)
10163 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
10164 type = _class->dataType;
10165 }
10166 }
10167 switch(type->kind)
10168 {
10169 case 6:
10170 {
10171 float value;
10172 float (* Get)(float) = (void *)prop->Get;
10173
10174 GetFloat(exp->member.exp, &value);
10175 exp->constant = PrintFloat(Get ? Get(value) : value);
10176 exp->type = 2;
10177 break;
10178 }
10179 case 7:
10180 {
10181 double value;
10182 double (* Get)(double);
10183
10184 GetDouble(exp->member.exp, &value);
10185 if(convertTo)
10186 Get = (void *)prop->Set;
10187 else
10188 Get = (void *)prop->Get;
10189 exp->constant = PrintDouble(Get ? Get(value) : value);
10190 exp->type = 2;
10191 break;
10192 }
10193 }
10194 }
10195 else
10196 {
10197 if(convertTo)
10198 {
10199 struct Expression * value = exp->member.exp;
10200 struct Type * type;
10201
10202 if(!prop->dataType)
10203 ProcessPropertyType(prop);
10204 type = prop->dataType;
10205 if(!type)
10206 {
10207 }
10208 else if(_class->type == 1)
10209 {
10210 switch(type->kind)
10211 {
10212 case 8:
10213 {
10214 struct __ecereNameSpace__ecere__com__Class * propertyClass = type->_class->registered;
10215
10216 if(propertyClass->type == 1 && value->type == 1)
10217 {
10218 void (* Set)(void *, void *) = (void *)prop->Set;
10219
10220 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10221 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10222 exp->instance->_class = MkSpecifierName(_class->fullName);
10223 exp->instance->loc = exp->loc;
10224 exp->type = 1;
10225 Set(exp->instance->data, value->instance->data);
10226 PopulateInstance(exp->instance);
10227 }
10228 break;
10229 }
10230 case 3:
10231 {
10232 int intValue;
10233 void (* Set)(void *, int) = (void *)prop->Set;
10234
10235 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10236 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10237 exp->instance->_class = MkSpecifierName(_class->fullName);
10238 exp->instance->loc = exp->loc;
10239 exp->type = 1;
10240 GetInt(value, &intValue);
10241 Set(exp->instance->data, intValue);
10242 PopulateInstance(exp->instance);
10243 break;
10244 }
10245 case 4:
10246 {
10247 long long intValue;
10248 void (* Set)(void *, long long) = (void *)prop->Set;
10249
10250 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10251 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10252 exp->instance->_class = MkSpecifierName(_class->fullName);
10253 exp->instance->loc = exp->loc;
10254 exp->type = 1;
10255 GetInt64(value, &intValue);
10256 Set(exp->instance->data, intValue);
10257 PopulateInstance(exp->instance);
10258 break;
10259 }
10260 case 7:
10261 {
10262 double doubleValue;
10263 void (* Set)(void *, double) = (void *)prop->Set;
10264
10265 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10266 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10267 exp->instance->_class = MkSpecifierName(_class->fullName);
10268 exp->instance->loc = exp->loc;
10269 exp->type = 1;
10270 GetDouble(value, &doubleValue);
10271 Set(exp->instance->data, doubleValue);
10272 PopulateInstance(exp->instance);
10273 break;
10274 }
10275 }
10276 }
10277 else if(_class->type == 2)
10278 {
10279 switch(type->kind)
10280 {
10281 case 8:
10282 {
10283 struct __ecereNameSpace__ecere__com__Class * propertyClass = type->_class->registered;
10284
10285 if(propertyClass->type == 1 && value->instance->data)
10286 {
10287 unsigned int (* Set)(void *) = (void *)prop->Set;
10288 unsigned int bits = Set(value->instance->data);
10289
10290 exp->constant = PrintHexUInt(bits);
10291 exp->type = 2;
10292 break;
10293 }
10294 else if(_class->type == 2)
10295 {
10296 unsigned int value;
10297 unsigned int (* Set)(unsigned int) = (void *)prop->Set;
10298 unsigned int bits;
10299
10300 GetUInt(exp->member.exp, &value);
10301 bits = Set(value);
10302 exp->constant = PrintHexUInt(bits);
10303 exp->type = 2;
10304 }
10305 }
10306 }
10307 }
10308 }
10309 else
10310 {
10311 if(_class->type == 2)
10312 {
10313 unsigned int value;
10314
10315 GetUInt(exp->member.exp, &value);
10316 switch(type->kind)
10317 {
10318 case 8:
10319 {
10320 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
10321
10322 if(_class->type == 1)
10323 {
10324 void (* Get)(unsigned int, void *) = (void *)prop->Get;
10325
10326 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10327 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10328 exp->instance->_class = MkSpecifierName(_class->fullName);
10329 exp->instance->loc = exp->loc;
10330 exp->type = 1;
10331 Get(value, exp->instance->data);
10332 PopulateInstance(exp->instance);
10333 }
10334 else if(_class->type == 2)
10335 {
10336 unsigned int (* Get)(unsigned int) = (void *)prop->Get;
10337 uint64 bits = Get(value);
10338
10339 exp->constant = PrintHexUInt64(bits);
10340 exp->type = 2;
10341 }
10342 break;
10343 }
10344 }
10345 }
10346 else if(_class->type == 1)
10347 {
10348 char * value = (exp->member.exp->type == 1) ? exp->member.exp->instance->data : (((void *)0));
10349
10350 switch(type->kind)
10351 {
10352 case 8:
10353 {
10354 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
10355
10356 if(_class->type == 1 && value)
10357 {
10358 void (* Get)(void *, void *) = (void *)prop->Get;
10359
10360 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10361 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10362 exp->instance->_class = MkSpecifierName(_class->fullName);
10363 exp->instance->loc = exp->loc;
10364 exp->type = 1;
10365 Get(value, exp->instance->data);
10366 PopulateInstance(exp->instance);
10367 }
10368 break;
10369 }
10370 }
10371 }
10372 }
10373 }
10374 }
10375 else
10376 {
10377 exp->isConstant = 0x0;
10378 }
10379 }
10380 else if(member)
10381 {
10382 }
10383 }
10384 if(exp->type != 8)
10385 {
10386 FreeExpression(memberExp);
10387 FreeIdentifier(memberID);
10388 }
10389 break;
10390 }
10391 case 10:
10392 {
10393 struct Type * type = ProcessType(exp->typeName->qualifiers, exp->typeName->declarator);
10394
10395 FreeExpContents(exp);
10396 exp->constant = PrintUInt(ComputeTypeSize(type));
10397 exp->type = 2;
10398 FreeType(type);
10399 break;
10400 }
10401 case 15:
10402 {
10403 struct Symbol * classSym = exp->_class->symbol;
10404
10405 if(classSym && classSym->registered)
10406 {
10407 if(classSym->registered->fixed)
10408 {
10409 FreeSpecifier(exp->_class);
10410 exp->constant = PrintUInt(classSym->registered->templateClass ? classSym->registered->templateClass->structSize : classSym->registered->structSize);
10411 exp->type = 2;
10412 }
10413 else
10414 {
10415 char className[1024];
10416
10417 strcpy(className, "__ecereClass_");
10418 FullClassNameCat(className, classSym->string, 0x1);
10419 MangleClassName(className);
10420 FreeExpContents(exp);
10421 exp->type = 9;
10422 exp->member.exp = MkExpIdentifier(MkIdentifier(className));
10423 exp->member.member = MkIdentifier("structSize");
10424 }
10425 }
10426 break;
10427 }
10428 case 11:
10429 {
10430 struct Type * type;
10431 struct Expression * e = exp;
10432
10433 if(exp->type == 11)
10434 {
10435 if(exp->cast.exp)
10436 ComputeExpression(exp->cast.exp);
10437 e = exp->cast.exp;
10438 }
10439 if(e && exp->expType)
10440 {
10441 type = exp->expType;
10442 if(type->kind == 8)
10443 {
10444 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
10445
10446 if(_class && (_class->type == 3 || _class->type == 2))
10447 {
10448 if(!_class->dataType)
10449 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
10450 type = _class->dataType;
10451 }
10452 }
10453 switch(type->kind)
10454 {
10455 case 1:
10456 if(type->isSigned)
10457 {
10458 char value;
10459
10460 GetChar(e, &value);
10461 FreeExpContents(exp);
10462 exp->constant = PrintChar(value);
10463 exp->type = 2;
10464 }
10465 else
10466 {
10467 unsigned char value;
10468
10469 GetUChar(e, &value);
10470 FreeExpContents(exp);
10471 exp->constant = PrintUChar(value);
10472 exp->type = 2;
10473 }
10474 break;
10475 case 2:
10476 if(type->isSigned)
10477 {
10478 short value;
10479
10480 GetShort(e, &value);
10481 FreeExpContents(exp);
10482 exp->constant = PrintShort(value);
10483 exp->type = 2;
10484 }
10485 else
10486 {
10487 unsigned short value;
10488
10489 GetUShort(e, &value);
10490 FreeExpContents(exp);
10491 exp->constant = PrintUShort(value);
10492 exp->type = 2;
10493 }
10494 break;
10495 case 3:
10496 if(type->isSigned)
10497 {
10498 int value;
10499
10500 GetInt(e, &value);
10501 FreeExpContents(exp);
10502 exp->constant = PrintInt(value);
10503 exp->type = 2;
10504 }
10505 else
10506 {
10507 unsigned int value;
10508
10509 GetUInt(e, &value);
10510 FreeExpContents(exp);
10511 exp->constant = PrintUInt(value);
10512 exp->type = 2;
10513 }
10514 break;
10515 case 4:
10516 if(type->isSigned)
10517 {
10518 long long value;
10519
10520 GetInt64(e, &value);
10521 FreeExpContents(exp);
10522 exp->constant = PrintInt64(value);
10523 exp->type = 2;
10524 }
10525 else
10526 {
10527 uint64 value;
10528
10529 GetUInt64(e, &value);
10530 FreeExpContents(exp);
10531 exp->constant = PrintUInt64(value);
10532 exp->type = 2;
10533 }
10534 break;
10535 case 6:
10536 {
10537 float value;
10538
10539 GetFloat(e, &value);
10540 FreeExpContents(exp);
10541 exp->constant = PrintFloat(value);
10542 exp->type = 2;
10543 break;
10544 }
10545 case 7:
10546 {
10547 double value;
10548
10549 GetDouble(e, &value);
10550 FreeExpContents(exp);
10551 exp->constant = PrintDouble(value);
10552 exp->type = 2;
10553 break;
10554 }
10555 }
10556 }
10557 break;
10558 }
10559 case 12:
10560 {
10561 struct Operand op1 = 
10562 {
10563 0, 0, 0, 0, 
10564 {
10565 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
10566 }
10567 };
10568 struct Operand op2 = 
10569 {
10570 0, 0, 0, 0, 
10571 {
10572 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
10573 }
10574 };
10575 struct Operand op3 = 
10576 {
10577 0, 0, 0, 0, 
10578 {
10579 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
10580 }
10581 };
10582
10583 if(exp->cond.exp)
10584 ComputeExpression((*exp->cond.exp).last);
10585 if(exp->cond.elseExp)
10586 ComputeExpression(exp->cond.elseExp);
10587 if(exp->cond.cond)
10588 ComputeExpression(exp->cond.cond);
10589 op1 = GetOperand(exp->cond.cond);
10590 if(op1.type)
10591 op1.type->refCount++;
10592 op2 = GetOperand((*exp->cond.exp).last);
10593 if(op2.type)
10594 op2.type->refCount++;
10595 op3 = GetOperand(exp->cond.elseExp);
10596 if(op3.type)
10597 op3.type->refCount++;
10598 if(op1.ops.Cond)
10599 {
10600 FreeExpContents(exp);
10601 op1.ops.Cond(exp, &op1, &op2, &op3);
10602 }
10603 if(op1.type)
10604 FreeType(op1.type);
10605 if(op2.type)
10606 FreeType(op2.type);
10607 if(op3.type)
10608 FreeType(op3.type);
10609 break;
10610 }
10611 }
10612 }
10613
10614 void ApplyAnyObjectLogic(struct Expression * e);
10615
10616 extern void CopyTypeInto(struct Type * type, struct Type * src);
10617
10618 static unsigned int CheckExpressionType(struct Expression * exp, struct Type * destType, unsigned int skipUnitBla)
10619 {
10620 unsigned int result = 0x1;
10621
10622 if(destType)
10623 {
10624 struct __ecereNameSpace__ecere__sys__OldList converts = 
10625 {
10626 0, 0, 0, 0, 0
10627 };
10628 struct Conversion * convert;
10629
10630 if(destType->kind == 0)
10631 return 0x0;
10632 if(!MatchTypeExpression(exp, destType, &converts, skipUnitBla))
10633 result = 0x0;
10634 if(converts.count)
10635 {
10636 for(convert = converts.first; convert; convert = convert->next)
10637 {
10638 unsigned int empty = !(convert->isGet ? (void *)convert->convert->Get : (void *)convert->convert->Set);
10639
10640 if(!empty)
10641 {
10642 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
10643 int objectType = exp->expType ? exp->expType->classObjectType : 0;
10644
10645 *newExp = *exp;
10646 newExp->destType = (((void *)0));
10647 if(convert->isGet)
10648 {
10649 exp->type = 8;
10650 exp->addedThis = 0x1;
10651 exp->member.exp = newExp;
10652 FreeType(exp->member.exp->expType);
10653 exp->member.exp->expType = MkClassType(convert->convert->_class->fullName);
10654 exp->member.exp->expType->classObjectType = objectType;
10655 exp->member.member = MkIdentifier(convert->convert->dataTypeString);
10656 exp->member.memberType = 1;
10657 exp->expType = convert->resultType ? convert->resultType : convert->convert->dataType;
10658 exp->needCast = 0x1;
10659 if(exp->expType)
10660 exp->expType->refCount++;
10661 ApplyAnyObjectLogic(exp->member.exp);
10662 }
10663 else
10664 {
10665 {
10666 exp->type = 8;
10667 exp->addedThis = 0x1;
10668 exp->member.exp = newExp;
10669 if(newExp->expType && newExp->expType->kind == 8 && newExp->expType->_class && newExp->expType->_class->registered && newExp->expType->_class->registered->type == 5)
10670 {
10671 newExp->byReference = 0x1;
10672 }
10673 FreeType(exp->member.exp->expType);
10674 exp->member.exp->expType = (((void *)0));
10675 if(convert->convert->dataType)
10676 {
10677 exp->member.exp->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
10678 CopyTypeInto(exp->member.exp->expType, convert->convert->dataType);
10679 exp->member.exp->expType->refCount = 1;
10680 exp->member.exp->expType->classObjectType = objectType;
10681 ApplyAnyObjectLogic(exp->member.exp);
10682 }
10683 exp->member.member = MkIdentifier(convert->convert->_class->fullName);
10684 exp->member.memberType = 4;
10685 exp->expType = convert->resultType ? convert->resultType : MkClassType(convert->convert->_class->fullName);
10686 exp->needCast = 0x1;
10687 if(convert->resultType)
10688 convert->resultType->refCount++;
10689 }
10690 }
10691 }
10692 else
10693 {
10694 FreeType(exp->expType);
10695 if(convert->isGet)
10696 {
10697 exp->expType = convert->resultType ? convert->resultType : convert->convert->dataType;
10698 exp->needCast = 0x1;
10699 if(exp->expType)
10700 exp->expType->refCount++;
10701 }
10702 else
10703 {
10704 exp->expType = convert->resultType ? convert->resultType : MkClassType(convert->convert->_class->fullName);
10705 exp->needCast = 0x1;
10706 if(convert->resultType)
10707 convert->resultType->refCount++;
10708 }
10709 }
10710 }
10711 if(exp->isConstant && inCompiler)
10712 ComputeExpression(exp);
10713 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(&converts, FreeConvert);
10714 }
10715 if(!result && exp->expType && converts.count)
10716 {
10717 result = MatchTypes(exp->expType, exp->destType, (((void *)0)), (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0);
10718 }
10719 if(!result && exp->expType && exp->destType)
10720 {
10721 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))
10722 result = 0x1;
10723 }
10724 }
10725 return result;
10726 }
10727
10728 extern struct Expression * MkExpExtensionCompound(struct Statement * compound);
10729
10730 extern struct Statement * MkCompoundStmt(struct __ecereNameSpace__ecere__sys__OldList * declarations, struct __ecereNameSpace__ecere__sys__OldList * statements);
10731
10732 extern struct Statement * MkExpressionStmt(struct __ecereNameSpace__ecere__sys__OldList * expressions);
10733
10734 void CheckTemplateTypes(struct Expression * exp)
10735 {
10736 if(exp->destType && exp->destType->passAsTemplate && exp->expType && exp->expType->kind != 20 && !exp->expType->passAsTemplate)
10737 {
10738 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
10739 struct Statement * compound;
10740 struct Context * context;
10741
10742 *newExp = *exp;
10743 if(exp->destType)
10744 exp->destType->refCount++;
10745 if(exp->expType)
10746 exp->expType->refCount++;
10747 newExp->prev = (((void *)0));
10748 newExp->next = (((void *)0));
10749 switch(exp->expType->kind)
10750 {
10751 case 7:
10752 exp->type = 4;
10753 exp->op.exp1 = (((void *)0));
10754 context = PushContext();
10755 exp->op.exp2 = MkExpCast(MkTypeName(MkListOne(MkSpecifierName("uint64")), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), MkExpExtensionCompound(compound = MkCompoundStmt(MkListOne(MkDeclaration(MkListOne(MkSpecifier(DOUBLE)), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internal")), MkInitializerAssignment(newExp))))), MkListOne(MkExpressionStmt(MkListOne(MkExpOp((((void *)0)), '&', MkExpIdentifier(MkIdentifier("__internal")))))))));
10756 compound->compound.context = context;
10757 PopContext(context);
10758 exp->op.op = '*';
10759 break;
10760 default:
10761 exp->type = 11;
10762 exp->cast.typeName = MkTypeName(MkListOne(MkSpecifierName("uint64")), (((void *)0)));
10763 exp->cast.exp = MkExpBrackets(MkListOne(newExp));
10764 break;
10765 }
10766 }
10767 else if(exp->expType && exp->expType->passAsTemplate && exp->destType && ((unsigned int)((exp->usage & 0x1) >> 0)) && exp->destType->kind != 20 && !exp->destType->passAsTemplate)
10768 {
10769 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
10770 struct Statement * compound;
10771 struct Context * context;
10772
10773 *newExp = *exp;
10774 if(exp->destType)
10775 exp->destType->refCount++;
10776 if(exp->expType)
10777 exp->expType->refCount++;
10778 newExp->prev = (((void *)0));
10779 newExp->next = (((void *)0));
10780 switch(exp->expType->kind)
10781 {
10782 case 7:
10783 exp->type = 4;
10784 exp->op.exp1 = (((void *)0));
10785 context = PushContext();
10786 exp->op.exp2 = MkExpCast(MkTypeName(MkListOne(MkSpecifier(DOUBLE)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), MkExpExtensionCompound(compound = MkCompoundStmt(MkListOne(MkDeclaration(MkListOne(MkSpecifierName("uint64")), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internal")), MkInitializerAssignment(newExp))))), MkListOne(MkExpressionStmt(MkListOne(MkExpOp((((void *)0)), '&', MkExpIdentifier(MkIdentifier("__internal")))))))));
10787 compound->compound.context = context;
10788 PopContext(context);
10789 exp->op.op = '*';
10790 ProcessExpressionType(exp->op.exp2);
10791 break;
10792 case 8:
10793 {
10794 if(exp->expType->_class && exp->expType->_class->registered && exp->expType->_class->registered->type == 1)
10795 {
10796 exp->type = 5;
10797 exp->list = MkListOne(MkExpOp((((void *)0)), '*', MkExpCast(MkTypeName(MkListOne(MkSpecifierName(exp->expType->_class->string)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), newExp)));
10798 ProcessExpressionType((*exp->list).first);
10799 break;
10800 }
10801 else
10802 {
10803 exp->type = 5;
10804 exp->list = MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName(exp->expType->_class->string)), (((void *)0))), newExp));
10805 newExp->needCast = 0x1;
10806 ProcessExpressionType((*exp->list).first);
10807 break;
10808 }
10809 }
10810 default:
10811 {
10812 if(exp->expType->kind == 20)
10813 {
10814 struct Type * type = ProcessTemplateParameterType(exp->expType->templateParameter);
10815
10816 if(type)
10817 {
10818 FreeType(exp->destType);
10819 FreeType(exp->expType);
10820 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
10821 break;
10822 }
10823 }
10824 if(newExp->type == 8 && newExp->member.memberType == 3)
10825 {
10826 exp->type = 4;
10827 exp->op.op = '*';
10828 exp->op.exp1 = (((void *)0));
10829 exp->op.exp2 = MkExpCast(MkTypeName(MkListOne(MkSpecifierName("uint64")), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), MkExpBrackets(MkListOne(MkExpOp((((void *)0)), '&', newExp))));
10830 }
10831 else
10832 {
10833 char typeString[1024];
10834 struct Declarator * decl;
10835 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
10836
10837 typeString[0] = '\0';
10838 PrintType(exp->expType, typeString, 0x0, 0x0);
10839 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
10840 exp->type = 11;
10841 exp->cast.typeName = MkTypeName(specs, decl);
10842 exp->cast.exp = MkExpBrackets(MkListOne(newExp));
10843 exp->cast.exp->needCast = 0x1;
10844 }
10845 break;
10846 }
10847 }
10848 }
10849 }
10850
10851 extern int strncmp(const char * , const char * , int n);
10852
10853 struct __ecereNameSpace__ecere__sys__BTNode * __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindPrefix(struct __ecereNameSpace__ecere__sys__BinaryTree * this, char *  key);
10854
10855 static struct Symbol * ScanWithNameSpace(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, char * nameSpace, char * name)
10856 {
10857 int nsLen = strlen(nameSpace);
10858 struct Symbol * symbol;
10859
10860 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)))
10861 {
10862 char * s = symbol->string;
10863
10864 if(!strncmp(s, nameSpace, nsLen))
10865 {
10866 int c;
10867 char * namePart;
10868
10869 for(c = strlen(s) - 1; c >= 0; c--)
10870 if(s[c] == ':')
10871 break;
10872 namePart = s + c + 1;
10873 if(!strcmp(namePart, name))
10874 {
10875 return symbol;
10876 }
10877 }
10878 else
10879 break;
10880 }
10881 return (((void *)0));
10882 }
10883
10884 static struct Symbol * FindWithNameSpace(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, char * name)
10885 {
10886 int c;
10887 char nameSpace[1024];
10888 char * namePart;
10889 unsigned int gotColon = 0x0;
10890
10891 nameSpace[0] = '\0';
10892 for(c = strlen(name) - 1; c >= 0; c--)
10893 if(name[c] == ':')
10894 {
10895 gotColon = 0x1;
10896 break;
10897 }
10898 namePart = name + c + 1;
10899 while(c >= 0 && name[c] == ':')
10900 c--;
10901 if(c >= 0)
10902 {
10903 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, name);
10904
10905 if(symbol)
10906 return symbol;
10907 memcpy(nameSpace, name, c + 1);
10908 nameSpace[c + 1] = (char)0;
10909 return ScanWithNameSpace(tree, nameSpace, namePart);
10910 }
10911 else if(gotColon)
10912 {
10913 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, namePart);
10914
10915 return symbol;
10916 }
10917 else
10918 {
10919 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, namePart);
10920
10921 if(symbol)
10922 return symbol;
10923 return ScanWithNameSpace(tree, "", namePart);
10924 }
10925 return (((void *)0));
10926 }
10927
10928 static void ProcessDeclaration(struct Declaration * decl);
10929
10930 struct Symbol * FindSymbol(char * name, struct Context * startContext, struct Context * endContext, unsigned int isStruct, unsigned int globalNameSpace)
10931 {
10932 struct Context * ctx;
10933 struct Symbol * symbol = (((void *)0));
10934
10935 for(ctx = startContext; ctx && !symbol; ctx = ctx->parent)
10936 {
10937 if(ctx == globalContext && !globalNameSpace && ctx->hasNameSpace)
10938 {
10939 symbol = (((void *)0));
10940 if(thisNameSpace)
10941 {
10942 char curName[1024];
10943
10944 strcpy(curName, thisNameSpace);
10945 strcat(curName, "::");
10946 strcat(curName, name);
10947 symbol = FindWithNameSpace(isStruct ? &ctx->structSymbols : &ctx->symbols, curName);
10948 }
10949 if(!symbol)
10950 symbol = FindWithNameSpace(isStruct ? &ctx->structSymbols : &ctx->symbols, name);
10951 }
10952 else
10953 symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString((isStruct ? &ctx->structSymbols : &ctx->symbols), name);
10954 if(symbol || ctx == endContext)
10955 break;
10956 }
10957 if(inCompiler && curExternal && symbol && ctx == globalContext && curExternal->symbol && symbol->id > curExternal->symbol->idCode && symbol->pointerExternal)
10958 {
10959 if(symbol->pointerExternal->type == 0)
10960 {
10961 struct FunctionDefinition * function = symbol->pointerExternal->function;
10962 struct Context * tmpContext = curContext;
10963
10964 curContext = (((void *)0));
10965 symbol->pointerExternal = MkExternalDeclaration(MkDeclaration(CopyList(function->specifiers, CopySpecifier), MkListOne(MkInitDeclarator(CopyDeclarator(function->declarator), (((void *)0))))));
10966 curContext = tmpContext;
10967 symbol->pointerExternal->symbol = symbol;
10968 DeclareType(symbol->type, 0x1, 0x1);
10969 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, symbol->pointerExternal);
10970 symbol->id = curExternal->symbol->idCode;
10971 }
10972 else if(symbol->pointerExternal->type == 1 && curExternal->symbol->idCode < symbol->pointerExternal->symbol->id)
10973 {
10974 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
10975 symbol->id = curExternal->symbol->idCode;
10976 }
10977 }
10978 return symbol;
10979 }
10980
10981 static void GetTypeSpecs(struct Type * type, struct __ecereNameSpace__ecere__sys__OldList * specs)
10982 {
10983 if(!type->isSigned)
10984 ListAdd(specs, MkSpecifier(UNSIGNED));
10985 switch(type->kind)
10986 {
10987 case 8:
10988 {
10989 if(type->_class->registered)
10990 {
10991 if(!type->_class->registered->dataType)
10992 type->_class->registered->dataType = ProcessTypeString(type->_class->registered->dataTypeString, 0x0);
10993 GetTypeSpecs(type->_class->registered->dataType, specs);
10994 }
10995 break;
10996 }
10997 case 7:
10998 ListAdd(specs, MkSpecifier(DOUBLE));
10999 break;
11000 case 6:
11001 ListAdd(specs, MkSpecifier(FLOAT));
11002 break;
11003 case 1:
11004 ListAdd(specs, MkSpecifier(CHAR));
11005 break;
11006 case 2:
11007 ListAdd(specs, MkSpecifier(SHORT));
11008 break;
11009 case 4:
11010 ListAdd(specs, MkSpecifier(INT64));
11011 break;
11012 case 3:
11013 default:
11014 ListAdd(specs, MkSpecifier(INT));
11015 break;
11016 }
11017 }
11018
11019 extern char *  __ecereNameSpace__ecere__sys__RSearchString(char *  buffer, char *  subStr, int maxLen, unsigned int matchCase, unsigned int matchWord);
11020
11021 static void _PrintType(struct Type * type, char * string, unsigned int printName, unsigned int printFunction, unsigned int fullName)
11022 {
11023 if(type)
11024 {
11025 switch(type->kind)
11026 {
11027 case 8:
11028 if(type->_class && type->_class->string)
11029 {
11030 if(type->classObjectType == 2)
11031 strcat(string, "typed_object");
11032 else if(fullName)
11033 strcat(string, type->_class->string);
11034 else
11035 {
11036 if(type->_class->registered)
11037 strcat(string, type->_class->registered->name);
11038 else
11039 strcat(string, type->_class->string);
11040 }
11041 }
11042 break;
11043 case 13:
11044 {
11045 {
11046 _PrintType(type->type, string, 0x0, printFunction, fullName);
11047 strcat(string, " *");
11048 }
11049 break;
11050 }
11051 case 0:
11052 strcat(string, "void");
11053 break;
11054 case 3:
11055 strcat(string, type->isSigned ? "int" : "uint");
11056 break;
11057 case 4:
11058 strcat(string, type->isSigned ? "int64" : "uint64");
11059 break;
11060 case 1:
11061 strcat(string, type->isSigned ? "char" : "byte");
11062 break;
11063 case 2:
11064 strcat(string, type->isSigned ? "short" : "uint16");
11065 break;
11066 case 6:
11067 strcat(string, "float");
11068 break;
11069 case 7:
11070 strcat(string, "double");
11071 break;
11072 case 9:
11073 if(type->enumName)
11074 {
11075 strcat(string, "struct ");
11076 strcat(string, type->enumName);
11077 }
11078 else if(type->typeName)
11079 {
11080 strcat(string, type->typeName);
11081 }
11082 else
11083 {
11084 struct Type * member;
11085
11086 strcat(string, "struct {");
11087 for(member = type->members.first; member; member = member->next)
11088 {
11089 PrintType(member, string, 0x1, fullName);
11090 strcat(string, "; ");
11091 }
11092 strcat(string, "}");
11093 }
11094 break;
11095 case 10:
11096 if(type->enumName)
11097 {
11098 strcat(string, "union ");
11099 strcat(string, type->enumName);
11100 }
11101 else if(type->typeName)
11102 {
11103 strcat(string, type->typeName);
11104 }
11105 else
11106 {
11107 strcat(string, "union ");
11108 strcat(string, "(unnamed)");
11109 }
11110 break;
11111 case 15:
11112 if(type->enumName)
11113 {
11114 strcat(string, "enum ");
11115 strcat(string, type->enumName);
11116 }
11117 else if(type->typeName)
11118 {
11119 strcat(string, type->typeName);
11120 }
11121 else
11122 strcat(string, "enum");
11123 break;
11124 case 11:
11125 {
11126 if(printFunction)
11127 {
11128 if(type->dllExport)
11129 strcat(string, "dllexport ");
11130 PrintType(type->returnType, string, 0x0, fullName);
11131 strcat(string, " ");
11132 }
11133 if(printName)
11134 {
11135 if(type->name)
11136 {
11137 if(fullName)
11138 strcat(string, type->name);
11139 else
11140 {
11141 char * name = __ecereNameSpace__ecere__sys__RSearchString(type->name, "::", strlen(type->name), 0x1, 0x0);
11142
11143 if(name)
11144 name += 2;
11145 else
11146 name = type->name;
11147 strcat(string, name);
11148 }
11149 }
11150 }
11151 if(printFunction)
11152 {
11153 struct Type * param;
11154
11155 strcat(string, "(");
11156 for(param = type->params.first; param; param = param->next)
11157 {
11158 PrintType(param, string, 0x1, fullName);
11159 if(param->next)
11160 strcat(string, ", ");
11161 }
11162 strcat(string, ")");
11163 }
11164 break;
11165 }
11166 case 12:
11167 {
11168 {
11169 char baseType[1024], size[256];
11170 struct Type * arrayType = type;
11171
11172 baseType[0] = '\0';
11173 size[0] = '\0';
11174 while(arrayType->kind == 12)
11175 {
11176 strcat(size, "[");
11177 if(arrayType->enumClass)
11178 strcat(size, arrayType->enumClass->string);
11179 else if(arrayType->arraySizeExp)
11180 PrintExpression(arrayType->arraySizeExp, size);
11181 strcat(size, "]");
11182 arrayType = arrayType->arrayType;
11183 }
11184 _PrintType(arrayType, baseType, printName, printFunction, fullName);
11185 strcat(string, baseType);
11186 strcat(string, size);
11187 }
11188 printName = 0x0;
11189 break;
11190 }
11191 case 14:
11192 strcat(string, "...");
11193 break;
11194 case 16:
11195 _PrintType(type->method->dataType, string, 0x0, printFunction, fullName);
11196 break;
11197 case 19:
11198 strcat(string, "subclass(");
11199 strcat(string, type->_class ? type->_class->string : "int");
11200 strcat(string, ")");
11201 break;
11202 case 20:
11203 strcat(string, type->templateParameter->identifier->string);
11204 break;
11205 case 21:
11206 strcat(string, "thisclass");
11207 break;
11208 case 17:
11209 strcat(string, "__builtin_va_list");
11210 break;
11211 }
11212 if(type->name && printName && type->kind != 11 && (type->kind != 13 || type->type->kind != 11))
11213 {
11214 strcat(string, " ");
11215 strcat(string, type->name);
11216 }
11217 }
11218 }
11219
11220 void PrintType(struct Type * type, char * string, unsigned int printName, unsigned int fullName)
11221 {
11222 struct Type * funcType;
11223
11224 for(funcType = type; funcType && (funcType->kind == 13 || funcType->kind == 12); funcType = funcType->type)
11225 ;
11226 if(funcType && funcType->kind == 11 && type != funcType)
11227 {
11228 char typeString[1024];
11229 struct Type * param;
11230
11231 PrintType(funcType->returnType, string, 0x0, fullName);
11232 strcat(string, "(");
11233 _PrintType(type, string, printName, 0x0, fullName);
11234 strcat(string, ")");
11235 strcat(string, "(");
11236 for(param = funcType->params.first; param; param = param->next)
11237 {
11238 PrintType(param, string, 0x1, fullName);
11239 if(param->next)
11240 strcat(string, ", ");
11241 }
11242 strcat(string, ")");
11243 }
11244 else
11245 _PrintType(type, string, printName, 0x1, fullName);
11246 if(type->bitFieldCount)
11247 {
11248 char count[100];
11249
11250 sprintf(count, ":%d", type->bitFieldCount);
11251 strcat(string, count);
11252 }
11253 }
11254
11255 static struct Type * FindMember(struct Type * type, char * string)
11256 {
11257 struct Type * memberType;
11258
11259 for(memberType = type->members.first; memberType; memberType = memberType->next)
11260 {
11261 if(!memberType->name)
11262 {
11263 struct Type * subType = FindMember(memberType, string);
11264
11265 if(subType)
11266 return subType;
11267 }
11268 else if(!strcmp(memberType->name, string))
11269 return memberType;
11270 }
11271 return (((void *)0));
11272 }
11273
11274 struct Type * FindMemberAndOffset(struct Type * type, char * string, unsigned int * offset)
11275 {
11276 struct Type * memberType;
11277
11278 for(memberType = type->members.first; memberType; memberType = memberType->next)
11279 {
11280 if(!memberType->name)
11281 {
11282 struct Type * subType = FindMember(memberType, string);
11283
11284 if(subType)
11285 {
11286 *offset += memberType->offset;
11287 return subType;
11288 }
11289 }
11290 else if(!strcmp(memberType->name, string))
11291 {
11292 *offset += memberType->offset;
11293 return memberType;
11294 }
11295 }
11296 return (((void *)0));
11297 }
11298
11299 extern struct __ecereNameSpace__ecere__com__Instance * fileInput;
11300
11301 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Write;
11302
11303 struct Expression * ParseExpressionString(char * expression)
11304 {
11305 fileInput = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
11306 ((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));
11307 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))fileInput->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(fileInput, 0, 0);
11308 echoOn = 0x0;
11309 parsedExpression = (((void *)0));
11310 resetScanner();
11311 expression_yyparse();
11312 (__ecereNameSpace__ecere__com__eInstance_DecRef(fileInput), fileInput = 0);
11313 return parsedExpression;
11314 }
11315
11316 extern char *  QMkString(char *  source);
11317
11318 static unsigned int ResolveIdWithClass(struct Expression * exp, struct __ecereNameSpace__ecere__com__Class * _class, unsigned int skipIDClassCheck)
11319 {
11320 void * __ecereTemp1;
11321 struct Identifier * id = exp->identifier;
11322 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
11323 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
11324 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
11325 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
11326
11327 if(_class && _class->type == 4)
11328 {
11329 struct __ecereNameSpace__ecere__sys__NamedLink * value = (((void *)0));
11330 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
11331
11332 if(enumClass)
11333 {
11334 struct __ecereNameSpace__ecere__com__Class * baseClass;
11335
11336 for(baseClass = _class; baseClass && baseClass->type == 4; baseClass = baseClass->base)
11337 {
11338 struct __ecereNameSpace__ecere__com__EnumClassData * e = (baseClass ? ((void *)(((char *)baseClass->data) + enumClass->offsetClass)) : (((void *)0)));
11339
11340 for(value = e->values.first; value; value = value->next)
11341 {
11342 if(!strcmp(value->name, id->string))
11343 break;
11344 }
11345 if(value)
11346 {
11347 char constant[256];
11348
11349 FreeExpContents(exp);
11350 exp->type = 2;
11351 exp->isConstant = 0x1;
11352 if(!strcmp(baseClass->dataTypeString, "int"))
11353 sprintf(constant, "%d", value->data);
11354 else
11355 sprintf(constant, "0x%X", value->data);
11356 exp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
11357 exp->expType = MkClassType(baseClass->fullName);
11358 break;
11359 }
11360 }
11361 }
11362 if(value)
11363 return 0x1;
11364 }
11365 if((method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule)))
11366 {
11367 ProcessMethodType(method);
11368 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));
11369 return 0x1;
11370 }
11371 else if((prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule)))
11372 {
11373 if(!prop->dataType)
11374 ProcessPropertyType(prop);
11375 exp->expType = prop->dataType;
11376 if(prop->dataType)
11377 prop->dataType->refCount++;
11378 return 0x1;
11379 }
11380 else if((member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)))))
11381 {
11382 if(!member->dataType)
11383 member->dataType = ProcessTypeString(member->dataTypeString, 0x0);
11384 exp->expType = member->dataType;
11385 if(member->dataType)
11386 member->dataType->refCount++;
11387 return 0x1;
11388 }
11389 else if((classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(_class, id->string)))
11390 {
11391 if(!classProp->dataType)
11392 classProp->dataType = ProcessTypeString(classProp->dataTypeString, 0x0);
11393 if(classProp->constant)
11394 {
11395 FreeExpContents(exp);
11396 exp->isConstant = 0x1;
11397 if(classProp->dataType->kind == 13 && classProp->dataType->type->kind == 1)
11398 {
11399 exp->type = 3;
11400 exp->constant = QMkString((char *)classProp->Get(_class));
11401 }
11402 else
11403 {
11404 char constant[256];
11405
11406 exp->type = 2;
11407 sprintf(constant, "%d", classProp->Get(_class));
11408 exp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
11409 }
11410 }
11411 else
11412 {
11413 }
11414 exp->expType = classProp->dataType;
11415 if(classProp->dataType)
11416 classProp->dataType->refCount++;
11417 return 0x1;
11418 }
11419 return 0x0;
11420 }
11421
11422 static struct GlobalData * ScanGlobalData(struct __ecereNameSpace__ecere__com__NameSpace * nameSpace, char * name)
11423 {
11424 struct __ecereNameSpace__ecere__sys__BinaryTree * tree = &nameSpace->functions;
11425 struct GlobalData * data = (struct GlobalData *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString((&*tree), name);
11426 struct __ecereNameSpace__ecere__com__NameSpace * child;
11427
11428 if(!data)
11429 {
11430 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)))
11431 {
11432 data = ScanGlobalData(child, name);
11433 if(data)
11434 break;
11435 }
11436 }
11437 return data;
11438 }
11439
11440 extern struct __ecereNameSpace__ecere__com__NameSpace *  globalData;
11441
11442 extern char *  strncpy(char * , const char * , int n);
11443
11444 static struct GlobalData * FindGlobalData(char * name)
11445 {
11446 int start = 0, c;
11447 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
11448
11449 nameSpace = globalData;
11450 for(c = 0; name[c]; c++)
11451 {
11452 if(name[c] == '.' || (name[c] == ':' && name[c + 1] == ':'))
11453 {
11454 struct __ecereNameSpace__ecere__com__NameSpace * newSpace;
11455 char * spaceName = __ecereNameSpace__ecere__com__eSystem_New(sizeof(char) * (c - start + 1));
11456
11457 strncpy(spaceName, name + start, c - start);
11458 spaceName[c - start] = '\0';
11459 newSpace = (struct __ecereNameSpace__ecere__com__NameSpace *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(&(*nameSpace).nameSpaces, spaceName);
11460 (__ecereNameSpace__ecere__com__eSystem_Delete(spaceName), spaceName = 0);
11461 if(!newSpace)
11462 return (((void *)0));
11463 nameSpace = newSpace;
11464 if(name[c] == ':')
11465 c++;
11466 start = c + 1;
11467 }
11468 }
11469 if(c - start)
11470 {
11471 return ScanGlobalData(nameSpace, name + start);
11472 }
11473 return (((void *)0));
11474 }
11475
11476 static int definedExpStackPos;
11477
11478 static void * definedExpStack[512];
11479
11480 void ReplaceExpContents(struct Expression * checkedExp, struct Expression * newExp)
11481 {
11482 struct Expression * prev = checkedExp->prev, * next = checkedExp->next;
11483
11484 FreeExpContents(checkedExp);
11485 FreeType(checkedExp->expType);
11486 FreeType(checkedExp->destType);
11487 *checkedExp = *newExp;
11488 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
11489 checkedExp->prev = prev;
11490 checkedExp->next = next;
11491 }
11492
11493 extern struct Expression * MkExpCall(struct Expression * expression, struct __ecereNameSpace__ecere__sys__OldList * arguments);
11494
11495 void __ecereMethod_Expression_Clear();
11496
11497 void ApplyAnyObjectLogic(struct Expression * e)
11498 {
11499 struct Type * destType = e->destType;
11500
11501 if(destType && (destType->classObjectType == 3))
11502 {
11503 if(e && e->expType)
11504 {
11505 struct Type * type = e->expType;
11506 struct __ecereNameSpace__ecere__com__Class * _class = (((void *)0));
11507
11508 if(type->kind == 8 && type->_class && type->_class->registered)
11509 {
11510 _class = type->_class->registered;
11511 }
11512 else if(type->kind == 19)
11513 {
11514 _class = FindClass("ecere::com::Class")->registered;
11515 }
11516 else
11517 {
11518 char string[1024] = "";
11519 struct Symbol * classSym;
11520
11521 PrintType(type, string, 0x0, 0x1);
11522 classSym = FindClass(string);
11523 if(classSym)
11524 _class = classSym->registered;
11525 }
11526 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)))
11527 {
11528 if(!_class || strcmp(_class->fullName, "char *"))
11529 {
11530 struct Expression * checkedExp = e, * newExp;
11531
11532 while(((checkedExp->type == 5 || checkedExp->type == 34 || checkedExp->type == 25) && checkedExp->list) || checkedExp->type == 11)
11533 {
11534 if(checkedExp->type == 5 || checkedExp->type == 34 || checkedExp->type == 25)
11535 {
11536 if(checkedExp->type == 25)
11537 {
11538 checkedExp = (*((struct Statement *)(*checkedExp->compound->compound.statements).last)->expressions).last;
11539 }
11540 else
11541 checkedExp = (*checkedExp->list).last;
11542 }
11543 else if(checkedExp->type == 11)
11544 checkedExp = checkedExp->cast.exp;
11545 }
11546 if(checkedExp && checkedExp->type == 4 && checkedExp->op.op == '*' && !checkedExp->op.exp1)
11547 {
11548 newExp = checkedExp->op.exp2;
11549 checkedExp->op.exp2 = (((void *)0));
11550 FreeExpContents(checkedExp);
11551 if(e->expType && e->expType->passAsTemplate)
11552 {
11553 char size[100];
11554
11555 ComputeTypeSize(e->expType);
11556 sprintf(size, "%d", e->expType->size);
11557 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))))));
11558 }
11559 ReplaceExpContents(checkedExp, newExp);
11560 e->byReference = 0x1;
11561 }
11562 else if(!e->byReference || (_class && _class->type == 5))
11563 {
11564 struct Expression * checkedExp, * newExp;
11565
11566 {
11567 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;
11568
11569 if(_class && _class->type != 5 && _class->type != 0 && _class->type != 1 && !hasAddress)
11570 {
11571 struct Context * context = PushContext();
11572 struct Declarator * decl;
11573 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
11574 char typeString[1024];
11575 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
11576
11577 typeString[0] = '\0';
11578 *newExp = *e;
11579 newExp->prev = (((void *)0));
11580 newExp->next = (((void *)0));
11581 newExp->expType = (((void *)0));
11582 PrintType(e->expType, typeString, 0x0, 0x1);
11583 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
11584 newExp->destType = ProcessType(specs, decl);
11585 curContext = context;
11586 e->type = 25;
11587 e->compound = MkCompoundStmt(MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internalValue")), MkInitializerAssignment(newExp))))), MkListOne(MkExpressionStmt(MkListOne(MkExpIdentifier(MkIdentifier("__internalValue"))))));
11588 {
11589 struct Type * type = e->destType;
11590
11591 e->destType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
11592 CopyTypeInto(e->destType, type);
11593 e->destType->refCount = 1;
11594 e->destType->classObjectType = 0;
11595 FreeType(type);
11596 }
11597 e->compound->compound.context = context;
11598 PopContext(context);
11599 curContext = context->parent;
11600 }
11601 }
11602 checkedExp = e;
11603 while(((checkedExp->type == 5 || checkedExp->type == 34 || checkedExp->type == 25) && checkedExp->list) || checkedExp->type == 11)
11604 {
11605 if(checkedExp->type == 5 || checkedExp->type == 34 || checkedExp->type == 25)
11606 {
11607 if(checkedExp->type == 25)
11608 {
11609 checkedExp = (*((struct Statement *)(*checkedExp->compound->compound.statements).last)->expressions).last;
11610 }
11611 else
11612 checkedExp = (*checkedExp->list).last;
11613 }
11614 else if(checkedExp->type == 11)
11615 checkedExp = checkedExp->cast.exp;
11616 }
11617 {
11618 struct Expression * operand = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
11619
11620 *operand = *checkedExp;
11621 checkedExp->destType = (((void *)0));
11622 checkedExp->expType = (((void *)0));
11623 __ecereMethod_Expression_Clear(checkedExp);
11624 checkedExp->type = 4;
11625 checkedExp->op.op = '&';
11626 checkedExp->op.exp1 = (((void *)0));
11627 checkedExp->op.exp2 = operand;
11628 }
11629 }
11630 }
11631 }
11632 }
11633 }
11634 {
11635 }
11636 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))))
11637 {
11638 if(e->expType->kind == 8 && e->expType->_class && e->expType->_class->registered && !strcmp(e->expType->_class->registered->name, "class"))
11639 {
11640 return ;
11641 }
11642 else
11643 {
11644 struct Expression * thisExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
11645
11646 *thisExp = *e;
11647 thisExp->prev = (((void *)0));
11648 thisExp->next = (((void *)0));
11649 __ecereMethod_Expression_Clear(e);
11650 e->type = 5;
11651 e->list = MkListOne(MkExpOp((((void *)0)), '*', MkExpBrackets(MkListOne(thisExp))));
11652 if(thisExp->expType->kind == 8 && thisExp->expType->_class && thisExp->expType->_class->registered && thisExp->expType->_class->registered->type == 5)
11653 ((struct Expression *)(*e->list).first)->byReference = 0x1;
11654 {
11655 e->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
11656 CopyTypeInto(e->expType, thisExp->expType);
11657 e->expType->byReference = 0x0;
11658 e->expType->refCount = 1;
11659 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))
11660 {
11661 e->expType->classObjectType = 0;
11662 }
11663 }
11664 }
11665 }
11666 else if(destType && e->expType && (e->expType->classObjectType == 3 || e->expType->classObjectType == 2) && !destType->classObjectType && destType->kind != 0)
11667 {
11668 if(destType->kind == 14)
11669 {
11670 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Unspecified type\n", (((void *)0))));
11671 }
11672 else if(!(destType->truth && e->expType->kind == 8 && e->expType->_class && e->expType->_class->registered && e->expType->_class->registered->type == 1))
11673 {
11674 unsigned int byReference = e->expType->byReference;
11675 struct Expression * thisExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
11676 struct Declarator * decl;
11677 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
11678 char typeString[1024];
11679 struct Type * type;
11680 int backupClassObjectType;
11681
11682 if(e->expType->kind == 8 && e->expType->_class && e->expType->_class->registered && strcmp(e->expType->_class->registered->name, "class"))
11683 type = e->expType;
11684 else
11685 type = destType;
11686 backupClassObjectType = type->classObjectType;
11687 type->classObjectType = 0;
11688 typeString[0] = '\0';
11689 PrintType(type, typeString, 0x0, 0x1);
11690 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
11691 type->classObjectType = backupClassObjectType;
11692 *thisExp = *e;
11693 thisExp->prev = (((void *)0));
11694 thisExp->next = (((void *)0));
11695 __ecereMethod_Expression_Clear(e);
11696 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)))
11697 {
11698 e->type = 4;
11699 e->op.op = '*';
11700 e->op.exp1 = (((void *)0));
11701 e->op.exp2 = MkExpCast(MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl)), thisExp);
11702 }
11703 else
11704 {
11705 e->type = 11;
11706 e->cast.typeName = MkTypeName(specs, decl);
11707 e->cast.exp = thisExp;
11708 e->byReference = 0x1;
11709 }
11710 e->expType = type;
11711 e->destType = destType;
11712 type->refCount++;
11713 destType->refCount++;
11714 }
11715 }
11716 }
11717
11718 extern char *  strstr(char * , const char * );
11719
11720 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__DefinedExpression;
11721
11722 struct __ecereNameSpace__ecere__com__DefinedExpression
11723 {
11724 struct __ecereNameSpace__ecere__com__DefinedExpression * prev;
11725 struct __ecereNameSpace__ecere__com__DefinedExpression * next;
11726 char *  name;
11727 char *  value;
11728 struct __ecereNameSpace__ecere__com__NameSpace *  nameSpace;
11729 };
11730
11731 extern struct __ecereNameSpace__ecere__com__DefinedExpression * __ecereNameSpace__ecere__com__eSystem_FindDefine(struct __ecereNameSpace__ecere__com__Instance * module, char *  name);
11732
11733 extern struct __ecereNameSpace__ecere__com__GlobalFunction * __ecereNameSpace__ecere__com__eSystem_FindFunction(struct __ecereNameSpace__ecere__com__Instance * module, char *  name);
11734
11735 extern unsigned int __ecereNameSpace__ecere__sys__UTF8GetChar(char *  string, int *  numBytes);
11736
11737 extern struct Expression * GetTemplateArgExp(struct TemplateParameter * param, struct __ecereNameSpace__ecere__com__Class * curClass, unsigned int pointer);
11738
11739 extern struct Expression * MkExpMember(struct Expression * expression, struct Identifier * member);
11740
11741 extern struct Expression * MkExpCondition(struct Expression * cond, struct __ecereNameSpace__ecere__sys__OldList * expressions, struct Expression * elseExp);
11742
11743 extern struct Expression * CopyExpression(struct Expression * exp);
11744
11745 extern struct Expression * MkExpTypeSize(struct TypeName * typeName);
11746
11747 extern struct Expression * MkExpClass(struct __ecereNameSpace__ecere__sys__OldList *  specifiers, struct Declarator * decl);
11748
11749 static void ProcessStatement(struct Statement * stmt);
11750
11751 extern struct Initializer * MkInitializerList(struct __ecereNameSpace__ecere__sys__OldList * list);
11752
11753 extern struct Declaration * MkDeclarationInst(struct Instantiation * inst);
11754
11755 extern struct Instantiation * MkInstantiationNamed(struct __ecereNameSpace__ecere__sys__OldList * specs, struct Expression * exp, struct __ecereNameSpace__ecere__sys__OldList * members);
11756
11757 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear(struct __ecereNameSpace__ecere__sys__OldList * this);
11758
11759 void ProcessExpressionType(struct Expression * exp)
11760 {
11761 void * __ecereTemp2;
11762 void * __ecereTemp1;
11763 unsigned int unresolved = 0x0;
11764 struct Location oldyylloc = yylloc;
11765 unsigned int notByReference = 0x0;
11766
11767 if(!exp || exp->expType)
11768 return ;
11769 yylloc = exp->loc;
11770 switch(exp->type)
11771 {
11772 case 0:
11773 {
11774 struct Identifier * id = exp->identifier;
11775
11776 if(!id)
11777 return ;
11778 if(id->_class && id->_class->name)
11779 {
11780 id->classSym = id->_class->symbol;
11781 }
11782 if(strstr(id->string, "__ecereClass") == id->string)
11783 {
11784 exp->expType = ProcessTypeString("ecere::com::Class", 0x1);
11785 break;
11786 }
11787 else if(id->_class && (id->classSym || (id->_class->name && !strcmp(id->_class->name, "property"))))
11788 {
11789 ReplaceClassMembers(exp, thisClass);
11790 if(exp->type != 0)
11791 {
11792 ProcessExpressionType(exp);
11793 break;
11794 }
11795 if(id->classSym && ResolveIdWithClass(exp, id->classSym->registered, 0x0))
11796 break;
11797 }
11798 else
11799 {
11800 struct Symbol * symbol = FindSymbol(id->string, curContext, topContext, 0x0, id->_class && id->_class->name == (((void *)0)));
11801
11802 if(!symbol)
11803 {
11804 if(exp->destType && CheckExpressionType(exp, exp->destType, 0x0))
11805 break;
11806 else
11807 {
11808 if(thisClass)
11809 {
11810 ReplaceClassMembers(exp, thisClass ? thisClass : currentClass);
11811 if(exp->type != 0)
11812 {
11813 ProcessExpressionType(exp);
11814 break;
11815 }
11816 }
11817 else if(currentClass && !id->_class)
11818 {
11819 if(ResolveIdWithClass(exp, currentClass, 0x1))
11820 break;
11821 }
11822 symbol = FindSymbol(id->string, topContext->parent, globalContext, 0x0, id->_class && id->_class->name == (((void *)0)));
11823 }
11824 }
11825 if(symbol)
11826 {
11827 struct Type * type = symbol->type;
11828 struct __ecereNameSpace__ecere__com__Class * _class = (type && type->kind == 8 && type->_class) ? type->_class->registered : (((void *)0));
11829
11830 if(_class && !strcmp(id->string, "this") && !type->classObjectType)
11831 {
11832 struct Context * context = SetupTemplatesContext(_class);
11833
11834 type = ReplaceThisClassType(_class);
11835 FinishTemplatesContext(context);
11836 if(type)
11837 type->refCount = 0;
11838 }
11839 FreeSpecifier(id->_class);
11840 id->_class = (((void *)0));
11841 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
11842 id->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
11843 id->classSym = (((void *)0));
11844 exp->expType = type;
11845 if(type)
11846 type->refCount++;
11847 if(type && (type->kind == 15 || (_class && _class->type == 4)))
11848 exp->isConstant = 0x1;
11849 if(symbol->isParam || !strcmp(id->string, "this"))
11850 {
11851 if(_class && _class->type == 1)
11852 exp->byReference = 0x1;
11853 }
11854 if(symbol->isIterator)
11855 {
11856 if(symbol->isIterator == 3)
11857 {
11858 exp->type = 5;
11859 exp->list = MkListOne(MkExpOp((((void *)0)), '*', MkExpIdentifier(exp->identifier)));
11860 ((struct Expression *)(*exp->list).first)->op.exp2->expType = exp->expType;
11861 exp->expType = (((void *)0));
11862 ProcessExpressionType(exp);
11863 }
11864 else if(symbol->isIterator != 4)
11865 {
11866 exp->type = 8;
11867 exp->member.exp = MkExpIdentifier(exp->identifier);
11868 exp->member.exp->expType = exp->expType;
11869 exp->member.member = MkIdentifier("data");
11870 exp->expType = (((void *)0));
11871 ProcessExpressionType(exp);
11872 }
11873 }
11874 break;
11875 }
11876 else
11877 {
11878 struct __ecereNameSpace__ecere__com__DefinedExpression * definedExp = (((void *)0));
11879
11880 if(thisNameSpace && !(id->_class && !id->_class->name))
11881 {
11882 char name[1024];
11883
11884 strcpy(name, thisNameSpace);
11885 strcat(name, "::");
11886 strcat(name, id->string);
11887 definedExp = __ecereNameSpace__ecere__com__eSystem_FindDefine(privateModule, name);
11888 }
11889 if(!definedExp)
11890 definedExp = __ecereNameSpace__ecere__com__eSystem_FindDefine(privateModule, id->string);
11891 if(definedExp)
11892 {
11893 int c;
11894
11895 for(c = 0; c < definedExpStackPos; c++)
11896 if(definedExpStack[c] == definedExp)
11897 break;
11898 if(c == definedExpStackPos && c < sizeof definedExpStack / sizeof(void *))
11899 {
11900 struct Location backupYylloc = yylloc;
11901
11902 definedExpStack[definedExpStackPos++] = definedExp;
11903 fileInput = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
11904 ((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));
11905 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))fileInput->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(fileInput, 0, 0);
11906 echoOn = 0x0;
11907 parsedExpression = (((void *)0));
11908 resetScanner();
11909 expression_yyparse();
11910 (__ecereNameSpace__ecere__com__eInstance_DecRef(fileInput), fileInput = 0);
11911 yylloc = backupYylloc;
11912 if(parsedExpression)
11913 {
11914 FreeIdentifier(id);
11915 exp->type = 5;
11916 exp->list = MkListOne(parsedExpression);
11917 parsedExpression->loc = yylloc;
11918 ProcessExpressionType(exp);
11919 definedExpStackPos--;
11920 return ;
11921 }
11922 definedExpStackPos--;
11923 }
11924 else
11925 {
11926 if(inCompiler)
11927 {
11928 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Recursion in defined expression %s\n", (((void *)0))), id->string);
11929 }
11930 }
11931 }
11932 else
11933 {
11934 struct GlobalData * data = (((void *)0));
11935
11936 if(thisNameSpace && !(id->_class && !id->_class->name))
11937 {
11938 char name[1024];
11939
11940 strcpy(name, thisNameSpace);
11941 strcat(name, "::");
11942 strcat(name, id->string);
11943 data = FindGlobalData(name);
11944 }
11945 if(!data)
11946 data = FindGlobalData(id->string);
11947 if(data)
11948 {
11949 DeclareGlobalData(data);
11950 exp->expType = data->dataType;
11951 if(data->dataType)
11952 data->dataType->refCount++;
11953 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
11954 id->string = __ecereNameSpace__ecere__sys__CopyString(data->fullName);
11955 FreeSpecifier(id->_class);
11956 id->_class = (((void *)0));
11957 break;
11958 }
11959 else
11960 {
11961 struct __ecereNameSpace__ecere__com__GlobalFunction * function = (((void *)0));
11962
11963 if(thisNameSpace && !(id->_class && !id->_class->name))
11964 {
11965 char name[1024];
11966
11967 strcpy(name, thisNameSpace);
11968 strcat(name, "::");
11969 strcat(name, id->string);
11970 function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, name);
11971 }
11972 if(!function)
11973 function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, id->string);
11974 if(function)
11975 {
11976 char name[1024];
11977
11978 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
11979 id->string = __ecereNameSpace__ecere__sys__CopyString(function->name);
11980 name[0] = (char)0;
11981 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + 12)))->importType != 1 && (!function->dataType || !function->dataType->dllExport))
11982 strcpy(name, "__ecereFunction_");
11983 FullClassNameCat(name, id->string, 0x0);
11984 if(DeclareFunction(function, name))
11985 {
11986 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
11987 id->string = __ecereNameSpace__ecere__sys__CopyString(name);
11988 }
11989 exp->expType = function->dataType;
11990 if(function->dataType)
11991 function->dataType->refCount++;
11992 FreeSpecifier(id->_class);
11993 id->_class = (((void *)0));
11994 break;
11995 }
11996 }
11997 }
11998 }
11999 }
12000 unresolved = 0x1;
12001 break;
12002 }
12003 case 1:
12004 {
12005 struct __ecereNameSpace__ecere__com__Class * _class;
12006
12007 if(!exp->instance->_class)
12008 {
12009 if(exp->destType && exp->destType->kind == 8 && exp->destType->_class)
12010 {
12011 exp->instance->_class = MkSpecifierName(exp->destType->_class->string);
12012 }
12013 }
12014 ProcessInstantiationType(exp->instance);
12015 exp->isConstant = exp->instance->isConstant;
12016 if(exp->instance->_class)
12017 {
12018 exp->expType = MkClassType(exp->instance->_class->name);
12019 }
12020 break;
12021 }
12022 case 2:
12023 {
12024 if(!exp->expType)
12025 {
12026 struct Type * type = (type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), type->refCount = 1, type->constant = 0x1, type);
12027
12028 exp->expType = type;
12029 if(exp->constant[0] == '\'')
12030 {
12031 if((int)((unsigned char *)exp->constant)[1] > 127)
12032 {
12033 int nb;
12034 unsigned int ch = __ecereNameSpace__ecere__sys__UTF8GetChar(exp->constant + 1, &nb);
12035
12036 if(nb < 2)
12037 ch = exp->constant[1];
12038 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->constant), exp->constant = 0);
12039 exp->constant = PrintUInt(ch);
12040 type->kind = 8;
12041 type->_class = FindClass("unichar");
12042 type->isSigned = 0x0;
12043 }
12044 else
12045 {
12046 type->kind = 1;
12047 type->isSigned = 0x1;
12048 }
12049 }
12050 else if(strchr(exp->constant, '.'))
12051 {
12052 char ch = exp->constant[strlen(exp->constant) - 1];
12053
12054 if(ch == 'f')
12055 type->kind = 6;
12056 else
12057 type->kind = 7;
12058 type->isSigned = 0x1;
12059 }
12060 else
12061 {
12062 if(exp->constant[0] == '0' && exp->constant[1])
12063 type->isSigned = 0x0;
12064 else if(strchr(exp->constant, 'L') || strchr(exp->constant, 'l'))
12065 type->isSigned = 0x0;
12066 else if(strtoll(exp->constant, (((void *)0)), 0) > (((int)0x7fffffff)))
12067 type->isSigned = 0x0;
12068 else
12069 type->isSigned = 0x1;
12070 type->kind = 3;
12071 }
12072 exp->isConstant = 0x1;
12073 }
12074 break;
12075 }
12076 case 3:
12077 {
12078 exp->isConstant = 0x1;
12079 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));
12080 break;
12081 }
12082 case 13:
12083 case 28:
12084 ProcessExpressionType(exp->_new.size);
12085 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));
12086 DeclareType(exp->expType->type, 0x0, 0x0);
12087 break;
12088 case 14:
12089 case 29:
12090 ProcessExpressionType(exp->_renew.size);
12091 ProcessExpressionType(exp->_renew.exp);
12092 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));
12093 DeclareType(exp->expType->type, 0x0, 0x0);
12094 break;
12095 case 4:
12096 {
12097 unsigned int assign = 0x0, boolResult = 0x0, boolOps = 0x0;
12098 struct Type * type1 = (((void *)0)), * type2 = (((void *)0));
12099 unsigned int useDestType = 0x0, useSideType = 0x0;
12100 struct Location oldyylloc = yylloc;
12101 unsigned int useSideUnit = 0x0;
12102 struct Type * dummy = (dummy = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), dummy->count = (unsigned int)1, dummy->refCount = 1, dummy);
12103
12104 switch(exp->op.op)
12105 {
12106 case '=':
12107 case MUL_ASSIGN:
12108 case DIV_ASSIGN:
12109 case MOD_ASSIGN:
12110 case ADD_ASSIGN:
12111 case SUB_ASSIGN:
12112 case LEFT_ASSIGN:
12113 case RIGHT_ASSIGN:
12114 case AND_ASSIGN:
12115 case XOR_ASSIGN:
12116 case OR_ASSIGN:
12117 assign = 0x1;
12118 break;
12119 case '!':
12120 break;
12121 case AND_OP:
12122 case OR_OP:
12123 boolOps = 0x1;
12124 boolResult = 0x1;
12125 break;
12126 case EQ_OP:
12127 case '<':
12128 case '>':
12129 case LE_OP:
12130 case GE_OP:
12131 case NE_OP:
12132 boolResult = 0x1;
12133 useSideType = 0x1;
12134 break;
12135 case '+':
12136 case '-':
12137 useSideUnit = 0x1;
12138 case '|':
12139 case '&':
12140 case '^':
12141 case '/':
12142 case '%':
12143 case '*':
12144 if(exp->op.op != '*' || exp->op.exp1)
12145 {
12146 useSideType = 0x1;
12147 useDestType = 0x1;
12148 }
12149 break;
12150 }
12151 if(exp->op.op == '&')
12152 {
12153 if(!exp->op.exp1 && exp->op.exp2 && exp->op.exp2->type == 0 && exp->op.exp2->identifier)
12154 {
12155 struct Identifier * id = exp->op.exp2->identifier;
12156 struct Symbol * symbol = FindSymbol(id->string, curContext, topContext, 0x0, id->_class && id->_class->name == (((void *)0)));
12157
12158 if(symbol && symbol->isIterator == 2)
12159 {
12160 exp->type = 8;
12161 exp->member.exp = exp->op.exp2;
12162 exp->member.member = MkIdentifier("key");
12163 exp->expType = (((void *)0));
12164 exp->op.exp2->expType = symbol->type;
12165 symbol->type->refCount++;
12166 ProcessExpressionType(exp);
12167 FreeType(dummy);
12168 break;
12169 }
12170 }
12171 }
12172 if(exp->op.exp1)
12173 {
12174 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))
12175 {
12176 if(exp->op.exp1->destType)
12177 FreeType(exp->op.exp1->destType);
12178 exp->op.exp1->destType = exp->destType;
12179 if(exp->destType)
12180 exp->destType->refCount++;
12181 }
12182 else if(!assign)
12183 {
12184 if(exp->op.exp1->destType)
12185 FreeType(exp->op.exp1->destType);
12186 exp->op.exp1->destType = dummy;
12187 dummy->refCount++;
12188 }
12189 if(exp->op.exp1->destType && exp->op.op != '=')
12190 exp->op.exp1->destType->count++;
12191 ProcessExpressionType(exp->op.exp1);
12192 if(exp->op.exp1->destType && exp->op.op != '=')
12193 exp->op.exp1->destType->count--;
12194 if(exp->op.exp1->destType == dummy)
12195 {
12196 FreeType(dummy);
12197 exp->op.exp1->destType = (((void *)0));
12198 }
12199 type1 = exp->op.exp1->expType;
12200 }
12201 if(exp->op.exp2)
12202 {
12203 char expString[10240];
12204
12205 expString[0] = '\0';
12206 if(exp->op.exp2->type == 1 && !exp->op.exp2->instance->_class)
12207 {
12208 if(exp->op.exp1)
12209 {
12210 exp->op.exp2->destType = exp->op.exp1->expType;
12211 if(exp->op.exp1->expType)
12212 exp->op.exp1->expType->refCount++;
12213 }
12214 else
12215 {
12216 exp->op.exp2->destType = exp->destType;
12217 if(exp->destType)
12218 exp->destType->refCount++;
12219 }
12220 if(type1)
12221 type1->refCount++;
12222 exp->expType = type1;
12223 }
12224 else if(assign)
12225 {
12226 if(inCompiler)
12227 PrintExpression(exp->op.exp2, expString);
12228 if(type1 && type1->kind == 13)
12229 {
12230 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)
12231 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "operator %s illegal on pointer\n", (((void *)0))), exp->op.op);
12232 else if(exp->op.op == '=')
12233 {
12234 if(exp->op.exp2->destType)
12235 FreeType(exp->op.exp2->destType);
12236 exp->op.exp2->destType = type1;
12237 if(type1)
12238 type1->refCount++;
12239 }
12240 }
12241 else
12242 {
12243 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)
12244 ;
12245 else
12246 {
12247 if(exp->op.exp2->destType)
12248 FreeType(exp->op.exp2->destType);
12249 exp->op.exp2->destType = type1;
12250 if(type1)
12251 type1->refCount++;
12252 }
12253 }
12254 if(type1)
12255 type1->refCount++;
12256 exp->expType = type1;
12257 }
12258 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)))
12259 {
12260 if(exp->op.exp2->destType)
12261 FreeType(exp->op.exp2->destType);
12262 exp->op.exp2->destType = exp->destType;
12263 if(exp->destType)
12264 exp->destType->refCount++;
12265 }
12266 else
12267 {
12268 if(exp->op.exp2->destType)
12269 FreeType(exp->op.exp2->destType);
12270 exp->op.exp2->destType = dummy;
12271 dummy->refCount++;
12272 }
12273 if(type1 && boolResult && useSideType && type1->kind == 8 && type1->_class && type1->_class->registered && (type1->_class->registered->type == 2 || type1->_class->registered->type == 4))
12274 {
12275 FreeType(exp->op.exp2->destType);
12276 exp->op.exp2->destType = type1;
12277 type1->refCount++;
12278 }
12279 if(exp->op.exp2->destType && exp->op.op != '=')
12280 exp->op.exp2->destType->count++;
12281 ProcessExpressionType(exp->op.exp2);
12282 if(exp->op.exp2->destType && exp->op.op != '=')
12283 exp->op.exp2->destType->count--;
12284 if(assign && type1 && type1->kind == 13 && exp->op.exp2->expType)
12285 {
12286 if(exp->op.exp2->expType->kind == 4 || exp->op.exp2->expType->kind == 3 || exp->op.exp2->expType->kind == 2 || exp->op.exp2->expType->kind == 1)
12287 {
12288 if(exp->op.op != '=' && type1->type->kind == 0)
12289 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "void *: unknown size\n", (((void *)0))));
12290 }
12291 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)))
12292 {
12293 if(exp->op.op == ADD_ASSIGN)
12294 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "cannot add two pointers\n", (((void *)0))));
12295 }
12296 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))
12297 {
12298 if(exp->op.op == ADD_ASSIGN)
12299 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "cannot add two pointers\n", (((void *)0))));
12300 }
12301 else if(inCompiler)
12302 {
12303 char type1String[1024];
12304 char type2String[1024];
12305
12306 type1String[0] = '\0';
12307 type2String[0] = '\0';
12308 PrintType(exp->op.exp2->expType, type1String, 0x0, 0x1);
12309 PrintType(type1, type2String, 0x0, 0x1);
12310 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
12311 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible expression %s (%s); expected %s\n", (((void *)0))), expString, type1String, type2String);
12312 }
12313 }
12314 if(exp->op.exp2->destType == dummy)
12315 {
12316 FreeType(dummy);
12317 exp->op.exp2->destType = (((void *)0));
12318 }
12319 type2 = exp->op.exp2->expType;
12320 }
12321 dummy->kind = 0;
12322 if(exp->op.op == SIZEOF)
12323 {
12324 exp->expType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1)->kind = 3, ((struct Type *)__ecereTemp1));
12325 exp->isConstant = 0x1;
12326 }
12327 else if(exp->op.op == '*' && !exp->op.exp1)
12328 {
12329 exp->expType = Dereference(type2);
12330 if(type2 && type2->kind == 8)
12331 notByReference = 0x1;
12332 }
12333 else if(exp->op.op == '&' && !exp->op.exp1)
12334 exp->expType = Reference(type2);
12335 else if(!assign)
12336 {
12337 if(boolOps)
12338 {
12339 if(exp->op.exp1)
12340 {
12341 if(exp->op.exp1->destType)
12342 FreeType(exp->op.exp1->destType);
12343 exp->op.exp1->destType = MkClassType("bool");
12344 exp->op.exp1->destType->truth = 0x1;
12345 if(!exp->op.exp1->expType)
12346 ProcessExpressionType(exp->op.exp1);
12347 else
12348 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
12349 FreeType(exp->op.exp1->expType);
12350 exp->op.exp1->expType = MkClassType("bool");
12351 exp->op.exp1->expType->truth = 0x1;
12352 }
12353 if(exp->op.exp2)
12354 {
12355 if(exp->op.exp2->destType)
12356 FreeType(exp->op.exp2->destType);
12357 exp->op.exp2->destType = MkClassType("bool");
12358 exp->op.exp2->destType->truth = 0x1;
12359 if(!exp->op.exp2->expType)
12360 ProcessExpressionType(exp->op.exp2);
12361 else
12362 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
12363 FreeType(exp->op.exp2->expType);
12364 exp->op.exp2->expType = MkClassType("bool");
12365 exp->op.exp2->expType->truth = 0x1;
12366 }
12367 }
12368 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")))))
12369 {
12370 if(type1 && type2 && ((type1->kind == 8 && strcmp(type1->_class->string, "String")) == (type2->kind == 8 && strcmp(type2->_class->string, "String"))))
12371 {
12372 if(exp->op.exp2->destType)
12373 FreeType(exp->op.exp2->destType);
12374 exp->op.exp2->destType = type1;
12375 type1->refCount++;
12376 if(exp->op.exp1->destType)
12377 FreeType(exp->op.exp1->destType);
12378 exp->op.exp1->destType = type2;
12379 type2->refCount++;
12380 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)
12381 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);
12382 if(type1->kind == 13 && type1->type->kind == 20 && type2->kind != 13)
12383 {
12384 struct Expression * argExp = GetTemplateArgExp(type1->type->templateParameter, thisClass, 0x1);
12385
12386 if(argExp)
12387 {
12388 struct Expression * classExp = MkExpMember(argExp, MkIdentifier("dataTypeClass"));
12389
12390 exp->op.exp1 = MkExpBrackets(MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName("byte")), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), exp->op.exp1)));
12391 ProcessExpressionType(exp->op.exp1);
12392 if(type2->kind != 13)
12393 {
12394 ProcessExpressionType(classExp);
12395 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"))))))));
12396 if(!exp->op.exp2->expType)
12397 type2 = exp->op.exp2->expType = ProcessTypeString("int", 0x0);
12398 ProcessExpressionType(exp->op.exp2);
12399 }
12400 }
12401 }
12402 if(!boolResult && ((type1->kind == 13 || type1->kind == 12 || (type1->kind == 8 && !strcmp(type1->_class->string, "String"))) && (type2->kind == 4 || type2->kind == 3 || type2->kind == 2 || type2->kind == 1)))
12403 {
12404 if(type1->kind != 8 && type1->type->kind == 0)
12405 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "void *: unknown size\n", (((void *)0))));
12406 exp->expType = type1;
12407 if(type1)
12408 type1->refCount++;
12409 }
12410 else if(!boolResult && ((type2->kind == 13 || type2->kind == 12 || (type2->kind == 8 && !strcmp(type2->_class->string, "String"))) && (type1->kind == 4 || type1->kind == 3 || type1->kind == 2 || type1->kind == 1)))
12411 {
12412 if(type2->kind != 8 && type2->type->kind == 0)
12413 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "void *: unknown size\n", (((void *)0))));
12414 exp->expType = type2;
12415 if(type2)
12416 type2->refCount++;
12417 }
12418 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))
12419 {
12420 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "different levels of indirection\n", (((void *)0))));
12421 }
12422 else
12423 {
12424 unsigned int success = 0x0;
12425
12426 if(type1->kind == 13 && type2->kind == 13)
12427 {
12428 if(exp->op.op == '+')
12429 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "cannot add two pointers\n", (((void *)0))));
12430 else if(exp->op.op == '-')
12431 {
12432 if(MatchTypes(type1->type, type2->type, (((void *)0)), (((void *)0)), (((void *)0)), 0x0, 0x0, 0x0, 0x0))
12433 {
12434 exp->expType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->kind = 3, ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1));
12435 success = 0x1;
12436 if(type1->type->kind == 20)
12437 {
12438 struct Expression * argExp = GetTemplateArgExp(type1->type->templateParameter, thisClass, 0x1);
12439
12440 if(argExp)
12441 {
12442 struct Expression * classExp = MkExpMember(argExp, MkIdentifier("dataTypeClass"));
12443
12444 ProcessExpressionType(classExp);
12445 exp->type = 5;
12446 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")))))));
12447 ProcessExpressionType(((struct Expression *)(*exp->list).first)->op.exp2);
12448 FreeType(dummy);
12449 return ;
12450 }
12451 }
12452 }
12453 }
12454 }
12455 if(!success && exp->op.exp1->type == 2)
12456 {
12457 if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
12458 {
12459 if(exp->expType)
12460 FreeType(exp->expType);
12461 exp->expType = exp->op.exp1->destType;
12462 if(exp->op.exp1->destType)
12463 exp->op.exp1->destType->refCount++;
12464 success = 0x1;
12465 }
12466 else if(CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0))
12467 {
12468 if(exp->expType)
12469 FreeType(exp->expType);
12470 exp->expType = exp->op.exp2->destType;
12471 if(exp->op.exp2->destType)
12472 exp->op.exp2->destType->refCount++;
12473 success = 0x1;
12474 }
12475 }
12476 else if(!success)
12477 {
12478 if(CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0))
12479 {
12480 if(exp->expType)
12481 FreeType(exp->expType);
12482 exp->expType = exp->op.exp2->destType;
12483 if(exp->op.exp2->destType)
12484 exp->op.exp2->destType->refCount++;
12485 success = 0x1;
12486 }
12487 else if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
12488 {
12489 if(exp->expType)
12490 FreeType(exp->expType);
12491 exp->expType = exp->op.exp1->destType;
12492 if(exp->op.exp1->destType)
12493 exp->op.exp1->destType->refCount++;
12494 success = 0x1;
12495 }
12496 }
12497 if(!success)
12498 {
12499 char expString1[10240];
12500 char expString2[10240];
12501 char type1[1024];
12502 char type2[1024];
12503
12504 expString1[0] = '\0';
12505 expString2[0] = '\0';
12506 type1[0] = '\0';
12507 type2[0] = '\0';
12508 if(inCompiler)
12509 {
12510 PrintExpression(exp->op.exp1, expString1);
12511 __ecereNameSpace__ecere__sys__ChangeCh(expString1, '\n', ' ');
12512 PrintExpression(exp->op.exp2, expString2);
12513 __ecereNameSpace__ecere__sys__ChangeCh(expString2, '\n', ' ');
12514 PrintType(exp->op.exp1->expType, type1, 0x0, 0x1);
12515 PrintType(exp->op.exp2->expType, type2, 0x0, 0x1);
12516 }
12517 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible expressions %s (%s) and %s (%s)\n", (((void *)0))), expString1, type1, expString2, type2);
12518 }
12519 }
12520 }
12521 else if(!boolResult && (!useSideUnit) && type2 && type1 && type2->kind == 8 && type1->kind != 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 3)
12522 {
12523 if(exp->op.exp1->destType)
12524 FreeType(exp->op.exp1->destType);
12525 exp->op.exp1->destType = type2->_class->registered->dataType;
12526 if(type2->_class->registered->dataType)
12527 type2->_class->registered->dataType->refCount++;
12528 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
12529 exp->expType = type2;
12530 if(type2)
12531 type2->refCount++;
12532 }
12533 else if(!boolResult && (!useSideUnit) && type1 && type2 && type1->kind == 8 && type2->kind != 8 && type1->_class && type1->_class->registered && type1->_class->registered->type == 3)
12534 {
12535 if(exp->op.exp2->destType)
12536 FreeType(exp->op.exp2->destType);
12537 exp->op.exp2->destType = type1->_class->registered->dataType;
12538 if(type1->_class->registered->dataType)
12539 type1->_class->registered->dataType->refCount++;
12540 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
12541 exp->expType = type1;
12542 if(type1)
12543 type1->refCount++;
12544 }
12545 else if(type1)
12546 {
12547 unsigned int valid = 0x0;
12548
12549 if(!boolResult && useSideUnit && type1 && type1->kind == 8 && type1->_class->registered && type1->_class->registered->type == 3 && type2 && type2->kind != 8)
12550 {
12551 if(exp->op.exp2->destType)
12552 FreeType(exp->op.exp2->destType);
12553 if(!type1->_class->registered->dataType)
12554 type1->_class->registered->dataType = ProcessTypeString(type1->_class->registered->dataTypeString, 0x0);
12555 exp->op.exp2->destType = type1->_class->registered->dataType;
12556 exp->op.exp2->destType->refCount++;
12557 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
12558 type2 = exp->op.exp2->destType;
12559 exp->expType = type2;
12560 type2->refCount++;
12561 }
12562 if(!boolResult && useSideUnit && type2 && type2->kind == 8 && type2->_class->registered && type2->_class->registered->type == 3 && type1 && type1->kind != 8)
12563 {
12564 if(exp->op.exp1->destType)
12565 FreeType(exp->op.exp1->destType);
12566 if(!type2->_class->registered->dataType)
12567 type2->_class->registered->dataType = ProcessTypeString(type2->_class->registered->dataTypeString, 0x0);
12568 exp->op.exp1->destType = type2->_class->registered->dataType;
12569 exp->op.exp1->destType->refCount++;
12570 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
12571 type1 = exp->op.exp1->destType;
12572 exp->expType = type1;
12573 type1->refCount++;
12574 }
12575 if(!boolResult || exp->op.op == '>' || exp->op.op == '<')
12576 {
12577 if(type1->kind == 8 && type1->_class && type1->_class->registered && type1->_class->registered->type == 4 && exp->op.exp2->expType)
12578 {
12579 if(CheckExpressionType(exp->op.exp1, exp->op.exp2->expType, 0x0))
12580 {
12581 if(exp->expType)
12582 FreeType(exp->expType);
12583 exp->expType = exp->op.exp1->expType;
12584 if(exp->op.exp2->expType)
12585 exp->op.exp1->expType->refCount++;
12586 valid = 0x1;
12587 }
12588 }
12589 else if(type2 && (type2->kind == 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 4 && exp->op.exp1->expType))
12590 {
12591 if(CheckExpressionType(exp->op.exp2, exp->op.exp1->expType, 0x0))
12592 {
12593 if(exp->expType)
12594 FreeType(exp->expType);
12595 exp->expType = exp->op.exp2->expType;
12596 if(exp->op.exp2->expType)
12597 exp->op.exp2->expType->refCount++;
12598 valid = 0x1;
12599 }
12600 }
12601 }
12602 if(!valid)
12603 {
12604 if(exp->op.exp2->destType)
12605 FreeType(exp->op.exp2->destType);
12606 exp->op.exp2->destType = type1;
12607 type1->refCount++;
12608 if(CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0))
12609 {
12610 if(exp->expType)
12611 FreeType(exp->expType);
12612 exp->expType = exp->op.exp2->destType;
12613 if(exp->op.exp2->destType)
12614 exp->op.exp2->destType->refCount++;
12615 }
12616 else if(type1 && type2)
12617 {
12618 char expString1[10240];
12619 char expString2[10240];
12620 char type1String[1024];
12621 char type2String[1024];
12622
12623 expString1[0] = '\0';
12624 expString2[0] = '\0';
12625 type1String[0] = '\0';
12626 type2String[0] = '\0';
12627 if(inCompiler)
12628 {
12629 PrintExpression(exp->op.exp1, expString1);
12630 __ecereNameSpace__ecere__sys__ChangeCh(expString1, '\n', ' ');
12631 PrintExpression(exp->op.exp2, expString2);
12632 __ecereNameSpace__ecere__sys__ChangeCh(expString2, '\n', ' ');
12633 PrintType(exp->op.exp1->expType, type1String, 0x0, 0x1);
12634 PrintType(exp->op.exp2->expType, type2String, 0x0, 0x1);
12635 }
12636 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible expressions %s (%s) and %s (%s)\n", (((void *)0))), expString1, type1String, expString2, type2String);
12637 if(type1->kind == 8 && type1->_class && type1->_class->registered && type1->_class->registered->type == 4)
12638 {
12639 exp->expType = exp->op.exp1->expType;
12640 if(exp->op.exp1->expType)
12641 exp->op.exp1->expType->refCount++;
12642 }
12643 else if(type2->kind == 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 4)
12644 {
12645 exp->expType = exp->op.exp2->expType;
12646 if(exp->op.exp2->expType)
12647 exp->op.exp2->expType->refCount++;
12648 }
12649 }
12650 }
12651 }
12652 else if(type2)
12653 {
12654 if(type2->kind == 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 4)
12655 {
12656 struct Type * oldType = exp->op.exp1->expType;
12657
12658 exp->op.exp1->expType = (((void *)0));
12659 if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
12660 FreeType(oldType);
12661 else
12662 exp->op.exp1->expType = oldType;
12663 }
12664 if(exp->op.exp1->destType)
12665 FreeType(exp->op.exp1->destType);
12666 exp->op.exp1->destType = type2;
12667 type2->refCount++;
12668 if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
12669 {
12670 if(exp->expType)
12671 FreeType(exp->expType);
12672 exp->expType = exp->op.exp1->destType;
12673 if(exp->op.exp1->destType)
12674 exp->op.exp1->destType->refCount++;
12675 }
12676 }
12677 }
12678 else if(type2 && (!type1 || (type2->kind == 8 && type1->kind != 8)))
12679 {
12680 if(type1 && type2->_class && type2->_class->registered && type2->_class->registered->type == 3)
12681 {
12682 if(exp->op.exp1->destType)
12683 FreeType(exp->op.exp1->destType);
12684 exp->op.exp1->destType = type2->_class->registered->dataType;
12685 if(type2->_class->registered->dataType)
12686 type2->_class->registered->dataType->refCount++;
12687 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
12688 }
12689 if(exp->op.op == '!')
12690 {
12691 exp->expType = MkClassType("bool");
12692 exp->expType->truth = 0x1;
12693 }
12694 else
12695 {
12696 exp->expType = type2;
12697 if(type2)
12698 type2->refCount++;
12699 }
12700 }
12701 else if(type1 && (!type2 || (type1->kind == 8 && type2->kind != 8)))
12702 {
12703 if(type2 && type1->_class && type1->_class->registered && type1->_class->registered->type == 3)
12704 {
12705 if(exp->op.exp2->destType)
12706 FreeType(exp->op.exp2->destType);
12707 exp->op.exp2->destType = type1->_class->registered->dataType;
12708 if(type1->_class->registered->dataType)
12709 type1->_class->registered->dataType->refCount++;
12710 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
12711 }
12712 exp->expType = type1;
12713 if(type1)
12714 type1->refCount++;
12715 }
12716 }
12717 yylloc = exp->loc;
12718 if(exp->op.exp1 && !exp->op.exp1->expType)
12719 {
12720 char expString[10000];
12721
12722 expString[0] = '\0';
12723 if(inCompiler)
12724 {
12725 PrintExpression(exp->op.exp1, expString);
12726 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
12727 }
12728 if(expString[0])
12729 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't determine type of %s\n", (((void *)0))), expString);
12730 }
12731 if(exp->op.exp2 && !exp->op.exp2->expType)
12732 {
12733 char expString[10240];
12734
12735 expString[0] = '\0';
12736 if(inCompiler)
12737 {
12738 PrintExpression(exp->op.exp2, expString);
12739 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
12740 }
12741 if(expString[0])
12742 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't determine type of %s\n", (((void *)0))), expString);
12743 }
12744 if(boolResult)
12745 {
12746 FreeType(exp->expType);
12747 exp->expType = MkClassType("bool");
12748 exp->expType->truth = 0x1;
12749 }
12750 if(exp->op.op != SIZEOF)
12751 exp->isConstant = (!exp->op.exp1 || exp->op.exp1->isConstant) && (!exp->op.exp2 || exp->op.exp2->isConstant);
12752 if(exp->op.op == SIZEOF && exp->op.exp2->expType)
12753 {
12754 DeclareType(exp->op.exp2->expType, 0x0, 0x0);
12755 }
12756 yylloc = oldyylloc;
12757 FreeType(dummy);
12758 break;
12759 }
12760 case 5:
12761 case 34:
12762 {
12763 struct Expression * e;
12764
12765 exp->isConstant = 0x1;
12766 for(e = (*exp->list).first; e; e = e->next)
12767 {
12768 unsigned int inced = 0x0;
12769
12770 if(!e->next)
12771 {
12772 FreeType(e->destType);
12773 e->destType = exp->destType;
12774 if(e->destType)
12775 {
12776 exp->destType->refCount++;
12777 e->destType->count++;
12778 inced = 0x1;
12779 }
12780 }
12781 ProcessExpressionType(e);
12782 if(inced)
12783 exp->destType->count--;
12784 if(!exp->expType && !e->next)
12785 {
12786 exp->expType = e->expType;
12787 if(e->expType)
12788 e->expType->refCount++;
12789 }
12790 if(!e->isConstant)
12791 exp->isConstant = 0x0;
12792 }
12793 e = (*exp->list).first;
12794 if(!e->next && e->type == 8)
12795 {
12796 struct Expression * next = exp->next, * prev = exp->prev;
12797
12798 FreeType(exp->expType);
12799 FreeType(exp->destType);
12800 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->list), exp->list = 0);
12801 *exp = *e;
12802 exp->prev = prev;
12803 exp->next = next;
12804 ((e ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(e) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(e)) : 0), e = 0);
12805 ProcessExpressionType(exp);
12806 }
12807 break;
12808 }
12809 case 6:
12810 {
12811 struct Expression * e;
12812
12813 exp->isConstant = 0x1;
12814 ProcessExpressionType(exp->index.exp);
12815 if(!exp->index.exp->isConstant)
12816 exp->isConstant = 0x0;
12817 if(exp->index.exp->expType)
12818 {
12819 struct Type * source = exp->index.exp->expType;
12820
12821 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)
12822 {
12823 struct __ecereNameSpace__ecere__com__Class * _class = source->_class->registered;
12824
12825 exp->expType = ProcessTypeString(_class->templateArgs[2].dataTypeString, 0x0);
12826 if(exp->index.index && (*exp->index.index).last)
12827 {
12828 ((struct Expression *)(*exp->index.index).last)->destType = ProcessTypeString(_class->templateArgs[1].dataTypeString, 0x0);
12829 }
12830 }
12831 }
12832 for(e = (*exp->index.index).first; e; e = e->next)
12833 {
12834 if(!e->next && exp->index.exp->expType && exp->index.exp->expType->kind == 12 && exp->index.exp->expType->enumClass)
12835 {
12836 if(e->destType)
12837 FreeType(e->destType);
12838 e->destType = MkClassType(exp->index.exp->expType->enumClass->string);
12839 }
12840 ProcessExpressionType(e);
12841 if(!e->next)
12842 {
12843 }
12844 if(!e->isConstant)
12845 exp->isConstant = 0x0;
12846 }
12847 if(!exp->expType)
12848 exp->expType = Dereference(exp->index.exp->expType);
12849 if(exp->expType)
12850 DeclareType(exp->expType, 0x0, 0x0);
12851 break;
12852 }
12853 case 7:
12854 {
12855 struct Expression * e;
12856 struct Type * functionType;
12857 struct Type * methodType = (((void *)0));
12858 char name[1024];
12859
12860 name[0] = '\0';
12861 if(inCompiler)
12862 {
12863 PrintExpression(exp->call.exp, name);
12864 if(exp->call.exp->expType && !exp->call.exp->expType->returnType)
12865 {
12866 PrintExpression(exp->call.exp, name);
12867 }
12868 }
12869 if(exp->call.exp->type == 0)
12870 {
12871 struct Expression * idExp = exp->call.exp;
12872 struct Identifier * id = idExp->identifier;
12873
12874 if(!strcmp(id->string, "__ENDIAN_PAD"))
12875 {
12876 exp->expType = ProcessTypeString("int", 0x1);
12877 if(exp->call.arguments && (*exp->call.arguments).first)
12878 ProcessExpressionType((*exp->call.arguments).first);
12879 break;
12880 }
12881 else if(!strcmp(id->string, "Max") || !strcmp(id->string, "Min") || !strcmp(id->string, "Sgn") || !strcmp(id->string, "Abs"))
12882 {
12883 struct Expression * a = (((void *)0));
12884 struct Expression * b = (((void *)0));
12885 struct Expression * tempExp1 = (((void *)0)), * tempExp2 = (((void *)0));
12886
12887 if((!strcmp(id->string, "Max") || !strcmp(id->string, "Min")) && (*exp->call.arguments).count == 2)
12888 {
12889 a = (*exp->call.arguments).first;
12890 b = (*exp->call.arguments).last;
12891 tempExp1 = a;
12892 tempExp2 = b;
12893 }
12894 else if((*exp->call.arguments).count == 1)
12895 {
12896 a = (*exp->call.arguments).first;
12897 tempExp1 = a;
12898 }
12899 if(a)
12900 {
12901 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear((&*exp->call.arguments));
12902 idExp->identifier = (((void *)0));
12903 FreeExpContents(exp);
12904 ProcessExpressionType(a);
12905 if(b)
12906 ProcessExpressionType(b);
12907 exp->type = 5;
12908 exp->list = MkList();
12909 if(a->expType && (!b || b->expType))
12910 {
12911 if((!a->isConstant && a->type != 0) || (b && !b->isConstant && b->type != 0))
12912 {
12913 if(inCompiler)
12914 {
12915 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
12916 struct __ecereNameSpace__ecere__sys__OldList * decls = MkList();
12917 struct Declaration * decl;
12918 char temp1[1024], temp2[1024];
12919
12920 GetTypeSpecs(a->expType, specs);
12921 if(a && !a->isConstant && a->type != 0)
12922 {
12923 sprintf(temp1, "__simpleStruct%d", curContext->simpleID++);
12924 ListAdd(decls, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(temp1)), (((void *)0))));
12925 tempExp1 = QMkExpId(temp1);
12926 tempExp1->expType = a->expType;
12927 if(a->expType)
12928 a->expType->refCount++;
12929 ListAdd(exp->list, MkExpOp(CopyExpression(tempExp1), '=', a));
12930 }
12931 if(b && !b->isConstant && b->type != 0)
12932 {
12933 sprintf(temp2, "__simpleStruct%d", curContext->simpleID++);
12934 ListAdd(decls, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(temp2)), (((void *)0))));
12935 tempExp2 = QMkExpId(temp2);
12936 tempExp2->expType = b->expType;
12937 if(b->expType)
12938 b->expType->refCount++;
12939 ListAdd(exp->list, MkExpOp(CopyExpression(tempExp2), '=', b));
12940 }
12941 decl = MkDeclaration(specs, decls);
12942 if(!curCompound->compound.declarations)
12943 curCompound->compound.declarations = MkList();
12944 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*curCompound->compound.declarations), (((void *)0)), decl);
12945 }
12946 }
12947 }
12948 if(!strcmp(id->string, "Max") || !strcmp(id->string, "Min"))
12949 {
12950 int op = (!strcmp(id->string, "Max")) ? '>' : '<';
12951
12952 ListAdd(exp->list, MkExpCondition(MkExpBrackets(MkListOne(MkExpOp(CopyExpression(tempExp1), op, CopyExpression(tempExp2)))), MkListOne(CopyExpression(tempExp1)), CopyExpression(tempExp2)));
12953 exp->expType = a->expType;
12954 if(a->expType)
12955 a->expType->refCount++;
12956 }
12957 else if(!strcmp(id->string, "Abs"))
12958 {
12959 ListAdd(exp->list, MkExpCondition(MkExpBrackets(MkListOne(MkExpOp(CopyExpression(tempExp1), '<', MkExpConstant("0")))), MkListOne(MkExpOp((((void *)0)), '-', CopyExpression(tempExp1))), CopyExpression(tempExp1)));
12960 exp->expType = a->expType;
12961 if(a->expType)
12962 a->expType->refCount++;
12963 }
12964 else if(!strcmp(id->string, "Sgn"))
12965 {
12966 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"))))));
12967 exp->expType = ProcessTypeString("int", 0x0);
12968 }
12969 FreeExpression(tempExp1);
12970 if(tempExp2)
12971 FreeExpression(tempExp2);
12972 FreeIdentifier(id);
12973 break;
12974 }
12975 }
12976 }
12977 {
12978 struct Type * dummy = (dummy = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), dummy->count = (unsigned int)1, dummy->refCount = 1, dummy);
12979
12980 if(!exp->call.exp->destType)
12981 {
12982 exp->call.exp->destType = dummy;
12983 dummy->refCount++;
12984 }
12985 ProcessExpressionType(exp->call.exp);
12986 if(exp->call.exp->destType == dummy)
12987 {
12988 FreeType(dummy);
12989 exp->call.exp->destType = (((void *)0));
12990 }
12991 FreeType(dummy);
12992 }
12993 functionType = exp->call.exp->expType;
12994 if(functionType && functionType->kind == 16)
12995 {
12996 methodType = functionType;
12997 functionType = methodType->method->dataType;
12998 if(exp->call.exp->expType->usedClass)
12999 {
13000 char typeString[1024];
13001
13002 typeString[0] = '\0';
13003 PrintType(functionType, typeString, 0x1, 0x1);
13004 if(strstr(typeString, "thisclass"))
13005 {
13006 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13007 struct Declarator * decl;
13008
13009 {
13010 struct Context * context = SetupTemplatesContext(exp->call.exp->expType->usedClass);
13011
13012 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
13013 if(thisClass != (exp->call.exp->expType->usedClass->templateClass ? exp->call.exp->expType->usedClass->templateClass : exp->call.exp->expType->usedClass))
13014 thisClassParams = 0x0;
13015 ReplaceThisClassSpecifiers(specs, exp->call.exp->expType->usedClass);
13016 {
13017 struct __ecereNameSpace__ecere__com__Class * backupThisClass = thisClass;
13018
13019 thisClass = exp->call.exp->expType->usedClass;
13020 ProcessDeclarator(decl);
13021 thisClass = backupThisClass;
13022 }
13023 thisClassParams = 0x1;
13024 functionType = ProcessType(specs, decl);
13025 functionType->refCount = 0;
13026 FinishTemplatesContext(context);
13027 }
13028 FreeList(specs, FreeSpecifier);
13029 FreeDeclarator(decl);
13030 }
13031 }
13032 }
13033 if(functionType && functionType->kind == 13 && functionType->type && functionType->type->kind == 11)
13034 {
13035 struct Type * type = functionType->type;
13036
13037 if(!functionType->refCount)
13038 {
13039 functionType->type = (((void *)0));
13040 FreeType(functionType);
13041 }
13042 functionType = type;
13043 }
13044 if(functionType && functionType->kind != 11)
13045 {
13046 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "called object %s is not a function\n", (((void *)0))), name);
13047 }
13048 else if(functionType)
13049 {
13050 unsigned int emptyParams = 0x0, noParams = 0x0;
13051 struct Expression * e = exp->call.arguments ? (*exp->call.arguments).first : (((void *)0));
13052 struct Type * type = functionType->params.first;
13053 struct Expression * memberExp = (exp->call.exp->type == 8) ? exp->call.exp : (((void *)0));
13054 int extra = 0;
13055 struct Location oldyylloc = yylloc;
13056
13057 if(!type)
13058 emptyParams = 0x1;
13059 if(functionType->extraParam && e)
13060 {
13061 e->destType = MkClassType(functionType->thisClass->string);
13062 e = e->next;
13063 }
13064 if(!functionType->staticMethod)
13065 {
13066 if(memberExp && memberExp->member.exp && memberExp->member.exp->expType && memberExp->member.exp->expType->kind == 19 && memberExp->member.exp->expType->_class)
13067 {
13068 type = MkClassType(memberExp->member.exp->expType->_class->string);
13069 if(e)
13070 {
13071 e->destType = type;
13072 e = e->next;
13073 type = functionType->params.first;
13074 }
13075 else
13076 type->refCount = 0;
13077 }
13078 else if(!memberExp && (functionType->thisClass || (methodType && methodType->methodClass)))
13079 {
13080 type = MkClassType(functionType->thisClass ? functionType->thisClass->string : (methodType ? methodType->methodClass->fullName : (((void *)0))));
13081 if(e)
13082 {
13083 e->destType = type;
13084 e = e->next;
13085 type = functionType->params.first;
13086 }
13087 else
13088 type->refCount = 0;
13089 }
13090 }
13091 if(type && type->kind == 0)
13092 {
13093 noParams = 0x1;
13094 if(!type->refCount)
13095 FreeType(type);
13096 type = (((void *)0));
13097 }
13098 for(; e; e = e->next)
13099 {
13100 if(!type && !emptyParams)
13101 {
13102 yylloc = e->loc;
13103 if(methodType && methodType->methodClass)
13104 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);
13105 else
13106 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);
13107 break;
13108 }
13109 if(methodType && type && type->kind == 20 && type->templateParameter->type == 0)
13110 {
13111 struct Type * templatedType = (((void *)0));
13112 struct __ecereNameSpace__ecere__com__Class * _class = methodType->usedClass;
13113 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
13114 int id = 0;
13115
13116 if(_class && _class->templateArgs)
13117 {
13118 struct __ecereNameSpace__ecere__com__Class * sClass;
13119
13120 for(sClass = _class; sClass; sClass = sClass->base)
13121 {
13122 if(sClass->templateClass)
13123 sClass = sClass->templateClass;
13124 id = 0;
13125 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
13126 {
13127 if(curParam->type == 0 && !strcmp(type->templateParameter->identifier->string, curParam->name))
13128 {
13129 struct __ecereNameSpace__ecere__com__Class * nextClass;
13130
13131 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
13132 {
13133 if(nextClass->templateClass)
13134 nextClass = nextClass->templateClass;
13135 id += nextClass->templateParams.count;
13136 }
13137 break;
13138 }
13139 id++;
13140 }
13141 if(curParam)
13142 break;
13143 }
13144 }
13145 if(curParam && _class->templateArgs[id].dataTypeString)
13146 {
13147 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = _class->templateArgs[id];
13148
13149 {
13150 struct Context * context = SetupTemplatesContext(_class);
13151
13152 templatedType = ProcessTypeString(arg.dataTypeString, 0x0);
13153 FinishTemplatesContext(context);
13154 }
13155 e->destType = templatedType;
13156 if(templatedType)
13157 {
13158 templatedType->passAsTemplate = 0x1;
13159 }
13160 }
13161 else
13162 {
13163 e->destType = type;
13164 if(type)
13165 type->refCount++;
13166 }
13167 }
13168 else
13169 {
13170 e->destType = type;
13171 if(type)
13172 type->refCount++;
13173 }
13174 if(type && type->kind != 14)
13175 {
13176 struct Type * next = type->next;
13177
13178 if(!type->refCount)
13179 FreeType(type);
13180 type = next;
13181 }
13182 }
13183 if(type && type->kind != 14)
13184 {
13185 if(methodType && methodType->methodClass)
13186 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);
13187 else
13188 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);
13189 }
13190 yylloc = oldyylloc;
13191 if(type && !type->refCount)
13192 FreeType(type);
13193 }
13194 else
13195 {
13196 functionType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->refCount = 0, ((struct Type *)__ecereTemp1)->kind = 11, ((struct Type *)__ecereTemp1));
13197 if(exp->call.exp->type == 0)
13198 {
13199 char * string = exp->call.exp->identifier->string;
13200
13201 if(inCompiler)
13202 {
13203 struct Symbol * symbol;
13204 struct Location oldyylloc = yylloc;
13205
13206 yylloc = exp->call.exp->identifier->loc;
13207 if(strstr(string, "__builtin_") == string)
13208 ;
13209 else
13210 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "%s undefined; assuming extern returning int\n", (((void *)0))), string);
13211 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));
13212 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)symbol);
13213 if(strstr(symbol->string, "::"))
13214 globalContext->hasNameSpace = 0x1;
13215 yylloc = oldyylloc;
13216 }
13217 }
13218 else if(exp->call.exp->type == 8)
13219 {
13220 }
13221 else
13222 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "callable object undefined; extern assuming returning int\n", (((void *)0))));
13223 if(!functionType->returnType)
13224 {
13225 functionType->returnType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1)->kind = 3, ((struct Type *)__ecereTemp1));
13226 }
13227 }
13228 if(functionType && functionType->kind == 11)
13229 {
13230 exp->expType = functionType->returnType;
13231 if(functionType->returnType)
13232 functionType->returnType->refCount++;
13233 if(!functionType->refCount)
13234 FreeType(functionType);
13235 }
13236 if(exp->call.arguments)
13237 {
13238 for(e = (*exp->call.arguments).first; e; e = e->next)
13239 {
13240 struct Type * destType = e->destType;
13241
13242 ProcessExpressionType(e);
13243 }
13244 }
13245 break;
13246 }
13247 case 8:
13248 {
13249 struct Type * type;
13250 struct Location oldyylloc = yylloc;
13251 unsigned int thisPtr = (exp->member.exp && exp->member.exp->type == 0 && !strcmp(exp->member.exp->identifier->string, "this"));
13252
13253 exp->thisPtr = thisPtr;
13254 if(exp->member.member && exp->member.member->_class && exp->member.member->_class->name)
13255 {
13256 exp->member.member->classSym = exp->member.member->_class->symbol;
13257 }
13258 ProcessExpressionType(exp->member.exp);
13259 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)
13260 {
13261 exp->isConstant = 0x0;
13262 }
13263 else
13264 exp->isConstant = exp->member.exp->isConstant;
13265 type = exp->member.exp->expType;
13266 yylloc = exp->loc;
13267 if(type && (type->kind == 20))
13268 {
13269 struct __ecereNameSpace__ecere__com__Class * _class = thisClass ? thisClass : currentClass;
13270 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param = (((void *)0));
13271
13272 if(_class)
13273 {
13274 for(param = _class->templateParams.first; param; param = param->next)
13275 {
13276 if(param->type == 1 && !strcmp(param->name, exp->member.member->string))
13277 break;
13278 }
13279 }
13280 if(param && param->defaultArg.member)
13281 {
13282 struct Expression * argExp = GetTemplateArgExpByName(param->name, thisClass, 1);
13283
13284 if(argExp)
13285 {
13286 struct Expression * expMember = exp->member.exp;
13287 struct Declarator * decl;
13288 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13289 char thisClassTypeString[1024];
13290
13291 FreeIdentifier(exp->member.member);
13292 ProcessExpressionType(argExp);
13293 {
13294 char * colon = strstr(param->defaultArg.memberString, "::");
13295
13296 if(colon)
13297 {
13298 char className[1024];
13299 struct __ecereNameSpace__ecere__com__Class * sClass;
13300
13301 memcpy(thisClassTypeString, param->defaultArg.memberString, colon - param->defaultArg.memberString);
13302 thisClassTypeString[colon - param->defaultArg.memberString] = '\0';
13303 }
13304 else
13305 strcpy(thisClassTypeString, _class->fullName);
13306 }
13307 decl = SpecDeclFromString(param->defaultArg.member->dataTypeString, specs, (((void *)0)));
13308 exp->expType = ProcessType(specs, decl);
13309 if(exp->expType->kind == 8 && exp->expType->_class && exp->expType->_class->registered && exp->expType->_class->registered->templateClass)
13310 {
13311 struct __ecereNameSpace__ecere__com__Class * expClass = exp->expType->_class->registered;
13312 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
13313 int c;
13314 int paramCount = 0;
13315 int lastParam = -1;
13316 char templateString[1024];
13317 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
13318
13319 sprintf(templateString, "%s<", expClass->templateClass->fullName);
13320 for(cClass = expClass; cClass; cClass = cClass->base)
13321 {
13322 int p = 0;
13323
13324 for(param = cClass->templateParams.first; param; param = param->next)
13325 {
13326 int id = p;
13327 struct __ecereNameSpace__ecere__com__Class * sClass;
13328 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
13329
13330 for(sClass = cClass->base; sClass; sClass = sClass->base)
13331 id += sClass->templateParams.count;
13332 arg = expClass->templateArgs[id];
13333 for(sClass = _class; sClass; sClass = sClass->base)
13334 {
13335 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * cParam;
13336 int p = 0;
13337 struct __ecereNameSpace__ecere__com__Class * nextClass;
13338
13339 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
13340 p += nextClass->templateParams.count;
13341 for(cParam = sClass->templateParams.first; cParam; cParam = cParam->next, p++)
13342 {
13343 if(cParam->type == 0 && arg.dataTypeString && !strcmp(cParam->name, arg.dataTypeString))
13344 {
13345 if(_class->templateArgs && arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
13346 {
13347 arg.dataTypeString = _class->templateArgs[p].dataTypeString;
13348 arg.dataTypeClass = _class->templateArgs[p].dataTypeClass;
13349 break;
13350 }
13351 }
13352 }
13353 }
13354 {
13355 char argument[256];
13356
13357 argument[0] = '\0';
13358 switch(param->type)
13359 {
13360 case 2:
13361 {
13362 char expString[1024];
13363 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13364 struct Declarator * decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
13365 struct Expression * exp;
13366 char * string = PrintHexUInt64(arg.expression.ui64);
13367
13368 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
13369 ProcessExpressionType(exp);
13370 ComputeExpression(exp);
13371 expString[0] = '\0';
13372 PrintExpression(exp, expString);
13373 strcat(argument, expString);
13374 FreeExpression(exp);
13375 break;
13376 }
13377 case 1:
13378 {
13379 strcat(argument, arg.member->name);
13380 break;
13381 }
13382 case 0:
13383 {
13384 if(arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
13385 {
13386 if(!strcmp(arg.dataTypeString, "thisclass"))
13387 strcat(argument, thisClassTypeString);
13388 else
13389 strcat(argument, arg.dataTypeString);
13390 }
13391 break;
13392 }
13393 }
13394 if(argument[0])
13395 {
13396 if(paramCount)
13397 strcat(templateString, ", ");
13398 if(lastParam != p - 1)
13399 {
13400 strcat(templateString, param->name);
13401 strcat(templateString, " = ");
13402 }
13403 strcat(templateString, argument);
13404 paramCount++;
13405 lastParam = p;
13406 }
13407 p++;
13408 }
13409 }
13410 }
13411 {
13412 int len = strlen(templateString);
13413
13414 if(templateString[len - 1] == '>')
13415 templateString[len++] = ' ';
13416 templateString[len++] = '>';
13417 templateString[len++] = '\0';
13418 }
13419 {
13420 struct Context * context = SetupTemplatesContext(_class);
13421
13422 FreeType(exp->expType);
13423 exp->expType = ProcessTypeString(templateString, 0x0);
13424 FinishTemplatesContext(context);
13425 }
13426 }
13427 exp->type = 5;
13428 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")))))))));
13429 }
13430 }
13431 else if(type->templateParameter && type->templateParameter->type == 0 && (type->templateParameter->dataType || type->templateParameter->dataTypeString))
13432 {
13433 type = ProcessTemplateParameterType(type->templateParameter);
13434 }
13435 }
13436 if(type && (type->kind == 20))
13437 ;
13438 else if(type && (type->kind == 8 || type->kind == 19 || type->kind == 3 || type->kind == 15))
13439 {
13440 struct Identifier * id = exp->member.member;
13441 int typeKind = type->kind;
13442 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));
13443
13444 if(typeKind == 19 && exp->member.exp->type == 26)
13445 {
13446 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "ecere::com::Class");
13447 typeKind = 8;
13448 }
13449 if(id && (typeKind == 3 || typeKind == 15))
13450 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "int");
13451 if(_class && id)
13452 {
13453 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
13454 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
13455 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
13456 struct __ecereNameSpace__ecere__com__Property * revConvert = (((void *)0));
13457 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
13458
13459 if(id && id->_class && id->_class->name && !strcmp(id->_class->name, "property"))
13460 exp->member.memberType = 1;
13461 if(id && id->_class && type->_class && !__ecereNameSpace__ecere__com__eClass_IsDerived(type->_class->registered, _class))
13462 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "invalid class specifier %s for object of class %s\n", (((void *)0))), _class->fullName, type->_class->string);
13463 if(typeKind != 19)
13464 {
13465 if((exp->member.memberType == 0 && thisPtr) || exp->member.memberType == 3)
13466 {
13467 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
13468 if(member && member->_class != (_class->templateClass ? _class->templateClass : _class) && exp->member.memberType != 3)
13469 {
13470 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
13471 if(prop)
13472 member = (((void *)0));
13473 }
13474 if(!member && !prop)
13475 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
13476 if((member && member->_class == (_class->templateClass ? _class->templateClass : _class)) || (prop && prop->_class == (_class->templateClass ? _class->templateClass : _class)))
13477 exp->member.thisPtr = 0x1;
13478 }
13479 else
13480 {
13481 if(!id->classSym)
13482 {
13483 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, (((void *)0)));
13484 if(!id->_class || !id->_class->name || strcmp(id->_class->name, "property"))
13485 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, (((void *)0)), (((void *)0)), (((void *)0)));
13486 }
13487 if(!prop && !member)
13488 {
13489 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, (((void *)0)));
13490 if(!method)
13491 {
13492 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
13493 if(!id->_class || !id->_class->name || strcmp(id->_class->name, "property"))
13494 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
13495 }
13496 }
13497 if(member && prop)
13498 {
13499 if(member->_class != prop->_class && !id->_class && __ecereNameSpace__ecere__com__eClass_IsDerived(member->_class, prop->_class))
13500 prop = (((void *)0));
13501 else
13502 member = (((void *)0));
13503 }
13504 }
13505 }
13506 if(!prop && !member)
13507 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule);
13508 if(!prop && !member && !method)
13509 {
13510 if(typeKind == 19)
13511 {
13512 classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(type->_class->registered, exp->member.member->string);
13513 if(classProp)
13514 {
13515 exp->member.memberType = 5;
13516 exp->expType = ProcessTypeString(classProp->dataTypeString, 0x0);
13517 }
13518 else
13519 {
13520 char structName[1024];
13521 struct Identifier * id = exp->member.member;
13522 struct Expression * classExp = exp->member.exp;
13523
13524 type->refCount++;
13525 FreeType(classExp->expType);
13526 classExp->expType = ProcessTypeString("ecere::com::Class", 0x0);
13527 strcpy(structName, "__ecereClassData_");
13528 FullClassNameCat(structName, type->_class->string, 0x0);
13529 exp->type = 9;
13530 exp->member.member = id;
13531 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"))))))));
13532 FreeType(type);
13533 ProcessExpressionType(exp);
13534 return ;
13535 }
13536 }
13537 else
13538 {
13539 struct Symbol * classSym = FindClass(id->string);
13540
13541 if(classSym)
13542 {
13543 struct __ecereNameSpace__ecere__com__Class * convertClass = classSym->registered;
13544
13545 if(convertClass)
13546 revConvert = __ecereNameSpace__ecere__com__eClass_FindProperty(convertClass, _class->fullName, privateModule);
13547 }
13548 }
13549 }
13550 if(prop)
13551 {
13552 exp->member.memberType = 1;
13553 if(!prop->dataType)
13554 ProcessPropertyType(prop);
13555 exp->expType = prop->dataType;
13556 if(prop->dataType)
13557 prop->dataType->refCount++;
13558 }
13559 else if(member)
13560 {
13561 if(exp->member.exp->expType->classObjectType == 2 && !strcmp(exp->member.member->string, "_class"))
13562 {
13563 FreeExpContents(exp);
13564 exp->type = 0;
13565 exp->identifier = MkIdentifier("class");
13566 ProcessExpressionType(exp);
13567 return ;
13568 }
13569 exp->member.memberType = 3;
13570 DeclareStruct(_class->fullName, 0x0);
13571 if(!member->dataType)
13572 {
13573 struct Context * context = SetupTemplatesContext(_class);
13574
13575 member->dataType = ProcessTypeString(member->dataTypeString, 0x0);
13576 FinishTemplatesContext(context);
13577 }
13578 exp->expType = member->dataType;
13579 if(member->dataType)
13580 member->dataType->refCount++;
13581 }
13582 else if(revConvert)
13583 {
13584 exp->member.memberType = 4;
13585 exp->expType = MkClassType(revConvert->_class->fullName);
13586 }
13587 else if(method)
13588 {
13589 if(inCompiler)
13590 {
13591 exp->member.memberType = 2;
13592 }
13593 if(!method->dataType)
13594 ProcessMethodType(method);
13595 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));
13596 exp->expType->methodClass = (id && id->_class) ? _class : (((void *)0));
13597 exp->expType->usedClass = _class;
13598 }
13599 else if(!classProp)
13600 {
13601 if(exp->member.exp->expType->classObjectType == 2 && !strcmp(exp->member.member->string, "_class"))
13602 {
13603 FreeExpContents(exp);
13604 exp->type = 0;
13605 exp->identifier = MkIdentifier("class");
13606 ProcessExpressionType(exp);
13607 return ;
13608 }
13609 yylloc = exp->member.member->loc;
13610 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't find member %s in class %s\n", (((void *)0))), id->string, _class->fullName);
13611 if(inCompiler)
13612 __ecereNameSpace__ecere__com__eClass_AddDataMember(_class, id->string, "int", 0, 0, 1);
13613 }
13614 if(_class && exp->expType)
13615 {
13616 struct __ecereNameSpace__ecere__com__Class * tClass;
13617
13618 tClass = _class;
13619 while(tClass && !tClass->templateClass)
13620 tClass = tClass->base;
13621 if(tClass && exp->expType->kind == 20 && exp->expType->templateParameter->type == 0)
13622 {
13623 int id = 0;
13624 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam;
13625 struct __ecereNameSpace__ecere__com__Class * sClass;
13626
13627 for(sClass = tClass; sClass; sClass = sClass->base)
13628 {
13629 id = 0;
13630 if(sClass->templateClass)
13631 sClass = sClass->templateClass;
13632 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
13633 {
13634 if(curParam->type == 0 && !strcmp(exp->expType->templateParameter->identifier->string, curParam->name))
13635 {
13636 for(sClass = sClass->base; sClass; sClass = sClass->base)
13637 id += sClass->templateParams.count;
13638 break;
13639 }
13640 id++;
13641 }
13642 if(curParam)
13643 break;
13644 }
13645 if(curParam && tClass->templateArgs[id].dataTypeString)
13646 {
13647 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = tClass->templateArgs[id];
13648 struct Context * context = SetupTemplatesContext(tClass);
13649
13650 FreeType(exp->expType);
13651 exp->expType = ProcessTypeString(arg.dataTypeString, 0x0);
13652 if(exp->expType)
13653 {
13654 if(exp->expType->kind == 21)
13655 {
13656 FreeType(exp->expType);
13657 exp->expType = ReplaceThisClassType(_class);
13658 }
13659 if(tClass->templateClass)
13660 exp->expType->passAsTemplate = 0x1;
13661 if(!exp->destType)
13662 {
13663 exp->destType = ProcessTypeString(arg.dataTypeString, 0x0);
13664 if(exp->destType->kind == 21)
13665 {
13666 FreeType(exp->destType);
13667 exp->destType = ReplaceThisClassType(_class);
13668 }
13669 }
13670 }
13671 FinishTemplatesContext(context);
13672 }
13673 }
13674 else if(tClass && exp->expType->kind == 13 && exp->expType->type && exp->expType->type->kind == 20 && exp->expType->type->templateParameter->type == 0)
13675 {
13676 int id = 0;
13677 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam;
13678 struct __ecereNameSpace__ecere__com__Class * sClass;
13679
13680 for(sClass = tClass; sClass; sClass = sClass->base)
13681 {
13682 id = 0;
13683 if(sClass->templateClass)
13684 sClass = sClass->templateClass;
13685 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
13686 {
13687 if(curParam->type == 0 && !strcmp(exp->expType->type->templateParameter->identifier->string, curParam->name))
13688 {
13689 for(sClass = sClass->base; sClass; sClass = sClass->base)
13690 id += sClass->templateParams.count;
13691 break;
13692 }
13693 id++;
13694 }
13695 if(curParam)
13696 break;
13697 }
13698 if(curParam)
13699 {
13700 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = tClass->templateArgs[id];
13701 struct Context * context = SetupTemplatesContext(tClass);
13702 struct Type * basicType;
13703
13704 basicType = ProcessTypeString(arg.dataTypeString, 0x0);
13705 if(basicType)
13706 {
13707 if(basicType->kind == 21)
13708 {
13709 FreeType(basicType);
13710 basicType = ReplaceThisClassType(_class);
13711 }
13712 FreeType(exp->expType);
13713 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));
13714 if(!exp->destType)
13715 {
13716 exp->destType = exp->expType;
13717 exp->destType->refCount++;
13718 }
13719 {
13720 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
13721 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13722 struct Declarator * decl;
13723
13724 decl = SpecDeclFromString(arg.dataTypeString, specs, (((void *)0)));
13725 *newExp = *exp;
13726 if(exp->destType)
13727 exp->destType->refCount++;
13728 if(exp->expType)
13729 exp->expType->refCount++;
13730 exp->type = 11;
13731 exp->cast.typeName = MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl));
13732 exp->cast.exp = newExp;
13733 }
13734 }
13735 FinishTemplatesContext(context);
13736 }
13737 }
13738 else if(tClass && exp->expType->kind == 8 && exp->expType->_class && strchr(exp->expType->_class->string, '<'))
13739 {
13740 struct __ecereNameSpace__ecere__com__Class * expClass = exp->expType->_class->registered;
13741
13742 if(expClass)
13743 {
13744 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
13745 int c;
13746 int p = 0;
13747 int paramCount = 0;
13748 int lastParam = -1;
13749 char templateString[1024];
13750 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
13751
13752 sprintf(templateString, "%s<", expClass->templateClass->fullName);
13753 while(cClass != expClass)
13754 {
13755 struct __ecereNameSpace__ecere__com__Class * sClass;
13756
13757 for(sClass = expClass; sClass && sClass->base != cClass; sClass = sClass->base)
13758 ;
13759 cClass = sClass;
13760 for(param = cClass->templateParams.first; param; param = param->next)
13761 {
13762 struct __ecereNameSpace__ecere__com__Class * cClassCur = (((void *)0));
13763 int c;
13764 int cp = 0;
13765 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * paramCur = (((void *)0));
13766 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
13767
13768 while(cClassCur != tClass && !paramCur)
13769 {
13770 struct __ecereNameSpace__ecere__com__Class * sClassCur;
13771
13772 for(sClassCur = tClass; sClassCur && sClassCur->base != cClassCur; sClassCur = sClassCur->base)
13773 ;
13774 cClassCur = sClassCur;
13775 for(paramCur = cClassCur->templateParams.first; paramCur; paramCur = paramCur->next)
13776 {
13777 if(!strcmp(paramCur->name, param->name))
13778 {
13779 break;
13780 }
13781 cp++;
13782 }
13783 }
13784 if(paramCur && paramCur->type == 0)
13785 arg = tClass->templateArgs[cp];
13786 else
13787 arg = expClass->templateArgs[p];
13788 {
13789 char argument[256];
13790
13791 argument[0] = '\0';
13792 switch(param->type)
13793 {
13794 case 2:
13795 {
13796 char expString[1024];
13797 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13798 struct Declarator * decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
13799 struct Expression * exp;
13800 char * string = PrintHexUInt64(arg.expression.ui64);
13801
13802 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
13803 ProcessExpressionType(exp);
13804 ComputeExpression(exp);
13805 expString[0] = '\0';
13806 PrintExpression(exp, expString);
13807 strcat(argument, expString);
13808 FreeExpression(exp);
13809 break;
13810 }
13811 case 1:
13812 {
13813 strcat(argument, arg.member->name);
13814 break;
13815 }
13816 case 0:
13817 {
13818 if(arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
13819 strcat(argument, arg.dataTypeString);
13820 break;
13821 }
13822 }
13823 if(argument[0])
13824 {
13825 if(paramCount)
13826 strcat(templateString, ", ");
13827 if(lastParam != p - 1)
13828 {
13829 strcat(templateString, param->name);
13830 strcat(templateString, " = ");
13831 }
13832 strcat(templateString, argument);
13833 paramCount++;
13834 lastParam = p;
13835 }
13836 }
13837 p++;
13838 }
13839 }
13840 {
13841 int len = strlen(templateString);
13842
13843 if(templateString[len - 1] == '>')
13844 templateString[len++] = ' ';
13845 templateString[len++] = '>';
13846 templateString[len++] = '\0';
13847 }
13848 FreeType(exp->expType);
13849 {
13850 struct Context * context = SetupTemplatesContext(tClass);
13851
13852 exp->expType = ProcessTypeString(templateString, 0x0);
13853 FinishTemplatesContext(context);
13854 }
13855 }
13856 }
13857 }
13858 }
13859 else
13860 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)");
13861 }
13862 else if(type && (type->kind == 9 || type->kind == 10))
13863 {
13864 struct Type * memberType = exp->member.member ? FindMember(type, exp->member.member->string) : (((void *)0));
13865
13866 if(memberType)
13867 {
13868 exp->expType = memberType;
13869 if(memberType)
13870 memberType->refCount++;
13871 }
13872 }
13873 else
13874 {
13875 char expString[10240];
13876
13877 expString[0] = '\0';
13878 if(inCompiler)
13879 {
13880 PrintExpression(exp, expString);
13881 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
13882 }
13883 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "member operator on non-structure type expression %s\n", (((void *)0))), expString);
13884 }
13885 if(exp->expType && exp->expType->kind == 21 && (!exp->destType || exp->destType->kind != 21))
13886 {
13887 if(type && (type->kind == 8 || type->kind == 19 || type->kind == 3 || type->kind == 15))
13888 {
13889 struct Identifier * id = exp->member.member;
13890 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));
13891
13892 if(_class)
13893 {
13894 FreeType(exp->expType);
13895 exp->expType = ReplaceThisClassType(_class);
13896 }
13897 }
13898 }
13899 yylloc = oldyylloc;
13900 break;
13901 }
13902 case 9:
13903 {
13904 struct Type * destType = exp->destType;
13905
13906 if(exp->member.member && exp->member.member->_class && exp->member.member->_class->name)
13907 {
13908 exp->member.member->classSym = exp->member.member->_class->symbol;
13909 }
13910 exp->member.exp = MkExpBrackets(MkListOne(MkExpOp((((void *)0)), '*', exp->member.exp)));
13911 exp->type = 8;
13912 if(destType)
13913 destType->count++;
13914 ProcessExpressionType(exp);
13915 if(destType)
13916 destType->count--;
13917 break;
13918 }
13919 case 15:
13920 {
13921 struct Symbol * classSym = exp->_class->symbol;
13922
13923 if(classSym && classSym->registered)
13924 {
13925 if(classSym->registered->type == 5)
13926 {
13927 char name[1024];
13928
13929 name[0] = '\0';
13930 DeclareStruct(classSym->string, 0x0);
13931 FreeSpecifier(exp->_class);
13932 exp->type = 10;
13933 FullClassNameCat(name, classSym->string, 0x0);
13934 exp->typeName = MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(name), (((void *)0)))), (((void *)0)));
13935 }
13936 else
13937 {
13938 if(classSym->registered->fixed)
13939 {
13940 FreeSpecifier(exp->_class);
13941 exp->constant = PrintUInt(classSym->registered->templateClass ? classSym->registered->templateClass->structSize : classSym->registered->structSize);
13942 exp->type = 2;
13943 }
13944 else
13945 {
13946 char className[1024];
13947
13948 strcpy(className, "__ecereClass_");
13949 FullClassNameCat(className, classSym->string, 0x1);
13950 MangleClassName(className);
13951 DeclareClass(classSym, className);
13952 FreeExpContents(exp);
13953 exp->type = 9;
13954 exp->member.exp = MkExpIdentifier(MkIdentifier(className));
13955 exp->member.member = MkIdentifier("structSize");
13956 }
13957 }
13958 }
13959 exp->expType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1)->kind = 3, ((struct Type *)__ecereTemp1));
13960 break;
13961 }
13962 case 10:
13963 {
13964 struct Type * type = ProcessType(exp->typeName->qualifiers, exp->typeName->declarator);
13965
13966 exp->expType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1)->kind = 3, ((struct Type *)__ecereTemp1));
13967 exp->isConstant = 0x1;
13968 DeclareType(type, 0x0, 0x0);
13969 FreeType(type);
13970 break;
13971 }
13972 case 11:
13973 {
13974 struct Type * type = ProcessType(exp->cast.typeName->qualifiers, exp->cast.typeName->declarator);
13975
13976 type->count = (unsigned int)1;
13977 FreeType(exp->cast.exp->destType);
13978 exp->cast.exp->destType = type;
13979 type->refCount++;
13980 ProcessExpressionType(exp->cast.exp);
13981 type->count = (unsigned int)0;
13982 exp->expType = type;
13983 if(!exp->cast.exp->needCast && !NeedCast(exp->cast.exp->expType, type))
13984 {
13985 void * prev = exp->prev, * next = exp->next;
13986 struct Type * expType = exp->cast.exp->destType;
13987 struct Expression * castExp = exp->cast.exp;
13988 struct Type * destType = exp->destType;
13989
13990 if(expType)
13991 expType->refCount++;
13992 FreeType(exp->expType);
13993 FreeTypeName(exp->cast.typeName);
13994 *exp = *castExp;
13995 FreeType(exp->expType);
13996 FreeType(exp->destType);
13997 exp->expType = expType;
13998 exp->destType = destType;
13999 ((castExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(castExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(castExp)) : 0), castExp = 0);
14000 exp->prev = prev;
14001 exp->next = next;
14002 }
14003 else
14004 {
14005 exp->isConstant = exp->cast.exp->isConstant;
14006 }
14007 break;
14008 }
14009 case 35:
14010 {
14011 struct Type * type = ProcessType(exp->initializer.typeName->qualifiers, exp->initializer.typeName->declarator);
14012
14013 type->refCount++;
14014 exp->expType = type;
14015 break;
14016 }
14017 case 36:
14018 {
14019 struct Type * type = ProcessType(exp->vaArg.typeName->qualifiers, exp->vaArg.typeName->declarator);
14020
14021 ProcessExpressionType(exp->vaArg.exp);
14022 type->refCount++;
14023 exp->expType = type;
14024 break;
14025 }
14026 case 12:
14027 {
14028 struct Expression * e;
14029
14030 exp->isConstant = 0x1;
14031 FreeType(exp->cond.cond->destType);
14032 exp->cond.cond->destType = MkClassType("bool");
14033 exp->cond.cond->destType->truth = 0x1;
14034 ProcessExpressionType(exp->cond.cond);
14035 if(!exp->cond.cond->isConstant)
14036 exp->isConstant = 0x0;
14037 for(e = (*exp->cond.exp).first; e; e = e->next)
14038 {
14039 if(!e->next)
14040 {
14041 FreeType(e->destType);
14042 e->destType = exp->destType;
14043 if(e->destType)
14044 e->destType->refCount++;
14045 }
14046 ProcessExpressionType(e);
14047 if(!e->next)
14048 {
14049 exp->expType = e->expType;
14050 if(e->expType)
14051 e->expType->refCount++;
14052 }
14053 if(!e->isConstant)
14054 exp->isConstant = 0x0;
14055 }
14056 FreeType(exp->cond.elseExp->destType);
14057 exp->cond.elseExp->destType = exp->destType ? exp->destType : exp->expType;
14058 if(exp->cond.elseExp->destType)
14059 exp->cond.elseExp->destType->refCount++;
14060 ProcessExpressionType(exp->cond.elseExp);
14061 if(!exp->cond.elseExp->isConstant)
14062 exp->isConstant = 0x0;
14063 break;
14064 }
14065 case 25:
14066 {
14067 if(exp->compound && exp->compound->compound.statements && (*exp->compound->compound.statements).last)
14068 {
14069 struct Statement * last = (*exp->compound->compound.statements).last;
14070
14071 if(last->type == 3 && last->expressions && (*last->expressions).last)
14072 {
14073 ((struct Expression *)(*last->expressions).last)->destType = exp->destType;
14074 if(exp->destType)
14075 exp->destType->refCount++;
14076 }
14077 ProcessStatement(exp->compound);
14078 exp->expType = ((struct Expression *)(*last->expressions).last)->expType;
14079 if(((struct Expression *)(*last->expressions).last)->expType)
14080 exp->expType->refCount++;
14081 }
14082 break;
14083 }
14084 case 26:
14085 {
14086 struct Specifier * spec = (*exp->_classExp.specifiers).first;
14087
14088 if(spec && spec->type == 1)
14089 {
14090 exp->expType = MkClassType(spec->name);
14091 exp->expType->kind = 19;
14092 exp->byReference = 0x1;
14093 }
14094 else
14095 {
14096 exp->expType = MkClassType("ecere::com::Class");
14097 exp->byReference = 0x1;
14098 }
14099 break;
14100 }
14101 case 27:
14102 {
14103 struct __ecereNameSpace__ecere__com__Class * _class = thisClass ? thisClass : currentClass;
14104
14105 if(_class)
14106 {
14107 struct Identifier * id = exp->classData.id;
14108 char structName[1024];
14109 struct Expression * classExp;
14110
14111 strcpy(structName, "__ecereClassData_");
14112 FullClassNameCat(structName, _class->fullName, 0x0);
14113 exp->type = 9;
14114 exp->member.member = id;
14115 if(curCompound && FindSymbol("this", curContext, curCompound->compound.context, 0x0, 0x0))
14116 classExp = MkExpMember(MkExpIdentifier(MkIdentifier("this")), MkIdentifier("_class"));
14117 else
14118 classExp = MkExpIdentifier(MkIdentifier("class"));
14119 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"))))))));
14120 ProcessExpressionType(exp);
14121 return ;
14122 }
14123 break;
14124 }
14125 case 37:
14126 {
14127 struct Type * type = (((void *)0));
14128 char * typeString = (((void *)0));
14129 char typeStringBuf[1024];
14130
14131 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))
14132 {
14133 struct __ecereNameSpace__ecere__com__Class * templateClass = exp->destType->_class->registered;
14134
14135 typeString = templateClass->templateArgs[2].dataTypeString;
14136 }
14137 else if(exp->list)
14138 {
14139 struct Expression * e;
14140
14141 for(e = (*exp->list).first; e; e = e->next)
14142 {
14143 ProcessExpressionType(e);
14144 if(e->expType)
14145 {
14146 if(!type)
14147 {
14148 type = e->expType;
14149 type->refCount++;
14150 }
14151 else
14152 {
14153 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
14154 {
14155 FreeType(type);
14156 type = e->expType;
14157 e->expType = (((void *)0));
14158 e = (*exp->list).first;
14159 ProcessExpressionType(e);
14160 if(e->expType)
14161 {
14162 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
14163 {
14164 FreeType(e->expType);
14165 e->expType = (((void *)0));
14166 FreeType(type);
14167 type = (((void *)0));
14168 break;
14169 }
14170 }
14171 }
14172 }
14173 if(e->expType)
14174 {
14175 FreeType(e->expType);
14176 e->expType = (((void *)0));
14177 }
14178 }
14179 }
14180 if(type)
14181 {
14182 typeStringBuf[0] = '\0';
14183 PrintType(type, typeStringBuf, 0x0, 0x1);
14184 typeString = typeStringBuf;
14185 FreeType(type);
14186 type = (((void *)0));
14187 }
14188 }
14189 if(typeString)
14190 {
14191 char templateString[1024];
14192 struct __ecereNameSpace__ecere__sys__OldList * declarations = MkList();
14193 struct __ecereNameSpace__ecere__sys__OldList * instMembers = MkList();
14194 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
14195 struct __ecereNameSpace__ecere__sys__OldList * initializers = MkList();
14196 char count[128];
14197 struct Expression * e;
14198 struct Expression * expExt;
14199 struct Declarator * decl = SpecDeclFromString(typeString, specs, (((void *)0)));
14200 struct Context * context = PushContext();
14201
14202 sprintf(templateString, "Container<%s>", typeString);
14203 ListAdd(instMembers, MkMemberInit(MkListOne(MkIdentifier("data")), MkInitializerAssignment(MkExpIdentifier(MkIdentifier("__internalList")))));
14204 sprintf(count, "%d", (*exp->list).count);
14205 ListAdd(instMembers, MkMemberInit(MkListOne(MkIdentifier("count")), MkInitializerAssignment(MkExpConstant(count))));
14206 ListAdd(instMembers, MkMemberInit(MkListOne(MkIdentifier("type")), MkInitializerAssignment(MkExpClass(CopyList(specs, CopySpecifier), CopyDeclarator(decl)))));
14207 ListAdd(instMembers, MkMemberInit(MkListOne(MkIdentifier("_vTbl")), MkInitializerAssignment(MkExpMember(MkExpClass(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0))), MkIdentifier("_vTbl")))));
14208 ListAdd(instMembers, MkMemberInit(MkListOne(MkIdentifier("_class")), MkInitializerAssignment(MkExpClass(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0))))));
14209 if(exp->list)
14210 {
14211 type = ProcessTypeString(typeString, 0x0);
14212 while(e = (*exp->list).first)
14213 {
14214 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*exp->list), e);
14215 e->destType = type;
14216 type->refCount++;
14217 ProcessExpressionType(e);
14218 ListAdd(initializers, MkInitializerAssignment(e));
14219 }
14220 FreeType(type);
14221 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->list), exp->list = 0);
14222 }
14223 ListAdd(declarations, MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorArray(PlugDeclarator(decl, MkDeclaratorIdentifier(MkIdentifier("__internalList"))), (((void *)0))), MkInitializerList(initializers)))));
14224 ListAdd(declarations, MkDeclarationInst(MkInstantiationNamed(MkListOne(MkSpecifierName("BuiltInContainer")), MkExpIdentifier(MkIdentifier("__internalContainer")), MkListOne(MkMembersInitList(instMembers)))));
14225 exp->expType = ProcessTypeString(templateString, 0x0);
14226 exp->type = 5;
14227 exp->list = MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName(templateString)), (((void *)0))), (expExt = MkExpExtensionCompound(MkCompoundStmt(declarations, MkListOne(MkExpressionStmt(MkListOne(MkExpOp((((void *)0)), '&', MkExpIdentifier(MkIdentifier("__internalContainer")))))))))));
14228 expExt->compound->compound.context = context;
14229 PopContext(context);
14230 ProcessExpressionType(expExt);
14231 }
14232 else
14233 {
14234 exp->expType = ProcessTypeString("Container", 0x0);
14235 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Couldn't determine type of array elements\n", (((void *)0))));
14236 }
14237 break;
14238 }
14239 }
14240 if(exp->expType && exp->expType->kind == 21 && thisClass && (!exp->destType || exp->destType->kind != 21))
14241 {
14242 FreeType(exp->expType);
14243 exp->expType = ReplaceThisClassType(thisClass);
14244 }
14245 if(exp->expType && (exp->expType->kind == 9 || exp->expType->kind == 10 || exp->expType->kind == 15) && !exp->expType->members.first && exp->expType->enumName)
14246 {
14247 struct Symbol * symbol = FindSymbol(exp->expType->enumName, curContext, globalContext, 0x1, 0x0);
14248
14249 if(symbol)
14250 {
14251 if(exp->expType->kind != 15)
14252 {
14253 struct Type * member;
14254 char * enumName = __ecereNameSpace__ecere__sys__CopyString(exp->expType->enumName);
14255
14256 FreeType(exp->expType);
14257 exp->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14258 exp->expType->kind = symbol->type->kind;
14259 exp->expType->refCount++;
14260 exp->expType->enumName = enumName;
14261 exp->expType->members = symbol->type->members;
14262 for(member = symbol->type->members.first; member; member = member->next)
14263 member->refCount++;
14264 }
14265 else
14266 {
14267 struct __ecereNameSpace__ecere__sys__NamedLink * member;
14268
14269 for(member = symbol->type->members.first; member; member = member->next)
14270 {
14271 struct __ecereNameSpace__ecere__sys__NamedLink * value = (value = __ecereNameSpace__ecere__com__eSystem_New0(16), value->name = __ecereNameSpace__ecere__sys__CopyString(member->name), value);
14272
14273 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&exp->expType->members, value);
14274 }
14275 }
14276 }
14277 }
14278 yylloc = exp->loc;
14279 if(exp->destType && (exp->destType->kind == 0 || exp->destType->kind == 18))
14280 ;
14281 else if(exp->destType && !exp->destType->keepCast)
14282 {
14283 if(!CheckExpressionType(exp, exp->destType, 0x0))
14284 {
14285 if(!exp->destType->count || unresolved)
14286 {
14287 if(!exp->expType)
14288 {
14289 yylloc = exp->loc;
14290 if(exp->destType->kind != 14)
14291 {
14292 char type2[1024];
14293
14294 type2[0] = '\0';
14295 if(inCompiler)
14296 {
14297 char expString[10240];
14298
14299 expString[0] = '\0';
14300 PrintType(exp->destType, type2, 0x0, 0x1);
14301 if(inCompiler)
14302 {
14303 PrintExpression(exp, expString);
14304 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14305 }
14306 if(unresolved)
14307 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "unresolved identifier %s; expected %s\n", (((void *)0))), expString, type2);
14308 else if(exp->type != 16)
14309 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't determine type of %s; expected %s\n", (((void *)0))), expString, type2);
14310 }
14311 }
14312 else
14313 {
14314 char expString[10240];
14315
14316 expString[0] = '\0';
14317 if(inCompiler)
14318 {
14319 PrintExpression(exp, expString);
14320 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14321 }
14322 if(unresolved)
14323 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "unresolved identifier %s\n", (((void *)0))), expString);
14324 else if(exp->type != 16)
14325 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't determine type of %s\n", (((void *)0))), expString);
14326 }
14327 }
14328 else
14329 {
14330 char type1[1024];
14331 char type2[1024];
14332
14333 type1[0] = '\0';
14334 type2[0] = '\0';
14335 if(inCompiler)
14336 {
14337 PrintType(exp->expType, type1, 0x0, 0x1);
14338 PrintType(exp->destType, type2, 0x0, 0x1);
14339 }
14340 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)))
14341 ;
14342 else
14343 {
14344 char expString[10240];
14345
14346 expString[0] = '\0';
14347 if(inCompiler)
14348 {
14349 PrintExpression(exp, expString);
14350 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14351 }
14352 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible expression %s (%s); expected %s\n", (((void *)0))), expString, type1, type2);
14353 FreeType(exp->expType);
14354 exp->destType->refCount++;
14355 exp->expType = exp->destType;
14356 }
14357 }
14358 }
14359 }
14360 else if(exp->destType && exp->destType->kind == 14 && exp->expType && exp->expType->passAsTemplate)
14361 {
14362 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
14363 char typeString[1024];
14364 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
14365 struct Declarator * decl;
14366
14367 typeString[0] = '\0';
14368 *newExp = *exp;
14369 if(exp->expType)
14370 exp->expType->refCount++;
14371 if(exp->expType)
14372 exp->expType->refCount++;
14373 exp->type = 11;
14374 newExp->destType = exp->expType;
14375 PrintType(exp->expType, typeString, 0x0, 0x0);
14376 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
14377 exp->cast.typeName = MkTypeName(specs, decl);
14378 exp->cast.exp = newExp;
14379 }
14380 }
14381 else if(unresolved)
14382 {
14383 if(exp->identifier->_class && exp->identifier->_class->name)
14384 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "unresolved identifier %s::%s\n", (((void *)0))), exp->identifier->_class->name, exp->identifier->string);
14385 else if(exp->identifier->string && exp->identifier->string[0])
14386 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "unresolved identifier %s\n", (((void *)0))), exp->identifier->string);
14387 }
14388 else if(!exp->expType && exp->type != 16)
14389 {
14390 char expString[10240];
14391
14392 expString[0] = '\0';
14393 if(inCompiler)
14394 {
14395 PrintExpression(exp, expString);
14396 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14397 }
14398 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't determine type of %s\n", (((void *)0))), expString);
14399 }
14400 ApplyAnyObjectLogic(exp);
14401 if(!notByReference && exp->expType && exp->expType->kind == 8 && exp->expType->_class && exp->expType->_class->registered && exp->expType->_class->registered->type == 5)
14402 {
14403 exp->byReference = 0x1;
14404 }
14405 yylloc = oldyylloc;
14406 }
14407
14408 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)
14409 {
14410 if(*curMember)
14411 {
14412 *curMember = (*curMember)->next;
14413 if(subMemberStackPos && *subMemberStackPos > 0 && subMemberStack[*subMemberStackPos - 1]->type == 1)
14414 {
14415 *curMember = subMemberStack[--(*subMemberStackPos)];
14416 *curMember = (*curMember)->next;
14417 }
14418 while((*curMember) && (*curMember)->isProperty)
14419 *curMember = (*curMember)->next;
14420 if(subMemberStackPos)
14421 {
14422 while((*curMember) && !(*curMember)->isProperty && !(*curMember)->name && ((*curMember)->type == 2 || (*curMember)->type == 1))
14423 {
14424 subMemberStack[(*subMemberStackPos)++] = *curMember;
14425 *curMember = (*curMember)->members.first;
14426 while(*curMember && (*curMember)->isProperty)
14427 *curMember = (*curMember)->next;
14428 }
14429 }
14430 }
14431 while(!*curMember)
14432 {
14433 if(!*curMember)
14434 {
14435 if(subMemberStackPos && *subMemberStackPos)
14436 {
14437 *curMember = subMemberStack[--(*subMemberStackPos)];
14438 *curMember = (*curMember)->next;
14439 }
14440 else
14441 {
14442 struct __ecereNameSpace__ecere__com__Class * lastCurClass = *curClass;
14443
14444 if(*curClass == _class)
14445 break;
14446 for(*curClass = _class; (*curClass)->base != lastCurClass && (*curClass)->base->type != 1000; *curClass = (*curClass)->base)
14447 ;
14448 *curMember = (*curClass)->membersAndProperties.first;
14449 }
14450 while((*curMember) && (*curMember)->isProperty)
14451 *curMember = (*curMember)->next;
14452 if(subMemberStackPos)
14453 {
14454 while((*curMember) && !(*curMember)->isProperty && !(*curMember)->name && ((*curMember)->type == 2 || (*curMember)->type == 1))
14455 {
14456 subMemberStack[(*subMemberStackPos)++] = *curMember;
14457 *curMember = (*curMember)->members.first;
14458 while(*curMember && (*curMember)->isProperty)
14459 *curMember = (*curMember)->next;
14460 }
14461 }
14462 }
14463 }
14464 }
14465
14466 static void ProcessInitializer(struct Initializer * init, struct Type * type)
14467 {
14468 switch(init->type)
14469 {
14470 case 0:
14471 if(!init->exp || init->exp->type != 1 || !init->exp->instance || init->exp->instance->_class || !type || type->kind == 8)
14472 {
14473 if(init->exp && !init->exp->destType)
14474 {
14475 FreeType(init->exp->destType);
14476 init->exp->destType = type;
14477 if(type)
14478 type->refCount++;
14479 }
14480 if(init->exp)
14481 {
14482 ProcessExpressionType(init->exp);
14483 init->isConstant = init->exp->isConstant;
14484 }
14485 break;
14486 }
14487 else
14488 {
14489 struct Expression * exp = init->exp;
14490 struct Instantiation * inst = exp->instance;
14491 struct MembersInit * members;
14492
14493 init->type = 1;
14494 init->list = MkList();
14495 if(inst->members)
14496 {
14497 for(members = (*inst->members).first; members; members = members->next)
14498 {
14499 if(members->type == 0)
14500 {
14501 struct MemberInit * member;
14502
14503 for(member = (*members->dataMembers).first; member; member = member->next)
14504 {
14505 ListAdd(init->list, member->initializer);
14506 member->initializer = (((void *)0));
14507 }
14508 }
14509 }
14510 }
14511 FreeExpression(exp);
14512 }
14513 case 1:
14514 {
14515 struct Initializer * i;
14516 struct Type * initializerType = (((void *)0));
14517 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
14518 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
14519 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
14520 int subMemberStackPos = 0;
14521
14522 if(type && type->kind == 12)
14523 initializerType = Dereference(type);
14524 else if(type && (type->kind == 9 || type->kind == 10))
14525 initializerType = type->members.first;
14526 for(i = (*init->list).first; i; i = i->next)
14527 {
14528 if(type && type->kind == 8 && type->_class && type->_class->registered)
14529 {
14530 FindNextDataMember(type->_class->registered, &curClass, &curMember, subMemberStack, &subMemberStackPos);
14531 if(curMember)
14532 {
14533 if(!curMember->dataType)
14534 curMember->dataType = ProcessTypeString(curMember->dataTypeString, 0x0);
14535 initializerType = curMember->dataType;
14536 }
14537 }
14538 ProcessInitializer(i, initializerType);
14539 if(initializerType && type && (type->kind == 9 || type->kind == 10))
14540 initializerType = initializerType->next;
14541 if(!i->isConstant)
14542 init->isConstant = 0x0;
14543 }
14544 if(type && type->kind == 12)
14545 FreeType(initializerType);
14546 if(type && type->kind != 12 && type->kind != 9 && type->kind != 10 && (type->kind != 8 || !type->_class->registered || type->_class->registered->type != 1))
14547 {
14548 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Assigning list initializer to non list\n", (((void *)0))));
14549 }
14550 break;
14551 }
14552 }
14553 }
14554
14555 extern struct Symbol * FindType(struct Context * ctx, char *  name);
14556
14557 static void ProcessClass(struct __ecereNameSpace__ecere__sys__OldList * definitions, struct Symbol * symbol);
14558
14559 static void ProcessSpecifier(struct Specifier * spec, unsigned int declareStruct)
14560 {
14561 switch(spec->type)
14562 {
14563 case 0:
14564 {
14565 if(spec->specifier == THISCLASS)
14566 {
14567 if(thisClass)
14568 {
14569 spec->type = 1;
14570 spec->name = ReplaceThisClass(thisClass);
14571 spec->symbol = FindClass(spec->name);
14572 ProcessSpecifier(spec, declareStruct);
14573 }
14574 }
14575 break;
14576 }
14577 case 1:
14578 {
14579 struct Symbol * symbol = FindType(curContext, spec->name);
14580
14581 if(symbol)
14582 DeclareType(symbol->type, 0x1, 0x1);
14583 else if((symbol = spec->symbol) && symbol->registered && symbol->registered->type == 1 && declareStruct)
14584 DeclareStruct(spec->name, 0x0);
14585 break;
14586 }
14587 case 2:
14588 {
14589 struct Enumerator * e;
14590
14591 if(spec->list)
14592 {
14593 for(e = (*spec->list).first; e; e = e->next)
14594 {
14595 if(e->exp)
14596 ProcessExpressionType(e->exp);
14597 }
14598 }
14599 break;
14600 }
14601 case 3:
14602 case 4:
14603 {
14604 if(spec->definitions)
14605 {
14606 struct ClassDef * def;
14607 struct Symbol * symbol = spec->id ? FindClass(spec->id->string) : (((void *)0));
14608
14609 ProcessClass(spec->definitions, symbol);
14610 }
14611 break;
14612 }
14613 }
14614 }
14615
14616 static void ProcessDeclarator(struct Declarator * decl)
14617 {
14618 switch(decl->type)
14619 {
14620 case 1:
14621 if(decl->identifier->classSym)
14622 {
14623 FreeSpecifier(decl->identifier->_class);
14624 decl->identifier->_class = (((void *)0));
14625 }
14626 break;
14627 case 3:
14628 if(decl->array.exp)
14629 ProcessExpressionType(decl->array.exp);
14630 case 0:
14631 case 2:
14632 case 4:
14633 case 5:
14634 case 6:
14635 case 7:
14636 if(decl->declarator)
14637 ProcessDeclarator(decl->declarator);
14638 if(decl->type == 4)
14639 {
14640 struct Identifier * id = GetDeclId(decl);
14641
14642 if(id && id->_class)
14643 {
14644 struct TypeName * param = (param = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TypeName), param->qualifiers = MkListOne(id->_class), param->declarator = (((void *)0)), param);
14645
14646 if(!decl->function.parameters)
14647 decl->function.parameters = MkList();
14648 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*decl->function.parameters), (((void *)0)), param);
14649 id->_class = (((void *)0));
14650 }
14651 if(decl->function.parameters)
14652 {
14653 struct TypeName * param;
14654
14655 for(param = (*decl->function.parameters).first; param; param = param->next)
14656 {
14657 if(param->qualifiers && (*param->qualifiers).first)
14658 {
14659 struct Specifier * spec = (*param->qualifiers).first;
14660
14661 if(spec && spec->specifier == TYPED_OBJECT)
14662 {
14663 struct Declarator * d = param->declarator;
14664 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);
14665
14666 FreeList(param->qualifiers, FreeSpecifier);
14667 param->qualifiers = MkListOne(MkStructOrUnion(3, MkIdentifier("__ecereNameSpace__ecere__com__Class"), (((void *)0))));
14668 param->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier("class")));
14669 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*decl->function.parameters), param, newParam);
14670 param = newParam;
14671 }
14672 else if(spec && spec->specifier == ANY_OBJECT)
14673 {
14674 struct Declarator * d = param->declarator;
14675
14676 FreeList(param->qualifiers, FreeSpecifier);
14677 param->qualifiers = MkListOne(MkSpecifier(VOID));
14678 param->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d);
14679 }
14680 else if(spec->specifier == THISCLASS)
14681 {
14682 if(thisClass)
14683 {
14684 spec->type = 1;
14685 spec->name = ReplaceThisClass(thisClass);
14686 spec->symbol = FindClass(spec->name);
14687 ProcessSpecifier(spec, 0x0);
14688 }
14689 }
14690 }
14691 if(param->declarator)
14692 ProcessDeclarator(param->declarator);
14693 }
14694 }
14695 }
14696 break;
14697 }
14698 }
14699
14700 extern struct Identifier * CopyIdentifier(struct Identifier * id);
14701
14702 extern void FreeInitDeclarator(struct InitDeclarator * decl);
14703
14704 static void ProcessDeclaration(struct Declaration * decl)
14705 {
14706 yylloc = decl->loc;
14707 switch(decl->type)
14708 {
14709 case 1:
14710 {
14711 unsigned int declareStruct = 0x0;
14712
14713 if(decl->declarators)
14714 {
14715 struct InitDeclarator * d;
14716
14717 for(d = (*decl->declarators).first; d; d = d->next)
14718 {
14719 struct Type * type, * subType;
14720
14721 ProcessDeclarator(d->declarator);
14722 type = ProcessType(decl->specifiers, d->declarator);
14723 if(d->initializer)
14724 {
14725 ProcessInitializer(d->initializer, type);
14726 if((*decl->declarators).count == 1 && d->initializer->type == 0 && d->initializer->exp->type == 1)
14727 {
14728 if(type->kind == 8 && type->_class == d->initializer->exp->expType->_class)
14729 {
14730 struct Instantiation * inst = d->initializer->exp->instance;
14731
14732 inst->exp = MkExpIdentifier(CopyIdentifier(GetDeclId(d->declarator)));
14733 d->initializer->exp->instance = (((void *)0));
14734 if(decl->specifiers)
14735 FreeList(decl->specifiers, FreeSpecifier);
14736 FreeList(decl->declarators, FreeInitDeclarator);
14737 d = (((void *)0));
14738 decl->type = 2;
14739 decl->inst = inst;
14740 }
14741 }
14742 }
14743 for(subType = type; subType; )
14744 {
14745 if(subType->kind == 8)
14746 {
14747 declareStruct = 0x1;
14748 break;
14749 }
14750 else if(subType->kind == 13)
14751 break;
14752 else if(subType->kind == 12)
14753 subType = subType->arrayType;
14754 else
14755 break;
14756 }
14757 FreeType(type);
14758 if(!d)
14759 break;
14760 }
14761 }
14762 if(decl->specifiers)
14763 {
14764 struct Specifier * s;
14765
14766 for(s = (*decl->specifiers).first; s; s = s->next)
14767 {
14768 ProcessSpecifier(s, declareStruct);
14769 }
14770 }
14771 break;
14772 }
14773 case 2:
14774 {
14775 ProcessInstantiationType(decl->inst);
14776 break;
14777 }
14778 case 0:
14779 {
14780 struct Specifier * spec;
14781 struct Declarator * d;
14782 unsigned int declareStruct = 0x0;
14783
14784 if(decl->declarators)
14785 {
14786 for(d = (*decl->declarators).first; d; d = d->next)
14787 {
14788 struct Type * type = ProcessType(decl->specifiers, d->declarator);
14789 struct Type * subType;
14790
14791 ProcessDeclarator(d);
14792 for(subType = type; subType; )
14793 {
14794 if(subType->kind == 8)
14795 {
14796 declareStruct = 0x1;
14797 break;
14798 }
14799 else if(subType->kind == 13)
14800 break;
14801 else if(subType->kind == 12)
14802 subType = subType->arrayType;
14803 else
14804 break;
14805 }
14806 FreeType(type);
14807 }
14808 }
14809 if(decl->specifiers)
14810 {
14811 for(spec = (*decl->specifiers).first; spec; spec = spec->next)
14812 ProcessSpecifier(spec, declareStruct);
14813 }
14814 break;
14815 }
14816 }
14817 }
14818
14819 static struct FunctionDefinition * curFunction;
14820
14821 static void CreateFireWatcher(struct __ecereNameSpace__ecere__com__Property * prop, struct Expression * object, struct Statement * stmt)
14822 {
14823 char propName[1024], propNameM[1024];
14824 char getName[1024], setName[1024];
14825 struct __ecereNameSpace__ecere__sys__OldList * args;
14826
14827 DeclareProperty(prop, setName, getName);
14828 strcpy(propName, "__ecereProp_");
14829 FullClassNameCat(propName, prop->_class->fullName, 0x0);
14830 strcat(propName, "_");
14831 FullClassNameCat(propName, prop->name, 0x1);
14832 MangleClassName(propName);
14833 strcpy(propNameM, "__ecerePropM_");
14834 FullClassNameCat(propNameM, prop->_class->fullName, 0x0);
14835 strcat(propNameM, "_");
14836 FullClassNameCat(propNameM, prop->name, 0x1);
14837 MangleClassName(propNameM);
14838 if(prop->isWatchable)
14839 {
14840 args = MkList();
14841 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
14842 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
14843 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireWatchers")), args));
14844 args = MkList();
14845 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
14846 ListAdd(args, MkExpIdentifier(MkIdentifier(propNameM)));
14847 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireWatchers")), args));
14848 }
14849 {
14850 args = MkList();
14851 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
14852 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
14853 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireSelfWatchers")), args));
14854 args = MkList();
14855 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
14856 ListAdd(args, MkExpIdentifier(MkIdentifier(propNameM)));
14857 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireSelfWatchers")), args));
14858 }
14859 if(curFunction->propSet && !strcmp(curFunction->propSet->string, prop->name) && (!object || (object->type == 0 && !strcmp(object->identifier->string, "this"))))
14860 curFunction->propSet->fireWatchersDone = 0x1;
14861 }
14862
14863 extern struct Statement * MkIfStmt(struct __ecereNameSpace__ecere__sys__OldList * exp, struct Statement * statement, struct Statement * elseStmt);
14864
14865 extern struct Statement * MkForStmt(struct Statement * init, struct Statement * check, struct __ecereNameSpace__ecere__sys__OldList * inc, struct Statement * statement);
14866
14867 extern struct Statement * MkWhileStmt(struct __ecereNameSpace__ecere__sys__OldList * exp, struct Statement * statement);
14868
14869 extern struct ClassFunction * MkClassFunction(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct Specifier * _class, struct Declarator * decl, struct __ecereNameSpace__ecere__sys__OldList * declList);
14870
14871 extern void ProcessClassFunctionBody(struct ClassFunction * func, struct Statement * body);
14872
14873 extern void FreePropertyWatch(struct PropertyWatch * watcher);
14874
14875 static void ProcessStatement(struct Statement * stmt)
14876 {
14877 yylloc = stmt->loc;
14878 switch(stmt->type)
14879 {
14880 case 0:
14881 ProcessStatement(stmt->labeled.stmt);
14882 break;
14883 case 1:
14884 if(stmt->caseStmt.exp)
14885 {
14886 FreeType(stmt->caseStmt.exp->destType);
14887 stmt->caseStmt.exp->destType = curSwitchType;
14888 if(curSwitchType)
14889 curSwitchType->refCount++;
14890 ProcessExpressionType(stmt->caseStmt.exp);
14891 ComputeExpression(stmt->caseStmt.exp);
14892 }
14893 if(stmt->caseStmt.stmt)
14894 ProcessStatement(stmt->caseStmt.stmt);
14895 break;
14896 case 2:
14897 {
14898 if(stmt->compound.context)
14899 {
14900 struct Declaration * decl;
14901 struct Statement * s;
14902 struct Statement * prevCompound = curCompound;
14903 struct Context * prevContext = curContext;
14904
14905 if(!stmt->compound.isSwitch)
14906 {
14907 curCompound = stmt;
14908 curContext = stmt->compound.context;
14909 }
14910 if(stmt->compound.declarations)
14911 {
14912 for(decl = (*stmt->compound.declarations).first; decl; decl = decl->next)
14913 ProcessDeclaration(decl);
14914 }
14915 if(stmt->compound.statements)
14916 {
14917 for(s = (*stmt->compound.statements).first; s; s = s->next)
14918 ProcessStatement(s);
14919 }
14920 curContext = prevContext;
14921 curCompound = prevCompound;
14922 }
14923 break;
14924 }
14925 case 3:
14926 {
14927 struct Expression * exp;
14928
14929 if(stmt->expressions)
14930 {
14931 for(exp = (*stmt->expressions).first; exp; exp = exp->next)
14932 ProcessExpressionType(exp);
14933 }
14934 break;
14935 }
14936 case 4:
14937 {
14938 struct Expression * exp;
14939
14940 FreeType(((struct Expression *)(*stmt->ifStmt.exp).last)->destType);
14941 ((struct Expression *)(*stmt->ifStmt.exp).last)->destType = MkClassType("bool");
14942 ((struct Expression *)(*stmt->ifStmt.exp).last)->destType->truth = 0x1;
14943 for(exp = (*stmt->ifStmt.exp).first; exp; exp = exp->next)
14944 {
14945 ProcessExpressionType(exp);
14946 }
14947 if(stmt->ifStmt.stmt)
14948 ProcessStatement(stmt->ifStmt.stmt);
14949 if(stmt->ifStmt.elseStmt)
14950 ProcessStatement(stmt->ifStmt.elseStmt);
14951 break;
14952 }
14953 case 5:
14954 {
14955 struct Type * oldSwitchType = curSwitchType;
14956
14957 if(stmt->switchStmt.exp)
14958 {
14959 struct Expression * exp;
14960
14961 for(exp = (*stmt->switchStmt.exp).first; exp; exp = exp->next)
14962 {
14963 if(!exp->next)
14964 {
14965 ProcessExpressionType(exp);
14966 }
14967 if(!exp->next)
14968 curSwitchType = exp->expType;
14969 }
14970 }
14971 ProcessStatement(stmt->switchStmt.stmt);
14972 curSwitchType = oldSwitchType;
14973 break;
14974 }
14975 case 6:
14976 {
14977 if(stmt->whileStmt.exp)
14978 {
14979 struct Expression * exp;
14980
14981 FreeType(((struct Expression *)(*stmt->whileStmt.exp).last)->destType);
14982 ((struct Expression *)(*stmt->whileStmt.exp).last)->destType = MkClassType("bool");
14983 ((struct Expression *)(*stmt->whileStmt.exp).last)->destType->truth = 0x1;
14984 for(exp = (*stmt->whileStmt.exp).first; exp; exp = exp->next)
14985 {
14986 ProcessExpressionType(exp);
14987 }
14988 }
14989 if(stmt->whileStmt.stmt)
14990 ProcessStatement(stmt->whileStmt.stmt);
14991 break;
14992 }
14993 case 7:
14994 {
14995 if(stmt->doWhile.exp)
14996 {
14997 struct Expression * exp;
14998
14999 if((*stmt->doWhile.exp).last)
15000 {
15001 FreeType(((struct Expression *)(*stmt->doWhile.exp).last)->destType);
15002 ((struct Expression *)(*stmt->doWhile.exp).last)->destType = MkClassType("bool");
15003 ((struct Expression *)(*stmt->doWhile.exp).last)->destType->truth = 0x1;
15004 }
15005 for(exp = (*stmt->doWhile.exp).first; exp; exp = exp->next)
15006 {
15007 ProcessExpressionType(exp);
15008 }
15009 }
15010 if(stmt->doWhile.stmt)
15011 ProcessStatement(stmt->doWhile.stmt);
15012 break;
15013 }
15014 case 8:
15015 {
15016 struct Expression * exp;
15017
15018 if(stmt->forStmt.init)
15019 ProcessStatement(stmt->forStmt.init);
15020 if(stmt->forStmt.check && stmt->forStmt.check->expressions)
15021 {
15022 FreeType(((struct Expression *)(*stmt->forStmt.check->expressions).last)->destType);
15023 ((struct Expression *)(*stmt->forStmt.check->expressions).last)->destType = MkClassType("bool");
15024 ((struct Expression *)(*stmt->forStmt.check->expressions).last)->destType->truth = 0x1;
15025 }
15026 if(stmt->forStmt.check)
15027 ProcessStatement(stmt->forStmt.check);
15028 if(stmt->forStmt.increment)
15029 {
15030 for(exp = (*stmt->forStmt.increment).first; exp; exp = exp->next)
15031 ProcessExpressionType(exp);
15032 }
15033 if(stmt->forStmt.stmt)
15034 ProcessStatement(stmt->forStmt.stmt);
15035 break;
15036 }
15037 case 18:
15038 {
15039 struct Identifier * id = stmt->forEachStmt.id;
15040 struct __ecereNameSpace__ecere__sys__OldList * exp = stmt->forEachStmt.exp;
15041 struct __ecereNameSpace__ecere__sys__OldList * filter = stmt->forEachStmt.filter;
15042 struct Statement * block = stmt->forEachStmt.stmt;
15043 char iteratorType[1024];
15044 struct Type * source;
15045 struct Expression * e;
15046 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));
15047 struct Expression * arrayExp;
15048 char * typeString = (((void *)0));
15049 int builtinCount = 0;
15050
15051 for(e = exp ? (*exp).first : (((void *)0)); e; e = e->next)
15052 {
15053 if(!e->next)
15054 {
15055 FreeType(e->destType);
15056 e->destType = ProcessTypeString("Container", 0x0);
15057 }
15058 if(!isBuiltin || e->next)
15059 ProcessExpressionType(e);
15060 }
15061 source = (exp && (*exp).last) ? ((struct Expression *)(*exp).last)->expType : (((void *)0));
15062 if(isBuiltin || (source && source->kind == 8 && source->_class && source->_class->registered && source->_class->registered != containerClass && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, containerClass)))
15063 {
15064 struct __ecereNameSpace__ecere__com__Class * _class = source ? source->_class->registered : (((void *)0));
15065 struct Symbol * symbol;
15066 struct Expression * expIt = (((void *)0));
15067 unsigned int isMap = 0x0, isArray = 0x0, isLinkList = 0x0, isList = 0x0, isCustomAVLTree = 0x0, isAVLTree = 0x0;
15068 struct __ecereNameSpace__ecere__com__Class * arrayClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "Array");
15069 struct __ecereNameSpace__ecere__com__Class * linkListClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "LinkList");
15070 struct __ecereNameSpace__ecere__com__Class * customAVLTreeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "CustomAVLTree");
15071
15072 stmt->type = 2;
15073 stmt->compound.context = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Context);
15074 stmt->compound.context->parent = curContext;
15075 curContext = stmt->compound.context;
15076 if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, customAVLTreeClass))
15077 {
15078 struct __ecereNameSpace__ecere__com__Class * mapClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "Map");
15079 struct __ecereNameSpace__ecere__com__Class * avlTreeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "AVLTree");
15080
15081 isCustomAVLTree = 0x1;
15082 if(__ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, avlTreeClass))
15083 isAVLTree = 0x1;
15084 else if(__ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, mapClass))
15085 isMap = 0x1;
15086 }
15087 else if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, arrayClass))
15088 isArray = 0x1;
15089 else if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, linkListClass))
15090 {
15091 struct __ecereNameSpace__ecere__com__Class * listClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "List");
15092
15093 isLinkList = 0x1;
15094 isList = __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, listClass);
15095 }
15096 if(isArray)
15097 {
15098 struct Declarator * decl;
15099 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15100
15101 decl = SpecDeclFromString(_class->templateArgs[2].dataTypeString, specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(id)));
15102 stmt->compound.declarations = MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(decl, (((void *)0))))));
15103 ListAdd(stmt->compound.declarations, MkDeclaration(MkListOne(MkSpecifierName(source->_class->registered->fullName)), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internalArray")), MkInitializerAssignment(MkExpBrackets(exp))))));
15104 }
15105 else if(isBuiltin)
15106 {
15107 struct Type * type = (((void *)0));
15108 char typeStringBuf[1024];
15109
15110 arrayExp = (((struct Expression *)(*exp).last)->type == 37) ? (struct Expression *)(*exp).last : ((struct Expression *)(*exp).last)->cast.exp;
15111 if(((struct Expression *)(*exp).last)->type == 11)
15112 {
15113 struct TypeName * typeName = ((struct Expression *)(*exp).last)->cast.typeName;
15114
15115 if(typeName)
15116 arrayExp->destType = ProcessType(typeName->qualifiers, typeName->declarator);
15117 }
15118 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)
15119 {
15120 struct __ecereNameSpace__ecere__com__Class * templateClass = arrayExp->destType->_class->registered;
15121
15122 typeString = templateClass->templateArgs[2].dataTypeString;
15123 }
15124 else if(arrayExp->list)
15125 {
15126 struct Expression * e;
15127
15128 for(e = (*arrayExp->list).first; e; e = e->next)
15129 {
15130 ProcessExpressionType(e);
15131 if(e->expType)
15132 {
15133 if(!type)
15134 {
15135 type = e->expType;
15136 type->refCount++;
15137 }
15138 else
15139 {
15140 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
15141 {
15142 FreeType(type);
15143 type = e->expType;
15144 e->expType = (((void *)0));
15145 e = (*arrayExp->list).first;
15146 ProcessExpressionType(e);
15147 if(e->expType)
15148 {
15149 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
15150 {
15151 FreeType(e->expType);
15152 e->expType = (((void *)0));
15153 FreeType(type);
15154 type = (((void *)0));
15155 break;
15156 }
15157 }
15158 }
15159 }
15160 if(e->expType)
15161 {
15162 FreeType(e->expType);
15163 e->expType = (((void *)0));
15164 }
15165 }
15166 }
15167 if(type)
15168 {
15169 typeStringBuf[0] = '\0';
15170 PrintType(type, typeStringBuf, 0x0, 0x1);
15171 typeString = typeStringBuf;
15172 FreeType(type);
15173 }
15174 }
15175 if(typeString)
15176 {
15177 struct __ecereNameSpace__ecere__sys__OldList * initializers = MkList();
15178 struct Declarator * decl;
15179 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15180
15181 if(arrayExp->list)
15182 {
15183 struct Expression * e;
15184
15185 builtinCount = (*arrayExp->list).count;
15186 type = ProcessTypeString(typeString, 0x0);
15187 while(e = (*arrayExp->list).first)
15188 {
15189 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*arrayExp->list), e);
15190 e->destType = type;
15191 type->refCount++;
15192 ProcessExpressionType(e);
15193 ListAdd(initializers, MkInitializerAssignment(e));
15194 }
15195 FreeType(type);
15196 (__ecereNameSpace__ecere__com__eSystem_Delete(arrayExp->list), arrayExp->list = 0);
15197 }
15198 decl = SpecDeclFromString(typeString, specs, MkDeclaratorIdentifier(id));
15199 stmt->compound.declarations = MkListOne(MkDeclaration(CopyList(specs, CopySpecifier), MkListOne(MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl), (((void *)0))))));
15200 ListAdd(stmt->compound.declarations, MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorArray(PlugDeclarator(decl, MkDeclaratorIdentifier(MkIdentifier("__internalArray"))), (((void *)0))), MkInitializerList(initializers)))));
15201 FreeList(exp, FreeExpression);
15202 }
15203 else
15204 {
15205 arrayExp->expType = ProcessTypeString("Container", 0x0);
15206 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Couldn't determine type of array elements\n", (((void *)0))));
15207 }
15208 }
15209 else if(isLinkList && !isList)
15210 {
15211 struct Declarator * decl;
15212 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15213
15214 decl = SpecDeclFromString(_class->templateArgs[3].dataTypeString, specs, MkDeclaratorIdentifier(id));
15215 stmt->compound.declarations = MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(decl, (((void *)0))))));
15216 ListAdd(stmt->compound.declarations, MkDeclaration(MkListOne(MkSpecifierName(source->_class->registered->fullName)), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internalLinkList")), MkInitializerAssignment(MkExpBrackets(exp))))));
15217 }
15218 else if(_class->templateArgs)
15219 {
15220 if(isMap)
15221 sprintf(iteratorType, "MapIterator<%s, %s >", _class->templateArgs[5].dataTypeString, _class->templateArgs[6].dataTypeString);
15222 else
15223 sprintf(iteratorType, "Iterator<%s, %s >", _class->templateArgs[2].dataTypeString, _class->templateArgs[1].dataTypeString);
15224 stmt->compound.declarations = MkListOne(MkDeclarationInst(MkInstantiationNamed(MkListOne(MkSpecifierName(iteratorType)), MkExpIdentifier(id), MkListOne(MkMembersInitList(MkListOne(MkMemberInit(isMap ? MkListOne(MkIdentifier("map")) : (((void *)0)), MkInitializerAssignment(MkExpBrackets(exp)))))))));
15225 }
15226 symbol = FindSymbol(id->string, curContext, curContext, 0x0, 0x0);
15227 if(block && block->type == 2 && block->compound.context)
15228 {
15229 block->compound.context->parent = stmt->compound.context;
15230 }
15231 if(filter)
15232 {
15233 block = MkIfStmt(filter, block, (((void *)0)));
15234 }
15235 if(isArray)
15236 {
15237 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));
15238 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.init);
15239 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.check);
15240 ProcessExpressionType((*((struct Statement *)(*stmt->compound.statements).first)->forStmt.increment).first);
15241 }
15242 else if(isBuiltin)
15243 {
15244 char count[128];
15245
15246 sprintf(count, "%d", builtinCount);
15247 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));
15248 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.init);
15249 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.check);
15250 ProcessExpressionType((*((struct Statement *)(*stmt->compound.statements).first)->forStmt.increment).first);
15251 }
15252 else if(isLinkList && !isList)
15253 {
15254 struct __ecereNameSpace__ecere__com__Class * typeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, _class->templateArgs[3].dataTypeString);
15255 struct __ecereNameSpace__ecere__com__Class * listItemClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, "ListItem");
15256
15257 if(typeClass && __ecereNameSpace__ecere__com__eClass_IsDerived(typeClass, listItemClass) && _class->templateArgs[5].dataTypeString && !strcmp(_class->templateArgs[5].dataTypeString, "LT::link"))
15258 {
15259 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));
15260 }
15261 else
15262 {
15263 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15264 struct Declarator * decl = SpecDeclFromString(_class->templateArgs[3].dataTypeString, specs, (((void *)0)));
15265
15266 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));
15267 }
15268 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.init);
15269 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.check);
15270 ProcessExpressionType((*((struct Statement *)(*stmt->compound.statements).first)->forStmt.increment).first);
15271 }
15272 else
15273 {
15274 stmt->compound.statements = MkListOne(MkWhileStmt(MkListOne(MkExpCall(MkExpMember(expIt = MkExpIdentifier(CopyIdentifier(id)), MkIdentifier("Next")), (((void *)0)))), block));
15275 }
15276 ProcessExpressionType(expIt);
15277 if((*stmt->compound.declarations).first)
15278 ProcessDeclaration((*stmt->compound.declarations).first);
15279 if(symbol)
15280 symbol->isIterator = isMap ? 2 : ((isArray || isBuiltin) ? 3 : (isLinkList ? (isList ? 5 : 4) : (isCustomAVLTree ? 6 : 1)));
15281 ProcessStatement(stmt);
15282 curContext = stmt->compound.context->parent;
15283 break;
15284 }
15285 else
15286 {
15287 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Expression is not a container\n", (((void *)0))));
15288 }
15289 break;
15290 }
15291 case 9:
15292 break;
15293 case 10:
15294 break;
15295 case 11:
15296 break;
15297 case 12:
15298 {
15299 struct Expression * exp;
15300
15301 if(stmt->expressions)
15302 {
15303 for(exp = (*stmt->expressions).first; exp; exp = exp->next)
15304 {
15305 if(!exp->next)
15306 {
15307 if(curFunction && !curFunction->type)
15308 curFunction->type = ProcessType(curFunction->specifiers, curFunction->declarator);
15309 FreeType(exp->destType);
15310 exp->destType = (curFunction && curFunction->type && curFunction->type->kind == 11) ? curFunction->type->returnType : (((void *)0));
15311 if(exp->destType)
15312 exp->destType->refCount++;
15313 }
15314 ProcessExpressionType(exp);
15315 }
15316 }
15317 break;
15318 }
15319 case 14:
15320 {
15321 ProcessDeclaration(stmt->decl);
15322 break;
15323 }
15324 case 13:
15325 {
15326 struct AsmField * field;
15327
15328 if(stmt->asmStmt.inputFields)
15329 {
15330 for(field = (*stmt->asmStmt.inputFields).first; field; field = field->next)
15331 if(field->expression)
15332 ProcessExpressionType(field->expression);
15333 }
15334 if(stmt->asmStmt.outputFields)
15335 {
15336 for(field = (*stmt->asmStmt.outputFields).first; field; field = field->next)
15337 if(field->expression)
15338 ProcessExpressionType(field->expression);
15339 }
15340 if(stmt->asmStmt.clobberedFields)
15341 {
15342 for(field = (*stmt->asmStmt.clobberedFields).first; field; field = field->next)
15343 {
15344 if(field->expression)
15345 ProcessExpressionType(field->expression);
15346 }
15347 }
15348 break;
15349 }
15350 case 17:
15351 {
15352 struct PropertyWatch * propWatch;
15353 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->_watch.watches;
15354 struct Expression * object = stmt->_watch.object;
15355 struct Expression * watcher = stmt->_watch.watcher;
15356
15357 if(watcher)
15358 ProcessExpressionType(watcher);
15359 if(object)
15360 ProcessExpressionType(object);
15361 if(inCompiler)
15362 {
15363 if(watcher || thisClass)
15364 {
15365 struct External * external = curExternal;
15366 struct Context * context = curContext;
15367
15368 stmt->type = 3;
15369 stmt->expressions = MkList();
15370 curExternal = external->prev;
15371 for(propWatch = (*watches).first; propWatch; propWatch = propWatch->next)
15372 {
15373 struct ClassFunction * func;
15374 char watcherName[1024];
15375 struct __ecereNameSpace__ecere__com__Class * watcherClass = watcher ? ((watcher->expType && watcher->expType->kind == 8 && watcher->expType->_class) ? watcher->expType->_class->registered : (((void *)0))) : thisClass;
15376 struct External * createdExternal;
15377 struct External * externalDecl = MkExternalDeclaration((((void *)0)));
15378
15379 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, externalDecl);
15380 sprintf(watcherName, "__ecerePropertyWatcher_%d", propWatcherID++);
15381 if(propWatch->deleteWatch)
15382 strcat(watcherName, "_delete");
15383 else
15384 {
15385 struct Identifier * propID;
15386
15387 for(propID = (*propWatch->properties).first; propID; propID = propID->next)
15388 {
15389 strcat(watcherName, "_");
15390 strcat(watcherName, propID->string);
15391 }
15392 }
15393 if(object && object->expType && object->expType->kind == 8 && object->expType->_class && object->expType->_class->registered)
15394 {
15395 func = MkClassFunction(MkListOne(MkSpecifier(VOID)), (((void *)0)), MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(watcherName)), MkListOne(MkTypeName(MkListOne(MkSpecifierName(object->expType->_class->string)), MkDeclaratorIdentifier(MkIdentifier("value"))))), (((void *)0)));
15396 ProcessClassFunctionBody(func, propWatch->compound);
15397 propWatch->compound = (((void *)0));
15398 createdExternal = ProcessClassFunction(watcherClass, func, ast, curExternal, 0x1);
15399 createdExternal->symbol->idCode = external->symbol->idCode;
15400 curExternal = createdExternal;
15401 ProcessFunction(createdExternal->function);
15402 {
15403 struct Declaration * decl = MkDeclaration(CopyList(createdExternal->function->specifiers, CopySpecifier), MkListOne(MkInitDeclarator(CopyDeclarator(createdExternal->function->declarator), (((void *)0)))));
15404
15405 externalDecl->declaration = decl;
15406 if(decl->symbol && !decl->symbol->pointerExternal)
15407 decl->symbol->pointerExternal = externalDecl;
15408 }
15409 if(propWatch->deleteWatch)
15410 {
15411 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
15412
15413 ListAdd(args, CopyExpression(object));
15414 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
15415 ListAdd(args, MkExpIdentifier(MkIdentifier(watcherName)));
15416 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_WatchDestruction")), args));
15417 }
15418 else
15419 {
15420 struct __ecereNameSpace__ecere__com__Class * _class = object->expType->_class->registered;
15421 struct Identifier * propID;
15422
15423 for(propID = (*propWatch->properties).first; propID; propID = propID->next)
15424 {
15425 char propName[1024];
15426 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
15427
15428 if(prop)
15429 {
15430 char getName[1024], setName[1024];
15431 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
15432
15433 DeclareProperty(prop, setName, getName);
15434 strcpy(propName, "__ecereProp_");
15435 FullClassNameCat(propName, prop->_class->fullName, 0x0);
15436 strcat(propName, "_");
15437 FullClassNameCat(propName, prop->name, 0x1);
15438 ListAdd(args, CopyExpression(object));
15439 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
15440 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
15441 ListAdd(args, MkExpIdentifier(MkIdentifier(watcherName)));
15442 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_Watch")), args));
15443 }
15444 else
15445 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Property %s not found in class %s\n", (((void *)0))), prop->name, _class->fullName);
15446 }
15447 }
15448 }
15449 else
15450 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Invalid watched object\n", (((void *)0))));
15451 }
15452 curExternal = external;
15453 curContext = context;
15454 if(watcher)
15455 FreeExpression(watcher);
15456 if(object)
15457 FreeExpression(object);
15458 FreeList(watches, FreePropertyWatch);
15459 }
15460 else
15461 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "No observer specified and not inside a _class\n", (((void *)0))));
15462 }
15463 else
15464 {
15465 for(propWatch = (*watches).first; propWatch; propWatch = propWatch->next)
15466 {
15467 ProcessStatement(propWatch->compound);
15468 }
15469 }
15470 break;
15471 }
15472 case 15:
15473 {
15474 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->_watch.watches;
15475 struct Expression * object = stmt->_watch.object;
15476 struct __ecereNameSpace__ecere__com__Class * _class;
15477
15478 if(object)
15479 ProcessExpressionType(object);
15480 if(inCompiler)
15481 {
15482 _class = object ? ((object->expType && object->expType->kind == 8 && object->expType->_class) ? object->expType->_class->registered : (((void *)0))) : thisClass;
15483 if(_class)
15484 {
15485 struct Identifier * propID;
15486
15487 stmt->type = 3;
15488 stmt->expressions = MkList();
15489 if(!watches && curFunction->propSet && (!object || (object->type == 0 && !strcmp(object->identifier->string, "this"))))
15490 {
15491 watches = MkListOne(MkIdentifier(curFunction->propSet->string));
15492 }
15493 else if(!watches)
15494 {
15495 }
15496 if(watches)
15497 {
15498 for(propID = (*watches).first; propID; propID = propID->next)
15499 {
15500 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
15501
15502 if(prop)
15503 {
15504 CreateFireWatcher(prop, object, stmt);
15505 }
15506 else
15507 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Property %s not found in class %s\n", (((void *)0))), propID->string, _class->fullName);
15508 }
15509 }
15510 else
15511 {
15512 struct __ecereNameSpace__ecere__com__Property * prop;
15513 struct __ecereNameSpace__ecere__com__Class * base;
15514
15515 for(base = _class; base; base = base->base)
15516 {
15517 for(prop = base->membersAndProperties.first; prop; prop = prop->next)
15518 {
15519 if(prop->isProperty && prop->isWatchable)
15520 {
15521 CreateFireWatcher(prop, object, stmt);
15522 }
15523 }
15524 }
15525 }
15526 if(object)
15527 FreeExpression(object);
15528 FreeList(watches, FreeIdentifier);
15529 }
15530 else
15531 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Invalid object specified and not inside a class\n", (((void *)0))));
15532 }
15533 break;
15534 }
15535 case 16:
15536 {
15537 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->_watch.watches;
15538 struct Expression * object = stmt->_watch.object;
15539 struct Expression * watcher = stmt->_watch.watcher;
15540 struct __ecereNameSpace__ecere__com__Class * _class;
15541
15542 if(object)
15543 ProcessExpressionType(object);
15544 if(watcher)
15545 ProcessExpressionType(watcher);
15546 if(inCompiler)
15547 {
15548 _class = (object && object->expType && object->expType->kind == 8 && object->expType->_class) ? object->expType->_class->registered : (((void *)0));
15549 if(watcher || thisClass)
15550 {
15551 if(_class)
15552 {
15553 struct Identifier * propID;
15554
15555 stmt->type = 3;
15556 stmt->expressions = MkList();
15557 if(!watches)
15558 {
15559 struct __ecereNameSpace__ecere__sys__OldList * args;
15560
15561 args = MkList();
15562 ListAdd(args, CopyExpression(object));
15563 ListAdd(args, MkExpConstant("0"));
15564 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
15565 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_StopWatching")), args));
15566 }
15567 else
15568 {
15569 for(propID = (*watches).first; propID; propID = propID->next)
15570 {
15571 char propName[1024];
15572 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
15573
15574 if(prop)
15575 {
15576 char getName[1024], setName[1024];
15577 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
15578
15579 DeclareProperty(prop, setName, getName);
15580 strcpy(propName, "__ecereProp_");
15581 FullClassNameCat(propName, prop->_class->fullName, 0x0);
15582 strcat(propName, "_");
15583 FullClassNameCat(propName, prop->name, 0x1);
15584 MangleClassName(propName);
15585 ListAdd(args, CopyExpression(object));
15586 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
15587 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
15588 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_StopWatching")), args));
15589 }
15590 else
15591 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Property %s not found in class %s\n", (((void *)0))), prop->name, _class->fullName);
15592 }
15593 }
15594 if(object)
15595 FreeExpression(object);
15596 if(watcher)
15597 FreeExpression(watcher);
15598 FreeList(watches, FreeIdentifier);
15599 }
15600 else
15601 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Invalid object specified and not inside a class\n", (((void *)0))));
15602 }
15603 else
15604 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "No observer specified and not inside a class\n", (((void *)0))));
15605 }
15606 break;
15607 }
15608 }
15609 }
15610
15611 extern struct Expression * QBrackets(struct Expression * exp);
15612
15613 extern struct TypeName * QMkType(char *  spec, struct Declarator * decl);
15614
15615 extern struct Declarator * QMkPtrDecl(char *  id);
15616
15617 extern struct Expression * MkExpPointer(struct Expression * expression, struct Identifier * member);
15618
15619 extern struct Expression * QMkExpCond(struct Expression * cond, struct Expression * exp, struct Expression * elseExp);
15620
15621 extern struct Statement * MkFireWatchersStmt(struct Expression * object, struct __ecereNameSpace__ecere__sys__OldList * watches);
15622
15623 static void ProcessFunction(struct FunctionDefinition * function)
15624 {
15625 void * __ecereTemp2;
15626 void * __ecereTemp1;
15627 struct Identifier * id = GetDeclId(function->declarator);
15628 struct Symbol * symbol = function->declarator ? function->declarator->symbol : (((void *)0));
15629 struct Type * type = symbol ? symbol->type : (((void *)0));
15630 struct __ecereNameSpace__ecere__com__Class * oldThisClass = thisClass;
15631 struct Context * oldTopContext = topContext;
15632
15633 yylloc = function->loc;
15634 if(type && type->thisClass)
15635 {
15636 struct Symbol * classSym = type->thisClass;
15637 struct __ecereNameSpace__ecere__com__Class * _class = type->thisClass->registered;
15638 char className[1024];
15639 char structName[1024];
15640 struct Declarator * funcDecl;
15641 struct Symbol * thisSymbol;
15642 unsigned int typedObject = 0x0;
15643
15644 if(_class && !_class->base)
15645 {
15646 _class = currentClass;
15647 if(_class && !_class->symbol)
15648 _class->symbol = FindClass(_class->fullName);
15649 classSym = _class ? _class->symbol : (((void *)0));
15650 typedObject = 0x1;
15651 }
15652 thisClass = _class;
15653 if(inCompiler && _class)
15654 {
15655 if(type->kind == 11)
15656 {
15657 if(symbol->type->params.count == 1 && ((struct Type *)symbol->type->params.first)->kind == 0)
15658 {
15659 struct Type * param = symbol->type->params.first;
15660
15661 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(&symbol->type->params, param);
15662 FreeType(param);
15663 }
15664 if(type->classObjectType != 1)
15665 {
15666 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(&symbol->type->params, (((void *)0)), MkClassType(_class->fullName));
15667 symbol->type->staticMethod = 0x1;
15668 symbol->type->thisClass = (((void *)0));
15669 symbol->type->extraParam = 0x0;
15670 }
15671 }
15672 strcpy(className, "__ecereClass_");
15673 FullClassNameCat(className, _class->fullName, 0x1);
15674 MangleClassName(className);
15675 structName[0] = (char)0;
15676 FullClassNameCat(structName, _class->fullName, 0x0);
15677 funcDecl = GetFuncDecl(function->declarator);
15678 if(funcDecl)
15679 {
15680 if(funcDecl->function.parameters && (*funcDecl->function.parameters).count == 1)
15681 {
15682 struct TypeName * param = (*funcDecl->function.parameters).first;
15683
15684 if(param->qualifiers && (*param->qualifiers).count == 1 && ((struct Specifier *)(*param->qualifiers).first)->specifier == VOID && !param->declarator)
15685 {
15686 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->function.parameters), param);
15687 FreeTypeName(param);
15688 }
15689 }
15690 if(!function->propertyNoThis)
15691 {
15692 struct TypeName * thisParam;
15693
15694 if(type->classObjectType != 1)
15695 {
15696 thisParam = QMkClass(_class->fullName, MkDeclaratorIdentifier(MkIdentifier("this")));
15697 if(!funcDecl->function.parameters)
15698 funcDecl->function.parameters = MkList();
15699 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
15700 }
15701 if(typedObject)
15702 {
15703 if(type->classObjectType != 1)
15704 {
15705 if(type->byReference || _class->type == 3 || _class->type == 1000 || _class->type == 4 || _class->type == 2)
15706 thisParam->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), thisParam->declarator);
15707 }
15708 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));
15709 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
15710 }
15711 }
15712 }
15713 if(symbol && symbol->pointerExternal && symbol->pointerExternal->type == 1)
15714 {
15715 struct InitDeclarator * initDecl = (*symbol->pointerExternal->declaration->declarators).first;
15716
15717 funcDecl = GetFuncDecl(initDecl->declarator);
15718 if(funcDecl)
15719 {
15720 if(funcDecl->function.parameters && (*funcDecl->function.parameters).count == 1)
15721 {
15722 struct TypeName * param = (*funcDecl->function.parameters).first;
15723
15724 if(param->qualifiers && (*param->qualifiers).count == 1 && ((struct Specifier *)(*param->qualifiers).first)->specifier == VOID && !param->declarator)
15725 {
15726 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->function.parameters), param);
15727 FreeTypeName(param);
15728 }
15729 }
15730 if(type->classObjectType != 1)
15731 {
15732 if((_class->type != 2 && _class->type != 3 && _class->type != 4) || function != (struct FunctionDefinition *)symbol->externalSet)
15733 {
15734 struct TypeName * thisParam = QMkClass(_class->fullName, MkDeclaratorIdentifier(MkIdentifier("this")));
15735
15736 if(!funcDecl->function.parameters)
15737 funcDecl->function.parameters = MkList();
15738 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
15739 }
15740 }
15741 }
15742 }
15743 }
15744 if(function->body)
15745 {
15746 if(type->classObjectType != 1)
15747 {
15748 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));
15749 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&function->body->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
15750 if(typedObject && thisSymbol->type)
15751 {
15752 thisSymbol->type->classObjectType = 2;
15753 thisSymbol->type->byReference = type->byReference;
15754 }
15755 }
15756 }
15757 if(inCompiler && _class && (_class->type == 0) && type->classObjectType != 1)
15758 {
15759 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
15760
15761 {
15762 struct __ecereNameSpace__ecere__com__Class * base;
15763
15764 for(base = _class; base && base->type != 1000; base = base->next)
15765 {
15766 for(member = base->membersAndProperties.first; member; member = member->next)
15767 if(!member->isProperty)
15768 break;
15769 if(member)
15770 break;
15771 }
15772 }
15773 for(member = _class->membersAndProperties.first; member; member = member->next)
15774 if(!member->isProperty)
15775 break;
15776 if(member)
15777 {
15778 char pointerName[1024];
15779 struct Declaration * decl;
15780 struct Initializer * initializer;
15781 struct Expression * exp, * bytePtr;
15782
15783 strcpy(pointerName, "__ecerePointer_");
15784 FullClassNameCat(pointerName, _class->fullName, 0x0);
15785 {
15786 char className[1024];
15787
15788 strcpy(className, "__ecereClass_");
15789 FullClassNameCat(className, classSym->string, 0x1);
15790 MangleClassName(className);
15791 DeclareClass(classSym, className);
15792 }
15793 bytePtr = QBrackets(MkExpCast(QMkType("char", QMkPtrDecl((((void *)0)))), QMkExpId("this")));
15794 if(_class->fixed)
15795 {
15796 char string[256];
15797
15798 sprintf(string, "%d", _class->offset);
15799 exp = QBrackets(MkExpOp(bytePtr, '+', MkExpConstant(string)));
15800 }
15801 else
15802 {
15803 exp = QBrackets(MkExpOp(bytePtr, '+', MkExpPointer(QMkExpId(className), MkIdentifier("offset"))));
15804 }
15805 exp = QBrackets(QMkExpCond(QMkExpId("this"), exp, MkExpConstant("0")));
15806 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));
15807 if(function->body)
15808 {
15809 yylloc = function->body->loc;
15810 initializer = MkInitializerAssignment(MkExpCast(MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(structName), (((void *)0)))), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), exp));
15811 {
15812 struct Context * prevContext = curContext;
15813
15814 curContext = function->body->compound.context;
15815 decl = MkDeclaration(MkListOne(MkStructOrUnion(3, MkIdentifier(structName), (((void *)0)))), MkListOne(MkInitDeclarator(QMkPtrDecl(pointerName), initializer)));
15816 curContext = prevContext;
15817 }
15818 decl->symbol = (((void *)0));
15819 if(!function->body->compound.declarations)
15820 function->body->compound.declarations = MkList();
15821 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*function->body->compound.declarations), (((void *)0)), decl);
15822 }
15823 }
15824 }
15825 }
15826 else
15827 thisClass = (((void *)0));
15828 if(id)
15829 {
15830 FreeSpecifier(id->_class);
15831 id->_class = (((void *)0));
15832 if(symbol && symbol->pointerExternal && symbol->pointerExternal->type == 1)
15833 {
15834 struct InitDeclarator * initDecl = (*symbol->pointerExternal->declaration->declarators).first;
15835
15836 id = GetDeclId(initDecl->declarator);
15837 FreeSpecifier(id->_class);
15838 id->_class = (((void *)0));
15839 }
15840 }
15841 if(function->body)
15842 topContext = function->body->compound.context;
15843 {
15844 struct FunctionDefinition * oldFunction = curFunction;
15845
15846 curFunction = function;
15847 if(function->body)
15848 ProcessStatement(function->body);
15849 if(inCompiler && function->propSet && !function->propSet->fireWatchersDone)
15850 {
15851 struct Statement * prevCompound = curCompound;
15852 struct Context * prevContext = curContext;
15853 struct Statement * fireWatchers = MkFireWatchersStmt((((void *)0)), (((void *)0)));
15854
15855 if(!function->body->compound.statements)
15856 function->body->compound.statements = MkList();
15857 ListAdd(function->body->compound.statements, fireWatchers);
15858 curCompound = function->body;
15859 curContext = function->body->compound.context;
15860 ProcessStatement(fireWatchers);
15861 curContext = prevContext;
15862 curCompound = prevCompound;
15863 }
15864 curFunction = oldFunction;
15865 }
15866 if(function->declarator)
15867 {
15868 ProcessDeclarator(function->declarator);
15869 }
15870 topContext = oldTopContext;
15871 thisClass = oldThisClass;
15872 }
15873
15874 extern void FreeSymbol(struct Symbol * symbol);
15875
15876 void __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Remove(struct __ecereNameSpace__ecere__sys__BinaryTree * this, struct __ecereNameSpace__ecere__sys__BTNode * node);
15877
15878 static void ProcessClass(struct __ecereNameSpace__ecere__sys__OldList * definitions, struct Symbol * symbol)
15879 {
15880 struct ClassDef * def;
15881 struct External * external = curExternal;
15882 struct __ecereNameSpace__ecere__com__Class * regClass = symbol ? symbol->registered : (((void *)0));
15883
15884 for(def = definitions->first; def; def = def->next)
15885 {
15886 if(def->type == 0)
15887 {
15888 if(def->function->declarator)
15889 curExternal = def->function->declarator->symbol->pointerExternal;
15890 else
15891 curExternal = external;
15892 ProcessFunction((struct FunctionDefinition *)def->function);
15893 }
15894 else if(def->type == 2)
15895 {
15896 if(def->decl->type == 2)
15897 {
15898 thisClass = regClass;
15899 ProcessInstantiationType(def->decl->inst);
15900 thisClass = (((void *)0));
15901 }
15902 else
15903 {
15904 struct __ecereNameSpace__ecere__com__Class * backThisClass = thisClass;
15905
15906 if(regClass)
15907 thisClass = regClass;
15908 ProcessDeclaration(def->decl);
15909 thisClass = backThisClass;
15910 }
15911 }
15912 else if(def->type == 1 && def->defProperties)
15913 {
15914 struct MemberInit * defProperty;
15915 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);
15916
15917 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
15918 for(defProperty = (*def->defProperties).first; defProperty; defProperty = defProperty->next)
15919 {
15920 thisClass = regClass;
15921 ProcessMemberInitData(defProperty, regClass, (((void *)0)), (((void *)0)), (((void *)0)), (((void *)0)));
15922 thisClass = (((void *)0));
15923 }
15924 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Remove(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
15925 FreeSymbol(thisSymbol);
15926 }
15927 else if(def->type == 3 && def->propertyDef)
15928 {
15929 struct PropertyDef * prop = def->propertyDef;
15930
15931 thisClass = regClass;
15932 if(prop->setStmt)
15933 {
15934 if(regClass)
15935 {
15936 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
15937
15938 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->setStmt->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
15939 }
15940 curExternal = prop->symbol ? prop->symbol->externalSet : (((void *)0));
15941 ProcessStatement(prop->setStmt);
15942 }
15943 if(prop->getStmt)
15944 {
15945 if(regClass)
15946 {
15947 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
15948
15949 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->getStmt->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
15950 }
15951 curExternal = prop->symbol ? prop->symbol->externalGet : (((void *)0));
15952 ProcessStatement(prop->getStmt);
15953 }
15954 if(prop->issetStmt)
15955 {
15956 if(regClass)
15957 {
15958 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
15959
15960 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->issetStmt->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
15961 }
15962 curExternal = prop->symbol ? prop->symbol->externalIsSet : (((void *)0));
15963 ProcessStatement(prop->issetStmt);
15964 }
15965 thisClass = (((void *)0));
15966 }
15967 else if(def->type == 4 && def->propertyWatch)
15968 {
15969 struct PropertyWatch * propertyWatch = def->propertyWatch;
15970
15971 thisClass = regClass;
15972 if(propertyWatch->compound)
15973 {
15974 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);
15975
15976 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&propertyWatch->compound->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
15977 curExternal = (((void *)0));
15978 ProcessStatement(propertyWatch->compound);
15979 }
15980 thisClass = (((void *)0));
15981 }
15982 }
15983 }
15984
15985 extern struct __ecereNameSpace__ecere__com__Instance * GetPrivateModule(void);
15986
15987 void ComputeDataTypes()
15988 {
15989 void * __ecereTemp1;
15990 struct External * external;
15991 struct External * temp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_External);
15992
15993 currentClass = (((void *)0));
15994 containerClass = __ecereNameSpace__ecere__com__eSystem_FindClass(GetPrivateModule(), "Container");
15995 temp->symbol = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), ((struct Symbol *)__ecereTemp1)->id = -1000, ((struct Symbol *)__ecereTemp1)->idCode = -1000, ((struct Symbol *)__ecereTemp1));
15996 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), (((void *)0)), temp);
15997 curExternal = temp;
15998 DeclareStruct("ecere::com::Class", 0x0);
15999 DeclareStruct("ecere::com::Instance", 0x0);
16000 DeclareStruct("ecere::com::Property", 0x0);
16001 DeclareStruct("ecere::com::DataMember", 0x0);
16002 DeclareStruct("ecere::com::Method", 0x0);
16003 DeclareStruct("ecere::com::SerialBuffer", 0x0);
16004 DeclareStruct("ecere::com::ClassTemplateArgument", 0x0);
16005 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*ast), temp);
16006 for(external = (*ast).first; external; external = external->next)
16007 {
16008 afterExternal = curExternal = external;
16009 if(external->type == 0)
16010 {
16011 currentClass = external->function->_class;
16012 ProcessFunction(external->function);
16013 }
16014 else if(external->type == 1)
16015 {
16016 currentClass = (((void *)0));
16017 ProcessDeclaration(external->declaration);
16018 }
16019 else if(external->type == 2)
16020 {
16021 struct ClassDefinition * _class = external->_class;
16022
16023 currentClass = external->symbol->registered;
16024 if(_class->definitions)
16025 {
16026 ProcessClass(_class->definitions, _class->symbol);
16027 }
16028 if(inCompiler)
16029 {
16030 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*ast), external);
16031 ((external ? (__ecereClass_External->Destructor ? __ecereClass_External->Destructor(external) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(external)) : 0), external = 0);
16032 }
16033 }
16034 else if(external->type == 4)
16035 {
16036 thisNameSpace = external->id->string;
16037 }
16038 }
16039 currentClass = (((void *)0));
16040 thisNameSpace = (((void *)0));
16041 ((temp->symbol ? (__ecereClass_Symbol->Destructor ? __ecereClass_Symbol->Destructor(temp->symbol) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(temp->symbol)) : 0), temp->symbol = 0);
16042 ((temp ? (__ecereClass_External->Destructor ? __ecereClass_External->Destructor(temp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(temp)) : 0), temp = 0);
16043 }
16044
16045 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);
16046
16047 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);
16048
16049 void __ecereRegisterModule_pass15(struct __ecereNameSpace__ecere__com__Instance * module)
16050 {
16051 struct __ecereNameSpace__ecere__com__Class * class;
16052
16053 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetYydebug", "void SetYydebug(bool b)", SetYydebug, module, 1);
16054 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetThisClass", "void SetThisClass(ecere::com::Class c)", SetThisClass, module, 1);
16055 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetThisClass", "ecere::com::Class GetThisClass(void)", GetThisClass, module, 1);
16056 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintExpression", "void PrintExpression(Expression exp, char * string)", PrintExpression, module, 1);
16057 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("_strtoi64", "int64 _strtoi64(char * string, char * * endString, int base)", _strtoi64, module, 2);
16058 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("_strtoui64", "uint64 _strtoui64(char * string, char * * endString, int base)", _strtoui64, module, 2);
16059 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessTemplateParameterType", "Type ProcessTemplateParameterType(TemplateParameter param)", ProcessTemplateParameterType, module, 2);
16060 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("NeedCast", "bool NeedCast(Type type1, Type type2)", NeedCast, module, 2);
16061 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintInt", "char * PrintInt(int64 result)", PrintInt, module, 1);
16062 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUInt", "char * PrintUInt(uint64 result)", PrintUInt, module, 1);
16063 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintInt64", "char * PrintInt64(int64 result)", PrintInt64, module, 1);
16064 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUInt64", "char * PrintUInt64(uint64 result)", PrintUInt64, module, 1);
16065 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintHexUInt", "char * PrintHexUInt(uint64 result)", PrintHexUInt, module, 1);
16066 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintHexUInt64", "char * PrintHexUInt64(uint64 result)", PrintHexUInt64, module, 1);
16067 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintShort", "char * PrintShort(short result)", PrintShort, module, 1);
16068 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUShort", "char * PrintUShort(uint16 result)", PrintUShort, module, 1);
16069 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintChar", "char * PrintChar(char result)", PrintChar, module, 1);
16070 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUChar", "char * PrintUChar(byte result)", PrintUChar, module, 1);
16071 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintFloat", "char * PrintFloat(float result)", PrintFloat, module, 1);
16072 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintDouble", "char * PrintDouble(double result)", PrintDouble, module, 1);
16073 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetInt", "bool GetInt(Expression exp, int * value2)", GetInt, module, 1);
16074 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUInt", "bool GetUInt(Expression exp, uint * value2)", GetUInt, module, 1);
16075 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetInt64", "bool GetInt64(Expression exp, int64 * value2)", GetInt64, module, 1);
16076 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUInt64", "bool GetUInt64(Expression exp, uint64 * value2)", GetUInt64, module, 1);
16077 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetShort", "bool GetShort(Expression exp, short * value2)", GetShort, module, 1);
16078 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUShort", "bool GetUShort(Expression exp, uint16 * value2)", GetUShort, module, 1);
16079 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetChar", "bool GetChar(Expression exp, char * value2)", GetChar, module, 1);
16080 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUChar", "bool GetUChar(Expression exp, byte * value2)", GetUChar, module, 1);
16081 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetFloat", "bool GetFloat(Expression exp, float * value2)", GetFloat, module, 1);
16082 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetDouble", "bool GetDouble(Expression exp, double * value2)", GetDouble, module, 1);
16083 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeClassMembers", "void ComputeClassMembers(ecere::com::Class _class, bool isMember)", ComputeClassMembers, module, 2);
16084 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeModuleClasses", "void ComputeModuleClasses(ecere::com::Module module)", ComputeModuleClasses, module, 1);
16085 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeTypeSize", "int ComputeTypeSize(Type type)", ComputeTypeSize, module, 1);
16086 __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);
16087 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareStruct", "void DeclareStruct(char * name, bool skipNoHead)", DeclareStruct, module, 2);
16088 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareProperty", "void DeclareProperty(ecere::com::Property prop, char * setName, char * getName)", DeclareProperty, module, 2);
16089 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("Dereference", "Type Dereference(Type source)", Dereference, module, 1);
16090 __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);
16091 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessInstantiationType", "void ProcessInstantiationType(Instantiation inst)", ProcessInstantiationType, module, 2);
16092 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindTemplateArg", "ecere::com::ClassTemplateArgument * FindTemplateArg(ecere::com::Class _class, TemplateParameter param)", FindTemplateArg, module, 2);
16093 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetupTemplatesContext", "Context SetupTemplatesContext(ecere::com::Class _class)", SetupTemplatesContext, module, 1);
16094 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FinishTemplatesContext", "void FinishTemplatesContext(Context context)", FinishTemplatesContext, module, 1);
16095 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessMethodType", "void ProcessMethodType(ecere::com::Method method)", ProcessMethodType, module, 1);
16096 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessPropertyType", "void ProcessPropertyType(ecere::com::Property prop)", ProcessPropertyType, module, 1);
16097 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareMethod", "void DeclareMethod(ecere::com::Method method, char * name)", DeclareMethod, module, 1);
16098 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClass", "char * ReplaceThisClass(ecere::com::Class _class)", ReplaceThisClass, module, 2);
16099 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClassType", "Type ReplaceThisClassType(ecere::com::Class _class)", ReplaceThisClassType, module, 2);
16100 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClassSpecifiers", "void ReplaceThisClassSpecifiers(ecere::sys::OldList specs, ecere::com::Class _class)", ReplaceThisClassSpecifiers, module, 2);
16101 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareFunction", "bool DeclareFunction(ecere::com::GlobalFunction function, char * name)", DeclareFunction, module, 2);
16102 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareGlobalData", "void DeclareGlobalData(GlobalData data)", DeclareGlobalData, module, 2);
16103 class = __ecereNameSpace__ecere__com__eSystem_RegisterClass(5, "Conversion", 0, sizeof(struct Conversion), 0, 0, 0, module, 2, 1);
16104 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + 12)))->application == ((struct __ecereNameSpace__ecere__com__Module *)(((char *)__thisModule + 12)))->application && class)
16105 __ecereClass_Conversion = class;
16106 __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);
16107 __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);
16108 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ModuleVisibility", "bool ModuleVisibility(ecere::com::Module searchIn, ecere::com::Module searchFor)", ModuleVisibility, module, 1);
16109 __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);
16110 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("MatchTypeExpression", "bool MatchTypeExpression(Expression sourceExp, Type dest, ecere::sys::OldList conversions, bool skipUnitBla)", MatchTypeExpression, module, 2);
16111 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReadString", "void ReadString(char * output, char * string)", ReadString, module, 1);
16112 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOperand", "Operand GetOperand(Expression exp)", GetOperand, module, 1);
16113 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PopulateInstance", "void PopulateInstance(Instantiation inst)", PopulateInstance, module, 1);
16114 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeInstantiation", "void ComputeInstantiation(Expression exp)", ComputeInstantiation, module, 1);
16115 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CallOperator", "void CallOperator(Expression exp, Expression exp1, Expression exp2, Operand op1, Operand op2)", CallOperator, module, 1);
16116 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeExpression", "void ComputeExpression(Expression exp)", ComputeExpression, module, 1);
16117 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CheckTemplateTypes", "void CheckTemplateTypes(Expression exp)", CheckTemplateTypes, module, 1);
16118 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindSymbol", "Symbol FindSymbol(char * name, Context startContext, Context endContext, bool isStruct, bool globalNameSpace)", FindSymbol, module, 1);
16119 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintType", "void PrintType(Type type, char * string, bool printName, bool fullName)", PrintType, module, 1);
16120 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindMemberAndOffset", "Type FindMemberAndOffset(Type type, char * string, uint * offset)", FindMemberAndOffset, module, 1);
16121 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ParseExpressionString", "Expression ParseExpressionString(char * expression)", ParseExpressionString, module, 1);
16122 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceExpContents", "void ReplaceExpContents(Expression checkedExp, Expression newExp)", ReplaceExpContents, module, 1);
16123 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ApplyAnyObjectLogic", "void ApplyAnyObjectLogic(Expression e)", ApplyAnyObjectLogic, module, 1);
16124 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessExpressionType", "void ProcessExpressionType(Expression exp)", ProcessExpressionType, module, 1);
16125 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeDataTypes", "void ComputeDataTypes(void)", ComputeDataTypes, module, 1);
16126 }
16127
16128 void __ecereUnregisterModule_pass15(struct __ecereNameSpace__ecere__com__Instance * module)
16129 {
16130
16131 }
16132