compiler/bootstrap: Updated bootstrap
[sdk] / compiler / bootstrap / libec / bootstrap / pass15.c
1 #if defined(__GNUC__)
2 typedef long long int64;
3 typedef unsigned long long uint64;
4 #elif defined(__TINYC__)
5 #include <stdarg.h>
6 #define __builtin_va_list va_list
7 #define __builtin_va_start va_start
8 #define __builtin_va_end va_end
9 #ifdef _WIN32
10 #define strcasecmp stricmp
11 #define strncasecmp strnicmp
12 #define __declspec(x) __attribute__((x))
13 #endif
14 typedef long long int64;
15 typedef unsigned long long uint64;
16 #else
17 typedef __int64 int64;
18 typedef unsigned __int64 uint64;
19 #endif
20 #ifdef __BIG_ENDIAN__
21 #define __ENDIAN_PAD(x) (8 - (x))
22 #else
23 #define __ENDIAN_PAD(x) 0
24 #endif
25 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 if(endString)
1232 *endString = string + c;
1233 break;
1234 }
1235 if(ch < base)
1236 {
1237 value *= base;
1238 value += ch;
1239 }
1240 else
1241 {
1242 if(endString)
1243 *endString = string + c;
1244 break;
1245 }
1246 }
1247 return sign * value;
1248 }
1249
1250 uint64 _strtoui64(char * string, char ** endString, int base)
1251 {
1252 uint64 value = 0;
1253 int sign = 1;
1254 int c;
1255 char ch;
1256
1257 for(c = 0; (ch = string[c]) && isspace(ch); c++)
1258 ;
1259 if(ch == '+')
1260 c++;
1261 else if(ch == '-')
1262 {
1263 sign = -1;
1264 c++;
1265 }
1266 ;
1267 if(!base)
1268 {
1269 if(ch == (char)0 && string[c + 1] == 'x')
1270 {
1271 base = 16;
1272 c += 2;
1273 }
1274 else if(ch == '0')
1275 {
1276 base = 8;
1277 c++;
1278 }
1279 else
1280 base = 10;
1281 }
1282 for(; (ch = string[c]); c++)
1283 {
1284 if(ch == '0')
1285 ch = (char)0;
1286 else if(ch >= '1' && ch <= '9')
1287 ch -= '1';
1288 else if(ch >= 'a' && ch <= 'z')
1289 ch -= 'a';
1290 else if(ch >= 'A' && ch <= 'Z')
1291 ch -= 'A';
1292 else
1293 {
1294 if(endString)
1295 *endString = string + c;
1296 break;
1297 }
1298 if(ch < base)
1299 {
1300 value *= base;
1301 value += ch;
1302 }
1303 else
1304 {
1305 if(endString)
1306 *endString = string + c;
1307 break;
1308 }
1309 }
1310 return sign * value;
1311 }
1312
1313 extern struct Type * ProcessTypeString(char *  string, unsigned int staticMethod);
1314
1315 extern struct Type * ProcessType(struct __ecereNameSpace__ecere__sys__OldList * specs, struct Declarator * decl);
1316
1317 struct Type * ProcessTemplateParameterType(struct TemplateParameter * param)
1318 {
1319 if(param && param->type == 0 && (param->dataType || param->dataTypeString))
1320 {
1321 if(!param->baseType)
1322 {
1323 if(param->dataTypeString)
1324 param->baseType = ProcessTypeString(param->dataTypeString, 0x0);
1325 else
1326 param->baseType = ProcessType(param->dataType->specifiers, param->dataType->decl);
1327 }
1328 return param->baseType;
1329 }
1330 return (((void *)0));
1331 }
1332
1333 unsigned int NeedCast(struct Type * type1, struct Type * type2)
1334 {
1335 if(!type1 || !type2 || type1->keepCast || type2->keepCast)
1336 return 0x1;
1337 if(type1->kind == 20 && type2->kind == 4 && type2->passAsTemplate == 0x0)
1338 {
1339 return 0x0;
1340 }
1341 if(type1->kind == type2->kind)
1342 {
1343 switch(type1->kind)
1344 {
1345 case 1:
1346 case 2:
1347 case 3:
1348 case 4:
1349 if(type1->passAsTemplate && !type2->passAsTemplate)
1350 return 0x1;
1351 return type1->isSigned != type2->isSigned;
1352 case 8:
1353 return type1->_class != type2->_class;
1354 case 13:
1355 return NeedCast(type1->type, type2->type);
1356 default:
1357 return 0x1;
1358 }
1359 }
1360 return 0x1;
1361 }
1362
1363 extern int strcmp(const char * , const char * );
1364
1365 extern struct Context * curContext;
1366
1367 extern struct Context * topContext;
1368
1369 extern unsigned int __ecereNameSpace__ecere__com__eClass_IsDerived(struct __ecereNameSpace__ecere__com__Class * _class, struct __ecereNameSpace__ecere__com__Class * from);
1370
1371 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);
1372
1373 extern struct __ecereNameSpace__ecere__com__Instance * privateModule;
1374
1375 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);
1376
1377 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);
1378
1379 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__ClassProperty;
1380
1381 struct __ecereNameSpace__ecere__com__ClassProperty
1382 {
1383 char *  name;
1384 struct __ecereNameSpace__ecere__com__ClassProperty * parent;
1385 struct __ecereNameSpace__ecere__com__ClassProperty * left;
1386 struct __ecereNameSpace__ecere__com__ClassProperty * right;
1387 int depth;
1388 void (*  Set)(struct __ecereNameSpace__ecere__com__Class *, int);
1389 int (*  Get)(struct __ecereNameSpace__ecere__com__Class *);
1390 char *  dataTypeString;
1391 struct Type * dataType;
1392 unsigned int constant;
1393 };
1394
1395 extern struct __ecereNameSpace__ecere__com__ClassProperty * __ecereNameSpace__ecere__com__eClass_FindClassProperty(struct __ecereNameSpace__ecere__com__Class * _class, char *  name);
1396
1397 extern struct Expression * QMkExpId(char *  id);
1398
1399 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__ClassTemplateParameter;
1400
1401 struct __ecereNameSpace__ecere__com__ClassTemplateParameter
1402 {
1403 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * prev;
1404 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * next;
1405 char *  name;
1406 int type;
1407 union
1408 {
1409 char *  dataTypeString;
1410 int memberType;
1411 };
1412 struct __ecereNameSpace__ecere__com__ClassTemplateArgument defaultArg;
1413 void *  param;
1414 char __ecere_padding[4];
1415 };
1416
1417 extern struct Expression * GetTemplateArgExpByName(char *  paramName, struct __ecereNameSpace__ecere__com__Class * curClass, int tplType);
1418
1419 extern struct __ecereNameSpace__ecere__sys__OldList *  MkList(void);
1420
1421 extern void FreeIdentifier(struct Identifier * id);
1422
1423 void ProcessExpressionType(struct Expression * exp);
1424
1425 extern struct Declarator * SpecDeclFromString(char *  string, struct __ecereNameSpace__ecere__sys__OldList *  specs, struct Declarator * baseDecl);
1426
1427 extern struct __ecereNameSpace__ecere__sys__OldList *  MkListOne(void *  item);
1428
1429 extern struct Expression * MkExpOp(struct Expression * exp1, int op, struct Expression * exp2);
1430
1431 extern struct Expression * MkExpCast(struct TypeName * typeName, struct Expression * expression);
1432
1433 extern struct TypeName * MkTypeName(struct __ecereNameSpace__ecere__sys__OldList * qualifiers, struct Declarator * declarator);
1434
1435 extern struct Declarator * MkDeclaratorPointer(struct Pointer * pointer, struct Declarator * declarator);
1436
1437 extern struct Pointer * MkPointer(struct __ecereNameSpace__ecere__sys__OldList * qualifiers, struct Pointer * pointer);
1438
1439 struct __ecereNameSpace__ecere__sys__BTNode * __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(struct __ecereNameSpace__ecere__sys__BinaryTree * this, char *  key);
1440
1441 static void ReplaceClassMembers(struct Expression * exp, struct __ecereNameSpace__ecere__com__Class * _class)
1442 {
1443 if(exp->type == 0 && exp->identifier)
1444 {
1445 struct Identifier * id = exp->identifier;
1446 struct Context * ctx;
1447 struct Symbol * symbol = (((void *)0));
1448
1449 if(!id->_class || !id->_class->name || strcmp(id->_class->name, "property"))
1450 {
1451 for(ctx = curContext; ctx != topContext->parent && !symbol; ctx = ctx->parent)
1452 {
1453 symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(&ctx->symbols, id->string);
1454 if(symbol)
1455 break;
1456 }
1457 }
1458 if(!symbol && ((!id->_class || (id->_class->name && !strcmp(id->_class->name, "property"))) || (id->classSym && __ecereNameSpace__ecere__com__eClass_IsDerived(_class, id->classSym->registered))))
1459 {
1460 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
1461 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
1462 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
1463 struct __ecereNameSpace__ecere__com__ClassProperty * classProp;
1464
1465 if(!prop)
1466 {
1467 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule);
1468 }
1469 if(!prop && !method)
1470 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
1471 if(!prop && !method && !member)
1472 {
1473 classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(_class, id->string);
1474 }
1475 if(prop || method || member || classProp)
1476 {
1477 exp->type = 8;
1478 exp->member.member = id;
1479 exp->member.memberType = 0;
1480 exp->member.exp = QMkExpId("this");
1481 exp->addedThis = 0x1;
1482 }
1483 else if(_class && _class->templateParams.first)
1484 {
1485 struct __ecereNameSpace__ecere__com__Class * sClass;
1486
1487 for(sClass = _class; sClass; sClass = sClass->base)
1488 {
1489 if(sClass->templateParams.first)
1490 {
1491 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
1492
1493 for(param = sClass->templateParams.first; param; param = param->next)
1494 {
1495 if(param->type == 2 && !strcmp(param->name, id->string))
1496 {
1497 struct Expression * argExp = GetTemplateArgExpByName(param->name, _class, 2);
1498
1499 if(argExp)
1500 {
1501 struct Declarator * decl;
1502 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
1503
1504 FreeIdentifier(exp->member.member);
1505 ProcessExpressionType(argExp);
1506 decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
1507 exp->expType = ProcessType(specs, decl);
1508 exp->type = 5;
1509 exp->list = MkListOne(MkExpOp((((void *)0)), '*', MkExpCast(MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl)), MkExpOp((((void *)0)), '&', argExp))));
1510 }
1511 }
1512 }
1513 }
1514 }
1515 }
1516 }
1517 }
1518 }
1519
1520 extern int sprintf(char * , char * , ...);
1521
1522 extern int __ecereNameSpace__ecere__com__GetRuntimePlatform(void);
1523
1524 extern char *  __ecereNameSpace__ecere__sys__CopyString(char *  string);
1525
1526 char * PrintInt(long long result)
1527 {
1528 char temp[100];
1529
1530 if(result > (((long long)0x7fffffffffffffffLL)))
1531 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1532 else
1533 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "%I64dLL" : "%lldLL"), result);
1534 return __ecereNameSpace__ecere__sys__CopyString(temp);
1535 }
1536
1537 char * PrintUInt(uint64 result)
1538 {
1539 char temp[100];
1540
1541 if(result > (0xffffffff))
1542 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1543 else if(result > (((int)0x7fffffff)))
1544 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64X" : "0x%llX"), result);
1545 else
1546 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "%I64d" : "%lld"), result);
1547 return __ecereNameSpace__ecere__sys__CopyString(temp);
1548 }
1549
1550 char * PrintInt64(long long result)
1551 {
1552 char temp[100];
1553
1554 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "%I64dLL" : "%lldLL"), result);
1555 return __ecereNameSpace__ecere__sys__CopyString(temp);
1556 }
1557
1558 char * PrintUInt64(uint64 result)
1559 {
1560 char temp[100];
1561
1562 if(result > (((long long)0x7fffffffffffffffLL)))
1563 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1564 else
1565 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "%I64dLL" : "%lldLL"), result);
1566 return __ecereNameSpace__ecere__sys__CopyString(temp);
1567 }
1568
1569 char * PrintHexUInt(uint64 result)
1570 {
1571 char temp[100];
1572
1573 if(result > (0xffffffff))
1574 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1575 else
1576 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64X" : "0x%llX"), result);
1577 return __ecereNameSpace__ecere__sys__CopyString(temp);
1578 }
1579
1580 char * PrintHexUInt64(uint64 result)
1581 {
1582 char temp[100];
1583
1584 if(result > (0xffffffff))
1585 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1586 else
1587 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64X" : "0x%llX"), result);
1588 return __ecereNameSpace__ecere__sys__CopyString(temp);
1589 }
1590
1591 char * PrintShort(short result)
1592 {
1593 char temp[100];
1594
1595 sprintf(temp, "%d", (unsigned short)result);
1596 return __ecereNameSpace__ecere__sys__CopyString(temp);
1597 }
1598
1599 char * PrintUShort(unsigned short result)
1600 {
1601 char temp[100];
1602
1603 if(result > (unsigned short)32767)
1604 sprintf(temp, "0x%X", (int)result);
1605 else
1606 sprintf(temp, "%d", result);
1607 return __ecereNameSpace__ecere__sys__CopyString(temp);
1608 }
1609
1610 extern int isprint(int c);
1611
1612 char * PrintChar(char result)
1613 {
1614 char temp[100];
1615
1616 if(result > (char)0 && isprint(result))
1617 sprintf(temp, "'%c'", result);
1618 else if(result < (char)0)
1619 sprintf(temp, "%d", result);
1620 else
1621 sprintf(temp, "0x%X", (unsigned char)result);
1622 return __ecereNameSpace__ecere__sys__CopyString(temp);
1623 }
1624
1625 char * PrintUChar(unsigned char result)
1626 {
1627 char temp[100];
1628
1629 sprintf(temp, "0x%X", result);
1630 return __ecereNameSpace__ecere__sys__CopyString(temp);
1631 }
1632
1633 char * PrintFloat(float result)
1634 {
1635 char temp[350];
1636
1637 sprintf(temp, "%.16ff", result);
1638 return __ecereNameSpace__ecere__sys__CopyString(temp);
1639 }
1640
1641 char * PrintDouble(double result)
1642 {
1643 char temp[350];
1644
1645 sprintf(temp, "%.16f", result);
1646 return __ecereNameSpace__ecere__sys__CopyString(temp);
1647 }
1648
1649 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_OpTable;
1650
1651 struct OpTable
1652 {
1653 unsigned int (*  Add)(struct Expression *, struct Operand *, struct Operand *);
1654 unsigned int (*  Sub)(struct Expression *, struct Operand *, struct Operand *);
1655 unsigned int (*  Mul)(struct Expression *, struct Operand *, struct Operand *);
1656 unsigned int (*  Div)(struct Expression *, struct Operand *, struct Operand *);
1657 unsigned int (*  Mod)(struct Expression *, struct Operand *, struct Operand *);
1658 unsigned int (*  Neg)(struct Expression *, struct Operand *);
1659 unsigned int (*  Inc)(struct Expression *, struct Operand *);
1660 unsigned int (*  Dec)(struct Expression *, struct Operand *);
1661 unsigned int (*  Asign)(struct Expression *, struct Operand *, struct Operand *);
1662 unsigned int (*  AddAsign)(struct Expression *, struct Operand *, struct Operand *);
1663 unsigned int (*  SubAsign)(struct Expression *, struct Operand *, struct Operand *);
1664 unsigned int (*  MulAsign)(struct Expression *, struct Operand *, struct Operand *);
1665 unsigned int (*  DivAsign)(struct Expression *, struct Operand *, struct Operand *);
1666 unsigned int (*  ModAsign)(struct Expression *, struct Operand *, struct Operand *);
1667 unsigned int (*  BitAnd)(struct Expression *, struct Operand *, struct Operand *);
1668 unsigned int (*  BitOr)(struct Expression *, struct Operand *, struct Operand *);
1669 unsigned int (*  BitXor)(struct Expression *, struct Operand *, struct Operand *);
1670 unsigned int (*  LShift)(struct Expression *, struct Operand *, struct Operand *);
1671 unsigned int (*  RShift)(struct Expression *, struct Operand *, struct Operand *);
1672 unsigned int (*  BitNot)(struct Expression *, struct Operand *);
1673 unsigned int (*  AndAsign)(struct Expression *, struct Operand *, struct Operand *);
1674 unsigned int (*  OrAsign)(struct Expression *, struct Operand *, struct Operand *);
1675 unsigned int (*  XorAsign)(struct Expression *, struct Operand *, struct Operand *);
1676 unsigned int (*  LShiftAsign)(struct Expression *, struct Operand *, struct Operand *);
1677 unsigned int (*  RShiftAsign)(struct Expression *, struct Operand *, struct Operand *);
1678 unsigned int (*  Not)(struct Expression *, struct Operand *);
1679 unsigned int (*  Equ)(struct Expression *, struct Operand *, struct Operand *);
1680 unsigned int (*  Nqu)(struct Expression *, struct Operand *, struct Operand *);
1681 unsigned int (*  And)(struct Expression *, struct Operand *, struct Operand *);
1682 unsigned int (*  Or)(struct Expression *, struct Operand *, struct Operand *);
1683 unsigned int (*  Grt)(struct Expression *, struct Operand *, struct Operand *);
1684 unsigned int (*  Sma)(struct Expression *, struct Operand *, struct Operand *);
1685 unsigned int (*  GrtEqu)(struct Expression *, struct Operand *, struct Operand *);
1686 unsigned int (*  SmaEqu)(struct Expression *, struct Operand *, struct Operand *);
1687 unsigned int (*  Cond)(struct Expression *, struct Operand *, struct Operand *, struct Operand *);
1688 };
1689
1690 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Operand;
1691
1692 struct Operand
1693 {
1694 int kind;
1695 struct Type * type;
1696 unsigned int ptrSize;
1697 union
1698 {
1699 char c;
1700 unsigned char uc;
1701 short s;
1702 unsigned short us;
1703 int i;
1704 unsigned int ui;
1705 float f;
1706 double d;
1707 unsigned char *  p;
1708 long long i64;
1709 uint64 ui64;
1710 };
1711 struct OpTable ops;
1712 };
1713
1714 struct Operand GetOperand(struct Expression * exp);
1715
1716 unsigned int GetInt(struct Expression * exp, int * value2)
1717 {
1718 struct Operand op2 = GetOperand(exp);
1719
1720 if(op2.kind == 3 && op2.type->isSigned)
1721 *value2 = op2.i;
1722 else if(op2.kind == 3)
1723 *value2 = (int)op2.ui;
1724 if(op2.kind == 4 && op2.type->isSigned)
1725 *value2 = (int)op2.i64;
1726 else if(op2.kind == 4)
1727 *value2 = (int)op2.ui64;
1728 else if(op2.kind == 2 && op2.type->isSigned)
1729 *value2 = (int)op2.s;
1730 else if(op2.kind == 2)
1731 *value2 = (int)op2.us;
1732 else if(op2.kind == 1 && op2.type->isSigned)
1733 *value2 = (int)op2.c;
1734 else if(op2.kind == 1)
1735 *value2 = (int)op2.uc;
1736 else if(op2.kind == 6)
1737 *value2 = (int)op2.f;
1738 else if(op2.kind == 7)
1739 *value2 = (int)op2.d;
1740 else if(op2.kind == 13)
1741 *value2 = (int)op2.ui;
1742 else
1743 return 0x0;
1744 return 0x1;
1745 }
1746
1747 unsigned int GetUInt(struct Expression * exp, unsigned int * value2)
1748 {
1749 struct Operand op2 = GetOperand(exp);
1750
1751 if(op2.kind == 3 && op2.type->isSigned)
1752 *value2 = (unsigned int)op2.i;
1753 else if(op2.kind == 3)
1754 *value2 = op2.ui;
1755 if(op2.kind == 4 && op2.type->isSigned)
1756 *value2 = (unsigned int)op2.i64;
1757 else if(op2.kind == 4)
1758 *value2 = (unsigned int)op2.ui64;
1759 else if(op2.kind == 2 && op2.type->isSigned)
1760 *value2 = (unsigned int)op2.s;
1761 else if(op2.kind == 2)
1762 *value2 = (unsigned int)op2.us;
1763 else if(op2.kind == 1 && op2.type->isSigned)
1764 *value2 = (unsigned int)op2.c;
1765 else if(op2.kind == 1)
1766 *value2 = (unsigned int)op2.uc;
1767 else if(op2.kind == 6)
1768 *value2 = (unsigned int)op2.f;
1769 else if(op2.kind == 7)
1770 *value2 = (unsigned int)op2.d;
1771 else if(op2.kind == 13)
1772 *value2 = op2.ui;
1773 else
1774 return 0x0;
1775 return 0x1;
1776 }
1777
1778 unsigned int GetInt64(struct Expression * exp, long long * value2)
1779 {
1780 struct Operand op2 = GetOperand(exp);
1781
1782 if(op2.kind == 3 && op2.type->isSigned)
1783 *value2 = (long long)op2.i;
1784 else if(op2.kind == 3)
1785 *value2 = (long long)op2.ui;
1786 if(op2.kind == 4 && op2.type->isSigned)
1787 *value2 = op2.i64;
1788 else if(op2.kind == 4)
1789 *value2 = (long long)op2.ui64;
1790 else if(op2.kind == 2 && op2.type->isSigned)
1791 *value2 = (long long)op2.s;
1792 else if(op2.kind == 2)
1793 *value2 = (long long)op2.us;
1794 else if(op2.kind == 1 && op2.type->isSigned)
1795 *value2 = (long long)op2.c;
1796 else if(op2.kind == 1)
1797 *value2 = (long long)op2.uc;
1798 else if(op2.kind == 6)
1799 *value2 = (long long)op2.f;
1800 else if(op2.kind == 7)
1801 *value2 = (long long)op2.d;
1802 else if(op2.kind == 13)
1803 *value2 = (long long)op2.ui;
1804 else
1805 return 0x0;
1806 return 0x1;
1807 }
1808
1809 unsigned int GetUInt64(struct Expression * exp, uint64 * value2)
1810 {
1811 struct Operand op2 = GetOperand(exp);
1812
1813 if(op2.kind == 3 && op2.type->isSigned)
1814 *value2 = (uint64)op2.i;
1815 else if(op2.kind == 3)
1816 *value2 = (uint64)op2.ui;
1817 if(op2.kind == 4 && op2.type->isSigned)
1818 *value2 = (uint64)op2.i64;
1819 else if(op2.kind == 4)
1820 *value2 = op2.ui64;
1821 else if(op2.kind == 2 && op2.type->isSigned)
1822 *value2 = (uint64)op2.s;
1823 else if(op2.kind == 2)
1824 *value2 = (uint64)op2.us;
1825 else if(op2.kind == 1 && op2.type->isSigned)
1826 *value2 = (uint64)op2.c;
1827 else if(op2.kind == 1)
1828 *value2 = (uint64)op2.uc;
1829 else if(op2.kind == 6)
1830 *value2 = (uint64)op2.f;
1831 else if(op2.kind == 7)
1832 *value2 = (uint64)op2.d;
1833 else if(op2.kind == 13)
1834 *value2 = (uint64)op2.ui;
1835 else
1836 return 0x0;
1837 return 0x1;
1838 }
1839
1840 unsigned int GetShort(struct Expression * exp, short * value2)
1841 {
1842 struct Operand op2 = GetOperand(exp);
1843
1844 if(op2.kind == 3 && op2.type->isSigned)
1845 *value2 = (short)op2.i;
1846 else if(op2.kind == 3)
1847 *value2 = (short)op2.ui;
1848 if(op2.kind == 4 && op2.type->isSigned)
1849 *value2 = (short)op2.i64;
1850 else if(op2.kind == 4)
1851 *value2 = (short)op2.ui64;
1852 else if(op2.kind == 2 && op2.type->isSigned)
1853 *value2 = op2.s;
1854 else if(op2.kind == 2)
1855 *value2 = (short)op2.us;
1856 else if(op2.kind == 1 && op2.type->isSigned)
1857 *value2 = (short)op2.c;
1858 else if(op2.kind == 1)
1859 *value2 = (short)op2.uc;
1860 else if(op2.kind == 6)
1861 *value2 = (short)op2.f;
1862 else if(op2.kind == 7)
1863 *value2 = (short)op2.d;
1864 else if(op2.kind == 13)
1865 *value2 = (short)op2.ui;
1866 else
1867 return 0x0;
1868 return 0x1;
1869 }
1870
1871 unsigned int GetUShort(struct Expression * exp, unsigned short * value2)
1872 {
1873 struct Operand op2 = GetOperand(exp);
1874
1875 if(op2.kind == 3 && op2.type->isSigned)
1876 *value2 = (unsigned short)op2.i;
1877 else if(op2.kind == 3)
1878 *value2 = (unsigned short)op2.ui;
1879 if(op2.kind == 4 && op2.type->isSigned)
1880 *value2 = (unsigned short)op2.i64;
1881 else if(op2.kind == 4)
1882 *value2 = (unsigned short)op2.ui64;
1883 else if(op2.kind == 2 && op2.type->isSigned)
1884 *value2 = (unsigned short)op2.s;
1885 else if(op2.kind == 2)
1886 *value2 = op2.us;
1887 else if(op2.kind == 1 && op2.type->isSigned)
1888 *value2 = (unsigned short)op2.c;
1889 else if(op2.kind == 1)
1890 *value2 = (unsigned short)op2.uc;
1891 else if(op2.kind == 6)
1892 *value2 = (unsigned short)op2.f;
1893 else if(op2.kind == 7)
1894 *value2 = (unsigned short)op2.d;
1895 else if(op2.kind == 13)
1896 *value2 = (unsigned short)op2.ui;
1897 else
1898 return 0x0;
1899 return 0x1;
1900 }
1901
1902 unsigned int GetChar(struct Expression * exp, char * value2)
1903 {
1904 struct Operand op2 = GetOperand(exp);
1905
1906 if(op2.kind == 3 && op2.type->isSigned)
1907 *value2 = (char)op2.i;
1908 else if(op2.kind == 3)
1909 *value2 = (char)op2.ui;
1910 if(op2.kind == 4 && op2.type->isSigned)
1911 *value2 = (char)op2.i64;
1912 else if(op2.kind == 4)
1913 *value2 = (char)op2.ui64;
1914 else if(op2.kind == 2 && op2.type->isSigned)
1915 *value2 = (char)op2.s;
1916 else if(op2.kind == 2)
1917 *value2 = (char)op2.us;
1918 else if(op2.kind == 1 && op2.type->isSigned)
1919 *value2 = op2.c;
1920 else if(op2.kind == 1)
1921 *value2 = (char)op2.uc;
1922 else if(op2.kind == 6)
1923 *value2 = (char)op2.f;
1924 else if(op2.kind == 7)
1925 *value2 = (char)op2.d;
1926 else if(op2.kind == 13)
1927 *value2 = (char)op2.ui;
1928 else
1929 return 0x0;
1930 return 0x1;
1931 }
1932
1933 unsigned int GetUChar(struct Expression * exp, unsigned char * value2)
1934 {
1935 struct Operand op2 = GetOperand(exp);
1936
1937 if(op2.kind == 3 && op2.type->isSigned)
1938 *value2 = (unsigned char)op2.i;
1939 else if(op2.kind == 3)
1940 *value2 = (unsigned char)op2.ui;
1941 if(op2.kind == 4 && op2.type->isSigned)
1942 *value2 = (unsigned char)op2.i64;
1943 else if(op2.kind == 4)
1944 *value2 = (unsigned char)op2.ui64;
1945 else if(op2.kind == 2 && op2.type->isSigned)
1946 *value2 = (unsigned char)op2.s;
1947 else if(op2.kind == 2)
1948 *value2 = (unsigned char)op2.us;
1949 else if(op2.kind == 1 && op2.type->isSigned)
1950 *value2 = (unsigned char)op2.c;
1951 else if(op2.kind == 1)
1952 *value2 = op2.uc;
1953 else if(op2.kind == 6)
1954 *value2 = (unsigned char)op2.f;
1955 else if(op2.kind == 7)
1956 *value2 = (unsigned char)op2.d;
1957 else if(op2.kind == 13)
1958 *value2 = (unsigned char)op2.ui;
1959 else
1960 return 0x0;
1961 return 0x1;
1962 }
1963
1964 unsigned int GetFloat(struct Expression * exp, float * value2)
1965 {
1966 struct Operand op2 = GetOperand(exp);
1967
1968 if(op2.kind == 3 && op2.type->isSigned)
1969 *value2 = (float)(float)op2.i;
1970 else if(op2.kind == 3)
1971 *value2 = (float)(float)op2.ui;
1972 if(op2.kind == 4 && op2.type->isSigned)
1973 *value2 = (float)(float)op2.i64;
1974 else if(op2.kind == 4)
1975 *value2 = (float)(float)op2.ui64;
1976 else if(op2.kind == 2 && op2.type->isSigned)
1977 *value2 = (float)(float)op2.s;
1978 else if(op2.kind == 2)
1979 *value2 = (float)(float)op2.us;
1980 else if(op2.kind == 1 && op2.type->isSigned)
1981 *value2 = (float)(float)op2.c;
1982 else if(op2.kind == 1)
1983 *value2 = (float)(float)op2.uc;
1984 else if(op2.kind == 6)
1985 *value2 = (float)op2.f;
1986 else if(op2.kind == 7)
1987 *value2 = (float)op2.d;
1988 else if(op2.kind == 13)
1989 *value2 = (float)(float)op2.ui;
1990 else
1991 return 0x0;
1992 return 0x1;
1993 }
1994
1995 unsigned int GetDouble(struct Expression * exp, double * value2)
1996 {
1997 struct Operand op2 = GetOperand(exp);
1998
1999 if(op2.kind == 3 && op2.type->isSigned)
2000 *value2 = (double)(double)op2.i;
2001 else if(op2.kind == 3)
2002 *value2 = (double)(double)op2.ui;
2003 if(op2.kind == 4 && op2.type->isSigned)
2004 *value2 = (double)(double)op2.i64;
2005 else if(op2.kind == 4)
2006 *value2 = (double)(double)op2.ui64;
2007 else if(op2.kind == 2 && op2.type->isSigned)
2008 *value2 = (double)(double)op2.s;
2009 else if(op2.kind == 2)
2010 *value2 = (double)(double)op2.us;
2011 else if(op2.kind == 1 && op2.type->isSigned)
2012 *value2 = (double)(double)op2.c;
2013 else if(op2.kind == 1)
2014 *value2 = (double)(double)op2.uc;
2015 else if(op2.kind == 6)
2016 *value2 = (double)op2.f;
2017 else if(op2.kind == 7)
2018 *value2 = (double)op2.d;
2019 else if(op2.kind == 13)
2020 *value2 = (double)(double)op2.ui;
2021 else
2022 return 0x0;
2023 return 0x1;
2024 }
2025
2026 void ComputeExpression(struct Expression * exp);
2027
2028 struct Context * SetupTemplatesContext(struct __ecereNameSpace__ecere__com__Class * _class);
2029
2030 int ComputeTypeSize(struct Type * type);
2031
2032 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__BitMember;
2033
2034 struct __ecereNameSpace__ecere__com__BitMember
2035 {
2036 struct __ecereNameSpace__ecere__com__BitMember * prev;
2037 struct __ecereNameSpace__ecere__com__BitMember * next;
2038 char *  name;
2039 unsigned int isProperty;
2040 int memberAccess;
2041 int id;
2042 struct __ecereNameSpace__ecere__com__Class * _class;
2043 char *  dataTypeString;
2044 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
2045 struct Type * dataType;
2046 int type;
2047 int size;
2048 int pos;
2049 uint64 mask;
2050 };
2051
2052 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__OldLink;
2053
2054 struct __ecereNameSpace__ecere__sys__OldLink
2055 {
2056 struct __ecereNameSpace__ecere__sys__OldLink * prev;
2057 struct __ecereNameSpace__ecere__sys__OldLink * next;
2058 void *  data;
2059 };
2060
2061 void FinishTemplatesContext(struct Context * context);
2062
2063 void ComputeClassMembers(struct __ecereNameSpace__ecere__com__Class * _class, unsigned int isMember)
2064 {
2065 struct __ecereNameSpace__ecere__com__DataMember * member = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
2066 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
2067
2068 if(member || ((_class->type == 2 || _class->type == 0 || _class->type == 1 || _class->type == 5) && (_class->type == 2 || _class->structSize == _class->offset) && _class->computeSize))
2069 {
2070 int c;
2071 int unionMemberOffset = 0;
2072 int bitFields = 0;
2073
2074 if(!member && _class->destructionWatchOffset)
2075 _class->memberOffset += sizeof(struct __ecereNameSpace__ecere__sys__OldList);
2076 {
2077 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
2078
2079 for(dataMember = member ? member->members.first : _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
2080 {
2081 if(!dataMember->isProperty)
2082 {
2083 if(dataMember->type == 0 && dataMember->dataTypeString && !dataMember->dataType)
2084 {
2085 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
2086 }
2087 }
2088 }
2089 }
2090 {
2091 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
2092
2093 for(dataMember = member ? member->members.first : _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
2094 {
2095 if(!dataMember->isProperty && (dataMember->type != 0 || dataMember->dataTypeString))
2096 {
2097 if(!isMember && _class->type == 2 && dataMember->dataType)
2098 {
2099 struct __ecereNameSpace__ecere__com__BitMember * bitMember = (struct __ecereNameSpace__ecere__com__BitMember *)dataMember;
2100 uint64 mask = 0;
2101 int d;
2102
2103 ComputeTypeSize(dataMember->dataType);
2104 if(bitMember->pos == -1)
2105 bitMember->pos = _class->memberOffset;
2106 if(!bitMember->size)
2107 bitMember->size = dataMember->dataType->size * 8;
2108 _class->memberOffset = bitMember->pos + bitMember->size;
2109 for(d = 0; d < bitMember->size; d++)
2110 {
2111 if(d)
2112 mask <<= 1;
2113 mask |= 1;
2114 }
2115 bitMember->mask = mask << bitMember->pos;
2116 }
2117 else if(dataMember->type == 0 && dataMember->dataType)
2118 {
2119 int size;
2120 int alignment = 0;
2121
2122 if(dataMember->dataType->kind != 8 || ((!dataMember->dataType->_class || !dataMember->dataType->_class->registered || dataMember->dataType->_class->registered != _class || _class->type != 1)))
2123 ComputeTypeSize(dataMember->dataType);
2124 if(dataMember->dataType->bitFieldCount)
2125 {
2126 bitFields += dataMember->dataType->bitFieldCount;
2127 size = 0;
2128 }
2129 else
2130 {
2131 if(bitFields)
2132 {
2133 int size = (bitFields + 7) / 8;
2134
2135 if(isMember)
2136 {
2137 int __simpleStruct0;
2138
2139 if(alignment)
2140 {
2141 int __simpleStruct0;
2142
2143 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2144 if(member->memberOffset % alignment)
2145 member->memberOffset += alignment - (member->memberOffset % alignment);
2146 }
2147 dataMember->offset = member->memberOffset;
2148 if(member->type == 1)
2149 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2150 else
2151 {
2152 member->memberOffset += size;
2153 }
2154 }
2155 else
2156 {
2157 if(alignment)
2158 {
2159 int __simpleStruct0;
2160
2161 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2162 if(_class->memberOffset % alignment)
2163 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2164 }
2165 dataMember->offset = _class->memberOffset;
2166 _class->memberOffset += size;
2167 }
2168 bitFields = 0;
2169 }
2170 size = dataMember->dataType->size;
2171 alignment = dataMember->dataType->alignment;
2172 }
2173 if(isMember)
2174 {
2175 int __simpleStruct0;
2176
2177 if(alignment)
2178 {
2179 int __simpleStruct0;
2180
2181 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2182 if(member->memberOffset % alignment)
2183 member->memberOffset += alignment - (member->memberOffset % alignment);
2184 }
2185 dataMember->offset = member->memberOffset;
2186 if(member->type == 1)
2187 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2188 else
2189 {
2190 member->memberOffset += size;
2191 }
2192 }
2193 else
2194 {
2195 if(alignment)
2196 {
2197 int __simpleStruct0;
2198
2199 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2200 if(_class->memberOffset % alignment)
2201 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2202 }
2203 dataMember->offset = _class->memberOffset;
2204 _class->memberOffset += size;
2205 }
2206 }
2207 else
2208 {
2209 ComputeClassMembers((struct __ecereNameSpace__ecere__com__Class *)dataMember, 0x1);
2210 if(isMember)
2211 {
2212 int __simpleStruct2;
2213 int __simpleStruct0, __simpleStruct1;
2214
2215 member->structAlignment = (__simpleStruct0 = member->structAlignment, __simpleStruct1 = dataMember->structAlignment, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
2216 dataMember->offset = member->memberOffset;
2217 if(member->type == 1)
2218 unionMemberOffset = (__simpleStruct2 = dataMember->memberOffset, (unionMemberOffset > __simpleStruct2) ? unionMemberOffset : __simpleStruct2);
2219 else
2220 member->memberOffset += dataMember->memberOffset;
2221 }
2222 else
2223 {
2224 int __simpleStruct0, __simpleStruct1;
2225
2226 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, __simpleStruct1 = dataMember->structAlignment, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
2227 dataMember->offset = _class->memberOffset;
2228 _class->memberOffset += dataMember->memberOffset;
2229 }
2230 }
2231 }
2232 }
2233 if(bitFields)
2234 {
2235 int alignment = 0;
2236 int size = (bitFields + 7) / 8;
2237
2238 if(isMember)
2239 {
2240 int __simpleStruct0;
2241
2242 if(alignment)
2243 {
2244 int __simpleStruct0;
2245
2246 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2247 if(member->memberOffset % alignment)
2248 member->memberOffset += alignment - (member->memberOffset % alignment);
2249 }
2250 if(member->type == 1)
2251 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2252 else
2253 {
2254 member->memberOffset += size;
2255 }
2256 }
2257 else
2258 {
2259 if(alignment)
2260 {
2261 int __simpleStruct0;
2262
2263 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2264 if(_class->memberOffset % alignment)
2265 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2266 }
2267 _class->memberOffset += size;
2268 }
2269 bitFields = 0;
2270 }
2271 }
2272 if(member && member->type == 1)
2273 {
2274 member->memberOffset = unionMemberOffset;
2275 }
2276 if(!isMember)
2277 {
2278 if(_class->type != 2)
2279 {
2280 _class->structSize = (_class->base ? (_class->base->templateClass ? _class->base->templateClass->structSize : _class->base->structSize) : 0) + _class->memberOffset;
2281 if(!member)
2282 {
2283 struct __ecereNameSpace__ecere__com__Property * prop;
2284
2285 for(prop = _class->membersAndProperties.first; prop; prop = prop->next)
2286 {
2287 if(prop->isProperty && prop->isWatchable)
2288 {
2289 prop->watcherOffset = _class->structSize;
2290 _class->structSize += sizeof(struct __ecereNameSpace__ecere__sys__OldList);
2291 }
2292 }
2293 }
2294 {
2295 struct __ecereNameSpace__ecere__sys__OldLink * derivative;
2296
2297 for(derivative = _class->derivatives.first; derivative; derivative = derivative->next)
2298 {
2299 struct __ecereNameSpace__ecere__com__Class * deriv = derivative->data;
2300
2301 if(deriv->computeSize)
2302 {
2303 deriv->offset = _class->structSize;
2304 deriv->memberOffset = 0;
2305 deriv->structSize = deriv->offset;
2306 ComputeClassMembers(deriv, 0x0);
2307 }
2308 }
2309 }
2310 }
2311 }
2312 }
2313 if(context)
2314 FinishTemplatesContext(context);
2315 }
2316
2317 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__NameSpace;
2318
2319 struct __ecereNameSpace__ecere__com__NameSpace
2320 {
2321 char *  name;
2322 struct __ecereNameSpace__ecere__com__NameSpace *  btParent;
2323 struct __ecereNameSpace__ecere__com__NameSpace *  left;
2324 struct __ecereNameSpace__ecere__com__NameSpace *  right;
2325 int depth;
2326 struct __ecereNameSpace__ecere__com__NameSpace *  parent;
2327 struct __ecereNameSpace__ecere__sys__BinaryTree nameSpaces;
2328 struct __ecereNameSpace__ecere__sys__BinaryTree classes;
2329 struct __ecereNameSpace__ecere__sys__BinaryTree defines;
2330 struct __ecereNameSpace__ecere__sys__BinaryTree functions;
2331 };
2332
2333 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Module;
2334
2335 struct __ecereNameSpace__ecere__com__Module
2336 {
2337 struct __ecereNameSpace__ecere__com__Instance * application;
2338 struct __ecereNameSpace__ecere__sys__OldList classes;
2339 struct __ecereNameSpace__ecere__sys__OldList defines;
2340 struct __ecereNameSpace__ecere__sys__OldList functions;
2341 struct __ecereNameSpace__ecere__sys__OldList modules;
2342 struct __ecereNameSpace__ecere__com__Instance * prev;
2343 struct __ecereNameSpace__ecere__com__Instance * next;
2344 char *  name;
2345 void *  library;
2346 void *  Unload;
2347 int importType;
2348 int origImportType;
2349 struct __ecereNameSpace__ecere__com__NameSpace privateNameSpace;
2350 struct __ecereNameSpace__ecere__com__NameSpace publicNameSpace;
2351 };
2352
2353 void ComputeModuleClasses(struct __ecereNameSpace__ecere__com__Instance * module)
2354 {
2355 struct __ecereNameSpace__ecere__com__Class * _class;
2356 struct __ecereNameSpace__ecere__sys__OldLink * subModule;
2357
2358 for(subModule = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + 12)))->modules.first; subModule; subModule = subModule->next)
2359 ComputeModuleClasses(subModule->data);
2360 for(_class = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + 12)))->classes.first; _class; _class = _class->next)
2361 ComputeClassMembers(_class, 0x0);
2362 }
2363
2364 extern unsigned int inCompiler;
2365
2366 extern void Compiler_Error(char *  format, ...);
2367
2368 extern char *  __ecereNameSpace__ecere__GetTranslatedString(struct __ecereNameSpace__ecere__com__Instance * module, char *  string, char *  stringAndContext);
2369
2370 extern struct __ecereNameSpace__ecere__com__Instance * __thisModule;
2371
2372 extern int __ecereNameSpace__ecere__com__eClass_GetProperty(struct __ecereNameSpace__ecere__com__Class * _class, char *  name);
2373
2374 int ComputeTypeSize(struct Type * type)
2375 {
2376 unsigned int size = type ? type->size : 0;
2377
2378 if(!size && type && !type->computing)
2379 {
2380 type->computing = 0x1;
2381 switch(type->kind)
2382 {
2383 case 1:
2384 type->alignment = size = sizeof(char);
2385 break;
2386 case 3:
2387 type->alignment = size = sizeof(int);
2388 break;
2389 case 4:
2390 type->alignment = size = sizeof(long long);
2391 break;
2392 case 5:
2393 type->alignment = size = sizeof(long);
2394 break;
2395 case 2:
2396 type->alignment = size = sizeof(short);
2397 break;
2398 case 6:
2399 type->alignment = size = sizeof(float);
2400 break;
2401 case 7:
2402 type->alignment = size = sizeof(double);
2403 break;
2404 case 8:
2405 {
2406 struct __ecereNameSpace__ecere__com__Class * _class = type->_class ? type->_class->registered : (((void *)0));
2407
2408 if(_class && _class->type == 1)
2409 {
2410 ComputeClassMembers(_class, 0x0);
2411 type->alignment = _class->structAlignment;
2412 size = _class->structSize;
2413 if(type->alignment && size % type->alignment)
2414 size += type->alignment - (size % type->alignment);
2415 }
2416 else if(_class && (_class->type == 3 || _class->type == 4 || _class->type == 2))
2417 {
2418 if(!_class->dataType)
2419 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
2420 size = type->alignment = ComputeTypeSize(_class->dataType);
2421 }
2422 else
2423 size = type->alignment = sizeof(struct __ecereNameSpace__ecere__com__Instance **);
2424 break;
2425 }
2426 case 13:
2427 case 19:
2428 size = type->alignment = sizeof(void *);
2429 break;
2430 case 12:
2431 if(type->arraySizeExp)
2432 {
2433 ProcessExpressionType(type->arraySizeExp);
2434 ComputeExpression(type->arraySizeExp);
2435 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)))
2436 {
2437 struct Location oldLoc = yylloc;
2438 char expression[10240];
2439
2440 expression[0] = '\0';
2441 type->arraySizeExp->expType = (((void *)0));
2442 yylloc = type->arraySizeExp->loc;
2443 if(inCompiler)
2444 PrintExpression(type->arraySizeExp, expression);
2445 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Array size not constant int (%s)\n", (((void *)0))), expression);
2446 yylloc = oldLoc;
2447 }
2448 GetInt(type->arraySizeExp, &type->arraySize);
2449 }
2450 else if(type->enumClass)
2451 {
2452 if(type->enumClass && type->enumClass->registered && type->enumClass->registered->type == 4)
2453 {
2454 type->arraySize = __ecereNameSpace__ecere__com__eClass_GetProperty(type->enumClass->registered, "enumSize");
2455 }
2456 else
2457 type->arraySize = 0;
2458 }
2459 else
2460 {
2461 type->arraySize = 0;
2462 }
2463 size = ComputeTypeSize(type->type) * type->arraySize;
2464 type->alignment = type->type->alignment;
2465 break;
2466 case 9:
2467 {
2468 struct Type * member;
2469
2470 for(member = type->members.first; member; member = member->next)
2471 {
2472 int __simpleStruct0, __simpleStruct1;
2473 unsigned int addSize = ComputeTypeSize(member);
2474
2475 member->offset = size;
2476 if(member->alignment && size % member->alignment)
2477 member->offset += member->alignment - (size % member->alignment);
2478 size = member->offset;
2479 type->alignment = (__simpleStruct0 = type->alignment, __simpleStruct1 = member->alignment, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
2480 size += addSize;
2481 }
2482 if(type->alignment && size % type->alignment)
2483 size += type->alignment - (size % type->alignment);
2484 break;
2485 }
2486 case 10:
2487 {
2488 struct Type * member;
2489
2490 for(member = type->members.first; member; member = member->next)
2491 {
2492 int __simpleStruct0, __simpleStruct1;
2493 unsigned int addSize = ComputeTypeSize(member);
2494
2495 member->offset = size;
2496 if(member->alignment && size % member->alignment)
2497 member->offset += member->alignment - (size % member->alignment);
2498 size = member->offset;
2499 type->alignment = (__simpleStruct0 = type->alignment, __simpleStruct1 = member->alignment, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
2500 size = ((size > addSize) ? size : addSize);
2501 }
2502 if(type->alignment && size % type->alignment)
2503 size += type->alignment - (size % type->alignment);
2504 break;
2505 }
2506 case 20:
2507 {
2508 struct TemplateParameter * param = type->templateParameter;
2509 struct Type * baseType = ProcessTemplateParameterType(param);
2510
2511 if(baseType)
2512 size = ComputeTypeSize(baseType);
2513 else
2514 size = sizeof(uint64);
2515 break;
2516 }
2517 case 15:
2518 {
2519 size = sizeof(enum
2520 {
2521 test
2522 });
2523 break;
2524 }
2525 case 21:
2526 {
2527 size = sizeof(void *);
2528 break;
2529 }
2530 }
2531 type->size = size;
2532 type->computing = 0x0;
2533 }
2534 return size;
2535 }
2536
2537 extern struct Declarator * MkDeclaratorIdentifier(struct Identifier * id);
2538
2539 extern struct Identifier * MkIdentifier(char *  string);
2540
2541 extern void ListAdd(struct __ecereNameSpace__ecere__sys__OldList * list, void *  item);
2542
2543 extern struct Declarator * MkStructDeclarator(struct Declarator * declarator, struct Expression * exp);
2544
2545 extern struct ClassDef * MkClassDefDeclaration(struct Declaration * decl);
2546
2547 extern struct Declaration * MkStructDeclaration(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct __ecereNameSpace__ecere__sys__OldList * declarators, struct Specifier * extStorage);
2548
2549 void ReplaceThisClassSpecifiers(struct __ecereNameSpace__ecere__sys__OldList * specs, struct __ecereNameSpace__ecere__com__Class * _class);
2550
2551 static void DeclareType(struct Type * type, unsigned int declarePointers, unsigned int declareParams);
2552
2553 extern void FreeType(struct Type * type);
2554
2555 extern struct Specifier * MkStructOrUnion(int type, struct Identifier * id, struct __ecereNameSpace__ecere__sys__OldList * definitions);
2556
2557 extern struct Specifier * MkSpecifier(int specifier);
2558
2559 extern struct Declarator * MkDeclaratorArray(struct Declarator * declarator, struct Expression * exp);
2560
2561 extern struct Expression * MkExpConstant(char *  string);
2562
2563 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)
2564 {
2565 struct __ecereNameSpace__ecere__com__DataMember * topMember = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
2566 unsigned int totalSize = 0;
2567 unsigned int maxSize = 0;
2568 int alignment, size;
2569 struct __ecereNameSpace__ecere__com__DataMember * member;
2570 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
2571
2572 if(!isMember && _class->base)
2573 {
2574 maxSize = _class->structSize;
2575 {
2576 if(_class->type == 1 || _class->type == 5)
2577 AddMembers(declarations, _class->base, 0x0, &totalSize, topClass);
2578 else
2579 maxSize -= _class->base->templateClass ? _class->base->templateClass->structSize : _class->base->structSize;
2580 }
2581 }
2582 for(member = isMember ? topMember->members.first : _class->membersAndProperties.first; member; member = member->next)
2583 {
2584 if(!member->isProperty)
2585 {
2586 switch(member->type)
2587 {
2588 case 0:
2589 {
2590 if(member->dataTypeString)
2591 {
2592 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList(), * decls = MkList();
2593 struct Declarator * decl;
2594
2595 decl = SpecDeclFromString(member->dataTypeString, specs, MkDeclaratorIdentifier(MkIdentifier(member->name)));
2596 ListAdd(decls, MkStructDeclarator(decl, (((void *)0))));
2597 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(specs, decls, (((void *)0)))));
2598 if(!member->dataType)
2599 member->dataType = ProcessType(specs, decl);
2600 ReplaceThisClassSpecifiers(specs, topClass);
2601 {
2602 struct Type * type = ProcessType(specs, decl);
2603
2604 DeclareType(member->dataType, 0x0, 0x0);
2605 FreeType(type);
2606 }
2607 ComputeTypeSize(member->dataType);
2608 size = member->dataType->size;
2609 alignment = member->dataType->alignment;
2610 if(alignment)
2611 {
2612 if(totalSize % alignment)
2613 totalSize += alignment - (totalSize % alignment);
2614 }
2615 totalSize += size;
2616 }
2617 break;
2618 }
2619 case 1:
2620 case 2:
2621 {
2622 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList(), * list = MkList();
2623
2624 size = 0;
2625 AddMembers(list, (struct __ecereNameSpace__ecere__com__Class *)member, 0x1, &size, topClass);
2626 ListAdd(specs, MkStructOrUnion((member->type == 1) ? 4 : 3, (((void *)0)), list));
2627 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(specs, (((void *)0)), (((void *)0)))));
2628 alignment = member->structAlignment;
2629 if(alignment)
2630 {
2631 if(totalSize % alignment)
2632 totalSize += alignment - (totalSize % alignment);
2633 }
2634 totalSize += size;
2635 break;
2636 }
2637 }
2638 }
2639 }
2640 if(retSize)
2641 {
2642 unsigned int __simpleStruct0;
2643
2644 if(topMember && topMember->type == 1)
2645 *retSize = (__simpleStruct0 = *retSize, (__simpleStruct0 > totalSize) ? __simpleStruct0 : totalSize);
2646 else
2647 *retSize += totalSize;
2648 }
2649 else if(totalSize < maxSize && _class->type != 1000)
2650 {
2651 char sizeString[50];
2652
2653 sprintf(sizeString, "%d", maxSize - totalSize);
2654 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(CHAR)), MkListOne(MkDeclaratorArray(MkDeclaratorIdentifier(MkIdentifier("__ecere_padding")), MkExpConstant(sizeString))), (((void *)0)))));
2655 }
2656 if(context)
2657 FinishTemplatesContext(context);
2658 return topMember ? topMember->memberID : _class->memberID;
2659 }
2660
2661 static int DeclareMembers(struct __ecereNameSpace__ecere__com__Class * _class, unsigned int isMember)
2662 {
2663 struct __ecereNameSpace__ecere__com__DataMember * topMember = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
2664 unsigned int totalSize = 0;
2665 struct __ecereNameSpace__ecere__com__DataMember * member;
2666 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
2667
2668 if(!isMember && (_class->type == 1 || _class->type == 5) && _class->base->type != 1000)
2669 DeclareMembers(_class->base, 0x0);
2670 for(member = isMember ? topMember->members.first : _class->membersAndProperties.first; member; member = member->next)
2671 {
2672 if(!member->isProperty)
2673 {
2674 switch(member->type)
2675 {
2676 case 0:
2677 {
2678 if(!member->dataType && member->dataTypeString)
2679 member->dataType = ProcessTypeString(member->dataTypeString, 0x0);
2680 if(member->dataType)
2681 DeclareType(member->dataType, 0x0, 0x0);
2682 break;
2683 }
2684 case 1:
2685 case 2:
2686 {
2687 DeclareMembers((struct __ecereNameSpace__ecere__com__Class *)member, 0x1);
2688 break;
2689 }
2690 }
2691 }
2692 }
2693 if(context)
2694 FinishTemplatesContext(context);
2695 return topMember ? topMember->memberID : _class->memberID;
2696 }
2697
2698 extern struct Symbol * FindClass(char *  name);
2699
2700 extern char *  strchr(char * , int);
2701
2702 extern void FullClassNameCat(char *  output, char *  className, unsigned int includeTemplateParams);
2703
2704 extern void FreeList(struct __ecereNameSpace__ecere__sys__OldList * list, void (* )(void * ));
2705
2706 extern struct External * MkExternalDeclaration(struct Declaration * declaration);
2707
2708 extern struct Declaration * MkDeclaration(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct __ecereNameSpace__ecere__sys__OldList * initDeclarators);
2709
2710 extern char *  strcpy(char * , const char * );
2711
2712 extern void MangleClassName(char *  className);
2713
2714 extern void DeclareClass(struct Symbol * classSym, char *  className);
2715
2716 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move(struct __ecereNameSpace__ecere__sys__OldList * this, void *  item, void *  prevItem);
2717
2718 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(struct __ecereNameSpace__ecere__sys__OldList * this, void *  prevItem, void *  item);
2719
2720 void DeclareStruct(char * name, unsigned int skipNoHead)
2721 {
2722 struct External * external = (((void *)0));
2723 struct Symbol * classSym = FindClass(name);
2724
2725 if(!inCompiler || !classSym)
2726 return (((void *)0));
2727 if(classSym->registered && (classSym->registered->type == 2 || classSym->registered->type == 3 || classSym->registered->type == 4))
2728 return (((void *)0));
2729 if(classSym->registered && classSym->imported && !classSym->declaredStructSym)
2730 {
2731 struct Declaration * decl;
2732 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
2733 struct __ecereNameSpace__ecere__sys__OldList * declarations = (((void *)0));
2734 char structName[1024];
2735
2736 external = (classSym->registered && classSym->registered->type == 1) ? classSym->pointerExternal : classSym->structExternal;
2737 classSym->declaring++;
2738 if(strchr(classSym->string, '<'))
2739 {
2740 if(classSym->registered->templateClass)
2741 {
2742 DeclareStruct(classSym->registered->templateClass->fullName, skipNoHead);
2743 classSym->declaring--;
2744 }
2745 return (((void *)0));
2746 }
2747 DeclareMembers(classSym->registered, 0x0);
2748 structName[0] = (char)0;
2749 FullClassNameCat(structName, name, 0x0);
2750 if(!skipNoHead)
2751 {
2752 classSym->declaredStructSym = 0x1;
2753 declarations = MkList();
2754 AddMembers(declarations, classSym->registered, 0x0, (((void *)0)), classSym->registered);
2755 if(!(*declarations).count)
2756 {
2757 FreeList(declarations, (((void *)0)));
2758 declarations = (((void *)0));
2759 }
2760 }
2761 if(skipNoHead || declarations)
2762 {
2763 if(external && external->declaration)
2764 {
2765 ((struct Specifier *)(*external->declaration->specifiers).first)->definitions = declarations;
2766 if(curExternal && curExternal->symbol && curExternal->symbol->idCode < classSym->id)
2767 {
2768 if(classSym->structExternal)
2769 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->structExternal, curExternal->prev);
2770 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->pointerExternal, curExternal->prev);
2771 classSym->id = curExternal->symbol->idCode;
2772 classSym->idCode = curExternal->symbol->idCode;
2773 }
2774 }
2775 else
2776 {
2777 if(!external)
2778 external = MkExternalDeclaration((((void *)0)));
2779 specifiers = MkList();
2780 declarators = MkList();
2781 ListAdd(specifiers, MkStructOrUnion(3, MkIdentifier(structName), declarations));
2782 external->declaration = decl = MkDeclaration(specifiers, declarators);
2783 if(decl->symbol && !decl->symbol->pointerExternal)
2784 decl->symbol->pointerExternal = external;
2785 if(classSym->registered && classSym->registered->type == 1)
2786 {
2787 char className[1024];
2788
2789 strcpy(className, "__ecereClass_");
2790 FullClassNameCat(className, classSym->string, 0x1);
2791 MangleClassName(className);
2792 DeclareClass(classSym, className);
2793 external->symbol = classSym;
2794 classSym->pointerExternal = external;
2795 classSym->id = (curExternal && curExternal->symbol) ? curExternal->symbol->idCode : 0;
2796 classSym->idCode = (curExternal && curExternal->symbol) ? curExternal->symbol->idCode : 0;
2797 }
2798 else
2799 {
2800 char className[1024];
2801
2802 strcpy(className, "__ecereClass_");
2803 FullClassNameCat(className, classSym->string, 0x1);
2804 MangleClassName(className);
2805 classSym->structExternal = external;
2806 DeclareClass(classSym, className);
2807 external->symbol = classSym;
2808 }
2809 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal ? curExternal->prev : (((void *)0)), external);
2810 }
2811 }
2812 classSym->declaring--;
2813 }
2814 else if(curExternal && curExternal->symbol && curExternal->symbol->idCode < classSym->id)
2815 {
2816 classSym->declaring++;
2817 {
2818 if(classSym->registered)
2819 DeclareMembers(classSym->registered, 0x0);
2820 }
2821 if(classSym->registered && (classSym->registered->type == 1 || classSym->registered->type == 5))
2822 {
2823 if(classSym->structExternal)
2824 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->structExternal, curExternal->prev);
2825 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->pointerExternal, curExternal->prev);
2826 classSym->id = curExternal->symbol->idCode;
2827 classSym->idCode = curExternal->symbol->idCode;
2828 }
2829 classSym->declaring--;
2830 }
2831 }
2832
2833 extern char *  strcat(char * , const char * );
2834
2835 extern struct ModuleImport * FindModule(struct __ecereNameSpace__ecere__com__Instance * moduleToFind);
2836
2837 extern struct ModuleImport * mainModule;
2838
2839 extern struct Specifier * MkSpecifierName(char *  name);
2840
2841 extern struct Declarator * MkDeclaratorBrackets(struct Declarator * declarator);
2842
2843 extern struct Declarator * PlugDeclarator(struct Declarator * decl, struct Declarator * baseDecl);
2844
2845 extern struct Declarator * MkDeclaratorFunction(struct Declarator * declarator, struct __ecereNameSpace__ecere__sys__OldList * parameters);
2846
2847 extern struct InitDeclarator * MkInitDeclarator(struct Declarator * declarator, struct Initializer * initializer);
2848
2849 extern void FreeDeclarator(struct Declarator * decl);
2850
2851 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_PropertyImport;
2852
2853 struct PropertyImport
2854 {
2855 struct PropertyImport * prev;
2856 struct PropertyImport * next;
2857 char *  name;
2858 unsigned int isVirtual;
2859 unsigned int hasSet;
2860 unsigned int hasGet;
2861 };
2862
2863 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(struct __ecereNameSpace__ecere__sys__OldList * this, void *  item);
2864
2865 void DeclareProperty(struct __ecereNameSpace__ecere__com__Property * prop, char * setName, char * getName)
2866 {
2867 void * __ecereTemp1;
2868 struct Symbol * symbol = prop->symbol;
2869 char propName[1024];
2870
2871 strcpy(setName, "__ecereProp_");
2872 FullClassNameCat(setName, prop->_class->fullName, 0x0);
2873 strcat(setName, "_Set_");
2874 FullClassNameCat(setName, prop->name, 0x1);
2875 strcpy(getName, "__ecereProp_");
2876 FullClassNameCat(getName, prop->_class->fullName, 0x0);
2877 strcat(getName, "_Get_");
2878 FullClassNameCat(getName, prop->name, 0x1);
2879 strcpy(propName, "__ecereProp_");
2880 FullClassNameCat(propName, prop->_class->fullName, 0x0);
2881 strcat(propName, "_");
2882 FullClassNameCat(propName, prop->name, 0x1);
2883 MangleClassName(getName);
2884 MangleClassName(setName);
2885 MangleClassName(propName);
2886 if(prop->_class->type == 1)
2887 DeclareStruct(prop->_class->fullName, 0x0);
2888 if(!symbol || curExternal->symbol->idCode < symbol->id)
2889 {
2890 unsigned int imported = 0x0;
2891 unsigned int dllImport = 0x0;
2892
2893 if(!symbol || symbol->_import)
2894 {
2895 if(!symbol)
2896 {
2897 struct Symbol * classSym;
2898
2899 if(!prop->_class->symbol)
2900 prop->_class->symbol = FindClass(prop->_class->fullName);
2901 classSym = prop->_class->symbol;
2902 if(classSym && !classSym->_import)
2903 {
2904 struct ModuleImport * module;
2905
2906 if(prop->_class->module)
2907 module = FindModule(prop->_class->module);
2908 else
2909 module = mainModule;
2910 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));
2911 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->classes, classSym->_import);
2912 }
2913 symbol = prop->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
2914 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));
2915 if(classSym)
2916 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&classSym->_import->properties, symbol->_import);
2917 }
2918 imported = 0x1;
2919 if(prop->_class->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)prop->_class->module + 12)))->importType != 1)
2920 dllImport = 0x1;
2921 }
2922 if(!symbol->type)
2923 {
2924 struct Context * context = SetupTemplatesContext(prop->_class);
2925
2926 symbol->type = ProcessTypeString(prop->dataTypeString, 0x0);
2927 FinishTemplatesContext(context);
2928 }
2929 if(prop->Get)
2930 {
2931 if(!symbol->externalGet || symbol->externalGet->type == 0)
2932 {
2933 struct Declaration * decl;
2934 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
2935 struct Declarator * d;
2936 struct __ecereNameSpace__ecere__sys__OldList * params;
2937 struct Specifier * spec;
2938 struct External * external;
2939 struct Declarator * typeDecl;
2940 unsigned int simple = 0x0;
2941
2942 specifiers = MkList();
2943 declarators = MkList();
2944 params = MkList();
2945 ListAdd(params, MkTypeName(MkListOne(MkSpecifierName(prop->_class->fullName)), MkDeclaratorIdentifier(MkIdentifier("this"))));
2946 d = MkDeclaratorIdentifier(MkIdentifier(getName));
2947 if(dllImport)
2948 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
2949 {
2950 struct Context * context = SetupTemplatesContext(prop->_class);
2951
2952 typeDecl = SpecDeclFromString(prop->dataTypeString, specifiers, (((void *)0)));
2953 FinishTemplatesContext(context);
2954 }
2955 for(spec = (*specifiers).first; spec; spec = spec->next)
2956 {
2957 if(spec->type == 1)
2958 {
2959 if((!typeDecl || typeDecl->type == 1))
2960 {
2961 struct Symbol * classSym = spec->symbol;
2962
2963 symbol->_class = classSym->registered;
2964 if(classSym->registered && classSym->registered->type == 1)
2965 {
2966 DeclareStruct(spec->name, 0x0);
2967 simple = 0x1;
2968 }
2969 }
2970 }
2971 }
2972 if(!simple)
2973 d = PlugDeclarator(typeDecl, d);
2974 else
2975 {
2976 ListAdd(params, MkTypeName(specifiers, PlugDeclarator(typeDecl, MkDeclaratorIdentifier(MkIdentifier("value")))));
2977 specifiers = MkList();
2978 }
2979 d = MkDeclaratorFunction(d, params);
2980 if(dllImport)
2981 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
2982 else if(prop->_class->symbol && ((struct Symbol *)prop->_class->symbol)->isStatic)
2983 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
2984 if(simple)
2985 ListAdd(specifiers, MkSpecifier(VOID));
2986 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
2987 decl = MkDeclaration(specifiers, declarators);
2988 external = MkExternalDeclaration(decl);
2989 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
2990 external->symbol = symbol;
2991 symbol->externalGet = external;
2992 ReplaceThisClassSpecifiers(specifiers, prop->_class);
2993 if(typeDecl)
2994 FreeDeclarator(typeDecl);
2995 }
2996 else
2997 {
2998 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->externalGet, curExternal->prev);
2999 }
3000 }
3001 if(prop->Set)
3002 {
3003 if(!symbol->externalSet || symbol->externalSet->type == 0)
3004 {
3005 struct Declaration * decl;
3006 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
3007 struct Declarator * d;
3008 struct __ecereNameSpace__ecere__sys__OldList * params;
3009 struct Specifier * spec;
3010 struct External * external;
3011 struct Declarator * typeDecl;
3012
3013 declarators = MkList();
3014 params = MkList();
3015 if(!prop->conversion || prop->_class->type == 1)
3016 {
3017 ListAdd(params, MkTypeName(MkListOne(MkSpecifierName(prop->_class->fullName)), MkDeclaratorIdentifier(MkIdentifier("this"))));
3018 }
3019 specifiers = MkList();
3020 {
3021 struct Context * context = SetupTemplatesContext(prop->_class);
3022
3023 typeDecl = d = SpecDeclFromString(prop->dataTypeString, specifiers, MkDeclaratorIdentifier(MkIdentifier("value")));
3024 FinishTemplatesContext(context);
3025 }
3026 ListAdd(params, MkTypeName(specifiers, d));
3027 d = MkDeclaratorIdentifier(MkIdentifier(setName));
3028 if(dllImport)
3029 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
3030 d = MkDeclaratorFunction(d, params);
3031 for(spec = (*specifiers).first; spec; spec = spec->next)
3032 {
3033 if(spec->type == 1)
3034 {
3035 if((!typeDecl || typeDecl->type == 1))
3036 {
3037 struct Symbol * classSym = spec->symbol;
3038
3039 symbol->_class = classSym->registered;
3040 if(classSym->registered && classSym->registered->type == 1)
3041 DeclareStruct(spec->name, 0x0);
3042 }
3043 }
3044 }
3045 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
3046 specifiers = MkList();
3047 if(dllImport)
3048 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
3049 else if(prop->_class->symbol && ((struct Symbol *)prop->_class->symbol)->isStatic)
3050 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
3051 if(!prop->conversion || prop->_class->type == 1)
3052 ListAdd(specifiers, MkSpecifier(VOID));
3053 else
3054 ListAdd(specifiers, MkSpecifierName(prop->_class->fullName));
3055 decl = MkDeclaration(specifiers, declarators);
3056 external = MkExternalDeclaration(decl);
3057 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
3058 external->symbol = symbol;
3059 symbol->externalSet = external;
3060 ReplaceThisClassSpecifiers(specifiers, prop->_class);
3061 }
3062 else
3063 {
3064 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->externalSet, curExternal->prev);
3065 }
3066 }
3067 if(!symbol->externalPtr)
3068 {
3069 struct Declaration * decl;
3070 struct External * external;
3071 struct __ecereNameSpace__ecere__sys__OldList * specifiers = MkList();
3072
3073 if(imported)
3074 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
3075 else
3076 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
3077 ListAdd(specifiers, MkSpecifierName("Property"));
3078 {
3079 struct __ecereNameSpace__ecere__sys__OldList * list = MkList();
3080
3081 ListAdd(list, MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier(propName))), (((void *)0))));
3082 if(!imported)
3083 {
3084 strcpy(propName, "__ecerePropM_");
3085 FullClassNameCat(propName, prop->_class->fullName, 0x0);
3086 strcat(propName, "_");
3087 FullClassNameCat(propName, prop->name, 0x1);
3088 MangleClassName(propName);
3089 ListAdd(list, MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier(propName))), (((void *)0))));
3090 }
3091 decl = MkDeclaration(specifiers, list);
3092 }
3093 external = MkExternalDeclaration(decl);
3094 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
3095 external->symbol = symbol;
3096 symbol->externalPtr = external;
3097 }
3098 else
3099 {
3100 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->externalPtr, curExternal->prev);
3101 }
3102 symbol->id = curExternal->symbol->idCode;
3103 }
3104 }
3105
3106 struct Type * Dereference(struct Type * source)
3107 {
3108 void * __ecereTemp1;
3109 struct Type * type = (((void *)0));
3110
3111 if(source)
3112 {
3113 if(source->kind == 13 || source->kind == 12)
3114 {
3115 type = source->type;
3116 source->type->refCount++;
3117 }
3118 else if(source->kind == 8 && !strcmp(source->_class->string, "String"))
3119 {
3120 type = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->kind = 1, ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1));
3121 }
3122 else if(source->kind == 8 && source->_class && source->_class->registered && source->_class->registered->type == 5)
3123 {
3124 type = source;
3125 source->refCount++;
3126 }
3127 else
3128 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "cannot dereference type\n", (((void *)0))));
3129 }
3130 return type;
3131 }
3132
3133 static struct Type * Reference(struct Type * source)
3134 {
3135 void * __ecereTemp1;
3136 struct Type * type = (((void *)0));
3137
3138 if(source)
3139 {
3140 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));
3141 source->refCount++;
3142 }
3143 return type;
3144 }
3145
3146 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);
3147
3148 extern void *  memcpy(void * , const void * , unsigned int size);
3149
3150 void ProcessMethodType(struct __ecereNameSpace__ecere__com__Method * method);
3151
3152 extern void FreeExpression(struct Expression * exp);
3153
3154 extern void __ecereNameSpace__ecere__sys__ChangeCh(char *  string, char ch1, char ch2);
3155
3156 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);
3157
3158 static void ProcessInitializer(struct Initializer * init, struct Type * type);
3159
3160 extern struct Type * MkClassType(char *  name);
3161
3162 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);
3163
3164 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)
3165 {
3166 struct Identifier * ident = member->identifiers ? (*member->identifiers).first : (((void *)0));
3167 unsigned int found = 0x0;
3168 struct __ecereNameSpace__ecere__com__DataMember * dataMember = (((void *)0));
3169 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
3170 unsigned int freeType = 0x0;
3171
3172 yylloc = member->loc;
3173 if(!ident)
3174 {
3175 if(curMember)
3176 {
3177 __ecereNameSpace__ecere__com__eClass_FindNextMember(_class, curClass, curMember, subMemberStack, subMemberStackPos);
3178 if(*curMember)
3179 {
3180 found = 0x1;
3181 dataMember = *curMember;
3182 }
3183 }
3184 }
3185 else
3186 {
3187 struct __ecereNameSpace__ecere__com__DataMember * thisMember = (struct __ecereNameSpace__ecere__com__DataMember *)__ecereNameSpace__ecere__com__eClass_FindProperty(_class, ident->string, privateModule);
3188 struct __ecereNameSpace__ecere__com__DataMember * _subMemberStack[256];
3189 int _subMemberStackPos = 0;
3190
3191 if(!thisMember)
3192 thisMember = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, ident->string, privateModule, _subMemberStack, &_subMemberStackPos);
3193 if(thisMember)
3194 {
3195 dataMember = thisMember;
3196 if(curMember && thisMember->memberAccess == 1)
3197 {
3198 *curMember = thisMember;
3199 *curClass = thisMember->_class;
3200 memcpy(subMemberStack, _subMemberStack, sizeof(int) * _subMemberStackPos);
3201 *subMemberStackPos = _subMemberStackPos;
3202 }
3203 found = 0x1;
3204 }
3205 else
3206 {
3207 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, ident->string, privateModule);
3208 if(method && method->type == 1)
3209 found = 0x1;
3210 else
3211 method = (((void *)0));
3212 }
3213 }
3214 if(found)
3215 {
3216 struct Type * type = (((void *)0));
3217
3218 if(dataMember)
3219 {
3220 if(!dataMember->dataType && dataMember->dataTypeString)
3221 {
3222 struct Context * context = SetupTemplatesContext(_class);
3223
3224 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
3225 FinishTemplatesContext(context);
3226 }
3227 type = dataMember->dataType;
3228 }
3229 else if(method)
3230 {
3231 if(!method->dataType)
3232 ProcessMethodType(method);
3233 type = method->dataType;
3234 }
3235 if(ident && ident->next)
3236 {
3237 for(ident = ident->next; ident && type; ident = ident->next)
3238 {
3239 if(type->kind == 8)
3240 {
3241 dataMember = (struct __ecereNameSpace__ecere__com__DataMember *)__ecereNameSpace__ecere__com__eClass_FindProperty(type->_class->registered, ident->string, privateModule);
3242 if(!dataMember)
3243 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMember(type->_class->registered, ident->string, privateModule, (((void *)0)), (((void *)0)));
3244 if(dataMember)
3245 type = dataMember->dataType;
3246 }
3247 else if(type->kind == 9 || type->kind == 10)
3248 {
3249 struct Type * memberType;
3250
3251 for(memberType = type->members.first; memberType; memberType = memberType->next)
3252 {
3253 if(!strcmp(memberType->name, ident->string))
3254 {
3255 type = memberType;
3256 break;
3257 }
3258 }
3259 }
3260 }
3261 }
3262 if(type && type->kind == 20 && type->templateParameter->type == 0 && _class->templateArgs)
3263 {
3264 int id = 0;
3265 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam;
3266 struct __ecereNameSpace__ecere__com__Class * sClass;
3267
3268 for(sClass = _class; sClass; sClass = sClass->base)
3269 {
3270 id = 0;
3271 if(sClass->templateClass)
3272 sClass = sClass->templateClass;
3273 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
3274 {
3275 if(curParam->type == 0 && !strcmp(type->templateParameter->identifier->string, curParam->name))
3276 {
3277 for(sClass = sClass->base; sClass; sClass = sClass->base)
3278 {
3279 if(sClass->templateClass)
3280 sClass = sClass->templateClass;
3281 id += sClass->templateParams.count;
3282 }
3283 break;
3284 }
3285 id++;
3286 }
3287 if(curParam)
3288 break;
3289 }
3290 if(curParam)
3291 {
3292 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = _class->templateArgs[id];
3293
3294 if(arg.dataTypeString)
3295 {
3296 type = ProcessTypeString(arg.dataTypeString, 0x0);
3297 freeType = 0x1;
3298 if(type && _class->templateClass)
3299 type->passAsTemplate = 0x1;
3300 if(type)
3301 {
3302 }
3303 }
3304 }
3305 }
3306 if(type && type->kind == 8 && type->_class && type->_class->registered && strchr(type->_class->registered->fullName, '<'))
3307 {
3308 struct __ecereNameSpace__ecere__com__Class * expClass = type->_class->registered;
3309 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
3310 int c;
3311 int paramCount = 0;
3312 int lastParam = -1;
3313 char templateString[1024];
3314 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
3315
3316 sprintf(templateString, "%s<", expClass->templateClass->fullName);
3317 for(cClass = expClass; cClass; cClass = cClass->base)
3318 {
3319 int p = 0;
3320
3321 if(cClass->templateClass)
3322 cClass = cClass->templateClass;
3323 for(param = cClass->templateParams.first; param; param = param->next)
3324 {
3325 int id = p;
3326 struct __ecereNameSpace__ecere__com__Class * sClass;
3327 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
3328
3329 for(sClass = cClass->base; sClass; sClass = sClass->base)
3330 {
3331 if(sClass->templateClass)
3332 sClass = sClass->templateClass;
3333 id += sClass->templateParams.count;
3334 }
3335 arg = expClass->templateArgs[id];
3336 for(sClass = _class; sClass; sClass = sClass->base)
3337 {
3338 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * cParam;
3339 int p = 0;
3340 struct __ecereNameSpace__ecere__com__Class * nextClass;
3341
3342 if(sClass->templateClass)
3343 sClass = sClass->templateClass;
3344 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
3345 {
3346 if(nextClass->templateClass)
3347 nextClass = nextClass->templateClass;
3348 p += nextClass->templateParams.count;
3349 }
3350 for(cParam = sClass->templateParams.first; cParam; cParam = cParam->next, p++)
3351 {
3352 if(cParam->type == 0 && arg.dataTypeString && !strcmp(cParam->name, arg.dataTypeString))
3353 {
3354 if(_class->templateArgs && arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
3355 {
3356 arg.dataTypeString = _class->templateArgs[p].dataTypeString;
3357 arg.dataTypeClass = _class->templateArgs[p].dataTypeClass;
3358 break;
3359 }
3360 }
3361 }
3362 }
3363 {
3364 char argument[256];
3365
3366 argument[0] = '\0';
3367 switch(param->type)
3368 {
3369 case 2:
3370 {
3371 char expString[1024];
3372 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
3373 struct Declarator * decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
3374 struct Expression * exp;
3375 char * string = PrintHexUInt64(arg.expression.ui64);
3376
3377 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
3378 ProcessExpressionType(exp);
3379 ComputeExpression(exp);
3380 expString[0] = '\0';
3381 PrintExpression(exp, expString);
3382 strcat(argument, expString);
3383 FreeExpression(exp);
3384 break;
3385 }
3386 case 1:
3387 {
3388 strcat(argument, arg.member->name);
3389 break;
3390 }
3391 case 0:
3392 {
3393 if(arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
3394 strcat(argument, arg.dataTypeString);
3395 break;
3396 }
3397 }
3398 if(argument[0])
3399 {
3400 if(paramCount)
3401 strcat(templateString, ", ");
3402 if(lastParam != p - 1)
3403 {
3404 strcat(templateString, param->name);
3405 strcat(templateString, " = ");
3406 }
3407 strcat(templateString, argument);
3408 paramCount++;
3409 lastParam = p;
3410 }
3411 p++;
3412 }
3413 }
3414 }
3415 {
3416 int len = strlen(templateString);
3417
3418 if(templateString[len - 1] == '<')
3419 len--;
3420 else
3421 {
3422 if(templateString[len - 1] == '>')
3423 templateString[len++] = ' ';
3424 templateString[len++] = '>';
3425 }
3426 templateString[len++] = '\0';
3427 }
3428 {
3429 struct Context * context = SetupTemplatesContext(_class);
3430
3431 if(freeType)
3432 FreeType(type);
3433 type = ProcessTypeString(templateString, 0x0);
3434 freeType = 0x1;
3435 FinishTemplatesContext(context);
3436 }
3437 }
3438 if(method && member->initializer && member->initializer->type == 0 && member->initializer->exp)
3439 {
3440 ProcessExpressionType(member->initializer->exp);
3441 if(!member->initializer->exp->expType)
3442 {
3443 if(inCompiler)
3444 {
3445 char expString[10240];
3446
3447 expString[0] = '\0';
3448 PrintExpression(member->initializer->exp, expString);
3449 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
3450 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "unresolved symbol used as an instance method %s\n", (((void *)0))), expString);
3451 }
3452 }
3453 else if(!MatchTypes(member->initializer->exp->expType, type, (((void *)0)), (((void *)0)), _class, 0x1, 0x1, 0x0, 0x0))
3454 {
3455 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible instance method %s\n", (((void *)0))), ident->string);
3456 }
3457 }
3458 else if(member->initializer)
3459 {
3460 ProcessInitializer(member->initializer, type);
3461 }
3462 if(freeType)
3463 FreeType(type);
3464 }
3465 else
3466 {
3467 if(_class && _class->type == 3)
3468 {
3469 if(member->initializer)
3470 {
3471 struct Type * type = MkClassType(_class->fullName);
3472
3473 ProcessInitializer(member->initializer, type);
3474 FreeType(type);
3475 }
3476 }
3477 else
3478 {
3479 if(member->initializer)
3480 {
3481 ProcessInitializer(member->initializer, (((void *)0)));
3482 }
3483 if(ident)
3484 {
3485 if(method)
3486 {
3487 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't find virtual method %s in class %s\n", (((void *)0))), ident->string, _class->fullName);
3488 }
3489 else if(_class)
3490 {
3491 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't find member %s in class %s\n", (((void *)0))), ident->string, _class->fullName);
3492 if(inCompiler)
3493 __ecereNameSpace__ecere__com__eClass_AddDataMember(_class, ident->string, "int", 0, 0, 1);
3494 }
3495 }
3496 else if(_class)
3497 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "too many initializers for instantiation of class %s\n", (((void *)0))), _class->fullName);
3498 }
3499 }
3500 }
3501
3502 extern struct Identifier * GetDeclId(struct Declarator * decl);
3503
3504 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);
3505
3506 extern void FreeSpecifier(struct Specifier * spec);
3507
3508 static void ProcessFunction(struct FunctionDefinition * function);
3509
3510 extern struct __ecereNameSpace__ecere__sys__OldList *  CopyList(struct __ecereNameSpace__ecere__sys__OldList *  source, void *  (* )(void * ));
3511
3512 extern struct Specifier * CopySpecifier(struct Specifier * spec);
3513
3514 extern struct Declarator * CopyDeclarator(struct Declarator * declarator);
3515
3516 extern void FreeClassFunction(struct ClassFunction * func);
3517
3518 extern struct MemberInit * MkMemberInit(struct __ecereNameSpace__ecere__sys__OldList * ids, struct Initializer * initializer);
3519
3520 extern struct Initializer * MkInitializerAssignment(struct Expression * exp);
3521
3522 void ProcessInstantiationType(struct Instantiation * inst)
3523 {
3524 yylloc = inst->loc;
3525 if(inst->_class)
3526 {
3527 struct MembersInit * members;
3528 struct Symbol * classSym;
3529 struct __ecereNameSpace__ecere__com__Class * _class;
3530
3531 classSym = inst->_class->symbol;
3532 _class = classSym ? classSym->registered : (((void *)0));
3533 if(!_class || _class->type != 5)
3534 DeclareStruct(inst->_class->name, 0x0);
3535 afterExternal = afterExternal ? afterExternal : curExternal;
3536 if(inst->exp)
3537 ProcessExpressionType(inst->exp);
3538 inst->isConstant = 0x1;
3539 if(inst->members)
3540 {
3541 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
3542 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
3543 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
3544 int subMemberStackPos = 0;
3545
3546 for(members = (*inst->members).first; members; members = members->next)
3547 {
3548 switch(members->type)
3549 {
3550 case 1:
3551 {
3552 char name[1024];
3553 static unsigned int instMethodID = 0;
3554 struct External * external = curExternal;
3555 struct Context * context = curContext;
3556 struct Declarator * declarator = members->function->declarator;
3557 struct Identifier * nameID = GetDeclId(declarator);
3558 char * unmangled = nameID ? nameID->string : (((void *)0));
3559 struct Expression * exp;
3560 struct External * createdExternal = (((void *)0));
3561
3562 if(inCompiler)
3563 {
3564 char number[16];
3565
3566 strcpy(name, "__ecereInstMeth_");
3567 FullClassNameCat(name, _class ? _class->fullName : "_UNKNOWNCLASS", 0x0);
3568 strcat(name, "_");
3569 strcat(name, nameID->string);
3570 strcat(name, "_");
3571 sprintf(number, "_%08d", instMethodID++);
3572 strcat(name, number);
3573 nameID->string = __ecereNameSpace__ecere__sys__CopyString(name);
3574 }
3575 if(declarator)
3576 {
3577 struct Symbol * symbol = declarator->symbol;
3578 struct __ecereNameSpace__ecere__com__Method * method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, unmangled, privateModule);
3579
3580 if(method && method->type == 1)
3581 {
3582 symbol->method = method;
3583 ProcessMethodType(method);
3584 if(!symbol->type->thisClass)
3585 {
3586 if(method->dataType->thisClass && currentClass && __ecereNameSpace__ecere__com__eClass_IsDerived(currentClass, method->dataType->thisClass->registered))
3587 {
3588 if(!currentClass->symbol)
3589 currentClass->symbol = FindClass(currentClass->fullName);
3590 symbol->type->thisClass = currentClass->symbol;
3591 }
3592 else
3593 {
3594 if(!_class->symbol)
3595 _class->symbol = FindClass(_class->fullName);
3596 symbol->type->thisClass = _class->symbol;
3597 }
3598 }
3599 DeclareType(symbol->type, 0x1, 0x1);
3600 }
3601 else if(classSym)
3602 {
3603 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't find virtual method %s in class %s\n", (((void *)0))), unmangled, classSym->string);
3604 }
3605 }
3606 createdExternal = ProcessClassFunction(classSym ? classSym->registered : (((void *)0)), members->function, ast, afterExternal, 0x1);
3607 if(nameID)
3608 {
3609 FreeSpecifier(nameID->_class);
3610 nameID->_class = (((void *)0));
3611 }
3612 if(inCompiler)
3613 {
3614 struct Type * type = declarator->symbol->type;
3615 struct External * oldExternal = curExternal;
3616
3617 declarator->symbol->id = declarator->symbol->idCode = curExternal->symbol->idCode;
3618 {
3619 struct External * externalDecl;
3620
3621 externalDecl = MkExternalDeclaration((((void *)0)));
3622 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), oldExternal->prev, externalDecl);
3623 if(createdExternal->function)
3624 {
3625 ProcessFunction(createdExternal->function);
3626 {
3627 struct Declaration * decl = MkDeclaration(CopyList(createdExternal->function->specifiers, CopySpecifier), MkListOne(MkInitDeclarator(CopyDeclarator(declarator), (((void *)0)))));
3628
3629 externalDecl->declaration = decl;
3630 if(decl->symbol && !decl->symbol->pointerExternal)
3631 decl->symbol->pointerExternal = externalDecl;
3632 declarator->symbol->pointerExternal = externalDecl;
3633 }
3634 }
3635 }
3636 }
3637 else if(declarator)
3638 {
3639 curExternal = declarator->symbol->pointerExternal;
3640 ProcessFunction((struct FunctionDefinition *)members->function);
3641 }
3642 curExternal = external;
3643 curContext = context;
3644 if(inCompiler)
3645 {
3646 FreeClassFunction(members->function);
3647 exp = QMkExpId(name);
3648 members->type = 0;
3649 members->dataMembers = MkListOne(MkMemberInit(MkListOne(MkIdentifier(unmangled)), MkInitializerAssignment(exp)));
3650 (__ecereNameSpace__ecere__com__eSystem_Delete(unmangled), unmangled = 0);
3651 }
3652 break;
3653 }
3654 case 0:
3655 {
3656 if(members->dataMembers && classSym)
3657 {
3658 struct MemberInit * member;
3659 struct Location oldyyloc = yylloc;
3660
3661 for(member = (*members->dataMembers).first; member; member = member->next)
3662 {
3663 ProcessMemberInitData(member, classSym->registered, &curClass, &curMember, subMemberStack, &subMemberStackPos);
3664 if(member->initializer && !member->initializer->isConstant)
3665 inst->isConstant = 0x0;
3666 }
3667 yylloc = oldyyloc;
3668 }
3669 break;
3670 }
3671 }
3672 }
3673 }
3674 }
3675 }
3676
3677 static void DeclareType(struct Type * type, unsigned int declarePointers, unsigned int declareParams)
3678 {
3679 if(inCompiler)
3680 {
3681 if(type->kind == 11)
3682 {
3683 struct Type * param;
3684
3685 if(declareParams)
3686 {
3687 for(param = type->params.first; param; param = param->next)
3688 DeclareType(param, declarePointers, 0x1);
3689 }
3690 DeclareType(type->returnType, declarePointers, 0x1);
3691 }
3692 else if(type->kind == 13 && declarePointers)
3693 DeclareType(type->type, declarePointers, 0x0);
3694 else if(type->kind == 8)
3695 {
3696 if(type->_class->registered && (type->_class->registered->type == 1 || type->_class->registered->type == 5) && !type->_class->declaring)
3697 DeclareStruct(type->_class->registered->fullName, type->_class->registered->type == 5);
3698 }
3699 else if(type->kind == 9 || type->kind == 10)
3700 {
3701 struct Type * member;
3702
3703 for(member = type->members.first; member; member = member->next)
3704 DeclareType(member, 0x0, 0x0);
3705 }
3706 else if(type->kind == 12)
3707 DeclareType(type->arrayType, declarePointers, 0x0);
3708 }
3709 }
3710
3711 extern struct __ecereNameSpace__ecere__com__Class * __ecereNameSpace__ecere__com__eSystem_FindClass(struct __ecereNameSpace__ecere__com__Instance * module, char *  name);
3712
3713 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * FindTemplateArg(struct __ecereNameSpace__ecere__com__Class * _class, struct TemplateParameter * param)
3714 {
3715 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * arg = (((void *)0));
3716 int id = 0;
3717 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam;
3718 struct __ecereNameSpace__ecere__com__Class * sClass;
3719
3720 for(sClass = _class; sClass; sClass = sClass->base)
3721 {
3722 id = 0;
3723 if(sClass->templateClass)
3724 sClass = sClass->templateClass;
3725 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
3726 {
3727 if(curParam->type == 0 && !strcmp(param->identifier->string, curParam->name))
3728 {
3729 for(sClass = sClass->base; sClass; sClass = sClass->base)
3730 {
3731 if(sClass->templateClass)
3732 sClass = sClass->templateClass;
3733 id += sClass->templateParams.count;
3734 }
3735 break;
3736 }
3737 id++;
3738 }
3739 if(curParam)
3740 break;
3741 }
3742 if(curParam)
3743 {
3744 arg = &_class->templateArgs[id];
3745 if(arg && param->type == 0)
3746 (*arg).dataTypeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, (*arg).dataTypeString);
3747 }
3748 return arg;
3749 }
3750
3751 extern struct Context * PushContext(void);
3752
3753 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplatedType;
3754
3755 struct TemplatedType
3756 {
3757 unsigned int key;
3758 struct __ecereNameSpace__ecere__sys__BTNode * parent;
3759 struct __ecereNameSpace__ecere__sys__BTNode * left;
3760 struct __ecereNameSpace__ecere__sys__BTNode * right;
3761 int depth;
3762 struct TemplateParameter * param;
3763 };
3764
3765 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(struct __ecereNameSpace__ecere__sys__BinaryTree * this, struct __ecereNameSpace__ecere__sys__BTNode * node);
3766
3767 struct Context * SetupTemplatesContext(struct __ecereNameSpace__ecere__com__Class * _class)
3768 {
3769 void * __ecereTemp1;
3770 struct Context * context = PushContext();
3771
3772 context->templateTypesOnly = 0x1;
3773 if(_class->symbol && ((struct Symbol *)_class->symbol)->templateParams)
3774 {
3775 struct TemplateParameter * param = (*((struct Symbol *)_class->symbol)->templateParams).first;
3776
3777 for(; param; param = param->next)
3778 {
3779 if(param->type == 0 && param->identifier)
3780 {
3781 struct TemplatedType * type = (type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TemplatedType), type->key = (unsigned int)param->identifier->string, type->param = param, type);
3782
3783 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&curContext->templateTypes, (struct __ecereNameSpace__ecere__sys__BTNode *)type);
3784 }
3785 }
3786 }
3787 else if(_class)
3788 {
3789 struct __ecereNameSpace__ecere__com__Class * sClass;
3790
3791 for(sClass = _class; sClass; sClass = sClass->base)
3792 {
3793 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * p;
3794
3795 for(p = sClass->templateParams.first; p; p = p->next)
3796 {
3797 if(p->type == 0)
3798 {
3799 struct TemplateParameter * param = p->param;
3800 struct TemplatedType * type;
3801
3802 if(!param)
3803 {
3804 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));
3805 }
3806 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));
3807 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&curContext->templateTypes, (struct __ecereNameSpace__ecere__sys__BTNode *)type);
3808 }
3809 }
3810 }
3811 }
3812 return context;
3813 }
3814
3815 extern void PopContext(struct Context * ctx);
3816
3817 extern void FreeContext(struct Context * context);
3818
3819 void FinishTemplatesContext(struct Context * context)
3820 {
3821 PopContext(context);
3822 FreeContext(context);
3823 ((context ? (__ecereClass_Context->Destructor ? __ecereClass_Context->Destructor(context) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(context)) : 0), context = 0);
3824 }
3825
3826 void ProcessMethodType(struct __ecereNameSpace__ecere__com__Method * method)
3827 {
3828 if(!method->dataType)
3829 {
3830 struct Context * context = SetupTemplatesContext(method->_class);
3831
3832 method->dataType = ProcessTypeString(method->dataTypeString, 0x0);
3833 FinishTemplatesContext(context);
3834 if(method->type != 1 && method->dataType)
3835 {
3836 if(!method->dataType->thisClass && !method->dataType->staticMethod)
3837 {
3838 if(!method->_class->symbol)
3839 method->_class->symbol = FindClass(method->_class->fullName);
3840 method->dataType->thisClass = method->_class->symbol;
3841 }
3842 }
3843 }
3844 }
3845
3846 void ProcessPropertyType(struct __ecereNameSpace__ecere__com__Property * prop)
3847 {
3848 if(!prop->dataType)
3849 {
3850 struct Context * context = SetupTemplatesContext(prop->_class);
3851
3852 prop->dataType = ProcessTypeString(prop->dataTypeString, 0x0);
3853 FinishTemplatesContext(context);
3854 }
3855 }
3856
3857 extern struct Declarator * GetFuncDecl(struct Declarator * decl);
3858
3859 extern void FreeTypeName(struct TypeName * typeName);
3860
3861 static void ProcessDeclarator(struct Declarator * decl);
3862
3863 extern struct __ecereNameSpace__ecere__sys__OldList *  excludedSymbols;
3864
3865 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_MethodImport;
3866
3867 struct MethodImport
3868 {
3869 struct MethodImport * prev;
3870 struct MethodImport * next;
3871 char *  name;
3872 unsigned int isVirtual;
3873 };
3874
3875 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(struct __ecereNameSpace__ecere__sys__OldList * this, void *  item);
3876
3877 void DeclareMethod(struct __ecereNameSpace__ecere__com__Method * method, char * name)
3878 {
3879 void * __ecereTemp1;
3880 struct Symbol * symbol = method->symbol;
3881
3882 if(!symbol || (!symbol->pointerExternal && method->type == 1) || symbol->id > (curExternal ? curExternal->symbol->idCode : -1))
3883 {
3884 unsigned int imported = 0x0;
3885 unsigned int dllImport = 0x0;
3886
3887 if(!method->dataType)
3888 method->dataType = ProcessTypeString(method->dataTypeString, 0x0);
3889 if(!symbol || symbol->_import || method->type == 1)
3890 {
3891 if(!symbol || method->type == 1)
3892 {
3893 struct Symbol * classSym;
3894
3895 if(!method->_class->symbol)
3896 method->_class->symbol = FindClass(method->_class->fullName);
3897 classSym = method->_class->symbol;
3898 if(!classSym->_import)
3899 {
3900 struct ModuleImport * module;
3901
3902 if(method->_class->module && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)method->_class->module + 12)))->name)
3903 module = FindModule(method->_class->module);
3904 else
3905 module = mainModule;
3906 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));
3907 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->classes, classSym->_import);
3908 }
3909 if(!symbol)
3910 {
3911 symbol = method->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
3912 }
3913 if(!symbol->_import)
3914 {
3915 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));
3916 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&classSym->_import->methods, symbol->_import);
3917 }
3918 if(!symbol)
3919 {
3920 symbol->type = method->dataType;
3921 if(symbol->type)
3922 symbol->type->refCount++;
3923 }
3924 }
3925 if(!method->dataType->dllExport)
3926 {
3927 imported = 0x1;
3928 if(method->_class->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)method->_class->module + 12)))->importType != 1)
3929 dllImport = 0x1;
3930 }
3931 }
3932 if(method->type != 1 && method->dataType)
3933 DeclareType(method->dataType, 0x1, 0x1);
3934 if(!symbol->pointerExternal || symbol->pointerExternal->type == 0)
3935 {
3936 struct Declaration * decl;
3937 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
3938 struct Declarator * d;
3939 struct Declarator * funcDecl;
3940 struct External * external;
3941
3942 specifiers = MkList();
3943 declarators = MkList();
3944 if(dllImport)
3945 ListAdd(specifiers, MkSpecifier(EXTERN));
3946 else if(method->_class->symbol && ((struct Symbol *)method->_class->symbol)->isStatic)
3947 ListAdd(specifiers, MkSpecifier(STATIC));
3948 if(method->type == 1)
3949 {
3950 ListAdd(specifiers, MkSpecifier(INT));
3951 d = MkDeclaratorIdentifier(MkIdentifier(name));
3952 }
3953 else
3954 {
3955 d = MkDeclaratorIdentifier(MkIdentifier(name));
3956 if(dllImport)
3957 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
3958 {
3959 struct Context * context = SetupTemplatesContext(method->_class);
3960
3961 d = SpecDeclFromString(method->dataTypeString, specifiers, d);
3962 FinishTemplatesContext(context);
3963 }
3964 funcDecl = GetFuncDecl(d);
3965 if(dllImport)
3966 {
3967 struct Specifier * spec, * next;
3968
3969 for(spec = (*specifiers).first; spec; spec = next)
3970 {
3971 next = spec->next;
3972 if(spec->type == 5)
3973 {
3974 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*specifiers), spec);
3975 FreeSpecifier(spec);
3976 }
3977 }
3978 }
3979 if(method->dataType && !method->dataType->staticMethod)
3980 {
3981 if(funcDecl && funcDecl->function.parameters && (*funcDecl->function.parameters).count)
3982 {
3983 struct __ecereNameSpace__ecere__com__Class * _class = method->dataType->thisClass ? method->dataType->thisClass->registered : method->_class;
3984 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")));
3985 struct TypeName * firstParam = ((struct TypeName *)(*funcDecl->function.parameters).first);
3986 struct Specifier * firstSpec = firstParam->qualifiers ? (*firstParam->qualifiers).first : (((void *)0));
3987
3988 if(firstSpec && firstSpec->type == 0 && firstSpec->specifier == VOID && !firstParam->declarator)
3989 {
3990 struct TypeName * param = (*funcDecl->function.parameters).first;
3991
3992 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->function.parameters), param);
3993 FreeTypeName(param);
3994 }
3995 if(!funcDecl->function.parameters)
3996 funcDecl->function.parameters = MkList();
3997 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
3998 }
3999 }
4000 }
4001 ProcessDeclarator(d);
4002 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
4003 decl = MkDeclaration(specifiers, declarators);
4004 ReplaceThisClassSpecifiers(specifiers, method->_class);
4005 if(symbol->pointerExternal)
4006 {
4007 struct Symbol * functionSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4008
4009 {
4010 *functionSymbol = *symbol;
4011 functionSymbol->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
4012 if(functionSymbol->type)
4013 functionSymbol->type->refCount++;
4014 }
4015 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*excludedSymbols), functionSymbol);
4016 symbol->pointerExternal->symbol = functionSymbol;
4017 }
4018 external = MkExternalDeclaration(decl);
4019 if(curExternal)
4020 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal ? curExternal->prev : (((void *)0)), external);
4021 external->symbol = symbol;
4022 symbol->pointerExternal = external;
4023 }
4024 else if(ast)
4025 {
4026 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
4027 }
4028 symbol->id = curExternal ? curExternal->symbol->idCode : (((int)0x7fffffff));
4029 }
4030 }
4031
4032 char * ReplaceThisClass(struct __ecereNameSpace__ecere__com__Class * _class)
4033 {
4034 if(thisClassParams && _class->templateParams.count && !_class->templateClass)
4035 {
4036 unsigned int first = 0x1;
4037 int p = 0;
4038 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
4039 int lastParam = -1;
4040 char className[1024];
4041
4042 strcpy(className, _class->fullName);
4043 for(param = _class->templateParams.first; param; param = param->next)
4044 {
4045 {
4046 if(first)
4047 strcat(className, "<");
4048 if(!first)
4049 strcat(className, ", ");
4050 if(lastParam + 1 != p)
4051 {
4052 strcat(className, param->name);
4053 strcat(className, " = ");
4054 }
4055 strcat(className, param->name);
4056 first = 0x0;
4057 lastParam = p;
4058 }
4059 p++;
4060 }
4061 if(!first)
4062 {
4063 int len = strlen(className);
4064
4065 if(className[len - 1] == '>')
4066 className[len++] = ' ';
4067 className[len++] = '>';
4068 className[len++] = '\0';
4069 }
4070 return __ecereNameSpace__ecere__sys__CopyString(className);
4071 }
4072 else
4073 return __ecereNameSpace__ecere__sys__CopyString(_class->fullName);
4074 }
4075
4076 struct Type * ReplaceThisClassType(struct __ecereNameSpace__ecere__com__Class * _class)
4077 {
4078 if(thisClassParams && _class->templateParams.count && !_class->templateClass)
4079 {
4080 unsigned int first = 0x1;
4081 int p = 0;
4082 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
4083 int lastParam = -1;
4084 char className[1024];
4085
4086 strcpy(className, _class->fullName);
4087 for(param = _class->templateParams.first; param; param = param->next)
4088 {
4089 {
4090 if(first)
4091 strcat(className, "<");
4092 if(!first)
4093 strcat(className, ", ");
4094 if(lastParam + 1 != p)
4095 {
4096 strcat(className, param->name);
4097 strcat(className, " = ");
4098 }
4099 strcat(className, param->name);
4100 first = 0x0;
4101 lastParam = p;
4102 }
4103 p++;
4104 }
4105 if(!first)
4106 {
4107 int len = strlen(className);
4108
4109 if(className[len - 1] == '>')
4110 className[len++] = ' ';
4111 className[len++] = '>';
4112 className[len++] = '\0';
4113 }
4114 return MkClassType(className);
4115 }
4116 else
4117 {
4118 return MkClassType(_class->fullName);
4119 }
4120 }
4121
4122 void ReplaceThisClassSpecifiers(struct __ecereNameSpace__ecere__sys__OldList * specs, struct __ecereNameSpace__ecere__com__Class * _class)
4123 {
4124 if(specs != (((void *)0)) && _class)
4125 {
4126 struct Specifier * spec;
4127
4128 for(spec = specs->first; spec; spec = spec->next)
4129 {
4130 if(spec->type == 0 && spec->specifier == THISCLASS)
4131 {
4132 spec->type = 1;
4133 spec->name = ReplaceThisClass(_class);
4134 spec->symbol = FindClass(spec->name);
4135 }
4136 }
4137 }
4138 }
4139
4140 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__GlobalFunction;
4141
4142 struct __ecereNameSpace__ecere__com__GlobalFunction
4143 {
4144 struct __ecereNameSpace__ecere__com__GlobalFunction * prev;
4145 struct __ecereNameSpace__ecere__com__GlobalFunction * next;
4146 char *  name;
4147 int (*  function)();
4148 struct __ecereNameSpace__ecere__com__Instance * module;
4149 struct __ecereNameSpace__ecere__com__NameSpace *  nameSpace;
4150 char *  dataTypeString;
4151 struct Type * dataType;
4152 void *  symbol;
4153 };
4154
4155 extern struct Context * globalContext;
4156
4157 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_FunctionImport;
4158
4159 struct FunctionImport
4160 {
4161 struct FunctionImport * prev;
4162 struct FunctionImport * next;
4163 char *  name;
4164 };
4165
4166 unsigned int DeclareFunction(struct __ecereNameSpace__ecere__com__GlobalFunction * function, char * name)
4167 {
4168 void * __ecereTemp1;
4169 struct Symbol * symbol = function->symbol;
4170
4171 if(curExternal && (!symbol || symbol->id > curExternal->symbol->idCode))
4172 {
4173 unsigned int imported = 0x0;
4174 unsigned int dllImport = 0x0;
4175
4176 if(!function->dataType)
4177 {
4178 function->dataType = ProcessTypeString(function->dataTypeString, 0x0);
4179 if(!function->dataType->thisClass)
4180 function->dataType->staticMethod = 0x1;
4181 }
4182 if(inCompiler)
4183 {
4184 if(!symbol)
4185 {
4186 struct ModuleImport * module = FindModule(function->module);
4187
4188 symbol = function->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4189 if(module->name)
4190 {
4191 if(!function->dataType->dllExport)
4192 {
4193 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));
4194 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->functions, symbol->_import);
4195 }
4196 }
4197 {
4198 symbol->type = ProcessTypeString(function->dataTypeString, 0x0);
4199 if(!symbol->type->thisClass)
4200 symbol->type->staticMethod = 0x1;
4201 }
4202 }
4203 imported = symbol->_import ? 0x1 : 0x0;
4204 if(imported && function->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + 12)))->importType != 1)
4205 dllImport = 0x1;
4206 }
4207 DeclareType(function->dataType, 0x1, 0x1);
4208 if(inCompiler)
4209 {
4210 if(!symbol->pointerExternal || symbol->pointerExternal->type == 0)
4211 {
4212 struct Declaration * decl;
4213 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
4214 struct Declarator * d;
4215 struct Declarator * funcDecl;
4216 struct External * external;
4217
4218 specifiers = MkList();
4219 declarators = MkList();
4220 ListAdd(specifiers, MkSpecifier(EXTERN));
4221 d = MkDeclaratorIdentifier(MkIdentifier(imported ? name : function->name));
4222 if(dllImport)
4223 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
4224 d = SpecDeclFromString(function->dataTypeString, specifiers, d);
4225 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + 12)))->importType == 1)
4226 {
4227 struct Specifier * spec;
4228
4229 for(spec = (*specifiers).first; spec; spec = spec->next)
4230 if(spec->type == 5 && !strcmp(spec->name, "dllexport"))
4231 {
4232 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*specifiers), spec);
4233 FreeSpecifier(spec);
4234 break;
4235 }
4236 }
4237 funcDecl = GetFuncDecl(d);
4238 if(funcDecl && !funcDecl->function.parameters)
4239 {
4240 funcDecl->function.parameters = MkList();
4241 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), MkTypeName(MkListOne(MkSpecifier(VOID)), (((void *)0))));
4242 }
4243 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
4244 {
4245 struct Context * oldCtx = curContext;
4246
4247 curContext = globalContext;
4248 decl = MkDeclaration(specifiers, declarators);
4249 curContext = oldCtx;
4250 }
4251 if(symbol->pointerExternal)
4252 {
4253 struct Symbol * functionSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4254
4255 {
4256 *functionSymbol = *symbol;
4257 functionSymbol->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
4258 if(functionSymbol->type)
4259 functionSymbol->type->refCount++;
4260 }
4261 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*excludedSymbols), functionSymbol);
4262 symbol->pointerExternal->symbol = functionSymbol;
4263 }
4264 external = MkExternalDeclaration(decl);
4265 if(curExternal)
4266 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
4267 external->symbol = symbol;
4268 symbol->pointerExternal = external;
4269 }
4270 else
4271 {
4272 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
4273 }
4274 if(curExternal)
4275 symbol->id = curExternal->symbol->idCode;
4276 }
4277 }
4278 return (symbol && symbol->_import && function->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + 12)))->importType != 1) ? 0x1 : 0x0;
4279 }
4280
4281 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_GlobalData;
4282
4283 struct GlobalData
4284 {
4285 unsigned int key;
4286 struct __ecereNameSpace__ecere__sys__BTNode * parent;
4287 struct __ecereNameSpace__ecere__sys__BTNode * left;
4288 struct __ecereNameSpace__ecere__sys__BTNode * right;
4289 int depth;
4290 struct __ecereNameSpace__ecere__com__Instance * module;
4291 char *  dataTypeString;
4292 struct Type * dataType;
4293 void *  symbol;
4294 char *  fullName;
4295 };
4296
4297 void DeclareGlobalData(struct GlobalData * data)
4298 {
4299 struct Symbol * symbol = data->symbol;
4300
4301 if(curExternal && (!symbol || symbol->id > curExternal->symbol->idCode))
4302 {
4303 if(inCompiler)
4304 {
4305 if(!symbol)
4306 symbol = data->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4307 }
4308 if(!data->dataType)
4309 data->dataType = ProcessTypeString(data->dataTypeString, 0x0);
4310 DeclareType(data->dataType, 0x1, 0x1);
4311 if(inCompiler)
4312 {
4313 if(!symbol->pointerExternal)
4314 {
4315 struct Declaration * decl;
4316 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
4317 struct Declarator * d;
4318 struct External * external;
4319
4320 specifiers = MkList();
4321 declarators = MkList();
4322 ListAdd(specifiers, MkSpecifier(EXTERN));
4323 d = MkDeclaratorIdentifier(MkIdentifier(data->fullName));
4324 d = SpecDeclFromString(data->dataTypeString, specifiers, d);
4325 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
4326 decl = MkDeclaration(specifiers, declarators);
4327 external = MkExternalDeclaration(decl);
4328 if(curExternal)
4329 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
4330 external->symbol = symbol;
4331 symbol->pointerExternal = external;
4332 }
4333 else
4334 {
4335 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
4336 }
4337 if(curExternal)
4338 symbol->id = curExternal->symbol->idCode;
4339 }
4340 }
4341 }
4342
4343 struct Conversion
4344 {
4345 struct Conversion * prev, * next;
4346 struct __ecereNameSpace__ecere__com__Property * convert;
4347 unsigned int isGet;
4348 struct Type * resultType;
4349 };
4350
4351 static struct __ecereNameSpace__ecere__com__Class * __ecereClass_Conversion;
4352
4353 extern void Compiler_Warning(char *  format, ...);
4354
4355 void PrintType(struct Type * type, char *  string, unsigned int printName, unsigned int fullName);
4356
4357 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)
4358 {
4359 if(source && dest)
4360 {
4361 if(source->kind == 20 && dest->kind != 20)
4362 {
4363 struct Type * type = ProcessTemplateParameterType(source->templateParameter);
4364
4365 if(type)
4366 source = type;
4367 }
4368 if(dest->kind == 20 && source->kind != 20)
4369 {
4370 struct Type * type = ProcessTemplateParameterType(dest->templateParameter);
4371
4372 if(type)
4373 dest = type;
4374 }
4375 if((dest->classObjectType == 2 && source->classObjectType != 3) || (dest->classObjectType == 3 && source->classObjectType != 2))
4376 {
4377 return 0x1;
4378 }
4379 if(source->classObjectType == 3 && dest->classObjectType != 2)
4380 {
4381 return 0x1;
4382 }
4383 if((dest->kind == 9 && source->kind == 9) || (dest->kind == 10 && source->kind == 10))
4384 {
4385 if((dest->enumName && source->enumName && !strcmp(dest->enumName, source->enumName)) || (source->members.first && source->members.first == dest->members.first))
4386 return 0x1;
4387 }
4388 if(dest->kind == 14 && source->kind != 0)
4389 return 0x1;
4390 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))
4391 return 0x1;
4392 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))
4393 return 0x1;
4394 if(((source->kind == 8 && dest->kind == 8) || (source->kind == 19 && dest->kind == 19)) && source->_class)
4395 {
4396 if(source->_class->registered && source->_class->registered->type == 3)
4397 {
4398 if(conversions != (((void *)0)))
4399 {
4400 if(source->_class->registered == dest->_class->registered)
4401 return 0x1;
4402 }
4403 else
4404 {
4405 struct __ecereNameSpace__ecere__com__Class * sourceBase, * destBase;
4406
4407 for(sourceBase = source->_class->registered; sourceBase && sourceBase->base->type != 1000; sourceBase = sourceBase->base)
4408 ;
4409 for(destBase = dest->_class->registered; destBase && destBase->base->type != 1000; destBase = destBase->base)
4410 ;
4411 if(sourceBase == destBase)
4412 return 0x1;
4413 }
4414 }
4415 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))
4416 return 0x1;
4417 else
4418 {
4419 if(enumBaseType && dest->_class && dest->_class->registered && dest->_class->registered->type == 4 && source->_class && source->_class->registered && source->_class->registered->type != 4)
4420 {
4421 if(__ecereNameSpace__ecere__com__eClass_IsDerived(dest->_class->registered, source->_class->registered))
4422 {
4423 return 0x1;
4424 }
4425 }
4426 }
4427 }
4428 if(source->kind == 19 && dest->kind == 8 && dest->_class && !strcmp(dest->_class->string, "ecere::com::Class"))
4429 return 0x1;
4430 if(doConversion)
4431 {
4432 if(source->kind == 8)
4433 {
4434 struct __ecereNameSpace__ecere__com__Class * _class;
4435
4436 for(_class = source->_class ? source->_class->registered : (((void *)0)); _class; _class = _class->base)
4437 {
4438 struct __ecereNameSpace__ecere__com__Property * convert;
4439
4440 for(convert = _class->conversions.first; convert; convert = convert->next)
4441 {
4442 if(convert->memberAccess == 1 || _class->module == privateModule)
4443 {
4444 struct Conversion * after = (conversions != (((void *)0))) ? conversions->last : (((void *)0));
4445
4446 if(!convert->dataType)
4447 convert->dataType = ProcessTypeString(convert->dataTypeString, 0x0);
4448 if(MatchTypes(convert->dataType, dest, conversions, (((void *)0)), (((void *)0)), 0x0, 0x1, 0x0, 0x1))
4449 {
4450 if(!conversions && !convert->Get)
4451 return 0x1;
4452 else if(conversions != (((void *)0)))
4453 {
4454 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))
4455 return 0x1;
4456 else
4457 {
4458 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv->isGet = 0x1, conv);
4459
4460 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(conversions, after, conv);
4461 return 0x1;
4462 }
4463 }
4464 }
4465 }
4466 }
4467 }
4468 }
4469 if(dest->kind == 8)
4470 {
4471 struct __ecereNameSpace__ecere__com__Class * _class;
4472
4473 for(_class = dest->_class ? dest->_class->registered : (((void *)0)); _class; _class = _class->base)
4474 {
4475 struct __ecereNameSpace__ecere__com__Property * convert;
4476
4477 for(convert = _class->conversions.first; convert; convert = convert->next)
4478 {
4479 if(convert->memberAccess == 1 || _class->module == privateModule)
4480 {
4481 if(!convert->dataType)
4482 convert->dataType = ProcessTypeString(convert->dataTypeString, 0x0);
4483 if(convert->dataType != dest && MatchTypes(source, convert->dataType, conversions, (((void *)0)), (((void *)0)), 0x1, 0x0, 0x0, 0x1))
4484 {
4485 if(!conversions && !convert->Set)
4486 return 0x1;
4487 else if(conversions != (((void *)0)))
4488 {
4489 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))
4490 return 0x1;
4491 else
4492 {
4493 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv);
4494
4495 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(conversions, conv);
4496 return 0x1;
4497 }
4498 }
4499 }
4500 }
4501 }
4502 }
4503 if(enumBaseType && dest->_class && dest->_class->registered && dest->_class->registered->type == 4)
4504 {
4505 if(!dest->_class->registered->dataType)
4506 dest->_class->registered->dataType = ProcessTypeString(dest->_class->registered->dataTypeString, 0x0);
4507 if(dest->_class->registered->dataType->kind == 8 || source->truth || dest->truth)
4508 {
4509 if(MatchTypes(source, dest->_class->registered->dataType, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
4510 {
4511 return 0x1;
4512 }
4513 }
4514 }
4515 }
4516 if(source->kind == 8)
4517 {
4518 struct __ecereNameSpace__ecere__com__Class * _class;
4519
4520 for(_class = source->_class ? source->_class->registered : (((void *)0)); _class; _class = _class->base)
4521 {
4522 struct __ecereNameSpace__ecere__com__Property * convert;
4523
4524 for(convert = _class->conversions.first; convert; convert = convert->next)
4525 {
4526 if(convert->memberAccess == 1 || _class->module == privateModule)
4527 {
4528 struct Conversion * after = (conversions != (((void *)0))) ? conversions->last : (((void *)0));
4529
4530 if(!convert->dataType)
4531 convert->dataType = ProcessTypeString(convert->dataTypeString, 0x0);
4532 if(convert->dataType != source && MatchTypes(convert->dataType, dest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x1))
4533 {
4534 if(!conversions && !convert->Get)
4535 return 0x1;
4536 else if(conversions != (((void *)0)))
4537 {
4538 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))
4539 return 0x1;
4540 else
4541 {
4542 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv->isGet = 0x1, conv);
4543
4544 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(conversions, after, conv);
4545 return 0x1;
4546 }
4547 }
4548 }
4549 }
4550 }
4551 }
4552 if(enumBaseType && source->_class && source->_class->registered && source->_class->registered->type == 4)
4553 {
4554 if(!source->_class->registered->dataType)
4555 source->_class->registered->dataType = ProcessTypeString(source->_class->registered->dataTypeString, 0x0);
4556 if(MatchTypes(source->_class->registered->dataType, dest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
4557 {
4558 return 0x1;
4559 }
4560 }
4561 }
4562 }
4563 if(source->kind == 8 || source->kind == 19)
4564 ;
4565 else if(dest->kind == source->kind && (dest->kind != 9 && dest->kind != 10 && dest->kind != 11 && dest->kind != 12 && dest->kind != 13 && dest->kind != 16))
4566 return 0x1;
4567 else if(dest->kind == 7 && source->kind == 6)
4568 return 0x1;
4569 else if(dest->kind == 2 && source->kind == 1)
4570 return 0x1;
4571 else if(dest->kind == 3 && (source->kind == 2 || source->kind == 1))
4572 return 0x1;
4573 else if(dest->kind == 4 && (source->kind == 2 || source->kind == 1 || source->kind == 3))
4574 return 0x1;
4575 else if(source->kind == 15 && (dest->kind == 3 || dest->kind == 2 || dest->kind == 1 || dest->kind == 5 || dest->kind == 4))
4576 return 0x1;
4577 else if(dest->kind == 15 && (source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 5 || dest->kind == 4))
4578 return 0x1;
4579 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)))
4580 {
4581 struct Type * paramSource, * paramDest;
4582
4583 if(dest->kind == 16)
4584 owningClassDest = dest->methodClass ? dest->methodClass : dest->method->_class;
4585 if(source->kind == 16)
4586 owningClassSource = source->methodClass ? source->methodClass : source->method->_class;
4587 if(dest->kind == 13 && dest->type->kind == 11)
4588 dest = dest->type;
4589 if(source->kind == 13 && source->type->kind == 11)
4590 source = source->type;
4591 if(dest->kind == 16)
4592 dest = dest->method->dataType;
4593 if(source->kind == 16)
4594 source = source->method->dataType;
4595 paramSource = source->params.first;
4596 if(paramSource && paramSource->kind == 0)
4597 paramSource = (((void *)0));
4598 paramDest = dest->params.first;
4599 if(paramDest && paramDest->kind == 0)
4600 paramDest = (((void *)0));
4601 if((dest->staticMethod || (!dest->thisClass && !owningClassDest)) && !(source->staticMethod || (!source->thisClass && !owningClassSource)))
4602 {
4603 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))))
4604 {
4605 if(paramDest && paramDest->kind == 8)
4606 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "method class must be derived from %s\n", (((void *)0))), paramDest->_class->string);
4607 else
4608 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "method class should not take an object\n", (((void *)0))));
4609 return 0x0;
4610 }
4611 paramDest = paramDest->next;
4612 }
4613 else if(!dest->staticMethod && (dest->thisClass || owningClassDest))
4614 {
4615 if((source->staticMethod || (!source->thisClass && !owningClassSource)))
4616 {
4617 if(dest->thisClass)
4618 {
4619 if(!paramSource || paramSource->kind != 8 || !__ecereNameSpace__ecere__com__eClass_IsDerived(paramSource->_class->registered, dest->thisClass->registered))
4620 {
4621 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "method class must be derived from %s\n", (((void *)0))), dest->thisClass->string);
4622 return 0x0;
4623 }
4624 }
4625 else
4626 {
4627 if(!paramSource || paramSource->kind != 8 || (owningClassDest && !__ecereNameSpace__ecere__com__eClass_IsDerived(paramSource->_class->registered, owningClassDest)))
4628 {
4629 if(owningClassDest)
4630 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "%s expected to be derived from method class\n", (((void *)0))), owningClassDest->fullName);
4631 else
4632 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "overriding class expected to be derived from method class\n", (((void *)0))));
4633 return 0x0;
4634 }
4635 }
4636 paramSource = paramSource->next;
4637 }
4638 else
4639 {
4640 if(dest->thisClass)
4641 {
4642 if(!__ecereNameSpace__ecere__com__eClass_IsDerived(source->thisClass ? source->thisClass->registered : owningClassSource, dest->thisClass->registered))
4643 {
4644 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "method class must be derived from %s\n", (((void *)0))), dest->thisClass->string);
4645 return 0x0;
4646 }
4647 }
4648 else
4649 {
4650 if(source->thisClass && source->thisClass->registered && owningClassDest && !__ecereNameSpace__ecere__com__eClass_IsDerived(source->thisClass->registered, owningClassDest))
4651 {
4652 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "%s expected to be derived from method class\n", (((void *)0))), source->thisClass->registered->fullName);
4653 return 0x0;
4654 }
4655 }
4656 }
4657 }
4658 if(!MatchTypes(source->returnType, dest->returnType, (((void *)0)), (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
4659 {
4660 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible return type for function\n", (((void *)0))));
4661 return 0x0;
4662 }
4663 for(; paramDest; paramDest = paramDest->next)
4664 {
4665 if(!paramSource)
4666 {
4667 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "not enough parameters\n", (((void *)0))));
4668 return 0x0;
4669 }
4670 {
4671 struct Type * paramDestType = paramDest;
4672 struct Type * paramSourceType = paramSource;
4673 struct Type * type = paramDestType;
4674
4675 if(paramDest->kind == 20 && paramDest->templateParameter->type == 0 && owningClassSource && paramSource->kind != 20)
4676 {
4677 int id = 0;
4678 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam;
4679 struct __ecereNameSpace__ecere__com__Class * sClass;
4680
4681 for(sClass = owningClassSource; sClass; sClass = sClass->base)
4682 {
4683 id = 0;
4684 if(sClass->templateClass)
4685 sClass = sClass->templateClass;
4686 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
4687 {
4688 if(curParam->type == 0 && !strcmp(type->templateParameter->identifier->string, curParam->name))
4689 {
4690 for(sClass = sClass->base; sClass; sClass = sClass->base)
4691 {
4692 if(sClass->templateClass)
4693 sClass = sClass->templateClass;
4694 id += sClass->templateParams.count;
4695 }
4696 break;
4697 }
4698 id++;
4699 }
4700 if(curParam)
4701 break;
4702 }
4703 if(curParam)
4704 {
4705 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = owningClassSource->templateArgs[id];
4706
4707 paramDestType = type = ProcessTypeString(arg.dataTypeString, 0x0);
4708 }
4709 }
4710 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)))
4711 {
4712 char type[1024];
4713
4714 type[0] = (char)0;
4715 PrintType(paramDest, type, 0x0, 0x1);
4716 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible parameter %s (expected %s)\n", (((void *)0))), paramSource->name, type);
4717 if(paramDestType != paramDest)
4718 FreeType(paramDestType);
4719 return 0x0;
4720 }
4721 if(paramDestType != paramDest)
4722 FreeType(paramDestType);
4723 }
4724 paramSource = paramSource->next;
4725 }
4726 if(paramSource)
4727 {
4728 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "too many parameters\n", (((void *)0))));
4729 return 0x0;
4730 }
4731 return 0x1;
4732 }
4733 else if((dest->kind == 11 || (dest->kind == 13 && dest->type->kind == 11) || dest->kind == 16) && (source->kind == 13 && source->type->kind == 0))
4734 {
4735 return 0x1;
4736 }
4737 else if((dest->kind == 13 || dest->kind == 12) && (source->kind == 12 || source->kind == 13))
4738 {
4739 if(MatchTypes(source->type, dest->type, (((void *)0)), (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
4740 return 0x1;
4741 }
4742 }
4743 return 0x0;
4744 }
4745
4746 static void FreeConvert(struct Conversion * convert)
4747 {
4748 if(convert->resultType)
4749 FreeType(convert->resultType);
4750 }
4751
4752 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__BTNamedLink;
4753
4754 struct __ecereNameSpace__ecere__com__BTNamedLink
4755 {
4756 char *  name;
4757 struct __ecereNameSpace__ecere__com__BTNamedLink * parent;
4758 struct __ecereNameSpace__ecere__com__BTNamedLink * left;
4759 struct __ecereNameSpace__ecere__com__BTNamedLink * right;
4760 int depth;
4761 void *  data;
4762 };
4763
4764 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__EnumClassData;
4765
4766 struct __ecereNameSpace__ecere__com__EnumClassData
4767 {
4768 struct __ecereNameSpace__ecere__sys__OldList values;
4769 int largest;
4770 };
4771
4772 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__NamedLink;
4773
4774 struct __ecereNameSpace__ecere__sys__NamedLink
4775 {
4776 struct __ecereNameSpace__ecere__sys__NamedLink * prev;
4777 struct __ecereNameSpace__ecere__sys__NamedLink * next;
4778 char *  name;
4779 void *  data;
4780 };
4781
4782 extern void FreeExpContents(struct Expression * exp);
4783
4784 struct __ecereNameSpace__ecere__sys__BTNode * __ecereProp___ecereNameSpace__ecere__sys__BinaryTree_Get_first(struct __ecereNameSpace__ecere__sys__BinaryTree * this);
4785
4786 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp___ecereNameSpace__ecere__sys__BinaryTree_first;
4787
4788 struct __ecereNameSpace__ecere__sys__BTNode * __ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_next(struct __ecereNameSpace__ecere__sys__BTNode * this);
4789
4790 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp___ecereNameSpace__ecere__sys__BTNode_next;
4791
4792 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(struct __ecereNameSpace__ecere__sys__OldList * this, void (*  freeFn)(void * ));
4793
4794 unsigned int MatchWithEnums_NameSpace(struct __ecereNameSpace__ecere__com__NameSpace * nameSpace, struct Expression * sourceExp, struct Type * dest, char * string, struct __ecereNameSpace__ecere__sys__OldList * conversions)
4795 {
4796 struct __ecereNameSpace__ecere__com__BTNamedLink * link;
4797
4798 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)))
4799 {
4800 struct __ecereNameSpace__ecere__com__Class * _class = link->data;
4801
4802 if(_class->type == 4)
4803 {
4804 struct __ecereNameSpace__ecere__sys__OldList converts = 
4805 {
4806 0, 0, 0, 0, 0
4807 };
4808 struct Type * type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
4809
4810 type->kind = 8;
4811 if(!_class->symbol)
4812 _class->symbol = FindClass(_class->fullName);
4813 type->_class = _class->symbol;
4814 if(MatchTypes(type, dest, &converts, (((void *)0)), (((void *)0)), 0x1, 0x0, 0x0, 0x0))
4815 {
4816 struct __ecereNameSpace__ecere__sys__NamedLink * value;
4817 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
4818
4819 if(enumClass)
4820 {
4821 struct __ecereNameSpace__ecere__com__Class * baseClass;
4822
4823 for(baseClass = _class; baseClass && baseClass->type == 4; baseClass = baseClass->base)
4824 {
4825 struct __ecereNameSpace__ecere__com__EnumClassData * e = (baseClass ? ((void *)(((char *)baseClass->data) + enumClass->offsetClass)) : (((void *)0)));
4826
4827 for(value = e->values.first; value; value = value->next)
4828 {
4829 if(!strcmp(value->name, string))
4830 break;
4831 }
4832 if(value)
4833 {
4834 FreeExpContents(sourceExp);
4835 FreeType(sourceExp->expType);
4836 sourceExp->isConstant = 0x1;
4837 sourceExp->expType = MkClassType(baseClass->fullName);
4838 {
4839 char constant[256];
4840
4841 sourceExp->type = 2;
4842 if(!strcmp(baseClass->dataTypeString, "int"))
4843 sprintf(constant, "%d", value->data);
4844 else
4845 sprintf(constant, "0x%X", value->data);
4846 sourceExp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
4847 }
4848 while(converts.first)
4849 {
4850 struct Conversion * convert = converts.first;
4851
4852 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(&converts, convert);
4853 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(conversions, convert);
4854 }
4855 ((type ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(type) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(type)) : 0), type = 0);
4856 return 0x1;
4857 }
4858 }
4859 }
4860 }
4861 if(converts.first)
4862 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(&converts, FreeConvert);
4863 ((type ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(type) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(type)) : 0), type = 0);
4864 }
4865 }
4866 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)))
4867 if(MatchWithEnums_NameSpace(nameSpace, sourceExp, dest, string, conversions))
4868 return 0x1;
4869 return 0x0;
4870 }
4871
4872 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__SubModule;
4873
4874 struct __ecereNameSpace__ecere__com__SubModule
4875 {
4876 struct __ecereNameSpace__ecere__com__SubModule * prev;
4877 struct __ecereNameSpace__ecere__com__SubModule * next;
4878 struct __ecereNameSpace__ecere__com__Instance * module;
4879 int importMode;
4880 };
4881
4882 unsigned int ModuleVisibility(struct __ecereNameSpace__ecere__com__Instance * searchIn, struct __ecereNameSpace__ecere__com__Instance * searchFor)
4883 {
4884 struct __ecereNameSpace__ecere__com__SubModule * subModule;
4885
4886 if(searchFor == searchIn)
4887 return 0x1;
4888 for(subModule = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)searchIn + 12)))->modules.first; subModule; subModule = subModule->next)
4889 {
4890 if(subModule->importMode == 1 || searchIn == ((struct __ecereNameSpace__ecere__com__Module *)(((char *)searchIn + 12)))->application)
4891 {
4892 if(ModuleVisibility(subModule->module, searchFor))
4893 return 0x1;
4894 }
4895 }
4896 return 0x0;
4897 }
4898
4899 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Application;
4900
4901 struct __ecereNameSpace__ecere__com__Application
4902 {
4903 int argc;
4904 char * *  argv;
4905 int exitCode;
4906 unsigned int isGUIApp;
4907 struct __ecereNameSpace__ecere__sys__OldList allModules;
4908 char *  parsedCommand;
4909 struct __ecereNameSpace__ecere__com__NameSpace systemNameSpace;
4910 };
4911
4912 unsigned int MatchWithEnums_Module(struct __ecereNameSpace__ecere__com__Instance * mainModule, struct Expression * sourceExp, struct Type * dest, char * string, struct __ecereNameSpace__ecere__sys__OldList * conversions)
4913 {
4914 struct __ecereNameSpace__ecere__com__Instance * module;
4915
4916 if(MatchWithEnums_NameSpace(&((struct __ecereNameSpace__ecere__com__Application *)(((char *)((struct __ecereNameSpace__ecere__com__Module *)(((char *)mainModule + 12)))->application + 300)))->systemNameSpace, sourceExp, dest, string, conversions))
4917 return 0x1;
4918 if(MatchWithEnums_NameSpace(&((struct __ecereNameSpace__ecere__com__Module *)(((char *)((struct __ecereNameSpace__ecere__com__Module *)(((char *)mainModule + 12)))->application + 12)))->privateNameSpace, sourceExp, dest, string, conversions))
4919 return 0x1;
4920 if(MatchWithEnums_NameSpace(&((struct __ecereNameSpace__ecere__com__Module *)(((char *)((struct __ecereNameSpace__ecere__com__Module *)(((char *)mainModule + 12)))->application + 12)))->publicNameSpace, sourceExp, dest, string, conversions))
4921 return 0x1;
4922 for(module = ((struct __ecereNameSpace__ecere__com__Application *)(((char *)((struct __ecereNameSpace__ecere__com__Module *)(((char *)mainModule + 12)))->application + 300)))->allModules.first; module; module = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + 12)))->next)
4923 {
4924 if(ModuleVisibility(mainModule, module) && MatchWithEnums_NameSpace(&((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + 12)))->publicNameSpace, sourceExp, dest, string, conversions))
4925 return 0x1;
4926 }
4927 return 0x0;
4928 }
4929
4930 extern unsigned long strtoul(const char *  nptr, char * *  endptr, int base);
4931
4932 void ReadString(char *  output, char *  string);
4933
4934 extern struct Specifier * MkEnum(struct Identifier * id, struct __ecereNameSpace__ecere__sys__OldList * list);
4935
4936 extern struct TypeName * QMkClass(char *  spec, struct Declarator * decl);
4937
4938 extern struct Expression * MkExpBrackets(struct __ecereNameSpace__ecere__sys__OldList * expressions);
4939
4940 unsigned int MatchTypeExpression(struct Expression * sourceExp, struct Type * dest, struct __ecereNameSpace__ecere__sys__OldList * conversions, unsigned int skipUnitBla)
4941 {
4942 void * __ecereTemp1;
4943 struct Type * source = sourceExp->expType;
4944 struct Type * realDest = dest;
4945
4946 if(dest->kind == 13 && sourceExp->type == 2 && !strtoul(sourceExp->constant, (((void *)0)), 0))
4947 return 0x1;
4948 if(!skipUnitBla && source && dest && source->kind == 8 && dest->kind == 8)
4949 {
4950 if(source->_class && source->_class->registered && source->_class->registered->type == 3)
4951 {
4952 struct __ecereNameSpace__ecere__com__Class * sourceBase, * destBase;
4953
4954 for(sourceBase = source->_class->registered; sourceBase && sourceBase->base && sourceBase->base->type != 1000; sourceBase = sourceBase->base)
4955 ;
4956 for(destBase = dest->_class->registered; destBase && destBase->base && destBase->base->type != 1000; destBase = destBase->base)
4957 ;
4958 if(sourceBase == destBase)
4959 return 0x1;
4960 }
4961 }
4962 if(source)
4963 {
4964 struct __ecereNameSpace__ecere__sys__OldList * specs;
4965 unsigned int flag = 0x0;
4966 long long value = (((int)0x7fffffff));
4967
4968 source->refCount++;
4969 dest->refCount++;
4970 if(sourceExp->type == 2)
4971 {
4972 if(source->isSigned)
4973 value = strtoll(sourceExp->constant, (((void *)0)), 0);
4974 else
4975 value = strtoull(sourceExp->constant, (((void *)0)), 0);
4976 }
4977 else if(sourceExp->type == 4 && sourceExp->op.op == '-' && !sourceExp->op.exp1 && sourceExp->op.exp2 && sourceExp->op.exp2->type == 2)
4978 {
4979 if(source->isSigned)
4980 value = -strtoll(sourceExp->op.exp2->constant, (((void *)0)), 0);
4981 else
4982 value = -strtoull(sourceExp->op.exp2->constant, (((void *)0)), 0);
4983 }
4984 if(dest->kind != 8 && source->kind == 8 && source->_class && source->_class->registered && !strcmp(source->_class->registered->fullName, "ecere::com::unichar"))
4985 {
4986 FreeType(source);
4987 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));
4988 }
4989 if(dest->kind == 8)
4990 {
4991 struct __ecereNameSpace__ecere__com__Class * _class = dest->_class ? dest->_class->registered : (((void *)0));
4992
4993 if(_class && _class->type == 3)
4994 {
4995 if(source->kind != 8)
4996 {
4997 struct Type * tempType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
4998 struct Type * tempDest, * tempSource;
4999
5000 for(; _class->base->type != 1000; _class = _class->base)
5001 ;
5002 tempSource = dest;
5003 tempDest = tempType;
5004 tempType->kind = 8;
5005 if(!_class->symbol)
5006 _class->symbol = FindClass(_class->fullName);
5007 tempType->_class = _class->symbol;
5008 tempType->truth = dest->truth;
5009 if(tempType->_class)
5010 MatchTypes(tempSource, tempDest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0);
5011 FreeType(sourceExp->expType);
5012 sourceExp->expType = dest;
5013 dest->refCount++;
5014 flag = 0x1;
5015 ((tempType ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(tempType) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(tempType)) : 0), tempType = 0);
5016 }
5017 }
5018 if(_class && _class->type == 2 && source->kind != 8)
5019 {
5020 if(!dest->_class->registered->dataType)
5021 dest->_class->registered->dataType = ProcessTypeString(dest->_class->registered->dataTypeString, 0x0);
5022 if(MatchTypes(source, dest->_class->registered->dataType, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
5023 {
5024 FreeType(source);
5025 FreeType(sourceExp->expType);
5026 source = sourceExp->expType = MkClassType(dest->_class->string);
5027 source->refCount++;
5028 }
5029 }
5030 if(_class && !strcmp(_class->fullName, "ecere::com::Class") && source->kind == 13 && source->type && source->type->kind == 1 && sourceExp->type == 3)
5031 {
5032 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
5033 struct Declarator * decl;
5034 char string[1024];
5035
5036 ReadString(string, sourceExp->string);
5037 decl = SpecDeclFromString(string, specs, (((void *)0)));
5038 FreeExpContents(sourceExp);
5039 FreeType(sourceExp->expType);
5040 sourceExp->type = 26;
5041 sourceExp->_classExp.specifiers = specs;
5042 sourceExp->_classExp.decl = decl;
5043 sourceExp->expType = dest;
5044 dest->refCount++;
5045 FreeType(source);
5046 FreeType(dest);
5047 return 0x1;
5048 }
5049 }
5050 else if(source->kind == 8)
5051 {
5052 struct __ecereNameSpace__ecere__com__Class * _class = source->_class ? source->_class->registered : (((void *)0));
5053
5054 if(_class && (_class->type == 3 || !strcmp(_class->fullName, "bool") || _class->type == 2))
5055 {
5056 if(dest->kind != 8)
5057 {
5058 struct Type * tempType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5059 struct Type * tempDest, * tempSource;
5060
5061 if(!source->_class->registered->dataType)
5062 source->_class->registered->dataType = ProcessTypeString(source->_class->registered->dataTypeString, 0x0);
5063 for(; _class->base->type != 1000; _class = _class->base)
5064 ;
5065 tempDest = source;
5066 tempSource = tempType;
5067 tempType->kind = 8;
5068 tempType->_class = FindClass(_class->fullName);
5069 tempType->truth = source->truth;
5070 tempType->classObjectType = source->classObjectType;
5071 if(tempType->_class)
5072 MatchTypes(tempSource, tempDest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0);
5073 if(conversions->last)
5074 {
5075 ((struct Conversion *)conversions->last)->resultType = dest;
5076 dest->refCount++;
5077 }
5078 FreeType(sourceExp->expType);
5079 sourceExp->expType = MkClassType(_class->fullName);
5080 sourceExp->expType->truth = source->truth;
5081 sourceExp->expType->classObjectType = source->classObjectType;
5082 if(!sourceExp->destType)
5083 {
5084 FreeType(sourceExp->destType);
5085 sourceExp->destType = sourceExp->expType;
5086 if(sourceExp->expType)
5087 sourceExp->expType->refCount++;
5088 }
5089 if(!_class->dataType)
5090 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
5091 FreeType(dest);
5092 dest = MkClassType(source->_class->string);
5093 dest->truth = source->truth;
5094 dest->classObjectType = source->classObjectType;
5095 FreeType(source);
5096 source = _class->dataType;
5097 source->refCount++;
5098 ((tempType ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(tempType) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(tempType)) : 0), tempType = 0);
5099 }
5100 }
5101 }
5102 if(!flag)
5103 {
5104 if(MatchTypes(source, dest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
5105 {
5106 FreeType(source);
5107 FreeType(dest);
5108 return 0x1;
5109 }
5110 }
5111 if(dest->kind == 8)
5112 {
5113 struct __ecereNameSpace__ecere__com__Class * _class = dest->_class ? dest->_class->registered : (((void *)0));
5114
5115 if(_class && !dest->truth && (_class->type == 3 || !strcmp(_class->fullName, "bool") || (_class->type != 1 && !value && source->kind == 3) || _class->type == 2))
5116 {
5117 if(_class->type == 0 || _class->type == 5)
5118 {
5119 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
5120
5121 *newExp = *sourceExp;
5122 if(sourceExp->destType)
5123 sourceExp->destType->refCount++;
5124 if(sourceExp->expType)
5125 sourceExp->expType->refCount++;
5126 sourceExp->type = 11;
5127 sourceExp->cast.typeName = MkTypeName(MkListOne(MkSpecifier(VOID)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0))));
5128 sourceExp->cast.exp = newExp;
5129 FreeType(sourceExp->expType);
5130 sourceExp->expType = (((void *)0));
5131 ProcessExpressionType(sourceExp);
5132 if(!inCompiler)
5133 {
5134 FreeType(sourceExp->expType);
5135 sourceExp->expType = dest;
5136 }
5137 FreeType(source);
5138 if(inCompiler)
5139 FreeType(dest);
5140 return 0x1;
5141 }
5142 if(!_class->dataType)
5143 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
5144 FreeType(dest);
5145 dest = _class->dataType;
5146 dest->refCount++;
5147 }
5148 if(dest->kind == 7 && (source->kind == 7 || source->kind == 6 || dest->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 1))
5149 {
5150 specs = MkListOne(MkSpecifier(DOUBLE));
5151 }
5152 else if(dest->kind == 6 && (source->kind == 6 || dest->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 7))
5153 {
5154 specs = MkListOne(MkSpecifier(FLOAT));
5155 }
5156 else if(dest->kind == 4 && (source->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 6 || source->kind == 7))
5157 {
5158 specs = MkList();
5159 if(!dest->isSigned)
5160 ListAdd(specs, MkSpecifier(UNSIGNED));
5161 ListAdd(specs, MkSpecifier(INT64));
5162 }
5163 else if(dest->kind == 3 && (source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 6 || source->kind == 7))
5164 {
5165 specs = MkList();
5166 if(!dest->isSigned)
5167 ListAdd(specs, MkSpecifier(UNSIGNED));
5168 ListAdd(specs, MkSpecifier(INT));
5169 }
5170 else if(dest->kind == 2 && (source->kind == 2 || source->kind == 1 || source->kind == 3 || source->kind == 6 || source->kind == 7))
5171 {
5172 specs = MkList();
5173 if(!dest->isSigned)
5174 ListAdd(specs, MkSpecifier(UNSIGNED));
5175 ListAdd(specs, MkSpecifier(SHORT));
5176 }
5177 else if(dest->kind == 1 && (source->kind == 1 || source->kind == 2 || source->kind == 3 || source->kind == 6 || source->kind == 7))
5178 {
5179 specs = MkList();
5180 if(!dest->isSigned)
5181 ListAdd(specs, MkSpecifier(UNSIGNED));
5182 ListAdd(specs, MkSpecifier(CHAR));
5183 }
5184 else
5185 {
5186 FreeType(source);
5187 FreeType(dest);
5188 return 0x0;
5189 }
5190 }
5191 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))
5192 {
5193 specs = MkListOne(MkSpecifier(DOUBLE));
5194 }
5195 else if(dest->kind == 6 && (source->kind == 6 || source->kind == 15 || source->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 1))
5196 {
5197 specs = MkListOne(MkSpecifier(FLOAT));
5198 }
5199 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)))
5200 {
5201 specs = MkList();
5202 if(!dest->isSigned)
5203 ListAdd(specs, MkSpecifier(UNSIGNED));
5204 ListAdd(specs, MkSpecifier(CHAR));
5205 }
5206 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)))))
5207 {
5208 specs = MkList();
5209 if(!dest->isSigned)
5210 ListAdd(specs, MkSpecifier(UNSIGNED));
5211 ListAdd(specs, MkSpecifier(SHORT));
5212 }
5213 else if(dest->kind == 3 && (source->kind == 15 || source->kind == 2 || source->kind == 1 || source->kind == 3))
5214 {
5215 specs = MkList();
5216 if(!dest->isSigned)
5217 ListAdd(specs, MkSpecifier(UNSIGNED));
5218 ListAdd(specs, MkSpecifier(INT));
5219 }
5220 else if(dest->kind == 4 && (source->kind == 15 || source->kind == 2 || source->kind == 1 || source->kind == 3 || source->kind == 4))
5221 {
5222 specs = MkList();
5223 if(!dest->isSigned)
5224 ListAdd(specs, MkSpecifier(UNSIGNED));
5225 ListAdd(specs, MkSpecifier(INT64));
5226 }
5227 else if(dest->kind == 15 && (source->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 1))
5228 {
5229 specs = MkListOne(MkEnum(MkIdentifier(dest->enumName), (((void *)0))));
5230 }
5231 else
5232 {
5233 FreeType(source);
5234 FreeType(dest);
5235 return 0x0;
5236 }
5237 if(!flag)
5238 {
5239 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
5240
5241 *newExp = *sourceExp;
5242 newExp->prev = (((void *)0));
5243 newExp->next = (((void *)0));
5244 if(sourceExp->destType)
5245 sourceExp->destType->refCount++;
5246 if(sourceExp->expType)
5247 sourceExp->expType->refCount++;
5248 sourceExp->type = 11;
5249 if(realDest->kind == 8)
5250 {
5251 sourceExp->cast.typeName = QMkClass(realDest->_class->string, (((void *)0)));
5252 FreeList(specs, FreeSpecifier);
5253 }
5254 else
5255 sourceExp->cast.typeName = MkTypeName(specs, (((void *)0)));
5256 if(newExp->type == 4)
5257 {
5258 sourceExp->cast.exp = MkExpBrackets(MkListOne(newExp));
5259 }
5260 else
5261 sourceExp->cast.exp = newExp;
5262 FreeType(sourceExp->expType);
5263 sourceExp->expType = (((void *)0));
5264 ProcessExpressionType(sourceExp);
5265 }
5266 else
5267 FreeList(specs, FreeSpecifier);
5268 FreeType(dest);
5269 FreeType(source);
5270 return 0x1;
5271 }
5272 else
5273 {
5274 while((sourceExp->type == 5 || sourceExp->type == 34) && sourceExp->list)
5275 sourceExp = (*sourceExp->list).last;
5276 if(sourceExp->type == 0)
5277 {
5278 struct Identifier * id = sourceExp->identifier;
5279
5280 if(dest->kind == 8)
5281 {
5282 if(dest->_class && dest->_class->registered && dest->_class->registered->type == 4)
5283 {
5284 struct __ecereNameSpace__ecere__com__Class * _class = dest->_class->registered;
5285 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
5286
5287 if(enumClass)
5288 {
5289 for(; _class && _class->type == 4; _class = _class->base)
5290 {
5291 struct __ecereNameSpace__ecere__sys__NamedLink * value;
5292 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
5293
5294 for(value = e->values.first; value; value = value->next)
5295 {
5296 if(!strcmp(value->name, id->string))
5297 break;
5298 }
5299 if(value)
5300 {
5301 FreeExpContents(sourceExp);
5302 FreeType(sourceExp->expType);
5303 sourceExp->isConstant = 0x1;
5304 sourceExp->expType = MkClassType(_class->fullName);
5305 {
5306 char constant[256];
5307
5308 sourceExp->type = 2;
5309 if(_class->dataTypeString && !strcmp(_class->dataTypeString, "int"))
5310 sprintf(constant, "%d", value->data);
5311 else
5312 sprintf(constant, "0x%X", value->data);
5313 sourceExp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
5314 }
5315 return 0x1;
5316 }
5317 }
5318 }
5319 }
5320 }
5321 if(dest->classObjectType != 2 && dest->kind == 8 && MatchWithEnums_Module(privateModule, sourceExp, dest, id->string, conversions))
5322 return 0x1;
5323 }
5324 }
5325 return 0x0;
5326 }
5327
5328 static unsigned int IntAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5329 {
5330 int value2 = op2->i;
5331
5332 exp->type = 2;
5333 exp->string = PrintInt(op1->i + value2);
5334 if(!exp->expType)
5335 {
5336 exp->expType = op1->type;
5337 if(op1->type)
5338 op1->type->refCount++;
5339 }
5340 return 0x1;
5341 }
5342
5343 static unsigned int UIntAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5344 {
5345 unsigned int value2 = op2->ui;
5346
5347 exp->type = 2;
5348 exp->string = PrintUInt(op1->ui + value2);
5349 if(!exp->expType)
5350 {
5351 exp->expType = op1->type;
5352 if(op1->type)
5353 op1->type->refCount++;
5354 }
5355 return 0x1;
5356 }
5357
5358 static unsigned int ShortAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5359 {
5360 short value2 = op2->s;
5361
5362 exp->type = 2;
5363 exp->string = PrintShort(op1->s + value2);
5364 if(!exp->expType)
5365 {
5366 exp->expType = op1->type;
5367 if(op1->type)
5368 op1->type->refCount++;
5369 }
5370 return 0x1;
5371 }
5372
5373 static unsigned int UShortAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5374 {
5375 unsigned short value2 = op2->us;
5376
5377 exp->type = 2;
5378 exp->string = PrintUShort(op1->us + value2);
5379 if(!exp->expType)
5380 {
5381 exp->expType = op1->type;
5382 if(op1->type)
5383 op1->type->refCount++;
5384 }
5385 return 0x1;
5386 }
5387
5388 static unsigned int CharAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5389 {
5390 char value2 = op2->c;
5391
5392 exp->type = 2;
5393 exp->string = PrintChar(op1->c + value2);
5394 if(!exp->expType)
5395 {
5396 exp->expType = op1->type;
5397 if(op1->type)
5398 op1->type->refCount++;
5399 }
5400 return 0x1;
5401 }
5402
5403 static unsigned int UCharAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5404 {
5405 unsigned char value2 = op2->uc;
5406
5407 exp->type = 2;
5408 exp->string = PrintUChar(op1->uc + value2);
5409 if(!exp->expType)
5410 {
5411 exp->expType = op1->type;
5412 if(op1->type)
5413 op1->type->refCount++;
5414 }
5415 return 0x1;
5416 }
5417
5418 static unsigned int FloatAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5419 {
5420 float value2 = op2->f;
5421
5422 exp->type = 2;
5423 exp->string = PrintFloat(op1->f + value2);
5424 if(!exp->expType)
5425 {
5426 exp->expType = op1->type;
5427 if(op1->type)
5428 op1->type->refCount++;
5429 }
5430 return 0x1;
5431 }
5432
5433 static unsigned int DoubleAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5434 {
5435 double value2 = op2->d;
5436
5437 exp->type = 2;
5438 exp->string = PrintDouble(op1->d + value2);
5439 if(!exp->expType)
5440 {
5441 exp->expType = op1->type;
5442 if(op1->type)
5443 op1->type->refCount++;
5444 }
5445 return 0x1;
5446 }
5447
5448 static unsigned int IntSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5449 {
5450 int value2 = op2->i;
5451
5452 exp->type = 2;
5453 exp->string = PrintInt(op1->i - value2);
5454 if(!exp->expType)
5455 {
5456 exp->expType = op1->type;
5457 if(op1->type)
5458 op1->type->refCount++;
5459 }
5460 return 0x1;
5461 }
5462
5463 static unsigned int UIntSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5464 {
5465 unsigned int value2 = op2->ui;
5466
5467 exp->type = 2;
5468 exp->string = PrintUInt(op1->ui - value2);
5469 if(!exp->expType)
5470 {
5471 exp->expType = op1->type;
5472 if(op1->type)
5473 op1->type->refCount++;
5474 }
5475 return 0x1;
5476 }
5477
5478 static unsigned int ShortSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5479 {
5480 short value2 = op2->s;
5481
5482 exp->type = 2;
5483 exp->string = PrintShort(op1->s - value2);
5484 if(!exp->expType)
5485 {
5486 exp->expType = op1->type;
5487 if(op1->type)
5488 op1->type->refCount++;
5489 }
5490 return 0x1;
5491 }
5492
5493 static unsigned int UShortSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5494 {
5495 unsigned short value2 = op2->us;
5496
5497 exp->type = 2;
5498 exp->string = PrintUShort(op1->us - value2);
5499 if(!exp->expType)
5500 {
5501 exp->expType = op1->type;
5502 if(op1->type)
5503 op1->type->refCount++;
5504 }
5505 return 0x1;
5506 }
5507
5508 static unsigned int CharSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5509 {
5510 char value2 = op2->c;
5511
5512 exp->type = 2;
5513 exp->string = PrintChar(op1->c - value2);
5514 if(!exp->expType)
5515 {
5516 exp->expType = op1->type;
5517 if(op1->type)
5518 op1->type->refCount++;
5519 }
5520 return 0x1;
5521 }
5522
5523 static unsigned int UCharSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5524 {
5525 unsigned char value2 = op2->uc;
5526
5527 exp->type = 2;
5528 exp->string = PrintUChar(op1->uc - value2);
5529 if(!exp->expType)
5530 {
5531 exp->expType = op1->type;
5532 if(op1->type)
5533 op1->type->refCount++;
5534 }
5535 return 0x1;
5536 }
5537
5538 static unsigned int FloatSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5539 {
5540 float value2 = op2->f;
5541
5542 exp->type = 2;
5543 exp->string = PrintFloat(op1->f - value2);
5544 if(!exp->expType)
5545 {
5546 exp->expType = op1->type;
5547 if(op1->type)
5548 op1->type->refCount++;
5549 }
5550 return 0x1;
5551 }
5552
5553 static unsigned int DoubleSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5554 {
5555 double value2 = op2->d;
5556
5557 exp->type = 2;
5558 exp->string = PrintDouble(op1->d - value2);
5559 if(!exp->expType)
5560 {
5561 exp->expType = op1->type;
5562 if(op1->type)
5563 op1->type->refCount++;
5564 }
5565 return 0x1;
5566 }
5567
5568 static unsigned int IntMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5569 {
5570 int value2 = op2->i;
5571
5572 exp->type = 2;
5573 exp->string = PrintInt(op1->i * value2);
5574 if(!exp->expType)
5575 {
5576 exp->expType = op1->type;
5577 if(op1->type)
5578 op1->type->refCount++;
5579 }
5580 return 0x1;
5581 }
5582
5583 static unsigned int UIntMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5584 {
5585 unsigned int value2 = op2->ui;
5586
5587 exp->type = 2;
5588 exp->string = PrintUInt(op1->ui * value2);
5589 if(!exp->expType)
5590 {
5591 exp->expType = op1->type;
5592 if(op1->type)
5593 op1->type->refCount++;
5594 }
5595 return 0x1;
5596 }
5597
5598 static unsigned int ShortMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5599 {
5600 short value2 = op2->s;
5601
5602 exp->type = 2;
5603 exp->string = PrintShort(op1->s * value2);
5604 if(!exp->expType)
5605 {
5606 exp->expType = op1->type;
5607 if(op1->type)
5608 op1->type->refCount++;
5609 }
5610 return 0x1;
5611 }
5612
5613 static unsigned int UShortMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5614 {
5615 unsigned short value2 = op2->us;
5616
5617 exp->type = 2;
5618 exp->string = PrintUShort(op1->us * value2);
5619 if(!exp->expType)
5620 {
5621 exp->expType = op1->type;
5622 if(op1->type)
5623 op1->type->refCount++;
5624 }
5625 return 0x1;
5626 }
5627
5628 static unsigned int CharMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5629 {
5630 char value2 = op2->c;
5631
5632 exp->type = 2;
5633 exp->string = PrintChar(op1->c * value2);
5634 if(!exp->expType)
5635 {
5636 exp->expType = op1->type;
5637 if(op1->type)
5638 op1->type->refCount++;
5639 }
5640 return 0x1;
5641 }
5642
5643 static unsigned int UCharMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5644 {
5645 unsigned char value2 = op2->uc;
5646
5647 exp->type = 2;
5648 exp->string = PrintUChar(op1->uc * value2);
5649 if(!exp->expType)
5650 {
5651 exp->expType = op1->type;
5652 if(op1->type)
5653 op1->type->refCount++;
5654 }
5655 return 0x1;
5656 }
5657
5658 static unsigned int FloatMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5659 {
5660 float value2 = op2->f;
5661
5662 exp->type = 2;
5663 exp->string = PrintFloat(op1->f * value2);
5664 if(!exp->expType)
5665 {
5666 exp->expType = op1->type;
5667 if(op1->type)
5668 op1->type->refCount++;
5669 }
5670 return 0x1;
5671 }
5672
5673 static unsigned int DoubleMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5674 {
5675 double value2 = op2->d;
5676
5677 exp->type = 2;
5678 exp->string = PrintDouble(op1->d * value2);
5679 if(!exp->expType)
5680 {
5681 exp->expType = op1->type;
5682 if(op1->type)
5683 op1->type->refCount++;
5684 }
5685 return 0x1;
5686 }
5687
5688 static unsigned int IntDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5689 {
5690 int value2 = op2->i;
5691
5692 exp->type = 2;
5693 exp->string = PrintInt(value2 ? (op1->i / value2) : 0);
5694 if(!exp->expType)
5695 {
5696 exp->expType = op1->type;
5697 if(op1->type)
5698 op1->type->refCount++;
5699 }
5700 return 0x1;
5701 }
5702
5703 static unsigned int UIntDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5704 {
5705 unsigned int value2 = op2->ui;
5706
5707 exp->type = 2;
5708 exp->string = PrintUInt(value2 ? (op1->ui / value2) : 0);
5709 if(!exp->expType)
5710 {
5711 exp->expType = op1->type;
5712 if(op1->type)
5713 op1->type->refCount++;
5714 }
5715 return 0x1;
5716 }
5717
5718 static unsigned int ShortDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5719 {
5720 short value2 = op2->s;
5721
5722 exp->type = 2;
5723 exp->string = PrintShort(value2 ? (op1->s / value2) : (short)0);
5724 if(!exp->expType)
5725 {
5726 exp->expType = op1->type;
5727 if(op1->type)
5728 op1->type->refCount++;
5729 }
5730 return 0x1;
5731 }
5732
5733 static unsigned int UShortDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5734 {
5735 unsigned short value2 = op2->us;
5736
5737 exp->type = 2;
5738 exp->string = PrintUShort(value2 ? (op1->us / value2) : (unsigned short)0);
5739 if(!exp->expType)
5740 {
5741 exp->expType = op1->type;
5742 if(op1->type)
5743 op1->type->refCount++;
5744 }
5745 return 0x1;
5746 }
5747
5748 static unsigned int CharDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5749 {
5750 char value2 = op2->c;
5751
5752 exp->type = 2;
5753 exp->string = PrintChar(value2 ? (op1->c / value2) : (char)0);
5754 if(!exp->expType)
5755 {
5756 exp->expType = op1->type;
5757 if(op1->type)
5758 op1->type->refCount++;
5759 }
5760 return 0x1;
5761 }
5762
5763 static unsigned int UCharDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5764 {
5765 unsigned char value2 = op2->uc;
5766
5767 exp->type = 2;
5768 exp->string = PrintUChar(value2 ? (op1->uc / value2) : (unsigned char)0);
5769 if(!exp->expType)
5770 {
5771 exp->expType = op1->type;
5772 if(op1->type)
5773 op1->type->refCount++;
5774 }
5775 return 0x1;
5776 }
5777
5778 static unsigned int FloatDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5779 {
5780 float value2 = op2->f;
5781
5782 exp->type = 2;
5783 exp->string = PrintFloat(value2 ? (op1->f / value2) : (float)0);
5784 if(!exp->expType)
5785 {
5786 exp->expType = op1->type;
5787 if(op1->type)
5788 op1->type->refCount++;
5789 }
5790 return 0x1;
5791 }
5792
5793 static unsigned int DoubleDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5794 {
5795 double value2 = op2->d;
5796
5797 exp->type = 2;
5798 exp->string = PrintDouble(value2 ? (op1->d / value2) : (double)0);
5799 if(!exp->expType)
5800 {
5801 exp->expType = op1->type;
5802 if(op1->type)
5803 op1->type->refCount++;
5804 }
5805 return 0x1;
5806 }
5807
5808 static unsigned int IntMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5809 {
5810 int value2 = op2->i;
5811
5812 exp->type = 2;
5813 exp->string = PrintInt(value2 ? (op1->i % value2) : 0);
5814 if(!exp->expType)
5815 {
5816 exp->expType = op1->type;
5817 if(op1->type)
5818 op1->type->refCount++;
5819 }
5820 return 0x1;
5821 }
5822
5823 static unsigned int UIntMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5824 {
5825 unsigned int value2 = op2->ui;
5826
5827 exp->type = 2;
5828 exp->string = PrintUInt(value2 ? (op1->ui % value2) : 0);
5829 if(!exp->expType)
5830 {
5831 exp->expType = op1->type;
5832 if(op1->type)
5833 op1->type->refCount++;
5834 }
5835 return 0x1;
5836 }
5837
5838 static unsigned int ShortMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5839 {
5840 short value2 = op2->s;
5841
5842 exp->type = 2;
5843 exp->string = PrintShort(value2 ? (op1->s % value2) : (short)0);
5844 if(!exp->expType)
5845 {
5846 exp->expType = op1->type;
5847 if(op1->type)
5848 op1->type->refCount++;
5849 }
5850 return 0x1;
5851 }
5852
5853 static unsigned int UShortMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5854 {
5855 unsigned short value2 = op2->us;
5856
5857 exp->type = 2;
5858 exp->string = PrintUShort(value2 ? (op1->us % value2) : (unsigned short)0);
5859 if(!exp->expType)
5860 {
5861 exp->expType = op1->type;
5862 if(op1->type)
5863 op1->type->refCount++;
5864 }
5865 return 0x1;
5866 }
5867
5868 static unsigned int CharMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5869 {
5870 char value2 = op2->c;
5871
5872 exp->type = 2;
5873 exp->string = PrintChar(value2 ? (op1->c % value2) : (char)0);
5874 if(!exp->expType)
5875 {
5876 exp->expType = op1->type;
5877 if(op1->type)
5878 op1->type->refCount++;
5879 }
5880 return 0x1;
5881 }
5882
5883 static unsigned int UCharMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5884 {
5885 unsigned char value2 = op2->uc;
5886
5887 exp->type = 2;
5888 exp->string = PrintUChar(value2 ? (op1->uc % value2) : (unsigned char)0);
5889 if(!exp->expType)
5890 {
5891 exp->expType = op1->type;
5892 if(op1->type)
5893 op1->type->refCount++;
5894 }
5895 return 0x1;
5896 }
5897
5898 static unsigned int IntNeg(struct Expression * exp, struct Operand * op1)
5899 {
5900 exp->type = 2;
5901 exp->string = PrintInt(-op1->i);
5902 if(!exp->expType)
5903 {
5904 exp->expType = op1->type;
5905 if(op1->type)
5906 op1->type->refCount++;
5907 }
5908 return 0x1;
5909 }
5910
5911 static unsigned int UIntNeg(struct Expression * exp, struct Operand * op1)
5912 {
5913 exp->type = 2;
5914 exp->string = PrintUInt(-op1->ui);
5915 if(!exp->expType)
5916 {
5917 exp->expType = op1->type;
5918 if(op1->type)
5919 op1->type->refCount++;
5920 }
5921 return 0x1;
5922 }
5923
5924 static unsigned int ShortNeg(struct Expression * exp, struct Operand * op1)
5925 {
5926 exp->type = 2;
5927 exp->string = PrintShort(-op1->s);
5928 if(!exp->expType)
5929 {
5930 exp->expType = op1->type;
5931 if(op1->type)
5932 op1->type->refCount++;
5933 }
5934 return 0x1;
5935 }
5936
5937 static unsigned int UShortNeg(struct Expression * exp, struct Operand * op1)
5938 {
5939 exp->type = 2;
5940 exp->string = PrintUShort(-op1->us);
5941 if(!exp->expType)
5942 {
5943 exp->expType = op1->type;
5944 if(op1->type)
5945 op1->type->refCount++;
5946 }
5947 return 0x1;
5948 }
5949
5950 static unsigned int CharNeg(struct Expression * exp, struct Operand * op1)
5951 {
5952 exp->type = 2;
5953 exp->string = PrintChar(-op1->c);
5954 if(!exp->expType)
5955 {
5956 exp->expType = op1->type;
5957 if(op1->type)
5958 op1->type->refCount++;
5959 }
5960 return 0x1;
5961 }
5962
5963 static unsigned int UCharNeg(struct Expression * exp, struct Operand * op1)
5964 {
5965 exp->type = 2;
5966 exp->string = PrintUChar(-op1->uc);
5967 if(!exp->expType)
5968 {
5969 exp->expType = op1->type;
5970 if(op1->type)
5971 op1->type->refCount++;
5972 }
5973 return 0x1;
5974 }
5975
5976 static unsigned int FloatNeg(struct Expression * exp, struct Operand * op1)
5977 {
5978 exp->type = 2;
5979 exp->string = PrintFloat(-op1->f);
5980 if(!exp->expType)
5981 {
5982 exp->expType = op1->type;
5983 if(op1->type)
5984 op1->type->refCount++;
5985 }
5986 return 0x1;
5987 }
5988
5989 static unsigned int DoubleNeg(struct Expression * exp, struct Operand * op1)
5990 {
5991 exp->type = 2;
5992 exp->string = PrintDouble(-op1->d);
5993 if(!exp->expType)
5994 {
5995 exp->expType = op1->type;
5996 if(op1->type)
5997 op1->type->refCount++;
5998 }
5999 return 0x1;
6000 }
6001
6002 static unsigned int IntInc(struct Expression * exp, struct Operand * op1)
6003 {
6004 exp->type = 2;
6005 exp->string = PrintInt(++op1->i);
6006 if(!exp->expType)
6007 {
6008 exp->expType = op1->type;
6009 if(op1->type)
6010 op1->type->refCount++;
6011 }
6012 return 0x1;
6013 }
6014
6015 static unsigned int UIntInc(struct Expression * exp, struct Operand * op1)
6016 {
6017 exp->type = 2;
6018 exp->string = PrintUInt(++op1->ui);
6019 if(!exp->expType)
6020 {
6021 exp->expType = op1->type;
6022 if(op1->type)
6023 op1->type->refCount++;
6024 }
6025 return 0x1;
6026 }
6027
6028 static unsigned int ShortInc(struct Expression * exp, struct Operand * op1)
6029 {
6030 exp->type = 2;
6031 exp->string = PrintShort(++op1->s);
6032 if(!exp->expType)
6033 {
6034 exp->expType = op1->type;
6035 if(op1->type)
6036 op1->type->refCount++;
6037 }
6038 return 0x1;
6039 }
6040
6041 static unsigned int UShortInc(struct Expression * exp, struct Operand * op1)
6042 {
6043 exp->type = 2;
6044 exp->string = PrintUShort(++op1->us);
6045 if(!exp->expType)
6046 {
6047 exp->expType = op1->type;
6048 if(op1->type)
6049 op1->type->refCount++;
6050 }
6051 return 0x1;
6052 }
6053
6054 static unsigned int CharInc(struct Expression * exp, struct Operand * op1)
6055 {
6056 exp->type = 2;
6057 exp->string = PrintChar(++op1->c);
6058 if(!exp->expType)
6059 {
6060 exp->expType = op1->type;
6061 if(op1->type)
6062 op1->type->refCount++;
6063 }
6064 return 0x1;
6065 }
6066
6067 static unsigned int UCharInc(struct Expression * exp, struct Operand * op1)
6068 {
6069 exp->type = 2;
6070 exp->string = PrintUChar(++op1->uc);
6071 if(!exp->expType)
6072 {
6073 exp->expType = op1->type;
6074 if(op1->type)
6075 op1->type->refCount++;
6076 }
6077 return 0x1;
6078 }
6079
6080 static unsigned int FloatInc(struct Expression * exp, struct Operand * op1)
6081 {
6082 exp->type = 2;
6083 exp->string = PrintFloat(++op1->f);
6084 if(!exp->expType)
6085 {
6086 exp->expType = op1->type;
6087 if(op1->type)
6088 op1->type->refCount++;
6089 }
6090 return 0x1;
6091 }
6092
6093 static unsigned int DoubleInc(struct Expression * exp, struct Operand * op1)
6094 {
6095 exp->type = 2;
6096 exp->string = PrintDouble(++op1->d);
6097 if(!exp->expType)
6098 {
6099 exp->expType = op1->type;
6100 if(op1->type)
6101 op1->type->refCount++;
6102 }
6103 return 0x1;
6104 }
6105
6106 static unsigned int IntDec(struct Expression * exp, struct Operand * op1)
6107 {
6108 exp->type = 2;
6109 exp->string = PrintInt(--op1->i);
6110 if(!exp->expType)
6111 {
6112 exp->expType = op1->type;
6113 if(op1->type)
6114 op1->type->refCount++;
6115 }
6116 return 0x1;
6117 }
6118
6119 static unsigned int UIntDec(struct Expression * exp, struct Operand * op1)
6120 {
6121 exp->type = 2;
6122 exp->string = PrintUInt(--op1->ui);
6123 if(!exp->expType)
6124 {
6125 exp->expType = op1->type;
6126 if(op1->type)
6127 op1->type->refCount++;
6128 }
6129 return 0x1;
6130 }
6131
6132 static unsigned int ShortDec(struct Expression * exp, struct Operand * op1)
6133 {
6134 exp->type = 2;
6135 exp->string = PrintShort(--op1->s);
6136 if(!exp->expType)
6137 {
6138 exp->expType = op1->type;
6139 if(op1->type)
6140 op1->type->refCount++;
6141 }
6142 return 0x1;
6143 }
6144
6145 static unsigned int UShortDec(struct Expression * exp, struct Operand * op1)
6146 {
6147 exp->type = 2;
6148 exp->string = PrintUShort(--op1->us);
6149 if(!exp->expType)
6150 {
6151 exp->expType = op1->type;
6152 if(op1->type)
6153 op1->type->refCount++;
6154 }
6155 return 0x1;
6156 }
6157
6158 static unsigned int CharDec(struct Expression * exp, struct Operand * op1)
6159 {
6160 exp->type = 2;
6161 exp->string = PrintChar(--op1->c);
6162 if(!exp->expType)
6163 {
6164 exp->expType = op1->type;
6165 if(op1->type)
6166 op1->type->refCount++;
6167 }
6168 return 0x1;
6169 }
6170
6171 static unsigned int UCharDec(struct Expression * exp, struct Operand * op1)
6172 {
6173 exp->type = 2;
6174 exp->string = PrintUChar(--op1->uc);
6175 if(!exp->expType)
6176 {
6177 exp->expType = op1->type;
6178 if(op1->type)
6179 op1->type->refCount++;
6180 }
6181 return 0x1;
6182 }
6183
6184 static unsigned int FloatDec(struct Expression * exp, struct Operand * op1)
6185 {
6186 exp->type = 2;
6187 exp->string = PrintFloat(--op1->f);
6188 if(!exp->expType)
6189 {
6190 exp->expType = op1->type;
6191 if(op1->type)
6192 op1->type->refCount++;
6193 }
6194 return 0x1;
6195 }
6196
6197 static unsigned int DoubleDec(struct Expression * exp, struct Operand * op1)
6198 {
6199 exp->type = 2;
6200 exp->string = PrintDouble(--op1->d);
6201 if(!exp->expType)
6202 {
6203 exp->expType = op1->type;
6204 if(op1->type)
6205 op1->type->refCount++;
6206 }
6207 return 0x1;
6208 }
6209
6210 static unsigned int IntAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6211 {
6212 int value2 = op2->i;
6213
6214 exp->type = 2;
6215 exp->string = PrintInt(op1->i = value2);
6216 if(!exp->expType)
6217 {
6218 exp->expType = op1->type;
6219 if(op1->type)
6220 op1->type->refCount++;
6221 }
6222 return 0x1;
6223 }
6224
6225 static unsigned int UIntAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6226 {
6227 unsigned int value2 = op2->ui;
6228
6229 exp->type = 2;
6230 exp->string = PrintUInt(op1->ui = value2);
6231 if(!exp->expType)
6232 {
6233 exp->expType = op1->type;
6234 if(op1->type)
6235 op1->type->refCount++;
6236 }
6237 return 0x1;
6238 }
6239
6240 static unsigned int ShortAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6241 {
6242 short value2 = op2->s;
6243
6244 exp->type = 2;
6245 exp->string = PrintShort(op1->s = value2);
6246 if(!exp->expType)
6247 {
6248 exp->expType = op1->type;
6249 if(op1->type)
6250 op1->type->refCount++;
6251 }
6252 return 0x1;
6253 }
6254
6255 static unsigned int UShortAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6256 {
6257 unsigned short value2 = op2->us;
6258
6259 exp->type = 2;
6260 exp->string = PrintUShort(op1->us = value2);
6261 if(!exp->expType)
6262 {
6263 exp->expType = op1->type;
6264 if(op1->type)
6265 op1->type->refCount++;
6266 }
6267 return 0x1;
6268 }
6269
6270 static unsigned int CharAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6271 {
6272 char value2 = op2->c;
6273
6274 exp->type = 2;
6275 exp->string = PrintChar(op1->c = value2);
6276 if(!exp->expType)
6277 {
6278 exp->expType = op1->type;
6279 if(op1->type)
6280 op1->type->refCount++;
6281 }
6282 return 0x1;
6283 }
6284
6285 static unsigned int UCharAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6286 {
6287 unsigned char value2 = op2->uc;
6288
6289 exp->type = 2;
6290 exp->string = PrintUChar(op1->uc = value2);
6291 if(!exp->expType)
6292 {
6293 exp->expType = op1->type;
6294 if(op1->type)
6295 op1->type->refCount++;
6296 }
6297 return 0x1;
6298 }
6299
6300 static unsigned int FloatAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6301 {
6302 float value2 = op2->f;
6303
6304 exp->type = 2;
6305 exp->string = PrintFloat(op1->f = value2);
6306 if(!exp->expType)
6307 {
6308 exp->expType = op1->type;
6309 if(op1->type)
6310 op1->type->refCount++;
6311 }
6312 return 0x1;
6313 }
6314
6315 static unsigned int DoubleAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6316 {
6317 double value2 = op2->d;
6318
6319 exp->type = 2;
6320 exp->string = PrintDouble(op1->d = value2);
6321 if(!exp->expType)
6322 {
6323 exp->expType = op1->type;
6324 if(op1->type)
6325 op1->type->refCount++;
6326 }
6327 return 0x1;
6328 }
6329
6330 static unsigned int IntAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6331 {
6332 int value2 = op2->i;
6333
6334 exp->type = 2;
6335 exp->string = PrintInt(op1->i += value2);
6336 if(!exp->expType)
6337 {
6338 exp->expType = op1->type;
6339 if(op1->type)
6340 op1->type->refCount++;
6341 }
6342 return 0x1;
6343 }
6344
6345 static unsigned int UIntAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6346 {
6347 unsigned int value2 = op2->ui;
6348
6349 exp->type = 2;
6350 exp->string = PrintUInt(op1->ui += value2);
6351 if(!exp->expType)
6352 {
6353 exp->expType = op1->type;
6354 if(op1->type)
6355 op1->type->refCount++;
6356 }
6357 return 0x1;
6358 }
6359
6360 static unsigned int ShortAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6361 {
6362 short value2 = op2->s;
6363
6364 exp->type = 2;
6365 exp->string = PrintShort(op1->s += value2);
6366 if(!exp->expType)
6367 {
6368 exp->expType = op1->type;
6369 if(op1->type)
6370 op1->type->refCount++;
6371 }
6372 return 0x1;
6373 }
6374
6375 static unsigned int UShortAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6376 {
6377 unsigned short value2 = op2->us;
6378
6379 exp->type = 2;
6380 exp->string = PrintUShort(op1->us += value2);
6381 if(!exp->expType)
6382 {
6383 exp->expType = op1->type;
6384 if(op1->type)
6385 op1->type->refCount++;
6386 }
6387 return 0x1;
6388 }
6389
6390 static unsigned int CharAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6391 {
6392 char value2 = op2->c;
6393
6394 exp->type = 2;
6395 exp->string = PrintChar(op1->c += value2);
6396 if(!exp->expType)
6397 {
6398 exp->expType = op1->type;
6399 if(op1->type)
6400 op1->type->refCount++;
6401 }
6402 return 0x1;
6403 }
6404
6405 static unsigned int UCharAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6406 {
6407 unsigned char value2 = op2->uc;
6408
6409 exp->type = 2;
6410 exp->string = PrintUChar(op1->uc += value2);
6411 if(!exp->expType)
6412 {
6413 exp->expType = op1->type;
6414 if(op1->type)
6415 op1->type->refCount++;
6416 }
6417 return 0x1;
6418 }
6419
6420 static unsigned int FloatAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6421 {
6422 float value2 = op2->f;
6423
6424 exp->type = 2;
6425 exp->string = PrintFloat(op1->f += value2);
6426 if(!exp->expType)
6427 {
6428 exp->expType = op1->type;
6429 if(op1->type)
6430 op1->type->refCount++;
6431 }
6432 return 0x1;
6433 }
6434
6435 static unsigned int DoubleAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6436 {
6437 double value2 = op2->d;
6438
6439 exp->type = 2;
6440 exp->string = PrintDouble(op1->d += value2);
6441 if(!exp->expType)
6442 {
6443 exp->expType = op1->type;
6444 if(op1->type)
6445 op1->type->refCount++;
6446 }
6447 return 0x1;
6448 }
6449
6450 static unsigned int IntSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6451 {
6452 int value2 = op2->i;
6453
6454 exp->type = 2;
6455 exp->string = PrintInt(op1->i -= value2);
6456 if(!exp->expType)
6457 {
6458 exp->expType = op1->type;
6459 if(op1->type)
6460 op1->type->refCount++;
6461 }
6462 return 0x1;
6463 }
6464
6465 static unsigned int UIntSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6466 {
6467 unsigned int value2 = op2->ui;
6468
6469 exp->type = 2;
6470 exp->string = PrintUInt(op1->ui -= value2);
6471 if(!exp->expType)
6472 {
6473 exp->expType = op1->type;
6474 if(op1->type)
6475 op1->type->refCount++;
6476 }
6477 return 0x1;
6478 }
6479
6480 static unsigned int ShortSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6481 {
6482 short value2 = op2->s;
6483
6484 exp->type = 2;
6485 exp->string = PrintShort(op1->s -= value2);
6486 if(!exp->expType)
6487 {
6488 exp->expType = op1->type;
6489 if(op1->type)
6490 op1->type->refCount++;
6491 }
6492 return 0x1;
6493 }
6494
6495 static unsigned int UShortSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6496 {
6497 unsigned short value2 = op2->us;
6498
6499 exp->type = 2;
6500 exp->string = PrintUShort(op1->us -= value2);
6501 if(!exp->expType)
6502 {
6503 exp->expType = op1->type;
6504 if(op1->type)
6505 op1->type->refCount++;
6506 }
6507 return 0x1;
6508 }
6509
6510 static unsigned int CharSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6511 {
6512 char value2 = op2->c;
6513
6514 exp->type = 2;
6515 exp->string = PrintChar(op1->c -= value2);
6516 if(!exp->expType)
6517 {
6518 exp->expType = op1->type;
6519 if(op1->type)
6520 op1->type->refCount++;
6521 }
6522 return 0x1;
6523 }
6524
6525 static unsigned int UCharSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6526 {
6527 unsigned char value2 = op2->uc;
6528
6529 exp->type = 2;
6530 exp->string = PrintUChar(op1->uc -= value2);
6531 if(!exp->expType)
6532 {
6533 exp->expType = op1->type;
6534 if(op1->type)
6535 op1->type->refCount++;
6536 }
6537 return 0x1;
6538 }
6539
6540 static unsigned int FloatSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6541 {
6542 float value2 = op2->f;
6543
6544 exp->type = 2;
6545 exp->string = PrintFloat(op1->f -= value2);
6546 if(!exp->expType)
6547 {
6548 exp->expType = op1->type;
6549 if(op1->type)
6550 op1->type->refCount++;
6551 }
6552 return 0x1;
6553 }
6554
6555 static unsigned int DoubleSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6556 {
6557 double value2 = op2->d;
6558
6559 exp->type = 2;
6560 exp->string = PrintDouble(op1->d -= value2);
6561 if(!exp->expType)
6562 {
6563 exp->expType = op1->type;
6564 if(op1->type)
6565 op1->type->refCount++;
6566 }
6567 return 0x1;
6568 }
6569
6570 static unsigned int IntMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6571 {
6572 int value2 = op2->i;
6573
6574 exp->type = 2;
6575 exp->string = PrintInt(op1->i *= value2);
6576 if(!exp->expType)
6577 {
6578 exp->expType = op1->type;
6579 if(op1->type)
6580 op1->type->refCount++;
6581 }
6582 return 0x1;
6583 }
6584
6585 static unsigned int UIntMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6586 {
6587 unsigned int value2 = op2->ui;
6588
6589 exp->type = 2;
6590 exp->string = PrintUInt(op1->ui *= value2);
6591 if(!exp->expType)
6592 {
6593 exp->expType = op1->type;
6594 if(op1->type)
6595 op1->type->refCount++;
6596 }
6597 return 0x1;
6598 }
6599
6600 static unsigned int ShortMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6601 {
6602 short value2 = op2->s;
6603
6604 exp->type = 2;
6605 exp->string = PrintShort(op1->s *= value2);
6606 if(!exp->expType)
6607 {
6608 exp->expType = op1->type;
6609 if(op1->type)
6610 op1->type->refCount++;
6611 }
6612 return 0x1;
6613 }
6614
6615 static unsigned int UShortMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6616 {
6617 unsigned short value2 = op2->us;
6618
6619 exp->type = 2;
6620 exp->string = PrintUShort(op1->us *= value2);
6621 if(!exp->expType)
6622 {
6623 exp->expType = op1->type;
6624 if(op1->type)
6625 op1->type->refCount++;
6626 }
6627 return 0x1;
6628 }
6629
6630 static unsigned int CharMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6631 {
6632 char value2 = op2->c;
6633
6634 exp->type = 2;
6635 exp->string = PrintChar(op1->c *= value2);
6636 if(!exp->expType)
6637 {
6638 exp->expType = op1->type;
6639 if(op1->type)
6640 op1->type->refCount++;
6641 }
6642 return 0x1;
6643 }
6644
6645 static unsigned int UCharMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6646 {
6647 unsigned char value2 = op2->uc;
6648
6649 exp->type = 2;
6650 exp->string = PrintUChar(op1->uc *= value2);
6651 if(!exp->expType)
6652 {
6653 exp->expType = op1->type;
6654 if(op1->type)
6655 op1->type->refCount++;
6656 }
6657 return 0x1;
6658 }
6659
6660 static unsigned int FloatMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6661 {
6662 float value2 = op2->f;
6663
6664 exp->type = 2;
6665 exp->string = PrintFloat(op1->f *= value2);
6666 if(!exp->expType)
6667 {
6668 exp->expType = op1->type;
6669 if(op1->type)
6670 op1->type->refCount++;
6671 }
6672 return 0x1;
6673 }
6674
6675 static unsigned int DoubleMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6676 {
6677 double value2 = op2->d;
6678
6679 exp->type = 2;
6680 exp->string = PrintDouble(op1->d *= value2);
6681 if(!exp->expType)
6682 {
6683 exp->expType = op1->type;
6684 if(op1->type)
6685 op1->type->refCount++;
6686 }
6687 return 0x1;
6688 }
6689
6690 static unsigned int IntDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6691 {
6692 int value2 = op2->i;
6693
6694 exp->type = 2;
6695 exp->string = PrintInt(value2 ? (op1->i /= value2) : 0);
6696 if(!exp->expType)
6697 {
6698 exp->expType = op1->type;
6699 if(op1->type)
6700 op1->type->refCount++;
6701 }
6702 return 0x1;
6703 }
6704
6705 static unsigned int UIntDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6706 {
6707 unsigned int value2 = op2->ui;
6708
6709 exp->type = 2;
6710 exp->string = PrintUInt(value2 ? (op1->ui /= value2) : 0);
6711 if(!exp->expType)
6712 {
6713 exp->expType = op1->type;
6714 if(op1->type)
6715 op1->type->refCount++;
6716 }
6717 return 0x1;
6718 }
6719
6720 static unsigned int ShortDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6721 {
6722 short value2 = op2->s;
6723
6724 exp->type = 2;
6725 exp->string = PrintShort(value2 ? (op1->s /= value2) : (short)0);
6726 if(!exp->expType)
6727 {
6728 exp->expType = op1->type;
6729 if(op1->type)
6730 op1->type->refCount++;
6731 }
6732 return 0x1;
6733 }
6734
6735 static unsigned int UShortDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6736 {
6737 unsigned short value2 = op2->us;
6738
6739 exp->type = 2;
6740 exp->string = PrintUShort(value2 ? (op1->us /= value2) : (unsigned short)0);
6741 if(!exp->expType)
6742 {
6743 exp->expType = op1->type;
6744 if(op1->type)
6745 op1->type->refCount++;
6746 }
6747 return 0x1;
6748 }
6749
6750 static unsigned int CharDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6751 {
6752 char value2 = op2->c;
6753
6754 exp->type = 2;
6755 exp->string = PrintChar(value2 ? (op1->c /= value2) : (char)0);
6756 if(!exp->expType)
6757 {
6758 exp->expType = op1->type;
6759 if(op1->type)
6760 op1->type->refCount++;
6761 }
6762 return 0x1;
6763 }
6764
6765 static unsigned int UCharDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6766 {
6767 unsigned char value2 = op2->uc;
6768
6769 exp->type = 2;
6770 exp->string = PrintUChar(value2 ? (op1->uc /= value2) : (unsigned char)0);
6771 if(!exp->expType)
6772 {
6773 exp->expType = op1->type;
6774 if(op1->type)
6775 op1->type->refCount++;
6776 }
6777 return 0x1;
6778 }
6779
6780 static unsigned int FloatDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6781 {
6782 float value2 = op2->f;
6783
6784 exp->type = 2;
6785 exp->string = PrintFloat(value2 ? (op1->f /= value2) : (float)0);
6786 if(!exp->expType)
6787 {
6788 exp->expType = op1->type;
6789 if(op1->type)
6790 op1->type->refCount++;
6791 }
6792 return 0x1;
6793 }
6794
6795 static unsigned int DoubleDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6796 {
6797 double value2 = op2->d;
6798
6799 exp->type = 2;
6800 exp->string = PrintDouble(value2 ? (op1->d /= value2) : (double)0);
6801 if(!exp->expType)
6802 {
6803 exp->expType = op1->type;
6804 if(op1->type)
6805 op1->type->refCount++;
6806 }
6807 return 0x1;
6808 }
6809
6810 static unsigned int IntModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6811 {
6812 int value2 = op2->i;
6813
6814 exp->type = 2;
6815 exp->string = PrintInt(value2 ? (op1->i %= value2) : 0);
6816 if(!exp->expType)
6817 {
6818 exp->expType = op1->type;
6819 if(op1->type)
6820 op1->type->refCount++;
6821 }
6822 return 0x1;
6823 }
6824
6825 static unsigned int UIntModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6826 {
6827 unsigned int value2 = op2->ui;
6828
6829 exp->type = 2;
6830 exp->string = PrintUInt(value2 ? (op1->ui %= value2) : 0);
6831 if(!exp->expType)
6832 {
6833 exp->expType = op1->type;
6834 if(op1->type)
6835 op1->type->refCount++;
6836 }
6837 return 0x1;
6838 }
6839
6840 static unsigned int ShortModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6841 {
6842 short value2 = op2->s;
6843
6844 exp->type = 2;
6845 exp->string = PrintShort(value2 ? (op1->s %= value2) : (short)0);
6846 if(!exp->expType)
6847 {
6848 exp->expType = op1->type;
6849 if(op1->type)
6850 op1->type->refCount++;
6851 }
6852 return 0x1;
6853 }
6854
6855 static unsigned int UShortModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6856 {
6857 unsigned short value2 = op2->us;
6858
6859 exp->type = 2;
6860 exp->string = PrintUShort(value2 ? (op1->us %= value2) : (unsigned short)0);
6861 if(!exp->expType)
6862 {
6863 exp->expType = op1->type;
6864 if(op1->type)
6865 op1->type->refCount++;
6866 }
6867 return 0x1;
6868 }
6869
6870 static unsigned int CharModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6871 {
6872 char value2 = op2->c;
6873
6874 exp->type = 2;
6875 exp->string = PrintChar(value2 ? (op1->c %= value2) : (char)0);
6876 if(!exp->expType)
6877 {
6878 exp->expType = op1->type;
6879 if(op1->type)
6880 op1->type->refCount++;
6881 }
6882 return 0x1;
6883 }
6884
6885 static unsigned int UCharModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6886 {
6887 unsigned char value2 = op2->uc;
6888
6889 exp->type = 2;
6890 exp->string = PrintUChar(value2 ? (op1->uc %= value2) : (unsigned char)0);
6891 if(!exp->expType)
6892 {
6893 exp->expType = op1->type;
6894 if(op1->type)
6895 op1->type->refCount++;
6896 }
6897 return 0x1;
6898 }
6899
6900 static unsigned int IntBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6901 {
6902 int value2 = op2->i;
6903
6904 exp->type = 2;
6905 exp->string = PrintInt(op1->i & value2);
6906 if(!exp->expType)
6907 {
6908 exp->expType = op1->type;
6909 if(op1->type)
6910 op1->type->refCount++;
6911 }
6912 return 0x1;
6913 }
6914
6915 static unsigned int UIntBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6916 {
6917 unsigned int value2 = op2->ui;
6918
6919 exp->type = 2;
6920 exp->string = PrintUInt(op1->ui & value2);
6921 if(!exp->expType)
6922 {
6923 exp->expType = op1->type;
6924 if(op1->type)
6925 op1->type->refCount++;
6926 }
6927 return 0x1;
6928 }
6929
6930 static unsigned int ShortBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6931 {
6932 short value2 = op2->s;
6933
6934 exp->type = 2;
6935 exp->string = PrintShort(op1->s & value2);
6936 if(!exp->expType)
6937 {
6938 exp->expType = op1->type;
6939 if(op1->type)
6940 op1->type->refCount++;
6941 }
6942 return 0x1;
6943 }
6944
6945 static unsigned int UShortBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6946 {
6947 unsigned short value2 = op2->us;
6948
6949 exp->type = 2;
6950 exp->string = PrintUShort(op1->us & value2);
6951 if(!exp->expType)
6952 {
6953 exp->expType = op1->type;
6954 if(op1->type)
6955 op1->type->refCount++;
6956 }
6957 return 0x1;
6958 }
6959
6960 static unsigned int CharBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6961 {
6962 char value2 = op2->c;
6963
6964 exp->type = 2;
6965 exp->string = PrintChar(op1->c & value2);
6966 if(!exp->expType)
6967 {
6968 exp->expType = op1->type;
6969 if(op1->type)
6970 op1->type->refCount++;
6971 }
6972 return 0x1;
6973 }
6974
6975 static unsigned int UCharBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6976 {
6977 unsigned char value2 = op2->uc;
6978
6979 exp->type = 2;
6980 exp->string = PrintUChar(op1->uc & value2);
6981 if(!exp->expType)
6982 {
6983 exp->expType = op1->type;
6984 if(op1->type)
6985 op1->type->refCount++;
6986 }
6987 return 0x1;
6988 }
6989
6990 static unsigned int IntBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6991 {
6992 int value2 = op2->i;
6993
6994 exp->type = 2;
6995 exp->string = PrintInt(op1->i | value2);
6996 if(!exp->expType)
6997 {
6998 exp->expType = op1->type;
6999 if(op1->type)
7000 op1->type->refCount++;
7001 }
7002 return 0x1;
7003 }
7004
7005 static unsigned int UIntBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7006 {
7007 unsigned int value2 = op2->ui;
7008
7009 exp->type = 2;
7010 exp->string = PrintUInt(op1->ui | value2);
7011 if(!exp->expType)
7012 {
7013 exp->expType = op1->type;
7014 if(op1->type)
7015 op1->type->refCount++;
7016 }
7017 return 0x1;
7018 }
7019
7020 static unsigned int ShortBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7021 {
7022 short value2 = op2->s;
7023
7024 exp->type = 2;
7025 exp->string = PrintShort(op1->s | value2);
7026 if(!exp->expType)
7027 {
7028 exp->expType = op1->type;
7029 if(op1->type)
7030 op1->type->refCount++;
7031 }
7032 return 0x1;
7033 }
7034
7035 static unsigned int UShortBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7036 {
7037 unsigned short value2 = op2->us;
7038
7039 exp->type = 2;
7040 exp->string = PrintUShort(op1->us | value2);
7041 if(!exp->expType)
7042 {
7043 exp->expType = op1->type;
7044 if(op1->type)
7045 op1->type->refCount++;
7046 }
7047 return 0x1;
7048 }
7049
7050 static unsigned int CharBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7051 {
7052 char value2 = op2->c;
7053
7054 exp->type = 2;
7055 exp->string = PrintChar(op1->c | value2);
7056 if(!exp->expType)
7057 {
7058 exp->expType = op1->type;
7059 if(op1->type)
7060 op1->type->refCount++;
7061 }
7062 return 0x1;
7063 }
7064
7065 static unsigned int UCharBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7066 {
7067 unsigned char value2 = op2->uc;
7068
7069 exp->type = 2;
7070 exp->string = PrintUChar(op1->uc | value2);
7071 if(!exp->expType)
7072 {
7073 exp->expType = op1->type;
7074 if(op1->type)
7075 op1->type->refCount++;
7076 }
7077 return 0x1;
7078 }
7079
7080 static unsigned int IntBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7081 {
7082 int value2 = op2->i;
7083
7084 exp->type = 2;
7085 exp->string = PrintInt(op1->i ^ value2);
7086 if(!exp->expType)
7087 {
7088 exp->expType = op1->type;
7089 if(op1->type)
7090 op1->type->refCount++;
7091 }
7092 return 0x1;
7093 }
7094
7095 static unsigned int UIntBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7096 {
7097 unsigned int value2 = op2->ui;
7098
7099 exp->type = 2;
7100 exp->string = PrintUInt(op1->ui ^ value2);
7101 if(!exp->expType)
7102 {
7103 exp->expType = op1->type;
7104 if(op1->type)
7105 op1->type->refCount++;
7106 }
7107 return 0x1;
7108 }
7109
7110 static unsigned int ShortBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7111 {
7112 short value2 = op2->s;
7113
7114 exp->type = 2;
7115 exp->string = PrintShort(op1->s ^ value2);
7116 if(!exp->expType)
7117 {
7118 exp->expType = op1->type;
7119 if(op1->type)
7120 op1->type->refCount++;
7121 }
7122 return 0x1;
7123 }
7124
7125 static unsigned int UShortBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7126 {
7127 unsigned short value2 = op2->us;
7128
7129 exp->type = 2;
7130 exp->string = PrintUShort(op1->us ^ value2);
7131 if(!exp->expType)
7132 {
7133 exp->expType = op1->type;
7134 if(op1->type)
7135 op1->type->refCount++;
7136 }
7137 return 0x1;
7138 }
7139
7140 static unsigned int CharBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7141 {
7142 char value2 = op2->c;
7143
7144 exp->type = 2;
7145 exp->string = PrintChar(op1->c ^ value2);
7146 if(!exp->expType)
7147 {
7148 exp->expType = op1->type;
7149 if(op1->type)
7150 op1->type->refCount++;
7151 }
7152 return 0x1;
7153 }
7154
7155 static unsigned int UCharBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7156 {
7157 unsigned char value2 = op2->uc;
7158
7159 exp->type = 2;
7160 exp->string = PrintUChar(op1->uc ^ value2);
7161 if(!exp->expType)
7162 {
7163 exp->expType = op1->type;
7164 if(op1->type)
7165 op1->type->refCount++;
7166 }
7167 return 0x1;
7168 }
7169
7170 static unsigned int IntLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7171 {
7172 int value2 = op2->i;
7173
7174 exp->type = 2;
7175 exp->string = PrintInt(op1->i << value2);
7176 if(!exp->expType)
7177 {
7178 exp->expType = op1->type;
7179 if(op1->type)
7180 op1->type->refCount++;
7181 }
7182 return 0x1;
7183 }
7184
7185 static unsigned int UIntLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7186 {
7187 unsigned int value2 = op2->ui;
7188
7189 exp->type = 2;
7190 exp->string = PrintUInt(op1->ui << value2);
7191 if(!exp->expType)
7192 {
7193 exp->expType = op1->type;
7194 if(op1->type)
7195 op1->type->refCount++;
7196 }
7197 return 0x1;
7198 }
7199
7200 static unsigned int ShortLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7201 {
7202 short value2 = op2->s;
7203
7204 exp->type = 2;
7205 exp->string = PrintShort(op1->s << value2);
7206 if(!exp->expType)
7207 {
7208 exp->expType = op1->type;
7209 if(op1->type)
7210 op1->type->refCount++;
7211 }
7212 return 0x1;
7213 }
7214
7215 static unsigned int UShortLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7216 {
7217 unsigned short value2 = op2->us;
7218
7219 exp->type = 2;
7220 exp->string = PrintUShort(op1->us << value2);
7221 if(!exp->expType)
7222 {
7223 exp->expType = op1->type;
7224 if(op1->type)
7225 op1->type->refCount++;
7226 }
7227 return 0x1;
7228 }
7229
7230 static unsigned int CharLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7231 {
7232 char value2 = op2->c;
7233
7234 exp->type = 2;
7235 exp->string = PrintChar(op1->c << value2);
7236 if(!exp->expType)
7237 {
7238 exp->expType = op1->type;
7239 if(op1->type)
7240 op1->type->refCount++;
7241 }
7242 return 0x1;
7243 }
7244
7245 static unsigned int UCharLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7246 {
7247 unsigned char value2 = op2->uc;
7248
7249 exp->type = 2;
7250 exp->string = PrintUChar(op1->uc << value2);
7251 if(!exp->expType)
7252 {
7253 exp->expType = op1->type;
7254 if(op1->type)
7255 op1->type->refCount++;
7256 }
7257 return 0x1;
7258 }
7259
7260 static unsigned int IntRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7261 {
7262 int value2 = op2->i;
7263
7264 exp->type = 2;
7265 exp->string = PrintInt(op1->i >> value2);
7266 if(!exp->expType)
7267 {
7268 exp->expType = op1->type;
7269 if(op1->type)
7270 op1->type->refCount++;
7271 }
7272 return 0x1;
7273 }
7274
7275 static unsigned int UIntRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7276 {
7277 unsigned int value2 = op2->ui;
7278
7279 exp->type = 2;
7280 exp->string = PrintUInt(op1->ui >> value2);
7281 if(!exp->expType)
7282 {
7283 exp->expType = op1->type;
7284 if(op1->type)
7285 op1->type->refCount++;
7286 }
7287 return 0x1;
7288 }
7289
7290 static unsigned int ShortRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7291 {
7292 short value2 = op2->s;
7293
7294 exp->type = 2;
7295 exp->string = PrintShort(op1->s >> value2);
7296 if(!exp->expType)
7297 {
7298 exp->expType = op1->type;
7299 if(op1->type)
7300 op1->type->refCount++;
7301 }
7302 return 0x1;
7303 }
7304
7305 static unsigned int UShortRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7306 {
7307 unsigned short value2 = op2->us;
7308
7309 exp->type = 2;
7310 exp->string = PrintUShort(op1->us >> value2);
7311 if(!exp->expType)
7312 {
7313 exp->expType = op1->type;
7314 if(op1->type)
7315 op1->type->refCount++;
7316 }
7317 return 0x1;
7318 }
7319
7320 static unsigned int CharRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7321 {
7322 char value2 = op2->c;
7323
7324 exp->type = 2;
7325 exp->string = PrintChar(op1->c >> value2);
7326 if(!exp->expType)
7327 {
7328 exp->expType = op1->type;
7329 if(op1->type)
7330 op1->type->refCount++;
7331 }
7332 return 0x1;
7333 }
7334
7335 static unsigned int UCharRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7336 {
7337 unsigned char value2 = op2->uc;
7338
7339 exp->type = 2;
7340 exp->string = PrintUChar(op1->uc >> value2);
7341 if(!exp->expType)
7342 {
7343 exp->expType = op1->type;
7344 if(op1->type)
7345 op1->type->refCount++;
7346 }
7347 return 0x1;
7348 }
7349
7350 static unsigned int IntBitNot(struct Expression * exp, struct Operand * op1)
7351 {
7352 exp->type = 2;
7353 exp->string = PrintInt(~op1->i);
7354 if(!exp->expType)
7355 {
7356 exp->expType = op1->type;
7357 if(op1->type)
7358 op1->type->refCount++;
7359 }
7360 return 0x1;
7361 }
7362
7363 static unsigned int UIntBitNot(struct Expression * exp, struct Operand * op1)
7364 {
7365 exp->type = 2;
7366 exp->string = PrintUInt(~op1->ui);
7367 if(!exp->expType)
7368 {
7369 exp->expType = op1->type;
7370 if(op1->type)
7371 op1->type->refCount++;
7372 }
7373 return 0x1;
7374 }
7375
7376 static unsigned int ShortBitNot(struct Expression * exp, struct Operand * op1)
7377 {
7378 exp->type = 2;
7379 exp->string = PrintShort(~op1->s);
7380 if(!exp->expType)
7381 {
7382 exp->expType = op1->type;
7383 if(op1->type)
7384 op1->type->refCount++;
7385 }
7386 return 0x1;
7387 }
7388
7389 static unsigned int UShortBitNot(struct Expression * exp, struct Operand * op1)
7390 {
7391 exp->type = 2;
7392 exp->string = PrintUShort(~op1->us);
7393 if(!exp->expType)
7394 {
7395 exp->expType = op1->type;
7396 if(op1->type)
7397 op1->type->refCount++;
7398 }
7399 return 0x1;
7400 }
7401
7402 static unsigned int CharBitNot(struct Expression * exp, struct Operand * op1)
7403 {
7404 exp->type = 2;
7405 exp->string = PrintChar(~op1->c);
7406 if(!exp->expType)
7407 {
7408 exp->expType = op1->type;
7409 if(op1->type)
7410 op1->type->refCount++;
7411 }
7412 return 0x1;
7413 }
7414
7415 static unsigned int UCharBitNot(struct Expression * exp, struct Operand * op1)
7416 {
7417 exp->type = 2;
7418 exp->string = PrintUChar(~op1->uc);
7419 if(!exp->expType)
7420 {
7421 exp->expType = op1->type;
7422 if(op1->type)
7423 op1->type->refCount++;
7424 }
7425 return 0x1;
7426 }
7427
7428 static unsigned int IntAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7429 {
7430 int value2 = op2->i;
7431
7432 exp->type = 2;
7433 exp->string = PrintInt(op1->i &= value2);
7434 if(!exp->expType)
7435 {
7436 exp->expType = op1->type;
7437 if(op1->type)
7438 op1->type->refCount++;
7439 }
7440 return 0x1;
7441 }
7442
7443 static unsigned int UIntAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7444 {
7445 unsigned int value2 = op2->ui;
7446
7447 exp->type = 2;
7448 exp->string = PrintUInt(op1->ui &= value2);
7449 if(!exp->expType)
7450 {
7451 exp->expType = op1->type;
7452 if(op1->type)
7453 op1->type->refCount++;
7454 }
7455 return 0x1;
7456 }
7457
7458 static unsigned int ShortAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7459 {
7460 short value2 = op2->s;
7461
7462 exp->type = 2;
7463 exp->string = PrintShort(op1->s &= value2);
7464 if(!exp->expType)
7465 {
7466 exp->expType = op1->type;
7467 if(op1->type)
7468 op1->type->refCount++;
7469 }
7470 return 0x1;
7471 }
7472
7473 static unsigned int UShortAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7474 {
7475 unsigned short value2 = op2->us;
7476
7477 exp->type = 2;
7478 exp->string = PrintUShort(op1->us &= value2);
7479 if(!exp->expType)
7480 {
7481 exp->expType = op1->type;
7482 if(op1->type)
7483 op1->type->refCount++;
7484 }
7485 return 0x1;
7486 }
7487
7488 static unsigned int CharAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7489 {
7490 char value2 = op2->c;
7491
7492 exp->type = 2;
7493 exp->string = PrintChar(op1->c &= value2);
7494 if(!exp->expType)
7495 {
7496 exp->expType = op1->type;
7497 if(op1->type)
7498 op1->type->refCount++;
7499 }
7500 return 0x1;
7501 }
7502
7503 static unsigned int UCharAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7504 {
7505 unsigned char value2 = op2->uc;
7506
7507 exp->type = 2;
7508 exp->string = PrintUChar(op1->uc &= value2);
7509 if(!exp->expType)
7510 {
7511 exp->expType = op1->type;
7512 if(op1->type)
7513 op1->type->refCount++;
7514 }
7515 return 0x1;
7516 }
7517
7518 static unsigned int IntOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7519 {
7520 int value2 = op2->i;
7521
7522 exp->type = 2;
7523 exp->string = PrintInt(op1->i |= value2);
7524 if(!exp->expType)
7525 {
7526 exp->expType = op1->type;
7527 if(op1->type)
7528 op1->type->refCount++;
7529 }
7530 return 0x1;
7531 }
7532
7533 static unsigned int UIntOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7534 {
7535 unsigned int value2 = op2->ui;
7536
7537 exp->type = 2;
7538 exp->string = PrintUInt(op1->ui |= value2);
7539 if(!exp->expType)
7540 {
7541 exp->expType = op1->type;
7542 if(op1->type)
7543 op1->type->refCount++;
7544 }
7545 return 0x1;
7546 }
7547
7548 static unsigned int ShortOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7549 {
7550 short value2 = op2->s;
7551
7552 exp->type = 2;
7553 exp->string = PrintShort(op1->s |= value2);
7554 if(!exp->expType)
7555 {
7556 exp->expType = op1->type;
7557 if(op1->type)
7558 op1->type->refCount++;
7559 }
7560 return 0x1;
7561 }
7562
7563 static unsigned int UShortOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7564 {
7565 unsigned short value2 = op2->us;
7566
7567 exp->type = 2;
7568 exp->string = PrintUShort(op1->us |= value2);
7569 if(!exp->expType)
7570 {
7571 exp->expType = op1->type;
7572 if(op1->type)
7573 op1->type->refCount++;
7574 }
7575 return 0x1;
7576 }
7577
7578 static unsigned int CharOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7579 {
7580 char value2 = op2->c;
7581
7582 exp->type = 2;
7583 exp->string = PrintChar(op1->c |= value2);
7584 if(!exp->expType)
7585 {
7586 exp->expType = op1->type;
7587 if(op1->type)
7588 op1->type->refCount++;
7589 }
7590 return 0x1;
7591 }
7592
7593 static unsigned int UCharOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7594 {
7595 unsigned char value2 = op2->uc;
7596
7597 exp->type = 2;
7598 exp->string = PrintUChar(op1->uc |= value2);
7599 if(!exp->expType)
7600 {
7601 exp->expType = op1->type;
7602 if(op1->type)
7603 op1->type->refCount++;
7604 }
7605 return 0x1;
7606 }
7607
7608 static unsigned int IntXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7609 {
7610 int value2 = op2->i;
7611
7612 exp->type = 2;
7613 exp->string = PrintInt(op1->i ^= value2);
7614 if(!exp->expType)
7615 {
7616 exp->expType = op1->type;
7617 if(op1->type)
7618 op1->type->refCount++;
7619 }
7620 return 0x1;
7621 }
7622
7623 static unsigned int UIntXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7624 {
7625 unsigned int value2 = op2->ui;
7626
7627 exp->type = 2;
7628 exp->string = PrintUInt(op1->ui ^= value2);
7629 if(!exp->expType)
7630 {
7631 exp->expType = op1->type;
7632 if(op1->type)
7633 op1->type->refCount++;
7634 }
7635 return 0x1;
7636 }
7637
7638 static unsigned int ShortXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7639 {
7640 short value2 = op2->s;
7641
7642 exp->type = 2;
7643 exp->string = PrintShort(op1->s ^= value2);
7644 if(!exp->expType)
7645 {
7646 exp->expType = op1->type;
7647 if(op1->type)
7648 op1->type->refCount++;
7649 }
7650 return 0x1;
7651 }
7652
7653 static unsigned int UShortXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7654 {
7655 unsigned short value2 = op2->us;
7656
7657 exp->type = 2;
7658 exp->string = PrintUShort(op1->us ^= value2);
7659 if(!exp->expType)
7660 {
7661 exp->expType = op1->type;
7662 if(op1->type)
7663 op1->type->refCount++;
7664 }
7665 return 0x1;
7666 }
7667
7668 static unsigned int CharXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7669 {
7670 char value2 = op2->c;
7671
7672 exp->type = 2;
7673 exp->string = PrintChar(op1->c ^= value2);
7674 if(!exp->expType)
7675 {
7676 exp->expType = op1->type;
7677 if(op1->type)
7678 op1->type->refCount++;
7679 }
7680 return 0x1;
7681 }
7682
7683 static unsigned int UCharXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7684 {
7685 unsigned char value2 = op2->uc;
7686
7687 exp->type = 2;
7688 exp->string = PrintUChar(op1->uc ^= value2);
7689 if(!exp->expType)
7690 {
7691 exp->expType = op1->type;
7692 if(op1->type)
7693 op1->type->refCount++;
7694 }
7695 return 0x1;
7696 }
7697
7698 static unsigned int IntLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7699 {
7700 int value2 = op2->i;
7701
7702 exp->type = 2;
7703 exp->string = PrintInt(op1->i <<= value2);
7704 if(!exp->expType)
7705 {
7706 exp->expType = op1->type;
7707 if(op1->type)
7708 op1->type->refCount++;
7709 }
7710 return 0x1;
7711 }
7712
7713 static unsigned int UIntLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7714 {
7715 unsigned int value2 = op2->ui;
7716
7717 exp->type = 2;
7718 exp->string = PrintUInt(op1->ui <<= value2);
7719 if(!exp->expType)
7720 {
7721 exp->expType = op1->type;
7722 if(op1->type)
7723 op1->type->refCount++;
7724 }
7725 return 0x1;
7726 }
7727
7728 static unsigned int ShortLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7729 {
7730 short value2 = op2->s;
7731
7732 exp->type = 2;
7733 exp->string = PrintShort(op1->s <<= value2);
7734 if(!exp->expType)
7735 {
7736 exp->expType = op1->type;
7737 if(op1->type)
7738 op1->type->refCount++;
7739 }
7740 return 0x1;
7741 }
7742
7743 static unsigned int UShortLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7744 {
7745 unsigned short value2 = op2->us;
7746
7747 exp->type = 2;
7748 exp->string = PrintUShort(op1->us <<= value2);
7749 if(!exp->expType)
7750 {
7751 exp->expType = op1->type;
7752 if(op1->type)
7753 op1->type->refCount++;
7754 }
7755 return 0x1;
7756 }
7757
7758 static unsigned int CharLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7759 {
7760 char value2 = op2->c;
7761
7762 exp->type = 2;
7763 exp->string = PrintChar(op1->c <<= value2);
7764 if(!exp->expType)
7765 {
7766 exp->expType = op1->type;
7767 if(op1->type)
7768 op1->type->refCount++;
7769 }
7770 return 0x1;
7771 }
7772
7773 static unsigned int UCharLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7774 {
7775 unsigned char value2 = op2->uc;
7776
7777 exp->type = 2;
7778 exp->string = PrintUChar(op1->uc <<= value2);
7779 if(!exp->expType)
7780 {
7781 exp->expType = op1->type;
7782 if(op1->type)
7783 op1->type->refCount++;
7784 }
7785 return 0x1;
7786 }
7787
7788 static unsigned int IntRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7789 {
7790 int value2 = op2->i;
7791
7792 exp->type = 2;
7793 exp->string = PrintInt(op1->i >>= value2);
7794 if(!exp->expType)
7795 {
7796 exp->expType = op1->type;
7797 if(op1->type)
7798 op1->type->refCount++;
7799 }
7800 return 0x1;
7801 }
7802
7803 static unsigned int UIntRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7804 {
7805 unsigned int value2 = op2->ui;
7806
7807 exp->type = 2;
7808 exp->string = PrintUInt(op1->ui >>= value2);
7809 if(!exp->expType)
7810 {
7811 exp->expType = op1->type;
7812 if(op1->type)
7813 op1->type->refCount++;
7814 }
7815 return 0x1;
7816 }
7817
7818 static unsigned int ShortRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7819 {
7820 short value2 = op2->s;
7821
7822 exp->type = 2;
7823 exp->string = PrintShort(op1->s >>= value2);
7824 if(!exp->expType)
7825 {
7826 exp->expType = op1->type;
7827 if(op1->type)
7828 op1->type->refCount++;
7829 }
7830 return 0x1;
7831 }
7832
7833 static unsigned int UShortRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7834 {
7835 unsigned short value2 = op2->us;
7836
7837 exp->type = 2;
7838 exp->string = PrintUShort(op1->us >>= value2);
7839 if(!exp->expType)
7840 {
7841 exp->expType = op1->type;
7842 if(op1->type)
7843 op1->type->refCount++;
7844 }
7845 return 0x1;
7846 }
7847
7848 static unsigned int CharRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7849 {
7850 char value2 = op2->c;
7851
7852 exp->type = 2;
7853 exp->string = PrintChar(op1->c >>= value2);
7854 if(!exp->expType)
7855 {
7856 exp->expType = op1->type;
7857 if(op1->type)
7858 op1->type->refCount++;
7859 }
7860 return 0x1;
7861 }
7862
7863 static unsigned int UCharRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7864 {
7865 unsigned char value2 = op2->uc;
7866
7867 exp->type = 2;
7868 exp->string = PrintUChar(op1->uc >>= value2);
7869 if(!exp->expType)
7870 {
7871 exp->expType = op1->type;
7872 if(op1->type)
7873 op1->type->refCount++;
7874 }
7875 return 0x1;
7876 }
7877
7878 static unsigned int IntNot(struct Expression * exp, struct Operand * op1)
7879 {
7880 exp->type = 2;
7881 exp->string = PrintInt(!op1->i);
7882 if(!exp->expType)
7883 {
7884 exp->expType = op1->type;
7885 if(op1->type)
7886 op1->type->refCount++;
7887 }
7888 return 0x1;
7889 }
7890
7891 static unsigned int UIntNot(struct Expression * exp, struct Operand * op1)
7892 {
7893 exp->type = 2;
7894 exp->string = PrintUInt(!op1->ui);
7895 if(!exp->expType)
7896 {
7897 exp->expType = op1->type;
7898 if(op1->type)
7899 op1->type->refCount++;
7900 }
7901 return 0x1;
7902 }
7903
7904 static unsigned int ShortNot(struct Expression * exp, struct Operand * op1)
7905 {
7906 exp->type = 2;
7907 exp->string = PrintShort(!op1->s);
7908 if(!exp->expType)
7909 {
7910 exp->expType = op1->type;
7911 if(op1->type)
7912 op1->type->refCount++;
7913 }
7914 return 0x1;
7915 }
7916
7917 static unsigned int UShortNot(struct Expression * exp, struct Operand * op1)
7918 {
7919 exp->type = 2;
7920 exp->string = PrintUShort(!op1->us);
7921 if(!exp->expType)
7922 {
7923 exp->expType = op1->type;
7924 if(op1->type)
7925 op1->type->refCount++;
7926 }
7927 return 0x1;
7928 }
7929
7930 static unsigned int CharNot(struct Expression * exp, struct Operand * op1)
7931 {
7932 exp->type = 2;
7933 exp->string = PrintChar(!op1->c);
7934 if(!exp->expType)
7935 {
7936 exp->expType = op1->type;
7937 if(op1->type)
7938 op1->type->refCount++;
7939 }
7940 return 0x1;
7941 }
7942
7943 static unsigned int UCharNot(struct Expression * exp, struct Operand * op1)
7944 {
7945 exp->type = 2;
7946 exp->string = PrintUChar(!op1->uc);
7947 if(!exp->expType)
7948 {
7949 exp->expType = op1->type;
7950 if(op1->type)
7951 op1->type->refCount++;
7952 }
7953 return 0x1;
7954 }
7955
7956 static unsigned int IntEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7957 {
7958 int value2 = op2->i;
7959
7960 exp->type = 2;
7961 exp->string = PrintInt(op1->i == value2);
7962 if(!exp->expType)
7963 {
7964 exp->expType = op1->type;
7965 if(op1->type)
7966 op1->type->refCount++;
7967 }
7968 return 0x1;
7969 }
7970
7971 static unsigned int UIntEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7972 {
7973 unsigned int value2 = op2->ui;
7974
7975 exp->type = 2;
7976 exp->string = PrintUInt(op1->ui == value2);
7977 if(!exp->expType)
7978 {
7979 exp->expType = op1->type;
7980 if(op1->type)
7981 op1->type->refCount++;
7982 }
7983 return 0x1;
7984 }
7985
7986 static unsigned int ShortEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7987 {
7988 short value2 = op2->s;
7989
7990 exp->type = 2;
7991 exp->string = PrintShort(op1->s == value2);
7992 if(!exp->expType)
7993 {
7994 exp->expType = op1->type;
7995 if(op1->type)
7996 op1->type->refCount++;
7997 }
7998 return 0x1;
7999 }
8000
8001 static unsigned int UShortEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8002 {
8003 unsigned short value2 = op2->us;
8004
8005 exp->type = 2;
8006 exp->string = PrintUShort(op1->us == value2);
8007 if(!exp->expType)
8008 {
8009 exp->expType = op1->type;
8010 if(op1->type)
8011 op1->type->refCount++;
8012 }
8013 return 0x1;
8014 }
8015
8016 static unsigned int CharEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8017 {
8018 char value2 = op2->c;
8019
8020 exp->type = 2;
8021 exp->string = PrintChar(op1->c == value2);
8022 if(!exp->expType)
8023 {
8024 exp->expType = op1->type;
8025 if(op1->type)
8026 op1->type->refCount++;
8027 }
8028 return 0x1;
8029 }
8030
8031 static unsigned int UCharEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8032 {
8033 unsigned char value2 = op2->uc;
8034
8035 exp->type = 2;
8036 exp->string = PrintUChar(op1->uc == value2);
8037 if(!exp->expType)
8038 {
8039 exp->expType = op1->type;
8040 if(op1->type)
8041 op1->type->refCount++;
8042 }
8043 return 0x1;
8044 }
8045
8046 static unsigned int FloatEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8047 {
8048 float value2 = op2->f;
8049
8050 exp->type = 2;
8051 exp->string = PrintFloat(op1->f == value2);
8052 if(!exp->expType)
8053 {
8054 exp->expType = op1->type;
8055 if(op1->type)
8056 op1->type->refCount++;
8057 }
8058 return 0x1;
8059 }
8060
8061 static unsigned int DoubleEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8062 {
8063 double value2 = op2->d;
8064
8065 exp->type = 2;
8066 exp->string = PrintDouble(op1->d == value2);
8067 if(!exp->expType)
8068 {
8069 exp->expType = op1->type;
8070 if(op1->type)
8071 op1->type->refCount++;
8072 }
8073 return 0x1;
8074 }
8075
8076 static unsigned int IntNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8077 {
8078 int value2 = op2->i;
8079
8080 exp->type = 2;
8081 exp->string = PrintInt(op1->i != value2);
8082 if(!exp->expType)
8083 {
8084 exp->expType = op1->type;
8085 if(op1->type)
8086 op1->type->refCount++;
8087 }
8088 return 0x1;
8089 }
8090
8091 static unsigned int UIntNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8092 {
8093 unsigned int value2 = op2->ui;
8094
8095 exp->type = 2;
8096 exp->string = PrintUInt(op1->ui != value2);
8097 if(!exp->expType)
8098 {
8099 exp->expType = op1->type;
8100 if(op1->type)
8101 op1->type->refCount++;
8102 }
8103 return 0x1;
8104 }
8105
8106 static unsigned int ShortNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8107 {
8108 short value2 = op2->s;
8109
8110 exp->type = 2;
8111 exp->string = PrintShort(op1->s != value2);
8112 if(!exp->expType)
8113 {
8114 exp->expType = op1->type;
8115 if(op1->type)
8116 op1->type->refCount++;
8117 }
8118 return 0x1;
8119 }
8120
8121 static unsigned int UShortNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8122 {
8123 unsigned short value2 = op2->us;
8124
8125 exp->type = 2;
8126 exp->string = PrintUShort(op1->us != value2);
8127 if(!exp->expType)
8128 {
8129 exp->expType = op1->type;
8130 if(op1->type)
8131 op1->type->refCount++;
8132 }
8133 return 0x1;
8134 }
8135
8136 static unsigned int CharNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8137 {
8138 char value2 = op2->c;
8139
8140 exp->type = 2;
8141 exp->string = PrintChar(op1->c != value2);
8142 if(!exp->expType)
8143 {
8144 exp->expType = op1->type;
8145 if(op1->type)
8146 op1->type->refCount++;
8147 }
8148 return 0x1;
8149 }
8150
8151 static unsigned int UCharNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8152 {
8153 unsigned char value2 = op2->uc;
8154
8155 exp->type = 2;
8156 exp->string = PrintUChar(op1->uc != value2);
8157 if(!exp->expType)
8158 {
8159 exp->expType = op1->type;
8160 if(op1->type)
8161 op1->type->refCount++;
8162 }
8163 return 0x1;
8164 }
8165
8166 static unsigned int FloatNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8167 {
8168 float value2 = op2->f;
8169
8170 exp->type = 2;
8171 exp->string = PrintFloat(op1->f != value2);
8172 if(!exp->expType)
8173 {
8174 exp->expType = op1->type;
8175 if(op1->type)
8176 op1->type->refCount++;
8177 }
8178 return 0x1;
8179 }
8180
8181 static unsigned int DoubleNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8182 {
8183 double value2 = op2->d;
8184
8185 exp->type = 2;
8186 exp->string = PrintDouble(op1->d != value2);
8187 if(!exp->expType)
8188 {
8189 exp->expType = op1->type;
8190 if(op1->type)
8191 op1->type->refCount++;
8192 }
8193 return 0x1;
8194 }
8195
8196 static unsigned int IntAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8197 {
8198 int value2 = op2->i;
8199
8200 exp->type = 2;
8201 exp->string = PrintInt(op1->i && value2);
8202 if(!exp->expType)
8203 {
8204 exp->expType = op1->type;
8205 if(op1->type)
8206 op1->type->refCount++;
8207 }
8208 return 0x1;
8209 }
8210
8211 static unsigned int UIntAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8212 {
8213 unsigned int value2 = op2->ui;
8214
8215 exp->type = 2;
8216 exp->string = PrintUInt(op1->ui && value2);
8217 if(!exp->expType)
8218 {
8219 exp->expType = op1->type;
8220 if(op1->type)
8221 op1->type->refCount++;
8222 }
8223 return 0x1;
8224 }
8225
8226 static unsigned int ShortAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8227 {
8228 short value2 = op2->s;
8229
8230 exp->type = 2;
8231 exp->string = PrintShort(op1->s && value2);
8232 if(!exp->expType)
8233 {
8234 exp->expType = op1->type;
8235 if(op1->type)
8236 op1->type->refCount++;
8237 }
8238 return 0x1;
8239 }
8240
8241 static unsigned int UShortAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8242 {
8243 unsigned short value2 = op2->us;
8244
8245 exp->type = 2;
8246 exp->string = PrintUShort(op1->us && value2);
8247 if(!exp->expType)
8248 {
8249 exp->expType = op1->type;
8250 if(op1->type)
8251 op1->type->refCount++;
8252 }
8253 return 0x1;
8254 }
8255
8256 static unsigned int CharAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8257 {
8258 char value2 = op2->c;
8259
8260 exp->type = 2;
8261 exp->string = PrintChar(op1->c && value2);
8262 if(!exp->expType)
8263 {
8264 exp->expType = op1->type;
8265 if(op1->type)
8266 op1->type->refCount++;
8267 }
8268 return 0x1;
8269 }
8270
8271 static unsigned int UCharAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8272 {
8273 unsigned char value2 = op2->uc;
8274
8275 exp->type = 2;
8276 exp->string = PrintUChar(op1->uc && value2);
8277 if(!exp->expType)
8278 {
8279 exp->expType = op1->type;
8280 if(op1->type)
8281 op1->type->refCount++;
8282 }
8283 return 0x1;
8284 }
8285
8286 static unsigned int FloatAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8287 {
8288 float value2 = op2->f;
8289
8290 exp->type = 2;
8291 exp->string = PrintFloat(op1->f && value2);
8292 if(!exp->expType)
8293 {
8294 exp->expType = op1->type;
8295 if(op1->type)
8296 op1->type->refCount++;
8297 }
8298 return 0x1;
8299 }
8300
8301 static unsigned int DoubleAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8302 {
8303 double value2 = op2->d;
8304
8305 exp->type = 2;
8306 exp->string = PrintDouble(op1->d && value2);
8307 if(!exp->expType)
8308 {
8309 exp->expType = op1->type;
8310 if(op1->type)
8311 op1->type->refCount++;
8312 }
8313 return 0x1;
8314 }
8315
8316 static unsigned int IntOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8317 {
8318 int value2 = op2->i;
8319
8320 exp->type = 2;
8321 exp->string = PrintInt(op1->i || value2);
8322 if(!exp->expType)
8323 {
8324 exp->expType = op1->type;
8325 if(op1->type)
8326 op1->type->refCount++;
8327 }
8328 return 0x1;
8329 }
8330
8331 static unsigned int UIntOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8332 {
8333 unsigned int value2 = op2->ui;
8334
8335 exp->type = 2;
8336 exp->string = PrintUInt(op1->ui || value2);
8337 if(!exp->expType)
8338 {
8339 exp->expType = op1->type;
8340 if(op1->type)
8341 op1->type->refCount++;
8342 }
8343 return 0x1;
8344 }
8345
8346 static unsigned int ShortOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8347 {
8348 short value2 = op2->s;
8349
8350 exp->type = 2;
8351 exp->string = PrintShort(op1->s || value2);
8352 if(!exp->expType)
8353 {
8354 exp->expType = op1->type;
8355 if(op1->type)
8356 op1->type->refCount++;
8357 }
8358 return 0x1;
8359 }
8360
8361 static unsigned int UShortOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8362 {
8363 unsigned short value2 = op2->us;
8364
8365 exp->type = 2;
8366 exp->string = PrintUShort(op1->us || value2);
8367 if(!exp->expType)
8368 {
8369 exp->expType = op1->type;
8370 if(op1->type)
8371 op1->type->refCount++;
8372 }
8373 return 0x1;
8374 }
8375
8376 static unsigned int CharOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8377 {
8378 char value2 = op2->c;
8379
8380 exp->type = 2;
8381 exp->string = PrintChar(op1->c || value2);
8382 if(!exp->expType)
8383 {
8384 exp->expType = op1->type;
8385 if(op1->type)
8386 op1->type->refCount++;
8387 }
8388 return 0x1;
8389 }
8390
8391 static unsigned int UCharOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8392 {
8393 unsigned char value2 = op2->uc;
8394
8395 exp->type = 2;
8396 exp->string = PrintUChar(op1->uc || value2);
8397 if(!exp->expType)
8398 {
8399 exp->expType = op1->type;
8400 if(op1->type)
8401 op1->type->refCount++;
8402 }
8403 return 0x1;
8404 }
8405
8406 static unsigned int FloatOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8407 {
8408 float value2 = op2->f;
8409
8410 exp->type = 2;
8411 exp->string = PrintFloat(op1->f || value2);
8412 if(!exp->expType)
8413 {
8414 exp->expType = op1->type;
8415 if(op1->type)
8416 op1->type->refCount++;
8417 }
8418 return 0x1;
8419 }
8420
8421 static unsigned int DoubleOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8422 {
8423 double value2 = op2->d;
8424
8425 exp->type = 2;
8426 exp->string = PrintDouble(op1->d || value2);
8427 if(!exp->expType)
8428 {
8429 exp->expType = op1->type;
8430 if(op1->type)
8431 op1->type->refCount++;
8432 }
8433 return 0x1;
8434 }
8435
8436 static unsigned int IntGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8437 {
8438 int value2 = op2->i;
8439
8440 exp->type = 2;
8441 exp->string = PrintInt(op1->i > value2);
8442 if(!exp->expType)
8443 {
8444 exp->expType = op1->type;
8445 if(op1->type)
8446 op1->type->refCount++;
8447 }
8448 return 0x1;
8449 }
8450
8451 static unsigned int UIntGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8452 {
8453 unsigned int value2 = op2->ui;
8454
8455 exp->type = 2;
8456 exp->string = PrintUInt(op1->ui > value2);
8457 if(!exp->expType)
8458 {
8459 exp->expType = op1->type;
8460 if(op1->type)
8461 op1->type->refCount++;
8462 }
8463 return 0x1;
8464 }
8465
8466 static unsigned int ShortGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8467 {
8468 short value2 = op2->s;
8469
8470 exp->type = 2;
8471 exp->string = PrintShort(op1->s > value2);
8472 if(!exp->expType)
8473 {
8474 exp->expType = op1->type;
8475 if(op1->type)
8476 op1->type->refCount++;
8477 }
8478 return 0x1;
8479 }
8480
8481 static unsigned int UShortGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8482 {
8483 unsigned short value2 = op2->us;
8484
8485 exp->type = 2;
8486 exp->string = PrintUShort(op1->us > value2);
8487 if(!exp->expType)
8488 {
8489 exp->expType = op1->type;
8490 if(op1->type)
8491 op1->type->refCount++;
8492 }
8493 return 0x1;
8494 }
8495
8496 static unsigned int CharGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8497 {
8498 char value2 = op2->c;
8499
8500 exp->type = 2;
8501 exp->string = PrintChar(op1->c > value2);
8502 if(!exp->expType)
8503 {
8504 exp->expType = op1->type;
8505 if(op1->type)
8506 op1->type->refCount++;
8507 }
8508 return 0x1;
8509 }
8510
8511 static unsigned int UCharGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8512 {
8513 unsigned char value2 = op2->uc;
8514
8515 exp->type = 2;
8516 exp->string = PrintUChar(op1->uc > value2);
8517 if(!exp->expType)
8518 {
8519 exp->expType = op1->type;
8520 if(op1->type)
8521 op1->type->refCount++;
8522 }
8523 return 0x1;
8524 }
8525
8526 static unsigned int FloatGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8527 {
8528 float value2 = op2->f;
8529
8530 exp->type = 2;
8531 exp->string = PrintFloat(op1->f > value2);
8532 if(!exp->expType)
8533 {
8534 exp->expType = op1->type;
8535 if(op1->type)
8536 op1->type->refCount++;
8537 }
8538 return 0x1;
8539 }
8540
8541 static unsigned int DoubleGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8542 {
8543 double value2 = op2->d;
8544
8545 exp->type = 2;
8546 exp->string = PrintDouble(op1->d > value2);
8547 if(!exp->expType)
8548 {
8549 exp->expType = op1->type;
8550 if(op1->type)
8551 op1->type->refCount++;
8552 }
8553 return 0x1;
8554 }
8555
8556 static unsigned int IntSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8557 {
8558 int value2 = op2->i;
8559
8560 exp->type = 2;
8561 exp->string = PrintInt(op1->i < value2);
8562 if(!exp->expType)
8563 {
8564 exp->expType = op1->type;
8565 if(op1->type)
8566 op1->type->refCount++;
8567 }
8568 return 0x1;
8569 }
8570
8571 static unsigned int UIntSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8572 {
8573 unsigned int value2 = op2->ui;
8574
8575 exp->type = 2;
8576 exp->string = PrintUInt(op1->ui < value2);
8577 if(!exp->expType)
8578 {
8579 exp->expType = op1->type;
8580 if(op1->type)
8581 op1->type->refCount++;
8582 }
8583 return 0x1;
8584 }
8585
8586 static unsigned int ShortSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8587 {
8588 short value2 = op2->s;
8589
8590 exp->type = 2;
8591 exp->string = PrintShort(op1->s < value2);
8592 if(!exp->expType)
8593 {
8594 exp->expType = op1->type;
8595 if(op1->type)
8596 op1->type->refCount++;
8597 }
8598 return 0x1;
8599 }
8600
8601 static unsigned int UShortSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8602 {
8603 unsigned short value2 = op2->us;
8604
8605 exp->type = 2;
8606 exp->string = PrintUShort(op1->us < value2);
8607 if(!exp->expType)
8608 {
8609 exp->expType = op1->type;
8610 if(op1->type)
8611 op1->type->refCount++;
8612 }
8613 return 0x1;
8614 }
8615
8616 static unsigned int CharSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8617 {
8618 char value2 = op2->c;
8619
8620 exp->type = 2;
8621 exp->string = PrintChar(op1->c < value2);
8622 if(!exp->expType)
8623 {
8624 exp->expType = op1->type;
8625 if(op1->type)
8626 op1->type->refCount++;
8627 }
8628 return 0x1;
8629 }
8630
8631 static unsigned int UCharSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8632 {
8633 unsigned char value2 = op2->uc;
8634
8635 exp->type = 2;
8636 exp->string = PrintUChar(op1->uc < value2);
8637 if(!exp->expType)
8638 {
8639 exp->expType = op1->type;
8640 if(op1->type)
8641 op1->type->refCount++;
8642 }
8643 return 0x1;
8644 }
8645
8646 static unsigned int FloatSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8647 {
8648 float value2 = op2->f;
8649
8650 exp->type = 2;
8651 exp->string = PrintFloat(op1->f < value2);
8652 if(!exp->expType)
8653 {
8654 exp->expType = op1->type;
8655 if(op1->type)
8656 op1->type->refCount++;
8657 }
8658 return 0x1;
8659 }
8660
8661 static unsigned int DoubleSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8662 {
8663 double value2 = op2->d;
8664
8665 exp->type = 2;
8666 exp->string = PrintDouble(op1->d < value2);
8667 if(!exp->expType)
8668 {
8669 exp->expType = op1->type;
8670 if(op1->type)
8671 op1->type->refCount++;
8672 }
8673 return 0x1;
8674 }
8675
8676 static unsigned int IntGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8677 {
8678 int value2 = op2->i;
8679
8680 exp->type = 2;
8681 exp->string = PrintInt(op1->i >= value2);
8682 if(!exp->expType)
8683 {
8684 exp->expType = op1->type;
8685 if(op1->type)
8686 op1->type->refCount++;
8687 }
8688 return 0x1;
8689 }
8690
8691 static unsigned int UIntGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8692 {
8693 unsigned int value2 = op2->ui;
8694
8695 exp->type = 2;
8696 exp->string = PrintUInt(op1->ui >= value2);
8697 if(!exp->expType)
8698 {
8699 exp->expType = op1->type;
8700 if(op1->type)
8701 op1->type->refCount++;
8702 }
8703 return 0x1;
8704 }
8705
8706 static unsigned int ShortGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8707 {
8708 short value2 = op2->s;
8709
8710 exp->type = 2;
8711 exp->string = PrintShort(op1->s >= value2);
8712 if(!exp->expType)
8713 {
8714 exp->expType = op1->type;
8715 if(op1->type)
8716 op1->type->refCount++;
8717 }
8718 return 0x1;
8719 }
8720
8721 static unsigned int UShortGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8722 {
8723 unsigned short value2 = op2->us;
8724
8725 exp->type = 2;
8726 exp->string = PrintUShort(op1->us >= value2);
8727 if(!exp->expType)
8728 {
8729 exp->expType = op1->type;
8730 if(op1->type)
8731 op1->type->refCount++;
8732 }
8733 return 0x1;
8734 }
8735
8736 static unsigned int CharGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8737 {
8738 char value2 = op2->c;
8739
8740 exp->type = 2;
8741 exp->string = PrintChar(op1->c >= value2);
8742 if(!exp->expType)
8743 {
8744 exp->expType = op1->type;
8745 if(op1->type)
8746 op1->type->refCount++;
8747 }
8748 return 0x1;
8749 }
8750
8751 static unsigned int UCharGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8752 {
8753 unsigned char value2 = op2->uc;
8754
8755 exp->type = 2;
8756 exp->string = PrintUChar(op1->uc >= value2);
8757 if(!exp->expType)
8758 {
8759 exp->expType = op1->type;
8760 if(op1->type)
8761 op1->type->refCount++;
8762 }
8763 return 0x1;
8764 }
8765
8766 static unsigned int FloatGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8767 {
8768 float value2 = op2->f;
8769
8770 exp->type = 2;
8771 exp->string = PrintFloat(op1->f >= value2);
8772 if(!exp->expType)
8773 {
8774 exp->expType = op1->type;
8775 if(op1->type)
8776 op1->type->refCount++;
8777 }
8778 return 0x1;
8779 }
8780
8781 static unsigned int DoubleGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8782 {
8783 double value2 = op2->d;
8784
8785 exp->type = 2;
8786 exp->string = PrintDouble(op1->d >= value2);
8787 if(!exp->expType)
8788 {
8789 exp->expType = op1->type;
8790 if(op1->type)
8791 op1->type->refCount++;
8792 }
8793 return 0x1;
8794 }
8795
8796 static unsigned int IntSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8797 {
8798 int value2 = op2->i;
8799
8800 exp->type = 2;
8801 exp->string = PrintInt(op1->i <= value2);
8802 if(!exp->expType)
8803 {
8804 exp->expType = op1->type;
8805 if(op1->type)
8806 op1->type->refCount++;
8807 }
8808 return 0x1;
8809 }
8810
8811 static unsigned int UIntSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8812 {
8813 unsigned int value2 = op2->ui;
8814
8815 exp->type = 2;
8816 exp->string = PrintUInt(op1->ui <= value2);
8817 if(!exp->expType)
8818 {
8819 exp->expType = op1->type;
8820 if(op1->type)
8821 op1->type->refCount++;
8822 }
8823 return 0x1;
8824 }
8825
8826 static unsigned int ShortSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8827 {
8828 short value2 = op2->s;
8829
8830 exp->type = 2;
8831 exp->string = PrintShort(op1->s <= value2);
8832 if(!exp->expType)
8833 {
8834 exp->expType = op1->type;
8835 if(op1->type)
8836 op1->type->refCount++;
8837 }
8838 return 0x1;
8839 }
8840
8841 static unsigned int UShortSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8842 {
8843 unsigned short value2 = op2->us;
8844
8845 exp->type = 2;
8846 exp->string = PrintUShort(op1->us <= value2);
8847 if(!exp->expType)
8848 {
8849 exp->expType = op1->type;
8850 if(op1->type)
8851 op1->type->refCount++;
8852 }
8853 return 0x1;
8854 }
8855
8856 static unsigned int CharSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8857 {
8858 char value2 = op2->c;
8859
8860 exp->type = 2;
8861 exp->string = PrintChar(op1->c <= value2);
8862 if(!exp->expType)
8863 {
8864 exp->expType = op1->type;
8865 if(op1->type)
8866 op1->type->refCount++;
8867 }
8868 return 0x1;
8869 }
8870
8871 static unsigned int UCharSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8872 {
8873 unsigned char value2 = op2->uc;
8874
8875 exp->type = 2;
8876 exp->string = PrintUChar(op1->uc <= value2);
8877 if(!exp->expType)
8878 {
8879 exp->expType = op1->type;
8880 if(op1->type)
8881 op1->type->refCount++;
8882 }
8883 return 0x1;
8884 }
8885
8886 static unsigned int FloatSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8887 {
8888 float value2 = op2->f;
8889
8890 exp->type = 2;
8891 exp->string = PrintFloat(op1->f <= value2);
8892 if(!exp->expType)
8893 {
8894 exp->expType = op1->type;
8895 if(op1->type)
8896 op1->type->refCount++;
8897 }
8898 return 0x1;
8899 }
8900
8901 static unsigned int DoubleSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8902 {
8903 double value2 = op2->d;
8904
8905 exp->type = 2;
8906 exp->string = PrintDouble(op1->d <= value2);
8907 if(!exp->expType)
8908 {
8909 exp->expType = op1->type;
8910 if(op1->type)
8911 op1->type->refCount++;
8912 }
8913 return 0x1;
8914 }
8915
8916 static unsigned int IntCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
8917 {
8918 exp->type = 2;
8919 exp->string = PrintInt(op1->i ? op2->i : op3->i);
8920 if(!exp->expType)
8921 {
8922 exp->expType = op1->type;
8923 if(op1->type)
8924 op1->type->refCount++;
8925 }
8926 return 0x1;
8927 }
8928
8929 static unsigned int UIntCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
8930 {
8931 exp->type = 2;
8932 exp->string = PrintUInt(op1->ui ? op2->ui : op3->ui);
8933 if(!exp->expType)
8934 {
8935 exp->expType = op1->type;
8936 if(op1->type)
8937 op1->type->refCount++;
8938 }
8939 return 0x1;
8940 }
8941
8942 static unsigned int ShortCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
8943 {
8944 exp->type = 2;
8945 exp->string = PrintShort(op1->s ? op2->s : op3->s);
8946 if(!exp->expType)
8947 {
8948 exp->expType = op1->type;
8949 if(op1->type)
8950 op1->type->refCount++;
8951 }
8952 return 0x1;
8953 }
8954
8955 static unsigned int UShortCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
8956 {
8957 exp->type = 2;
8958 exp->string = PrintUShort(op1->us ? op2->us : op3->us);
8959 if(!exp->expType)
8960 {
8961 exp->expType = op1->type;
8962 if(op1->type)
8963 op1->type->refCount++;
8964 }
8965 return 0x1;
8966 }
8967
8968 static unsigned int CharCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
8969 {
8970 exp->type = 2;
8971 exp->string = PrintChar(op1->c ? op2->c : op3->c);
8972 if(!exp->expType)
8973 {
8974 exp->expType = op1->type;
8975 if(op1->type)
8976 op1->type->refCount++;
8977 }
8978 return 0x1;
8979 }
8980
8981 static unsigned int UCharCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
8982 {
8983 exp->type = 2;
8984 exp->string = PrintUChar(op1->uc ? op2->uc : op3->uc);
8985 if(!exp->expType)
8986 {
8987 exp->expType = op1->type;
8988 if(op1->type)
8989 op1->type->refCount++;
8990 }
8991 return 0x1;
8992 }
8993
8994 static unsigned int FloatCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
8995 {
8996 exp->type = 2;
8997 exp->string = PrintFloat(op1->f ? op2->f : op3->f);
8998 if(!exp->expType)
8999 {
9000 exp->expType = op1->type;
9001 if(op1->type)
9002 op1->type->refCount++;
9003 }
9004 return 0x1;
9005 }
9006
9007 static unsigned int DoubleCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
9008 {
9009 exp->type = 2;
9010 exp->string = PrintDouble(op1->d ? op2->d : op3->d);
9011 if(!exp->expType)
9012 {
9013 exp->expType = op1->type;
9014 if(op1->type)
9015 op1->type->refCount++;
9016 }
9017 return 0x1;
9018 }
9019
9020 struct OpTable intOps = 
9021 {
9022 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
9023 };
9024
9025 struct OpTable uintOps = 
9026 {
9027 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
9028 };
9029
9030 struct OpTable shortOps = 
9031 {
9032 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
9033 };
9034
9035 struct OpTable ushortOps = 
9036 {
9037 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
9038 };
9039
9040 struct OpTable floatOps = 
9041 {
9042 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
9043 };
9044
9045 struct OpTable doubleOps = 
9046 {
9047 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
9048 };
9049
9050 struct OpTable charOps = 
9051 {
9052 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
9053 };
9054
9055 struct OpTable ucharOps = 
9056 {
9057 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
9058 };
9059
9060 void ReadString(char * output, char * string)
9061 {
9062 int len = strlen(string);
9063 int c, d = 0;
9064 unsigned int quoted = 0x0, escaped = 0x0;
9065
9066 for(c = 0; c < len; c++)
9067 {
9068 char ch = string[c];
9069
9070 if(escaped)
9071 {
9072 switch(ch)
9073 {
9074 case 'n':
9075 output[d] = '\n';
9076 break;
9077 case 't':
9078 output[d] = '\t';
9079 break;
9080 case 'a':
9081 output[d] = '\a';
9082 break;
9083 case 'b':
9084 output[d] = '\b';
9085 break;
9086 case 'f':
9087 output[d] = '\f';
9088 break;
9089 case 'r':
9090 output[d] = '\r';
9091 break;
9092 case 'v':
9093 output[d] = '\v';
9094 break;
9095 case '\\':
9096 output[d] = '\\';
9097 break;
9098 case '\"':
9099 output[d] = '\"';
9100 break;
9101 default:
9102 output[d++] = '\\';
9103 output[d] = ch;
9104 }
9105 d++;
9106 escaped = 0x0;
9107 }
9108 else
9109 {
9110 if(ch == '\"')
9111 quoted ^= 0x1;
9112 else if(quoted)
9113 {
9114 if(ch == '\\')
9115 escaped = 0x1;
9116 else
9117 output[d++] = ch;
9118 }
9119 }
9120 }
9121 output[d] = '\0';
9122 }
9123
9124 extern double strtod(char * , char * * );
9125
9126 struct Operand GetOperand(struct Expression * exp)
9127 {
9128 struct Operand op = 
9129 {
9130 0, 0, 0, 0, 
9131 {
9132 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
9133 }
9134 };
9135 struct Type * type = exp->expType;
9136
9137 if(type)
9138 {
9139 while(type->kind == 8 && type->_class->registered && (type->_class->registered->type == 2 || type->_class->registered->type == 3 || type->_class->registered->type == 4))
9140 {
9141 if(!type->_class->registered->dataType)
9142 type->_class->registered->dataType = ProcessTypeString(type->_class->registered->dataTypeString, 0x0);
9143 type = type->_class->registered->dataType;
9144 }
9145 op.kind = type->kind;
9146 op.type = exp->expType;
9147 if(exp->isConstant && exp->type == 2)
9148 {
9149 switch(op.kind)
9150 {
9151 case 1:
9152 {
9153 if(exp->constant[0] == '\'')
9154 op.c = exp->constant[1];
9155 else if(type->isSigned)
9156 {
9157 op.c = (char)strtol(exp->constant, (((void *)0)), 0);
9158 op.ops = charOps;
9159 }
9160 else
9161 {
9162 op.uc = (unsigned char)strtoul(exp->constant, (((void *)0)), 0);
9163 op.ops = ucharOps;
9164 }
9165 break;
9166 }
9167 case 2:
9168 if(type->isSigned)
9169 {
9170 op.s = (short)strtol(exp->constant, (((void *)0)), 0);
9171 op.ops = shortOps;
9172 }
9173 else
9174 {
9175 op.us = (unsigned short)strtoul(exp->constant, (((void *)0)), 0);
9176 op.ops = ushortOps;
9177 }
9178 break;
9179 case 3:
9180 case 5:
9181 if(type->isSigned)
9182 {
9183 op.i = strtol(exp->constant, (((void *)0)), 0);
9184 op.ops = intOps;
9185 }
9186 else
9187 {
9188 op.ui = strtoul(exp->constant, (((void *)0)), 0);
9189 op.ops = uintOps;
9190 }
9191 op.kind = 3;
9192 break;
9193 case 4:
9194 if(type->isSigned)
9195 {
9196 op.i64 = _strtoi64(exp->constant, (((void *)0)), 0);
9197 op.ops = intOps;
9198 }
9199 else
9200 {
9201 op.ui64 = _strtoui64(exp->constant, (((void *)0)), 0);
9202 op.ops = uintOps;
9203 }
9204 op.kind = 3;
9205 break;
9206 case 6:
9207 op.f = (float)strtod(exp->constant, (((void *)0)));
9208 op.ops = floatOps;
9209 break;
9210 case 7:
9211 op.d = (double)strtod(exp->constant, (((void *)0)));
9212 op.ops = doubleOps;
9213 break;
9214 case 12:
9215 case 13:
9216 case 8:
9217 op.p = (unsigned char *)strtoul(exp->constant, (((void *)0)), 0);
9218 op.kind = 13;
9219 op.ops = uintOps;
9220 break;
9221 }
9222 }
9223 }
9224 return op;
9225 }
9226
9227 int __ecereVMethodID_class_OnGetString;
9228
9229 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_int;
9230
9231 static void UnusedFunction()
9232 {
9233 int a;
9234
9235 ((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);
9236 }
9237
9238 extern int __ecereVMethodID_class_OnGetString;
9239
9240 static void PopulateInstanceProcessMember(struct Instantiation * inst, struct __ecereNameSpace__ecere__sys__OldList * memberList, struct __ecereNameSpace__ecere__com__DataMember * parentDataMember, unsigned int offset)
9241 {
9242 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
9243
9244 for(dataMember = parentDataMember->members.first; dataMember; dataMember = dataMember->next)
9245 {
9246 if(!dataMember->name && (dataMember->type == 2 || dataMember->type == 1))
9247 PopulateInstanceProcessMember(inst, memberList, dataMember, offset + dataMember->offset);
9248 else
9249 {
9250 struct Expression * exp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
9251 struct MemberInit * member = MkMemberInit(MkListOne(MkIdentifier(dataMember->name)), MkInitializerAssignment(exp));
9252 struct Type * type;
9253 void * ptr = inst->data + dataMember->offset + offset;
9254 char * result = (((void *)0));
9255
9256 exp->loc = member->loc = inst->loc;
9257 ((struct Identifier *)(*member->identifiers).first)->loc = inst->loc;
9258 if(!dataMember->dataType)
9259 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
9260 type = dataMember->dataType;
9261 if(type->kind == 8)
9262 {
9263 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
9264
9265 if(_class->type == 4)
9266 {
9267 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
9268
9269 if(enumClass)
9270 {
9271 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
9272 struct __ecereNameSpace__ecere__sys__NamedLink * item;
9273
9274 for(item = e->values.first; item; item = item->next)
9275 {
9276 if((int)item->data == *(int *)ptr)
9277 {
9278 result = item->name;
9279 break;
9280 }
9281 }
9282 if(result)
9283 {
9284 exp->identifier = MkIdentifier(result);
9285 exp->type = 0;
9286 exp->destType = MkClassType(_class->fullName);
9287 ProcessExpressionType(exp);
9288 }
9289 }
9290 }
9291 if(_class->type == 4 || _class->type == 3 || _class->type == 2)
9292 {
9293 if(!_class->dataType)
9294 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
9295 type = _class->dataType;
9296 }
9297 }
9298 if(!result)
9299 {
9300 switch(type->kind)
9301 {
9302 case 6:
9303 {
9304 FreeExpContents(exp);
9305 exp->constant = PrintFloat(*(float *)ptr);
9306 exp->type = 2;
9307 break;
9308 }
9309 case 7:
9310 {
9311 FreeExpContents(exp);
9312 exp->constant = PrintDouble(*(double *)ptr);
9313 exp->type = 2;
9314 break;
9315 }
9316 case 3:
9317 {
9318 FreeExpContents(exp);
9319 exp->constant = PrintInt(*(int *)ptr);
9320 exp->type = 2;
9321 break;
9322 }
9323 case 4:
9324 {
9325 FreeExpContents(exp);
9326 exp->constant = PrintInt64(*(long long *)ptr);
9327 exp->type = 2;
9328 break;
9329 }
9330 default:
9331 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Unhandled type populating instance\n", (((void *)0))));
9332 }
9333 }
9334 ListAdd(memberList, member);
9335 }
9336 if(parentDataMember->type == 1)
9337 break;
9338 }
9339 }
9340
9341 extern struct MembersInit * MkMembersInitList(struct __ecereNameSpace__ecere__sys__OldList * dataMembers);
9342
9343 void PopulateInstance(struct Instantiation * inst)
9344 {
9345 struct Symbol * classSym = inst->_class->symbol;
9346 struct __ecereNameSpace__ecere__com__Class * _class = classSym->registered;
9347 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
9348 struct __ecereNameSpace__ecere__sys__OldList * memberList = MkList();
9349
9350 inst->members = MkListOne(MkMembersInitList(memberList));
9351 for(dataMember = _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
9352 {
9353 if(!dataMember->isProperty)
9354 {
9355 if(!dataMember->name && (dataMember->type == 2 || dataMember->type == 1))
9356 PopulateInstanceProcessMember(inst, memberList, dataMember, dataMember->offset);
9357 else
9358 {
9359 struct Expression * exp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
9360 struct MemberInit * member = MkMemberInit(MkListOne(MkIdentifier(dataMember->name)), MkInitializerAssignment(exp));
9361 struct Type * type;
9362 void * ptr = inst->data + dataMember->offset;
9363 char * result = (((void *)0));
9364
9365 exp->loc = member->loc = inst->loc;
9366 ((struct Identifier *)(*member->identifiers).first)->loc = inst->loc;
9367 if(!dataMember->dataType)
9368 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
9369 type = dataMember->dataType;
9370 if(type->kind == 8)
9371 {
9372 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
9373
9374 if(_class->type == 4)
9375 {
9376 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
9377
9378 if(enumClass)
9379 {
9380 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
9381 struct __ecereNameSpace__ecere__sys__NamedLink * item;
9382
9383 for(item = e->values.first; item; item = item->next)
9384 {
9385 if((int)item->data == *(int *)ptr)
9386 {
9387 result = item->name;
9388 break;
9389 }
9390 }
9391 }
9392 if(result)
9393 {
9394 exp->identifier = MkIdentifier(result);
9395 exp->type = 0;
9396 exp->destType = MkClassType(_class->fullName);
9397 ProcessExpressionType(exp);
9398 }
9399 }
9400 if(_class->type == 4 || _class->type == 3 || _class->type == 2)
9401 {
9402 if(!_class->dataType)
9403 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
9404 type = _class->dataType;
9405 }
9406 }
9407 if(!result)
9408 {
9409 switch(type->kind)
9410 {
9411 case 6:
9412 {
9413 exp->constant = PrintFloat(*(float *)ptr);
9414 exp->type = 2;
9415 break;
9416 }
9417 case 7:
9418 {
9419 exp->constant = PrintDouble(*(double *)ptr);
9420 exp->type = 2;
9421 break;
9422 }
9423 case 3:
9424 {
9425 exp->constant = PrintInt(*(int *)ptr);
9426 exp->type = 2;
9427 break;
9428 }
9429 case 4:
9430 {
9431 exp->constant = PrintInt64(*(long long *)ptr);
9432 exp->type = 2;
9433 break;
9434 }
9435 default:
9436 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Unhandled type populating instance\n", (((void *)0))));
9437 }
9438 }
9439 ListAdd(memberList, member);
9440 }
9441 }
9442 }
9443 }
9444
9445 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);
9446
9447 extern void FreeInstance(struct Instantiation * inst);
9448
9449 void ComputeInstantiation(struct Expression * exp)
9450 {
9451 struct Instantiation * inst = exp->instance;
9452 struct MembersInit * members;
9453 struct Symbol * classSym = inst->_class ? inst->_class->symbol : (((void *)0));
9454 struct __ecereNameSpace__ecere__com__Class * _class = classSym ? classSym->registered : (((void *)0));
9455 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
9456 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
9457 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
9458 int subMemberStackPos = 0;
9459 uint64 bits = 0;
9460
9461 if(_class && (_class->type == 1 || _class->type == 0 || _class->type == 5))
9462 {
9463 if(inst->data)
9464 return ;
9465 if(_class->type == 0 || _class->type == 5)
9466 inst->data = (unsigned char *)__ecereNameSpace__ecere__com__eInstance_New(_class);
9467 else
9468 inst->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
9469 }
9470 if(inst->members)
9471 {
9472 for(members = (*inst->members).first; members; members = members->next)
9473 {
9474 switch(members->type)
9475 {
9476 case 0:
9477 {
9478 if(members->dataMembers)
9479 {
9480 struct MemberInit * member;
9481
9482 for(member = (*members->dataMembers).first; member; member = member->next)
9483 {
9484 struct Identifier * ident = member->identifiers ? (*member->identifiers).first : (((void *)0));
9485 unsigned int found = 0x0;
9486 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
9487 struct __ecereNameSpace__ecere__com__DataMember * dataMember = (((void *)0));
9488 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
9489 unsigned int dataMemberOffset;
9490
9491 if(!ident)
9492 {
9493 __ecereNameSpace__ecere__com__eClass_FindNextMember(_class, &curClass, &curMember, subMemberStack, &subMemberStackPos);
9494 if(curMember)
9495 {
9496 if(curMember->isProperty)
9497 prop = (struct __ecereNameSpace__ecere__com__Property *)curMember;
9498 else
9499 {
9500 dataMember = curMember;
9501 __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(_class, dataMember->name, &dataMemberOffset, privateModule, (((void *)0)), (((void *)0)));
9502 }
9503 found = 0x1;
9504 }
9505 }
9506 else
9507 {
9508 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, ident->string, privateModule);
9509 if(prop)
9510 {
9511 found = 0x1;
9512 if(prop->memberAccess == 1)
9513 {
9514 curMember = (struct __ecereNameSpace__ecere__com__DataMember *)prop;
9515 curClass = prop->_class;
9516 }
9517 }
9518 else
9519 {
9520 struct __ecereNameSpace__ecere__com__DataMember * _subMemberStack[256];
9521 int _subMemberStackPos = 0;
9522
9523 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(_class, ident->string, &dataMemberOffset, privateModule, _subMemberStack, &_subMemberStackPos);
9524 if(dataMember)
9525 {
9526 found = 0x1;
9527 if(dataMember->memberAccess == 1)
9528 {
9529 curMember = dataMember;
9530 curClass = dataMember->_class;
9531 memcpy(subMemberStack, _subMemberStack, sizeof(int) * _subMemberStackPos);
9532 subMemberStackPos = _subMemberStackPos;
9533 }
9534 }
9535 }
9536 }
9537 if(found && member->initializer && member->initializer->type == 0)
9538 {
9539 struct Expression * value = member->initializer->exp;
9540 struct Type * type = (((void *)0));
9541
9542 if(prop)
9543 {
9544 type = prop->dataType;
9545 }
9546 else if(dataMember)
9547 {
9548 if(!dataMember->dataType)
9549 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
9550 type = dataMember->dataType;
9551 }
9552 if(ident && ident->next)
9553 {
9554 for(ident = ident->next; ident && type; ident = ident->next)
9555 {
9556 if(type->kind == 8)
9557 {
9558 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(type->_class->registered, ident->string, privateModule);
9559 if(prop)
9560 type = prop->dataType;
9561 else
9562 {
9563 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(type->_class->registered, ident->string, &dataMemberOffset, privateModule, (((void *)0)), (((void *)0)));
9564 if(dataMember)
9565 type = dataMember->dataType;
9566 }
9567 }
9568 else if(type->kind == 9 || type->kind == 10)
9569 {
9570 struct Type * memberType;
9571
9572 for(memberType = type->members.first; memberType; memberType = memberType->next)
9573 {
9574 if(!strcmp(memberType->name, ident->string))
9575 {
9576 type = memberType;
9577 break;
9578 }
9579 }
9580 }
9581 }
9582 }
9583 if(value)
9584 {
9585 FreeType(value->destType);
9586 value->destType = type;
9587 if(type)
9588 type->refCount++;
9589 ComputeExpression(value);
9590 }
9591 if(value && (_class->type == 1 || _class->type == 0 || _class->type == 5))
9592 {
9593 if(type->kind == 8)
9594 {
9595 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
9596
9597 if(_class->type == 2 || _class->type == 3 || _class->type == 4)
9598 {
9599 if(!_class->dataType)
9600 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
9601 type = _class->dataType;
9602 }
9603 }
9604 if(dataMember)
9605 {
9606 void * ptr = inst->data + dataMemberOffset;
9607
9608 if(value->type == 2)
9609 {
9610 switch(type->kind)
9611 {
9612 case 3:
9613 {
9614 GetInt(value, (int *)ptr);
9615 break;
9616 }
9617 case 4:
9618 {
9619 GetInt64(value, (long long *)ptr);
9620 break;
9621 }
9622 case 6:
9623 {
9624 GetFloat(value, (float *)ptr);
9625 break;
9626 }
9627 case 7:
9628 {
9629 GetDouble(value, (double *)ptr);
9630 break;
9631 }
9632 }
9633 }
9634 else if(value->type == 1)
9635 {
9636 if(type->kind == 8)
9637 {
9638 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
9639
9640 if(_class->type == 1)
9641 {
9642 ComputeTypeSize(type);
9643 if(value->instance->data)
9644 memcpy(ptr, value->instance->data, type->size);
9645 }
9646 }
9647 }
9648 }
9649 else if(prop)
9650 {
9651 if(value->type == 1 && value->instance->data)
9652 {
9653 void (* Set)(void *, void *) = (void *)prop->Set;
9654
9655 Set(inst->data, value->instance->data);
9656 PopulateInstance(inst);
9657 }
9658 else if(value->type == 2)
9659 {
9660 switch(type->kind)
9661 {
9662 case 7:
9663 {
9664 void (* Set)(void *, double) = (void *)prop->Set;
9665
9666 Set(inst->data, strtod(value->constant, (((void *)0))));
9667 break;
9668 }
9669 case 6:
9670 {
9671 void (* Set)(void *, float) = (void *)prop->Set;
9672
9673 Set(inst->data, (float)(strtod(value->constant, (((void *)0)))));
9674 break;
9675 }
9676 case 3:
9677 {
9678 void (* Set)(void *, int) = (void *)prop->Set;
9679
9680 Set(inst->data, strtol(value->constant, (((void *)0)), 0));
9681 break;
9682 }
9683 case 4:
9684 {
9685 void (* Set)(void *, long long) = (void *)prop->Set;
9686
9687 Set(inst->data, _strtoi64(value->constant, (((void *)0)), 0));
9688 break;
9689 }
9690 }
9691 }
9692 else if(value->type == 3)
9693 {
9694 char temp[1024];
9695
9696 ReadString(temp, value->string);
9697 prop->Set(inst->data, temp);
9698 }
9699 }
9700 }
9701 else if(_class->type == 3)
9702 {
9703 if(prop)
9704 {
9705 if(value->type == 2)
9706 {
9707 if(type->kind == 8)
9708 {
9709 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
9710
9711 if(_class->type == 3)
9712 {
9713 if(!_class->dataType)
9714 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
9715 type = _class->dataType;
9716 }
9717 }
9718 switch(type->kind)
9719 {
9720 case 6:
9721 {
9722 float fValue;
9723 float (* Set)(float) = (void *)prop->Set;
9724
9725 GetFloat(member->initializer->exp, &fValue);
9726 exp->constant = PrintFloat(Set(fValue));
9727 exp->type = 2;
9728 break;
9729 }
9730 case 7:
9731 {
9732 double dValue;
9733 double (* Set)(double) = (void *)prop->Set;
9734
9735 GetDouble(member->initializer->exp, &dValue);
9736 exp->constant = PrintDouble(Set(dValue));
9737 exp->type = 2;
9738 break;
9739 }
9740 }
9741 }
9742 }
9743 }
9744 else if(_class->type == 2)
9745 {
9746 if(prop)
9747 {
9748 if(value->type == 1 && value->instance->data)
9749 {
9750 unsigned int (* Set)(void *) = (void *)prop->Set;
9751
9752 bits = Set(value->instance->data);
9753 }
9754 else if(value->type == 2)
9755 {
9756 }
9757 }
9758 else if(dataMember)
9759 {
9760 struct __ecereNameSpace__ecere__com__BitMember * bitMember = (struct __ecereNameSpace__ecere__com__BitMember *)dataMember;
9761 struct Type * type;
9762 int part = 0;
9763
9764 GetInt(value, &part);
9765 bits = (bits & ~bitMember->mask);
9766 if(!bitMember->dataType)
9767 bitMember->dataType = ProcessTypeString(bitMember->dataTypeString, 0x0);
9768 type = bitMember->dataType;
9769 if(type->kind == 8 && type->_class && type->_class->registered)
9770 {
9771 if(!type->_class->registered->dataType)
9772 type->_class->registered->dataType = ProcessTypeString(type->_class->registered->dataTypeString, 0x0);
9773 type = type->_class->registered->dataType;
9774 }
9775 switch(type->kind)
9776 {
9777 case 1:
9778 if(type->isSigned)
9779 bits |= ((char)part << bitMember->pos);
9780 else
9781 bits |= ((unsigned char)part << bitMember->pos);
9782 break;
9783 case 2:
9784 if(type->isSigned)
9785 bits |= ((short)part << bitMember->pos);
9786 else
9787 bits |= ((unsigned short)part << bitMember->pos);
9788 break;
9789 case 3:
9790 case 5:
9791 if(type->isSigned)
9792 bits |= (part << bitMember->pos);
9793 else
9794 bits |= ((unsigned int)part << bitMember->pos);
9795 break;
9796 case 4:
9797 if(type->isSigned)
9798 bits |= ((long long)part << bitMember->pos);
9799 else
9800 bits |= ((uint64)part << bitMember->pos);
9801 break;
9802 }
9803 }
9804 }
9805 }
9806 else
9807 {
9808 if(_class && _class->type == 3)
9809 {
9810 ComputeExpression(member->initializer->exp);
9811 exp->constant = member->initializer->exp->constant;
9812 exp->type = 2;
9813 member->initializer->exp->constant = (((void *)0));
9814 }
9815 }
9816 }
9817 }
9818 break;
9819 }
9820 }
9821 }
9822 }
9823 if(_class && _class->type == 2)
9824 {
9825 exp->constant = PrintHexUInt(bits);
9826 exp->type = 2;
9827 }
9828 if(exp->type != 1)
9829 {
9830 FreeInstance(inst);
9831 }
9832 }
9833
9834 void CallOperator(struct Expression * exp, struct Expression * exp1, struct Expression * exp2, struct Operand * op1, struct Operand * op2)
9835 {
9836 if(exp->op.op == SIZEOF)
9837 {
9838 FreeExpContents(exp);
9839 exp->type = 2;
9840 exp->constant = PrintUInt(ComputeTypeSize(op1->type));
9841 }
9842 else
9843 {
9844 if(!exp->op.exp1)
9845 {
9846 switch(exp->op.op)
9847 {
9848 case '+':
9849 {
9850 struct Expression * exp2 = exp->op.exp2;
9851
9852 exp->op.exp2 = (((void *)0));
9853 FreeExpContents(exp);
9854 FreeType(exp->expType);
9855 FreeType(exp->destType);
9856 *exp = *exp2;
9857 ((exp2 ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(exp2) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(exp2)) : 0), exp2 = 0);
9858 break;
9859 }
9860 case '-':
9861 if(op1->ops.Neg)
9862 {
9863 FreeExpContents(exp);
9864 op1->ops.Neg(exp, op1);
9865 }
9866 break;
9867 case '~':
9868 if(op1->ops.BitNot)
9869 {
9870 FreeExpContents(exp);
9871 op1->ops.BitNot(exp, op1);
9872 }
9873 break;
9874 case '!':
9875 if(op1->ops.Not)
9876 {
9877 FreeExpContents(exp);
9878 op1->ops.Not(exp, op1);
9879 }
9880 break;
9881 }
9882 }
9883 else
9884 {
9885 switch(exp->op.op)
9886 {
9887 case '+':
9888 if(op1->ops.Add)
9889 {
9890 FreeExpContents(exp);
9891 op1->ops.Add(exp, op1, op2);
9892 }
9893 break;
9894 case '-':
9895 if(op1->ops.Sub)
9896 {
9897 FreeExpContents(exp);
9898 op1->ops.Sub(exp, op1, op2);
9899 }
9900 break;
9901 case '*':
9902 if(op1->ops.Mul)
9903 {
9904 FreeExpContents(exp);
9905 op1->ops.Mul(exp, op1, op2);
9906 }
9907 break;
9908 case '/':
9909 if(op1->ops.Div)
9910 {
9911 FreeExpContents(exp);
9912 op1->ops.Div(exp, op1, op2);
9913 }
9914 break;
9915 case '%':
9916 if(op1->ops.Mod)
9917 {
9918 FreeExpContents(exp);
9919 op1->ops.Mod(exp, op1, op2);
9920 }
9921 break;
9922 case '&':
9923 if(exp->op.exp2)
9924 {
9925 if(op1->ops.BitAnd)
9926 {
9927 FreeExpContents(exp);
9928 op1->ops.BitAnd(exp, op1, op2);
9929 }
9930 }
9931 break;
9932 case '|':
9933 if(op1->ops.BitOr)
9934 {
9935 FreeExpContents(exp);
9936 op1->ops.BitOr(exp, op1, op2);
9937 }
9938 break;
9939 case '^':
9940 if(op1->ops.BitXor)
9941 {
9942 FreeExpContents(exp);
9943 op1->ops.BitXor(exp, op1, op2);
9944 }
9945 break;
9946 case LEFT_OP:
9947 if(op1->ops.LShift)
9948 {
9949 FreeExpContents(exp);
9950 op1->ops.LShift(exp, op1, op2);
9951 }
9952 break;
9953 case RIGHT_OP:
9954 if(op1->ops.RShift)
9955 {
9956 FreeExpContents(exp);
9957 op1->ops.RShift(exp, op1, op2);
9958 }
9959 break;
9960 case EQ_OP:
9961 if(op1->ops.Equ)
9962 {
9963 FreeExpContents(exp);
9964 op1->ops.Equ(exp, op1, op2);
9965 }
9966 break;
9967 case NE_OP:
9968 if(op1->ops.Nqu)
9969 {
9970 FreeExpContents(exp);
9971 op1->ops.Nqu(exp, op1, op2);
9972 }
9973 break;
9974 case AND_OP:
9975 if(op1->ops.And)
9976 {
9977 FreeExpContents(exp);
9978 op1->ops.And(exp, op1, op2);
9979 }
9980 break;
9981 case OR_OP:
9982 if(op1->ops.Or)
9983 {
9984 FreeExpContents(exp);
9985 op1->ops.Or(exp, op1, op2);
9986 }
9987 break;
9988 case '>':
9989 if(op1->ops.Grt)
9990 {
9991 FreeExpContents(exp);
9992 op1->ops.Grt(exp, op1, op2);
9993 }
9994 break;
9995 case '<':
9996 if(op1->ops.Sma)
9997 {
9998 FreeExpContents(exp);
9999 op1->ops.Sma(exp, op1, op2);
10000 }
10001 break;
10002 case GE_OP:
10003 if(op1->ops.GrtEqu)
10004 {
10005 FreeExpContents(exp);
10006 op1->ops.GrtEqu(exp, op1, op2);
10007 }
10008 break;
10009 case LE_OP:
10010 if(op1->ops.SmaEqu)
10011 {
10012 FreeExpContents(exp);
10013 op1->ops.SmaEqu(exp, op1, op2);
10014 }
10015 break;
10016 }
10017 }
10018 }
10019 }
10020
10021 extern struct Expression * MkExpIdentifier(struct Identifier * id);
10022
10023 void ComputeExpression(struct Expression * exp)
10024 {
10025 char expString[10240];
10026
10027 expString[0] = '\0';
10028 switch(exp->type)
10029 {
10030 case 1:
10031 {
10032 ComputeInstantiation(exp);
10033 break;
10034 }
10035 case 4:
10036 {
10037 struct Expression * exp1, * exp2 = (((void *)0));
10038 struct Operand op1 = 
10039 {
10040 0, 0, 0, 0, 
10041 {
10042 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
10043 }
10044 };
10045 struct Operand op2 = 
10046 {
10047 0, 0, 0, 0, 
10048 {
10049 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
10050 }
10051 };
10052
10053 if(exp->op.exp2)
10054 ComputeExpression(exp->op.exp2);
10055 if(exp->op.exp1)
10056 {
10057 ComputeExpression(exp->op.exp1);
10058 exp1 = exp->op.exp1;
10059 exp2 = exp->op.exp2;
10060 op1 = GetOperand(exp1);
10061 if(op1.type)
10062 op1.type->refCount++;
10063 if(exp2)
10064 {
10065 op2 = GetOperand(exp2);
10066 if(op2.type)
10067 op2.type->refCount++;
10068 }
10069 }
10070 else
10071 {
10072 exp1 = exp->op.exp2;
10073 op1 = GetOperand(exp1);
10074 if(op1.type)
10075 op1.type->refCount++;
10076 }
10077 CallOperator(exp, exp1, exp2, &op1, &op2);
10078 if(op1.type)
10079 FreeType(op1.type);
10080 if(op2.type)
10081 FreeType(op2.type);
10082 break;
10083 }
10084 case 5:
10085 case 34:
10086 {
10087 struct Expression * e, * n;
10088
10089 for(e = (*exp->list).first; e; e = n)
10090 {
10091 n = e->next;
10092 if(!n)
10093 {
10094 struct __ecereNameSpace__ecere__sys__OldList * list = exp->list;
10095
10096 ComputeExpression(e);
10097 FreeType(exp->expType);
10098 FreeType(exp->destType);
10099 *exp = *e;
10100 ((e ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(e) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(e)) : 0), e = 0);
10101 (__ecereNameSpace__ecere__com__eSystem_Delete(list), list = 0);
10102 }
10103 else
10104 {
10105 FreeExpression(e);
10106 }
10107 }
10108 break;
10109 }
10110 case 8:
10111 {
10112 struct Expression * memberExp = exp->member.exp;
10113 struct Identifier * memberID = exp->member.member;
10114 struct Type * type;
10115
10116 ComputeExpression(exp->member.exp);
10117 type = exp->member.exp->expType;
10118 if(type)
10119 {
10120 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)));
10121 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
10122 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
10123 struct __ecereNameSpace__ecere__com__Class * convertTo = (((void *)0));
10124
10125 if(type->kind == 19 && exp->member.exp->type == 26)
10126 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "ecere::com::Class");
10127 if(!_class)
10128 {
10129 char string[256];
10130 struct Symbol * classSym;
10131
10132 string[0] = '\0';
10133 PrintType(type, string, 0x0, 0x1);
10134 classSym = FindClass(string);
10135 _class = classSym ? classSym->registered : (((void *)0));
10136 }
10137 if(exp->member.member)
10138 {
10139 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, exp->member.member->string, privateModule);
10140 if(!prop)
10141 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, exp->member.member->string, privateModule, (((void *)0)), (((void *)0)));
10142 }
10143 if(!prop && !member && _class && exp->member.member)
10144 {
10145 struct Symbol * classSym = FindClass(exp->member.member->string);
10146
10147 convertTo = _class;
10148 _class = classSym ? classSym->registered : (((void *)0));
10149 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, convertTo->fullName, privateModule);
10150 }
10151 if(prop)
10152 {
10153 if(prop->compiled)
10154 {
10155 struct Type * type = prop->dataType;
10156
10157 if(_class->type == 3)
10158 {
10159 if(type->kind == 8)
10160 {
10161 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
10162
10163 if(_class->type == 3)
10164 {
10165 if(!_class->dataType)
10166 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
10167 type = _class->dataType;
10168 }
10169 }
10170 switch(type->kind)
10171 {
10172 case 6:
10173 {
10174 float value;
10175 float (* Get)(float) = (void *)prop->Get;
10176
10177 GetFloat(exp->member.exp, &value);
10178 exp->constant = PrintFloat(Get ? Get(value) : value);
10179 exp->type = 2;
10180 break;
10181 }
10182 case 7:
10183 {
10184 double value;
10185 double (* Get)(double);
10186
10187 GetDouble(exp->member.exp, &value);
10188 if(convertTo)
10189 Get = (void *)prop->Set;
10190 else
10191 Get = (void *)prop->Get;
10192 exp->constant = PrintDouble(Get ? Get(value) : value);
10193 exp->type = 2;
10194 break;
10195 }
10196 }
10197 }
10198 else
10199 {
10200 if(convertTo)
10201 {
10202 struct Expression * value = exp->member.exp;
10203 struct Type * type;
10204
10205 if(!prop->dataType)
10206 ProcessPropertyType(prop);
10207 type = prop->dataType;
10208 if(!type)
10209 {
10210 }
10211 else if(_class->type == 1)
10212 {
10213 switch(type->kind)
10214 {
10215 case 8:
10216 {
10217 struct __ecereNameSpace__ecere__com__Class * propertyClass = type->_class->registered;
10218
10219 if(propertyClass->type == 1 && value->type == 1)
10220 {
10221 void (* Set)(void *, void *) = (void *)prop->Set;
10222
10223 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10224 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10225 exp->instance->_class = MkSpecifierName(_class->fullName);
10226 exp->instance->loc = exp->loc;
10227 exp->type = 1;
10228 Set(exp->instance->data, value->instance->data);
10229 PopulateInstance(exp->instance);
10230 }
10231 break;
10232 }
10233 case 3:
10234 {
10235 int intValue;
10236 void (* Set)(void *, int) = (void *)prop->Set;
10237
10238 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10239 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10240 exp->instance->_class = MkSpecifierName(_class->fullName);
10241 exp->instance->loc = exp->loc;
10242 exp->type = 1;
10243 GetInt(value, &intValue);
10244 Set(exp->instance->data, intValue);
10245 PopulateInstance(exp->instance);
10246 break;
10247 }
10248 case 4:
10249 {
10250 long long intValue;
10251 void (* Set)(void *, long long) = (void *)prop->Set;
10252
10253 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10254 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10255 exp->instance->_class = MkSpecifierName(_class->fullName);
10256 exp->instance->loc = exp->loc;
10257 exp->type = 1;
10258 GetInt64(value, &intValue);
10259 Set(exp->instance->data, intValue);
10260 PopulateInstance(exp->instance);
10261 break;
10262 }
10263 case 7:
10264 {
10265 double doubleValue;
10266 void (* Set)(void *, double) = (void *)prop->Set;
10267
10268 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10269 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10270 exp->instance->_class = MkSpecifierName(_class->fullName);
10271 exp->instance->loc = exp->loc;
10272 exp->type = 1;
10273 GetDouble(value, &doubleValue);
10274 Set(exp->instance->data, doubleValue);
10275 PopulateInstance(exp->instance);
10276 break;
10277 }
10278 }
10279 }
10280 else if(_class->type == 2)
10281 {
10282 switch(type->kind)
10283 {
10284 case 8:
10285 {
10286 struct __ecereNameSpace__ecere__com__Class * propertyClass = type->_class->registered;
10287
10288 if(propertyClass->type == 1 && value->instance->data)
10289 {
10290 unsigned int (* Set)(void *) = (void *)prop->Set;
10291 unsigned int bits = Set(value->instance->data);
10292
10293 exp->constant = PrintHexUInt(bits);
10294 exp->type = 2;
10295 break;
10296 }
10297 else if(_class->type == 2)
10298 {
10299 unsigned int value;
10300 unsigned int (* Set)(unsigned int) = (void *)prop->Set;
10301 unsigned int bits;
10302
10303 GetUInt(exp->member.exp, &value);
10304 bits = Set(value);
10305 exp->constant = PrintHexUInt(bits);
10306 exp->type = 2;
10307 }
10308 }
10309 }
10310 }
10311 }
10312 else
10313 {
10314 if(_class->type == 2)
10315 {
10316 unsigned int value;
10317
10318 GetUInt(exp->member.exp, &value);
10319 switch(type->kind)
10320 {
10321 case 8:
10322 {
10323 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
10324
10325 if(_class->type == 1)
10326 {
10327 void (* Get)(unsigned int, void *) = (void *)prop->Get;
10328
10329 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10330 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10331 exp->instance->_class = MkSpecifierName(_class->fullName);
10332 exp->instance->loc = exp->loc;
10333 exp->type = 1;
10334 Get(value, exp->instance->data);
10335 PopulateInstance(exp->instance);
10336 }
10337 else if(_class->type == 2)
10338 {
10339 unsigned int (* Get)(unsigned int) = (void *)prop->Get;
10340 uint64 bits = Get(value);
10341
10342 exp->constant = PrintHexUInt64(bits);
10343 exp->type = 2;
10344 }
10345 break;
10346 }
10347 }
10348 }
10349 else if(_class->type == 1)
10350 {
10351 char * value = (exp->member.exp->type == 1) ? exp->member.exp->instance->data : (((void *)0));
10352
10353 switch(type->kind)
10354 {
10355 case 8:
10356 {
10357 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
10358
10359 if(_class->type == 1 && value)
10360 {
10361 void (* Get)(void *, void *) = (void *)prop->Get;
10362
10363 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10364 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10365 exp->instance->_class = MkSpecifierName(_class->fullName);
10366 exp->instance->loc = exp->loc;
10367 exp->type = 1;
10368 Get(value, exp->instance->data);
10369 PopulateInstance(exp->instance);
10370 }
10371 break;
10372 }
10373 }
10374 }
10375 }
10376 }
10377 }
10378 else
10379 {
10380 exp->isConstant = 0x0;
10381 }
10382 }
10383 else if(member)
10384 {
10385 }
10386 }
10387 if(exp->type != 8)
10388 {
10389 FreeExpression(memberExp);
10390 FreeIdentifier(memberID);
10391 }
10392 break;
10393 }
10394 case 10:
10395 {
10396 struct Type * type = ProcessType(exp->typeName->qualifiers, exp->typeName->declarator);
10397
10398 FreeExpContents(exp);
10399 exp->constant = PrintUInt(ComputeTypeSize(type));
10400 exp->type = 2;
10401 FreeType(type);
10402 break;
10403 }
10404 case 15:
10405 {
10406 struct Symbol * classSym = exp->_class->symbol;
10407
10408 if(classSym && classSym->registered)
10409 {
10410 if(classSym->registered->fixed)
10411 {
10412 FreeSpecifier(exp->_class);
10413 exp->constant = PrintUInt(classSym->registered->templateClass ? classSym->registered->templateClass->structSize : classSym->registered->structSize);
10414 exp->type = 2;
10415 }
10416 else
10417 {
10418 char className[1024];
10419
10420 strcpy(className, "__ecereClass_");
10421 FullClassNameCat(className, classSym->string, 0x1);
10422 MangleClassName(className);
10423 FreeExpContents(exp);
10424 exp->type = 9;
10425 exp->member.exp = MkExpIdentifier(MkIdentifier(className));
10426 exp->member.member = MkIdentifier("structSize");
10427 }
10428 }
10429 break;
10430 }
10431 case 11:
10432 {
10433 struct Type * type;
10434 struct Expression * e = exp;
10435
10436 if(exp->type == 11)
10437 {
10438 if(exp->cast.exp)
10439 ComputeExpression(exp->cast.exp);
10440 e = exp->cast.exp;
10441 }
10442 if(e && exp->expType)
10443 {
10444 type = exp->expType;
10445 if(type->kind == 8)
10446 {
10447 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
10448
10449 if(_class && (_class->type == 3 || _class->type == 2))
10450 {
10451 if(!_class->dataType)
10452 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
10453 type = _class->dataType;
10454 }
10455 }
10456 switch(type->kind)
10457 {
10458 case 1:
10459 if(type->isSigned)
10460 {
10461 char value;
10462
10463 GetChar(e, &value);
10464 FreeExpContents(exp);
10465 exp->constant = PrintChar(value);
10466 exp->type = 2;
10467 }
10468 else
10469 {
10470 unsigned char value;
10471
10472 GetUChar(e, &value);
10473 FreeExpContents(exp);
10474 exp->constant = PrintUChar(value);
10475 exp->type = 2;
10476 }
10477 break;
10478 case 2:
10479 if(type->isSigned)
10480 {
10481 short value;
10482
10483 GetShort(e, &value);
10484 FreeExpContents(exp);
10485 exp->constant = PrintShort(value);
10486 exp->type = 2;
10487 }
10488 else
10489 {
10490 unsigned short value;
10491
10492 GetUShort(e, &value);
10493 FreeExpContents(exp);
10494 exp->constant = PrintUShort(value);
10495 exp->type = 2;
10496 }
10497 break;
10498 case 3:
10499 if(type->isSigned)
10500 {
10501 int value;
10502
10503 GetInt(e, &value);
10504 FreeExpContents(exp);
10505 exp->constant = PrintInt(value);
10506 exp->type = 2;
10507 }
10508 else
10509 {
10510 unsigned int value;
10511
10512 GetUInt(e, &value);
10513 FreeExpContents(exp);
10514 exp->constant = PrintUInt(value);
10515 exp->type = 2;
10516 }
10517 break;
10518 case 4:
10519 if(type->isSigned)
10520 {
10521 long long value;
10522
10523 GetInt64(e, &value);
10524 FreeExpContents(exp);
10525 exp->constant = PrintInt64(value);
10526 exp->type = 2;
10527 }
10528 else
10529 {
10530 uint64 value;
10531
10532 GetUInt64(e, &value);
10533 FreeExpContents(exp);
10534 exp->constant = PrintUInt64(value);
10535 exp->type = 2;
10536 }
10537 break;
10538 case 6:
10539 {
10540 float value;
10541
10542 GetFloat(e, &value);
10543 FreeExpContents(exp);
10544 exp->constant = PrintFloat(value);
10545 exp->type = 2;
10546 break;
10547 }
10548 case 7:
10549 {
10550 double value;
10551
10552 GetDouble(e, &value);
10553 FreeExpContents(exp);
10554 exp->constant = PrintDouble(value);
10555 exp->type = 2;
10556 break;
10557 }
10558 }
10559 }
10560 break;
10561 }
10562 case 12:
10563 {
10564 struct Operand op1 = 
10565 {
10566 0, 0, 0, 0, 
10567 {
10568 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
10569 }
10570 };
10571 struct Operand op2 = 
10572 {
10573 0, 0, 0, 0, 
10574 {
10575 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
10576 }
10577 };
10578 struct Operand op3 = 
10579 {
10580 0, 0, 0, 0, 
10581 {
10582 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
10583 }
10584 };
10585
10586 if(exp->cond.exp)
10587 ComputeExpression((*exp->cond.exp).last);
10588 if(exp->cond.elseExp)
10589 ComputeExpression(exp->cond.elseExp);
10590 if(exp->cond.cond)
10591 ComputeExpression(exp->cond.cond);
10592 op1 = GetOperand(exp->cond.cond);
10593 if(op1.type)
10594 op1.type->refCount++;
10595 op2 = GetOperand((*exp->cond.exp).last);
10596 if(op2.type)
10597 op2.type->refCount++;
10598 op3 = GetOperand(exp->cond.elseExp);
10599 if(op3.type)
10600 op3.type->refCount++;
10601 if(op1.ops.Cond)
10602 {
10603 FreeExpContents(exp);
10604 op1.ops.Cond(exp, &op1, &op2, &op3);
10605 }
10606 if(op1.type)
10607 FreeType(op1.type);
10608 if(op2.type)
10609 FreeType(op2.type);
10610 if(op3.type)
10611 FreeType(op3.type);
10612 break;
10613 }
10614 }
10615 }
10616
10617 void ApplyAnyObjectLogic(struct Expression * e);
10618
10619 extern void CopyTypeInto(struct Type * type, struct Type * src);
10620
10621 static unsigned int CheckExpressionType(struct Expression * exp, struct Type * destType, unsigned int skipUnitBla)
10622 {
10623 unsigned int result = 0x1;
10624
10625 if(destType)
10626 {
10627 struct __ecereNameSpace__ecere__sys__OldList converts = 
10628 {
10629 0, 0, 0, 0, 0
10630 };
10631 struct Conversion * convert;
10632
10633 if(destType->kind == 0)
10634 return 0x0;
10635 if(!MatchTypeExpression(exp, destType, &converts, skipUnitBla))
10636 result = 0x0;
10637 if(converts.count)
10638 {
10639 for(convert = converts.first; convert; convert = convert->next)
10640 {
10641 unsigned int empty = !(convert->isGet ? (void *)convert->convert->Get : (void *)convert->convert->Set);
10642
10643 if(!empty)
10644 {
10645 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
10646 int objectType = exp->expType ? exp->expType->classObjectType : 0;
10647
10648 *newExp = *exp;
10649 newExp->destType = (((void *)0));
10650 if(convert->isGet)
10651 {
10652 exp->type = 8;
10653 exp->addedThis = 0x1;
10654 exp->member.exp = newExp;
10655 FreeType(exp->member.exp->expType);
10656 exp->member.exp->expType = MkClassType(convert->convert->_class->fullName);
10657 exp->member.exp->expType->classObjectType = objectType;
10658 exp->member.member = MkIdentifier(convert->convert->dataTypeString);
10659 exp->member.memberType = 1;
10660 exp->expType = convert->resultType ? convert->resultType : convert->convert->dataType;
10661 exp->needCast = 0x1;
10662 if(exp->expType)
10663 exp->expType->refCount++;
10664 ApplyAnyObjectLogic(exp->member.exp);
10665 }
10666 else
10667 {
10668 {
10669 exp->type = 8;
10670 exp->addedThis = 0x1;
10671 exp->member.exp = newExp;
10672 if(newExp->expType && newExp->expType->kind == 8 && newExp->expType->_class && newExp->expType->_class->registered && newExp->expType->_class->registered->type == 5)
10673 {
10674 newExp->byReference = 0x1;
10675 }
10676 FreeType(exp->member.exp->expType);
10677 exp->member.exp->expType = (((void *)0));
10678 if(convert->convert->dataType)
10679 {
10680 exp->member.exp->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
10681 CopyTypeInto(exp->member.exp->expType, convert->convert->dataType);
10682 exp->member.exp->expType->refCount = 1;
10683 exp->member.exp->expType->classObjectType = objectType;
10684 ApplyAnyObjectLogic(exp->member.exp);
10685 }
10686 exp->member.member = MkIdentifier(convert->convert->_class->fullName);
10687 exp->member.memberType = 4;
10688 exp->expType = convert->resultType ? convert->resultType : MkClassType(convert->convert->_class->fullName);
10689 exp->needCast = 0x1;
10690 if(convert->resultType)
10691 convert->resultType->refCount++;
10692 }
10693 }
10694 }
10695 else
10696 {
10697 FreeType(exp->expType);
10698 if(convert->isGet)
10699 {
10700 exp->expType = convert->resultType ? convert->resultType : convert->convert->dataType;
10701 exp->needCast = 0x1;
10702 if(exp->expType)
10703 exp->expType->refCount++;
10704 }
10705 else
10706 {
10707 exp->expType = convert->resultType ? convert->resultType : MkClassType(convert->convert->_class->fullName);
10708 exp->needCast = 0x1;
10709 if(convert->resultType)
10710 convert->resultType->refCount++;
10711 }
10712 }
10713 }
10714 if(exp->isConstant && inCompiler)
10715 ComputeExpression(exp);
10716 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(&converts, FreeConvert);
10717 }
10718 if(!result && exp->expType && converts.count)
10719 {
10720 result = MatchTypes(exp->expType, exp->destType, (((void *)0)), (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0);
10721 }
10722 if(!result && exp->expType && exp->destType)
10723 {
10724 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))
10725 result = 0x1;
10726 }
10727 }
10728 return result;
10729 }
10730
10731 extern struct Expression * MkExpExtensionCompound(struct Statement * compound);
10732
10733 extern struct Statement * MkCompoundStmt(struct __ecereNameSpace__ecere__sys__OldList * declarations, struct __ecereNameSpace__ecere__sys__OldList * statements);
10734
10735 extern struct Statement * MkExpressionStmt(struct __ecereNameSpace__ecere__sys__OldList * expressions);
10736
10737 void CheckTemplateTypes(struct Expression * exp)
10738 {
10739 if(exp->destType && exp->destType->passAsTemplate && exp->expType && exp->expType->kind != 20 && !exp->expType->passAsTemplate)
10740 {
10741 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
10742 struct Statement * compound;
10743 struct Context * context;
10744
10745 *newExp = *exp;
10746 if(exp->destType)
10747 exp->destType->refCount++;
10748 if(exp->expType)
10749 exp->expType->refCount++;
10750 newExp->prev = (((void *)0));
10751 newExp->next = (((void *)0));
10752 switch(exp->expType->kind)
10753 {
10754 case 7:
10755 exp->type = 4;
10756 exp->op.exp1 = (((void *)0));
10757 context = PushContext();
10758 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")))))))));
10759 compound->compound.context = context;
10760 PopContext(context);
10761 exp->op.op = '*';
10762 break;
10763 default:
10764 exp->type = 11;
10765 exp->cast.typeName = MkTypeName(MkListOne(MkSpecifierName("uint64")), (((void *)0)));
10766 exp->cast.exp = MkExpBrackets(MkListOne(newExp));
10767 break;
10768 }
10769 }
10770 else if(exp->expType && exp->expType->passAsTemplate && exp->destType && ((unsigned int)((exp->usage & 0x1) >> 0)) && exp->destType->kind != 20 && !exp->destType->passAsTemplate)
10771 {
10772 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
10773 struct Statement * compound;
10774 struct Context * context;
10775
10776 *newExp = *exp;
10777 if(exp->destType)
10778 exp->destType->refCount++;
10779 if(exp->expType)
10780 exp->expType->refCount++;
10781 newExp->prev = (((void *)0));
10782 newExp->next = (((void *)0));
10783 switch(exp->expType->kind)
10784 {
10785 case 7:
10786 exp->type = 4;
10787 exp->op.exp1 = (((void *)0));
10788 context = PushContext();
10789 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")))))))));
10790 compound->compound.context = context;
10791 PopContext(context);
10792 exp->op.op = '*';
10793 ProcessExpressionType(exp->op.exp2);
10794 break;
10795 case 8:
10796 {
10797 if(exp->expType->_class && exp->expType->_class->registered && exp->expType->_class->registered->type == 1)
10798 {
10799 exp->type = 5;
10800 exp->list = MkListOne(MkExpOp((((void *)0)), '*', MkExpCast(MkTypeName(MkListOne(MkSpecifierName(exp->expType->_class->string)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), newExp)));
10801 ProcessExpressionType((*exp->list).first);
10802 break;
10803 }
10804 else
10805 {
10806 exp->type = 5;
10807 exp->list = MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName(exp->expType->_class->string)), (((void *)0))), newExp));
10808 newExp->needCast = 0x1;
10809 ProcessExpressionType((*exp->list).first);
10810 break;
10811 }
10812 }
10813 default:
10814 {
10815 if(exp->expType->kind == 20)
10816 {
10817 struct Type * type = ProcessTemplateParameterType(exp->expType->templateParameter);
10818
10819 if(type)
10820 {
10821 FreeType(exp->destType);
10822 FreeType(exp->expType);
10823 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
10824 break;
10825 }
10826 }
10827 if(newExp->type == 8 && newExp->member.memberType == 3)
10828 {
10829 exp->type = 4;
10830 exp->op.op = '*';
10831 exp->op.exp1 = (((void *)0));
10832 exp->op.exp2 = MkExpCast(MkTypeName(MkListOne(MkSpecifierName("uint64")), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), MkExpBrackets(MkListOne(MkExpOp((((void *)0)), '&', newExp))));
10833 }
10834 else
10835 {
10836 char typeString[1024];
10837 struct Declarator * decl;
10838 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
10839
10840 typeString[0] = '\0';
10841 PrintType(exp->expType, typeString, 0x0, 0x0);
10842 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
10843 exp->type = 11;
10844 exp->cast.typeName = MkTypeName(specs, decl);
10845 exp->cast.exp = MkExpBrackets(MkListOne(newExp));
10846 exp->cast.exp->needCast = 0x1;
10847 }
10848 break;
10849 }
10850 }
10851 }
10852 }
10853
10854 extern int strncmp(const char * , const char * , int n);
10855
10856 struct __ecereNameSpace__ecere__sys__BTNode * __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindPrefix(struct __ecereNameSpace__ecere__sys__BinaryTree * this, char *  key);
10857
10858 static struct Symbol * ScanWithNameSpace(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, char * nameSpace, char * name)
10859 {
10860 int nsLen = strlen(nameSpace);
10861 struct Symbol * symbol;
10862
10863 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)))
10864 {
10865 char * s = symbol->string;
10866
10867 if(!strncmp(s, nameSpace, nsLen))
10868 {
10869 int c;
10870 char * namePart;
10871
10872 for(c = strlen(s) - 1; c >= 0; c--)
10873 if(s[c] == ':')
10874 break;
10875 namePart = s + c + 1;
10876 if(!strcmp(namePart, name))
10877 {
10878 return symbol;
10879 }
10880 }
10881 else
10882 break;
10883 }
10884 return (((void *)0));
10885 }
10886
10887 static struct Symbol * FindWithNameSpace(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, char * name)
10888 {
10889 int c;
10890 char nameSpace[1024];
10891 char * namePart;
10892 unsigned int gotColon = 0x0;
10893
10894 nameSpace[0] = '\0';
10895 for(c = strlen(name) - 1; c >= 0; c--)
10896 if(name[c] == ':')
10897 {
10898 gotColon = 0x1;
10899 break;
10900 }
10901 namePart = name + c + 1;
10902 while(c >= 0 && name[c] == ':')
10903 c--;
10904 if(c >= 0)
10905 {
10906 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, name);
10907
10908 if(symbol)
10909 return symbol;
10910 memcpy(nameSpace, name, c + 1);
10911 nameSpace[c + 1] = (char)0;
10912 return ScanWithNameSpace(tree, nameSpace, namePart);
10913 }
10914 else if(gotColon)
10915 {
10916 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, namePart);
10917
10918 return symbol;
10919 }
10920 else
10921 {
10922 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, namePart);
10923
10924 if(symbol)
10925 return symbol;
10926 return ScanWithNameSpace(tree, "", namePart);
10927 }
10928 return (((void *)0));
10929 }
10930
10931 static void ProcessDeclaration(struct Declaration * decl);
10932
10933 struct Symbol * FindSymbol(char * name, struct Context * startContext, struct Context * endContext, unsigned int isStruct, unsigned int globalNameSpace)
10934 {
10935 struct Context * ctx;
10936 struct Symbol * symbol = (((void *)0));
10937
10938 for(ctx = startContext; ctx && !symbol; ctx = ctx->parent)
10939 {
10940 if(ctx == globalContext && !globalNameSpace && ctx->hasNameSpace)
10941 {
10942 symbol = (((void *)0));
10943 if(thisNameSpace)
10944 {
10945 char curName[1024];
10946
10947 strcpy(curName, thisNameSpace);
10948 strcat(curName, "::");
10949 strcat(curName, name);
10950 symbol = FindWithNameSpace(isStruct ? &ctx->structSymbols : &ctx->symbols, curName);
10951 }
10952 if(!symbol)
10953 symbol = FindWithNameSpace(isStruct ? &ctx->structSymbols : &ctx->symbols, name);
10954 }
10955 else
10956 symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString((isStruct ? &ctx->structSymbols : &ctx->symbols), name);
10957 if(symbol || ctx == endContext)
10958 break;
10959 }
10960 if(inCompiler && curExternal && symbol && ctx == globalContext && curExternal->symbol && symbol->id > curExternal->symbol->idCode && symbol->pointerExternal)
10961 {
10962 if(symbol->pointerExternal->type == 0)
10963 {
10964 struct FunctionDefinition * function = symbol->pointerExternal->function;
10965 struct Context * tmpContext = curContext;
10966
10967 curContext = (((void *)0));
10968 symbol->pointerExternal = MkExternalDeclaration(MkDeclaration(CopyList(function->specifiers, CopySpecifier), MkListOne(MkInitDeclarator(CopyDeclarator(function->declarator), (((void *)0))))));
10969 curContext = tmpContext;
10970 symbol->pointerExternal->symbol = symbol;
10971 DeclareType(symbol->type, 0x1, 0x1);
10972 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, symbol->pointerExternal);
10973 symbol->id = curExternal->symbol->idCode;
10974 }
10975 else if(symbol->pointerExternal->type == 1 && curExternal->symbol->idCode < symbol->pointerExternal->symbol->id)
10976 {
10977 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
10978 symbol->id = curExternal->symbol->idCode;
10979 }
10980 }
10981 return symbol;
10982 }
10983
10984 static void GetTypeSpecs(struct Type * type, struct __ecereNameSpace__ecere__sys__OldList * specs)
10985 {
10986 if(!type->isSigned)
10987 ListAdd(specs, MkSpecifier(UNSIGNED));
10988 switch(type->kind)
10989 {
10990 case 8:
10991 {
10992 if(type->_class->registered)
10993 {
10994 if(!type->_class->registered->dataType)
10995 type->_class->registered->dataType = ProcessTypeString(type->_class->registered->dataTypeString, 0x0);
10996 GetTypeSpecs(type->_class->registered->dataType, specs);
10997 }
10998 break;
10999 }
11000 case 7:
11001 ListAdd(specs, MkSpecifier(DOUBLE));
11002 break;
11003 case 6:
11004 ListAdd(specs, MkSpecifier(FLOAT));
11005 break;
11006 case 1:
11007 ListAdd(specs, MkSpecifier(CHAR));
11008 break;
11009 case 2:
11010 ListAdd(specs, MkSpecifier(SHORT));
11011 break;
11012 case 4:
11013 ListAdd(specs, MkSpecifier(INT64));
11014 break;
11015 case 3:
11016 default:
11017 ListAdd(specs, MkSpecifier(INT));
11018 break;
11019 }
11020 }
11021
11022 extern char *  __ecereNameSpace__ecere__sys__RSearchString(char *  buffer, char *  subStr, int maxLen, unsigned int matchCase, unsigned int matchWord);
11023
11024 static void _PrintType(struct Type * type, char * string, unsigned int printName, unsigned int printFunction, unsigned int fullName)
11025 {
11026 if(type)
11027 {
11028 switch(type->kind)
11029 {
11030 case 8:
11031 if(type->_class && type->_class->string)
11032 {
11033 if(type->classObjectType == 2)
11034 strcat(string, "typed_object");
11035 else if(fullName)
11036 strcat(string, type->_class->string);
11037 else
11038 {
11039 if(type->_class->registered)
11040 strcat(string, type->_class->registered->name);
11041 else
11042 strcat(string, type->_class->string);
11043 }
11044 }
11045 break;
11046 case 13:
11047 {
11048 {
11049 _PrintType(type->type, string, 0x0, printFunction, fullName);
11050 strcat(string, " *");
11051 }
11052 break;
11053 }
11054 case 0:
11055 strcat(string, "void");
11056 break;
11057 case 3:
11058 strcat(string, type->isSigned ? "int" : "uint");
11059 break;
11060 case 4:
11061 strcat(string, type->isSigned ? "int64" : "uint64");
11062 break;
11063 case 1:
11064 strcat(string, type->isSigned ? "char" : "byte");
11065 break;
11066 case 2:
11067 strcat(string, type->isSigned ? "short" : "uint16");
11068 break;
11069 case 6:
11070 strcat(string, "float");
11071 break;
11072 case 7:
11073 strcat(string, "double");
11074 break;
11075 case 9:
11076 if(type->enumName)
11077 {
11078 strcat(string, "struct ");
11079 strcat(string, type->enumName);
11080 }
11081 else if(type->typeName)
11082 {
11083 strcat(string, type->typeName);
11084 }
11085 else
11086 {
11087 struct Type * member;
11088
11089 strcat(string, "struct {");
11090 for(member = type->members.first; member; member = member->next)
11091 {
11092 PrintType(member, string, 0x1, fullName);
11093 strcat(string, "; ");
11094 }
11095 strcat(string, "}");
11096 }
11097 break;
11098 case 10:
11099 if(type->enumName)
11100 {
11101 strcat(string, "union ");
11102 strcat(string, type->enumName);
11103 }
11104 else if(type->typeName)
11105 {
11106 strcat(string, type->typeName);
11107 }
11108 else
11109 {
11110 strcat(string, "union ");
11111 strcat(string, "(unnamed)");
11112 }
11113 break;
11114 case 15:
11115 if(type->enumName)
11116 {
11117 strcat(string, "enum ");
11118 strcat(string, type->enumName);
11119 }
11120 else if(type->typeName)
11121 {
11122 strcat(string, type->typeName);
11123 }
11124 else
11125 strcat(string, "enum");
11126 break;
11127 case 11:
11128 {
11129 if(printFunction)
11130 {
11131 if(type->dllExport)
11132 strcat(string, "dllexport ");
11133 PrintType(type->returnType, string, 0x0, fullName);
11134 strcat(string, " ");
11135 }
11136 if(printName)
11137 {
11138 if(type->name)
11139 {
11140 if(fullName)
11141 strcat(string, type->name);
11142 else
11143 {
11144 char * name = __ecereNameSpace__ecere__sys__RSearchString(type->name, "::", strlen(type->name), 0x1, 0x0);
11145
11146 if(name)
11147 name += 2;
11148 else
11149 name = type->name;
11150 strcat(string, name);
11151 }
11152 }
11153 }
11154 if(printFunction)
11155 {
11156 struct Type * param;
11157
11158 strcat(string, "(");
11159 for(param = type->params.first; param; param = param->next)
11160 {
11161 PrintType(param, string, 0x1, fullName);
11162 if(param->next)
11163 strcat(string, ", ");
11164 }
11165 strcat(string, ")");
11166 }
11167 break;
11168 }
11169 case 12:
11170 {
11171 {
11172 char baseType[1024], size[256];
11173 struct Type * arrayType = type;
11174
11175 baseType[0] = '\0';
11176 size[0] = '\0';
11177 while(arrayType->kind == 12)
11178 {
11179 strcat(size, "[");
11180 if(arrayType->enumClass)
11181 strcat(size, arrayType->enumClass->string);
11182 else if(arrayType->arraySizeExp)
11183 PrintExpression(arrayType->arraySizeExp, size);
11184 strcat(size, "]");
11185 arrayType = arrayType->arrayType;
11186 }
11187 _PrintType(arrayType, baseType, printName, printFunction, fullName);
11188 strcat(string, baseType);
11189 strcat(string, size);
11190 }
11191 printName = 0x0;
11192 break;
11193 }
11194 case 14:
11195 strcat(string, "...");
11196 break;
11197 case 16:
11198 _PrintType(type->method->dataType, string, 0x0, printFunction, fullName);
11199 break;
11200 case 19:
11201 strcat(string, "subclass(");
11202 strcat(string, type->_class ? type->_class->string : "int");
11203 strcat(string, ")");
11204 break;
11205 case 20:
11206 strcat(string, type->templateParameter->identifier->string);
11207 break;
11208 case 21:
11209 strcat(string, "thisclass");
11210 break;
11211 case 17:
11212 strcat(string, "__builtin_va_list");
11213 break;
11214 }
11215 if(type->name && printName && type->kind != 11 && (type->kind != 13 || type->type->kind != 11))
11216 {
11217 strcat(string, " ");
11218 strcat(string, type->name);
11219 }
11220 }
11221 }
11222
11223 void PrintType(struct Type * type, char * string, unsigned int printName, unsigned int fullName)
11224 {
11225 struct Type * funcType;
11226
11227 for(funcType = type; funcType && (funcType->kind == 13 || funcType->kind == 12); funcType = funcType->type)
11228 ;
11229 if(funcType && funcType->kind == 11 && type != funcType)
11230 {
11231 char typeString[1024];
11232 struct Type * param;
11233
11234 PrintType(funcType->returnType, string, 0x0, fullName);
11235 strcat(string, "(");
11236 _PrintType(type, string, printName, 0x0, fullName);
11237 strcat(string, ")");
11238 strcat(string, "(");
11239 for(param = funcType->params.first; param; param = param->next)
11240 {
11241 PrintType(param, string, 0x1, fullName);
11242 if(param->next)
11243 strcat(string, ", ");
11244 }
11245 strcat(string, ")");
11246 }
11247 else
11248 _PrintType(type, string, printName, 0x1, fullName);
11249 if(type->bitFieldCount)
11250 {
11251 char count[100];
11252
11253 sprintf(count, ":%d", type->bitFieldCount);
11254 strcat(string, count);
11255 }
11256 }
11257
11258 static struct Type * FindMember(struct Type * type, char * string)
11259 {
11260 struct Type * memberType;
11261
11262 for(memberType = type->members.first; memberType; memberType = memberType->next)
11263 {
11264 if(!memberType->name)
11265 {
11266 struct Type * subType = FindMember(memberType, string);
11267
11268 if(subType)
11269 return subType;
11270 }
11271 else if(!strcmp(memberType->name, string))
11272 return memberType;
11273 }
11274 return (((void *)0));
11275 }
11276
11277 struct Type * FindMemberAndOffset(struct Type * type, char * string, unsigned int * offset)
11278 {
11279 struct Type * memberType;
11280
11281 for(memberType = type->members.first; memberType; memberType = memberType->next)
11282 {
11283 if(!memberType->name)
11284 {
11285 struct Type * subType = FindMember(memberType, string);
11286
11287 if(subType)
11288 {
11289 *offset += memberType->offset;
11290 return subType;
11291 }
11292 }
11293 else if(!strcmp(memberType->name, string))
11294 {
11295 *offset += memberType->offset;
11296 return memberType;
11297 }
11298 }
11299 return (((void *)0));
11300 }
11301
11302 extern struct __ecereNameSpace__ecere__com__Instance * fileInput;
11303
11304 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Write;
11305
11306 struct Expression * ParseExpressionString(char * expression)
11307 {
11308 fileInput = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
11309 ((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));
11310 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))fileInput->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(fileInput, 0, 0);
11311 echoOn = 0x0;
11312 parsedExpression = (((void *)0));
11313 resetScanner();
11314 expression_yyparse();
11315 (__ecereNameSpace__ecere__com__eInstance_DecRef(fileInput), fileInput = 0);
11316 return parsedExpression;
11317 }
11318
11319 extern char *  QMkString(char *  source);
11320
11321 static unsigned int ResolveIdWithClass(struct Expression * exp, struct __ecereNameSpace__ecere__com__Class * _class, unsigned int skipIDClassCheck)
11322 {
11323 void * __ecereTemp1;
11324 struct Identifier * id = exp->identifier;
11325 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
11326 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
11327 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
11328 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
11329
11330 if(_class && _class->type == 4)
11331 {
11332 struct __ecereNameSpace__ecere__sys__NamedLink * value = (((void *)0));
11333 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
11334
11335 if(enumClass)
11336 {
11337 struct __ecereNameSpace__ecere__com__Class * baseClass;
11338
11339 for(baseClass = _class; baseClass && baseClass->type == 4; baseClass = baseClass->base)
11340 {
11341 struct __ecereNameSpace__ecere__com__EnumClassData * e = (baseClass ? ((void *)(((char *)baseClass->data) + enumClass->offsetClass)) : (((void *)0)));
11342
11343 for(value = e->values.first; value; value = value->next)
11344 {
11345 if(!strcmp(value->name, id->string))
11346 break;
11347 }
11348 if(value)
11349 {
11350 char constant[256];
11351
11352 FreeExpContents(exp);
11353 exp->type = 2;
11354 exp->isConstant = 0x1;
11355 if(!strcmp(baseClass->dataTypeString, "int"))
11356 sprintf(constant, "%d", value->data);
11357 else
11358 sprintf(constant, "0x%X", value->data);
11359 exp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
11360 exp->expType = MkClassType(baseClass->fullName);
11361 break;
11362 }
11363 }
11364 }
11365 if(value)
11366 return 0x1;
11367 }
11368 if((method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule)))
11369 {
11370 ProcessMethodType(method);
11371 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));
11372 return 0x1;
11373 }
11374 else if((prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule)))
11375 {
11376 if(!prop->dataType)
11377 ProcessPropertyType(prop);
11378 exp->expType = prop->dataType;
11379 if(prop->dataType)
11380 prop->dataType->refCount++;
11381 return 0x1;
11382 }
11383 else if((member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)))))
11384 {
11385 if(!member->dataType)
11386 member->dataType = ProcessTypeString(member->dataTypeString, 0x0);
11387 exp->expType = member->dataType;
11388 if(member->dataType)
11389 member->dataType->refCount++;
11390 return 0x1;
11391 }
11392 else if((classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(_class, id->string)))
11393 {
11394 if(!classProp->dataType)
11395 classProp->dataType = ProcessTypeString(classProp->dataTypeString, 0x0);
11396 if(classProp->constant)
11397 {
11398 FreeExpContents(exp);
11399 exp->isConstant = 0x1;
11400 if(classProp->dataType->kind == 13 && classProp->dataType->type->kind == 1)
11401 {
11402 exp->type = 3;
11403 exp->constant = QMkString((char *)classProp->Get(_class));
11404 }
11405 else
11406 {
11407 char constant[256];
11408
11409 exp->type = 2;
11410 sprintf(constant, "%d", classProp->Get(_class));
11411 exp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
11412 }
11413 }
11414 else
11415 {
11416 }
11417 exp->expType = classProp->dataType;
11418 if(classProp->dataType)
11419 classProp->dataType->refCount++;
11420 return 0x1;
11421 }
11422 return 0x0;
11423 }
11424
11425 static struct GlobalData * ScanGlobalData(struct __ecereNameSpace__ecere__com__NameSpace * nameSpace, char * name)
11426 {
11427 struct __ecereNameSpace__ecere__sys__BinaryTree * tree = &nameSpace->functions;
11428 struct GlobalData * data = (struct GlobalData *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString((&*tree), name);
11429 struct __ecereNameSpace__ecere__com__NameSpace * child;
11430
11431 if(!data)
11432 {
11433 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)))
11434 {
11435 data = ScanGlobalData(child, name);
11436 if(data)
11437 break;
11438 }
11439 }
11440 return data;
11441 }
11442
11443 extern struct __ecereNameSpace__ecere__com__NameSpace *  globalData;
11444
11445 extern char *  strncpy(char * , const char * , int n);
11446
11447 static struct GlobalData * FindGlobalData(char * name)
11448 {
11449 int start = 0, c;
11450 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
11451
11452 nameSpace = globalData;
11453 for(c = 0; name[c]; c++)
11454 {
11455 if(name[c] == '.' || (name[c] == ':' && name[c + 1] == ':'))
11456 {
11457 struct __ecereNameSpace__ecere__com__NameSpace * newSpace;
11458 char * spaceName = __ecereNameSpace__ecere__com__eSystem_New(sizeof(char) * (c - start + 1));
11459
11460 strncpy(spaceName, name + start, c - start);
11461 spaceName[c - start] = '\0';
11462 newSpace = (struct __ecereNameSpace__ecere__com__NameSpace *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(&(*nameSpace).nameSpaces, spaceName);
11463 (__ecereNameSpace__ecere__com__eSystem_Delete(spaceName), spaceName = 0);
11464 if(!newSpace)
11465 return (((void *)0));
11466 nameSpace = newSpace;
11467 if(name[c] == ':')
11468 c++;
11469 start = c + 1;
11470 }
11471 }
11472 if(c - start)
11473 {
11474 return ScanGlobalData(nameSpace, name + start);
11475 }
11476 return (((void *)0));
11477 }
11478
11479 static int definedExpStackPos;
11480
11481 static void * definedExpStack[512];
11482
11483 void ReplaceExpContents(struct Expression * checkedExp, struct Expression * newExp)
11484 {
11485 struct Expression * prev = checkedExp->prev, * next = checkedExp->next;
11486
11487 FreeExpContents(checkedExp);
11488 FreeType(checkedExp->expType);
11489 FreeType(checkedExp->destType);
11490 *checkedExp = *newExp;
11491 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
11492 checkedExp->prev = prev;
11493 checkedExp->next = next;
11494 }
11495
11496 extern struct Expression * MkExpCall(struct Expression * expression, struct __ecereNameSpace__ecere__sys__OldList * arguments);
11497
11498 void __ecereMethod_Expression_Clear();
11499
11500 void ApplyAnyObjectLogic(struct Expression * e)
11501 {
11502 struct Type * destType = e->destType;
11503
11504 if(destType && (destType->classObjectType == 3))
11505 {
11506 if(e && e->expType)
11507 {
11508 struct Type * type = e->expType;
11509 struct __ecereNameSpace__ecere__com__Class * _class = (((void *)0));
11510
11511 if(type->kind == 8 && type->_class && type->_class->registered)
11512 {
11513 _class = type->_class->registered;
11514 }
11515 else if(type->kind == 19)
11516 {
11517 _class = FindClass("ecere::com::Class")->registered;
11518 }
11519 else
11520 {
11521 char string[1024] = "";
11522 struct Symbol * classSym;
11523
11524 PrintType(type, string, 0x0, 0x1);
11525 classSym = FindClass(string);
11526 if(classSym)
11527 _class = classSym->registered;
11528 }
11529 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)))
11530 {
11531 if(!_class || strcmp(_class->fullName, "char *"))
11532 {
11533 struct Expression * checkedExp = e, * newExp;
11534
11535 while(((checkedExp->type == 5 || checkedExp->type == 34 || checkedExp->type == 25) && checkedExp->list) || checkedExp->type == 11)
11536 {
11537 if(checkedExp->type == 5 || checkedExp->type == 34 || checkedExp->type == 25)
11538 {
11539 if(checkedExp->type == 25)
11540 {
11541 checkedExp = (*((struct Statement *)(*checkedExp->compound->compound.statements).last)->expressions).last;
11542 }
11543 else
11544 checkedExp = (*checkedExp->list).last;
11545 }
11546 else if(checkedExp->type == 11)
11547 checkedExp = checkedExp->cast.exp;
11548 }
11549 if(checkedExp && checkedExp->type == 4 && checkedExp->op.op == '*' && !checkedExp->op.exp1)
11550 {
11551 newExp = checkedExp->op.exp2;
11552 checkedExp->op.exp2 = (((void *)0));
11553 FreeExpContents(checkedExp);
11554 if(e->expType && e->expType->passAsTemplate)
11555 {
11556 char size[100];
11557
11558 ComputeTypeSize(e->expType);
11559 sprintf(size, "%d", e->expType->size);
11560 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))))));
11561 }
11562 ReplaceExpContents(checkedExp, newExp);
11563 e->byReference = 0x1;
11564 }
11565 else if(!e->byReference || (_class && _class->type == 5))
11566 {
11567 struct Expression * checkedExp, * newExp;
11568
11569 {
11570 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;
11571
11572 if(_class && _class->type != 5 && _class->type != 0 && _class->type != 1 && !hasAddress)
11573 {
11574 struct Context * context = PushContext();
11575 struct Declarator * decl;
11576 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
11577 char typeString[1024];
11578 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
11579
11580 typeString[0] = '\0';
11581 *newExp = *e;
11582 newExp->prev = (((void *)0));
11583 newExp->next = (((void *)0));
11584 newExp->expType = (((void *)0));
11585 PrintType(e->expType, typeString, 0x0, 0x1);
11586 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
11587 newExp->destType = ProcessType(specs, decl);
11588 curContext = context;
11589 e->type = 25;
11590 e->compound = MkCompoundStmt(MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internalValue")), MkInitializerAssignment(newExp))))), MkListOne(MkExpressionStmt(MkListOne(MkExpIdentifier(MkIdentifier("__internalValue"))))));
11591 {
11592 struct Type * type = e->destType;
11593
11594 e->destType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
11595 CopyTypeInto(e->destType, type);
11596 e->destType->refCount = 1;
11597 e->destType->classObjectType = 0;
11598 FreeType(type);
11599 }
11600 e->compound->compound.context = context;
11601 PopContext(context);
11602 curContext = context->parent;
11603 }
11604 }
11605 checkedExp = e;
11606 while(((checkedExp->type == 5 || checkedExp->type == 34 || checkedExp->type == 25) && checkedExp->list) || checkedExp->type == 11)
11607 {
11608 if(checkedExp->type == 5 || checkedExp->type == 34 || checkedExp->type == 25)
11609 {
11610 if(checkedExp->type == 25)
11611 {
11612 checkedExp = (*((struct Statement *)(*checkedExp->compound->compound.statements).last)->expressions).last;
11613 }
11614 else
11615 checkedExp = (*checkedExp->list).last;
11616 }
11617 else if(checkedExp->type == 11)
11618 checkedExp = checkedExp->cast.exp;
11619 }
11620 {
11621 struct Expression * operand = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
11622
11623 *operand = *checkedExp;
11624 checkedExp->destType = (((void *)0));
11625 checkedExp->expType = (((void *)0));
11626 __ecereMethod_Expression_Clear(checkedExp);
11627 checkedExp->type = 4;
11628 checkedExp->op.op = '&';
11629 checkedExp->op.exp1 = (((void *)0));
11630 checkedExp->op.exp2 = operand;
11631 }
11632 }
11633 }
11634 }
11635 }
11636 }
11637 {
11638 }
11639 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))))
11640 {
11641 if(e->expType->kind == 8 && e->expType->_class && e->expType->_class->registered && !strcmp(e->expType->_class->registered->name, "class"))
11642 {
11643 return ;
11644 }
11645 else
11646 {
11647 struct Expression * thisExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
11648
11649 *thisExp = *e;
11650 thisExp->prev = (((void *)0));
11651 thisExp->next = (((void *)0));
11652 __ecereMethod_Expression_Clear(e);
11653 e->type = 5;
11654 e->list = MkListOne(MkExpOp((((void *)0)), '*', MkExpBrackets(MkListOne(thisExp))));
11655 if(thisExp->expType->kind == 8 && thisExp->expType->_class && thisExp->expType->_class->registered && thisExp->expType->_class->registered->type == 5)
11656 ((struct Expression *)(*e->list).first)->byReference = 0x1;
11657 {
11658 e->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
11659 CopyTypeInto(e->expType, thisExp->expType);
11660 e->expType->byReference = 0x0;
11661 e->expType->refCount = 1;
11662 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))
11663 {
11664 e->expType->classObjectType = 0;
11665 }
11666 }
11667 }
11668 }
11669 else if(destType && e->expType && (e->expType->classObjectType == 3 || e->expType->classObjectType == 2) && !destType->classObjectType && destType->kind != 0)
11670 {
11671 if(destType->kind == 14)
11672 {
11673 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Unspecified type\n", (((void *)0))));
11674 }
11675 else if(!(destType->truth && e->expType->kind == 8 && e->expType->_class && e->expType->_class->registered && e->expType->_class->registered->type == 1))
11676 {
11677 unsigned int byReference = e->expType->byReference;
11678 struct Expression * thisExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
11679 struct Declarator * decl;
11680 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
11681 char typeString[1024];
11682 struct Type * type;
11683 int backupClassObjectType;
11684
11685 if(e->expType->kind == 8 && e->expType->_class && e->expType->_class->registered && strcmp(e->expType->_class->registered->name, "class"))
11686 type = e->expType;
11687 else
11688 type = destType;
11689 backupClassObjectType = type->classObjectType;
11690 type->classObjectType = 0;
11691 typeString[0] = '\0';
11692 PrintType(type, typeString, 0x0, 0x1);
11693 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
11694 type->classObjectType = backupClassObjectType;
11695 *thisExp = *e;
11696 thisExp->prev = (((void *)0));
11697 thisExp->next = (((void *)0));
11698 __ecereMethod_Expression_Clear(e);
11699 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)))
11700 {
11701 e->type = 4;
11702 e->op.op = '*';
11703 e->op.exp1 = (((void *)0));
11704 e->op.exp2 = MkExpCast(MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl)), thisExp);
11705 }
11706 else
11707 {
11708 e->type = 11;
11709 e->cast.typeName = MkTypeName(specs, decl);
11710 e->cast.exp = thisExp;
11711 e->byReference = 0x1;
11712 }
11713 e->expType = type;
11714 e->destType = destType;
11715 type->refCount++;
11716 destType->refCount++;
11717 }
11718 }
11719 }
11720
11721 extern char *  strstr(char * , const char * );
11722
11723 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__DefinedExpression;
11724
11725 struct __ecereNameSpace__ecere__com__DefinedExpression
11726 {
11727 struct __ecereNameSpace__ecere__com__DefinedExpression * prev;
11728 struct __ecereNameSpace__ecere__com__DefinedExpression * next;
11729 char *  name;
11730 char *  value;
11731 struct __ecereNameSpace__ecere__com__NameSpace *  nameSpace;
11732 };
11733
11734 extern struct __ecereNameSpace__ecere__com__DefinedExpression * __ecereNameSpace__ecere__com__eSystem_FindDefine(struct __ecereNameSpace__ecere__com__Instance * module, char *  name);
11735
11736 extern struct __ecereNameSpace__ecere__com__GlobalFunction * __ecereNameSpace__ecere__com__eSystem_FindFunction(struct __ecereNameSpace__ecere__com__Instance * module, char *  name);
11737
11738 extern unsigned int __ecereNameSpace__ecere__sys__UTF8GetChar(char *  string, int *  numBytes);
11739
11740 extern struct Expression * GetTemplateArgExp(struct TemplateParameter * param, struct __ecereNameSpace__ecere__com__Class * curClass, unsigned int pointer);
11741
11742 extern struct Expression * MkExpMember(struct Expression * expression, struct Identifier * member);
11743
11744 extern struct Expression * MkExpCondition(struct Expression * cond, struct __ecereNameSpace__ecere__sys__OldList * expressions, struct Expression * elseExp);
11745
11746 extern struct Expression * CopyExpression(struct Expression * exp);
11747
11748 extern struct Expression * MkExpTypeSize(struct TypeName * typeName);
11749
11750 extern struct Expression * MkExpClass(struct __ecereNameSpace__ecere__sys__OldList *  specifiers, struct Declarator * decl);
11751
11752 static void ProcessStatement(struct Statement * stmt);
11753
11754 extern struct Initializer * MkInitializerList(struct __ecereNameSpace__ecere__sys__OldList * list);
11755
11756 extern struct Declaration * MkDeclarationInst(struct Instantiation * inst);
11757
11758 extern struct Instantiation * MkInstantiationNamed(struct __ecereNameSpace__ecere__sys__OldList * specs, struct Expression * exp, struct __ecereNameSpace__ecere__sys__OldList * members);
11759
11760 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear(struct __ecereNameSpace__ecere__sys__OldList * this);
11761
11762 void ProcessExpressionType(struct Expression * exp)
11763 {
11764 void * __ecereTemp2;
11765 void * __ecereTemp1;
11766 unsigned int unresolved = 0x0;
11767 struct Location oldyylloc = yylloc;
11768 unsigned int notByReference = 0x0;
11769
11770 if(!exp || exp->expType)
11771 return ;
11772 yylloc = exp->loc;
11773 switch(exp->type)
11774 {
11775 case 0:
11776 {
11777 struct Identifier * id = exp->identifier;
11778
11779 if(!id)
11780 return ;
11781 if(id->_class && id->_class->name)
11782 {
11783 id->classSym = id->_class->symbol;
11784 }
11785 if(strstr(id->string, "__ecereClass") == id->string)
11786 {
11787 exp->expType = ProcessTypeString("ecere::com::Class", 0x1);
11788 break;
11789 }
11790 else if(id->_class && (id->classSym || (id->_class->name && !strcmp(id->_class->name, "property"))))
11791 {
11792 ReplaceClassMembers(exp, thisClass);
11793 if(exp->type != 0)
11794 {
11795 ProcessExpressionType(exp);
11796 break;
11797 }
11798 if(id->classSym && ResolveIdWithClass(exp, id->classSym->registered, 0x0))
11799 break;
11800 }
11801 else
11802 {
11803 struct Symbol * symbol = FindSymbol(id->string, curContext, topContext, 0x0, id->_class && id->_class->name == (((void *)0)));
11804
11805 if(!symbol)
11806 {
11807 if(exp->destType && CheckExpressionType(exp, exp->destType, 0x0))
11808 break;
11809 else
11810 {
11811 if(thisClass)
11812 {
11813 ReplaceClassMembers(exp, thisClass ? thisClass : currentClass);
11814 if(exp->type != 0)
11815 {
11816 ProcessExpressionType(exp);
11817 break;
11818 }
11819 }
11820 else if(currentClass && !id->_class)
11821 {
11822 if(ResolveIdWithClass(exp, currentClass, 0x1))
11823 break;
11824 }
11825 symbol = FindSymbol(id->string, topContext->parent, globalContext, 0x0, id->_class && id->_class->name == (((void *)0)));
11826 }
11827 }
11828 if(symbol)
11829 {
11830 struct Type * type = symbol->type;
11831 struct __ecereNameSpace__ecere__com__Class * _class = (type && type->kind == 8 && type->_class) ? type->_class->registered : (((void *)0));
11832
11833 if(_class && !strcmp(id->string, "this") && !type->classObjectType)
11834 {
11835 struct Context * context = SetupTemplatesContext(_class);
11836
11837 type = ReplaceThisClassType(_class);
11838 FinishTemplatesContext(context);
11839 if(type)
11840 type->refCount = 0;
11841 }
11842 FreeSpecifier(id->_class);
11843 id->_class = (((void *)0));
11844 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
11845 id->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
11846 id->classSym = (((void *)0));
11847 exp->expType = type;
11848 if(type)
11849 type->refCount++;
11850 if(type && (type->kind == 15 || (_class && _class->type == 4)))
11851 exp->isConstant = 0x1;
11852 if(symbol->isParam || !strcmp(id->string, "this"))
11853 {
11854 if(_class && _class->type == 1)
11855 exp->byReference = 0x1;
11856 }
11857 if(symbol->isIterator)
11858 {
11859 if(symbol->isIterator == 3)
11860 {
11861 exp->type = 5;
11862 exp->list = MkListOne(MkExpOp((((void *)0)), '*', MkExpIdentifier(exp->identifier)));
11863 ((struct Expression *)(*exp->list).first)->op.exp2->expType = exp->expType;
11864 exp->expType = (((void *)0));
11865 ProcessExpressionType(exp);
11866 }
11867 else if(symbol->isIterator != 4)
11868 {
11869 exp->type = 8;
11870 exp->member.exp = MkExpIdentifier(exp->identifier);
11871 exp->member.exp->expType = exp->expType;
11872 exp->member.member = MkIdentifier("data");
11873 exp->expType = (((void *)0));
11874 ProcessExpressionType(exp);
11875 }
11876 }
11877 break;
11878 }
11879 else
11880 {
11881 struct __ecereNameSpace__ecere__com__DefinedExpression * definedExp = (((void *)0));
11882
11883 if(thisNameSpace && !(id->_class && !id->_class->name))
11884 {
11885 char name[1024];
11886
11887 strcpy(name, thisNameSpace);
11888 strcat(name, "::");
11889 strcat(name, id->string);
11890 definedExp = __ecereNameSpace__ecere__com__eSystem_FindDefine(privateModule, name);
11891 }
11892 if(!definedExp)
11893 definedExp = __ecereNameSpace__ecere__com__eSystem_FindDefine(privateModule, id->string);
11894 if(definedExp)
11895 {
11896 int c;
11897
11898 for(c = 0; c < definedExpStackPos; c++)
11899 if(definedExpStack[c] == definedExp)
11900 break;
11901 if(c == definedExpStackPos && c < sizeof definedExpStack / sizeof(void *))
11902 {
11903 struct Location backupYylloc = yylloc;
11904
11905 definedExpStack[definedExpStackPos++] = definedExp;
11906 fileInput = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
11907 ((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));
11908 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))fileInput->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(fileInput, 0, 0);
11909 echoOn = 0x0;
11910 parsedExpression = (((void *)0));
11911 resetScanner();
11912 expression_yyparse();
11913 (__ecereNameSpace__ecere__com__eInstance_DecRef(fileInput), fileInput = 0);
11914 yylloc = backupYylloc;
11915 if(parsedExpression)
11916 {
11917 FreeIdentifier(id);
11918 exp->type = 5;
11919 exp->list = MkListOne(parsedExpression);
11920 parsedExpression->loc = yylloc;
11921 ProcessExpressionType(exp);
11922 definedExpStackPos--;
11923 return ;
11924 }
11925 definedExpStackPos--;
11926 }
11927 else
11928 {
11929 if(inCompiler)
11930 {
11931 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Recursion in defined expression %s\n", (((void *)0))), id->string);
11932 }
11933 }
11934 }
11935 else
11936 {
11937 struct GlobalData * data = (((void *)0));
11938
11939 if(thisNameSpace && !(id->_class && !id->_class->name))
11940 {
11941 char name[1024];
11942
11943 strcpy(name, thisNameSpace);
11944 strcat(name, "::");
11945 strcat(name, id->string);
11946 data = FindGlobalData(name);
11947 }
11948 if(!data)
11949 data = FindGlobalData(id->string);
11950 if(data)
11951 {
11952 DeclareGlobalData(data);
11953 exp->expType = data->dataType;
11954 if(data->dataType)
11955 data->dataType->refCount++;
11956 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
11957 id->string = __ecereNameSpace__ecere__sys__CopyString(data->fullName);
11958 FreeSpecifier(id->_class);
11959 id->_class = (((void *)0));
11960 break;
11961 }
11962 else
11963 {
11964 struct __ecereNameSpace__ecere__com__GlobalFunction * function = (((void *)0));
11965
11966 if(thisNameSpace && !(id->_class && !id->_class->name))
11967 {
11968 char name[1024];
11969
11970 strcpy(name, thisNameSpace);
11971 strcat(name, "::");
11972 strcat(name, id->string);
11973 function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, name);
11974 }
11975 if(!function)
11976 function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, id->string);
11977 if(function)
11978 {
11979 char name[1024];
11980
11981 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
11982 id->string = __ecereNameSpace__ecere__sys__CopyString(function->name);
11983 name[0] = (char)0;
11984 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + 12)))->importType != 1 && (!function->dataType || !function->dataType->dllExport))
11985 strcpy(name, "__ecereFunction_");
11986 FullClassNameCat(name, id->string, 0x0);
11987 if(DeclareFunction(function, name))
11988 {
11989 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
11990 id->string = __ecereNameSpace__ecere__sys__CopyString(name);
11991 }
11992 exp->expType = function->dataType;
11993 if(function->dataType)
11994 function->dataType->refCount++;
11995 FreeSpecifier(id->_class);
11996 id->_class = (((void *)0));
11997 break;
11998 }
11999 }
12000 }
12001 }
12002 }
12003 unresolved = 0x1;
12004 break;
12005 }
12006 case 1:
12007 {
12008 struct __ecereNameSpace__ecere__com__Class * _class;
12009
12010 if(!exp->instance->_class)
12011 {
12012 if(exp->destType && exp->destType->kind == 8 && exp->destType->_class)
12013 {
12014 exp->instance->_class = MkSpecifierName(exp->destType->_class->string);
12015 }
12016 }
12017 ProcessInstantiationType(exp->instance);
12018 exp->isConstant = exp->instance->isConstant;
12019 if(exp->instance->_class)
12020 {
12021 exp->expType = MkClassType(exp->instance->_class->name);
12022 }
12023 break;
12024 }
12025 case 2:
12026 {
12027 if(!exp->expType)
12028 {
12029 struct Type * type = (type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), type->refCount = 1, type->constant = 0x1, type);
12030
12031 exp->expType = type;
12032 if(exp->constant[0] == '\'')
12033 {
12034 if((int)((unsigned char *)exp->constant)[1] > 127)
12035 {
12036 int nb;
12037 unsigned int ch = __ecereNameSpace__ecere__sys__UTF8GetChar(exp->constant + 1, &nb);
12038
12039 if(nb < 2)
12040 ch = exp->constant[1];
12041 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->constant), exp->constant = 0);
12042 exp->constant = PrintUInt(ch);
12043 type->kind = 8;
12044 type->_class = FindClass("unichar");
12045 type->isSigned = 0x0;
12046 }
12047 else
12048 {
12049 type->kind = 1;
12050 type->isSigned = 0x1;
12051 }
12052 }
12053 else if(strchr(exp->constant, '.'))
12054 {
12055 char ch = exp->constant[strlen(exp->constant) - 1];
12056
12057 if(ch == 'f')
12058 type->kind = 6;
12059 else
12060 type->kind = 7;
12061 type->isSigned = 0x1;
12062 }
12063 else
12064 {
12065 if(exp->constant[0] == '0' && exp->constant[1])
12066 type->isSigned = 0x0;
12067 else if(strchr(exp->constant, 'L') || strchr(exp->constant, 'l'))
12068 type->isSigned = 0x0;
12069 else if(strtoll(exp->constant, (((void *)0)), 0) > (((int)0x7fffffff)))
12070 type->isSigned = 0x0;
12071 else
12072 type->isSigned = 0x1;
12073 type->kind = 3;
12074 }
12075 exp->isConstant = 0x1;
12076 }
12077 break;
12078 }
12079 case 3:
12080 {
12081 exp->isConstant = 0x1;
12082 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));
12083 break;
12084 }
12085 case 13:
12086 case 28:
12087 ProcessExpressionType(exp->_new.size);
12088 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));
12089 DeclareType(exp->expType->type, 0x0, 0x0);
12090 break;
12091 case 14:
12092 case 29:
12093 ProcessExpressionType(exp->_renew.size);
12094 ProcessExpressionType(exp->_renew.exp);
12095 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));
12096 DeclareType(exp->expType->type, 0x0, 0x0);
12097 break;
12098 case 4:
12099 {
12100 unsigned int assign = 0x0, boolResult = 0x0, boolOps = 0x0;
12101 struct Type * type1 = (((void *)0)), * type2 = (((void *)0));
12102 unsigned int useDestType = 0x0, useSideType = 0x0;
12103 struct Location oldyylloc = yylloc;
12104 unsigned int useSideUnit = 0x0;
12105 struct Type * dummy = (dummy = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), dummy->count = (unsigned int)1, dummy->refCount = 1, dummy);
12106
12107 switch(exp->op.op)
12108 {
12109 case '=':
12110 case MUL_ASSIGN:
12111 case DIV_ASSIGN:
12112 case MOD_ASSIGN:
12113 case ADD_ASSIGN:
12114 case SUB_ASSIGN:
12115 case LEFT_ASSIGN:
12116 case RIGHT_ASSIGN:
12117 case AND_ASSIGN:
12118 case XOR_ASSIGN:
12119 case OR_ASSIGN:
12120 assign = 0x1;
12121 break;
12122 case '!':
12123 break;
12124 case AND_OP:
12125 case OR_OP:
12126 boolOps = 0x1;
12127 boolResult = 0x1;
12128 break;
12129 case EQ_OP:
12130 case '<':
12131 case '>':
12132 case LE_OP:
12133 case GE_OP:
12134 case NE_OP:
12135 boolResult = 0x1;
12136 useSideType = 0x1;
12137 break;
12138 case '+':
12139 case '-':
12140 useSideUnit = 0x1;
12141 case '|':
12142 case '&':
12143 case '^':
12144 case '/':
12145 case '%':
12146 case '*':
12147 if(exp->op.op != '*' || exp->op.exp1)
12148 {
12149 useSideType = 0x1;
12150 useDestType = 0x1;
12151 }
12152 break;
12153 }
12154 if(exp->op.op == '&')
12155 {
12156 if(!exp->op.exp1 && exp->op.exp2 && exp->op.exp2->type == 0 && exp->op.exp2->identifier)
12157 {
12158 struct Identifier * id = exp->op.exp2->identifier;
12159 struct Symbol * symbol = FindSymbol(id->string, curContext, topContext, 0x0, id->_class && id->_class->name == (((void *)0)));
12160
12161 if(symbol && symbol->isIterator == 2)
12162 {
12163 exp->type = 8;
12164 exp->member.exp = exp->op.exp2;
12165 exp->member.member = MkIdentifier("key");
12166 exp->expType = (((void *)0));
12167 exp->op.exp2->expType = symbol->type;
12168 symbol->type->refCount++;
12169 ProcessExpressionType(exp);
12170 FreeType(dummy);
12171 break;
12172 }
12173 }
12174 }
12175 if(exp->op.exp1)
12176 {
12177 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))
12178 {
12179 if(exp->op.exp1->destType)
12180 FreeType(exp->op.exp1->destType);
12181 exp->op.exp1->destType = exp->destType;
12182 if(exp->destType)
12183 exp->destType->refCount++;
12184 }
12185 else if(!assign)
12186 {
12187 if(exp->op.exp1->destType)
12188 FreeType(exp->op.exp1->destType);
12189 exp->op.exp1->destType = dummy;
12190 dummy->refCount++;
12191 }
12192 if(exp->op.exp1->destType && exp->op.op != '=')
12193 exp->op.exp1->destType->count++;
12194 ProcessExpressionType(exp->op.exp1);
12195 if(exp->op.exp1->destType && exp->op.op != '=')
12196 exp->op.exp1->destType->count--;
12197 if(exp->op.exp1->destType == dummy)
12198 {
12199 FreeType(dummy);
12200 exp->op.exp1->destType = (((void *)0));
12201 }
12202 type1 = exp->op.exp1->expType;
12203 }
12204 if(exp->op.exp2)
12205 {
12206 char expString[10240];
12207
12208 expString[0] = '\0';
12209 if(exp->op.exp2->type == 1 && !exp->op.exp2->instance->_class)
12210 {
12211 if(exp->op.exp1)
12212 {
12213 exp->op.exp2->destType = exp->op.exp1->expType;
12214 if(exp->op.exp1->expType)
12215 exp->op.exp1->expType->refCount++;
12216 }
12217 else
12218 {
12219 exp->op.exp2->destType = exp->destType;
12220 if(exp->destType)
12221 exp->destType->refCount++;
12222 }
12223 if(type1)
12224 type1->refCount++;
12225 exp->expType = type1;
12226 }
12227 else if(assign)
12228 {
12229 if(inCompiler)
12230 PrintExpression(exp->op.exp2, expString);
12231 if(type1 && type1->kind == 13)
12232 {
12233 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)
12234 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "operator %s illegal on pointer\n", (((void *)0))), exp->op.op);
12235 else if(exp->op.op == '=')
12236 {
12237 if(exp->op.exp2->destType)
12238 FreeType(exp->op.exp2->destType);
12239 exp->op.exp2->destType = type1;
12240 if(type1)
12241 type1->refCount++;
12242 }
12243 }
12244 else
12245 {
12246 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)
12247 ;
12248 else
12249 {
12250 if(exp->op.exp2->destType)
12251 FreeType(exp->op.exp2->destType);
12252 exp->op.exp2->destType = type1;
12253 if(type1)
12254 type1->refCount++;
12255 }
12256 }
12257 if(type1)
12258 type1->refCount++;
12259 exp->expType = type1;
12260 }
12261 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)))
12262 {
12263 if(exp->op.exp2->destType)
12264 FreeType(exp->op.exp2->destType);
12265 exp->op.exp2->destType = exp->destType;
12266 if(exp->destType)
12267 exp->destType->refCount++;
12268 }
12269 else
12270 {
12271 if(exp->op.exp2->destType)
12272 FreeType(exp->op.exp2->destType);
12273 exp->op.exp2->destType = dummy;
12274 dummy->refCount++;
12275 }
12276 if(type1 && boolResult && useSideType && type1->kind == 8 && type1->_class && type1->_class->registered && (type1->_class->registered->type == 2 || type1->_class->registered->type == 4))
12277 {
12278 FreeType(exp->op.exp2->destType);
12279 exp->op.exp2->destType = type1;
12280 type1->refCount++;
12281 }
12282 if(exp->op.exp2->destType && exp->op.op != '=')
12283 exp->op.exp2->destType->count++;
12284 ProcessExpressionType(exp->op.exp2);
12285 if(exp->op.exp2->destType && exp->op.op != '=')
12286 exp->op.exp2->destType->count--;
12287 if(assign && type1 && type1->kind == 13 && exp->op.exp2->expType)
12288 {
12289 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)
12290 {
12291 if(exp->op.op != '=' && type1->type->kind == 0)
12292 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "void *: unknown size\n", (((void *)0))));
12293 }
12294 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)))
12295 {
12296 if(exp->op.op == ADD_ASSIGN)
12297 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "cannot add two pointers\n", (((void *)0))));
12298 }
12299 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))
12300 {
12301 if(exp->op.op == ADD_ASSIGN)
12302 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "cannot add two pointers\n", (((void *)0))));
12303 }
12304 else if(inCompiler)
12305 {
12306 char type1String[1024];
12307 char type2String[1024];
12308
12309 type1String[0] = '\0';
12310 type2String[0] = '\0';
12311 PrintType(exp->op.exp2->expType, type1String, 0x0, 0x1);
12312 PrintType(type1, type2String, 0x0, 0x1);
12313 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
12314 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible expression %s (%s); expected %s\n", (((void *)0))), expString, type1String, type2String);
12315 }
12316 }
12317 if(exp->op.exp2->destType == dummy)
12318 {
12319 FreeType(dummy);
12320 exp->op.exp2->destType = (((void *)0));
12321 }
12322 type2 = exp->op.exp2->expType;
12323 }
12324 dummy->kind = 0;
12325 if(exp->op.op == SIZEOF)
12326 {
12327 exp->expType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1)->kind = 3, ((struct Type *)__ecereTemp1));
12328 exp->isConstant = 0x1;
12329 }
12330 else if(exp->op.op == '*' && !exp->op.exp1)
12331 {
12332 exp->expType = Dereference(type2);
12333 if(type2 && type2->kind == 8)
12334 notByReference = 0x1;
12335 }
12336 else if(exp->op.op == '&' && !exp->op.exp1)
12337 exp->expType = Reference(type2);
12338 else if(!assign)
12339 {
12340 if(boolOps)
12341 {
12342 if(exp->op.exp1)
12343 {
12344 if(exp->op.exp1->destType)
12345 FreeType(exp->op.exp1->destType);
12346 exp->op.exp1->destType = MkClassType("bool");
12347 exp->op.exp1->destType->truth = 0x1;
12348 if(!exp->op.exp1->expType)
12349 ProcessExpressionType(exp->op.exp1);
12350 else
12351 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
12352 FreeType(exp->op.exp1->expType);
12353 exp->op.exp1->expType = MkClassType("bool");
12354 exp->op.exp1->expType->truth = 0x1;
12355 }
12356 if(exp->op.exp2)
12357 {
12358 if(exp->op.exp2->destType)
12359 FreeType(exp->op.exp2->destType);
12360 exp->op.exp2->destType = MkClassType("bool");
12361 exp->op.exp2->destType->truth = 0x1;
12362 if(!exp->op.exp2->expType)
12363 ProcessExpressionType(exp->op.exp2);
12364 else
12365 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
12366 FreeType(exp->op.exp2->expType);
12367 exp->op.exp2->expType = MkClassType("bool");
12368 exp->op.exp2->expType->truth = 0x1;
12369 }
12370 }
12371 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")))))
12372 {
12373 if(type1 && type2 && ((type1->kind == 8 && strcmp(type1->_class->string, "String")) == (type2->kind == 8 && strcmp(type2->_class->string, "String"))))
12374 {
12375 if(exp->op.exp2->destType)
12376 FreeType(exp->op.exp2->destType);
12377 exp->op.exp2->destType = type1;
12378 type1->refCount++;
12379 if(exp->op.exp1->destType)
12380 FreeType(exp->op.exp1->destType);
12381 exp->op.exp1->destType = type2;
12382 type2->refCount++;
12383 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)
12384 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);
12385 if(type1->kind == 13 && type1->type->kind == 20 && type2->kind != 13)
12386 {
12387 struct Expression * argExp = GetTemplateArgExp(type1->type->templateParameter, thisClass, 0x1);
12388
12389 if(argExp)
12390 {
12391 struct Expression * classExp = MkExpMember(argExp, MkIdentifier("dataTypeClass"));
12392
12393 exp->op.exp1 = MkExpBrackets(MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName("byte")), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), exp->op.exp1)));
12394 ProcessExpressionType(exp->op.exp1);
12395 if(type2->kind != 13)
12396 {
12397 ProcessExpressionType(classExp);
12398 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"))))))));
12399 if(!exp->op.exp2->expType)
12400 type2 = exp->op.exp2->expType = ProcessTypeString("int", 0x0);
12401 ProcessExpressionType(exp->op.exp2);
12402 }
12403 }
12404 }
12405 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)))
12406 {
12407 if(type1->kind != 8 && type1->type->kind == 0)
12408 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "void *: unknown size\n", (((void *)0))));
12409 exp->expType = type1;
12410 if(type1)
12411 type1->refCount++;
12412 }
12413 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)))
12414 {
12415 if(type2->kind != 8 && type2->type->kind == 0)
12416 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "void *: unknown size\n", (((void *)0))));
12417 exp->expType = type2;
12418 if(type2)
12419 type2->refCount++;
12420 }
12421 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))
12422 {
12423 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "different levels of indirection\n", (((void *)0))));
12424 }
12425 else
12426 {
12427 unsigned int success = 0x0;
12428
12429 if(type1->kind == 13 && type2->kind == 13)
12430 {
12431 if(exp->op.op == '+')
12432 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "cannot add two pointers\n", (((void *)0))));
12433 else if(exp->op.op == '-')
12434 {
12435 if(MatchTypes(type1->type, type2->type, (((void *)0)), (((void *)0)), (((void *)0)), 0x0, 0x0, 0x0, 0x0))
12436 {
12437 exp->expType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->kind = 3, ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1));
12438 success = 0x1;
12439 if(type1->type->kind == 20)
12440 {
12441 struct Expression * argExp = GetTemplateArgExp(type1->type->templateParameter, thisClass, 0x1);
12442
12443 if(argExp)
12444 {
12445 struct Expression * classExp = MkExpMember(argExp, MkIdentifier("dataTypeClass"));
12446
12447 ProcessExpressionType(classExp);
12448 exp->type = 5;
12449 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")))))));
12450 ProcessExpressionType(((struct Expression *)(*exp->list).first)->op.exp2);
12451 FreeType(dummy);
12452 return ;
12453 }
12454 }
12455 }
12456 }
12457 }
12458 if(!success && exp->op.exp1->type == 2)
12459 {
12460 if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
12461 {
12462 if(exp->expType)
12463 FreeType(exp->expType);
12464 exp->expType = exp->op.exp1->destType;
12465 if(exp->op.exp1->destType)
12466 exp->op.exp1->destType->refCount++;
12467 success = 0x1;
12468 }
12469 else if(CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0))
12470 {
12471 if(exp->expType)
12472 FreeType(exp->expType);
12473 exp->expType = exp->op.exp2->destType;
12474 if(exp->op.exp2->destType)
12475 exp->op.exp2->destType->refCount++;
12476 success = 0x1;
12477 }
12478 }
12479 else if(!success)
12480 {
12481 if(CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0))
12482 {
12483 if(exp->expType)
12484 FreeType(exp->expType);
12485 exp->expType = exp->op.exp2->destType;
12486 if(exp->op.exp2->destType)
12487 exp->op.exp2->destType->refCount++;
12488 success = 0x1;
12489 }
12490 else if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
12491 {
12492 if(exp->expType)
12493 FreeType(exp->expType);
12494 exp->expType = exp->op.exp1->destType;
12495 if(exp->op.exp1->destType)
12496 exp->op.exp1->destType->refCount++;
12497 success = 0x1;
12498 }
12499 }
12500 if(!success)
12501 {
12502 char expString1[10240];
12503 char expString2[10240];
12504 char type1[1024];
12505 char type2[1024];
12506
12507 expString1[0] = '\0';
12508 expString2[0] = '\0';
12509 type1[0] = '\0';
12510 type2[0] = '\0';
12511 if(inCompiler)
12512 {
12513 PrintExpression(exp->op.exp1, expString1);
12514 __ecereNameSpace__ecere__sys__ChangeCh(expString1, '\n', ' ');
12515 PrintExpression(exp->op.exp2, expString2);
12516 __ecereNameSpace__ecere__sys__ChangeCh(expString2, '\n', ' ');
12517 PrintType(exp->op.exp1->expType, type1, 0x0, 0x1);
12518 PrintType(exp->op.exp2->expType, type2, 0x0, 0x1);
12519 }
12520 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible expressions %s (%s) and %s (%s)\n", (((void *)0))), expString1, type1, expString2, type2);
12521 }
12522 }
12523 }
12524 else if(!boolResult && (!useSideUnit) && type2 && type1 && type2->kind == 8 && type1->kind != 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 3)
12525 {
12526 if(exp->op.exp1->destType)
12527 FreeType(exp->op.exp1->destType);
12528 exp->op.exp1->destType = type2->_class->registered->dataType;
12529 if(type2->_class->registered->dataType)
12530 type2->_class->registered->dataType->refCount++;
12531 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
12532 exp->expType = type2;
12533 if(type2)
12534 type2->refCount++;
12535 }
12536 else if(!boolResult && (!useSideUnit) && type1 && type2 && type1->kind == 8 && type2->kind != 8 && type1->_class && type1->_class->registered && type1->_class->registered->type == 3)
12537 {
12538 if(exp->op.exp2->destType)
12539 FreeType(exp->op.exp2->destType);
12540 exp->op.exp2->destType = type1->_class->registered->dataType;
12541 if(type1->_class->registered->dataType)
12542 type1->_class->registered->dataType->refCount++;
12543 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
12544 exp->expType = type1;
12545 if(type1)
12546 type1->refCount++;
12547 }
12548 else if(type1)
12549 {
12550 unsigned int valid = 0x0;
12551
12552 if(!boolResult && useSideUnit && type1 && type1->kind == 8 && type1->_class->registered && type1->_class->registered->type == 3 && type2 && type2->kind != 8)
12553 {
12554 if(exp->op.exp2->destType)
12555 FreeType(exp->op.exp2->destType);
12556 if(!type1->_class->registered->dataType)
12557 type1->_class->registered->dataType = ProcessTypeString(type1->_class->registered->dataTypeString, 0x0);
12558 exp->op.exp2->destType = type1->_class->registered->dataType;
12559 exp->op.exp2->destType->refCount++;
12560 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
12561 type2 = exp->op.exp2->destType;
12562 exp->expType = type2;
12563 type2->refCount++;
12564 }
12565 if(!boolResult && useSideUnit && type2 && type2->kind == 8 && type2->_class->registered && type2->_class->registered->type == 3 && type1 && type1->kind != 8)
12566 {
12567 if(exp->op.exp1->destType)
12568 FreeType(exp->op.exp1->destType);
12569 if(!type2->_class->registered->dataType)
12570 type2->_class->registered->dataType = ProcessTypeString(type2->_class->registered->dataTypeString, 0x0);
12571 exp->op.exp1->destType = type2->_class->registered->dataType;
12572 exp->op.exp1->destType->refCount++;
12573 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
12574 type1 = exp->op.exp1->destType;
12575 exp->expType = type1;
12576 type1->refCount++;
12577 }
12578 if(!boolResult || exp->op.op == '>' || exp->op.op == '<')
12579 {
12580 if(type1->kind == 8 && type1->_class && type1->_class->registered && type1->_class->registered->type == 4 && exp->op.exp2->expType)
12581 {
12582 if(CheckExpressionType(exp->op.exp1, exp->op.exp2->expType, 0x0))
12583 {
12584 if(exp->expType)
12585 FreeType(exp->expType);
12586 exp->expType = exp->op.exp1->expType;
12587 if(exp->op.exp2->expType)
12588 exp->op.exp1->expType->refCount++;
12589 valid = 0x1;
12590 }
12591 }
12592 else if(type2 && (type2->kind == 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 4 && exp->op.exp1->expType))
12593 {
12594 if(CheckExpressionType(exp->op.exp2, exp->op.exp1->expType, 0x0))
12595 {
12596 if(exp->expType)
12597 FreeType(exp->expType);
12598 exp->expType = exp->op.exp2->expType;
12599 if(exp->op.exp2->expType)
12600 exp->op.exp2->expType->refCount++;
12601 valid = 0x1;
12602 }
12603 }
12604 }
12605 if(!valid)
12606 {
12607 if(exp->op.exp2->destType)
12608 FreeType(exp->op.exp2->destType);
12609 exp->op.exp2->destType = type1;
12610 type1->refCount++;
12611 if(CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0))
12612 {
12613 if(exp->expType)
12614 FreeType(exp->expType);
12615 exp->expType = exp->op.exp2->destType;
12616 if(exp->op.exp2->destType)
12617 exp->op.exp2->destType->refCount++;
12618 }
12619 else if(type1 && type2)
12620 {
12621 char expString1[10240];
12622 char expString2[10240];
12623 char type1String[1024];
12624 char type2String[1024];
12625
12626 expString1[0] = '\0';
12627 expString2[0] = '\0';
12628 type1String[0] = '\0';
12629 type2String[0] = '\0';
12630 if(inCompiler)
12631 {
12632 PrintExpression(exp->op.exp1, expString1);
12633 __ecereNameSpace__ecere__sys__ChangeCh(expString1, '\n', ' ');
12634 PrintExpression(exp->op.exp2, expString2);
12635 __ecereNameSpace__ecere__sys__ChangeCh(expString2, '\n', ' ');
12636 PrintType(exp->op.exp1->expType, type1String, 0x0, 0x1);
12637 PrintType(exp->op.exp2->expType, type2String, 0x0, 0x1);
12638 }
12639 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible expressions %s (%s) and %s (%s)\n", (((void *)0))), expString1, type1String, expString2, type2String);
12640 if(type1->kind == 8 && type1->_class && type1->_class->registered && type1->_class->registered->type == 4)
12641 {
12642 exp->expType = exp->op.exp1->expType;
12643 if(exp->op.exp1->expType)
12644 exp->op.exp1->expType->refCount++;
12645 }
12646 else if(type2->kind == 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 4)
12647 {
12648 exp->expType = exp->op.exp2->expType;
12649 if(exp->op.exp2->expType)
12650 exp->op.exp2->expType->refCount++;
12651 }
12652 }
12653 }
12654 }
12655 else if(type2)
12656 {
12657 if(type2->kind == 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 4)
12658 {
12659 struct Type * oldType = exp->op.exp1->expType;
12660
12661 exp->op.exp1->expType = (((void *)0));
12662 if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
12663 FreeType(oldType);
12664 else
12665 exp->op.exp1->expType = oldType;
12666 }
12667 if(exp->op.exp1->destType)
12668 FreeType(exp->op.exp1->destType);
12669 exp->op.exp1->destType = type2;
12670 type2->refCount++;
12671 if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
12672 {
12673 if(exp->expType)
12674 FreeType(exp->expType);
12675 exp->expType = exp->op.exp1->destType;
12676 if(exp->op.exp1->destType)
12677 exp->op.exp1->destType->refCount++;
12678 }
12679 }
12680 }
12681 else if(type2 && (!type1 || (type2->kind == 8 && type1->kind != 8)))
12682 {
12683 if(type1 && type2->_class && type2->_class->registered && type2->_class->registered->type == 3)
12684 {
12685 if(exp->op.exp1->destType)
12686 FreeType(exp->op.exp1->destType);
12687 exp->op.exp1->destType = type2->_class->registered->dataType;
12688 if(type2->_class->registered->dataType)
12689 type2->_class->registered->dataType->refCount++;
12690 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
12691 }
12692 if(exp->op.op == '!')
12693 {
12694 exp->expType = MkClassType("bool");
12695 exp->expType->truth = 0x1;
12696 }
12697 else
12698 {
12699 exp->expType = type2;
12700 if(type2)
12701 type2->refCount++;
12702 }
12703 }
12704 else if(type1 && (!type2 || (type1->kind == 8 && type2->kind != 8)))
12705 {
12706 if(type2 && type1->_class && type1->_class->registered && type1->_class->registered->type == 3)
12707 {
12708 if(exp->op.exp2->destType)
12709 FreeType(exp->op.exp2->destType);
12710 exp->op.exp2->destType = type1->_class->registered->dataType;
12711 if(type1->_class->registered->dataType)
12712 type1->_class->registered->dataType->refCount++;
12713 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
12714 }
12715 exp->expType = type1;
12716 if(type1)
12717 type1->refCount++;
12718 }
12719 }
12720 yylloc = exp->loc;
12721 if(exp->op.exp1 && !exp->op.exp1->expType)
12722 {
12723 char expString[10000];
12724
12725 expString[0] = '\0';
12726 if(inCompiler)
12727 {
12728 PrintExpression(exp->op.exp1, expString);
12729 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
12730 }
12731 if(expString[0])
12732 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't determine type of %s\n", (((void *)0))), expString);
12733 }
12734 if(exp->op.exp2 && !exp->op.exp2->expType)
12735 {
12736 char expString[10240];
12737
12738 expString[0] = '\0';
12739 if(inCompiler)
12740 {
12741 PrintExpression(exp->op.exp2, expString);
12742 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
12743 }
12744 if(expString[0])
12745 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't determine type of %s\n", (((void *)0))), expString);
12746 }
12747 if(boolResult)
12748 {
12749 FreeType(exp->expType);
12750 exp->expType = MkClassType("bool");
12751 exp->expType->truth = 0x1;
12752 }
12753 if(exp->op.op != SIZEOF)
12754 exp->isConstant = (!exp->op.exp1 || exp->op.exp1->isConstant) && (!exp->op.exp2 || exp->op.exp2->isConstant);
12755 if(exp->op.op == SIZEOF && exp->op.exp2->expType)
12756 {
12757 DeclareType(exp->op.exp2->expType, 0x0, 0x0);
12758 }
12759 yylloc = oldyylloc;
12760 FreeType(dummy);
12761 break;
12762 }
12763 case 5:
12764 case 34:
12765 {
12766 struct Expression * e;
12767
12768 exp->isConstant = 0x1;
12769 for(e = (*exp->list).first; e; e = e->next)
12770 {
12771 unsigned int inced = 0x0;
12772
12773 if(!e->next)
12774 {
12775 FreeType(e->destType);
12776 e->destType = exp->destType;
12777 if(e->destType)
12778 {
12779 exp->destType->refCount++;
12780 e->destType->count++;
12781 inced = 0x1;
12782 }
12783 }
12784 ProcessExpressionType(e);
12785 if(inced)
12786 exp->destType->count--;
12787 if(!exp->expType && !e->next)
12788 {
12789 exp->expType = e->expType;
12790 if(e->expType)
12791 e->expType->refCount++;
12792 }
12793 if(!e->isConstant)
12794 exp->isConstant = 0x0;
12795 }
12796 e = (*exp->list).first;
12797 if(!e->next && e->type == 8)
12798 {
12799 struct Expression * next = exp->next, * prev = exp->prev;
12800
12801 FreeType(exp->expType);
12802 FreeType(exp->destType);
12803 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->list), exp->list = 0);
12804 *exp = *e;
12805 exp->prev = prev;
12806 exp->next = next;
12807 ((e ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(e) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(e)) : 0), e = 0);
12808 ProcessExpressionType(exp);
12809 }
12810 break;
12811 }
12812 case 6:
12813 {
12814 struct Expression * e;
12815
12816 exp->isConstant = 0x1;
12817 ProcessExpressionType(exp->index.exp);
12818 if(!exp->index.exp->isConstant)
12819 exp->isConstant = 0x0;
12820 if(exp->index.exp->expType)
12821 {
12822 struct Type * source = exp->index.exp->expType;
12823
12824 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)
12825 {
12826 struct __ecereNameSpace__ecere__com__Class * _class = source->_class->registered;
12827
12828 exp->expType = ProcessTypeString(_class->templateArgs[2].dataTypeString, 0x0);
12829 if(exp->index.index && (*exp->index.index).last)
12830 {
12831 ((struct Expression *)(*exp->index.index).last)->destType = ProcessTypeString(_class->templateArgs[1].dataTypeString, 0x0);
12832 }
12833 }
12834 }
12835 for(e = (*exp->index.index).first; e; e = e->next)
12836 {
12837 if(!e->next && exp->index.exp->expType && exp->index.exp->expType->kind == 12 && exp->index.exp->expType->enumClass)
12838 {
12839 if(e->destType)
12840 FreeType(e->destType);
12841 e->destType = MkClassType(exp->index.exp->expType->enumClass->string);
12842 }
12843 ProcessExpressionType(e);
12844 if(!e->next)
12845 {
12846 }
12847 if(!e->isConstant)
12848 exp->isConstant = 0x0;
12849 }
12850 if(!exp->expType)
12851 exp->expType = Dereference(exp->index.exp->expType);
12852 if(exp->expType)
12853 DeclareType(exp->expType, 0x0, 0x0);
12854 break;
12855 }
12856 case 7:
12857 {
12858 struct Expression * e;
12859 struct Type * functionType;
12860 struct Type * methodType = (((void *)0));
12861 char name[1024];
12862
12863 name[0] = '\0';
12864 if(inCompiler)
12865 {
12866 PrintExpression(exp->call.exp, name);
12867 if(exp->call.exp->expType && !exp->call.exp->expType->returnType)
12868 {
12869 PrintExpression(exp->call.exp, name);
12870 }
12871 }
12872 if(exp->call.exp->type == 0)
12873 {
12874 struct Expression * idExp = exp->call.exp;
12875 struct Identifier * id = idExp->identifier;
12876
12877 if(!strcmp(id->string, "__ENDIAN_PAD"))
12878 {
12879 exp->expType = ProcessTypeString("int", 0x1);
12880 if(exp->call.arguments && (*exp->call.arguments).first)
12881 ProcessExpressionType((*exp->call.arguments).first);
12882 break;
12883 }
12884 else if(!strcmp(id->string, "Max") || !strcmp(id->string, "Min") || !strcmp(id->string, "Sgn") || !strcmp(id->string, "Abs"))
12885 {
12886 struct Expression * a = (((void *)0));
12887 struct Expression * b = (((void *)0));
12888 struct Expression * tempExp1 = (((void *)0)), * tempExp2 = (((void *)0));
12889
12890 if((!strcmp(id->string, "Max") || !strcmp(id->string, "Min")) && (*exp->call.arguments).count == 2)
12891 {
12892 a = (*exp->call.arguments).first;
12893 b = (*exp->call.arguments).last;
12894 tempExp1 = a;
12895 tempExp2 = b;
12896 }
12897 else if((*exp->call.arguments).count == 1)
12898 {
12899 a = (*exp->call.arguments).first;
12900 tempExp1 = a;
12901 }
12902 if(a)
12903 {
12904 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear((&*exp->call.arguments));
12905 idExp->identifier = (((void *)0));
12906 FreeExpContents(exp);
12907 ProcessExpressionType(a);
12908 if(b)
12909 ProcessExpressionType(b);
12910 exp->type = 5;
12911 exp->list = MkList();
12912 if(a->expType && (!b || b->expType))
12913 {
12914 if((!a->isConstant && a->type != 0) || (b && !b->isConstant && b->type != 0))
12915 {
12916 if(inCompiler)
12917 {
12918 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
12919 struct __ecereNameSpace__ecere__sys__OldList * decls = MkList();
12920 struct Declaration * decl;
12921 char temp1[1024], temp2[1024];
12922
12923 GetTypeSpecs(a->expType, specs);
12924 if(a && !a->isConstant && a->type != 0)
12925 {
12926 sprintf(temp1, "__simpleStruct%d", curContext->simpleID++);
12927 ListAdd(decls, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(temp1)), (((void *)0))));
12928 tempExp1 = QMkExpId(temp1);
12929 tempExp1->expType = a->expType;
12930 if(a->expType)
12931 a->expType->refCount++;
12932 ListAdd(exp->list, MkExpOp(CopyExpression(tempExp1), '=', a));
12933 }
12934 if(b && !b->isConstant && b->type != 0)
12935 {
12936 sprintf(temp2, "__simpleStruct%d", curContext->simpleID++);
12937 ListAdd(decls, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(temp2)), (((void *)0))));
12938 tempExp2 = QMkExpId(temp2);
12939 tempExp2->expType = b->expType;
12940 if(b->expType)
12941 b->expType->refCount++;
12942 ListAdd(exp->list, MkExpOp(CopyExpression(tempExp2), '=', b));
12943 }
12944 decl = MkDeclaration(specs, decls);
12945 if(!curCompound->compound.declarations)
12946 curCompound->compound.declarations = MkList();
12947 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*curCompound->compound.declarations), (((void *)0)), decl);
12948 }
12949 }
12950 }
12951 if(!strcmp(id->string, "Max") || !strcmp(id->string, "Min"))
12952 {
12953 int op = (!strcmp(id->string, "Max")) ? '>' : '<';
12954
12955 ListAdd(exp->list, MkExpCondition(MkExpBrackets(MkListOne(MkExpOp(CopyExpression(tempExp1), op, CopyExpression(tempExp2)))), MkListOne(CopyExpression(tempExp1)), CopyExpression(tempExp2)));
12956 exp->expType = a->expType;
12957 if(a->expType)
12958 a->expType->refCount++;
12959 }
12960 else if(!strcmp(id->string, "Abs"))
12961 {
12962 ListAdd(exp->list, MkExpCondition(MkExpBrackets(MkListOne(MkExpOp(CopyExpression(tempExp1), '<', MkExpConstant("0")))), MkListOne(MkExpOp((((void *)0)), '-', CopyExpression(tempExp1))), CopyExpression(tempExp1)));
12963 exp->expType = a->expType;
12964 if(a->expType)
12965 a->expType->refCount++;
12966 }
12967 else if(!strcmp(id->string, "Sgn"))
12968 {
12969 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"))))));
12970 exp->expType = ProcessTypeString("int", 0x0);
12971 }
12972 FreeExpression(tempExp1);
12973 if(tempExp2)
12974 FreeExpression(tempExp2);
12975 FreeIdentifier(id);
12976 break;
12977 }
12978 }
12979 }
12980 {
12981 struct Type * dummy = (dummy = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), dummy->count = (unsigned int)1, dummy->refCount = 1, dummy);
12982
12983 if(!exp->call.exp->destType)
12984 {
12985 exp->call.exp->destType = dummy;
12986 dummy->refCount++;
12987 }
12988 ProcessExpressionType(exp->call.exp);
12989 if(exp->call.exp->destType == dummy)
12990 {
12991 FreeType(dummy);
12992 exp->call.exp->destType = (((void *)0));
12993 }
12994 FreeType(dummy);
12995 }
12996 functionType = exp->call.exp->expType;
12997 if(functionType && functionType->kind == 16)
12998 {
12999 methodType = functionType;
13000 functionType = methodType->method->dataType;
13001 if(exp->call.exp->expType->usedClass)
13002 {
13003 char typeString[1024];
13004
13005 typeString[0] = '\0';
13006 PrintType(functionType, typeString, 0x1, 0x1);
13007 if(strstr(typeString, "thisclass"))
13008 {
13009 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13010 struct Declarator * decl;
13011
13012 {
13013 struct Context * context = SetupTemplatesContext(exp->call.exp->expType->usedClass);
13014
13015 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
13016 if(thisClass != (exp->call.exp->expType->usedClass->templateClass ? exp->call.exp->expType->usedClass->templateClass : exp->call.exp->expType->usedClass))
13017 thisClassParams = 0x0;
13018 ReplaceThisClassSpecifiers(specs, exp->call.exp->expType->usedClass);
13019 {
13020 struct __ecereNameSpace__ecere__com__Class * backupThisClass = thisClass;
13021
13022 thisClass = exp->call.exp->expType->usedClass;
13023 ProcessDeclarator(decl);
13024 thisClass = backupThisClass;
13025 }
13026 thisClassParams = 0x1;
13027 functionType = ProcessType(specs, decl);
13028 functionType->refCount = 0;
13029 FinishTemplatesContext(context);
13030 }
13031 FreeList(specs, FreeSpecifier);
13032 FreeDeclarator(decl);
13033 }
13034 }
13035 }
13036 if(functionType && functionType->kind == 13 && functionType->type && functionType->type->kind == 11)
13037 {
13038 struct Type * type = functionType->type;
13039
13040 if(!functionType->refCount)
13041 {
13042 functionType->type = (((void *)0));
13043 FreeType(functionType);
13044 }
13045 functionType = type;
13046 }
13047 if(functionType && functionType->kind != 11)
13048 {
13049 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "called object %s is not a function\n", (((void *)0))), name);
13050 }
13051 else if(functionType)
13052 {
13053 unsigned int emptyParams = 0x0, noParams = 0x0;
13054 struct Expression * e = exp->call.arguments ? (*exp->call.arguments).first : (((void *)0));
13055 struct Type * type = functionType->params.first;
13056 struct Expression * memberExp = (exp->call.exp->type == 8) ? exp->call.exp : (((void *)0));
13057 int extra = 0;
13058 struct Location oldyylloc = yylloc;
13059
13060 if(!type)
13061 emptyParams = 0x1;
13062 if(functionType->extraParam && e)
13063 {
13064 e->destType = MkClassType(functionType->thisClass->string);
13065 e = e->next;
13066 }
13067 if(!functionType->staticMethod)
13068 {
13069 if(memberExp && memberExp->member.exp && memberExp->member.exp->expType && memberExp->member.exp->expType->kind == 19 && memberExp->member.exp->expType->_class)
13070 {
13071 type = MkClassType(memberExp->member.exp->expType->_class->string);
13072 if(e)
13073 {
13074 e->destType = type;
13075 e = e->next;
13076 type = functionType->params.first;
13077 }
13078 else
13079 type->refCount = 0;
13080 }
13081 else if(!memberExp && (functionType->thisClass || (methodType && methodType->methodClass)))
13082 {
13083 type = MkClassType(functionType->thisClass ? functionType->thisClass->string : (methodType ? methodType->methodClass->fullName : (((void *)0))));
13084 if(e)
13085 {
13086 e->destType = type;
13087 e = e->next;
13088 type = functionType->params.first;
13089 }
13090 else
13091 type->refCount = 0;
13092 }
13093 }
13094 if(type && type->kind == 0)
13095 {
13096 noParams = 0x1;
13097 if(!type->refCount)
13098 FreeType(type);
13099 type = (((void *)0));
13100 }
13101 for(; e; e = e->next)
13102 {
13103 if(!type && !emptyParams)
13104 {
13105 yylloc = e->loc;
13106 if(methodType && methodType->methodClass)
13107 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);
13108 else
13109 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);
13110 break;
13111 }
13112 if(methodType && type && type->kind == 20 && type->templateParameter->type == 0)
13113 {
13114 struct Type * templatedType = (((void *)0));
13115 struct __ecereNameSpace__ecere__com__Class * _class = methodType->usedClass;
13116 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
13117 int id = 0;
13118
13119 if(_class && _class->templateArgs)
13120 {
13121 struct __ecereNameSpace__ecere__com__Class * sClass;
13122
13123 for(sClass = _class; sClass; sClass = sClass->base)
13124 {
13125 if(sClass->templateClass)
13126 sClass = sClass->templateClass;
13127 id = 0;
13128 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
13129 {
13130 if(curParam->type == 0 && !strcmp(type->templateParameter->identifier->string, curParam->name))
13131 {
13132 struct __ecereNameSpace__ecere__com__Class * nextClass;
13133
13134 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
13135 {
13136 if(nextClass->templateClass)
13137 nextClass = nextClass->templateClass;
13138 id += nextClass->templateParams.count;
13139 }
13140 break;
13141 }
13142 id++;
13143 }
13144 if(curParam)
13145 break;
13146 }
13147 }
13148 if(curParam && _class->templateArgs[id].dataTypeString)
13149 {
13150 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = _class->templateArgs[id];
13151
13152 {
13153 struct Context * context = SetupTemplatesContext(_class);
13154
13155 templatedType = ProcessTypeString(arg.dataTypeString, 0x0);
13156 FinishTemplatesContext(context);
13157 }
13158 e->destType = templatedType;
13159 if(templatedType)
13160 {
13161 templatedType->passAsTemplate = 0x1;
13162 }
13163 }
13164 else
13165 {
13166 e->destType = type;
13167 if(type)
13168 type->refCount++;
13169 }
13170 }
13171 else
13172 {
13173 e->destType = type;
13174 if(type)
13175 type->refCount++;
13176 }
13177 if(type && type->kind != 14)
13178 {
13179 struct Type * next = type->next;
13180
13181 if(!type->refCount)
13182 FreeType(type);
13183 type = next;
13184 }
13185 }
13186 if(type && type->kind != 14)
13187 {
13188 if(methodType && methodType->methodClass)
13189 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);
13190 else
13191 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);
13192 }
13193 yylloc = oldyylloc;
13194 if(type && !type->refCount)
13195 FreeType(type);
13196 }
13197 else
13198 {
13199 functionType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->refCount = 0, ((struct Type *)__ecereTemp1)->kind = 11, ((struct Type *)__ecereTemp1));
13200 if(exp->call.exp->type == 0)
13201 {
13202 char * string = exp->call.exp->identifier->string;
13203
13204 if(inCompiler)
13205 {
13206 struct Symbol * symbol;
13207 struct Location oldyylloc = yylloc;
13208
13209 yylloc = exp->call.exp->identifier->loc;
13210 if(strstr(string, "__builtin_") == string)
13211 ;
13212 else
13213 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "%s undefined; assuming extern returning int\n", (((void *)0))), string);
13214 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));
13215 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)symbol);
13216 if(strstr(symbol->string, "::"))
13217 globalContext->hasNameSpace = 0x1;
13218 yylloc = oldyylloc;
13219 }
13220 }
13221 else if(exp->call.exp->type == 8)
13222 {
13223 }
13224 else
13225 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "callable object undefined; extern assuming returning int\n", (((void *)0))));
13226 if(!functionType->returnType)
13227 {
13228 functionType->returnType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1)->kind = 3, ((struct Type *)__ecereTemp1));
13229 }
13230 }
13231 if(functionType && functionType->kind == 11)
13232 {
13233 exp->expType = functionType->returnType;
13234 if(functionType->returnType)
13235 functionType->returnType->refCount++;
13236 if(!functionType->refCount)
13237 FreeType(functionType);
13238 }
13239 if(exp->call.arguments)
13240 {
13241 for(e = (*exp->call.arguments).first; e; e = e->next)
13242 {
13243 struct Type * destType = e->destType;
13244
13245 ProcessExpressionType(e);
13246 }
13247 }
13248 break;
13249 }
13250 case 8:
13251 {
13252 struct Type * type;
13253 struct Location oldyylloc = yylloc;
13254 unsigned int thisPtr = (exp->member.exp && exp->member.exp->type == 0 && !strcmp(exp->member.exp->identifier->string, "this"));
13255
13256 exp->thisPtr = thisPtr;
13257 if(exp->member.member && exp->member.member->_class && exp->member.member->_class->name)
13258 {
13259 exp->member.member->classSym = exp->member.member->_class->symbol;
13260 }
13261 ProcessExpressionType(exp->member.exp);
13262 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)
13263 {
13264 exp->isConstant = 0x0;
13265 }
13266 else
13267 exp->isConstant = exp->member.exp->isConstant;
13268 type = exp->member.exp->expType;
13269 yylloc = exp->loc;
13270 if(type && (type->kind == 20))
13271 {
13272 struct __ecereNameSpace__ecere__com__Class * _class = thisClass ? thisClass : currentClass;
13273 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param = (((void *)0));
13274
13275 if(_class)
13276 {
13277 for(param = _class->templateParams.first; param; param = param->next)
13278 {
13279 if(param->type == 1 && exp->member.member && exp->member.member->string && !strcmp(param->name, exp->member.member->string))
13280 break;
13281 }
13282 }
13283 if(param && param->defaultArg.member)
13284 {
13285 struct Expression * argExp = GetTemplateArgExpByName(param->name, thisClass, 1);
13286
13287 if(argExp)
13288 {
13289 struct Expression * expMember = exp->member.exp;
13290 struct Declarator * decl;
13291 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13292 char thisClassTypeString[1024];
13293
13294 FreeIdentifier(exp->member.member);
13295 ProcessExpressionType(argExp);
13296 {
13297 char * colon = strstr(param->defaultArg.memberString, "::");
13298
13299 if(colon)
13300 {
13301 char className[1024];
13302 struct __ecereNameSpace__ecere__com__Class * sClass;
13303
13304 memcpy(thisClassTypeString, param->defaultArg.memberString, colon - param->defaultArg.memberString);
13305 thisClassTypeString[colon - param->defaultArg.memberString] = '\0';
13306 }
13307 else
13308 strcpy(thisClassTypeString, _class->fullName);
13309 }
13310 decl = SpecDeclFromString(param->defaultArg.member->dataTypeString, specs, (((void *)0)));
13311 exp->expType = ProcessType(specs, decl);
13312 if(exp->expType->kind == 8 && exp->expType->_class && exp->expType->_class->registered && exp->expType->_class->registered->templateClass)
13313 {
13314 struct __ecereNameSpace__ecere__com__Class * expClass = exp->expType->_class->registered;
13315 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
13316 int c;
13317 int paramCount = 0;
13318 int lastParam = -1;
13319 char templateString[1024];
13320 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
13321
13322 sprintf(templateString, "%s<", expClass->templateClass->fullName);
13323 for(cClass = expClass; cClass; cClass = cClass->base)
13324 {
13325 int p = 0;
13326
13327 for(param = cClass->templateParams.first; param; param = param->next)
13328 {
13329 int id = p;
13330 struct __ecereNameSpace__ecere__com__Class * sClass;
13331 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
13332
13333 for(sClass = cClass->base; sClass; sClass = sClass->base)
13334 id += sClass->templateParams.count;
13335 arg = expClass->templateArgs[id];
13336 for(sClass = _class; sClass; sClass = sClass->base)
13337 {
13338 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * cParam;
13339 int p = 0;
13340 struct __ecereNameSpace__ecere__com__Class * nextClass;
13341
13342 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
13343 p += nextClass->templateParams.count;
13344 for(cParam = sClass->templateParams.first; cParam; cParam = cParam->next, p++)
13345 {
13346 if(cParam->type == 0 && arg.dataTypeString && !strcmp(cParam->name, arg.dataTypeString))
13347 {
13348 if(_class->templateArgs && arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
13349 {
13350 arg.dataTypeString = _class->templateArgs[p].dataTypeString;
13351 arg.dataTypeClass = _class->templateArgs[p].dataTypeClass;
13352 break;
13353 }
13354 }
13355 }
13356 }
13357 {
13358 char argument[256];
13359
13360 argument[0] = '\0';
13361 switch(param->type)
13362 {
13363 case 2:
13364 {
13365 char expString[1024];
13366 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13367 struct Declarator * decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
13368 struct Expression * exp;
13369 char * string = PrintHexUInt64(arg.expression.ui64);
13370
13371 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
13372 ProcessExpressionType(exp);
13373 ComputeExpression(exp);
13374 expString[0] = '\0';
13375 PrintExpression(exp, expString);
13376 strcat(argument, expString);
13377 FreeExpression(exp);
13378 break;
13379 }
13380 case 1:
13381 {
13382 strcat(argument, arg.member->name);
13383 break;
13384 }
13385 case 0:
13386 {
13387 if(arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
13388 {
13389 if(!strcmp(arg.dataTypeString, "thisclass"))
13390 strcat(argument, thisClassTypeString);
13391 else
13392 strcat(argument, arg.dataTypeString);
13393 }
13394 break;
13395 }
13396 }
13397 if(argument[0])
13398 {
13399 if(paramCount)
13400 strcat(templateString, ", ");
13401 if(lastParam != p - 1)
13402 {
13403 strcat(templateString, param->name);
13404 strcat(templateString, " = ");
13405 }
13406 strcat(templateString, argument);
13407 paramCount++;
13408 lastParam = p;
13409 }
13410 p++;
13411 }
13412 }
13413 }
13414 {
13415 int len = strlen(templateString);
13416
13417 if(templateString[len - 1] == '>')
13418 templateString[len++] = ' ';
13419 templateString[len++] = '>';
13420 templateString[len++] = '\0';
13421 }
13422 {
13423 struct Context * context = SetupTemplatesContext(_class);
13424
13425 FreeType(exp->expType);
13426 exp->expType = ProcessTypeString(templateString, 0x0);
13427 FinishTemplatesContext(context);
13428 }
13429 }
13430 exp->type = 5;
13431 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")))))))));
13432 }
13433 }
13434 else if(type->templateParameter && type->templateParameter->type == 0 && (type->templateParameter->dataType || type->templateParameter->dataTypeString))
13435 {
13436 type = ProcessTemplateParameterType(type->templateParameter);
13437 }
13438 }
13439 if(type && (type->kind == 20))
13440 ;
13441 else if(type && (type->kind == 8 || type->kind == 19 || type->kind == 3 || type->kind == 15))
13442 {
13443 struct Identifier * id = exp->member.member;
13444 int typeKind = type->kind;
13445 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));
13446
13447 if(typeKind == 19 && exp->member.exp->type == 26)
13448 {
13449 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "ecere::com::Class");
13450 typeKind = 8;
13451 }
13452 if(id && (typeKind == 3 || typeKind == 15))
13453 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "int");
13454 if(_class && id)
13455 {
13456 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
13457 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
13458 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
13459 struct __ecereNameSpace__ecere__com__Property * revConvert = (((void *)0));
13460 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
13461
13462 if(id && id->_class && id->_class->name && !strcmp(id->_class->name, "property"))
13463 exp->member.memberType = 1;
13464 if(id && id->_class && type->_class && !__ecereNameSpace__ecere__com__eClass_IsDerived(type->_class->registered, _class))
13465 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "invalid class specifier %s for object of class %s\n", (((void *)0))), _class->fullName, type->_class->string);
13466 if(typeKind != 19)
13467 {
13468 if((exp->member.memberType == 0 && thisPtr) || exp->member.memberType == 3)
13469 {
13470 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
13471 if(member && member->_class != (_class->templateClass ? _class->templateClass : _class) && exp->member.memberType != 3)
13472 {
13473 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
13474 if(prop)
13475 member = (((void *)0));
13476 }
13477 if(!member && !prop)
13478 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
13479 if((member && member->_class == (_class->templateClass ? _class->templateClass : _class)) || (prop && prop->_class == (_class->templateClass ? _class->templateClass : _class)))
13480 exp->member.thisPtr = 0x1;
13481 }
13482 else
13483 {
13484 if(!id->classSym)
13485 {
13486 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, (((void *)0)));
13487 if(!id->_class || !id->_class->name || strcmp(id->_class->name, "property"))
13488 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, (((void *)0)), (((void *)0)), (((void *)0)));
13489 }
13490 if(!prop && !member)
13491 {
13492 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, (((void *)0)));
13493 if(!method)
13494 {
13495 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
13496 if(!id->_class || !id->_class->name || strcmp(id->_class->name, "property"))
13497 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
13498 }
13499 }
13500 if(member && prop)
13501 {
13502 if(member->_class != prop->_class && !id->_class && __ecereNameSpace__ecere__com__eClass_IsDerived(member->_class, prop->_class))
13503 prop = (((void *)0));
13504 else
13505 member = (((void *)0));
13506 }
13507 }
13508 }
13509 if(!prop && !member)
13510 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule);
13511 if(!prop && !member && !method)
13512 {
13513 if(typeKind == 19)
13514 {
13515 classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(type->_class->registered, exp->member.member->string);
13516 if(classProp)
13517 {
13518 exp->member.memberType = 5;
13519 exp->expType = ProcessTypeString(classProp->dataTypeString, 0x0);
13520 }
13521 else
13522 {
13523 char structName[1024];
13524 struct Identifier * id = exp->member.member;
13525 struct Expression * classExp = exp->member.exp;
13526
13527 type->refCount++;
13528 FreeType(classExp->expType);
13529 classExp->expType = ProcessTypeString("ecere::com::Class", 0x0);
13530 strcpy(structName, "__ecereClassData_");
13531 FullClassNameCat(structName, type->_class->string, 0x0);
13532 exp->type = 9;
13533 exp->member.member = id;
13534 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"))))))));
13535 FreeType(type);
13536 ProcessExpressionType(exp);
13537 return ;
13538 }
13539 }
13540 else
13541 {
13542 struct Symbol * classSym = FindClass(id->string);
13543
13544 if(classSym)
13545 {
13546 struct __ecereNameSpace__ecere__com__Class * convertClass = classSym->registered;
13547
13548 if(convertClass)
13549 revConvert = __ecereNameSpace__ecere__com__eClass_FindProperty(convertClass, _class->fullName, privateModule);
13550 }
13551 }
13552 }
13553 if(prop)
13554 {
13555 exp->member.memberType = 1;
13556 if(!prop->dataType)
13557 ProcessPropertyType(prop);
13558 exp->expType = prop->dataType;
13559 if(prop->dataType)
13560 prop->dataType->refCount++;
13561 }
13562 else if(member)
13563 {
13564 if(exp->member.exp->expType->classObjectType == 2 && !strcmp(exp->member.member->string, "_class"))
13565 {
13566 FreeExpContents(exp);
13567 exp->type = 0;
13568 exp->identifier = MkIdentifier("class");
13569 ProcessExpressionType(exp);
13570 return ;
13571 }
13572 exp->member.memberType = 3;
13573 DeclareStruct(_class->fullName, 0x0);
13574 if(!member->dataType)
13575 {
13576 struct Context * context = SetupTemplatesContext(_class);
13577
13578 member->dataType = ProcessTypeString(member->dataTypeString, 0x0);
13579 FinishTemplatesContext(context);
13580 }
13581 exp->expType = member->dataType;
13582 if(member->dataType)
13583 member->dataType->refCount++;
13584 }
13585 else if(revConvert)
13586 {
13587 exp->member.memberType = 4;
13588 exp->expType = MkClassType(revConvert->_class->fullName);
13589 }
13590 else if(method)
13591 {
13592 if(inCompiler)
13593 {
13594 exp->member.memberType = 2;
13595 }
13596 if(!method->dataType)
13597 ProcessMethodType(method);
13598 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));
13599 exp->expType->methodClass = (id && id->_class) ? _class : (((void *)0));
13600 exp->expType->usedClass = _class;
13601 }
13602 else if(!classProp)
13603 {
13604 if(exp->member.exp->expType->classObjectType == 2 && !strcmp(exp->member.member->string, "_class"))
13605 {
13606 FreeExpContents(exp);
13607 exp->type = 0;
13608 exp->identifier = MkIdentifier("class");
13609 ProcessExpressionType(exp);
13610 return ;
13611 }
13612 yylloc = exp->member.member->loc;
13613 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't find member %s in class %s\n", (((void *)0))), id->string, _class->fullName);
13614 if(inCompiler)
13615 __ecereNameSpace__ecere__com__eClass_AddDataMember(_class, id->string, "int", 0, 0, 1);
13616 }
13617 if(_class && exp->expType)
13618 {
13619 struct __ecereNameSpace__ecere__com__Class * tClass;
13620
13621 tClass = _class;
13622 while(tClass && !tClass->templateClass)
13623 tClass = tClass->base;
13624 if(tClass && exp->expType->kind == 20 && exp->expType->templateParameter->type == 0)
13625 {
13626 int id = 0;
13627 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam;
13628 struct __ecereNameSpace__ecere__com__Class * sClass;
13629
13630 for(sClass = tClass; sClass; sClass = sClass->base)
13631 {
13632 id = 0;
13633 if(sClass->templateClass)
13634 sClass = sClass->templateClass;
13635 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
13636 {
13637 if(curParam->type == 0 && !strcmp(exp->expType->templateParameter->identifier->string, curParam->name))
13638 {
13639 for(sClass = sClass->base; sClass; sClass = sClass->base)
13640 id += sClass->templateParams.count;
13641 break;
13642 }
13643 id++;
13644 }
13645 if(curParam)
13646 break;
13647 }
13648 if(curParam && tClass->templateArgs[id].dataTypeString)
13649 {
13650 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = tClass->templateArgs[id];
13651 struct Context * context = SetupTemplatesContext(tClass);
13652
13653 FreeType(exp->expType);
13654 exp->expType = ProcessTypeString(arg.dataTypeString, 0x0);
13655 if(exp->expType)
13656 {
13657 if(exp->expType->kind == 21)
13658 {
13659 FreeType(exp->expType);
13660 exp->expType = ReplaceThisClassType(_class);
13661 }
13662 if(tClass->templateClass)
13663 exp->expType->passAsTemplate = 0x1;
13664 if(!exp->destType)
13665 {
13666 exp->destType = ProcessTypeString(arg.dataTypeString, 0x0);
13667 if(exp->destType->kind == 21)
13668 {
13669 FreeType(exp->destType);
13670 exp->destType = ReplaceThisClassType(_class);
13671 }
13672 }
13673 }
13674 FinishTemplatesContext(context);
13675 }
13676 }
13677 else if(tClass && exp->expType->kind == 13 && exp->expType->type && exp->expType->type->kind == 20 && exp->expType->type->templateParameter->type == 0)
13678 {
13679 int id = 0;
13680 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam;
13681 struct __ecereNameSpace__ecere__com__Class * sClass;
13682
13683 for(sClass = tClass; sClass; sClass = sClass->base)
13684 {
13685 id = 0;
13686 if(sClass->templateClass)
13687 sClass = sClass->templateClass;
13688 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
13689 {
13690 if(curParam->type == 0 && !strcmp(exp->expType->type->templateParameter->identifier->string, curParam->name))
13691 {
13692 for(sClass = sClass->base; sClass; sClass = sClass->base)
13693 id += sClass->templateParams.count;
13694 break;
13695 }
13696 id++;
13697 }
13698 if(curParam)
13699 break;
13700 }
13701 if(curParam)
13702 {
13703 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = tClass->templateArgs[id];
13704 struct Context * context = SetupTemplatesContext(tClass);
13705 struct Type * basicType;
13706
13707 basicType = ProcessTypeString(arg.dataTypeString, 0x0);
13708 if(basicType)
13709 {
13710 if(basicType->kind == 21)
13711 {
13712 FreeType(basicType);
13713 basicType = ReplaceThisClassType(_class);
13714 }
13715 FreeType(exp->expType);
13716 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));
13717 if(!exp->destType)
13718 {
13719 exp->destType = exp->expType;
13720 exp->destType->refCount++;
13721 }
13722 {
13723 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
13724 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13725 struct Declarator * decl;
13726
13727 decl = SpecDeclFromString(arg.dataTypeString, specs, (((void *)0)));
13728 *newExp = *exp;
13729 if(exp->destType)
13730 exp->destType->refCount++;
13731 if(exp->expType)
13732 exp->expType->refCount++;
13733 exp->type = 11;
13734 exp->cast.typeName = MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl));
13735 exp->cast.exp = newExp;
13736 }
13737 }
13738 FinishTemplatesContext(context);
13739 }
13740 }
13741 else if(tClass && exp->expType->kind == 8 && exp->expType->_class && strchr(exp->expType->_class->string, '<'))
13742 {
13743 struct __ecereNameSpace__ecere__com__Class * expClass = exp->expType->_class->registered;
13744
13745 if(expClass)
13746 {
13747 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
13748 int c;
13749 int p = 0;
13750 int paramCount = 0;
13751 int lastParam = -1;
13752 char templateString[1024];
13753 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
13754
13755 sprintf(templateString, "%s<", expClass->templateClass->fullName);
13756 while(cClass != expClass)
13757 {
13758 struct __ecereNameSpace__ecere__com__Class * sClass;
13759
13760 for(sClass = expClass; sClass && sClass->base != cClass; sClass = sClass->base)
13761 ;
13762 cClass = sClass;
13763 for(param = cClass->templateParams.first; param; param = param->next)
13764 {
13765 struct __ecereNameSpace__ecere__com__Class * cClassCur = (((void *)0));
13766 int c;
13767 int cp = 0;
13768 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * paramCur = (((void *)0));
13769 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
13770
13771 while(cClassCur != tClass && !paramCur)
13772 {
13773 struct __ecereNameSpace__ecere__com__Class * sClassCur;
13774
13775 for(sClassCur = tClass; sClassCur && sClassCur->base != cClassCur; sClassCur = sClassCur->base)
13776 ;
13777 cClassCur = sClassCur;
13778 for(paramCur = cClassCur->templateParams.first; paramCur; paramCur = paramCur->next)
13779 {
13780 if(!strcmp(paramCur->name, param->name))
13781 {
13782 break;
13783 }
13784 cp++;
13785 }
13786 }
13787 if(paramCur && paramCur->type == 0)
13788 arg = tClass->templateArgs[cp];
13789 else
13790 arg = expClass->templateArgs[p];
13791 {
13792 char argument[256];
13793
13794 argument[0] = '\0';
13795 switch(param->type)
13796 {
13797 case 2:
13798 {
13799 char expString[1024];
13800 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13801 struct Declarator * decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
13802 struct Expression * exp;
13803 char * string = PrintHexUInt64(arg.expression.ui64);
13804
13805 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
13806 ProcessExpressionType(exp);
13807 ComputeExpression(exp);
13808 expString[0] = '\0';
13809 PrintExpression(exp, expString);
13810 strcat(argument, expString);
13811 FreeExpression(exp);
13812 break;
13813 }
13814 case 1:
13815 {
13816 strcat(argument, arg.member->name);
13817 break;
13818 }
13819 case 0:
13820 {
13821 if(arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
13822 strcat(argument, arg.dataTypeString);
13823 break;
13824 }
13825 }
13826 if(argument[0])
13827 {
13828 if(paramCount)
13829 strcat(templateString, ", ");
13830 if(lastParam != p - 1)
13831 {
13832 strcat(templateString, param->name);
13833 strcat(templateString, " = ");
13834 }
13835 strcat(templateString, argument);
13836 paramCount++;
13837 lastParam = p;
13838 }
13839 }
13840 p++;
13841 }
13842 }
13843 {
13844 int len = strlen(templateString);
13845
13846 if(templateString[len - 1] == '>')
13847 templateString[len++] = ' ';
13848 templateString[len++] = '>';
13849 templateString[len++] = '\0';
13850 }
13851 FreeType(exp->expType);
13852 {
13853 struct Context * context = SetupTemplatesContext(tClass);
13854
13855 exp->expType = ProcessTypeString(templateString, 0x0);
13856 FinishTemplatesContext(context);
13857 }
13858 }
13859 }
13860 }
13861 }
13862 else
13863 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)");
13864 }
13865 else if(type && (type->kind == 9 || type->kind == 10))
13866 {
13867 struct Type * memberType = exp->member.member ? FindMember(type, exp->member.member->string) : (((void *)0));
13868
13869 if(memberType)
13870 {
13871 exp->expType = memberType;
13872 if(memberType)
13873 memberType->refCount++;
13874 }
13875 }
13876 else
13877 {
13878 char expString[10240];
13879
13880 expString[0] = '\0';
13881 if(inCompiler)
13882 {
13883 PrintExpression(exp, expString);
13884 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
13885 }
13886 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "member operator on non-structure type expression %s\n", (((void *)0))), expString);
13887 }
13888 if(exp->expType && exp->expType->kind == 21 && (!exp->destType || exp->destType->kind != 21))
13889 {
13890 if(type && (type->kind == 8 || type->kind == 19 || type->kind == 3 || type->kind == 15))
13891 {
13892 struct Identifier * id = exp->member.member;
13893 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));
13894
13895 if(_class)
13896 {
13897 FreeType(exp->expType);
13898 exp->expType = ReplaceThisClassType(_class);
13899 }
13900 }
13901 }
13902 yylloc = oldyylloc;
13903 break;
13904 }
13905 case 9:
13906 {
13907 struct Type * destType = exp->destType;
13908
13909 if(exp->member.member && exp->member.member->_class && exp->member.member->_class->name)
13910 {
13911 exp->member.member->classSym = exp->member.member->_class->symbol;
13912 }
13913 exp->member.exp = MkExpBrackets(MkListOne(MkExpOp((((void *)0)), '*', exp->member.exp)));
13914 exp->type = 8;
13915 if(destType)
13916 destType->count++;
13917 ProcessExpressionType(exp);
13918 if(destType)
13919 destType->count--;
13920 break;
13921 }
13922 case 15:
13923 {
13924 struct Symbol * classSym = exp->_class->symbol;
13925
13926 if(classSym && classSym->registered)
13927 {
13928 if(classSym->registered->type == 5)
13929 {
13930 char name[1024];
13931
13932 name[0] = '\0';
13933 DeclareStruct(classSym->string, 0x0);
13934 FreeSpecifier(exp->_class);
13935 exp->type = 10;
13936 FullClassNameCat(name, classSym->string, 0x0);
13937 exp->typeName = MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(name), (((void *)0)))), (((void *)0)));
13938 }
13939 else
13940 {
13941 if(classSym->registered->fixed)
13942 {
13943 FreeSpecifier(exp->_class);
13944 exp->constant = PrintUInt(classSym->registered->templateClass ? classSym->registered->templateClass->structSize : classSym->registered->structSize);
13945 exp->type = 2;
13946 }
13947 else
13948 {
13949 char className[1024];
13950
13951 strcpy(className, "__ecereClass_");
13952 FullClassNameCat(className, classSym->string, 0x1);
13953 MangleClassName(className);
13954 DeclareClass(classSym, className);
13955 FreeExpContents(exp);
13956 exp->type = 9;
13957 exp->member.exp = MkExpIdentifier(MkIdentifier(className));
13958 exp->member.member = MkIdentifier("structSize");
13959 }
13960 }
13961 }
13962 exp->expType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1)->kind = 3, ((struct Type *)__ecereTemp1));
13963 break;
13964 }
13965 case 10:
13966 {
13967 struct Type * type = ProcessType(exp->typeName->qualifiers, exp->typeName->declarator);
13968
13969 exp->expType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1)->kind = 3, ((struct Type *)__ecereTemp1));
13970 exp->isConstant = 0x1;
13971 DeclareType(type, 0x0, 0x0);
13972 FreeType(type);
13973 break;
13974 }
13975 case 11:
13976 {
13977 struct Type * type = ProcessType(exp->cast.typeName->qualifiers, exp->cast.typeName->declarator);
13978
13979 type->count = (unsigned int)1;
13980 FreeType(exp->cast.exp->destType);
13981 exp->cast.exp->destType = type;
13982 type->refCount++;
13983 ProcessExpressionType(exp->cast.exp);
13984 type->count = (unsigned int)0;
13985 exp->expType = type;
13986 if(!exp->cast.exp->needCast && !NeedCast(exp->cast.exp->expType, type))
13987 {
13988 void * prev = exp->prev, * next = exp->next;
13989 struct Type * expType = exp->cast.exp->destType;
13990 struct Expression * castExp = exp->cast.exp;
13991 struct Type * destType = exp->destType;
13992
13993 if(expType)
13994 expType->refCount++;
13995 FreeType(exp->expType);
13996 FreeTypeName(exp->cast.typeName);
13997 *exp = *castExp;
13998 FreeType(exp->expType);
13999 FreeType(exp->destType);
14000 exp->expType = expType;
14001 exp->destType = destType;
14002 ((castExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(castExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(castExp)) : 0), castExp = 0);
14003 exp->prev = prev;
14004 exp->next = next;
14005 }
14006 else
14007 {
14008 exp->isConstant = exp->cast.exp->isConstant;
14009 }
14010 break;
14011 }
14012 case 35:
14013 {
14014 struct Type * type = ProcessType(exp->initializer.typeName->qualifiers, exp->initializer.typeName->declarator);
14015
14016 type->refCount++;
14017 exp->expType = type;
14018 break;
14019 }
14020 case 36:
14021 {
14022 struct Type * type = ProcessType(exp->vaArg.typeName->qualifiers, exp->vaArg.typeName->declarator);
14023
14024 ProcessExpressionType(exp->vaArg.exp);
14025 type->refCount++;
14026 exp->expType = type;
14027 break;
14028 }
14029 case 12:
14030 {
14031 struct Expression * e;
14032
14033 exp->isConstant = 0x1;
14034 FreeType(exp->cond.cond->destType);
14035 exp->cond.cond->destType = MkClassType("bool");
14036 exp->cond.cond->destType->truth = 0x1;
14037 ProcessExpressionType(exp->cond.cond);
14038 if(!exp->cond.cond->isConstant)
14039 exp->isConstant = 0x0;
14040 for(e = (*exp->cond.exp).first; e; e = e->next)
14041 {
14042 if(!e->next)
14043 {
14044 FreeType(e->destType);
14045 e->destType = exp->destType;
14046 if(e->destType)
14047 e->destType->refCount++;
14048 }
14049 ProcessExpressionType(e);
14050 if(!e->next)
14051 {
14052 exp->expType = e->expType;
14053 if(e->expType)
14054 e->expType->refCount++;
14055 }
14056 if(!e->isConstant)
14057 exp->isConstant = 0x0;
14058 }
14059 FreeType(exp->cond.elseExp->destType);
14060 exp->cond.elseExp->destType = exp->destType ? exp->destType : exp->expType;
14061 if(exp->cond.elseExp->destType)
14062 exp->cond.elseExp->destType->refCount++;
14063 ProcessExpressionType(exp->cond.elseExp);
14064 if(!exp->cond.elseExp->isConstant)
14065 exp->isConstant = 0x0;
14066 break;
14067 }
14068 case 25:
14069 {
14070 if(exp->compound && exp->compound->compound.statements && (*exp->compound->compound.statements).last)
14071 {
14072 struct Statement * last = (*exp->compound->compound.statements).last;
14073
14074 if(last->type == 3 && last->expressions && (*last->expressions).last)
14075 {
14076 ((struct Expression *)(*last->expressions).last)->destType = exp->destType;
14077 if(exp->destType)
14078 exp->destType->refCount++;
14079 }
14080 ProcessStatement(exp->compound);
14081 exp->expType = ((struct Expression *)(*last->expressions).last)->expType;
14082 if(((struct Expression *)(*last->expressions).last)->expType)
14083 exp->expType->refCount++;
14084 }
14085 break;
14086 }
14087 case 26:
14088 {
14089 struct Specifier * spec = (*exp->_classExp.specifiers).first;
14090
14091 if(spec && spec->type == 1)
14092 {
14093 exp->expType = MkClassType(spec->name);
14094 exp->expType->kind = 19;
14095 exp->byReference = 0x1;
14096 }
14097 else
14098 {
14099 exp->expType = MkClassType("ecere::com::Class");
14100 exp->byReference = 0x1;
14101 }
14102 break;
14103 }
14104 case 27:
14105 {
14106 struct __ecereNameSpace__ecere__com__Class * _class = thisClass ? thisClass : currentClass;
14107
14108 if(_class)
14109 {
14110 struct Identifier * id = exp->classData.id;
14111 char structName[1024];
14112 struct Expression * classExp;
14113
14114 strcpy(structName, "__ecereClassData_");
14115 FullClassNameCat(structName, _class->fullName, 0x0);
14116 exp->type = 9;
14117 exp->member.member = id;
14118 if(curCompound && FindSymbol("this", curContext, curCompound->compound.context, 0x0, 0x0))
14119 classExp = MkExpMember(MkExpIdentifier(MkIdentifier("this")), MkIdentifier("_class"));
14120 else
14121 classExp = MkExpIdentifier(MkIdentifier("class"));
14122 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"))))))));
14123 ProcessExpressionType(exp);
14124 return ;
14125 }
14126 break;
14127 }
14128 case 37:
14129 {
14130 struct Type * type = (((void *)0));
14131 char * typeString = (((void *)0));
14132 char typeStringBuf[1024];
14133
14134 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))
14135 {
14136 struct __ecereNameSpace__ecere__com__Class * templateClass = exp->destType->_class->registered;
14137
14138 typeString = templateClass->templateArgs[2].dataTypeString;
14139 }
14140 else if(exp->list)
14141 {
14142 struct Expression * e;
14143
14144 for(e = (*exp->list).first; e; e = e->next)
14145 {
14146 ProcessExpressionType(e);
14147 if(e->expType)
14148 {
14149 if(!type)
14150 {
14151 type = e->expType;
14152 type->refCount++;
14153 }
14154 else
14155 {
14156 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
14157 {
14158 FreeType(type);
14159 type = e->expType;
14160 e->expType = (((void *)0));
14161 e = (*exp->list).first;
14162 ProcessExpressionType(e);
14163 if(e->expType)
14164 {
14165 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
14166 {
14167 FreeType(e->expType);
14168 e->expType = (((void *)0));
14169 FreeType(type);
14170 type = (((void *)0));
14171 break;
14172 }
14173 }
14174 }
14175 }
14176 if(e->expType)
14177 {
14178 FreeType(e->expType);
14179 e->expType = (((void *)0));
14180 }
14181 }
14182 }
14183 if(type)
14184 {
14185 typeStringBuf[0] = '\0';
14186 PrintType(type, typeStringBuf, 0x0, 0x1);
14187 typeString = typeStringBuf;
14188 FreeType(type);
14189 type = (((void *)0));
14190 }
14191 }
14192 if(typeString)
14193 {
14194 char templateString[1024];
14195 struct __ecereNameSpace__ecere__sys__OldList * declarations = MkList();
14196 struct __ecereNameSpace__ecere__sys__OldList * instMembers = MkList();
14197 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
14198 struct __ecereNameSpace__ecere__sys__OldList * initializers = MkList();
14199 char count[128];
14200 struct Expression * e;
14201 struct Expression * expExt;
14202 struct Declarator * decl = SpecDeclFromString(typeString, specs, (((void *)0)));
14203 struct Context * context = PushContext();
14204
14205 sprintf(templateString, "Container<%s>", typeString);
14206 ListAdd(instMembers, MkMemberInit(MkListOne(MkIdentifier("data")), MkInitializerAssignment(MkExpIdentifier(MkIdentifier("__internalList")))));
14207 sprintf(count, "%d", (*exp->list).count);
14208 ListAdd(instMembers, MkMemberInit(MkListOne(MkIdentifier("count")), MkInitializerAssignment(MkExpConstant(count))));
14209 ListAdd(instMembers, MkMemberInit(MkListOne(MkIdentifier("type")), MkInitializerAssignment(MkExpClass(CopyList(specs, CopySpecifier), CopyDeclarator(decl)))));
14210 ListAdd(instMembers, MkMemberInit(MkListOne(MkIdentifier("_vTbl")), MkInitializerAssignment(MkExpMember(MkExpClass(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0))), MkIdentifier("_vTbl")))));
14211 ListAdd(instMembers, MkMemberInit(MkListOne(MkIdentifier("_class")), MkInitializerAssignment(MkExpClass(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0))))));
14212 if(exp->list)
14213 {
14214 type = ProcessTypeString(typeString, 0x0);
14215 while(e = (*exp->list).first)
14216 {
14217 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*exp->list), e);
14218 e->destType = type;
14219 type->refCount++;
14220 ProcessExpressionType(e);
14221 ListAdd(initializers, MkInitializerAssignment(e));
14222 }
14223 FreeType(type);
14224 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->list), exp->list = 0);
14225 }
14226 ListAdd(declarations, MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorArray(PlugDeclarator(decl, MkDeclaratorIdentifier(MkIdentifier("__internalList"))), (((void *)0))), MkInitializerList(initializers)))));
14227 ListAdd(declarations, MkDeclarationInst(MkInstantiationNamed(MkListOne(MkSpecifierName("BuiltInContainer")), MkExpIdentifier(MkIdentifier("__internalContainer")), MkListOne(MkMembersInitList(instMembers)))));
14228 exp->expType = ProcessTypeString(templateString, 0x0);
14229 exp->type = 5;
14230 exp->list = MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName(templateString)), (((void *)0))), (expExt = MkExpExtensionCompound(MkCompoundStmt(declarations, MkListOne(MkExpressionStmt(MkListOne(MkExpOp((((void *)0)), '&', MkExpIdentifier(MkIdentifier("__internalContainer")))))))))));
14231 expExt->compound->compound.context = context;
14232 PopContext(context);
14233 ProcessExpressionType(expExt);
14234 }
14235 else
14236 {
14237 exp->expType = ProcessTypeString("Container", 0x0);
14238 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Couldn't determine type of array elements\n", (((void *)0))));
14239 }
14240 break;
14241 }
14242 }
14243 if(exp->expType && exp->expType->kind == 21 && thisClass && (!exp->destType || exp->destType->kind != 21))
14244 {
14245 FreeType(exp->expType);
14246 exp->expType = ReplaceThisClassType(thisClass);
14247 }
14248 if(exp->expType && (exp->expType->kind == 9 || exp->expType->kind == 10 || exp->expType->kind == 15) && !exp->expType->members.first && exp->expType->enumName)
14249 {
14250 struct Symbol * symbol = FindSymbol(exp->expType->enumName, curContext, globalContext, 0x1, 0x0);
14251
14252 if(symbol)
14253 {
14254 if(exp->expType->kind != 15)
14255 {
14256 struct Type * member;
14257 char * enumName = __ecereNameSpace__ecere__sys__CopyString(exp->expType->enumName);
14258
14259 FreeType(exp->expType);
14260 exp->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14261 exp->expType->kind = symbol->type->kind;
14262 exp->expType->refCount++;
14263 exp->expType->enumName = enumName;
14264 exp->expType->members = symbol->type->members;
14265 for(member = symbol->type->members.first; member; member = member->next)
14266 member->refCount++;
14267 }
14268 else
14269 {
14270 struct __ecereNameSpace__ecere__sys__NamedLink * member;
14271
14272 for(member = symbol->type->members.first; member; member = member->next)
14273 {
14274 struct __ecereNameSpace__ecere__sys__NamedLink * value = (value = __ecereNameSpace__ecere__com__eSystem_New0(16), value->name = __ecereNameSpace__ecere__sys__CopyString(member->name), value);
14275
14276 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&exp->expType->members, value);
14277 }
14278 }
14279 }
14280 }
14281 yylloc = exp->loc;
14282 if(exp->destType && (exp->destType->kind == 0 || exp->destType->kind == 18))
14283 ;
14284 else if(exp->destType && !exp->destType->keepCast)
14285 {
14286 if(!CheckExpressionType(exp, exp->destType, 0x0))
14287 {
14288 if(!exp->destType->count || unresolved)
14289 {
14290 if(!exp->expType)
14291 {
14292 yylloc = exp->loc;
14293 if(exp->destType->kind != 14)
14294 {
14295 char type2[1024];
14296
14297 type2[0] = '\0';
14298 if(inCompiler)
14299 {
14300 char expString[10240];
14301
14302 expString[0] = '\0';
14303 PrintType(exp->destType, type2, 0x0, 0x1);
14304 if(inCompiler)
14305 {
14306 PrintExpression(exp, expString);
14307 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14308 }
14309 if(unresolved)
14310 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "unresolved identifier %s; expected %s\n", (((void *)0))), expString, type2);
14311 else if(exp->type != 16)
14312 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't determine type of %s; expected %s\n", (((void *)0))), expString, type2);
14313 }
14314 }
14315 else
14316 {
14317 char expString[10240];
14318
14319 expString[0] = '\0';
14320 if(inCompiler)
14321 {
14322 PrintExpression(exp, expString);
14323 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14324 }
14325 if(unresolved)
14326 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "unresolved identifier %s\n", (((void *)0))), expString);
14327 else if(exp->type != 16)
14328 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't determine type of %s\n", (((void *)0))), expString);
14329 }
14330 }
14331 else
14332 {
14333 char type1[1024];
14334 char type2[1024];
14335
14336 type1[0] = '\0';
14337 type2[0] = '\0';
14338 if(inCompiler)
14339 {
14340 PrintType(exp->expType, type1, 0x0, 0x1);
14341 PrintType(exp->destType, type2, 0x0, 0x1);
14342 }
14343 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)))
14344 ;
14345 else
14346 {
14347 char expString[10240];
14348
14349 expString[0] = '\0';
14350 if(inCompiler)
14351 {
14352 PrintExpression(exp, expString);
14353 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14354 }
14355 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible expression %s (%s); expected %s\n", (((void *)0))), expString, type1, type2);
14356 FreeType(exp->expType);
14357 exp->destType->refCount++;
14358 exp->expType = exp->destType;
14359 }
14360 }
14361 }
14362 }
14363 else if(exp->destType && exp->destType->kind == 14 && exp->expType && exp->expType->passAsTemplate)
14364 {
14365 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
14366 char typeString[1024];
14367 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
14368 struct Declarator * decl;
14369
14370 typeString[0] = '\0';
14371 *newExp = *exp;
14372 if(exp->expType)
14373 exp->expType->refCount++;
14374 if(exp->expType)
14375 exp->expType->refCount++;
14376 exp->type = 11;
14377 newExp->destType = exp->expType;
14378 PrintType(exp->expType, typeString, 0x0, 0x0);
14379 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
14380 exp->cast.typeName = MkTypeName(specs, decl);
14381 exp->cast.exp = newExp;
14382 }
14383 }
14384 else if(unresolved)
14385 {
14386 if(exp->identifier->_class && exp->identifier->_class->name)
14387 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "unresolved identifier %s::%s\n", (((void *)0))), exp->identifier->_class->name, exp->identifier->string);
14388 else if(exp->identifier->string && exp->identifier->string[0])
14389 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "unresolved identifier %s\n", (((void *)0))), exp->identifier->string);
14390 }
14391 else if(!exp->expType && exp->type != 16)
14392 {
14393 char expString[10240];
14394
14395 expString[0] = '\0';
14396 if(inCompiler)
14397 {
14398 PrintExpression(exp, expString);
14399 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14400 }
14401 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't determine type of %s\n", (((void *)0))), expString);
14402 }
14403 ApplyAnyObjectLogic(exp);
14404 if(!notByReference && exp->expType && exp->expType->kind == 8 && exp->expType->_class && exp->expType->_class->registered && exp->expType->_class->registered->type == 5)
14405 {
14406 exp->byReference = 0x1;
14407 }
14408 yylloc = oldyylloc;
14409 }
14410
14411 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)
14412 {
14413 if(*curMember)
14414 {
14415 *curMember = (*curMember)->next;
14416 if(subMemberStackPos && *subMemberStackPos > 0 && subMemberStack[*subMemberStackPos - 1]->type == 1)
14417 {
14418 *curMember = subMemberStack[--(*subMemberStackPos)];
14419 *curMember = (*curMember)->next;
14420 }
14421 while((*curMember) && (*curMember)->isProperty)
14422 *curMember = (*curMember)->next;
14423 if(subMemberStackPos)
14424 {
14425 while((*curMember) && !(*curMember)->isProperty && !(*curMember)->name && ((*curMember)->type == 2 || (*curMember)->type == 1))
14426 {
14427 subMemberStack[(*subMemberStackPos)++] = *curMember;
14428 *curMember = (*curMember)->members.first;
14429 while(*curMember && (*curMember)->isProperty)
14430 *curMember = (*curMember)->next;
14431 }
14432 }
14433 }
14434 while(!*curMember)
14435 {
14436 if(!*curMember)
14437 {
14438 if(subMemberStackPos && *subMemberStackPos)
14439 {
14440 *curMember = subMemberStack[--(*subMemberStackPos)];
14441 *curMember = (*curMember)->next;
14442 }
14443 else
14444 {
14445 struct __ecereNameSpace__ecere__com__Class * lastCurClass = *curClass;
14446
14447 if(*curClass == _class)
14448 break;
14449 for(*curClass = _class; (*curClass)->base != lastCurClass && (*curClass)->base->type != 1000; *curClass = (*curClass)->base)
14450 ;
14451 *curMember = (*curClass)->membersAndProperties.first;
14452 }
14453 while((*curMember) && (*curMember)->isProperty)
14454 *curMember = (*curMember)->next;
14455 if(subMemberStackPos)
14456 {
14457 while((*curMember) && !(*curMember)->isProperty && !(*curMember)->name && ((*curMember)->type == 2 || (*curMember)->type == 1))
14458 {
14459 subMemberStack[(*subMemberStackPos)++] = *curMember;
14460 *curMember = (*curMember)->members.first;
14461 while(*curMember && (*curMember)->isProperty)
14462 *curMember = (*curMember)->next;
14463 }
14464 }
14465 }
14466 }
14467 }
14468
14469 static void ProcessInitializer(struct Initializer * init, struct Type * type)
14470 {
14471 switch(init->type)
14472 {
14473 case 0:
14474 if(!init->exp || init->exp->type != 1 || !init->exp->instance || init->exp->instance->_class || !type || type->kind == 8)
14475 {
14476 if(init->exp && !init->exp->destType)
14477 {
14478 FreeType(init->exp->destType);
14479 init->exp->destType = type;
14480 if(type)
14481 type->refCount++;
14482 }
14483 if(init->exp)
14484 {
14485 ProcessExpressionType(init->exp);
14486 init->isConstant = init->exp->isConstant;
14487 }
14488 break;
14489 }
14490 else
14491 {
14492 struct Expression * exp = init->exp;
14493 struct Instantiation * inst = exp->instance;
14494 struct MembersInit * members;
14495
14496 init->type = 1;
14497 init->list = MkList();
14498 if(inst->members)
14499 {
14500 for(members = (*inst->members).first; members; members = members->next)
14501 {
14502 if(members->type == 0)
14503 {
14504 struct MemberInit * member;
14505
14506 for(member = (*members->dataMembers).first; member; member = member->next)
14507 {
14508 ListAdd(init->list, member->initializer);
14509 member->initializer = (((void *)0));
14510 }
14511 }
14512 }
14513 }
14514 FreeExpression(exp);
14515 }
14516 case 1:
14517 {
14518 struct Initializer * i;
14519 struct Type * initializerType = (((void *)0));
14520 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
14521 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
14522 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
14523 int subMemberStackPos = 0;
14524
14525 if(type && type->kind == 12)
14526 initializerType = Dereference(type);
14527 else if(type && (type->kind == 9 || type->kind == 10))
14528 initializerType = type->members.first;
14529 for(i = (*init->list).first; i; i = i->next)
14530 {
14531 if(type && type->kind == 8 && type->_class && type->_class->registered)
14532 {
14533 FindNextDataMember(type->_class->registered, &curClass, &curMember, subMemberStack, &subMemberStackPos);
14534 if(curMember)
14535 {
14536 if(!curMember->dataType)
14537 curMember->dataType = ProcessTypeString(curMember->dataTypeString, 0x0);
14538 initializerType = curMember->dataType;
14539 }
14540 }
14541 ProcessInitializer(i, initializerType);
14542 if(initializerType && type && (type->kind == 9 || type->kind == 10))
14543 initializerType = initializerType->next;
14544 if(!i->isConstant)
14545 init->isConstant = 0x0;
14546 }
14547 if(type && type->kind == 12)
14548 FreeType(initializerType);
14549 if(type && type->kind != 12 && type->kind != 9 && type->kind != 10 && (type->kind != 8 || !type->_class->registered || type->_class->registered->type != 1))
14550 {
14551 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Assigning list initializer to non list\n", (((void *)0))));
14552 }
14553 break;
14554 }
14555 }
14556 }
14557
14558 extern struct Symbol * FindType(struct Context * ctx, char *  name);
14559
14560 static void ProcessClass(struct __ecereNameSpace__ecere__sys__OldList * definitions, struct Symbol * symbol);
14561
14562 static void ProcessSpecifier(struct Specifier * spec, unsigned int declareStruct)
14563 {
14564 switch(spec->type)
14565 {
14566 case 0:
14567 {
14568 if(spec->specifier == THISCLASS)
14569 {
14570 if(thisClass)
14571 {
14572 spec->type = 1;
14573 spec->name = ReplaceThisClass(thisClass);
14574 spec->symbol = FindClass(spec->name);
14575 ProcessSpecifier(spec, declareStruct);
14576 }
14577 }
14578 break;
14579 }
14580 case 1:
14581 {
14582 struct Symbol * symbol = FindType(curContext, spec->name);
14583
14584 if(symbol)
14585 DeclareType(symbol->type, 0x1, 0x1);
14586 else if((symbol = spec->symbol) && symbol->registered && symbol->registered->type == 1 && declareStruct)
14587 DeclareStruct(spec->name, 0x0);
14588 break;
14589 }
14590 case 2:
14591 {
14592 struct Enumerator * e;
14593
14594 if(spec->list)
14595 {
14596 for(e = (*spec->list).first; e; e = e->next)
14597 {
14598 if(e->exp)
14599 ProcessExpressionType(e->exp);
14600 }
14601 }
14602 break;
14603 }
14604 case 3:
14605 case 4:
14606 {
14607 if(spec->definitions)
14608 {
14609 struct ClassDef * def;
14610 struct Symbol * symbol = spec->id ? FindClass(spec->id->string) : (((void *)0));
14611
14612 ProcessClass(spec->definitions, symbol);
14613 }
14614 break;
14615 }
14616 }
14617 }
14618
14619 static void ProcessDeclarator(struct Declarator * decl)
14620 {
14621 switch(decl->type)
14622 {
14623 case 1:
14624 if(decl->identifier->classSym)
14625 {
14626 FreeSpecifier(decl->identifier->_class);
14627 decl->identifier->_class = (((void *)0));
14628 }
14629 break;
14630 case 3:
14631 if(decl->array.exp)
14632 ProcessExpressionType(decl->array.exp);
14633 case 0:
14634 case 2:
14635 case 4:
14636 case 5:
14637 case 6:
14638 case 7:
14639 if(decl->declarator)
14640 ProcessDeclarator(decl->declarator);
14641 if(decl->type == 4)
14642 {
14643 struct Identifier * id = GetDeclId(decl);
14644
14645 if(id && id->_class)
14646 {
14647 struct TypeName * param = (param = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TypeName), param->qualifiers = MkListOne(id->_class), param->declarator = (((void *)0)), param);
14648
14649 if(!decl->function.parameters)
14650 decl->function.parameters = MkList();
14651 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*decl->function.parameters), (((void *)0)), param);
14652 id->_class = (((void *)0));
14653 }
14654 if(decl->function.parameters)
14655 {
14656 struct TypeName * param;
14657
14658 for(param = (*decl->function.parameters).first; param; param = param->next)
14659 {
14660 if(param->qualifiers && (*param->qualifiers).first)
14661 {
14662 struct Specifier * spec = (*param->qualifiers).first;
14663
14664 if(spec && spec->specifier == TYPED_OBJECT)
14665 {
14666 struct Declarator * d = param->declarator;
14667 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);
14668
14669 FreeList(param->qualifiers, FreeSpecifier);
14670 param->qualifiers = MkListOne(MkStructOrUnion(3, MkIdentifier("__ecereNameSpace__ecere__com__Class"), (((void *)0))));
14671 param->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier("class")));
14672 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*decl->function.parameters), param, newParam);
14673 param = newParam;
14674 }
14675 else if(spec && spec->specifier == ANY_OBJECT)
14676 {
14677 struct Declarator * d = param->declarator;
14678
14679 FreeList(param->qualifiers, FreeSpecifier);
14680 param->qualifiers = MkListOne(MkSpecifier(VOID));
14681 param->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d);
14682 }
14683 else if(spec->specifier == THISCLASS)
14684 {
14685 if(thisClass)
14686 {
14687 spec->type = 1;
14688 spec->name = ReplaceThisClass(thisClass);
14689 spec->symbol = FindClass(spec->name);
14690 ProcessSpecifier(spec, 0x0);
14691 }
14692 }
14693 }
14694 if(param->declarator)
14695 ProcessDeclarator(param->declarator);
14696 }
14697 }
14698 }
14699 break;
14700 }
14701 }
14702
14703 extern struct Identifier * CopyIdentifier(struct Identifier * id);
14704
14705 extern void FreeInitDeclarator(struct InitDeclarator * decl);
14706
14707 static void ProcessDeclaration(struct Declaration * decl)
14708 {
14709 yylloc = decl->loc;
14710 switch(decl->type)
14711 {
14712 case 1:
14713 {
14714 unsigned int declareStruct = 0x0;
14715
14716 if(decl->declarators)
14717 {
14718 struct InitDeclarator * d;
14719
14720 for(d = (*decl->declarators).first; d; d = d->next)
14721 {
14722 struct Type * type, * subType;
14723
14724 ProcessDeclarator(d->declarator);
14725 type = ProcessType(decl->specifiers, d->declarator);
14726 if(d->initializer)
14727 {
14728 ProcessInitializer(d->initializer, type);
14729 if((*decl->declarators).count == 1 && d->initializer->type == 0 && d->initializer->exp->type == 1)
14730 {
14731 if(type->kind == 8 && type->_class == d->initializer->exp->expType->_class)
14732 {
14733 struct Instantiation * inst = d->initializer->exp->instance;
14734
14735 inst->exp = MkExpIdentifier(CopyIdentifier(GetDeclId(d->declarator)));
14736 d->initializer->exp->instance = (((void *)0));
14737 if(decl->specifiers)
14738 FreeList(decl->specifiers, FreeSpecifier);
14739 FreeList(decl->declarators, FreeInitDeclarator);
14740 d = (((void *)0));
14741 decl->type = 2;
14742 decl->inst = inst;
14743 }
14744 }
14745 }
14746 for(subType = type; subType; )
14747 {
14748 if(subType->kind == 8)
14749 {
14750 declareStruct = 0x1;
14751 break;
14752 }
14753 else if(subType->kind == 13)
14754 break;
14755 else if(subType->kind == 12)
14756 subType = subType->arrayType;
14757 else
14758 break;
14759 }
14760 FreeType(type);
14761 if(!d)
14762 break;
14763 }
14764 }
14765 if(decl->specifiers)
14766 {
14767 struct Specifier * s;
14768
14769 for(s = (*decl->specifiers).first; s; s = s->next)
14770 {
14771 ProcessSpecifier(s, declareStruct);
14772 }
14773 }
14774 break;
14775 }
14776 case 2:
14777 {
14778 ProcessInstantiationType(decl->inst);
14779 break;
14780 }
14781 case 0:
14782 {
14783 struct Specifier * spec;
14784 struct Declarator * d;
14785 unsigned int declareStruct = 0x0;
14786
14787 if(decl->declarators)
14788 {
14789 for(d = (*decl->declarators).first; d; d = d->next)
14790 {
14791 struct Type * type = ProcessType(decl->specifiers, d->declarator);
14792 struct Type * subType;
14793
14794 ProcessDeclarator(d);
14795 for(subType = type; subType; )
14796 {
14797 if(subType->kind == 8)
14798 {
14799 declareStruct = 0x1;
14800 break;
14801 }
14802 else if(subType->kind == 13)
14803 break;
14804 else if(subType->kind == 12)
14805 subType = subType->arrayType;
14806 else
14807 break;
14808 }
14809 FreeType(type);
14810 }
14811 }
14812 if(decl->specifiers)
14813 {
14814 for(spec = (*decl->specifiers).first; spec; spec = spec->next)
14815 ProcessSpecifier(spec, declareStruct);
14816 }
14817 break;
14818 }
14819 }
14820 }
14821
14822 static struct FunctionDefinition * curFunction;
14823
14824 static void CreateFireWatcher(struct __ecereNameSpace__ecere__com__Property * prop, struct Expression * object, struct Statement * stmt)
14825 {
14826 char propName[1024], propNameM[1024];
14827 char getName[1024], setName[1024];
14828 struct __ecereNameSpace__ecere__sys__OldList * args;
14829
14830 DeclareProperty(prop, setName, getName);
14831 strcpy(propName, "__ecereProp_");
14832 FullClassNameCat(propName, prop->_class->fullName, 0x0);
14833 strcat(propName, "_");
14834 FullClassNameCat(propName, prop->name, 0x1);
14835 MangleClassName(propName);
14836 strcpy(propNameM, "__ecerePropM_");
14837 FullClassNameCat(propNameM, prop->_class->fullName, 0x0);
14838 strcat(propNameM, "_");
14839 FullClassNameCat(propNameM, prop->name, 0x1);
14840 MangleClassName(propNameM);
14841 if(prop->isWatchable)
14842 {
14843 args = MkList();
14844 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
14845 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
14846 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireWatchers")), args));
14847 args = MkList();
14848 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
14849 ListAdd(args, MkExpIdentifier(MkIdentifier(propNameM)));
14850 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireWatchers")), args));
14851 }
14852 {
14853 args = MkList();
14854 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
14855 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
14856 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireSelfWatchers")), args));
14857 args = MkList();
14858 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
14859 ListAdd(args, MkExpIdentifier(MkIdentifier(propNameM)));
14860 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireSelfWatchers")), args));
14861 }
14862 if(curFunction->propSet && !strcmp(curFunction->propSet->string, prop->name) && (!object || (object->type == 0 && !strcmp(object->identifier->string, "this"))))
14863 curFunction->propSet->fireWatchersDone = 0x1;
14864 }
14865
14866 extern struct Statement * MkIfStmt(struct __ecereNameSpace__ecere__sys__OldList * exp, struct Statement * statement, struct Statement * elseStmt);
14867
14868 extern struct Statement * MkForStmt(struct Statement * init, struct Statement * check, struct __ecereNameSpace__ecere__sys__OldList * inc, struct Statement * statement);
14869
14870 extern struct Statement * MkWhileStmt(struct __ecereNameSpace__ecere__sys__OldList * exp, struct Statement * statement);
14871
14872 extern struct ClassFunction * MkClassFunction(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct Specifier * _class, struct Declarator * decl, struct __ecereNameSpace__ecere__sys__OldList * declList);
14873
14874 extern void ProcessClassFunctionBody(struct ClassFunction * func, struct Statement * body);
14875
14876 extern void FreePropertyWatch(struct PropertyWatch * watcher);
14877
14878 static void ProcessStatement(struct Statement * stmt)
14879 {
14880 yylloc = stmt->loc;
14881 switch(stmt->type)
14882 {
14883 case 0:
14884 ProcessStatement(stmt->labeled.stmt);
14885 break;
14886 case 1:
14887 if(stmt->caseStmt.exp)
14888 {
14889 FreeType(stmt->caseStmt.exp->destType);
14890 stmt->caseStmt.exp->destType = curSwitchType;
14891 if(curSwitchType)
14892 curSwitchType->refCount++;
14893 ProcessExpressionType(stmt->caseStmt.exp);
14894 ComputeExpression(stmt->caseStmt.exp);
14895 }
14896 if(stmt->caseStmt.stmt)
14897 ProcessStatement(stmt->caseStmt.stmt);
14898 break;
14899 case 2:
14900 {
14901 if(stmt->compound.context)
14902 {
14903 struct Declaration * decl;
14904 struct Statement * s;
14905 struct Statement * prevCompound = curCompound;
14906 struct Context * prevContext = curContext;
14907
14908 if(!stmt->compound.isSwitch)
14909 {
14910 curCompound = stmt;
14911 curContext = stmt->compound.context;
14912 }
14913 if(stmt->compound.declarations)
14914 {
14915 for(decl = (*stmt->compound.declarations).first; decl; decl = decl->next)
14916 ProcessDeclaration(decl);
14917 }
14918 if(stmt->compound.statements)
14919 {
14920 for(s = (*stmt->compound.statements).first; s; s = s->next)
14921 ProcessStatement(s);
14922 }
14923 curContext = prevContext;
14924 curCompound = prevCompound;
14925 }
14926 break;
14927 }
14928 case 3:
14929 {
14930 struct Expression * exp;
14931
14932 if(stmt->expressions)
14933 {
14934 for(exp = (*stmt->expressions).first; exp; exp = exp->next)
14935 ProcessExpressionType(exp);
14936 }
14937 break;
14938 }
14939 case 4:
14940 {
14941 struct Expression * exp;
14942
14943 FreeType(((struct Expression *)(*stmt->ifStmt.exp).last)->destType);
14944 ((struct Expression *)(*stmt->ifStmt.exp).last)->destType = MkClassType("bool");
14945 ((struct Expression *)(*stmt->ifStmt.exp).last)->destType->truth = 0x1;
14946 for(exp = (*stmt->ifStmt.exp).first; exp; exp = exp->next)
14947 {
14948 ProcessExpressionType(exp);
14949 }
14950 if(stmt->ifStmt.stmt)
14951 ProcessStatement(stmt->ifStmt.stmt);
14952 if(stmt->ifStmt.elseStmt)
14953 ProcessStatement(stmt->ifStmt.elseStmt);
14954 break;
14955 }
14956 case 5:
14957 {
14958 struct Type * oldSwitchType = curSwitchType;
14959
14960 if(stmt->switchStmt.exp)
14961 {
14962 struct Expression * exp;
14963
14964 for(exp = (*stmt->switchStmt.exp).first; exp; exp = exp->next)
14965 {
14966 if(!exp->next)
14967 {
14968 ProcessExpressionType(exp);
14969 }
14970 if(!exp->next)
14971 curSwitchType = exp->expType;
14972 }
14973 }
14974 ProcessStatement(stmt->switchStmt.stmt);
14975 curSwitchType = oldSwitchType;
14976 break;
14977 }
14978 case 6:
14979 {
14980 if(stmt->whileStmt.exp)
14981 {
14982 struct Expression * exp;
14983
14984 FreeType(((struct Expression *)(*stmt->whileStmt.exp).last)->destType);
14985 ((struct Expression *)(*stmt->whileStmt.exp).last)->destType = MkClassType("bool");
14986 ((struct Expression *)(*stmt->whileStmt.exp).last)->destType->truth = 0x1;
14987 for(exp = (*stmt->whileStmt.exp).first; exp; exp = exp->next)
14988 {
14989 ProcessExpressionType(exp);
14990 }
14991 }
14992 if(stmt->whileStmt.stmt)
14993 ProcessStatement(stmt->whileStmt.stmt);
14994 break;
14995 }
14996 case 7:
14997 {
14998 if(stmt->doWhile.exp)
14999 {
15000 struct Expression * exp;
15001
15002 if((*stmt->doWhile.exp).last)
15003 {
15004 FreeType(((struct Expression *)(*stmt->doWhile.exp).last)->destType);
15005 ((struct Expression *)(*stmt->doWhile.exp).last)->destType = MkClassType("bool");
15006 ((struct Expression *)(*stmt->doWhile.exp).last)->destType->truth = 0x1;
15007 }
15008 for(exp = (*stmt->doWhile.exp).first; exp; exp = exp->next)
15009 {
15010 ProcessExpressionType(exp);
15011 }
15012 }
15013 if(stmt->doWhile.stmt)
15014 ProcessStatement(stmt->doWhile.stmt);
15015 break;
15016 }
15017 case 8:
15018 {
15019 struct Expression * exp;
15020
15021 if(stmt->forStmt.init)
15022 ProcessStatement(stmt->forStmt.init);
15023 if(stmt->forStmt.check && stmt->forStmt.check->expressions)
15024 {
15025 FreeType(((struct Expression *)(*stmt->forStmt.check->expressions).last)->destType);
15026 ((struct Expression *)(*stmt->forStmt.check->expressions).last)->destType = MkClassType("bool");
15027 ((struct Expression *)(*stmt->forStmt.check->expressions).last)->destType->truth = 0x1;
15028 }
15029 if(stmt->forStmt.check)
15030 ProcessStatement(stmt->forStmt.check);
15031 if(stmt->forStmt.increment)
15032 {
15033 for(exp = (*stmt->forStmt.increment).first; exp; exp = exp->next)
15034 ProcessExpressionType(exp);
15035 }
15036 if(stmt->forStmt.stmt)
15037 ProcessStatement(stmt->forStmt.stmt);
15038 break;
15039 }
15040 case 18:
15041 {
15042 struct Identifier * id = stmt->forEachStmt.id;
15043 struct __ecereNameSpace__ecere__sys__OldList * exp = stmt->forEachStmt.exp;
15044 struct __ecereNameSpace__ecere__sys__OldList * filter = stmt->forEachStmt.filter;
15045 struct Statement * block = stmt->forEachStmt.stmt;
15046 char iteratorType[1024];
15047 struct Type * source;
15048 struct Expression * e;
15049 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));
15050 struct Expression * arrayExp;
15051 char * typeString = (((void *)0));
15052 int builtinCount = 0;
15053
15054 for(e = exp ? (*exp).first : (((void *)0)); e; e = e->next)
15055 {
15056 if(!e->next)
15057 {
15058 FreeType(e->destType);
15059 e->destType = ProcessTypeString("Container", 0x0);
15060 }
15061 if(!isBuiltin || e->next)
15062 ProcessExpressionType(e);
15063 }
15064 source = (exp && (*exp).last) ? ((struct Expression *)(*exp).last)->expType : (((void *)0));
15065 if(isBuiltin || (source && source->kind == 8 && source->_class && source->_class->registered && source->_class->registered != containerClass && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, containerClass)))
15066 {
15067 struct __ecereNameSpace__ecere__com__Class * _class = source ? source->_class->registered : (((void *)0));
15068 struct Symbol * symbol;
15069 struct Expression * expIt = (((void *)0));
15070 unsigned int isMap = 0x0, isArray = 0x0, isLinkList = 0x0, isList = 0x0, isCustomAVLTree = 0x0, isAVLTree = 0x0;
15071 struct __ecereNameSpace__ecere__com__Class * arrayClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "Array");
15072 struct __ecereNameSpace__ecere__com__Class * linkListClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "LinkList");
15073 struct __ecereNameSpace__ecere__com__Class * customAVLTreeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "CustomAVLTree");
15074
15075 stmt->type = 2;
15076 stmt->compound.context = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Context);
15077 stmt->compound.context->parent = curContext;
15078 curContext = stmt->compound.context;
15079 if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, customAVLTreeClass))
15080 {
15081 struct __ecereNameSpace__ecere__com__Class * mapClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "Map");
15082 struct __ecereNameSpace__ecere__com__Class * avlTreeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "AVLTree");
15083
15084 isCustomAVLTree = 0x1;
15085 if(__ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, avlTreeClass))
15086 isAVLTree = 0x1;
15087 else if(__ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, mapClass))
15088 isMap = 0x1;
15089 }
15090 else if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, arrayClass))
15091 isArray = 0x1;
15092 else if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, linkListClass))
15093 {
15094 struct __ecereNameSpace__ecere__com__Class * listClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "List");
15095
15096 isLinkList = 0x1;
15097 isList = __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, listClass);
15098 }
15099 if(isArray)
15100 {
15101 struct Declarator * decl;
15102 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15103
15104 decl = SpecDeclFromString(_class->templateArgs[2].dataTypeString, specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(id)));
15105 stmt->compound.declarations = MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(decl, (((void *)0))))));
15106 ListAdd(stmt->compound.declarations, MkDeclaration(MkListOne(MkSpecifierName(source->_class->registered->fullName)), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internalArray")), MkInitializerAssignment(MkExpBrackets(exp))))));
15107 }
15108 else if(isBuiltin)
15109 {
15110 struct Type * type = (((void *)0));
15111 char typeStringBuf[1024];
15112
15113 arrayExp = (((struct Expression *)(*exp).last)->type == 37) ? (struct Expression *)(*exp).last : ((struct Expression *)(*exp).last)->cast.exp;
15114 if(((struct Expression *)(*exp).last)->type == 11)
15115 {
15116 struct TypeName * typeName = ((struct Expression *)(*exp).last)->cast.typeName;
15117
15118 if(typeName)
15119 arrayExp->destType = ProcessType(typeName->qualifiers, typeName->declarator);
15120 }
15121 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)
15122 {
15123 struct __ecereNameSpace__ecere__com__Class * templateClass = arrayExp->destType->_class->registered;
15124
15125 typeString = templateClass->templateArgs[2].dataTypeString;
15126 }
15127 else if(arrayExp->list)
15128 {
15129 struct Expression * e;
15130
15131 for(e = (*arrayExp->list).first; e; e = e->next)
15132 {
15133 ProcessExpressionType(e);
15134 if(e->expType)
15135 {
15136 if(!type)
15137 {
15138 type = e->expType;
15139 type->refCount++;
15140 }
15141 else
15142 {
15143 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
15144 {
15145 FreeType(type);
15146 type = e->expType;
15147 e->expType = (((void *)0));
15148 e = (*arrayExp->list).first;
15149 ProcessExpressionType(e);
15150 if(e->expType)
15151 {
15152 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
15153 {
15154 FreeType(e->expType);
15155 e->expType = (((void *)0));
15156 FreeType(type);
15157 type = (((void *)0));
15158 break;
15159 }
15160 }
15161 }
15162 }
15163 if(e->expType)
15164 {
15165 FreeType(e->expType);
15166 e->expType = (((void *)0));
15167 }
15168 }
15169 }
15170 if(type)
15171 {
15172 typeStringBuf[0] = '\0';
15173 PrintType(type, typeStringBuf, 0x0, 0x1);
15174 typeString = typeStringBuf;
15175 FreeType(type);
15176 }
15177 }
15178 if(typeString)
15179 {
15180 struct __ecereNameSpace__ecere__sys__OldList * initializers = MkList();
15181 struct Declarator * decl;
15182 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15183
15184 if(arrayExp->list)
15185 {
15186 struct Expression * e;
15187
15188 builtinCount = (*arrayExp->list).count;
15189 type = ProcessTypeString(typeString, 0x0);
15190 while(e = (*arrayExp->list).first)
15191 {
15192 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*arrayExp->list), e);
15193 e->destType = type;
15194 type->refCount++;
15195 ProcessExpressionType(e);
15196 ListAdd(initializers, MkInitializerAssignment(e));
15197 }
15198 FreeType(type);
15199 (__ecereNameSpace__ecere__com__eSystem_Delete(arrayExp->list), arrayExp->list = 0);
15200 }
15201 decl = SpecDeclFromString(typeString, specs, MkDeclaratorIdentifier(id));
15202 stmt->compound.declarations = MkListOne(MkDeclaration(CopyList(specs, CopySpecifier), MkListOne(MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl), (((void *)0))))));
15203 ListAdd(stmt->compound.declarations, MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorArray(PlugDeclarator(decl, MkDeclaratorIdentifier(MkIdentifier("__internalArray"))), (((void *)0))), MkInitializerList(initializers)))));
15204 FreeList(exp, FreeExpression);
15205 }
15206 else
15207 {
15208 arrayExp->expType = ProcessTypeString("Container", 0x0);
15209 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Couldn't determine type of array elements\n", (((void *)0))));
15210 }
15211 }
15212 else if(isLinkList && !isList)
15213 {
15214 struct Declarator * decl;
15215 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15216
15217 decl = SpecDeclFromString(_class->templateArgs[3].dataTypeString, specs, MkDeclaratorIdentifier(id));
15218 stmt->compound.declarations = MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(decl, (((void *)0))))));
15219 ListAdd(stmt->compound.declarations, MkDeclaration(MkListOne(MkSpecifierName(source->_class->registered->fullName)), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internalLinkList")), MkInitializerAssignment(MkExpBrackets(exp))))));
15220 }
15221 else if(_class->templateArgs)
15222 {
15223 if(isMap)
15224 sprintf(iteratorType, "MapIterator<%s, %s >", _class->templateArgs[5].dataTypeString, _class->templateArgs[6].dataTypeString);
15225 else
15226 sprintf(iteratorType, "Iterator<%s, %s >", _class->templateArgs[2].dataTypeString, _class->templateArgs[1].dataTypeString);
15227 stmt->compound.declarations = MkListOne(MkDeclarationInst(MkInstantiationNamed(MkListOne(MkSpecifierName(iteratorType)), MkExpIdentifier(id), MkListOne(MkMembersInitList(MkListOne(MkMemberInit(isMap ? MkListOne(MkIdentifier("map")) : (((void *)0)), MkInitializerAssignment(MkExpBrackets(exp)))))))));
15228 }
15229 symbol = FindSymbol(id->string, curContext, curContext, 0x0, 0x0);
15230 if(block && block->type == 2 && block->compound.context)
15231 {
15232 block->compound.context->parent = stmt->compound.context;
15233 }
15234 if(filter)
15235 {
15236 block = MkIfStmt(filter, block, (((void *)0)));
15237 }
15238 if(isArray)
15239 {
15240 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));
15241 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.init);
15242 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.check);
15243 ProcessExpressionType((*((struct Statement *)(*stmt->compound.statements).first)->forStmt.increment).first);
15244 }
15245 else if(isBuiltin)
15246 {
15247 char count[128];
15248
15249 sprintf(count, "%d", builtinCount);
15250 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));
15251 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.init);
15252 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.check);
15253 ProcessExpressionType((*((struct Statement *)(*stmt->compound.statements).first)->forStmt.increment).first);
15254 }
15255 else if(isLinkList && !isList)
15256 {
15257 struct __ecereNameSpace__ecere__com__Class * typeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, _class->templateArgs[3].dataTypeString);
15258 struct __ecereNameSpace__ecere__com__Class * listItemClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, "ListItem");
15259
15260 if(typeClass && __ecereNameSpace__ecere__com__eClass_IsDerived(typeClass, listItemClass) && _class->templateArgs[5].dataTypeString && !strcmp(_class->templateArgs[5].dataTypeString, "LT::link"))
15261 {
15262 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));
15263 }
15264 else
15265 {
15266 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15267 struct Declarator * decl = SpecDeclFromString(_class->templateArgs[3].dataTypeString, specs, (((void *)0)));
15268
15269 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));
15270 }
15271 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.init);
15272 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.check);
15273 ProcessExpressionType((*((struct Statement *)(*stmt->compound.statements).first)->forStmt.increment).first);
15274 }
15275 else
15276 {
15277 stmt->compound.statements = MkListOne(MkWhileStmt(MkListOne(MkExpCall(MkExpMember(expIt = MkExpIdentifier(CopyIdentifier(id)), MkIdentifier("Next")), (((void *)0)))), block));
15278 }
15279 ProcessExpressionType(expIt);
15280 if((*stmt->compound.declarations).first)
15281 ProcessDeclaration((*stmt->compound.declarations).first);
15282 if(symbol)
15283 symbol->isIterator = isMap ? 2 : ((isArray || isBuiltin) ? 3 : (isLinkList ? (isList ? 5 : 4) : (isCustomAVLTree ? 6 : 1)));
15284 ProcessStatement(stmt);
15285 curContext = stmt->compound.context->parent;
15286 break;
15287 }
15288 else
15289 {
15290 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Expression is not a container\n", (((void *)0))));
15291 }
15292 break;
15293 }
15294 case 9:
15295 break;
15296 case 10:
15297 break;
15298 case 11:
15299 break;
15300 case 12:
15301 {
15302 struct Expression * exp;
15303
15304 if(stmt->expressions)
15305 {
15306 for(exp = (*stmt->expressions).first; exp; exp = exp->next)
15307 {
15308 if(!exp->next)
15309 {
15310 if(curFunction && !curFunction->type)
15311 curFunction->type = ProcessType(curFunction->specifiers, curFunction->declarator);
15312 FreeType(exp->destType);
15313 exp->destType = (curFunction && curFunction->type && curFunction->type->kind == 11) ? curFunction->type->returnType : (((void *)0));
15314 if(exp->destType)
15315 exp->destType->refCount++;
15316 }
15317 ProcessExpressionType(exp);
15318 }
15319 }
15320 break;
15321 }
15322 case 14:
15323 {
15324 ProcessDeclaration(stmt->decl);
15325 break;
15326 }
15327 case 13:
15328 {
15329 struct AsmField * field;
15330
15331 if(stmt->asmStmt.inputFields)
15332 {
15333 for(field = (*stmt->asmStmt.inputFields).first; field; field = field->next)
15334 if(field->expression)
15335 ProcessExpressionType(field->expression);
15336 }
15337 if(stmt->asmStmt.outputFields)
15338 {
15339 for(field = (*stmt->asmStmt.outputFields).first; field; field = field->next)
15340 if(field->expression)
15341 ProcessExpressionType(field->expression);
15342 }
15343 if(stmt->asmStmt.clobberedFields)
15344 {
15345 for(field = (*stmt->asmStmt.clobberedFields).first; field; field = field->next)
15346 {
15347 if(field->expression)
15348 ProcessExpressionType(field->expression);
15349 }
15350 }
15351 break;
15352 }
15353 case 17:
15354 {
15355 struct PropertyWatch * propWatch;
15356 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->_watch.watches;
15357 struct Expression * object = stmt->_watch.object;
15358 struct Expression * watcher = stmt->_watch.watcher;
15359
15360 if(watcher)
15361 ProcessExpressionType(watcher);
15362 if(object)
15363 ProcessExpressionType(object);
15364 if(inCompiler)
15365 {
15366 if(watcher || thisClass)
15367 {
15368 struct External * external = curExternal;
15369 struct Context * context = curContext;
15370
15371 stmt->type = 3;
15372 stmt->expressions = MkList();
15373 curExternal = external->prev;
15374 for(propWatch = (*watches).first; propWatch; propWatch = propWatch->next)
15375 {
15376 struct ClassFunction * func;
15377 char watcherName[1024];
15378 struct __ecereNameSpace__ecere__com__Class * watcherClass = watcher ? ((watcher->expType && watcher->expType->kind == 8 && watcher->expType->_class) ? watcher->expType->_class->registered : (((void *)0))) : thisClass;
15379 struct External * createdExternal;
15380 struct External * externalDecl = MkExternalDeclaration((((void *)0)));
15381
15382 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, externalDecl);
15383 sprintf(watcherName, "__ecerePropertyWatcher_%d", propWatcherID++);
15384 if(propWatch->deleteWatch)
15385 strcat(watcherName, "_delete");
15386 else
15387 {
15388 struct Identifier * propID;
15389
15390 for(propID = (*propWatch->properties).first; propID; propID = propID->next)
15391 {
15392 strcat(watcherName, "_");
15393 strcat(watcherName, propID->string);
15394 }
15395 }
15396 if(object && object->expType && object->expType->kind == 8 && object->expType->_class && object->expType->_class->registered)
15397 {
15398 func = MkClassFunction(MkListOne(MkSpecifier(VOID)), (((void *)0)), MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(watcherName)), MkListOne(MkTypeName(MkListOne(MkSpecifierName(object->expType->_class->string)), MkDeclaratorIdentifier(MkIdentifier("value"))))), (((void *)0)));
15399 ProcessClassFunctionBody(func, propWatch->compound);
15400 propWatch->compound = (((void *)0));
15401 createdExternal = ProcessClassFunction(watcherClass, func, ast, curExternal, 0x1);
15402 createdExternal->symbol->idCode = external->symbol->idCode;
15403 curExternal = createdExternal;
15404 ProcessFunction(createdExternal->function);
15405 {
15406 struct Declaration * decl = MkDeclaration(CopyList(createdExternal->function->specifiers, CopySpecifier), MkListOne(MkInitDeclarator(CopyDeclarator(createdExternal->function->declarator), (((void *)0)))));
15407
15408 externalDecl->declaration = decl;
15409 if(decl->symbol && !decl->symbol->pointerExternal)
15410 decl->symbol->pointerExternal = externalDecl;
15411 }
15412 if(propWatch->deleteWatch)
15413 {
15414 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
15415
15416 ListAdd(args, CopyExpression(object));
15417 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
15418 ListAdd(args, MkExpIdentifier(MkIdentifier(watcherName)));
15419 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_WatchDestruction")), args));
15420 }
15421 else
15422 {
15423 struct __ecereNameSpace__ecere__com__Class * _class = object->expType->_class->registered;
15424 struct Identifier * propID;
15425
15426 for(propID = (*propWatch->properties).first; propID; propID = propID->next)
15427 {
15428 char propName[1024];
15429 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
15430
15431 if(prop)
15432 {
15433 char getName[1024], setName[1024];
15434 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
15435
15436 DeclareProperty(prop, setName, getName);
15437 strcpy(propName, "__ecereProp_");
15438 FullClassNameCat(propName, prop->_class->fullName, 0x0);
15439 strcat(propName, "_");
15440 FullClassNameCat(propName, prop->name, 0x1);
15441 ListAdd(args, CopyExpression(object));
15442 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
15443 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
15444 ListAdd(args, MkExpIdentifier(MkIdentifier(watcherName)));
15445 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_Watch")), args));
15446 }
15447 else
15448 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Property %s not found in class %s\n", (((void *)0))), prop->name, _class->fullName);
15449 }
15450 }
15451 }
15452 else
15453 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Invalid watched object\n", (((void *)0))));
15454 }
15455 curExternal = external;
15456 curContext = context;
15457 if(watcher)
15458 FreeExpression(watcher);
15459 if(object)
15460 FreeExpression(object);
15461 FreeList(watches, FreePropertyWatch);
15462 }
15463 else
15464 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "No observer specified and not inside a _class\n", (((void *)0))));
15465 }
15466 else
15467 {
15468 for(propWatch = (*watches).first; propWatch; propWatch = propWatch->next)
15469 {
15470 ProcessStatement(propWatch->compound);
15471 }
15472 }
15473 break;
15474 }
15475 case 15:
15476 {
15477 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->_watch.watches;
15478 struct Expression * object = stmt->_watch.object;
15479 struct __ecereNameSpace__ecere__com__Class * _class;
15480
15481 if(object)
15482 ProcessExpressionType(object);
15483 if(inCompiler)
15484 {
15485 _class = object ? ((object->expType && object->expType->kind == 8 && object->expType->_class) ? object->expType->_class->registered : (((void *)0))) : thisClass;
15486 if(_class)
15487 {
15488 struct Identifier * propID;
15489
15490 stmt->type = 3;
15491 stmt->expressions = MkList();
15492 if(!watches && curFunction->propSet && (!object || (object->type == 0 && !strcmp(object->identifier->string, "this"))))
15493 {
15494 watches = MkListOne(MkIdentifier(curFunction->propSet->string));
15495 }
15496 else if(!watches)
15497 {
15498 }
15499 if(watches)
15500 {
15501 for(propID = (*watches).first; propID; propID = propID->next)
15502 {
15503 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
15504
15505 if(prop)
15506 {
15507 CreateFireWatcher(prop, object, stmt);
15508 }
15509 else
15510 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Property %s not found in class %s\n", (((void *)0))), propID->string, _class->fullName);
15511 }
15512 }
15513 else
15514 {
15515 struct __ecereNameSpace__ecere__com__Property * prop;
15516 struct __ecereNameSpace__ecere__com__Class * base;
15517
15518 for(base = _class; base; base = base->base)
15519 {
15520 for(prop = base->membersAndProperties.first; prop; prop = prop->next)
15521 {
15522 if(prop->isProperty && prop->isWatchable)
15523 {
15524 CreateFireWatcher(prop, object, stmt);
15525 }
15526 }
15527 }
15528 }
15529 if(object)
15530 FreeExpression(object);
15531 FreeList(watches, FreeIdentifier);
15532 }
15533 else
15534 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Invalid object specified and not inside a class\n", (((void *)0))));
15535 }
15536 break;
15537 }
15538 case 16:
15539 {
15540 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->_watch.watches;
15541 struct Expression * object = stmt->_watch.object;
15542 struct Expression * watcher = stmt->_watch.watcher;
15543 struct __ecereNameSpace__ecere__com__Class * _class;
15544
15545 if(object)
15546 ProcessExpressionType(object);
15547 if(watcher)
15548 ProcessExpressionType(watcher);
15549 if(inCompiler)
15550 {
15551 _class = (object && object->expType && object->expType->kind == 8 && object->expType->_class) ? object->expType->_class->registered : (((void *)0));
15552 if(watcher || thisClass)
15553 {
15554 if(_class)
15555 {
15556 struct Identifier * propID;
15557
15558 stmt->type = 3;
15559 stmt->expressions = MkList();
15560 if(!watches)
15561 {
15562 struct __ecereNameSpace__ecere__sys__OldList * args;
15563
15564 args = MkList();
15565 ListAdd(args, CopyExpression(object));
15566 ListAdd(args, MkExpConstant("0"));
15567 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
15568 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_StopWatching")), args));
15569 }
15570 else
15571 {
15572 for(propID = (*watches).first; propID; propID = propID->next)
15573 {
15574 char propName[1024];
15575 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
15576
15577 if(prop)
15578 {
15579 char getName[1024], setName[1024];
15580 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
15581
15582 DeclareProperty(prop, setName, getName);
15583 strcpy(propName, "__ecereProp_");
15584 FullClassNameCat(propName, prop->_class->fullName, 0x0);
15585 strcat(propName, "_");
15586 FullClassNameCat(propName, prop->name, 0x1);
15587 MangleClassName(propName);
15588 ListAdd(args, CopyExpression(object));
15589 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
15590 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
15591 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_StopWatching")), args));
15592 }
15593 else
15594 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Property %s not found in class %s\n", (((void *)0))), prop->name, _class->fullName);
15595 }
15596 }
15597 if(object)
15598 FreeExpression(object);
15599 if(watcher)
15600 FreeExpression(watcher);
15601 FreeList(watches, FreeIdentifier);
15602 }
15603 else
15604 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Invalid object specified and not inside a class\n", (((void *)0))));
15605 }
15606 else
15607 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "No observer specified and not inside a class\n", (((void *)0))));
15608 }
15609 break;
15610 }
15611 }
15612 }
15613
15614 extern struct Expression * QBrackets(struct Expression * exp);
15615
15616 extern struct TypeName * QMkType(char *  spec, struct Declarator * decl);
15617
15618 extern struct Declarator * QMkPtrDecl(char *  id);
15619
15620 extern struct Expression * MkExpPointer(struct Expression * expression, struct Identifier * member);
15621
15622 extern struct Expression * QMkExpCond(struct Expression * cond, struct Expression * exp, struct Expression * elseExp);
15623
15624 extern struct Statement * MkFireWatchersStmt(struct Expression * object, struct __ecereNameSpace__ecere__sys__OldList * watches);
15625
15626 static void ProcessFunction(struct FunctionDefinition * function)
15627 {
15628 void * __ecereTemp2;
15629 void * __ecereTemp1;
15630 struct Identifier * id = GetDeclId(function->declarator);
15631 struct Symbol * symbol = function->declarator ? function->declarator->symbol : (((void *)0));
15632 struct Type * type = symbol ? symbol->type : (((void *)0));
15633 struct __ecereNameSpace__ecere__com__Class * oldThisClass = thisClass;
15634 struct Context * oldTopContext = topContext;
15635
15636 yylloc = function->loc;
15637 if(type && type->thisClass)
15638 {
15639 struct Symbol * classSym = type->thisClass;
15640 struct __ecereNameSpace__ecere__com__Class * _class = type->thisClass->registered;
15641 char className[1024];
15642 char structName[1024];
15643 struct Declarator * funcDecl;
15644 struct Symbol * thisSymbol;
15645 unsigned int typedObject = 0x0;
15646
15647 if(_class && !_class->base)
15648 {
15649 _class = currentClass;
15650 if(_class && !_class->symbol)
15651 _class->symbol = FindClass(_class->fullName);
15652 classSym = _class ? _class->symbol : (((void *)0));
15653 typedObject = 0x1;
15654 }
15655 thisClass = _class;
15656 if(inCompiler && _class)
15657 {
15658 if(type->kind == 11)
15659 {
15660 if(symbol->type->params.count == 1 && ((struct Type *)symbol->type->params.first)->kind == 0)
15661 {
15662 struct Type * param = symbol->type->params.first;
15663
15664 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(&symbol->type->params, param);
15665 FreeType(param);
15666 }
15667 if(type->classObjectType != 1)
15668 {
15669 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(&symbol->type->params, (((void *)0)), MkClassType(_class->fullName));
15670 symbol->type->staticMethod = 0x1;
15671 symbol->type->thisClass = (((void *)0));
15672 symbol->type->extraParam = 0x0;
15673 }
15674 }
15675 strcpy(className, "__ecereClass_");
15676 FullClassNameCat(className, _class->fullName, 0x1);
15677 MangleClassName(className);
15678 structName[0] = (char)0;
15679 FullClassNameCat(structName, _class->fullName, 0x0);
15680 funcDecl = GetFuncDecl(function->declarator);
15681 if(funcDecl)
15682 {
15683 if(funcDecl->function.parameters && (*funcDecl->function.parameters).count == 1)
15684 {
15685 struct TypeName * param = (*funcDecl->function.parameters).first;
15686
15687 if(param->qualifiers && (*param->qualifiers).count == 1 && ((struct Specifier *)(*param->qualifiers).first)->specifier == VOID && !param->declarator)
15688 {
15689 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->function.parameters), param);
15690 FreeTypeName(param);
15691 }
15692 }
15693 if(!function->propertyNoThis)
15694 {
15695 struct TypeName * thisParam;
15696
15697 if(type->classObjectType != 1)
15698 {
15699 thisParam = QMkClass(_class->fullName, MkDeclaratorIdentifier(MkIdentifier("this")));
15700 if(!funcDecl->function.parameters)
15701 funcDecl->function.parameters = MkList();
15702 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
15703 }
15704 if(typedObject)
15705 {
15706 if(type->classObjectType != 1)
15707 {
15708 if(type->byReference || _class->type == 3 || _class->type == 1000 || _class->type == 4 || _class->type == 2)
15709 thisParam->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), thisParam->declarator);
15710 }
15711 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));
15712 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
15713 }
15714 }
15715 }
15716 if(symbol && symbol->pointerExternal && symbol->pointerExternal->type == 1)
15717 {
15718 struct InitDeclarator * initDecl = (*symbol->pointerExternal->declaration->declarators).first;
15719
15720 funcDecl = GetFuncDecl(initDecl->declarator);
15721 if(funcDecl)
15722 {
15723 if(funcDecl->function.parameters && (*funcDecl->function.parameters).count == 1)
15724 {
15725 struct TypeName * param = (*funcDecl->function.parameters).first;
15726
15727 if(param->qualifiers && (*param->qualifiers).count == 1 && ((struct Specifier *)(*param->qualifiers).first)->specifier == VOID && !param->declarator)
15728 {
15729 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->function.parameters), param);
15730 FreeTypeName(param);
15731 }
15732 }
15733 if(type->classObjectType != 1)
15734 {
15735 if((_class->type != 2 && _class->type != 3 && _class->type != 4) || function != (struct FunctionDefinition *)symbol->externalSet)
15736 {
15737 struct TypeName * thisParam = QMkClass(_class->fullName, MkDeclaratorIdentifier(MkIdentifier("this")));
15738
15739 if(!funcDecl->function.parameters)
15740 funcDecl->function.parameters = MkList();
15741 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
15742 }
15743 }
15744 }
15745 }
15746 }
15747 if(function->body)
15748 {
15749 if(type->classObjectType != 1)
15750 {
15751 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));
15752 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&function->body->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
15753 if(typedObject && thisSymbol->type)
15754 {
15755 thisSymbol->type->classObjectType = 2;
15756 thisSymbol->type->byReference = type->byReference;
15757 }
15758 }
15759 }
15760 if(inCompiler && _class && (_class->type == 0) && type->classObjectType != 1)
15761 {
15762 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
15763
15764 {
15765 struct __ecereNameSpace__ecere__com__Class * base;
15766
15767 for(base = _class; base && base->type != 1000; base = base->next)
15768 {
15769 for(member = base->membersAndProperties.first; member; member = member->next)
15770 if(!member->isProperty)
15771 break;
15772 if(member)
15773 break;
15774 }
15775 }
15776 for(member = _class->membersAndProperties.first; member; member = member->next)
15777 if(!member->isProperty)
15778 break;
15779 if(member)
15780 {
15781 char pointerName[1024];
15782 struct Declaration * decl;
15783 struct Initializer * initializer;
15784 struct Expression * exp, * bytePtr;
15785
15786 strcpy(pointerName, "__ecerePointer_");
15787 FullClassNameCat(pointerName, _class->fullName, 0x0);
15788 {
15789 char className[1024];
15790
15791 strcpy(className, "__ecereClass_");
15792 FullClassNameCat(className, classSym->string, 0x1);
15793 MangleClassName(className);
15794 DeclareClass(classSym, className);
15795 }
15796 bytePtr = QBrackets(MkExpCast(QMkType("char", QMkPtrDecl((((void *)0)))), QMkExpId("this")));
15797 if(_class->fixed)
15798 {
15799 char string[256];
15800
15801 sprintf(string, "%d", _class->offset);
15802 exp = QBrackets(MkExpOp(bytePtr, '+', MkExpConstant(string)));
15803 }
15804 else
15805 {
15806 exp = QBrackets(MkExpOp(bytePtr, '+', MkExpPointer(QMkExpId(className), MkIdentifier("offset"))));
15807 }
15808 exp = QBrackets(QMkExpCond(QMkExpId("this"), exp, MkExpConstant("0")));
15809 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));
15810 if(function->body)
15811 {
15812 yylloc = function->body->loc;
15813 initializer = MkInitializerAssignment(MkExpCast(MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(structName), (((void *)0)))), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), exp));
15814 {
15815 struct Context * prevContext = curContext;
15816
15817 curContext = function->body->compound.context;
15818 decl = MkDeclaration(MkListOne(MkStructOrUnion(3, MkIdentifier(structName), (((void *)0)))), MkListOne(MkInitDeclarator(QMkPtrDecl(pointerName), initializer)));
15819 curContext = prevContext;
15820 }
15821 decl->symbol = (((void *)0));
15822 if(!function->body->compound.declarations)
15823 function->body->compound.declarations = MkList();
15824 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*function->body->compound.declarations), (((void *)0)), decl);
15825 }
15826 }
15827 }
15828 }
15829 else
15830 thisClass = (((void *)0));
15831 if(id)
15832 {
15833 FreeSpecifier(id->_class);
15834 id->_class = (((void *)0));
15835 if(symbol && symbol->pointerExternal && symbol->pointerExternal->type == 1)
15836 {
15837 struct InitDeclarator * initDecl = (*symbol->pointerExternal->declaration->declarators).first;
15838
15839 id = GetDeclId(initDecl->declarator);
15840 FreeSpecifier(id->_class);
15841 id->_class = (((void *)0));
15842 }
15843 }
15844 if(function->body)
15845 topContext = function->body->compound.context;
15846 {
15847 struct FunctionDefinition * oldFunction = curFunction;
15848
15849 curFunction = function;
15850 if(function->body)
15851 ProcessStatement(function->body);
15852 if(inCompiler && function->propSet && !function->propSet->fireWatchersDone)
15853 {
15854 struct Statement * prevCompound = curCompound;
15855 struct Context * prevContext = curContext;
15856 struct Statement * fireWatchers = MkFireWatchersStmt((((void *)0)), (((void *)0)));
15857
15858 if(!function->body->compound.statements)
15859 function->body->compound.statements = MkList();
15860 ListAdd(function->body->compound.statements, fireWatchers);
15861 curCompound = function->body;
15862 curContext = function->body->compound.context;
15863 ProcessStatement(fireWatchers);
15864 curContext = prevContext;
15865 curCompound = prevCompound;
15866 }
15867 curFunction = oldFunction;
15868 }
15869 if(function->declarator)
15870 {
15871 ProcessDeclarator(function->declarator);
15872 }
15873 topContext = oldTopContext;
15874 thisClass = oldThisClass;
15875 }
15876
15877 extern void FreeSymbol(struct Symbol * symbol);
15878
15879 void __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Remove(struct __ecereNameSpace__ecere__sys__BinaryTree * this, struct __ecereNameSpace__ecere__sys__BTNode * node);
15880
15881 static void ProcessClass(struct __ecereNameSpace__ecere__sys__OldList * definitions, struct Symbol * symbol)
15882 {
15883 struct ClassDef * def;
15884 struct External * external = curExternal;
15885 struct __ecereNameSpace__ecere__com__Class * regClass = symbol ? symbol->registered : (((void *)0));
15886
15887 for(def = definitions->first; def; def = def->next)
15888 {
15889 if(def->type == 0)
15890 {
15891 if(def->function->declarator)
15892 curExternal = def->function->declarator->symbol->pointerExternal;
15893 else
15894 curExternal = external;
15895 ProcessFunction((struct FunctionDefinition *)def->function);
15896 }
15897 else if(def->type == 2)
15898 {
15899 if(def->decl->type == 2)
15900 {
15901 thisClass = regClass;
15902 ProcessInstantiationType(def->decl->inst);
15903 thisClass = (((void *)0));
15904 }
15905 else
15906 {
15907 struct __ecereNameSpace__ecere__com__Class * backThisClass = thisClass;
15908
15909 if(regClass)
15910 thisClass = regClass;
15911 ProcessDeclaration(def->decl);
15912 thisClass = backThisClass;
15913 }
15914 }
15915 else if(def->type == 1 && def->defProperties)
15916 {
15917 struct MemberInit * defProperty;
15918 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);
15919
15920 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
15921 for(defProperty = (*def->defProperties).first; defProperty; defProperty = defProperty->next)
15922 {
15923 thisClass = regClass;
15924 ProcessMemberInitData(defProperty, regClass, (((void *)0)), (((void *)0)), (((void *)0)), (((void *)0)));
15925 thisClass = (((void *)0));
15926 }
15927 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Remove(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
15928 FreeSymbol(thisSymbol);
15929 }
15930 else if(def->type == 3 && def->propertyDef)
15931 {
15932 struct PropertyDef * prop = def->propertyDef;
15933
15934 thisClass = regClass;
15935 if(prop->setStmt)
15936 {
15937 if(regClass)
15938 {
15939 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
15940
15941 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->setStmt->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
15942 }
15943 curExternal = prop->symbol ? prop->symbol->externalSet : (((void *)0));
15944 ProcessStatement(prop->setStmt);
15945 }
15946 if(prop->getStmt)
15947 {
15948 if(regClass)
15949 {
15950 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
15951
15952 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->getStmt->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
15953 }
15954 curExternal = prop->symbol ? prop->symbol->externalGet : (((void *)0));
15955 ProcessStatement(prop->getStmt);
15956 }
15957 if(prop->issetStmt)
15958 {
15959 if(regClass)
15960 {
15961 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
15962
15963 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->issetStmt->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
15964 }
15965 curExternal = prop->symbol ? prop->symbol->externalIsSet : (((void *)0));
15966 ProcessStatement(prop->issetStmt);
15967 }
15968 thisClass = (((void *)0));
15969 }
15970 else if(def->type == 4 && def->propertyWatch)
15971 {
15972 struct PropertyWatch * propertyWatch = def->propertyWatch;
15973
15974 thisClass = regClass;
15975 if(propertyWatch->compound)
15976 {
15977 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);
15978
15979 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&propertyWatch->compound->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
15980 curExternal = (((void *)0));
15981 ProcessStatement(propertyWatch->compound);
15982 }
15983 thisClass = (((void *)0));
15984 }
15985 }
15986 }
15987
15988 extern struct __ecereNameSpace__ecere__com__Instance * GetPrivateModule(void);
15989
15990 void ComputeDataTypes()
15991 {
15992 void * __ecereTemp1;
15993 struct External * external;
15994 struct External * temp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_External);
15995
15996 currentClass = (((void *)0));
15997 containerClass = __ecereNameSpace__ecere__com__eSystem_FindClass(GetPrivateModule(), "Container");
15998 temp->symbol = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), ((struct Symbol *)__ecereTemp1)->id = -1000, ((struct Symbol *)__ecereTemp1)->idCode = -1000, ((struct Symbol *)__ecereTemp1));
15999 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), (((void *)0)), temp);
16000 curExternal = temp;
16001 DeclareStruct("ecere::com::Class", 0x0);
16002 DeclareStruct("ecere::com::Instance", 0x0);
16003 DeclareStruct("ecere::com::Property", 0x0);
16004 DeclareStruct("ecere::com::DataMember", 0x0);
16005 DeclareStruct("ecere::com::Method", 0x0);
16006 DeclareStruct("ecere::com::SerialBuffer", 0x0);
16007 DeclareStruct("ecere::com::ClassTemplateArgument", 0x0);
16008 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*ast), temp);
16009 for(external = (*ast).first; external; external = external->next)
16010 {
16011 afterExternal = curExternal = external;
16012 if(external->type == 0)
16013 {
16014 currentClass = external->function->_class;
16015 ProcessFunction(external->function);
16016 }
16017 else if(external->type == 1)
16018 {
16019 currentClass = (((void *)0));
16020 ProcessDeclaration(external->declaration);
16021 }
16022 else if(external->type == 2)
16023 {
16024 struct ClassDefinition * _class = external->_class;
16025
16026 currentClass = external->symbol->registered;
16027 if(_class->definitions)
16028 {
16029 ProcessClass(_class->definitions, _class->symbol);
16030 }
16031 if(inCompiler)
16032 {
16033 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*ast), external);
16034 ((external ? (__ecereClass_External->Destructor ? __ecereClass_External->Destructor(external) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(external)) : 0), external = 0);
16035 }
16036 }
16037 else if(external->type == 4)
16038 {
16039 thisNameSpace = external->id->string;
16040 }
16041 }
16042 currentClass = (((void *)0));
16043 thisNameSpace = (((void *)0));
16044 ((temp->symbol ? (__ecereClass_Symbol->Destructor ? __ecereClass_Symbol->Destructor(temp->symbol) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(temp->symbol)) : 0), temp->symbol = 0);
16045 ((temp ? (__ecereClass_External->Destructor ? __ecereClass_External->Destructor(temp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(temp)) : 0), temp = 0);
16046 }
16047
16048 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);
16049
16050 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);
16051
16052 void __ecereRegisterModule_pass15(struct __ecereNameSpace__ecere__com__Instance * module)
16053 {
16054 struct __ecereNameSpace__ecere__com__Class * class;
16055
16056 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetYydebug", "void SetYydebug(bool b)", SetYydebug, module, 1);
16057 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetThisClass", "void SetThisClass(ecere::com::Class c)", SetThisClass, module, 1);
16058 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetThisClass", "ecere::com::Class GetThisClass(void)", GetThisClass, module, 1);
16059 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintExpression", "void PrintExpression(Expression exp, char * string)", PrintExpression, module, 1);
16060 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("_strtoi64", "int64 _strtoi64(char * string, char * * endString, int base)", _strtoi64, module, 2);
16061 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("_strtoui64", "uint64 _strtoui64(char * string, char * * endString, int base)", _strtoui64, module, 2);
16062 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessTemplateParameterType", "Type ProcessTemplateParameterType(TemplateParameter param)", ProcessTemplateParameterType, module, 2);
16063 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("NeedCast", "bool NeedCast(Type type1, Type type2)", NeedCast, module, 2);
16064 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintInt", "char * PrintInt(int64 result)", PrintInt, module, 1);
16065 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUInt", "char * PrintUInt(uint64 result)", PrintUInt, module, 1);
16066 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintInt64", "char * PrintInt64(int64 result)", PrintInt64, module, 1);
16067 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUInt64", "char * PrintUInt64(uint64 result)", PrintUInt64, module, 1);
16068 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintHexUInt", "char * PrintHexUInt(uint64 result)", PrintHexUInt, module, 1);
16069 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintHexUInt64", "char * PrintHexUInt64(uint64 result)", PrintHexUInt64, module, 1);
16070 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintShort", "char * PrintShort(short result)", PrintShort, module, 1);
16071 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUShort", "char * PrintUShort(uint16 result)", PrintUShort, module, 1);
16072 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintChar", "char * PrintChar(char result)", PrintChar, module, 1);
16073 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUChar", "char * PrintUChar(byte result)", PrintUChar, module, 1);
16074 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintFloat", "char * PrintFloat(float result)", PrintFloat, module, 1);
16075 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintDouble", "char * PrintDouble(double result)", PrintDouble, module, 1);
16076 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetInt", "bool GetInt(Expression exp, int * value2)", GetInt, module, 1);
16077 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUInt", "bool GetUInt(Expression exp, uint * value2)", GetUInt, module, 1);
16078 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetInt64", "bool GetInt64(Expression exp, int64 * value2)", GetInt64, module, 1);
16079 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUInt64", "bool GetUInt64(Expression exp, uint64 * value2)", GetUInt64, module, 1);
16080 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetShort", "bool GetShort(Expression exp, short * value2)", GetShort, module, 1);
16081 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUShort", "bool GetUShort(Expression exp, uint16 * value2)", GetUShort, module, 1);
16082 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetChar", "bool GetChar(Expression exp, char * value2)", GetChar, module, 1);
16083 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUChar", "bool GetUChar(Expression exp, byte * value2)", GetUChar, module, 1);
16084 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetFloat", "bool GetFloat(Expression exp, float * value2)", GetFloat, module, 1);
16085 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetDouble", "bool GetDouble(Expression exp, double * value2)", GetDouble, module, 1);
16086 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeClassMembers", "void ComputeClassMembers(ecere::com::Class _class, bool isMember)", ComputeClassMembers, module, 2);
16087 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeModuleClasses", "void ComputeModuleClasses(ecere::com::Module module)", ComputeModuleClasses, module, 1);
16088 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeTypeSize", "int ComputeTypeSize(Type type)", ComputeTypeSize, module, 1);
16089 __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);
16090 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareStruct", "void DeclareStruct(char * name, bool skipNoHead)", DeclareStruct, module, 2);
16091 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareProperty", "void DeclareProperty(ecere::com::Property prop, char * setName, char * getName)", DeclareProperty, module, 2);
16092 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("Dereference", "Type Dereference(Type source)", Dereference, module, 1);
16093 __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);
16094 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessInstantiationType", "void ProcessInstantiationType(Instantiation inst)", ProcessInstantiationType, module, 2);
16095 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindTemplateArg", "ecere::com::ClassTemplateArgument * FindTemplateArg(ecere::com::Class _class, TemplateParameter param)", FindTemplateArg, module, 2);
16096 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetupTemplatesContext", "Context SetupTemplatesContext(ecere::com::Class _class)", SetupTemplatesContext, module, 1);
16097 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FinishTemplatesContext", "void FinishTemplatesContext(Context context)", FinishTemplatesContext, module, 1);
16098 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessMethodType", "void ProcessMethodType(ecere::com::Method method)", ProcessMethodType, module, 1);
16099 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessPropertyType", "void ProcessPropertyType(ecere::com::Property prop)", ProcessPropertyType, module, 1);
16100 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareMethod", "void DeclareMethod(ecere::com::Method method, char * name)", DeclareMethod, module, 1);
16101 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClass", "char * ReplaceThisClass(ecere::com::Class _class)", ReplaceThisClass, module, 2);
16102 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClassType", "Type ReplaceThisClassType(ecere::com::Class _class)", ReplaceThisClassType, module, 2);
16103 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClassSpecifiers", "void ReplaceThisClassSpecifiers(ecere::sys::OldList specs, ecere::com::Class _class)", ReplaceThisClassSpecifiers, module, 2);
16104 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareFunction", "bool DeclareFunction(ecere::com::GlobalFunction function, char * name)", DeclareFunction, module, 2);
16105 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareGlobalData", "void DeclareGlobalData(GlobalData data)", DeclareGlobalData, module, 2);
16106 class = __ecereNameSpace__ecere__com__eSystem_RegisterClass(5, "Conversion", 0, sizeof(struct Conversion), 0, 0, 0, module, 2, 1);
16107 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + 12)))->application == ((struct __ecereNameSpace__ecere__com__Module *)(((char *)__thisModule + 12)))->application && class)
16108 __ecereClass_Conversion = class;
16109 __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);
16110 __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);
16111 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ModuleVisibility", "bool ModuleVisibility(ecere::com::Module searchIn, ecere::com::Module searchFor)", ModuleVisibility, module, 1);
16112 __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);
16113 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("MatchTypeExpression", "bool MatchTypeExpression(Expression sourceExp, Type dest, ecere::sys::OldList conversions, bool skipUnitBla)", MatchTypeExpression, module, 2);
16114 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReadString", "void ReadString(char * output, char * string)", ReadString, module, 1);
16115 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOperand", "Operand GetOperand(Expression exp)", GetOperand, module, 1);
16116 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PopulateInstance", "void PopulateInstance(Instantiation inst)", PopulateInstance, module, 1);
16117 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeInstantiation", "void ComputeInstantiation(Expression exp)", ComputeInstantiation, module, 1);
16118 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CallOperator", "void CallOperator(Expression exp, Expression exp1, Expression exp2, Operand op1, Operand op2)", CallOperator, module, 1);
16119 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeExpression", "void ComputeExpression(Expression exp)", ComputeExpression, module, 1);
16120 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CheckTemplateTypes", "void CheckTemplateTypes(Expression exp)", CheckTemplateTypes, module, 1);
16121 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindSymbol", "Symbol FindSymbol(char * name, Context startContext, Context endContext, bool isStruct, bool globalNameSpace)", FindSymbol, module, 1);
16122 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintType", "void PrintType(Type type, char * string, bool printName, bool fullName)", PrintType, module, 1);
16123 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindMemberAndOffset", "Type FindMemberAndOffset(Type type, char * string, uint * offset)", FindMemberAndOffset, module, 1);
16124 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ParseExpressionString", "Expression ParseExpressionString(char * expression)", ParseExpressionString, module, 1);
16125 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceExpContents", "void ReplaceExpContents(Expression checkedExp, Expression newExp)", ReplaceExpContents, module, 1);
16126 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ApplyAnyObjectLogic", "void ApplyAnyObjectLogic(Expression e)", ApplyAnyObjectLogic, module, 1);
16127 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessExpressionType", "void ProcessExpressionType(Expression exp)", ProcessExpressionType, module, 1);
16128 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeDataTypes", "void ComputeDataTypes(void)", ComputeDataTypes, module, 1);
16129 }
16130
16131 void __ecereUnregisterModule_pass15(struct __ecereNameSpace__ecere__com__Instance * module)
16132 {
16133
16134 }
16135