compiler/libec/lexer; expression, ide/debugger: (#67, #128) Generating a syntax error...
[sdk] / compiler / bootstrap / libec / bootstrap / pass15.c
1 /* Code generated from eC source file: pass15.ec */
2 #if defined(__GNUC__)
3 typedef long long int64;
4 typedef unsigned long long uint64;
5 #ifndef _WIN32
6 #define __declspec(x)
7 #endif
8 #elif defined(__TINYC__)
9 #include <stdarg.h>
10 #define __builtin_va_list va_list
11 #define __builtin_va_start va_start
12 #define __builtin_va_end va_end
13 #ifdef _WIN32
14 #define strcasecmp stricmp
15 #define strncasecmp strnicmp
16 #define __declspec(x) __attribute__((x))
17 #else
18 #define __declspec(x)
19 #endif
20 typedef long long int64;
21 typedef unsigned long long uint64;
22 #else
23 typedef __int64 int64;
24 typedef unsigned __int64 uint64;
25 #endif
26 #ifdef __BIG_ENDIAN__
27 #define __ENDIAN_PAD(x) (8 - (x))
28 #else
29 #define __ENDIAN_PAD(x) 0
30 #endif
31 #include <stdint.h>
32 #include <sys/types.h>
33
34 #if /*defined(_W64) || */(defined(__WORDSIZE) && __WORDSIZE == 8) || defined(__x86_64__)
35 #define _64BIT 1
36 #else
37 #define _64BIT 0
38 #endif
39
40 #define arch_PointerSize                  sizeof(void *)
41 #define structSize_Instance               (_64BIT ? 24 : 12)
42 #define structSize_Module                 (_64BIT ? 560 : 300)
43 #define structSize_NamedLink              (_64BIT ? 32 : 16)
44
45 extern void *  __ecereNameSpace__ecere__com__eSystem_New(unsigned int size);
46
47 extern void *  __ecereNameSpace__ecere__com__eSystem_New0(unsigned int size);
48
49 extern void *  __ecereNameSpace__ecere__com__eSystem_Renew(void *  memory, unsigned int size);
50
51 extern void *  __ecereNameSpace__ecere__com__eSystem_Renew0(void *  memory, unsigned int size);
52
53 extern void __ecereNameSpace__ecere__com__eSystem_Delete(void *  memory);
54
55 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__BTNode;
56
57 struct __ecereNameSpace__ecere__sys__BTNode;
58
59 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__BinaryTree;
60
61 struct __ecereNameSpace__ecere__sys__BinaryTree
62 {
63 struct __ecereNameSpace__ecere__sys__BTNode * root;
64 int count;
65 int (*  CompareKey)(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, uintptr_t a, uintptr_t b);
66 void (*  FreeKey)(void *  key);
67 } __attribute__ ((gcc_struct));
68
69 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__OldList;
70
71 struct __ecereNameSpace__ecere__sys__OldList
72 {
73 void *  first;
74 void *  last;
75 int count;
76 unsigned int offset;
77 unsigned int circ;
78 } __attribute__ ((gcc_struct));
79
80 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Method;
81
82 struct __ecereNameSpace__ecere__com__Method
83 {
84 char *  name;
85 struct __ecereNameSpace__ecere__com__Method * parent;
86 struct __ecereNameSpace__ecere__com__Method * left;
87 struct __ecereNameSpace__ecere__com__Method * right;
88 int depth;
89 int (*  function)();
90 int vid;
91 int type;
92 struct __ecereNameSpace__ecere__com__Class * _class;
93 void *  symbol;
94 char *  dataTypeString;
95 struct Type * dataType;
96 int memberAccess;
97 } __attribute__ ((gcc_struct));
98
99 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Property;
100
101 struct __ecereNameSpace__ecere__com__Property
102 {
103 struct __ecereNameSpace__ecere__com__Property * prev;
104 struct __ecereNameSpace__ecere__com__Property * next;
105 char *  name;
106 unsigned int isProperty;
107 int memberAccess;
108 int id;
109 struct __ecereNameSpace__ecere__com__Class * _class;
110 char *  dataTypeString;
111 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
112 struct Type * dataType;
113 void (*  Set)(void * , int);
114 int (*  Get)(void * );
115 unsigned int (*  IsSet)(void * );
116 void *  data;
117 void *  symbol;
118 int vid;
119 unsigned int conversion;
120 unsigned int watcherOffset;
121 char *  category;
122 unsigned int compiled;
123 unsigned int selfWatchable;
124 unsigned int isWatchable;
125 } __attribute__ ((gcc_struct));
126
127 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_CodePosition;
128
129 struct CodePosition
130 {
131 int line;
132 int charPos;
133 int pos;
134 int included;
135 } __attribute__ ((gcc_struct));
136
137 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Location;
138
139 struct Location
140 {
141 struct CodePosition start;
142 struct CodePosition end;
143 } __attribute__ ((gcc_struct));
144
145 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Attrib;
146
147 struct Attrib;
148
149 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ExtDecl;
150
151 struct ExtDecl
152 {
153 struct Location loc;
154 int type;
155 union
156 {
157 char * s;
158 struct Attrib * attr;
159 } __attribute__ ((gcc_struct));
160 } __attribute__ ((gcc_struct));
161
162 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassDefinition;
163
164 struct ClassDefinition
165 {
166 struct ClassDefinition * prev;
167 struct ClassDefinition * next;
168 struct Location loc;
169 struct Specifier * _class;
170 struct __ecereNameSpace__ecere__sys__OldList *  baseSpecs;
171 struct __ecereNameSpace__ecere__sys__OldList *  definitions;
172 struct Symbol * symbol;
173 struct Location blockStart;
174 struct Location nameLoc;
175 int endid;
176 int declMode;
177 unsigned int deleteWatchable;
178 } __attribute__ ((gcc_struct));
179
180 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Context;
181
182 struct Context
183 {
184 struct Context * parent;
185 struct __ecereNameSpace__ecere__sys__BinaryTree types;
186 struct __ecereNameSpace__ecere__sys__BinaryTree classes;
187 struct __ecereNameSpace__ecere__sys__BinaryTree symbols;
188 struct __ecereNameSpace__ecere__sys__BinaryTree structSymbols;
189 int nextID;
190 int simpleID;
191 struct __ecereNameSpace__ecere__sys__BinaryTree templateTypes;
192 struct ClassDefinition * classDef;
193 unsigned int templateTypesOnly;
194 unsigned int hasNameSpace;
195 } __attribute__ ((gcc_struct));
196
197 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Instantiation;
198
199 struct Instantiation
200 {
201 struct Instantiation * prev;
202 struct Instantiation * next;
203 struct Location loc;
204 struct Specifier * _class;
205 struct Expression * exp;
206 struct __ecereNameSpace__ecere__sys__OldList *  members;
207 struct Symbol * symbol;
208 unsigned int fullSet;
209 unsigned int isConstant;
210 unsigned char *  data;
211 struct Location nameLoc;
212 struct Location insideLoc;
213 unsigned int built;
214 } __attribute__ ((gcc_struct));
215
216 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Declaration;
217
218 struct Declaration
219 {
220 struct Declaration * prev;
221 struct Declaration * next;
222 struct Location loc;
223 int type;
224 union
225 {
226 struct
227 {
228 struct __ecereNameSpace__ecere__sys__OldList *  specifiers;
229 struct __ecereNameSpace__ecere__sys__OldList *  declarators;
230 } __attribute__ ((gcc_struct));
231 struct Instantiation * inst;
232 struct
233 {
234 struct Identifier * id;
235 struct Expression * exp;
236 } __attribute__ ((gcc_struct));
237 } __attribute__ ((gcc_struct));
238 struct Specifier * extStorage;
239 struct Symbol * symbol;
240 int declMode;
241 } __attribute__ ((gcc_struct));
242
243 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Statement;
244
245 struct Statement
246 {
247 struct Statement * prev;
248 struct Statement * next;
249 struct Location loc;
250 int type;
251 union
252 {
253 struct __ecereNameSpace__ecere__sys__OldList *  expressions;
254 struct
255 {
256 struct Identifier * id;
257 struct Statement * stmt;
258 } __attribute__ ((gcc_struct)) labeled;
259 struct
260 {
261 struct Expression * exp;
262 struct Statement * stmt;
263 } __attribute__ ((gcc_struct)) caseStmt;
264 struct
265 {
266 struct __ecereNameSpace__ecere__sys__OldList * declarations;
267 struct __ecereNameSpace__ecere__sys__OldList * statements;
268 struct Context * context;
269 unsigned int isSwitch;
270 } __attribute__ ((gcc_struct)) compound;
271 struct
272 {
273 struct __ecereNameSpace__ecere__sys__OldList * exp;
274 struct Statement * stmt;
275 struct Statement * elseStmt;
276 } __attribute__ ((gcc_struct)) ifStmt;
277 struct
278 {
279 struct __ecereNameSpace__ecere__sys__OldList * exp;
280 struct Statement * stmt;
281 } __attribute__ ((gcc_struct)) switchStmt;
282 struct
283 {
284 struct __ecereNameSpace__ecere__sys__OldList * exp;
285 struct Statement * stmt;
286 } __attribute__ ((gcc_struct)) whileStmt;
287 struct
288 {
289 struct __ecereNameSpace__ecere__sys__OldList * exp;
290 struct Statement * stmt;
291 } __attribute__ ((gcc_struct)) doWhile;
292 struct
293 {
294 struct Statement * init;
295 struct Statement * check;
296 struct __ecereNameSpace__ecere__sys__OldList * increment;
297 struct Statement * stmt;
298 } __attribute__ ((gcc_struct)) forStmt;
299 struct
300 {
301 struct Identifier * id;
302 } __attribute__ ((gcc_struct)) gotoStmt;
303 struct
304 {
305 struct Specifier * spec;
306 char * statements;
307 struct __ecereNameSpace__ecere__sys__OldList * inputFields;
308 struct __ecereNameSpace__ecere__sys__OldList * outputFields;
309 struct __ecereNameSpace__ecere__sys__OldList * clobberedFields;
310 } __attribute__ ((gcc_struct)) asmStmt;
311 struct
312 {
313 struct Expression * watcher;
314 struct Expression * object;
315 struct __ecereNameSpace__ecere__sys__OldList * watches;
316 } __attribute__ ((gcc_struct)) _watch;
317 struct
318 {
319 struct Identifier * id;
320 struct __ecereNameSpace__ecere__sys__OldList * exp;
321 struct __ecereNameSpace__ecere__sys__OldList * filter;
322 struct Statement * stmt;
323 } __attribute__ ((gcc_struct)) forEachStmt;
324 struct Declaration * decl;
325 } __attribute__ ((gcc_struct));
326 } __attribute__ ((gcc_struct));
327
328 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TypeName;
329
330 struct TypeName
331 {
332 struct TypeName * prev;
333 struct TypeName * next;
334 struct Location loc;
335 struct __ecereNameSpace__ecere__sys__OldList *  qualifiers;
336 struct Declarator * declarator;
337 int classObjectType;
338 struct Expression * bitCount;
339 } __attribute__ ((gcc_struct));
340
341 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Initializer;
342
343 struct Initializer
344 {
345 struct Initializer * prev;
346 struct Initializer * next;
347 struct Location loc;
348 int type;
349 union
350 {
351 struct Expression * exp;
352 struct __ecereNameSpace__ecere__sys__OldList *  list;
353 } __attribute__ ((gcc_struct));
354 unsigned int isConstant;
355 } __attribute__ ((gcc_struct));
356
357 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__DataValue;
358
359 struct __ecereNameSpace__ecere__com__DataValue
360 {
361 union
362 {
363 char c;
364 unsigned char uc;
365 short s;
366 unsigned short us;
367 int i;
368 unsigned int ui;
369 void *  p;
370 float f;
371 double d;
372 long long i64;
373 uint64 ui64;
374 } __attribute__ ((gcc_struct));
375 } __attribute__ ((gcc_struct));
376
377 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Expression;
378
379 struct Expression
380 {
381 struct Expression * prev;
382 struct Expression * next;
383 struct Location loc;
384 int type;
385 union
386 {
387 struct
388 {
389 char *  constant;
390 struct Identifier * identifier;
391 } __attribute__ ((gcc_struct));
392 struct Statement * compound;
393 struct Instantiation * instance;
394 struct
395 {
396 char *  string;
397 unsigned int intlString;
398 } __attribute__ ((gcc_struct));
399 struct __ecereNameSpace__ecere__sys__OldList *  list;
400 struct
401 {
402 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
403 struct Declarator * decl;
404 } __attribute__ ((gcc_struct)) _classExp;
405 struct
406 {
407 struct Identifier * id;
408 } __attribute__ ((gcc_struct)) classData;
409 struct
410 {
411 struct Expression * exp;
412 struct __ecereNameSpace__ecere__sys__OldList * arguments;
413 struct Location argLoc;
414 } __attribute__ ((gcc_struct)) call;
415 struct
416 {
417 struct Expression * exp;
418 struct __ecereNameSpace__ecere__sys__OldList * index;
419 } __attribute__ ((gcc_struct)) index;
420 struct
421 {
422 struct Expression * exp;
423 struct Identifier * member;
424 int memberType;
425 unsigned int thisPtr;
426 } __attribute__ ((gcc_struct)) member;
427 struct
428 {
429 int op;
430 struct Expression * exp1;
431 struct Expression * exp2;
432 } __attribute__ ((gcc_struct)) op;
433 struct TypeName * typeName;
434 struct Specifier * _class;
435 struct
436 {
437 struct TypeName * typeName;
438 struct Expression * exp;
439 } __attribute__ ((gcc_struct)) cast;
440 struct
441 {
442 struct Expression * cond;
443 struct __ecereNameSpace__ecere__sys__OldList * exp;
444 struct Expression * elseExp;
445 } __attribute__ ((gcc_struct)) cond;
446 struct
447 {
448 struct TypeName * typeName;
449 struct Expression * size;
450 } __attribute__ ((gcc_struct)) _new;
451 struct
452 {
453 struct TypeName * typeName;
454 struct Expression * size;
455 struct Expression * exp;
456 } __attribute__ ((gcc_struct)) _renew;
457 struct
458 {
459 char * table;
460 struct Identifier * id;
461 } __attribute__ ((gcc_struct)) db;
462 struct
463 {
464 struct Expression * ds;
465 struct Expression * name;
466 } __attribute__ ((gcc_struct)) dbopen;
467 struct
468 {
469 struct TypeName * typeName;
470 struct Initializer * initializer;
471 } __attribute__ ((gcc_struct)) initializer;
472 struct
473 {
474 struct Expression * exp;
475 struct TypeName * typeName;
476 } __attribute__ ((gcc_struct)) vaArg;
477 } __attribute__ ((gcc_struct));
478 unsigned int debugValue;
479 struct __ecereNameSpace__ecere__com__DataValue val;
480 uint64 address;
481 unsigned int hasAddress;
482 struct Type * expType;
483 struct Type * destType;
484 unsigned int usage;
485 int tempCount;
486 unsigned int byReference;
487 unsigned int isConstant;
488 unsigned int addedThis;
489 unsigned int needCast;
490 unsigned int thisPtr;
491 } __attribute__ ((gcc_struct));
492
493 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplateDatatype;
494
495 struct TemplateDatatype
496 {
497 struct __ecereNameSpace__ecere__sys__OldList *  specifiers;
498 struct Declarator * decl;
499 } __attribute__ ((gcc_struct));
500
501 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplateArgument;
502
503 struct TemplateArgument;
504
505 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplateParameter;
506
507 struct TemplateParameter
508 {
509 struct TemplateParameter * prev;
510 struct TemplateParameter * next;
511 struct Location loc;
512 int type;
513 struct Identifier * identifier;
514 union
515 {
516 struct TemplateDatatype * dataType;
517 int memberType;
518 } __attribute__ ((gcc_struct));
519 struct TemplateArgument * defaultArgument;
520 char *  dataTypeString;
521 struct Type * baseType;
522 } __attribute__ ((gcc_struct));
523
524 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Specifier;
525
526 struct Specifier
527 {
528 struct Specifier * prev;
529 struct Specifier * next;
530 struct Location loc;
531 int type;
532 union
533 {
534 int specifier;
535 struct
536 {
537 struct ExtDecl * extDecl;
538 char *  name;
539 struct Symbol * symbol;
540 struct __ecereNameSpace__ecere__sys__OldList *  templateArgs;
541 } __attribute__ ((gcc_struct));
542 struct
543 {
544 struct Identifier * id;
545 struct __ecereNameSpace__ecere__sys__OldList *  list;
546 struct __ecereNameSpace__ecere__sys__OldList *  baseSpecs;
547 struct __ecereNameSpace__ecere__sys__OldList *  definitions;
548 unsigned int addNameSpace;
549 struct Context * ctx;
550 struct ExtDecl * extDeclStruct;
551 } __attribute__ ((gcc_struct));
552 struct Expression * expression;
553 struct Specifier * _class;
554 struct TemplateParameter * templateParameter;
555 } __attribute__ ((gcc_struct));
556 } __attribute__ ((gcc_struct));
557
558 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Identifier;
559
560 struct Identifier
561 {
562 struct Identifier * prev;
563 struct Identifier * next;
564 struct Location loc;
565 struct Symbol * classSym;
566 struct Specifier * _class;
567 char *  string;
568 struct Identifier * badID;
569 } __attribute__ ((gcc_struct));
570
571 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Pointer;
572
573 struct Pointer;
574
575 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Declarator;
576
577 struct Declarator
578 {
579 struct Declarator * prev;
580 struct Declarator * next;
581 struct Location loc;
582 int type;
583 struct Symbol * symbol;
584 struct Declarator * declarator;
585 union
586 {
587 struct Identifier * identifier;
588 struct
589 {
590 struct Expression * exp;
591 struct Expression * posExp;
592 struct Attrib * attrib;
593 } __attribute__ ((gcc_struct)) structDecl;
594 struct
595 {
596 struct Expression * exp;
597 struct Specifier * enumClass;
598 } __attribute__ ((gcc_struct)) array;
599 struct
600 {
601 struct __ecereNameSpace__ecere__sys__OldList * parameters;
602 } __attribute__ ((gcc_struct)) function;
603 struct
604 {
605 struct Pointer * pointer;
606 } __attribute__ ((gcc_struct)) pointer;
607 struct
608 {
609 struct ExtDecl * extended;
610 } __attribute__ ((gcc_struct)) extended;
611 } __attribute__ ((gcc_struct));
612 } __attribute__ ((gcc_struct));
613
614 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_FunctionDefinition;
615
616 struct FunctionDefinition
617 {
618 struct FunctionDefinition * prev;
619 struct FunctionDefinition * next;
620 struct Location loc;
621 struct __ecereNameSpace__ecere__sys__OldList *  specifiers;
622 struct Declarator * declarator;
623 struct __ecereNameSpace__ecere__sys__OldList *  declarations;
624 struct Statement * body;
625 struct __ecereNameSpace__ecere__com__Class * _class;
626 struct __ecereNameSpace__ecere__sys__OldList attached;
627 int declMode;
628 struct Type * type;
629 struct Symbol * propSet;
630 int tempCount;
631 unsigned int propertyNoThis;
632 } __attribute__ ((gcc_struct));
633
634 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_DBTableDef;
635
636 struct DBTableDef;
637
638 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_External;
639
640 struct External
641 {
642 struct External * prev;
643 struct External * next;
644 struct Location loc;
645 int type;
646 struct Symbol * symbol;
647 union
648 {
649 struct FunctionDefinition * function;
650 struct ClassDefinition * _class;
651 struct Declaration * declaration;
652 char *  importString;
653 struct Identifier * id;
654 struct DBTableDef * table;
655 } __attribute__ ((gcc_struct));
656 int importType;
657 } __attribute__ ((gcc_struct));
658
659 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ModuleImport;
660
661 struct ModuleImport
662 {
663 struct ModuleImport * prev;
664 struct ModuleImport * next;
665 char *  name;
666 struct __ecereNameSpace__ecere__sys__OldList classes;
667 struct __ecereNameSpace__ecere__sys__OldList functions;
668 int importType;
669 int importAccess;
670 } __attribute__ ((gcc_struct));
671
672 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassImport;
673
674 struct ClassImport
675 {
676 struct ClassImport * prev;
677 struct ClassImport * next;
678 char *  name;
679 struct __ecereNameSpace__ecere__sys__OldList methods;
680 struct __ecereNameSpace__ecere__sys__OldList properties;
681 unsigned int itself;
682 unsigned int isRemote;
683 } __attribute__ ((gcc_struct));
684
685 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Symbol;
686
687 struct Symbol
688 {
689 char *  string;
690 struct Symbol * parent;
691 struct Symbol * left;
692 struct Symbol * right;
693 int depth;
694 struct Type * type;
695 union
696 {
697 struct __ecereNameSpace__ecere__com__Method * method;
698 struct __ecereNameSpace__ecere__com__Property * _property;
699 struct __ecereNameSpace__ecere__com__Class * registered;
700 } __attribute__ ((gcc_struct));
701 int id;
702 int idCode;
703 union
704 {
705 struct
706 {
707 struct External * pointerExternal;
708 struct External * structExternal;
709 } __attribute__ ((gcc_struct));
710 struct
711 {
712 struct External * externalGet;
713 struct External * externalSet;
714 struct External * externalPtr;
715 struct External * externalIsSet;
716 } __attribute__ ((gcc_struct));
717 struct
718 {
719 struct External * methodExternal;
720 struct External * methodCodeExternal;
721 } __attribute__ ((gcc_struct));
722 } __attribute__ ((gcc_struct));
723 unsigned int imported;
724 unsigned int declaredStructSym;
725 struct __ecereNameSpace__ecere__com__Class * _class;
726 unsigned int declaredStruct;
727 unsigned int needConstructor;
728 unsigned int needDestructor;
729 char *  constructorName;
730 char *  structName;
731 char *  className;
732 char *  destructorName;
733 struct ModuleImport * module;
734 struct ClassImport * _import;
735 struct Location nameLoc;
736 unsigned int isParam;
737 unsigned int isRemote;
738 unsigned int isStruct;
739 unsigned int fireWatchersDone;
740 int declaring;
741 unsigned int classData;
742 unsigned int isStatic;
743 char *  shortName;
744 struct __ecereNameSpace__ecere__sys__OldList *  templateParams;
745 struct __ecereNameSpace__ecere__sys__OldList templatedClasses;
746 struct Context * ctx;
747 int isIterator;
748 struct Expression * propCategory;
749 } __attribute__ ((gcc_struct));
750
751 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Type;
752
753 struct Type
754 {
755 struct Type * prev;
756 struct Type * next;
757 int refCount;
758 union
759 {
760 struct Symbol * _class;
761 struct
762 {
763 struct __ecereNameSpace__ecere__sys__OldList members;
764 char *  enumName;
765 } __attribute__ ((gcc_struct));
766 struct
767 {
768 struct Type * returnType;
769 struct __ecereNameSpace__ecere__sys__OldList params;
770 struct Symbol * thisClass;
771 unsigned int staticMethod;
772 struct TemplateParameter * thisClassTemplate;
773 } __attribute__ ((gcc_struct));
774 struct
775 {
776 struct __ecereNameSpace__ecere__com__Method * method;
777 struct __ecereNameSpace__ecere__com__Class * methodClass;
778 struct __ecereNameSpace__ecere__com__Class * usedClass;
779 } __attribute__ ((gcc_struct));
780 struct
781 {
782 struct Type * arrayType;
783 int arraySize;
784 struct Expression * arraySizeExp;
785 unsigned int freeExp;
786 struct Symbol * enumClass;
787 } __attribute__ ((gcc_struct));
788 struct Type * type;
789 struct TemplateParameter * templateParameter;
790 } __attribute__ ((gcc_struct));
791 int kind;
792 unsigned int size;
793 char *  name;
794 char *  typeName;
795 int classObjectType;
796 int alignment;
797 unsigned int offset;
798 int bitFieldCount;
799 int count;
800 unsigned int isSigned : 1;
801 unsigned int constant : 1;
802 unsigned int truth : 1;
803 unsigned int byReference : 1;
804 unsigned int extraParam : 1;
805 unsigned int directClassAccess : 1;
806 unsigned int computing : 1;
807 unsigned int keepCast : 1;
808 unsigned int passAsTemplate : 1;
809 unsigned int dllExport : 1;
810 unsigned int attrStdcall : 1;
811 unsigned int declaredWithStruct : 1;
812 unsigned int typedByReference : 1;
813 } __attribute__ ((gcc_struct));
814
815 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Class;
816
817 struct __ecereNameSpace__ecere__com__Class
818 {
819 struct __ecereNameSpace__ecere__com__Class * prev;
820 struct __ecereNameSpace__ecere__com__Class * next;
821 char *  name;
822 int offset;
823 int structSize;
824 int (* *  _vTbl)();
825 int vTblSize;
826 int (*  Constructor)(struct __ecereNameSpace__ecere__com__Instance *);
827 void (*  Destructor)(struct __ecereNameSpace__ecere__com__Instance *);
828 int offsetClass;
829 int sizeClass;
830 struct __ecereNameSpace__ecere__com__Class * base;
831 struct __ecereNameSpace__ecere__sys__BinaryTree methods;
832 struct __ecereNameSpace__ecere__sys__BinaryTree members;
833 struct __ecereNameSpace__ecere__sys__BinaryTree prop;
834 struct __ecereNameSpace__ecere__sys__OldList membersAndProperties;
835 struct __ecereNameSpace__ecere__sys__BinaryTree classProperties;
836 struct __ecereNameSpace__ecere__sys__OldList derivatives;
837 int memberID;
838 int startMemberID;
839 int type;
840 struct __ecereNameSpace__ecere__com__Instance * module;
841 struct __ecereNameSpace__ecere__com__NameSpace *  nameSpace;
842 char *  dataTypeString;
843 struct Type * dataType;
844 int typeSize;
845 int defaultAlignment;
846 void (*  Initialize)();
847 int memberOffset;
848 struct __ecereNameSpace__ecere__sys__OldList selfWatchers;
849 char *  designerClass;
850 unsigned int noExpansion;
851 char *  defaultProperty;
852 unsigned int comRedefinition;
853 int count;
854 unsigned int isRemote;
855 unsigned int internalDecl;
856 void *  data;
857 unsigned int computeSize;
858 int structAlignment;
859 int destructionWatchOffset;
860 unsigned int fixed;
861 struct __ecereNameSpace__ecere__sys__OldList delayedCPValues;
862 int inheritanceAccess;
863 char *  fullName;
864 void *  symbol;
865 struct __ecereNameSpace__ecere__sys__OldList conversions;
866 struct __ecereNameSpace__ecere__sys__OldList templateParams;
867 struct __ecereNameSpace__ecere__com__ClassTemplateArgument *  templateArgs;
868 struct __ecereNameSpace__ecere__com__Class * templateClass;
869 struct __ecereNameSpace__ecere__sys__OldList templatized;
870 int numParams;
871 unsigned int isInstanceClass;
872 unsigned int byValueSystemClass;
873 } __attribute__ ((gcc_struct));
874
875 extern long long __ecereNameSpace__ecere__com__eClass_GetProperty(struct __ecereNameSpace__ecere__com__Class * _class, char *  name);
876
877 extern void __ecereNameSpace__ecere__com__eInstance_FireSelfWatchers(struct __ecereNameSpace__ecere__com__Instance * instance, struct __ecereNameSpace__ecere__com__Property * _property);
878
879 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Instance;
880
881 struct __ecereNameSpace__ecere__com__Instance
882 {
883 int (* *  _vTbl)();
884 struct __ecereNameSpace__ecere__com__Class * _class;
885 int _refCount;
886 } __attribute__ ((gcc_struct));
887
888 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__DataMember;
889
890 struct __ecereNameSpace__ecere__com__DataMember
891 {
892 struct __ecereNameSpace__ecere__com__DataMember * prev;
893 struct __ecereNameSpace__ecere__com__DataMember * next;
894 char *  name;
895 unsigned int isProperty;
896 int memberAccess;
897 int id;
898 struct __ecereNameSpace__ecere__com__Class * _class;
899 char *  dataTypeString;
900 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
901 struct Type * dataType;
902 int type;
903 int offset;
904 int memberID;
905 struct __ecereNameSpace__ecere__sys__OldList members;
906 struct __ecereNameSpace__ecere__sys__BinaryTree membersAlpha;
907 int memberOffset;
908 int structAlignment;
909 } __attribute__ ((gcc_struct));
910
911 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__SerialBuffer;
912
913 struct __ecereNameSpace__ecere__com__SerialBuffer
914 {
915 unsigned char *  _buffer;
916 unsigned int count;
917 unsigned int _size;
918 unsigned int pos;
919 } __attribute__ ((gcc_struct));
920
921 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__ClassTemplateArgument;
922
923 struct __ecereNameSpace__ecere__com__ClassTemplateArgument
924 {
925 union
926 {
927 struct
928 {
929 char *  dataTypeString;
930 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
931 } __attribute__ ((gcc_struct));
932 struct __ecereNameSpace__ecere__com__DataValue expression;
933 struct
934 {
935 char *  memberString;
936 union
937 {
938 struct __ecereNameSpace__ecere__com__DataMember * member;
939 struct __ecereNameSpace__ecere__com__Property * prop;
940 struct __ecereNameSpace__ecere__com__Method * method;
941 } __attribute__ ((gcc_struct));
942 } __attribute__ ((gcc_struct));
943 } __attribute__ ((gcc_struct));
944 } __attribute__ ((gcc_struct));
945
946 void exit(int status);
947
948 void * calloc(size_t nmemb, size_t size);
949
950 void free(void * ptr);
951
952 void * malloc(size_t size);
953
954 void * realloc(void * ptr, size_t size);
955
956 long int strtol(const char * nptr, char ** endptr, int base);
957
958 long long int strtoll(const char * nptr, char ** endptr, int base);
959
960 unsigned long long int strtoull(const char * nptr, char ** endptr, int base);
961
962 enum yytokentype
963 {
964 IDENTIFIER = 258, CONSTANT = 259, STRING_LITERAL = 260, SIZEOF = 261, PTR_OP = 262, INC_OP = 263, DEC_OP = 264, LEFT_OP = 265, RIGHT_OP = 266, LE_OP = 267, GE_OP = 268, EQ_OP = 269, NE_OP = 270, AND_OP = 271, OR_OP = 272, MUL_ASSIGN = 273, DIV_ASSIGN = 274, MOD_ASSIGN = 275, ADD_ASSIGN = 276, SUB_ASSIGN = 277, LEFT_ASSIGN = 278, RIGHT_ASSIGN = 279, AND_ASSIGN = 280, XOR_ASSIGN = 281, OR_ASSIGN = 282, TYPE_NAME = 283, TYPEDEF = 284, EXTERN = 285, STATIC = 286, AUTO = 287, REGISTER = 288, CHAR = 289, SHORT = 290, INT = 291, UINT = 292, INT64 = 293, LONG = 294, SIGNED = 295, UNSIGNED = 296, FLOAT = 297, DOUBLE = 298, CONST = 299, VOLATILE = 300, VOID = 301, VALIST = 302, STRUCT = 303, UNION = 304, ENUM = 305, ELLIPSIS = 306, CASE = 307, DEFAULT = 308, IF = 309, SWITCH = 310, WHILE = 311, DO = 312, FOR = 313, GOTO = 314, CONTINUE = 315, BREAK = 316, RETURN = 317, IFX = 318, ELSE = 319, CLASS = 320, THISCLASS = 321, CLASS_NAME = 322, PROPERTY = 323, SETPROP = 324, GETPROP = 325, NEWOP = 326, RENEW = 327, DELETE = 328, EXT_DECL = 329, EXT_STORAGE = 330, IMPORT = 331, DEFINE = 332, VIRTUAL = 333, ATTRIB = 334, PUBLIC = 335, PRIVATE = 336, TYPED_OBJECT = 337, ANY_OBJECT = 338, _INCREF = 339, EXTENSION = 340, ASM = 341, TYPEOF = 342, WATCH = 343, STOPWATCHING = 344, FIREWATCHERS = 345, WATCHABLE = 346, CLASS_DESIGNER = 347, CLASS_NO_EXPANSION = 348, CLASS_FIXED = 349, ISPROPSET = 350, CLASS_DEFAULT_PROPERTY = 351, PROPERTY_CATEGORY = 352, CLASS_DATA = 353, CLASS_PROPERTY = 354, SUBCLASS = 355, NAMESPACE = 356, NEW0OP = 357, RENEW0 = 358, VAARG = 359, DBTABLE = 360, DBFIELD = 361, DBINDEX = 362, DATABASE_OPEN = 363, ALIGNOF = 364, ATTRIB_DEP = 365, __ATTRIB = 366, BOOL = 367, _BOOL = 368, _COMPLEX = 369, _IMAGINARY = 370, RESTRICT = 371, THREAD = 372
965 };
966
967 typedef union YYSTYPE
968 {
969 int specifierType;
970 int i;
971 int declMode;
972 struct Identifier * id;
973 struct Expression * exp;
974 struct Specifier * specifier;
975 struct __ecereNameSpace__ecere__sys__OldList * list;
976 struct Enumerator * enumerator;
977 struct Declarator * declarator;
978 struct Pointer * pointer;
979 struct Initializer * initializer;
980 struct InitDeclarator * initDeclarator;
981 struct TypeName * typeName;
982 struct Declaration * declaration;
983 struct Statement * stmt;
984 struct FunctionDefinition * function;
985 struct External * external;
986 struct Context * context;
987 struct AsmField * asmField;
988 struct Attrib * attrib;
989 struct ExtDecl * extDecl;
990 struct Attribute * attribute;
991 struct Instantiation * instance;
992 struct MembersInit * membersInit;
993 struct MemberInit * memberInit;
994 struct ClassFunction * classFunction;
995 struct ClassDefinition * _class;
996 struct ClassDef * classDef;
997 struct PropertyDef * prop;
998 char * string;
999 struct Symbol * symbol;
1000 struct PropertyWatch * propertyWatch;
1001 struct TemplateParameter * templateParameter;
1002 struct TemplateArgument * templateArgument;
1003 struct TemplateDatatype * templateDatatype;
1004 struct DBTableEntry * dbtableEntry;
1005 struct DBIndexItem * dbindexItem;
1006 struct DBTableDef * dbtableDef;
1007 } __attribute__ ((gcc_struct)) YYSTYPE;
1008
1009 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Enumerator;
1010
1011 struct Enumerator
1012 {
1013 struct Enumerator * prev;
1014 struct Enumerator * next;
1015 struct Location loc;
1016 struct Identifier * id;
1017 struct Expression * exp;
1018 } __attribute__ ((gcc_struct));
1019
1020 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_InitDeclarator;
1021
1022 struct InitDeclarator
1023 {
1024 struct InitDeclarator * prev;
1025 struct InitDeclarator * next;
1026 struct Location loc;
1027 struct Declarator * declarator;
1028 struct Initializer * initializer;
1029 } __attribute__ ((gcc_struct));
1030
1031 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_AsmField;
1032
1033 struct AsmField
1034 {
1035 struct AsmField * prev;
1036 struct AsmField * next;
1037 struct Location loc;
1038 char *  command;
1039 struct Expression * expression;
1040 struct Identifier * symbolic;
1041 } __attribute__ ((gcc_struct));
1042
1043 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Attribute;
1044
1045 struct Attribute;
1046
1047 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassFunction;
1048
1049 struct ClassFunction
1050 {
1051 struct ClassFunction * prev;
1052 struct ClassFunction * next;
1053 struct Location loc;
1054 struct __ecereNameSpace__ecere__sys__OldList *  specifiers;
1055 struct Declarator * declarator;
1056 struct __ecereNameSpace__ecere__sys__OldList *  declarations;
1057 struct Statement * body;
1058 struct __ecereNameSpace__ecere__com__Class * _class;
1059 struct __ecereNameSpace__ecere__sys__OldList attached;
1060 int declMode;
1061 struct Type * type;
1062 struct Symbol * propSet;
1063 unsigned int isVirtual;
1064 unsigned int isConstructor;
1065 unsigned int isDestructor;
1066 unsigned int dontMangle;
1067 int id;
1068 int idCode;
1069 } __attribute__ ((gcc_struct));
1070
1071 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_MembersInit;
1072
1073 struct MembersInit
1074 {
1075 struct MembersInit * prev;
1076 struct MembersInit * next;
1077 struct Location loc;
1078 int type;
1079 union
1080 {
1081 struct __ecereNameSpace__ecere__sys__OldList *  dataMembers;
1082 struct ClassFunction * function;
1083 } __attribute__ ((gcc_struct));
1084 } __attribute__ ((gcc_struct));
1085
1086 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_MemberInit;
1087
1088 struct MemberInit
1089 {
1090 struct MemberInit * prev;
1091 struct MemberInit * next;
1092 struct Location loc;
1093 struct Location realLoc;
1094 struct __ecereNameSpace__ecere__sys__OldList *  identifiers;
1095 struct Initializer * initializer;
1096 unsigned int used;
1097 unsigned int variable;
1098 unsigned int takeOutExp;
1099 } __attribute__ ((gcc_struct));
1100
1101 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_PropertyDef;
1102
1103 struct PropertyDef
1104 {
1105 struct PropertyDef * prev;
1106 struct PropertyDef * next;
1107 struct Location loc;
1108 struct __ecereNameSpace__ecere__sys__OldList *  specifiers;
1109 struct Declarator * declarator;
1110 struct Identifier * id;
1111 struct Statement * getStmt;
1112 struct Statement * setStmt;
1113 struct Statement * issetStmt;
1114 struct Symbol * symbol;
1115 struct Expression * category;
1116 struct
1117 {
1118 unsigned int conversion : 1;
1119 unsigned int isWatchable : 1;
1120 unsigned int isDBProp : 1;
1121 } __attribute__ ((gcc_struct));
1122 } __attribute__ ((gcc_struct));
1123
1124 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_PropertyWatch;
1125
1126 struct PropertyWatch
1127 {
1128 struct PropertyWatch * prev;
1129 struct PropertyWatch * next;
1130 struct Location loc;
1131 struct Statement * compound;
1132 struct __ecereNameSpace__ecere__sys__OldList *  properties;
1133 unsigned int deleteWatch;
1134 } __attribute__ ((gcc_struct));
1135
1136 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassDef;
1137
1138 struct ClassDef
1139 {
1140 struct ClassDef * prev;
1141 struct ClassDef * next;
1142 struct Location loc;
1143 int type;
1144 union
1145 {
1146 struct Declaration * decl;
1147 struct ClassFunction * function;
1148 struct __ecereNameSpace__ecere__sys__OldList *  defProperties;
1149 struct PropertyDef * propertyDef;
1150 struct PropertyWatch * propertyWatch;
1151 char *  designer;
1152 struct Identifier * defaultProperty;
1153 struct
1154 {
1155 struct Identifier * id;
1156 struct Initializer * initializer;
1157 } __attribute__ ((gcc_struct));
1158 } __attribute__ ((gcc_struct));
1159 int memberAccess;
1160 void *  object;
1161 } __attribute__ ((gcc_struct));
1162
1163 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_DBTableEntry;
1164
1165 struct DBTableEntry;
1166
1167 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_DBIndexItem;
1168
1169 struct DBIndexItem;
1170
1171 extern YYSTYPE yylval;
1172
1173 extern struct Location yylloc;
1174
1175 extern struct __ecereNameSpace__ecere__sys__OldList * ast;
1176
1177 extern int returnCode;
1178
1179 extern struct Expression * parsedExpression;
1180
1181 extern unsigned int yydebug;
1182
1183 void SetYydebug(unsigned int b)
1184 {
1185 yydebug = b;
1186 }
1187
1188 extern unsigned int echoOn;
1189
1190 void resetScanner();
1191
1192 int propWatcherID;
1193
1194 int expression_yyparse();
1195
1196 static struct Statement * curCompound;
1197
1198 struct External * curExternal, * afterExternal;
1199
1200 static struct Type * curSwitchType;
1201
1202 static struct __ecereNameSpace__ecere__com__Class * currentClass;
1203
1204 struct __ecereNameSpace__ecere__com__Class * thisClass;
1205
1206 void SetThisClass(struct __ecereNameSpace__ecere__com__Class * c)
1207 {
1208 thisClass = c;
1209 }
1210
1211 struct __ecereNameSpace__ecere__com__Class * GetThisClass()
1212 {
1213 return thisClass;
1214 }
1215
1216 static char * thisNameSpace;
1217
1218 struct __ecereNameSpace__ecere__com__Class * containerClass;
1219
1220 unsigned int thisClassParams = 0x1;
1221
1222 unsigned int internalValueCounter;
1223
1224 extern void OutputExpression(struct Expression * exp, struct __ecereNameSpace__ecere__com__Instance * f);
1225
1226 extern size_t strlen(const char * );
1227
1228 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__TempFile;
1229
1230 extern void *  __ecereNameSpace__ecere__com__eInstance_New(struct __ecereNameSpace__ecere__com__Class * _class);
1231
1232 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek;
1233
1234 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Read;
1235
1236 extern void __ecereNameSpace__ecere__com__eInstance_DecRef(struct __ecereNameSpace__ecere__com__Instance * instance);
1237
1238 void PrintExpression(struct Expression * exp, char * string)
1239 {
1240 {
1241 struct __ecereNameSpace__ecere__com__Instance * f = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
1242 int count;
1243
1244 if(exp)
1245 OutputExpression(exp, f);
1246 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))__extension__ ({
1247 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = f;
1248
1249 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__TempFile->_vTbl;
1250 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(f, 0, 0);
1251 count = strlen(string);
1252 count += ((int (*)(struct __ecereNameSpace__ecere__com__Instance *, void *  buffer, unsigned int size, unsigned int count))__extension__ ({
1253 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = f;
1254
1255 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__TempFile->_vTbl;
1256 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Read])(f, string + count, 1, 1023);
1257 string[count] = '\0';
1258 (__ecereNameSpace__ecere__com__eInstance_DecRef(f), f = 0);
1259 }
1260 }
1261
1262 extern struct Type * ProcessTypeString(char *  string, unsigned int staticMethod);
1263
1264 extern struct Type * ProcessType(struct __ecereNameSpace__ecere__sys__OldList * specs, struct Declarator * decl);
1265
1266 struct Type * ProcessTemplateParameterType(struct TemplateParameter * param)
1267 {
1268 if(param && param->type == 0 && (param->dataType || param->dataTypeString))
1269 {
1270 if(!param->baseType)
1271 {
1272 if(param->dataTypeString)
1273 param->baseType = ProcessTypeString(param->dataTypeString, 0x0);
1274 else
1275 param->baseType = ProcessType(param->dataType->specifiers, param->dataType->decl);
1276 }
1277 return param->baseType;
1278 }
1279 return (((void *)0));
1280 }
1281
1282 unsigned int NeedCast(struct Type * type1, struct Type * type2)
1283 {
1284 if(!type1 || !type2 || type1->keepCast || type2->keepCast)
1285 return 0x1;
1286 if(type1->kind == 20 && type2->kind == 4 && type2->passAsTemplate == 0x0)
1287 {
1288 return 0x0;
1289 }
1290 if(type1->kind == type2->kind)
1291 {
1292 switch(type1->kind)
1293 {
1294 case 24:
1295 case 1:
1296 case 2:
1297 case 3:
1298 case 4:
1299 case 22:
1300 case 23:
1301 if(type1->passAsTemplate && !type2->passAsTemplate)
1302 return 0x1;
1303 return type1->isSigned != type2->isSigned;
1304 case 8:
1305 return type1->_class != type2->_class;
1306 case 13:
1307 return NeedCast(type1->type, type2->type);
1308 default:
1309 return 0x1;
1310 }
1311 }
1312 return 0x1;
1313 }
1314
1315 extern int strcmp(const char * , const char * );
1316
1317 extern struct Context * curContext;
1318
1319 extern struct Context * topContext;
1320
1321 extern unsigned int __ecereNameSpace__ecere__com__eClass_IsDerived(struct __ecereNameSpace__ecere__com__Class * _class, struct __ecereNameSpace__ecere__com__Class * from);
1322
1323 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);
1324
1325 extern struct __ecereNameSpace__ecere__com__Instance * privateModule;
1326
1327 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);
1328
1329 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);
1330
1331 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__ClassProperty;
1332
1333 struct __ecereNameSpace__ecere__com__ClassProperty
1334 {
1335 char *  name;
1336 struct __ecereNameSpace__ecere__com__ClassProperty * parent;
1337 struct __ecereNameSpace__ecere__com__ClassProperty * left;
1338 struct __ecereNameSpace__ecere__com__ClassProperty * right;
1339 int depth;
1340 void (*  Set)(struct __ecereNameSpace__ecere__com__Class *, long long);
1341 long long (*  Get)(struct __ecereNameSpace__ecere__com__Class *);
1342 char *  dataTypeString;
1343 struct Type * dataType;
1344 unsigned int constant;
1345 } __attribute__ ((gcc_struct));
1346
1347 extern struct __ecereNameSpace__ecere__com__ClassProperty * __ecereNameSpace__ecere__com__eClass_FindClassProperty(struct __ecereNameSpace__ecere__com__Class * _class, char *  name);
1348
1349 extern struct Expression * QMkExpId(char *  id);
1350
1351 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__ClassTemplateParameter;
1352
1353 struct __ecereNameSpace__ecere__com__ClassTemplateParameter
1354 {
1355 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * prev;
1356 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * next;
1357 char *  name;
1358 int type;
1359 union
1360 {
1361 char *  dataTypeString;
1362 int memberType;
1363 } __attribute__ ((gcc_struct));
1364 struct __ecereNameSpace__ecere__com__ClassTemplateArgument defaultArg;
1365 void *  param;
1366 } __attribute__ ((gcc_struct));
1367
1368 extern struct Expression * GetTemplateArgExpByName(char *  paramName, struct __ecereNameSpace__ecere__com__Class * curClass, int tplType);
1369
1370 extern struct __ecereNameSpace__ecere__sys__OldList *  MkList(void);
1371
1372 extern void FreeIdentifier(struct Identifier * id);
1373
1374 void ProcessExpressionType(struct Expression * exp);
1375
1376 extern struct Declarator * SpecDeclFromString(char *  string, struct __ecereNameSpace__ecere__sys__OldList *  specs, struct Declarator * baseDecl);
1377
1378 extern struct __ecereNameSpace__ecere__sys__OldList *  MkListOne(void *  item);
1379
1380 extern struct Expression * MkExpOp(struct Expression * exp1, int op, struct Expression * exp2);
1381
1382 extern struct Expression * MkExpCast(struct TypeName * typeName, struct Expression * expression);
1383
1384 extern struct TypeName * MkTypeName(struct __ecereNameSpace__ecere__sys__OldList * qualifiers, struct Declarator * declarator);
1385
1386 extern struct Declarator * MkDeclaratorPointer(struct Pointer * pointer, struct Declarator * declarator);
1387
1388 extern struct Pointer * MkPointer(struct __ecereNameSpace__ecere__sys__OldList * qualifiers, struct Pointer * pointer);
1389
1390 struct __ecereNameSpace__ecere__sys__BTNode * __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(struct __ecereNameSpace__ecere__sys__BinaryTree * this, char *  key);
1391
1392 static void ReplaceClassMembers(struct Expression * exp, struct __ecereNameSpace__ecere__com__Class * _class)
1393 {
1394 if(exp->type == 0 && exp->identifier)
1395 {
1396 struct Identifier * id = exp->identifier;
1397 struct Context * ctx;
1398 struct Symbol * symbol = (((void *)0));
1399
1400 if(!id->_class || !id->_class->name || strcmp(id->_class->name, "property"))
1401 {
1402 for(ctx = curContext; ctx != topContext->parent && !symbol; ctx = ctx->parent)
1403 {
1404 symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(&ctx->symbols, id->string);
1405 if(symbol)
1406 break;
1407 }
1408 }
1409 if(!symbol && ((!id->_class || (id->_class->name && !strcmp(id->_class->name, "property"))) || (id->classSym && __ecereNameSpace__ecere__com__eClass_IsDerived(_class, id->classSym->registered))))
1410 {
1411 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
1412 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
1413 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
1414 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
1415
1416 if(!prop)
1417 {
1418 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule);
1419 }
1420 if(!prop && !method)
1421 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
1422 if(!prop && !method && !member)
1423 {
1424 classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(_class, id->string);
1425 }
1426 if(prop || method || member || classProp)
1427 {
1428 exp->type = 8;
1429 exp->member.member = id;
1430 exp->member.memberType = 0;
1431 exp->member.exp = QMkExpId("this");
1432 exp->addedThis = 0x1;
1433 }
1434 else if(_class && _class->templateParams.first)
1435 {
1436 struct __ecereNameSpace__ecere__com__Class * sClass;
1437
1438 for(sClass = _class; sClass; sClass = sClass->base)
1439 {
1440 if(sClass->templateParams.first)
1441 {
1442 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
1443
1444 for(param = sClass->templateParams.first; param; param = param->next)
1445 {
1446 if(param->type == 2 && !strcmp(param->name, id->string))
1447 {
1448 struct Expression * argExp = GetTemplateArgExpByName(param->name, _class, 2);
1449
1450 if(argExp)
1451 {
1452 struct Declarator * decl;
1453 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
1454
1455 FreeIdentifier(exp->member.member);
1456 ProcessExpressionType(argExp);
1457 decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
1458 exp->expType = ProcessType(specs, decl);
1459 exp->type = 5;
1460 exp->list = MkListOne(MkExpOp((((void *)0)), '*', MkExpCast(MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl)), MkExpOp((((void *)0)), '&', argExp))));
1461 }
1462 }
1463 }
1464 }
1465 }
1466 }
1467 }
1468 }
1469 }
1470
1471 extern int sprintf(char * , char * , ...);
1472
1473 extern int __ecereNameSpace__ecere__com__GetRuntimePlatform(void);
1474
1475 extern char *  __ecereNameSpace__ecere__sys__CopyString(char *  string);
1476
1477 char * PrintInt(long long result)
1478 {
1479 char temp[100];
1480
1481 if(result > (((long long)0x7fffffffffffffffLL)))
1482 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1483 else
1484 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "%I64dLL" : "%lldLL"), result);
1485 return __ecereNameSpace__ecere__sys__CopyString(temp);
1486 }
1487
1488 char * PrintUInt(uint64 result)
1489 {
1490 char temp[100];
1491
1492 if(result > (0xffffffff))
1493 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1494 else if(result > (((int)0x7fffffff)))
1495 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64X" : "0x%llX"), result);
1496 else
1497 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "%I64d" : "%lld"), result);
1498 return __ecereNameSpace__ecere__sys__CopyString(temp);
1499 }
1500
1501 char * PrintInt64(long long result)
1502 {
1503 char temp[100];
1504
1505 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "%I64dLL" : "%lldLL"), result);
1506 return __ecereNameSpace__ecere__sys__CopyString(temp);
1507 }
1508
1509 char * PrintUInt64(uint64 result)
1510 {
1511 char temp[100];
1512
1513 if(result > (((long long)0x7fffffffffffffffLL)))
1514 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1515 else
1516 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "%I64dLL" : "%lldLL"), result);
1517 return __ecereNameSpace__ecere__sys__CopyString(temp);
1518 }
1519
1520 char * PrintHexUInt(uint64 result)
1521 {
1522 char temp[100];
1523
1524 if(result > (0xffffffff))
1525 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1526 else
1527 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64X" : "0x%llX"), result);
1528 return __ecereNameSpace__ecere__sys__CopyString(temp);
1529 }
1530
1531 char * PrintHexUInt64(uint64 result)
1532 {
1533 char temp[100];
1534
1535 if(result > (0xffffffff))
1536 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1537 else
1538 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64X" : "0x%llX"), result);
1539 return __ecereNameSpace__ecere__sys__CopyString(temp);
1540 }
1541
1542 char * PrintShort(short result)
1543 {
1544 char temp[100];
1545
1546 sprintf(temp, "%d", (unsigned short)result);
1547 return __ecereNameSpace__ecere__sys__CopyString(temp);
1548 }
1549
1550 char * PrintUShort(unsigned short result)
1551 {
1552 char temp[100];
1553
1554 if(result > (unsigned short)32767)
1555 sprintf(temp, "0x%X", (int)result);
1556 else
1557 sprintf(temp, "%d", (int)result);
1558 return __ecereNameSpace__ecere__sys__CopyString(temp);
1559 }
1560
1561 extern int isprint(int c);
1562
1563 char * PrintChar(char result)
1564 {
1565 char temp[100];
1566
1567 if(result > (char)0 && isprint(result))
1568 sprintf(temp, "'%c'", result);
1569 else if(result < (char)0)
1570 sprintf(temp, "%d", (int)result);
1571 else
1572 sprintf(temp, "0x%X", (unsigned char)result);
1573 return __ecereNameSpace__ecere__sys__CopyString(temp);
1574 }
1575
1576 char * PrintUChar(unsigned char result)
1577 {
1578 char temp[100];
1579
1580 sprintf(temp, "0x%X", result);
1581 return __ecereNameSpace__ecere__sys__CopyString(temp);
1582 }
1583
1584 char * PrintFloat(float result)
1585 {
1586 char temp[350];
1587
1588 sprintf(temp, "%.16ff", result);
1589 return __ecereNameSpace__ecere__sys__CopyString(temp);
1590 }
1591
1592 char * PrintDouble(double result)
1593 {
1594 char temp[350];
1595
1596 sprintf(temp, "%.16f", result);
1597 return __ecereNameSpace__ecere__sys__CopyString(temp);
1598 }
1599
1600 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_OpTable;
1601
1602 struct OpTable
1603 {
1604 unsigned int (*  Add)(struct Expression *, struct Operand *, struct Operand *);
1605 unsigned int (*  Sub)(struct Expression *, struct Operand *, struct Operand *);
1606 unsigned int (*  Mul)(struct Expression *, struct Operand *, struct Operand *);
1607 unsigned int (*  Div)(struct Expression *, struct Operand *, struct Operand *);
1608 unsigned int (*  Mod)(struct Expression *, struct Operand *, struct Operand *);
1609 unsigned int (*  Neg)(struct Expression *, struct Operand *);
1610 unsigned int (*  Inc)(struct Expression *, struct Operand *);
1611 unsigned int (*  Dec)(struct Expression *, struct Operand *);
1612 unsigned int (*  Asign)(struct Expression *, struct Operand *, struct Operand *);
1613 unsigned int (*  AddAsign)(struct Expression *, struct Operand *, struct Operand *);
1614 unsigned int (*  SubAsign)(struct Expression *, struct Operand *, struct Operand *);
1615 unsigned int (*  MulAsign)(struct Expression *, struct Operand *, struct Operand *);
1616 unsigned int (*  DivAsign)(struct Expression *, struct Operand *, struct Operand *);
1617 unsigned int (*  ModAsign)(struct Expression *, struct Operand *, struct Operand *);
1618 unsigned int (*  BitAnd)(struct Expression *, struct Operand *, struct Operand *);
1619 unsigned int (*  BitOr)(struct Expression *, struct Operand *, struct Operand *);
1620 unsigned int (*  BitXor)(struct Expression *, struct Operand *, struct Operand *);
1621 unsigned int (*  LShift)(struct Expression *, struct Operand *, struct Operand *);
1622 unsigned int (*  RShift)(struct Expression *, struct Operand *, struct Operand *);
1623 unsigned int (*  BitNot)(struct Expression *, struct Operand *);
1624 unsigned int (*  AndAsign)(struct Expression *, struct Operand *, struct Operand *);
1625 unsigned int (*  OrAsign)(struct Expression *, struct Operand *, struct Operand *);
1626 unsigned int (*  XorAsign)(struct Expression *, struct Operand *, struct Operand *);
1627 unsigned int (*  LShiftAsign)(struct Expression *, struct Operand *, struct Operand *);
1628 unsigned int (*  RShiftAsign)(struct Expression *, struct Operand *, struct Operand *);
1629 unsigned int (*  Not)(struct Expression *, struct Operand *);
1630 unsigned int (*  Equ)(struct Expression *, struct Operand *, struct Operand *);
1631 unsigned int (*  Nqu)(struct Expression *, struct Operand *, struct Operand *);
1632 unsigned int (*  And)(struct Expression *, struct Operand *, struct Operand *);
1633 unsigned int (*  Or)(struct Expression *, struct Operand *, struct Operand *);
1634 unsigned int (*  Grt)(struct Expression *, struct Operand *, struct Operand *);
1635 unsigned int (*  Sma)(struct Expression *, struct Operand *, struct Operand *);
1636 unsigned int (*  GrtEqu)(struct Expression *, struct Operand *, struct Operand *);
1637 unsigned int (*  SmaEqu)(struct Expression *, struct Operand *, struct Operand *);
1638 unsigned int (*  Cond)(struct Expression *, struct Operand *, struct Operand *, struct Operand *);
1639 } __attribute__ ((gcc_struct));
1640
1641 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Operand;
1642
1643 struct Operand
1644 {
1645 int kind;
1646 struct Type * type;
1647 unsigned int ptrSize;
1648 union
1649 {
1650 char c;
1651 unsigned char uc;
1652 short s;
1653 unsigned short us;
1654 int i;
1655 unsigned int ui;
1656 float f;
1657 double d;
1658 long long i64;
1659 uint64 ui64;
1660 } __attribute__ ((gcc_struct));
1661 struct OpTable ops;
1662 } __attribute__ ((gcc_struct));
1663
1664 struct Operand GetOperand(struct Expression * exp);
1665
1666 unsigned int GetInt(struct Expression * exp, int * value2)
1667 {
1668 struct Operand op2 = GetOperand(exp);
1669
1670 if(op2.kind == 3 && op2.type->isSigned)
1671 *value2 = op2.i;
1672 else if(op2.kind == 3)
1673 *value2 = (int)op2.ui;
1674 else if(op2.kind == 4 && op2.type->isSigned)
1675 *value2 = (int)op2.i64;
1676 else if(op2.kind == 4)
1677 *value2 = (int)op2.ui64;
1678 else if(op2.kind == 23 && op2.type->isSigned)
1679 *value2 = (int)op2.i64;
1680 else if(op2.kind == 23)
1681 *value2 = (int)op2.ui64;
1682 else if(op2.kind == 22 && op2.type->isSigned)
1683 *value2 = (int)op2.i64;
1684 else if(op2.kind == 22)
1685 *value2 = (int)op2.ui64;
1686 else if(op2.kind == 2 && op2.type->isSigned)
1687 *value2 = (int)op2.s;
1688 else if(op2.kind == 2)
1689 *value2 = (int)op2.us;
1690 else if(op2.kind == 1 && op2.type->isSigned)
1691 *value2 = (int)op2.c;
1692 else if(op2.kind == 24 || op2.kind == 1)
1693 *value2 = (int)op2.uc;
1694 else if(op2.kind == 6)
1695 *value2 = (int)op2.f;
1696 else if(op2.kind == 7)
1697 *value2 = (int)op2.d;
1698 else if(op2.kind == 13)
1699 *value2 = (int)op2.ui64;
1700 else
1701 return 0x0;
1702 return 0x1;
1703 }
1704
1705 unsigned int GetUInt(struct Expression * exp, unsigned int * value2)
1706 {
1707 struct Operand op2 = GetOperand(exp);
1708
1709 if(op2.kind == 3 && op2.type->isSigned)
1710 *value2 = (unsigned int)op2.i;
1711 else if(op2.kind == 3)
1712 *value2 = op2.ui;
1713 else if(op2.kind == 4 && op2.type->isSigned)
1714 *value2 = (unsigned int)op2.i64;
1715 else if(op2.kind == 4)
1716 *value2 = (unsigned int)op2.ui64;
1717 else if(op2.kind == 23 && op2.type->isSigned)
1718 *value2 = (unsigned int)op2.i64;
1719 else if(op2.kind == 23)
1720 *value2 = (unsigned int)op2.ui64;
1721 else if(op2.kind == 22 && op2.type->isSigned)
1722 *value2 = (unsigned int)op2.i64;
1723 else if(op2.kind == 22)
1724 *value2 = (unsigned int)op2.ui64;
1725 else if(op2.kind == 2 && op2.type->isSigned)
1726 *value2 = (unsigned int)op2.s;
1727 else if(op2.kind == 2)
1728 *value2 = (unsigned int)op2.us;
1729 else if(op2.kind == 1 && op2.type->isSigned)
1730 *value2 = (unsigned int)op2.c;
1731 else if(op2.kind == 24 || op2.kind == 1)
1732 *value2 = (unsigned int)op2.uc;
1733 else if(op2.kind == 6)
1734 *value2 = (unsigned int)op2.f;
1735 else if(op2.kind == 7)
1736 *value2 = (unsigned int)op2.d;
1737 else if(op2.kind == 13)
1738 *value2 = (unsigned int)op2.ui64;
1739 else
1740 return 0x0;
1741 return 0x1;
1742 }
1743
1744 unsigned int GetInt64(struct Expression * exp, long long * value2)
1745 {
1746 struct Operand op2 = GetOperand(exp);
1747
1748 if(op2.kind == 3 && op2.type->isSigned)
1749 *value2 = (long long)op2.i;
1750 else if(op2.kind == 3)
1751 *value2 = (long long)op2.ui;
1752 else if(op2.kind == 4 && op2.type->isSigned)
1753 *value2 = op2.i64;
1754 else if(op2.kind == 4)
1755 *value2 = (long long)op2.ui64;
1756 else if(op2.kind == 23 && op2.type->isSigned)
1757 *value2 = op2.i64;
1758 else if(op2.kind == 23)
1759 *value2 = (long long)op2.ui64;
1760 else if(op2.kind == 22 && op2.type->isSigned)
1761 *value2 = op2.i64;
1762 else if(op2.kind == 22)
1763 *value2 = (long long)op2.ui64;
1764 else if(op2.kind == 2 && op2.type->isSigned)
1765 *value2 = (long long)op2.s;
1766 else if(op2.kind == 2)
1767 *value2 = (long long)op2.us;
1768 else if(op2.kind == 1 && op2.type->isSigned)
1769 *value2 = (long long)op2.c;
1770 else if(op2.kind == 24 || op2.kind == 1)
1771 *value2 = (long long)op2.uc;
1772 else if(op2.kind == 6)
1773 *value2 = (long long)op2.f;
1774 else if(op2.kind == 7)
1775 *value2 = (long long)op2.d;
1776 else if(op2.kind == 13)
1777 *value2 = (long long)op2.ui64;
1778 else
1779 return 0x0;
1780 return 0x1;
1781 }
1782
1783 unsigned int GetUInt64(struct Expression * exp, uint64 * value2)
1784 {
1785 struct Operand op2 = GetOperand(exp);
1786
1787 if(op2.kind == 3 && op2.type->isSigned)
1788 *value2 = (uint64)op2.i;
1789 else if(op2.kind == 3)
1790 *value2 = (uint64)op2.ui;
1791 else if(op2.kind == 4 && op2.type->isSigned)
1792 *value2 = (uint64)op2.i64;
1793 else if(op2.kind == 4)
1794 *value2 = op2.ui64;
1795 else if(op2.kind == 23 && op2.type->isSigned)
1796 *value2 = (uint64)op2.i64;
1797 else if(op2.kind == 23)
1798 *value2 = op2.ui64;
1799 else if(op2.kind == 22 && op2.type->isSigned)
1800 *value2 = (uint64)op2.i64;
1801 else if(op2.kind == 22)
1802 *value2 = op2.ui64;
1803 else if(op2.kind == 2 && op2.type->isSigned)
1804 *value2 = (uint64)op2.s;
1805 else if(op2.kind == 2)
1806 *value2 = (uint64)op2.us;
1807 else if(op2.kind == 1 && op2.type->isSigned)
1808 *value2 = (uint64)op2.c;
1809 else if(op2.kind == 24 || op2.kind == 1)
1810 *value2 = (uint64)op2.uc;
1811 else if(op2.kind == 6)
1812 *value2 = (uint64)op2.f;
1813 else if(op2.kind == 7)
1814 *value2 = (uint64)op2.d;
1815 else if(op2.kind == 13)
1816 *value2 = op2.ui64;
1817 else
1818 return 0x0;
1819 return 0x1;
1820 }
1821
1822 unsigned int GetIntPtr(struct Expression * exp, intptr_t * value2)
1823 {
1824 struct Operand op2 = GetOperand(exp);
1825
1826 if(op2.kind == 3 && op2.type->isSigned)
1827 *value2 = (intptr_t)op2.i;
1828 else if(op2.kind == 3)
1829 *value2 = (intptr_t)op2.ui;
1830 else if(op2.kind == 4 && op2.type->isSigned)
1831 *value2 = (intptr_t)op2.i64;
1832 else if(op2.kind == 4)
1833 *value2 = (intptr_t)op2.ui64;
1834 else if(op2.kind == 23 && op2.type->isSigned)
1835 *value2 = (intptr_t)op2.i64;
1836 else if(op2.kind == 23)
1837 *value2 = (intptr_t)op2.ui64;
1838 else if(op2.kind == 22 && op2.type->isSigned)
1839 *value2 = (intptr_t)op2.i64;
1840 else if(op2.kind == 22)
1841 *value2 = (intptr_t)op2.ui64;
1842 else if(op2.kind == 2 && op2.type->isSigned)
1843 *value2 = (intptr_t)op2.s;
1844 else if(op2.kind == 2)
1845 *value2 = (intptr_t)op2.us;
1846 else if(op2.kind == 1 && op2.type->isSigned)
1847 *value2 = (intptr_t)op2.c;
1848 else if(op2.kind == 24 || op2.kind == 1)
1849 *value2 = (intptr_t)op2.uc;
1850 else if(op2.kind == 6)
1851 *value2 = (intptr_t)op2.f;
1852 else if(op2.kind == 7)
1853 *value2 = (intptr_t)op2.d;
1854 else if(op2.kind == 13)
1855 *value2 = (intptr_t)op2.ui64;
1856 else
1857 return 0x0;
1858 return 0x1;
1859 }
1860
1861 unsigned int GetUIntPtr(struct Expression * exp, uintptr_t * value2)
1862 {
1863 struct Operand op2 = GetOperand(exp);
1864
1865 if(op2.kind == 3 && op2.type->isSigned)
1866 *value2 = (uintptr_t)op2.i;
1867 else if(op2.kind == 3)
1868 *value2 = (uintptr_t)op2.ui;
1869 else if(op2.kind == 4 && op2.type->isSigned)
1870 *value2 = (uintptr_t)op2.i64;
1871 else if(op2.kind == 4)
1872 *value2 = (uintptr_t)op2.ui64;
1873 else if(op2.kind == 23 && op2.type->isSigned)
1874 *value2 = (uintptr_t)op2.i64;
1875 else if(op2.kind == 23)
1876 *value2 = (uintptr_t)op2.ui64;
1877 else if(op2.kind == 22 && op2.type->isSigned)
1878 *value2 = (uintptr_t)op2.i64;
1879 else if(op2.kind == 22)
1880 *value2 = (uintptr_t)op2.ui64;
1881 else if(op2.kind == 2 && op2.type->isSigned)
1882 *value2 = (uintptr_t)op2.s;
1883 else if(op2.kind == 2)
1884 *value2 = (uintptr_t)op2.us;
1885 else if(op2.kind == 1 && op2.type->isSigned)
1886 *value2 = (uintptr_t)op2.c;
1887 else if(op2.kind == 24 || op2.kind == 1)
1888 *value2 = (uintptr_t)op2.uc;
1889 else if(op2.kind == 6)
1890 *value2 = (uintptr_t)op2.f;
1891 else if(op2.kind == 7)
1892 *value2 = (uintptr_t)op2.d;
1893 else if(op2.kind == 13)
1894 *value2 = (uintptr_t)op2.ui64;
1895 else
1896 return 0x0;
1897 return 0x1;
1898 }
1899
1900 unsigned int GetIntSize(struct Expression * exp, ssize_t * value2)
1901 {
1902 struct Operand op2 = GetOperand(exp);
1903
1904 if(op2.kind == 3 && op2.type->isSigned)
1905 *value2 = (ssize_t)op2.i;
1906 else if(op2.kind == 3)
1907 *value2 = (ssize_t)op2.ui;
1908 else if(op2.kind == 4 && op2.type->isSigned)
1909 *value2 = (ssize_t)op2.i64;
1910 else if(op2.kind == 4)
1911 *value2 = (ssize_t)op2.ui64;
1912 else if(op2.kind == 23 && op2.type->isSigned)
1913 *value2 = (ssize_t)op2.i64;
1914 else if(op2.kind == 23)
1915 *value2 = (ssize_t)op2.ui64;
1916 else if(op2.kind == 22 && op2.type->isSigned)
1917 *value2 = (ssize_t)op2.i64;
1918 else if(op2.kind == 22)
1919 *value2 = (ssize_t)op2.ui64;
1920 else if(op2.kind == 2 && op2.type->isSigned)
1921 *value2 = (ssize_t)op2.s;
1922 else if(op2.kind == 2)
1923 *value2 = (ssize_t)op2.us;
1924 else if(op2.kind == 1 && op2.type->isSigned)
1925 *value2 = (ssize_t)op2.c;
1926 else if(op2.kind == 24 || op2.kind == 1)
1927 *value2 = (ssize_t)op2.uc;
1928 else if(op2.kind == 6)
1929 *value2 = (ssize_t)op2.f;
1930 else if(op2.kind == 7)
1931 *value2 = (ssize_t)op2.d;
1932 else if(op2.kind == 13)
1933 *value2 = (ssize_t)op2.ui64;
1934 else
1935 return 0x0;
1936 return 0x1;
1937 }
1938
1939 unsigned int GetUIntSize(struct Expression * exp, size_t * value2)
1940 {
1941 struct Operand op2 = GetOperand(exp);
1942
1943 if(op2.kind == 3 && op2.type->isSigned)
1944 *value2 = (size_t)op2.i;
1945 else if(op2.kind == 3)
1946 *value2 = (size_t)op2.ui;
1947 else if(op2.kind == 4 && op2.type->isSigned)
1948 *value2 = (size_t)op2.i64;
1949 else if(op2.kind == 4)
1950 *value2 = (size_t)op2.ui64;
1951 else if(op2.kind == 23 && op2.type->isSigned)
1952 *value2 = (size_t)op2.i64;
1953 else if(op2.kind == 23)
1954 *value2 = (size_t)op2.ui64;
1955 else if(op2.kind == 22 && op2.type->isSigned)
1956 *value2 = (size_t)op2.i64;
1957 else if(op2.kind == 22)
1958 *value2 = (size_t)op2.ui64;
1959 else if(op2.kind == 2 && op2.type->isSigned)
1960 *value2 = (size_t)op2.s;
1961 else if(op2.kind == 2)
1962 *value2 = (size_t)op2.us;
1963 else if(op2.kind == 1 && op2.type->isSigned)
1964 *value2 = (size_t)op2.c;
1965 else if(op2.kind == 24 || op2.kind == 1)
1966 *value2 = (size_t)op2.uc;
1967 else if(op2.kind == 6)
1968 *value2 = (size_t)op2.f;
1969 else if(op2.kind == 7)
1970 *value2 = (size_t)op2.d;
1971 else if(op2.kind == 13)
1972 *value2 = (size_t)op2.ui64;
1973 else
1974 return 0x0;
1975 return 0x1;
1976 }
1977
1978 unsigned int GetShort(struct Expression * exp, short * value2)
1979 {
1980 struct Operand op2 = GetOperand(exp);
1981
1982 if(op2.kind == 3 && op2.type->isSigned)
1983 *value2 = (short)op2.i;
1984 else if(op2.kind == 3)
1985 *value2 = (short)op2.ui;
1986 else if(op2.kind == 4 && op2.type->isSigned)
1987 *value2 = (short)op2.i64;
1988 else if(op2.kind == 4)
1989 *value2 = (short)op2.ui64;
1990 else if(op2.kind == 23 && op2.type->isSigned)
1991 *value2 = (short)op2.i64;
1992 else if(op2.kind == 23)
1993 *value2 = (short)op2.ui64;
1994 else if(op2.kind == 22 && op2.type->isSigned)
1995 *value2 = (short)op2.i64;
1996 else if(op2.kind == 22)
1997 *value2 = (short)op2.ui64;
1998 else if(op2.kind == 2 && op2.type->isSigned)
1999 *value2 = op2.s;
2000 else if(op2.kind == 2)
2001 *value2 = (short)op2.us;
2002 else if(op2.kind == 1 && op2.type->isSigned)
2003 *value2 = (short)op2.c;
2004 else if(op2.kind == 24 || op2.kind == 1)
2005 *value2 = (short)op2.uc;
2006 else if(op2.kind == 6)
2007 *value2 = (short)op2.f;
2008 else if(op2.kind == 7)
2009 *value2 = (short)op2.d;
2010 else if(op2.kind == 13)
2011 *value2 = (short)op2.ui64;
2012 else
2013 return 0x0;
2014 return 0x1;
2015 }
2016
2017 unsigned int GetUShort(struct Expression * exp, unsigned short * value2)
2018 {
2019 struct Operand op2 = GetOperand(exp);
2020
2021 if(op2.kind == 3 && op2.type->isSigned)
2022 *value2 = (unsigned short)op2.i;
2023 else if(op2.kind == 3)
2024 *value2 = (unsigned short)op2.ui;
2025 else if(op2.kind == 4 && op2.type->isSigned)
2026 *value2 = (unsigned short)op2.i64;
2027 else if(op2.kind == 4)
2028 *value2 = (unsigned short)op2.ui64;
2029 else if(op2.kind == 23 && op2.type->isSigned)
2030 *value2 = (unsigned short)op2.i64;
2031 else if(op2.kind == 23)
2032 *value2 = (unsigned short)op2.ui64;
2033 else if(op2.kind == 22 && op2.type->isSigned)
2034 *value2 = (unsigned short)op2.i64;
2035 else if(op2.kind == 22)
2036 *value2 = (unsigned short)op2.ui64;
2037 else if(op2.kind == 2 && op2.type->isSigned)
2038 *value2 = (unsigned short)op2.s;
2039 else if(op2.kind == 2)
2040 *value2 = op2.us;
2041 else if(op2.kind == 1 && op2.type->isSigned)
2042 *value2 = (unsigned short)op2.c;
2043 else if(op2.kind == 24 || op2.kind == 1)
2044 *value2 = (unsigned short)op2.uc;
2045 else if(op2.kind == 6)
2046 *value2 = (unsigned short)op2.f;
2047 else if(op2.kind == 7)
2048 *value2 = (unsigned short)op2.d;
2049 else if(op2.kind == 13)
2050 *value2 = (unsigned short)op2.ui64;
2051 else
2052 return 0x0;
2053 return 0x1;
2054 }
2055
2056 unsigned int GetChar(struct Expression * exp, char * value2)
2057 {
2058 struct Operand op2 = GetOperand(exp);
2059
2060 if(op2.kind == 3 && op2.type->isSigned)
2061 *value2 = (char)op2.i;
2062 else if(op2.kind == 3)
2063 *value2 = (char)op2.ui;
2064 else if(op2.kind == 4 && op2.type->isSigned)
2065 *value2 = (char)op2.i64;
2066 else if(op2.kind == 4)
2067 *value2 = (char)op2.ui64;
2068 else if(op2.kind == 23 && op2.type->isSigned)
2069 *value2 = (char)op2.i64;
2070 else if(op2.kind == 23)
2071 *value2 = (char)op2.ui64;
2072 else if(op2.kind == 22 && op2.type->isSigned)
2073 *value2 = (char)op2.i64;
2074 else if(op2.kind == 22)
2075 *value2 = (char)op2.ui64;
2076 else if(op2.kind == 2 && op2.type->isSigned)
2077 *value2 = (char)op2.s;
2078 else if(op2.kind == 2)
2079 *value2 = (char)op2.us;
2080 else if(op2.kind == 1 && op2.type->isSigned)
2081 *value2 = op2.c;
2082 else if(op2.kind == 24 || op2.kind == 1)
2083 *value2 = (char)op2.uc;
2084 else if(op2.kind == 6)
2085 *value2 = (char)op2.f;
2086 else if(op2.kind == 7)
2087 *value2 = (char)op2.d;
2088 else if(op2.kind == 13)
2089 *value2 = (char)op2.ui64;
2090 else
2091 return 0x0;
2092 return 0x1;
2093 }
2094
2095 unsigned int GetUChar(struct Expression * exp, unsigned char * value2)
2096 {
2097 struct Operand op2 = GetOperand(exp);
2098
2099 if(op2.kind == 3 && op2.type->isSigned)
2100 *value2 = (unsigned char)op2.i;
2101 else if(op2.kind == 3)
2102 *value2 = (unsigned char)op2.ui;
2103 else if(op2.kind == 4 && op2.type->isSigned)
2104 *value2 = (unsigned char)op2.i64;
2105 else if(op2.kind == 4)
2106 *value2 = (unsigned char)op2.ui64;
2107 else if(op2.kind == 23 && op2.type->isSigned)
2108 *value2 = (unsigned char)op2.i64;
2109 else if(op2.kind == 23)
2110 *value2 = (unsigned char)op2.ui64;
2111 else if(op2.kind == 22 && op2.type->isSigned)
2112 *value2 = (unsigned char)op2.i64;
2113 else if(op2.kind == 22)
2114 *value2 = (unsigned char)op2.ui64;
2115 else if(op2.kind == 2 && op2.type->isSigned)
2116 *value2 = (unsigned char)op2.s;
2117 else if(op2.kind == 2)
2118 *value2 = (unsigned char)op2.us;
2119 else if(op2.kind == 1 && op2.type->isSigned)
2120 *value2 = (unsigned char)op2.c;
2121 else if(op2.kind == 24 || op2.kind == 1)
2122 *value2 = op2.uc;
2123 else if(op2.kind == 6)
2124 *value2 = (unsigned char)op2.f;
2125 else if(op2.kind == 7)
2126 *value2 = (unsigned char)op2.d;
2127 else if(op2.kind == 13)
2128 *value2 = (unsigned char)op2.ui64;
2129 else
2130 return 0x0;
2131 return 0x1;
2132 }
2133
2134 unsigned int GetFloat(struct Expression * exp, float * value2)
2135 {
2136 struct Operand op2 = GetOperand(exp);
2137
2138 if(op2.kind == 3 && op2.type->isSigned)
2139 *value2 = (float)(float)op2.i;
2140 else if(op2.kind == 3)
2141 *value2 = (float)(float)op2.ui;
2142 else if(op2.kind == 4 && op2.type->isSigned)
2143 *value2 = (float)(float)op2.i64;
2144 else if(op2.kind == 4)
2145 *value2 = (float)(float)op2.ui64;
2146 else if(op2.kind == 23 && op2.type->isSigned)
2147 *value2 = (float)(float)op2.i64;
2148 else if(op2.kind == 23)
2149 *value2 = (float)(float)op2.ui64;
2150 else if(op2.kind == 22 && op2.type->isSigned)
2151 *value2 = (float)(float)op2.i64;
2152 else if(op2.kind == 22)
2153 *value2 = (float)(float)op2.ui64;
2154 else if(op2.kind == 2 && op2.type->isSigned)
2155 *value2 = (float)(float)op2.s;
2156 else if(op2.kind == 2)
2157 *value2 = (float)(float)op2.us;
2158 else if(op2.kind == 1 && op2.type->isSigned)
2159 *value2 = (float)(float)op2.c;
2160 else if(op2.kind == 24 || op2.kind == 1)
2161 *value2 = (float)(float)op2.uc;
2162 else if(op2.kind == 6)
2163 *value2 = (float)op2.f;
2164 else if(op2.kind == 7)
2165 *value2 = (float)op2.d;
2166 else if(op2.kind == 13)
2167 *value2 = (float)(float)op2.ui64;
2168 else
2169 return 0x0;
2170 return 0x1;
2171 }
2172
2173 unsigned int GetDouble(struct Expression * exp, double * value2)
2174 {
2175 struct Operand op2 = GetOperand(exp);
2176
2177 if(op2.kind == 3 && op2.type->isSigned)
2178 *value2 = (double)(double)op2.i;
2179 else if(op2.kind == 3)
2180 *value2 = (double)(double)op2.ui;
2181 else if(op2.kind == 4 && op2.type->isSigned)
2182 *value2 = (double)(double)op2.i64;
2183 else if(op2.kind == 4)
2184 *value2 = (double)(double)op2.ui64;
2185 else if(op2.kind == 23 && op2.type->isSigned)
2186 *value2 = (double)(double)op2.i64;
2187 else if(op2.kind == 23)
2188 *value2 = (double)(double)op2.ui64;
2189 else if(op2.kind == 22 && op2.type->isSigned)
2190 *value2 = (double)(double)op2.i64;
2191 else if(op2.kind == 22)
2192 *value2 = (double)(double)op2.ui64;
2193 else if(op2.kind == 2 && op2.type->isSigned)
2194 *value2 = (double)(double)op2.s;
2195 else if(op2.kind == 2)
2196 *value2 = (double)(double)op2.us;
2197 else if(op2.kind == 1 && op2.type->isSigned)
2198 *value2 = (double)(double)op2.c;
2199 else if(op2.kind == 24 || op2.kind == 1)
2200 *value2 = (double)(double)op2.uc;
2201 else if(op2.kind == 6)
2202 *value2 = (double)op2.f;
2203 else if(op2.kind == 7)
2204 *value2 = (double)op2.d;
2205 else if(op2.kind == 13)
2206 *value2 = (double)(double)op2.ui64;
2207 else
2208 return 0x0;
2209 return 0x1;
2210 }
2211
2212 void ComputeExpression(struct Expression * exp);
2213
2214 struct Context * SetupTemplatesContext(struct __ecereNameSpace__ecere__com__Class * _class);
2215
2216 extern int targetBits;
2217
2218 int ComputeTypeSize(struct Type * type);
2219
2220 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__BitMember;
2221
2222 struct __ecereNameSpace__ecere__com__BitMember
2223 {
2224 struct __ecereNameSpace__ecere__com__BitMember * prev;
2225 struct __ecereNameSpace__ecere__com__BitMember * next;
2226 char *  name;
2227 unsigned int isProperty;
2228 int memberAccess;
2229 int id;
2230 struct __ecereNameSpace__ecere__com__Class * _class;
2231 char *  dataTypeString;
2232 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
2233 struct Type * dataType;
2234 int type;
2235 int size;
2236 int pos;
2237 uint64 mask;
2238 } __attribute__ ((gcc_struct));
2239
2240 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__OldLink;
2241
2242 struct __ecereNameSpace__ecere__sys__OldLink
2243 {
2244 struct __ecereNameSpace__ecere__sys__OldLink * prev;
2245 struct __ecereNameSpace__ecere__sys__OldLink * next;
2246 void *  data;
2247 } __attribute__ ((gcc_struct));
2248
2249 void FinishTemplatesContext(struct Context * context);
2250
2251 void ComputeClassMembers(struct __ecereNameSpace__ecere__com__Class * _class, unsigned int isMember)
2252 {
2253 struct __ecereNameSpace__ecere__com__DataMember * member = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
2254 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
2255
2256 if(member || ((_class->type == 2 || _class->type == 0 || _class->type == 1 || _class->type == 5) && (_class->type == 2 || (!_class->structSize || _class->structSize == _class->offset)) && _class->computeSize))
2257 {
2258 int c;
2259 int unionMemberOffset = 0;
2260 int bitFields = 0;
2261
2262 if(member)
2263 {
2264 member->memberOffset = 0;
2265 if(targetBits < sizeof(void *) * 8)
2266 member->structAlignment = 0;
2267 }
2268 else if(targetBits < sizeof(void *) * 8)
2269 _class->structAlignment = 0;
2270 if(!member && ((_class->type == 0 || _class->type == 5) || (_class->type == 1 && _class->memberOffset && _class->memberOffset > _class->base->structSize)))
2271 _class->memberOffset = (_class->base && _class->type == 1) ? _class->base->structSize : 0;
2272 if(!member && _class->destructionWatchOffset)
2273 _class->memberOffset += sizeof(struct __ecereNameSpace__ecere__sys__OldList);
2274 {
2275 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
2276
2277 for(dataMember = member ? member->members.first : _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
2278 {
2279 if(!dataMember->isProperty)
2280 {
2281 if(dataMember->type == 0 && dataMember->dataTypeString && !dataMember->dataType)
2282 {
2283 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
2284 }
2285 }
2286 }
2287 }
2288 {
2289 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
2290
2291 for(dataMember = member ? member->members.first : _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
2292 {
2293 if(!dataMember->isProperty && (dataMember->type != 0 || dataMember->dataTypeString))
2294 {
2295 if(!isMember && _class->type == 2 && dataMember->dataType)
2296 {
2297 struct __ecereNameSpace__ecere__com__BitMember * bitMember = (struct __ecereNameSpace__ecere__com__BitMember *)dataMember;
2298 uint64 mask = 0;
2299 int d;
2300
2301 ComputeTypeSize(dataMember->dataType);
2302 if(bitMember->pos == -1)
2303 bitMember->pos = _class->memberOffset;
2304 if(!bitMember->size)
2305 bitMember->size = dataMember->dataType->size * 8;
2306 _class->memberOffset = bitMember->pos + bitMember->size;
2307 for(d = 0; d < bitMember->size; d++)
2308 {
2309 if(d)
2310 mask <<= 1;
2311 mask |= 1;
2312 }
2313 bitMember->mask = mask << bitMember->pos;
2314 }
2315 else if(dataMember->type == 0 && dataMember->dataType)
2316 {
2317 int size;
2318 int alignment = 0;
2319
2320 if(dataMember->dataType->kind != 8 || ((!dataMember->dataType->_class || !dataMember->dataType->_class->registered || dataMember->dataType->_class->registered != _class || _class->type != 1)))
2321 ComputeTypeSize(dataMember->dataType);
2322 if(dataMember->dataType->bitFieldCount)
2323 {
2324 bitFields += dataMember->dataType->bitFieldCount;
2325 size = 0;
2326 }
2327 else
2328 {
2329 if(bitFields)
2330 {
2331 int size = (bitFields + 7) / 8;
2332
2333 if(isMember)
2334 {
2335 int __simpleStruct0;
2336
2337 if(alignment)
2338 {
2339 int __simpleStruct0;
2340
2341 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2342 if(member->memberOffset % alignment)
2343 member->memberOffset += alignment - (member->memberOffset % alignment);
2344 }
2345 dataMember->offset = member->memberOffset;
2346 if(member->type == 1)
2347 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2348 else
2349 {
2350 member->memberOffset += size;
2351 }
2352 }
2353 else
2354 {
2355 if(alignment)
2356 {
2357 int __simpleStruct0;
2358
2359 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2360 if(_class->memberOffset % alignment)
2361 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2362 }
2363 dataMember->offset = _class->memberOffset;
2364 _class->memberOffset += size;
2365 }
2366 bitFields = 0;
2367 }
2368 size = dataMember->dataType->size;
2369 alignment = dataMember->dataType->alignment;
2370 }
2371 if(isMember)
2372 {
2373 int __simpleStruct0;
2374
2375 if(alignment)
2376 {
2377 int __simpleStruct0;
2378
2379 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2380 if(member->memberOffset % alignment)
2381 member->memberOffset += alignment - (member->memberOffset % alignment);
2382 }
2383 dataMember->offset = member->memberOffset;
2384 if(member->type == 1)
2385 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2386 else
2387 {
2388 member->memberOffset += size;
2389 }
2390 }
2391 else
2392 {
2393 if(alignment)
2394 {
2395 int __simpleStruct0;
2396
2397 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2398 if(_class->memberOffset % alignment)
2399 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2400 }
2401 dataMember->offset = _class->memberOffset;
2402 _class->memberOffset += size;
2403 }
2404 }
2405 else
2406 {
2407 int alignment;
2408
2409 ComputeClassMembers((struct __ecereNameSpace__ecere__com__Class *)dataMember, 0x1);
2410 alignment = dataMember->structAlignment;
2411 if(isMember)
2412 {
2413 int __simpleStruct0;
2414
2415 if(alignment)
2416 {
2417 int __simpleStruct0;
2418
2419 if(member->memberOffset % alignment)
2420 member->memberOffset += alignment - (member->memberOffset % alignment);
2421 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2422 }
2423 dataMember->offset = member->memberOffset;
2424 if(member->type == 1)
2425 unionMemberOffset = (__simpleStruct0 = dataMember->memberOffset, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2426 else
2427 member->memberOffset += dataMember->memberOffset;
2428 }
2429 else
2430 {
2431 if(alignment)
2432 {
2433 int __simpleStruct0;
2434
2435 if(_class->memberOffset % alignment)
2436 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2437 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2438 }
2439 dataMember->offset = _class->memberOffset;
2440 _class->memberOffset += dataMember->memberOffset;
2441 }
2442 }
2443 }
2444 }
2445 if(bitFields)
2446 {
2447 int alignment = 0;
2448 int size = (bitFields + 7) / 8;
2449
2450 if(isMember)
2451 {
2452 int __simpleStruct0;
2453
2454 if(alignment)
2455 {
2456 int __simpleStruct0;
2457
2458 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2459 if(member->memberOffset % alignment)
2460 member->memberOffset += alignment - (member->memberOffset % alignment);
2461 }
2462 if(member->type == 1)
2463 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2464 else
2465 {
2466 member->memberOffset += size;
2467 }
2468 }
2469 else
2470 {
2471 if(alignment)
2472 {
2473 int __simpleStruct0;
2474
2475 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2476 if(_class->memberOffset % alignment)
2477 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2478 }
2479 _class->memberOffset += size;
2480 }
2481 bitFields = 0;
2482 }
2483 }
2484 if(member && member->type == 1)
2485 {
2486 member->memberOffset = unionMemberOffset;
2487 }
2488 if(!isMember)
2489 {
2490 if(_class->type != 2)
2491 {
2492 int extra = 0;
2493
2494 if(_class->structAlignment)
2495 {
2496 if(_class->memberOffset % _class->structAlignment)
2497 extra += _class->structAlignment - (_class->memberOffset % _class->structAlignment);
2498 }
2499 _class->structSize = (_class->base ? (_class->base->templateClass ? _class->base->templateClass->structSize : _class->base->structSize) : 0) + _class->memberOffset + extra;
2500 if(!member)
2501 {
2502 struct __ecereNameSpace__ecere__com__Property * prop;
2503
2504 for(prop = _class->membersAndProperties.first; prop; prop = prop->next)
2505 {
2506 if(prop->isProperty && prop->isWatchable)
2507 {
2508 prop->watcherOffset = _class->structSize;
2509 _class->structSize += sizeof(struct __ecereNameSpace__ecere__sys__OldList);
2510 }
2511 }
2512 }
2513 {
2514 struct __ecereNameSpace__ecere__sys__OldLink * derivative;
2515
2516 for(derivative = _class->derivatives.first; derivative; derivative = derivative->next)
2517 {
2518 struct __ecereNameSpace__ecere__com__Class * deriv = derivative->data;
2519
2520 if(deriv->computeSize)
2521 {
2522 deriv->offset = _class->structSize;
2523 deriv->memberOffset = 0;
2524 deriv->structSize = deriv->offset;
2525 ComputeClassMembers(deriv, 0x0);
2526 }
2527 }
2528 }
2529 }
2530 }
2531 }
2532 if(context)
2533 FinishTemplatesContext(context);
2534 }
2535
2536 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__NameSpace;
2537
2538 struct __ecereNameSpace__ecere__com__NameSpace
2539 {
2540 char *  name;
2541 struct __ecereNameSpace__ecere__com__NameSpace *  btParent;
2542 struct __ecereNameSpace__ecere__com__NameSpace *  left;
2543 struct __ecereNameSpace__ecere__com__NameSpace *  right;
2544 int depth;
2545 struct __ecereNameSpace__ecere__com__NameSpace *  parent;
2546 struct __ecereNameSpace__ecere__sys__BinaryTree nameSpaces;
2547 struct __ecereNameSpace__ecere__sys__BinaryTree classes;
2548 struct __ecereNameSpace__ecere__sys__BinaryTree defines;
2549 struct __ecereNameSpace__ecere__sys__BinaryTree functions;
2550 } __attribute__ ((gcc_struct));
2551
2552 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Module;
2553
2554 struct __ecereNameSpace__ecere__com__Module
2555 {
2556 struct __ecereNameSpace__ecere__com__Instance * application;
2557 struct __ecereNameSpace__ecere__sys__OldList classes;
2558 struct __ecereNameSpace__ecere__sys__OldList defines;
2559 struct __ecereNameSpace__ecere__sys__OldList functions;
2560 struct __ecereNameSpace__ecere__sys__OldList modules;
2561 struct __ecereNameSpace__ecere__com__Instance * prev;
2562 struct __ecereNameSpace__ecere__com__Instance * next;
2563 char *  name;
2564 void *  library;
2565 void *  Unload;
2566 int importType;
2567 int origImportType;
2568 struct __ecereNameSpace__ecere__com__NameSpace privateNameSpace;
2569 struct __ecereNameSpace__ecere__com__NameSpace publicNameSpace;
2570 } __attribute__ ((gcc_struct));
2571
2572 void ComputeModuleClasses(struct __ecereNameSpace__ecere__com__Instance * module)
2573 {
2574 struct __ecereNameSpace__ecere__com__Class * _class;
2575 struct __ecereNameSpace__ecere__sys__OldLink * subModule;
2576
2577 for(subModule = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->modules.first; subModule; subModule = subModule->next)
2578 ComputeModuleClasses(subModule->data);
2579 for(_class = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->classes.first; _class; _class = _class->next)
2580 ComputeClassMembers(_class, 0x0);
2581 }
2582
2583 extern unsigned int inCompiler;
2584
2585 extern void Compiler_Error(char *  format, ...);
2586
2587 extern char *  __ecereNameSpace__ecere__GetTranslatedString(char * name, char *  string, char *  stringAndContext);
2588
2589 int ComputeTypeSize(struct Type * type)
2590 {
2591 unsigned int size = type ? type->size : 0;
2592
2593 if(!size && type && !type->computing)
2594 {
2595 type->computing = 0x1;
2596 switch(type->kind)
2597 {
2598 case 24:
2599 type->alignment = size = sizeof(char);
2600 break;
2601 case 1:
2602 type->alignment = size = sizeof(char);
2603 break;
2604 case 3:
2605 type->alignment = size = sizeof(int);
2606 break;
2607 case 4:
2608 type->alignment = size = sizeof(long long);
2609 break;
2610 case 22:
2611 type->alignment = size = targetBits / 8;
2612 break;
2613 case 23:
2614 type->alignment = size = targetBits / 8;
2615 break;
2616 case 5:
2617 type->alignment = size = sizeof(long);
2618 break;
2619 case 2:
2620 type->alignment = size = sizeof(short);
2621 break;
2622 case 6:
2623 type->alignment = size = sizeof(float);
2624 break;
2625 case 7:
2626 type->alignment = size = sizeof(double);
2627 break;
2628 case 8:
2629 {
2630 struct __ecereNameSpace__ecere__com__Class * _class = type->_class ? type->_class->registered : (((void *)0));
2631
2632 if(_class && _class->type == 1)
2633 {
2634 ComputeClassMembers(_class, 0x0);
2635 type->alignment = _class->structAlignment;
2636 size = _class->structSize;
2637 if(type->alignment && size % type->alignment)
2638 size += type->alignment - (size % type->alignment);
2639 }
2640 else if(_class && (_class->type == 3 || _class->type == 4 || _class->type == 2))
2641 {
2642 if(!_class->dataType)
2643 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
2644 size = type->alignment = ComputeTypeSize(_class->dataType);
2645 }
2646 else
2647 size = type->alignment = targetBits / 8;
2648 break;
2649 }
2650 case 13:
2651 case 19:
2652 size = type->alignment = targetBits / 8;
2653 break;
2654 case 12:
2655 if(type->arraySizeExp)
2656 {
2657 ProcessExpressionType(type->arraySizeExp);
2658 ComputeExpression(type->arraySizeExp);
2659 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)))
2660 {
2661 struct Location oldLoc = yylloc;
2662 char expression[10240];
2663
2664 expression[0] = '\0';
2665 type->arraySizeExp->expType = (((void *)0));
2666 yylloc = type->arraySizeExp->loc;
2667 if(inCompiler)
2668 PrintExpression(type->arraySizeExp, expression);
2669 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Array size not constant int (%s)\n", (((void *)0))), expression);
2670 yylloc = oldLoc;
2671 }
2672 GetInt(type->arraySizeExp, &type->arraySize);
2673 }
2674 else if(type->enumClass)
2675 {
2676 if(type->enumClass && type->enumClass->registered && type->enumClass->registered->type == 4)
2677 {
2678 type->arraySize = (int)__ecereNameSpace__ecere__com__eClass_GetProperty(type->enumClass->registered, "enumSize");
2679 }
2680 else
2681 type->arraySize = 0;
2682 }
2683 else
2684 {
2685 type->arraySize = 0;
2686 }
2687 size = ComputeTypeSize(type->type) * type->arraySize;
2688 if(type->type)
2689 type->alignment = type->type->alignment;
2690 break;
2691 case 9:
2692 {
2693 struct Type * member;
2694
2695 for(member = type->members.first; member; member = member->next)
2696 {
2697 int __simpleStruct0, __simpleStruct1;
2698 unsigned int addSize = ComputeTypeSize(member);
2699
2700 member->offset = size;
2701 if(member->alignment && size % member->alignment)
2702 member->offset += member->alignment - (size % member->alignment);
2703 size = member->offset;
2704 type->alignment = (__simpleStruct0 = type->alignment, __simpleStruct1 = member->alignment, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
2705 size += addSize;
2706 }
2707 if(type->alignment && size % type->alignment)
2708 size += type->alignment - (size % type->alignment);
2709 break;
2710 }
2711 case 10:
2712 {
2713 struct Type * member;
2714
2715 for(member = type->members.first; member; member = member->next)
2716 {
2717 int __simpleStruct0, __simpleStruct1;
2718 unsigned int addSize = ComputeTypeSize(member);
2719
2720 member->offset = size;
2721 if(member->alignment && size % member->alignment)
2722 member->offset += member->alignment - (size % member->alignment);
2723 size = member->offset;
2724 type->alignment = (__simpleStruct0 = type->alignment, __simpleStruct1 = member->alignment, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
2725 size = ((size > addSize) ? size : addSize);
2726 }
2727 if(type->alignment && size % type->alignment)
2728 size += type->alignment - (size % type->alignment);
2729 break;
2730 }
2731 case 20:
2732 {
2733 struct TemplateParameter * param = type->templateParameter;
2734 struct Type * baseType = ProcessTemplateParameterType(param);
2735
2736 if(baseType)
2737 {
2738 size = ComputeTypeSize(baseType);
2739 type->alignment = baseType->alignment;
2740 }
2741 else
2742 type->alignment = size = sizeof(uint64);
2743 break;
2744 }
2745 case 15:
2746 {
2747 type->alignment = size = sizeof(enum
2748 {
2749 test
2750 });
2751 break;
2752 }
2753 case 21:
2754 {
2755 type->alignment = size = targetBits / 8;
2756 break;
2757 }
2758 }
2759 type->size = size;
2760 type->computing = 0x0;
2761 }
2762 return size;
2763 }
2764
2765 extern struct Declarator * MkDeclaratorIdentifier(struct Identifier * id);
2766
2767 extern struct Identifier * MkIdentifier(char *  string);
2768
2769 extern void ListAdd(struct __ecereNameSpace__ecere__sys__OldList * list, void *  item);
2770
2771 extern struct Declarator * MkStructDeclarator(struct Declarator * declarator, struct Expression * exp);
2772
2773 extern struct ClassDef * MkClassDefDeclaration(struct Declaration * decl);
2774
2775 extern struct Declaration * MkStructDeclaration(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct __ecereNameSpace__ecere__sys__OldList * declarators, struct Specifier * extStorage);
2776
2777 void ReplaceThisClassSpecifiers(struct __ecereNameSpace__ecere__sys__OldList * specs, struct __ecereNameSpace__ecere__com__Class * _class);
2778
2779 static void DeclareType(struct Type * type, unsigned int declarePointers, unsigned int declareParams);
2780
2781 extern void FreeType(struct Type * type);
2782
2783 extern struct Specifier * MkStructOrUnion(int type, struct Identifier * id, struct __ecereNameSpace__ecere__sys__OldList * definitions);
2784
2785 extern struct Specifier * MkSpecifier(int specifier);
2786
2787 extern struct Declarator * MkDeclaratorArray(struct Declarator * declarator, struct Expression * exp);
2788
2789 extern struct Expression * MkExpConstant(char *  string);
2790
2791 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, unsigned int * addedPadding)
2792 {
2793 struct __ecereNameSpace__ecere__com__DataMember * topMember = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
2794 unsigned int totalSize = 0;
2795 unsigned int maxSize = 0;
2796 int alignment, size;
2797 struct __ecereNameSpace__ecere__com__DataMember * member;
2798 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
2799
2800 if(addedPadding)
2801 *addedPadding = 0x0;
2802 if(!isMember && _class->base)
2803 {
2804 maxSize = _class->structSize;
2805 {
2806 if(_class->type == 1 || _class->type == 5)
2807 AddMembers(declarations, _class->base, 0x0, &totalSize, topClass, (((void *)0)));
2808 else
2809 {
2810 unsigned int baseSize = _class->base->templateClass ? _class->base->templateClass->structSize : _class->base->structSize;
2811
2812 if(maxSize > baseSize)
2813 maxSize -= baseSize;
2814 else
2815 maxSize = 0;
2816 }
2817 }
2818 }
2819 for(member = isMember ? topMember->members.first : _class->membersAndProperties.first; member; member = member->next)
2820 {
2821 if(!member->isProperty)
2822 {
2823 switch(member->type)
2824 {
2825 case 0:
2826 {
2827 if(member->dataTypeString)
2828 {
2829 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList(), * decls = MkList();
2830 struct Declarator * decl;
2831
2832 decl = SpecDeclFromString(member->dataTypeString, specs, MkDeclaratorIdentifier(MkIdentifier(member->name)));
2833 ListAdd(decls, MkStructDeclarator(decl, (((void *)0))));
2834 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(specs, decls, (((void *)0)))));
2835 if(!member->dataType)
2836 member->dataType = ProcessType(specs, decl);
2837 ReplaceThisClassSpecifiers(specs, topClass);
2838 {
2839 struct Type * type = ProcessType(specs, decl);
2840
2841 DeclareType(member->dataType, 0x0, 0x0);
2842 FreeType(type);
2843 }
2844 ComputeTypeSize(member->dataType);
2845 size = member->dataType->size;
2846 alignment = member->dataType->alignment;
2847 if(alignment)
2848 {
2849 if(totalSize % alignment)
2850 totalSize += alignment - (totalSize % alignment);
2851 }
2852 totalSize += size;
2853 }
2854 break;
2855 }
2856 case 1:
2857 case 2:
2858 {
2859 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList(), * list = MkList();
2860
2861 size = 0;
2862 AddMembers(list, (struct __ecereNameSpace__ecere__com__Class *)member, 0x1, &size, topClass, (((void *)0)));
2863 ListAdd(specs, MkStructOrUnion((member->type == 1) ? 4 : 3, (((void *)0)), list));
2864 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(specs, (((void *)0)), (((void *)0)))));
2865 alignment = member->structAlignment;
2866 if(alignment)
2867 {
2868 if(totalSize % alignment)
2869 totalSize += alignment - (totalSize % alignment);
2870 }
2871 totalSize += size;
2872 break;
2873 }
2874 }
2875 }
2876 }
2877 if(retSize)
2878 {
2879 unsigned int __simpleStruct0;
2880
2881 if(topMember && topMember->type == 1)
2882 *retSize = (__simpleStruct0 = *retSize, (__simpleStruct0 > totalSize) ? __simpleStruct0 : totalSize);
2883 else
2884 *retSize += totalSize;
2885 }
2886 else if(totalSize < maxSize && _class->type != 1000)
2887 {
2888 int autoPadding = 0;
2889
2890 if(!isMember && _class->structAlignment && totalSize % _class->structAlignment)
2891 autoPadding = _class->structAlignment - (totalSize % _class->structAlignment);
2892 if(totalSize + autoPadding < maxSize)
2893 {
2894 char sizeString[50];
2895
2896 sprintf(sizeString, "%d", maxSize - totalSize);
2897 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(CHAR)), MkListOne(MkDeclaratorArray(MkDeclaratorIdentifier(MkIdentifier("__ecere_padding")), MkExpConstant(sizeString))), (((void *)0)))));
2898 if(addedPadding)
2899 *addedPadding = 0x1;
2900 }
2901 }
2902 if(context)
2903 FinishTemplatesContext(context);
2904 return topMember ? topMember->memberID : _class->memberID;
2905 }
2906
2907 static int DeclareMembers(struct __ecereNameSpace__ecere__com__Class * _class, unsigned int isMember)
2908 {
2909 struct __ecereNameSpace__ecere__com__DataMember * topMember = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
2910 unsigned int totalSize = 0;
2911 struct __ecereNameSpace__ecere__com__DataMember * member;
2912 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
2913
2914 if(!isMember && (_class->type == 1 || _class->type == 5) && _class->base->type != 1000)
2915 DeclareMembers(_class->base, 0x0);
2916 for(member = isMember ? topMember->members.first : _class->membersAndProperties.first; member; member = member->next)
2917 {
2918 if(!member->isProperty)
2919 {
2920 switch(member->type)
2921 {
2922 case 0:
2923 {
2924 if(!member->dataType && member->dataTypeString)
2925 member->dataType = ProcessTypeString(member->dataTypeString, 0x0);
2926 if(member->dataType)
2927 DeclareType(member->dataType, 0x0, 0x0);
2928 break;
2929 }
2930 case 1:
2931 case 2:
2932 {
2933 DeclareMembers((struct __ecereNameSpace__ecere__com__Class *)member, 0x1);
2934 break;
2935 }
2936 }
2937 }
2938 }
2939 if(context)
2940 FinishTemplatesContext(context);
2941 return topMember ? topMember->memberID : _class->memberID;
2942 }
2943
2944 extern struct Symbol * FindClass(char *  name);
2945
2946 extern char *  strchr(const char * , int);
2947
2948 extern void FullClassNameCat(char *  output, char *  className, unsigned int includeTemplateParams);
2949
2950 extern void FreeList(struct __ecereNameSpace__ecere__sys__OldList * list, void (*  FreeFunction)(void * ));
2951
2952 extern void FreeClassDef(struct ClassDef * def);
2953
2954 extern struct External * MkExternalDeclaration(struct Declaration * declaration);
2955
2956 extern struct Declaration * MkDeclaration(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct __ecereNameSpace__ecere__sys__OldList * initDeclarators);
2957
2958 extern char *  strcpy(char * , const char * );
2959
2960 extern void MangleClassName(char *  className);
2961
2962 extern void DeclareClass(struct Symbol * classSym, char *  className);
2963
2964 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move(struct __ecereNameSpace__ecere__sys__OldList * this, void *  item, void *  prevItem);
2965
2966 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(struct __ecereNameSpace__ecere__sys__OldList * this, void *  prevItem, void *  item);
2967
2968 void DeclareStruct(char * name, unsigned int skipNoHead)
2969 {
2970 struct External * external = (((void *)0));
2971 struct Symbol * classSym = FindClass(name);
2972
2973 if(!inCompiler || !classSym)
2974 return ;
2975 if(classSym->registered && (classSym->registered->type == 2 || classSym->registered->type == 3 || classSym->registered->type == 4))
2976 return ;
2977 if(classSym->registered && classSym->imported && !classSym->declaredStructSym)
2978 {
2979 struct Declaration * decl;
2980 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
2981 struct __ecereNameSpace__ecere__sys__OldList * declarations = (((void *)0));
2982 char structName[1024];
2983
2984 external = (classSym->registered && classSym->registered->type == 1) ? classSym->pointerExternal : classSym->structExternal;
2985 classSym->declaring++;
2986 if(strchr(classSym->string, '<'))
2987 {
2988 if(classSym->registered->templateClass)
2989 {
2990 DeclareStruct(classSym->registered->templateClass->fullName, skipNoHead);
2991 classSym->declaring--;
2992 }
2993 return ;
2994 }
2995 DeclareMembers(classSym->registered, 0x0);
2996 structName[0] = (char)0;
2997 FullClassNameCat(structName, name, 0x0);
2998 if(!skipNoHead)
2999 {
3000 unsigned int addedPadding = 0x0;
3001
3002 classSym->declaredStructSym = 0x1;
3003 declarations = MkList();
3004 AddMembers(declarations, classSym->registered, 0x0, (((void *)0)), classSym->registered, &addedPadding);
3005 if(!(*declarations).count || ((*declarations).count == 1 && addedPadding))
3006 {
3007 FreeList(declarations, FreeClassDef);
3008 declarations = (((void *)0));
3009 }
3010 }
3011 if(skipNoHead || declarations)
3012 {
3013 if(external && external->declaration)
3014 {
3015 ((struct Specifier *)(*external->declaration->specifiers).first)->definitions = declarations;
3016 if(curExternal && curExternal->symbol && curExternal->symbol->idCode < classSym->id)
3017 {
3018 if(classSym->structExternal)
3019 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->structExternal, curExternal->prev);
3020 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->pointerExternal, curExternal->prev);
3021 classSym->id = curExternal->symbol->idCode;
3022 classSym->idCode = curExternal->symbol->idCode;
3023 }
3024 }
3025 else
3026 {
3027 if(!external)
3028 external = MkExternalDeclaration((((void *)0)));
3029 specifiers = MkList();
3030 declarators = MkList();
3031 ListAdd(specifiers, MkStructOrUnion(3, MkIdentifier(structName), declarations));
3032 external->declaration = decl = MkDeclaration(specifiers, declarators);
3033 if(decl->symbol && !decl->symbol->pointerExternal)
3034 decl->symbol->pointerExternal = external;
3035 if(classSym->registered && classSym->registered->type == 1)
3036 {
3037 char className[1024];
3038
3039 strcpy(className, "__ecereClass_");
3040 FullClassNameCat(className, classSym->string, 0x1);
3041 MangleClassName(className);
3042 DeclareClass(classSym, className);
3043 external->symbol = classSym;
3044 classSym->pointerExternal = external;
3045 classSym->id = (curExternal && curExternal->symbol) ? curExternal->symbol->idCode : 0;
3046 classSym->idCode = (curExternal && curExternal->symbol) ? curExternal->symbol->idCode : 0;
3047 }
3048 else
3049 {
3050 char className[1024];
3051
3052 strcpy(className, "__ecereClass_");
3053 FullClassNameCat(className, classSym->string, 0x1);
3054 MangleClassName(className);
3055 classSym->structExternal = external;
3056 DeclareClass(classSym, className);
3057 external->symbol = classSym;
3058 }
3059 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal ? curExternal->prev : (((void *)0)), external);
3060 }
3061 }
3062 classSym->declaring--;
3063 }
3064 else if(curExternal && curExternal->symbol && curExternal->symbol->idCode < classSym->id)
3065 {
3066 classSym->declaring++;
3067 {
3068 if(classSym->registered)
3069 DeclareMembers(classSym->registered, 0x0);
3070 }
3071 if(classSym->registered && (classSym->registered->type == 1 || classSym->registered->type == 5))
3072 {
3073 if(classSym->structExternal)
3074 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->structExternal, curExternal->prev);
3075 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->pointerExternal, curExternal->prev);
3076 classSym->id = curExternal->symbol->idCode;
3077 classSym->idCode = curExternal->symbol->idCode;
3078 }
3079 classSym->declaring--;
3080 }
3081 }
3082
3083 extern char *  strcat(char * , const char * );
3084
3085 extern struct ModuleImport * FindModule(struct __ecereNameSpace__ecere__com__Instance * moduleToFind);
3086
3087 extern struct ModuleImport * mainModule;
3088
3089 extern struct Specifier * MkSpecifierName(char *  name);
3090
3091 extern struct Declarator * MkDeclaratorBrackets(struct Declarator * declarator);
3092
3093 extern struct Declarator * PlugDeclarator(struct Declarator * decl, struct Declarator * baseDecl);
3094
3095 extern struct Declarator * MkDeclaratorFunction(struct Declarator * declarator, struct __ecereNameSpace__ecere__sys__OldList * parameters);
3096
3097 extern struct InitDeclarator * MkInitDeclarator(struct Declarator * declarator, struct Initializer * initializer);
3098
3099 extern void FreeDeclarator(struct Declarator * decl);
3100
3101 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_PropertyImport;
3102
3103 struct PropertyImport
3104 {
3105 struct PropertyImport * prev;
3106 struct PropertyImport * next;
3107 char *  name;
3108 unsigned int isVirtual;
3109 unsigned int hasSet;
3110 unsigned int hasGet;
3111 } __attribute__ ((gcc_struct));
3112
3113 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(struct __ecereNameSpace__ecere__sys__OldList * this, void *  item);
3114
3115 void DeclareProperty(struct __ecereNameSpace__ecere__com__Property * prop, char * setName, char * getName)
3116 {
3117 struct Symbol * symbol = prop->symbol;
3118 char propName[1024];
3119
3120 strcpy(setName, "__ecereProp_");
3121 FullClassNameCat(setName, prop->_class->fullName, 0x0);
3122 strcat(setName, "_Set_");
3123 FullClassNameCat(setName, prop->name, 0x1);
3124 strcpy(getName, "__ecereProp_");
3125 FullClassNameCat(getName, prop->_class->fullName, 0x0);
3126 strcat(getName, "_Get_");
3127 FullClassNameCat(getName, prop->name, 0x1);
3128 strcpy(propName, "__ecereProp_");
3129 FullClassNameCat(propName, prop->_class->fullName, 0x0);
3130 strcat(propName, "_");
3131 FullClassNameCat(propName, prop->name, 0x1);
3132 MangleClassName(getName);
3133 MangleClassName(setName);
3134 MangleClassName(propName);
3135 if(prop->_class->type == 1)
3136 DeclareStruct(prop->_class->fullName, 0x0);
3137 if(!symbol || curExternal->symbol->idCode < symbol->id)
3138 {
3139 unsigned int imported = 0x0;
3140 unsigned int dllImport = 0x0;
3141
3142 if(!symbol || symbol->_import)
3143 {
3144 if(!symbol)
3145 {
3146 struct Symbol * classSym;
3147
3148 if(!prop->_class->symbol)
3149 prop->_class->symbol = FindClass(prop->_class->fullName);
3150 classSym = prop->_class->symbol;
3151 if(classSym && !classSym->_import)
3152 {
3153 struct ModuleImport * module;
3154
3155 if(prop->_class->module)
3156 module = FindModule(prop->_class->module);
3157 else
3158 module = mainModule;
3159 classSym->_import = __extension__ ({
3160 struct ClassImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_ClassImport);
3161
3162 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(prop->_class->fullName), __ecereInstance1->isRemote = prop->_class->isRemote, __ecereInstance1;
3163 });
3164 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->classes, classSym->_import);
3165 }
3166 symbol = prop->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
3167 symbol->_import = (struct ClassImport *)__extension__ ({
3168 struct PropertyImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_PropertyImport);
3169
3170 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(prop->name), __ecereInstance1->isVirtual = 0x0, __ecereInstance1->hasSet = prop->Set ? 0x1 : 0x0, __ecereInstance1->hasGet = prop->Get ? 0x1 : 0x0, __ecereInstance1;
3171 });
3172 if(classSym)
3173 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&classSym->_import->properties, symbol->_import);
3174 }
3175 imported = 0x1;
3176 if(prop->_class->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)prop->_class->module + structSize_Instance)))->importType != 1)
3177 dllImport = 0x1;
3178 }
3179 if(!symbol->type)
3180 {
3181 struct Context * context = SetupTemplatesContext(prop->_class);
3182
3183 symbol->type = ProcessTypeString(prop->dataTypeString, 0x0);
3184 FinishTemplatesContext(context);
3185 }
3186 if(prop->Get)
3187 {
3188 if(!symbol->externalGet || symbol->externalGet->type == 0)
3189 {
3190 struct Declaration * decl;
3191 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
3192 struct Declarator * d;
3193 struct __ecereNameSpace__ecere__sys__OldList * params;
3194 struct Specifier * spec;
3195 struct External * external;
3196 struct Declarator * typeDecl;
3197 unsigned int simple = 0x0;
3198
3199 specifiers = MkList();
3200 declarators = MkList();
3201 params = MkList();
3202 ListAdd(params, MkTypeName(MkListOne(MkSpecifierName(prop->_class->fullName)), MkDeclaratorIdentifier(MkIdentifier("this"))));
3203 d = MkDeclaratorIdentifier(MkIdentifier(getName));
3204 if(dllImport)
3205 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
3206 {
3207 struct Context * context = SetupTemplatesContext(prop->_class);
3208
3209 typeDecl = SpecDeclFromString(prop->dataTypeString, specifiers, (((void *)0)));
3210 FinishTemplatesContext(context);
3211 }
3212 for(spec = (*specifiers).first; spec; spec = spec->next)
3213 {
3214 if(spec->type == 1)
3215 {
3216 if((!typeDecl || typeDecl->type == 1))
3217 {
3218 struct Symbol * classSym = spec->symbol;
3219
3220 symbol->_class = classSym->registered;
3221 if(classSym->registered && classSym->registered->type == 1)
3222 {
3223 DeclareStruct(spec->name, 0x0);
3224 simple = 0x1;
3225 }
3226 }
3227 }
3228 }
3229 if(!simple)
3230 d = PlugDeclarator(typeDecl, d);
3231 else
3232 {
3233 ListAdd(params, MkTypeName(specifiers, PlugDeclarator(typeDecl, MkDeclaratorIdentifier(MkIdentifier("value")))));
3234 specifiers = MkList();
3235 }
3236 d = MkDeclaratorFunction(d, params);
3237 if(dllImport)
3238 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
3239 else if(prop->_class->symbol && ((struct Symbol *)prop->_class->symbol)->isStatic)
3240 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
3241 if(simple)
3242 ListAdd(specifiers, MkSpecifier(VOID));
3243 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
3244 decl = MkDeclaration(specifiers, declarators);
3245 external = MkExternalDeclaration(decl);
3246 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
3247 external->symbol = symbol;
3248 symbol->externalGet = external;
3249 ReplaceThisClassSpecifiers(specifiers, prop->_class);
3250 if(typeDecl)
3251 FreeDeclarator(typeDecl);
3252 }
3253 else
3254 {
3255 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->externalGet, curExternal->prev);
3256 }
3257 }
3258 if(prop->Set)
3259 {
3260 if(!symbol->externalSet || symbol->externalSet->type == 0)
3261 {
3262 struct Declaration * decl;
3263 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
3264 struct Declarator * d;
3265 struct __ecereNameSpace__ecere__sys__OldList * params;
3266 struct Specifier * spec;
3267 struct External * external;
3268 struct Declarator * typeDecl;
3269
3270 declarators = MkList();
3271 params = MkList();
3272 if(!prop->conversion || prop->_class->type == 1)
3273 {
3274 ListAdd(params, MkTypeName(MkListOne(MkSpecifierName(prop->_class->fullName)), MkDeclaratorIdentifier(MkIdentifier("this"))));
3275 }
3276 specifiers = MkList();
3277 {
3278 struct Context * context = SetupTemplatesContext(prop->_class);
3279
3280 typeDecl = d = SpecDeclFromString(prop->dataTypeString, specifiers, MkDeclaratorIdentifier(MkIdentifier("value")));
3281 FinishTemplatesContext(context);
3282 }
3283 ListAdd(params, MkTypeName(specifiers, d));
3284 d = MkDeclaratorIdentifier(MkIdentifier(setName));
3285 if(dllImport)
3286 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
3287 d = MkDeclaratorFunction(d, params);
3288 for(spec = (*specifiers).first; spec; spec = spec->next)
3289 {
3290 if(spec->type == 1)
3291 {
3292 if((!typeDecl || typeDecl->type == 1))
3293 {
3294 struct Symbol * classSym = spec->symbol;
3295
3296 symbol->_class = classSym->registered;
3297 if(classSym->registered && classSym->registered->type == 1)
3298 DeclareStruct(spec->name, 0x0);
3299 }
3300 }
3301 }
3302 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
3303 specifiers = MkList();
3304 if(dllImport)
3305 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
3306 else if(prop->_class->symbol && ((struct Symbol *)prop->_class->symbol)->isStatic)
3307 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
3308 if(!prop->conversion || prop->_class->type == 1)
3309 ListAdd(specifiers, MkSpecifier(VOID));
3310 else
3311 ListAdd(specifiers, MkSpecifierName(prop->_class->fullName));
3312 decl = MkDeclaration(specifiers, declarators);
3313 external = MkExternalDeclaration(decl);
3314 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
3315 external->symbol = symbol;
3316 symbol->externalSet = external;
3317 ReplaceThisClassSpecifiers(specifiers, prop->_class);
3318 }
3319 else
3320 {
3321 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->externalSet, curExternal->prev);
3322 }
3323 }
3324 if(!symbol->externalPtr)
3325 {
3326 struct Declaration * decl;
3327 struct External * external;
3328 struct __ecereNameSpace__ecere__sys__OldList * specifiers = MkList();
3329
3330 if(imported)
3331 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
3332 else
3333 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
3334 ListAdd(specifiers, MkSpecifierName("Property"));
3335 {
3336 struct __ecereNameSpace__ecere__sys__OldList * list = MkList();
3337
3338 ListAdd(list, MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier(propName))), (((void *)0))));
3339 if(!imported)
3340 {
3341 strcpy(propName, "__ecerePropM_");
3342 FullClassNameCat(propName, prop->_class->fullName, 0x0);
3343 strcat(propName, "_");
3344 FullClassNameCat(propName, prop->name, 0x1);
3345 MangleClassName(propName);
3346 ListAdd(list, MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier(propName))), (((void *)0))));
3347 }
3348 decl = MkDeclaration(specifiers, list);
3349 }
3350 external = MkExternalDeclaration(decl);
3351 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
3352 external->symbol = symbol;
3353 symbol->externalPtr = external;
3354 }
3355 else
3356 {
3357 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->externalPtr, curExternal->prev);
3358 }
3359 symbol->id = curExternal->symbol->idCode;
3360 }
3361 }
3362
3363 struct Type * Dereference(struct Type * source)
3364 {
3365 struct Type * type = (((void *)0));
3366
3367 if(source)
3368 {
3369 if(source->kind == 13 || source->kind == 12)
3370 {
3371 type = source->type;
3372 source->type->refCount++;
3373 }
3374 else if(source->kind == 8 && !strcmp(source->_class->string, "String"))
3375 {
3376 type = __extension__ ({
3377 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
3378
3379 __ecereInstance1->kind = 1, __ecereInstance1->refCount = 1, __ecereInstance1;
3380 });
3381 }
3382 else if(source->kind == 8 && source->_class && source->_class->registered && source->_class->registered->type == 5)
3383 {
3384 type = source;
3385 source->refCount++;
3386 }
3387 else
3388 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "cannot dereference type\n", (((void *)0))));
3389 }
3390 return type;
3391 }
3392
3393 static struct Type * Reference(struct Type * source)
3394 {
3395 struct Type * type = (((void *)0));
3396
3397 if(source)
3398 {
3399 type = __extension__ ({
3400 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
3401
3402 __ecereInstance1->kind = 13, __ecereInstance1->type = source, __ecereInstance1->refCount = 1, __ecereInstance1;
3403 });
3404 source->refCount++;
3405 }
3406 return type;
3407 }
3408
3409 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);
3410
3411 extern void *  memcpy(void * , const void * , size_t size);
3412
3413 void ProcessMethodType(struct __ecereNameSpace__ecere__com__Method * method);
3414
3415 extern void FreeExpression(struct Expression * exp);
3416
3417 extern void __ecereNameSpace__ecere__sys__ChangeCh(char *  string, char ch1, char ch2);
3418
3419 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);
3420
3421 static void ProcessInitializer(struct Initializer * init, struct Type * type);
3422
3423 extern struct Type * MkClassType(char *  name);
3424
3425 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);
3426
3427 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)
3428 {
3429 struct Identifier * ident = member->identifiers ? (*member->identifiers).first : (((void *)0));
3430 unsigned int found = 0x0;
3431 struct __ecereNameSpace__ecere__com__DataMember * dataMember = (((void *)0));
3432 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
3433 unsigned int freeType = 0x0;
3434
3435 yylloc = member->loc;
3436 if(!ident)
3437 {
3438 if(curMember)
3439 {
3440 __ecereNameSpace__ecere__com__eClass_FindNextMember(_class, curClass, curMember, subMemberStack, subMemberStackPos);
3441 if(*curMember)
3442 {
3443 found = 0x1;
3444 dataMember = *curMember;
3445 }
3446 }
3447 }
3448 else
3449 {
3450 struct __ecereNameSpace__ecere__com__DataMember * thisMember = (struct __ecereNameSpace__ecere__com__DataMember *)__ecereNameSpace__ecere__com__eClass_FindProperty(_class, ident->string, privateModule);
3451 struct __ecereNameSpace__ecere__com__DataMember * _subMemberStack[256];
3452 int _subMemberStackPos = 0;
3453
3454 if(!thisMember)
3455 thisMember = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, ident->string, privateModule, _subMemberStack, &_subMemberStackPos);
3456 if(thisMember)
3457 {
3458 dataMember = thisMember;
3459 if(curMember && thisMember->memberAccess == 1)
3460 {
3461 *curMember = thisMember;
3462 *curClass = thisMember->_class;
3463 memcpy(subMemberStack, _subMemberStack, sizeof(struct __ecereNameSpace__ecere__com__DataMember *) * _subMemberStackPos);
3464 *subMemberStackPos = _subMemberStackPos;
3465 }
3466 found = 0x1;
3467 }
3468 else
3469 {
3470 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, ident->string, privateModule);
3471 if(method && method->type == 1)
3472 found = 0x1;
3473 else
3474 method = (((void *)0));
3475 }
3476 }
3477 if(found)
3478 {
3479 struct Type * type = (((void *)0));
3480
3481 if(dataMember)
3482 {
3483 if(!dataMember->dataType && dataMember->dataTypeString)
3484 {
3485 struct Context * context = SetupTemplatesContext(_class);
3486
3487 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
3488 FinishTemplatesContext(context);
3489 }
3490 type = dataMember->dataType;
3491 }
3492 else if(method)
3493 {
3494 if(!method->dataType)
3495 ProcessMethodType(method);
3496 type = method->dataType;
3497 }
3498 if(ident && ident->next)
3499 {
3500 for(ident = ident->next; ident && type; ident = ident->next)
3501 {
3502 if(type->kind == 8)
3503 {
3504 dataMember = (struct __ecereNameSpace__ecere__com__DataMember *)__ecereNameSpace__ecere__com__eClass_FindProperty(type->_class->registered, ident->string, privateModule);
3505 if(!dataMember)
3506 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMember(type->_class->registered, ident->string, privateModule, (((void *)0)), (((void *)0)));
3507 if(dataMember)
3508 type = dataMember->dataType;
3509 }
3510 else if(type->kind == 9 || type->kind == 10)
3511 {
3512 struct Type * memberType;
3513
3514 for(memberType = type->members.first; memberType; memberType = memberType->next)
3515 {
3516 if(!strcmp(memberType->name, ident->string))
3517 {
3518 type = memberType;
3519 break;
3520 }
3521 }
3522 }
3523 }
3524 }
3525 if(type && type->kind == 20 && type->templateParameter->type == 0 && _class->templateArgs)
3526 {
3527 int id = 0;
3528 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
3529 struct __ecereNameSpace__ecere__com__Class * sClass;
3530
3531 for(sClass = _class; sClass; sClass = sClass->base)
3532 {
3533 id = 0;
3534 if(sClass->templateClass)
3535 sClass = sClass->templateClass;
3536 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
3537 {
3538 if(curParam->type == 0 && !strcmp(type->templateParameter->identifier->string, curParam->name))
3539 {
3540 for(sClass = sClass->base; sClass; sClass = sClass->base)
3541 {
3542 if(sClass->templateClass)
3543 sClass = sClass->templateClass;
3544 id += sClass->templateParams.count;
3545 }
3546 break;
3547 }
3548 id++;
3549 }
3550 if(curParam)
3551 break;
3552 }
3553 if(curParam)
3554 {
3555 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = _class->templateArgs[id];
3556
3557 if(arg.dataTypeString)
3558 {
3559 type = ProcessTypeString(arg.dataTypeString, 0x0);
3560 freeType = 0x1;
3561 if(type && _class->templateClass)
3562 type->passAsTemplate = 0x1;
3563 if(type)
3564 {
3565 }
3566 }
3567 }
3568 }
3569 if(type && type->kind == 8 && type->_class && type->_class->registered && strchr(type->_class->registered->fullName, '<'))
3570 {
3571 struct __ecereNameSpace__ecere__com__Class * expClass = type->_class->registered;
3572 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
3573 int c;
3574 int paramCount = 0;
3575 int lastParam = -1;
3576 char templateString[1024];
3577 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
3578
3579 sprintf(templateString, "%s<", expClass->templateClass->fullName);
3580 for(cClass = expClass; cClass; cClass = cClass->base)
3581 {
3582 int p = 0;
3583
3584 if(cClass->templateClass)
3585 cClass = cClass->templateClass;
3586 for(param = cClass->templateParams.first; param; param = param->next)
3587 {
3588 int id = p;
3589 struct __ecereNameSpace__ecere__com__Class * sClass;
3590 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
3591
3592 for(sClass = cClass->base; sClass; sClass = sClass->base)
3593 {
3594 if(sClass->templateClass)
3595 sClass = sClass->templateClass;
3596 id += sClass->templateParams.count;
3597 }
3598 arg = expClass->templateArgs[id];
3599 for(sClass = _class; sClass; sClass = sClass->base)
3600 {
3601 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * cParam;
3602 int p = 0;
3603 struct __ecereNameSpace__ecere__com__Class * nextClass;
3604
3605 if(sClass->templateClass)
3606 sClass = sClass->templateClass;
3607 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
3608 {
3609 if(nextClass->templateClass)
3610 nextClass = nextClass->templateClass;
3611 p += nextClass->templateParams.count;
3612 }
3613 for(cParam = sClass->templateParams.first; cParam; cParam = cParam->next, p++)
3614 {
3615 if(cParam->type == 0 && arg.dataTypeString && !strcmp(cParam->name, arg.dataTypeString))
3616 {
3617 if(_class->templateArgs && arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
3618 {
3619 arg.dataTypeString = _class->templateArgs[p].dataTypeString;
3620 arg.dataTypeClass = _class->templateArgs[p].dataTypeClass;
3621 break;
3622 }
3623 }
3624 }
3625 }
3626 {
3627 char argument[256];
3628
3629 argument[0] = '\0';
3630 switch(param->type)
3631 {
3632 case 2:
3633 {
3634 char expString[1024];
3635 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
3636 struct Declarator * decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
3637 struct Expression * exp;
3638 char * string = PrintHexUInt64(arg.expression.ui64);
3639
3640 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
3641 (__ecereNameSpace__ecere__com__eSystem_Delete(string), string = 0);
3642 ProcessExpressionType(exp);
3643 ComputeExpression(exp);
3644 expString[0] = '\0';
3645 PrintExpression(exp, expString);
3646 strcat(argument, expString);
3647 FreeExpression(exp);
3648 break;
3649 }
3650 case 1:
3651 {
3652 strcat(argument, arg.member->name);
3653 break;
3654 }
3655 case 0:
3656 {
3657 if(arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
3658 strcat(argument, arg.dataTypeString);
3659 break;
3660 }
3661 }
3662 if(argument[0])
3663 {
3664 if(paramCount)
3665 strcat(templateString, ", ");
3666 if(lastParam != p - 1)
3667 {
3668 strcat(templateString, param->name);
3669 strcat(templateString, " = ");
3670 }
3671 strcat(templateString, argument);
3672 paramCount++;
3673 lastParam = p;
3674 }
3675 p++;
3676 }
3677 }
3678 }
3679 {
3680 int len = strlen(templateString);
3681
3682 if(templateString[len - 1] == '<')
3683 len--;
3684 else
3685 {
3686 if(templateString[len - 1] == '>')
3687 templateString[len++] = ' ';
3688 templateString[len++] = '>';
3689 }
3690 templateString[len++] = '\0';
3691 }
3692 {
3693 struct Context * context = SetupTemplatesContext(_class);
3694
3695 if(freeType)
3696 FreeType(type);
3697 type = ProcessTypeString(templateString, 0x0);
3698 freeType = 0x1;
3699 FinishTemplatesContext(context);
3700 }
3701 }
3702 if(method && member->initializer && member->initializer->type == 0 && member->initializer->exp)
3703 {
3704 ProcessExpressionType(member->initializer->exp);
3705 if(!member->initializer->exp->expType)
3706 {
3707 if(inCompiler)
3708 {
3709 char expString[10240];
3710
3711 expString[0] = '\0';
3712 PrintExpression(member->initializer->exp, expString);
3713 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
3714 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved symbol used as an instance method %s\n", (((void *)0))), expString);
3715 }
3716 }
3717 else if(!MatchTypes(member->initializer->exp->expType, type, (((void *)0)), (((void *)0)), _class, 0x1, 0x1, 0x0, 0x0))
3718 {
3719 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible instance method %s\n", (((void *)0))), ident->string);
3720 }
3721 }
3722 else if(member->initializer)
3723 {
3724 ProcessInitializer(member->initializer, type);
3725 }
3726 if(freeType)
3727 FreeType(type);
3728 }
3729 else
3730 {
3731 if(_class && _class->type == 3)
3732 {
3733 if(member->initializer)
3734 {
3735 struct Type * type = MkClassType(_class->fullName);
3736
3737 ProcessInitializer(member->initializer, type);
3738 FreeType(type);
3739 }
3740 }
3741 else
3742 {
3743 if(member->initializer)
3744 {
3745 ProcessInitializer(member->initializer, (((void *)0)));
3746 }
3747 if(ident)
3748 {
3749 if(method)
3750 {
3751 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't find virtual method %s in class %s\n", (((void *)0))), ident->string, _class->fullName);
3752 }
3753 else if(_class)
3754 {
3755 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't find member %s in class %s\n", (((void *)0))), ident->string, _class->fullName);
3756 if(inCompiler)
3757 __ecereNameSpace__ecere__com__eClass_AddDataMember(_class, ident->string, "int", 0, 0, 1);
3758 }
3759 }
3760 else if(_class)
3761 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "too many initializers for instantiation of class %s\n", (((void *)0))), _class->fullName);
3762 }
3763 }
3764 }
3765
3766 extern struct Identifier * GetDeclId(struct Declarator * decl);
3767
3768 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);
3769
3770 extern void FreeSpecifier(struct Specifier * spec);
3771
3772 static void ProcessFunction(struct FunctionDefinition * function);
3773
3774 extern struct __ecereNameSpace__ecere__sys__OldList *  CopyList(struct __ecereNameSpace__ecere__sys__OldList *  source, void *  (*  CopyFunction)(void * ));
3775
3776 extern struct Specifier * CopySpecifier(struct Specifier * spec);
3777
3778 extern struct Declarator * CopyDeclarator(struct Declarator * declarator);
3779
3780 extern void FreeClassFunction(struct ClassFunction * func);
3781
3782 extern struct MemberInit * MkMemberInit(struct __ecereNameSpace__ecere__sys__OldList * ids, struct Initializer * initializer);
3783
3784 extern struct Initializer * MkInitializerAssignment(struct Expression * exp);
3785
3786 void ProcessInstantiationType(struct Instantiation * inst)
3787 {
3788 yylloc = inst->loc;
3789 if(inst->_class)
3790 {
3791 struct MembersInit * members;
3792 struct Symbol * classSym;
3793 struct __ecereNameSpace__ecere__com__Class * _class;
3794
3795 classSym = inst->_class->symbol;
3796 _class = classSym ? classSym->registered : (((void *)0));
3797 if(!_class || _class->type != 5)
3798 DeclareStruct(inst->_class->name, 0x0);
3799 afterExternal = afterExternal ? afterExternal : curExternal;
3800 if(inst->exp)
3801 ProcessExpressionType(inst->exp);
3802 inst->isConstant = 0x1;
3803 if(inst->members)
3804 {
3805 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
3806 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
3807 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
3808 int subMemberStackPos = 0;
3809
3810 for(members = (*inst->members).first; members; members = members->next)
3811 {
3812 switch(members->type)
3813 {
3814 case 1:
3815 {
3816 char name[1024];
3817 static unsigned int instMethodID = 0;
3818 struct External * external = curExternal;
3819 struct Context * context = curContext;
3820 struct Declarator * declarator = members->function->declarator;
3821 struct Identifier * nameID = GetDeclId(declarator);
3822 char * unmangled = nameID ? nameID->string : (((void *)0));
3823 struct Expression * exp;
3824 struct External * createdExternal = (((void *)0));
3825
3826 if(inCompiler)
3827 {
3828 char number[16];
3829
3830 strcpy(name, "__ecereInstMeth_");
3831 FullClassNameCat(name, _class ? _class->fullName : "_UNKNOWNCLASS", 0x0);
3832 strcat(name, "_");
3833 strcat(name, nameID->string);
3834 strcat(name, "_");
3835 sprintf(number, "_%08d", instMethodID++);
3836 strcat(name, number);
3837 nameID->string = __ecereNameSpace__ecere__sys__CopyString(name);
3838 }
3839 if(declarator)
3840 {
3841 struct Symbol * symbol = declarator->symbol;
3842 struct __ecereNameSpace__ecere__com__Method * method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, unmangled, privateModule);
3843
3844 if(method && method->type == 1)
3845 {
3846 symbol->method = method;
3847 ProcessMethodType(method);
3848 if(!symbol->type->thisClass)
3849 {
3850 if(method->dataType->thisClass && currentClass && __ecereNameSpace__ecere__com__eClass_IsDerived(currentClass, method->dataType->thisClass->registered))
3851 {
3852 if(!currentClass->symbol)
3853 currentClass->symbol = FindClass(currentClass->fullName);
3854 symbol->type->thisClass = currentClass->symbol;
3855 }
3856 else
3857 {
3858 if(!_class->symbol)
3859 _class->symbol = FindClass(_class->fullName);
3860 symbol->type->thisClass = _class->symbol;
3861 }
3862 }
3863 DeclareType(symbol->type, 0x1, 0x1);
3864 }
3865 else if(classSym)
3866 {
3867 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't find virtual method %s in class %s\n", (((void *)0))), unmangled, classSym->string);
3868 }
3869 }
3870 createdExternal = ProcessClassFunction(classSym ? classSym->registered : (((void *)0)), members->function, ast, afterExternal, 0x1);
3871 if(nameID)
3872 {
3873 FreeSpecifier(nameID->_class);
3874 nameID->_class = (((void *)0));
3875 }
3876 if(inCompiler)
3877 {
3878 struct Type * type = declarator->symbol->type;
3879 struct External * oldExternal = curExternal;
3880
3881 declarator->symbol->id = declarator->symbol->idCode = curExternal->symbol->idCode;
3882 {
3883 struct External * externalDecl;
3884
3885 externalDecl = MkExternalDeclaration((((void *)0)));
3886 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), oldExternal->prev, externalDecl);
3887 if(createdExternal->function)
3888 {
3889 ProcessFunction(createdExternal->function);
3890 {
3891 struct Declaration * decl = MkDeclaration(CopyList(createdExternal->function->specifiers, CopySpecifier), MkListOne(MkInitDeclarator(CopyDeclarator(declarator), (((void *)0)))));
3892
3893 externalDecl->declaration = decl;
3894 if(decl->symbol && !decl->symbol->pointerExternal)
3895 decl->symbol->pointerExternal = externalDecl;
3896 declarator->symbol->pointerExternal = externalDecl;
3897 }
3898 }
3899 }
3900 }
3901 else if(declarator)
3902 {
3903 curExternal = declarator->symbol->pointerExternal;
3904 ProcessFunction((struct FunctionDefinition *)members->function);
3905 }
3906 curExternal = external;
3907 curContext = context;
3908 if(inCompiler)
3909 {
3910 FreeClassFunction(members->function);
3911 exp = QMkExpId(name);
3912 members->type = 0;
3913 members->dataMembers = MkListOne(MkMemberInit(MkListOne(MkIdentifier(unmangled)), MkInitializerAssignment(exp)));
3914 (__ecereNameSpace__ecere__com__eSystem_Delete(unmangled), unmangled = 0);
3915 }
3916 break;
3917 }
3918 case 0:
3919 {
3920 if(members->dataMembers && classSym)
3921 {
3922 struct MemberInit * member;
3923 struct Location oldyyloc = yylloc;
3924
3925 for(member = (*members->dataMembers).first; member; member = member->next)
3926 {
3927 ProcessMemberInitData(member, classSym->registered, &curClass, &curMember, subMemberStack, &subMemberStackPos);
3928 if(member->initializer && !member->initializer->isConstant)
3929 inst->isConstant = 0x0;
3930 }
3931 yylloc = oldyyloc;
3932 }
3933 break;
3934 }
3935 }
3936 }
3937 }
3938 }
3939 }
3940
3941 static void DeclareType(struct Type * type, unsigned int declarePointers, unsigned int declareParams)
3942 {
3943 if(inCompiler)
3944 {
3945 if(type->kind == 11)
3946 {
3947 struct Type * param;
3948
3949 if(declareParams)
3950 {
3951 for(param = type->params.first; param; param = param->next)
3952 DeclareType(param, declarePointers, 0x1);
3953 }
3954 DeclareType(type->returnType, declarePointers, 0x1);
3955 }
3956 else if(type->kind == 13 && declarePointers)
3957 DeclareType(type->type, declarePointers, 0x0);
3958 else if(type->kind == 8)
3959 {
3960 if(type->_class->registered && (type->_class->registered->type == 1 || type->_class->registered->type == 5) && !type->_class->declaring)
3961 DeclareStruct(type->_class->registered->fullName, type->_class->registered->type == 5);
3962 }
3963 else if(type->kind == 9 || type->kind == 10)
3964 {
3965 struct Type * member;
3966
3967 for(member = type->members.first; member; member = member->next)
3968 DeclareType(member, 0x0, 0x0);
3969 }
3970 else if(type->kind == 12)
3971 DeclareType(type->arrayType, declarePointers, 0x0);
3972 }
3973 }
3974
3975 extern struct __ecereNameSpace__ecere__com__Class * __ecereNameSpace__ecere__com__eSystem_FindClass(struct __ecereNameSpace__ecere__com__Instance * module, char *  name);
3976
3977 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * FindTemplateArg(struct __ecereNameSpace__ecere__com__Class * _class, struct TemplateParameter * param)
3978 {
3979 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * arg = (((void *)0));
3980 int id = 0;
3981 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
3982 struct __ecereNameSpace__ecere__com__Class * sClass;
3983
3984 for(sClass = _class; sClass; sClass = sClass->base)
3985 {
3986 id = 0;
3987 if(sClass->templateClass)
3988 sClass = sClass->templateClass;
3989 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
3990 {
3991 if(curParam->type == 0 && !strcmp(param->identifier->string, curParam->name))
3992 {
3993 for(sClass = sClass->base; sClass; sClass = sClass->base)
3994 {
3995 if(sClass->templateClass)
3996 sClass = sClass->templateClass;
3997 id += sClass->templateParams.count;
3998 }
3999 break;
4000 }
4001 id++;
4002 }
4003 if(curParam)
4004 break;
4005 }
4006 if(curParam)
4007 {
4008 arg = &_class->templateArgs[id];
4009 if(arg && param->type == 0)
4010 (*arg).dataTypeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, (*arg).dataTypeString);
4011 }
4012 return arg;
4013 }
4014
4015 extern struct Context * PushContext(void);
4016
4017 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplatedType;
4018
4019 struct TemplatedType
4020 {
4021 uintptr_t key;
4022 struct __ecereNameSpace__ecere__sys__BTNode * parent;
4023 struct __ecereNameSpace__ecere__sys__BTNode * left;
4024 struct __ecereNameSpace__ecere__sys__BTNode * right;
4025 int depth;
4026 struct TemplateParameter * param;
4027 } __attribute__ ((gcc_struct));
4028
4029 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(struct __ecereNameSpace__ecere__sys__BinaryTree * this, struct __ecereNameSpace__ecere__sys__BTNode * node);
4030
4031 struct Context * SetupTemplatesContext(struct __ecereNameSpace__ecere__com__Class * _class)
4032 {
4033 struct Context * context = PushContext();
4034
4035 context->templateTypesOnly = 0x1;
4036 if(_class->symbol && ((struct Symbol *)_class->symbol)->templateParams)
4037 {
4038 struct TemplateParameter * param = (*((struct Symbol *)_class->symbol)->templateParams).first;
4039
4040 for(; param; param = param->next)
4041 {
4042 if(param->type == 0 && param->identifier)
4043 {
4044 struct TemplatedType * type = (type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TemplatedType), type->key = (uintptr_t)param->identifier->string, type->param = param, type);
4045
4046 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&curContext->templateTypes, (struct __ecereNameSpace__ecere__sys__BTNode *)type);
4047 }
4048 }
4049 }
4050 else if(_class)
4051 {
4052 struct __ecereNameSpace__ecere__com__Class * sClass;
4053
4054 for(sClass = _class; sClass; sClass = sClass->base)
4055 {
4056 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * p;
4057
4058 for(p = sClass->templateParams.first; p; p = p->next)
4059 {
4060 if(p->type == 0)
4061 {
4062 struct TemplateParameter * param = p->param;
4063 struct TemplatedType * type;
4064
4065 if(!param)
4066 {
4067 p->param = param = __extension__ ({
4068 struct TemplateParameter * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TemplateParameter);
4069
4070 __ecereInstance1->identifier = MkIdentifier(p->name), __ecereInstance1->type = p->type, __ecereInstance1->dataTypeString = p->dataTypeString, __ecereInstance1;
4071 });
4072 }
4073 type = __extension__ ({
4074 struct TemplatedType * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TemplatedType);
4075
4076 __ecereInstance1->key = (uintptr_t)p->name, __ecereInstance1->param = param, __ecereInstance1;
4077 });
4078 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&curContext->templateTypes, (struct __ecereNameSpace__ecere__sys__BTNode *)type);
4079 }
4080 }
4081 }
4082 }
4083 return context;
4084 }
4085
4086 extern void PopContext(struct Context * ctx);
4087
4088 extern void FreeContext(struct Context * context);
4089
4090 void FinishTemplatesContext(struct Context * context)
4091 {
4092 PopContext(context);
4093 FreeContext(context);
4094 ((context ? (__ecereClass_Context->Destructor ? __ecereClass_Context->Destructor(context) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(context)) : 0), context = 0);
4095 }
4096
4097 void ProcessMethodType(struct __ecereNameSpace__ecere__com__Method * method)
4098 {
4099 if(!method->dataType)
4100 {
4101 struct Context * context = SetupTemplatesContext(method->_class);
4102
4103 method->dataType = ProcessTypeString(method->dataTypeString, 0x0);
4104 FinishTemplatesContext(context);
4105 if(method->type != 1 && method->dataType)
4106 {
4107 if(!method->dataType->thisClass && !method->dataType->staticMethod)
4108 {
4109 if(!method->_class->symbol)
4110 method->_class->symbol = FindClass(method->_class->fullName);
4111 method->dataType->thisClass = method->_class->symbol;
4112 }
4113 }
4114 }
4115 }
4116
4117 void ProcessPropertyType(struct __ecereNameSpace__ecere__com__Property * prop)
4118 {
4119 if(!prop->dataType)
4120 {
4121 struct Context * context = SetupTemplatesContext(prop->_class);
4122
4123 prop->dataType = ProcessTypeString(prop->dataTypeString, 0x0);
4124 FinishTemplatesContext(context);
4125 }
4126 }
4127
4128 extern struct Declarator * GetFuncDecl(struct Declarator * decl);
4129
4130 extern void FreeTypeName(struct TypeName * typeName);
4131
4132 static void ProcessDeclarator(struct Declarator * decl);
4133
4134 extern struct __ecereNameSpace__ecere__sys__OldList *  excludedSymbols;
4135
4136 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_MethodImport;
4137
4138 struct MethodImport
4139 {
4140 struct MethodImport * prev;
4141 struct MethodImport * next;
4142 char *  name;
4143 unsigned int isVirtual;
4144 } __attribute__ ((gcc_struct));
4145
4146 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(struct __ecereNameSpace__ecere__sys__OldList * this, void *  item);
4147
4148 void DeclareMethod(struct __ecereNameSpace__ecere__com__Method * method, char * name)
4149 {
4150 struct Symbol * symbol = method->symbol;
4151
4152 if(!symbol || (!symbol->pointerExternal && method->type == 1) || symbol->id > (curExternal ? curExternal->symbol->idCode : -1))
4153 {
4154 unsigned int imported = 0x0;
4155 unsigned int dllImport = 0x0;
4156
4157 if(!method->dataType)
4158 method->dataType = ProcessTypeString(method->dataTypeString, 0x0);
4159 if(!symbol || symbol->_import || method->type == 1)
4160 {
4161 if(!symbol || method->type == 1)
4162 {
4163 struct Symbol * classSym;
4164
4165 if(!method->_class->symbol)
4166 method->_class->symbol = FindClass(method->_class->fullName);
4167 classSym = method->_class->symbol;
4168 if(!classSym->_import)
4169 {
4170 struct ModuleImport * module;
4171
4172 if(method->_class->module && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)method->_class->module + structSize_Instance)))->name)
4173 module = FindModule(method->_class->module);
4174 else
4175 module = mainModule;
4176 classSym->_import = __extension__ ({
4177 struct ClassImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_ClassImport);
4178
4179 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(method->_class->fullName), __ecereInstance1->isRemote = method->_class->isRemote, __ecereInstance1;
4180 });
4181 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->classes, classSym->_import);
4182 }
4183 if(!symbol)
4184 {
4185 symbol = method->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4186 }
4187 if(!symbol->_import)
4188 {
4189 symbol->_import = (struct ClassImport *)__extension__ ({
4190 struct MethodImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_MethodImport);
4191
4192 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(method->name), __ecereInstance1->isVirtual = method->type == 1, __ecereInstance1;
4193 });
4194 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&classSym->_import->methods, symbol->_import);
4195 }
4196 if(!symbol)
4197 {
4198 symbol->type = method->dataType;
4199 if(symbol->type)
4200 symbol->type->refCount++;
4201 }
4202 }
4203 if(!method->dataType->dllExport)
4204 {
4205 imported = 0x1;
4206 if(method->_class->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)method->_class->module + structSize_Instance)))->importType != 1)
4207 dllImport = 0x1;
4208 }
4209 }
4210 if(method->type != 1 && method->dataType)
4211 DeclareType(method->dataType, 0x1, 0x1);
4212 if(!symbol->pointerExternal || symbol->pointerExternal->type == 0)
4213 {
4214 struct Declaration * decl;
4215 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
4216 struct Declarator * d;
4217 struct Declarator * funcDecl;
4218 struct External * external;
4219
4220 specifiers = MkList();
4221 declarators = MkList();
4222 if(dllImport)
4223 ListAdd(specifiers, MkSpecifier(EXTERN));
4224 else if(method->_class->symbol && ((struct Symbol *)method->_class->symbol)->isStatic)
4225 ListAdd(specifiers, MkSpecifier(STATIC));
4226 if(method->type == 1)
4227 {
4228 ListAdd(specifiers, MkSpecifier(INT));
4229 d = MkDeclaratorIdentifier(MkIdentifier(name));
4230 }
4231 else
4232 {
4233 d = MkDeclaratorIdentifier(MkIdentifier(name));
4234 if(dllImport)
4235 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
4236 {
4237 struct Context * context = SetupTemplatesContext(method->_class);
4238
4239 d = SpecDeclFromString(method->dataTypeString, specifiers, d);
4240 FinishTemplatesContext(context);
4241 }
4242 funcDecl = GetFuncDecl(d);
4243 if(dllImport)
4244 {
4245 struct Specifier * spec, * next;
4246
4247 for(spec = (*specifiers).first; spec; spec = next)
4248 {
4249 next = spec->next;
4250 if(spec->type == 5)
4251 {
4252 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*specifiers), spec);
4253 FreeSpecifier(spec);
4254 }
4255 }
4256 }
4257 if(method->dataType && !method->dataType->staticMethod)
4258 {
4259 if(funcDecl && funcDecl->function.parameters && (*funcDecl->function.parameters).count)
4260 {
4261 struct __ecereNameSpace__ecere__com__Class * _class = method->dataType->thisClass ? method->dataType->thisClass->registered : method->_class;
4262 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")));
4263 struct TypeName * firstParam = ((struct TypeName *)(*funcDecl->function.parameters).first);
4264 struct Specifier * firstSpec = firstParam->qualifiers ? (*firstParam->qualifiers).first : (((void *)0));
4265
4266 if(firstSpec && firstSpec->type == 0 && firstSpec->specifier == VOID && !firstParam->declarator)
4267 {
4268 struct TypeName * param = (*funcDecl->function.parameters).first;
4269
4270 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->function.parameters), param);
4271 FreeTypeName(param);
4272 }
4273 if(!funcDecl->function.parameters)
4274 funcDecl->function.parameters = MkList();
4275 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
4276 }
4277 }
4278 }
4279 ProcessDeclarator(d);
4280 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
4281 decl = MkDeclaration(specifiers, declarators);
4282 ReplaceThisClassSpecifiers(specifiers, method->_class);
4283 if(symbol->pointerExternal)
4284 {
4285 struct Symbol * functionSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4286
4287 {
4288 *functionSymbol = *symbol;
4289 functionSymbol->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
4290 if(functionSymbol->type)
4291 functionSymbol->type->refCount++;
4292 }
4293 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*excludedSymbols), functionSymbol);
4294 symbol->pointerExternal->symbol = functionSymbol;
4295 }
4296 external = MkExternalDeclaration(decl);
4297 if(curExternal)
4298 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal ? curExternal->prev : (((void *)0)), external);
4299 external->symbol = symbol;
4300 symbol->pointerExternal = external;
4301 }
4302 else if(ast)
4303 {
4304 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
4305 }
4306 symbol->id = curExternal ? curExternal->symbol->idCode : (((int)0x7fffffff));
4307 }
4308 }
4309
4310 char * ReplaceThisClass(struct __ecereNameSpace__ecere__com__Class * _class)
4311 {
4312 if(thisClassParams && _class->templateParams.count && !_class->templateClass)
4313 {
4314 unsigned int first = 0x1;
4315 int p = 0;
4316 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
4317 int lastParam = -1;
4318 char className[1024];
4319
4320 strcpy(className, _class->fullName);
4321 for(param = _class->templateParams.first; param; param = param->next)
4322 {
4323 {
4324 if(first)
4325 strcat(className, "<");
4326 if(!first)
4327 strcat(className, ", ");
4328 if(lastParam + 1 != p)
4329 {
4330 strcat(className, param->name);
4331 strcat(className, " = ");
4332 }
4333 strcat(className, param->name);
4334 first = 0x0;
4335 lastParam = p;
4336 }
4337 p++;
4338 }
4339 if(!first)
4340 {
4341 int len = strlen(className);
4342
4343 if(className[len - 1] == '>')
4344 className[len++] = ' ';
4345 className[len++] = '>';
4346 className[len++] = '\0';
4347 }
4348 return __ecereNameSpace__ecere__sys__CopyString(className);
4349 }
4350 else
4351 return __ecereNameSpace__ecere__sys__CopyString(_class->fullName);
4352 }
4353
4354 struct Type * ReplaceThisClassType(struct __ecereNameSpace__ecere__com__Class * _class)
4355 {
4356 if(thisClassParams && _class->templateParams.count && !_class->templateClass)
4357 {
4358 unsigned int first = 0x1;
4359 int p = 0;
4360 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
4361 int lastParam = -1;
4362 char className[1024];
4363
4364 strcpy(className, _class->fullName);
4365 for(param = _class->templateParams.first; param; param = param->next)
4366 {
4367 {
4368 if(first)
4369 strcat(className, "<");
4370 if(!first)
4371 strcat(className, ", ");
4372 if(lastParam + 1 != p)
4373 {
4374 strcat(className, param->name);
4375 strcat(className, " = ");
4376 }
4377 strcat(className, param->name);
4378 first = 0x0;
4379 lastParam = p;
4380 }
4381 p++;
4382 }
4383 if(!first)
4384 {
4385 int len = strlen(className);
4386
4387 if(className[len - 1] == '>')
4388 className[len++] = ' ';
4389 className[len++] = '>';
4390 className[len++] = '\0';
4391 }
4392 return MkClassType(className);
4393 }
4394 else
4395 {
4396 return MkClassType(_class->fullName);
4397 }
4398 }
4399
4400 void ReplaceThisClassSpecifiers(struct __ecereNameSpace__ecere__sys__OldList * specs, struct __ecereNameSpace__ecere__com__Class * _class)
4401 {
4402 if(specs != (((void *)0)) && _class)
4403 {
4404 struct Specifier * spec;
4405
4406 for(spec = specs->first; spec; spec = spec->next)
4407 {
4408 if(spec->type == 0 && spec->specifier == THISCLASS)
4409 {
4410 spec->type = 1;
4411 spec->name = ReplaceThisClass(_class);
4412 spec->symbol = FindClass(spec->name);
4413 }
4414 }
4415 }
4416 }
4417
4418 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__GlobalFunction;
4419
4420 struct __ecereNameSpace__ecere__com__GlobalFunction
4421 {
4422 struct __ecereNameSpace__ecere__com__GlobalFunction * prev;
4423 struct __ecereNameSpace__ecere__com__GlobalFunction * next;
4424 char *  name;
4425 int (*  function)();
4426 struct __ecereNameSpace__ecere__com__Instance * module;
4427 struct __ecereNameSpace__ecere__com__NameSpace *  nameSpace;
4428 char *  dataTypeString;
4429 struct Type * dataType;
4430 void *  symbol;
4431 } __attribute__ ((gcc_struct));
4432
4433 extern struct Context * globalContext;
4434
4435 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_FunctionImport;
4436
4437 struct FunctionImport
4438 {
4439 struct FunctionImport * prev;
4440 struct FunctionImport * next;
4441 char *  name;
4442 } __attribute__ ((gcc_struct));
4443
4444 unsigned int DeclareFunction(struct __ecereNameSpace__ecere__com__GlobalFunction * function, char * name)
4445 {
4446 struct Symbol * symbol = function->symbol;
4447
4448 if(curExternal && (!symbol || symbol->id > curExternal->symbol->idCode))
4449 {
4450 unsigned int imported = 0x0;
4451 unsigned int dllImport = 0x0;
4452
4453 if(!function->dataType)
4454 {
4455 function->dataType = ProcessTypeString(function->dataTypeString, 0x0);
4456 if(!function->dataType->thisClass)
4457 function->dataType->staticMethod = 0x1;
4458 }
4459 if(inCompiler)
4460 {
4461 if(!symbol)
4462 {
4463 struct ModuleImport * module = FindModule(function->module);
4464
4465 symbol = function->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4466 if(module->name)
4467 {
4468 if(!function->dataType->dllExport)
4469 {
4470 symbol->_import = (struct ClassImport *)__extension__ ({
4471 struct FunctionImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_FunctionImport);
4472
4473 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(function->name), __ecereInstance1;
4474 });
4475 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->functions, symbol->_import);
4476 }
4477 }
4478 {
4479 symbol->type = ProcessTypeString(function->dataTypeString, 0x0);
4480 if(!symbol->type->thisClass)
4481 symbol->type->staticMethod = 0x1;
4482 }
4483 }
4484 imported = symbol->_import ? 0x1 : 0x0;
4485 if(imported && function->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType != 1)
4486 dllImport = 0x1;
4487 }
4488 DeclareType(function->dataType, 0x1, 0x1);
4489 if(inCompiler)
4490 {
4491 if(!symbol->pointerExternal || symbol->pointerExternal->type == 0)
4492 {
4493 struct Declaration * decl;
4494 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
4495 struct Declarator * d;
4496 struct Declarator * funcDecl;
4497 struct External * external;
4498
4499 specifiers = MkList();
4500 declarators = MkList();
4501 ListAdd(specifiers, MkSpecifier(EXTERN));
4502 d = MkDeclaratorIdentifier(MkIdentifier(imported ? name : function->name));
4503 if(dllImport)
4504 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
4505 d = SpecDeclFromString(function->dataTypeString, specifiers, d);
4506 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType == 1)
4507 {
4508 struct Specifier * spec;
4509
4510 for(spec = (*specifiers).first; spec; spec = spec->next)
4511 if(spec->type == 5 && spec->extDecl && spec->extDecl->type == 0 && !strcmp(spec->extDecl->s, "dllexport"))
4512 {
4513 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*specifiers), spec);
4514 FreeSpecifier(spec);
4515 break;
4516 }
4517 }
4518 funcDecl = GetFuncDecl(d);
4519 if(funcDecl && !funcDecl->function.parameters)
4520 {
4521 funcDecl->function.parameters = MkList();
4522 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), MkTypeName(MkListOne(MkSpecifier(VOID)), (((void *)0))));
4523 }
4524 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
4525 {
4526 struct Context * oldCtx = curContext;
4527
4528 curContext = globalContext;
4529 decl = MkDeclaration(specifiers, declarators);
4530 curContext = oldCtx;
4531 }
4532 if(symbol->pointerExternal)
4533 {
4534 struct Symbol * functionSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4535
4536 {
4537 *functionSymbol = *symbol;
4538 functionSymbol->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
4539 if(functionSymbol->type)
4540 functionSymbol->type->refCount++;
4541 }
4542 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*excludedSymbols), functionSymbol);
4543 symbol->pointerExternal->symbol = functionSymbol;
4544 }
4545 external = MkExternalDeclaration(decl);
4546 if(curExternal)
4547 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
4548 external->symbol = symbol;
4549 symbol->pointerExternal = external;
4550 }
4551 else
4552 {
4553 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
4554 }
4555 if(curExternal)
4556 symbol->id = curExternal->symbol->idCode;
4557 }
4558 }
4559 return (symbol && symbol->_import && function->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType != 1) ? 0x1 : 0x0;
4560 }
4561
4562 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_GlobalData;
4563
4564 struct GlobalData
4565 {
4566 uintptr_t key;
4567 struct __ecereNameSpace__ecere__sys__BTNode * parent;
4568 struct __ecereNameSpace__ecere__sys__BTNode * left;
4569 struct __ecereNameSpace__ecere__sys__BTNode * right;
4570 int depth;
4571 struct __ecereNameSpace__ecere__com__Instance * module;
4572 char *  dataTypeString;
4573 struct Type * dataType;
4574 void *  symbol;
4575 char *  fullName;
4576 } __attribute__ ((gcc_struct));
4577
4578 void DeclareGlobalData(struct GlobalData * data)
4579 {
4580 struct Symbol * symbol = data->symbol;
4581
4582 if(curExternal && (!symbol || symbol->id > curExternal->symbol->idCode))
4583 {
4584 if(inCompiler)
4585 {
4586 if(!symbol)
4587 symbol = data->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4588 }
4589 if(!data->dataType)
4590 data->dataType = ProcessTypeString(data->dataTypeString, 0x0);
4591 DeclareType(data->dataType, 0x1, 0x1);
4592 if(inCompiler)
4593 {
4594 if(!symbol->pointerExternal)
4595 {
4596 struct Declaration * decl;
4597 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
4598 struct Declarator * d;
4599 struct External * external;
4600
4601 specifiers = MkList();
4602 declarators = MkList();
4603 ListAdd(specifiers, MkSpecifier(EXTERN));
4604 d = MkDeclaratorIdentifier(MkIdentifier(data->fullName));
4605 d = SpecDeclFromString(data->dataTypeString, specifiers, d);
4606 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
4607 decl = MkDeclaration(specifiers, declarators);
4608 external = MkExternalDeclaration(decl);
4609 if(curExternal)
4610 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
4611 external->symbol = symbol;
4612 symbol->pointerExternal = external;
4613 }
4614 else
4615 {
4616 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
4617 }
4618 if(curExternal)
4619 symbol->id = curExternal->symbol->idCode;
4620 }
4621 }
4622 }
4623
4624 struct Conversion
4625 {
4626 struct Conversion * prev, * next;
4627 struct __ecereNameSpace__ecere__com__Property * convert;
4628 unsigned int isGet;
4629 struct Type * resultType;
4630 } __attribute__ ((gcc_struct));
4631
4632 static struct __ecereNameSpace__ecere__com__Class * __ecereClass_Conversion;
4633
4634 extern void Compiler_Warning(char *  format, ...);
4635
4636 void PrintType(struct Type * type, char *  string, unsigned int printName, unsigned int fullName);
4637
4638 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)
4639 {
4640 if(source && dest)
4641 {
4642 if(source->kind == 20 && dest->kind != 20)
4643 {
4644 struct Type * type = ProcessTemplateParameterType(source->templateParameter);
4645
4646 if(type)
4647 source = type;
4648 }
4649 if(dest->kind == 20 && source->kind != 20)
4650 {
4651 struct Type * type = ProcessTemplateParameterType(dest->templateParameter);
4652
4653 if(type)
4654 dest = type;
4655 }
4656 if(dest->classObjectType == 2)
4657 {
4658 if(source->classObjectType != 3)
4659 return 0x1;
4660 else
4661 {
4662 if((dest->_class && strcmp(dest->_class->string, "class")) || (source->_class && strcmp(source->_class->string, "class")))
4663 {
4664 return 0x1;
4665 }
4666 }
4667 }
4668 else
4669 {
4670 if(source->classObjectType == 3)
4671 return 0x1;
4672 if(dest->classObjectType == 3 && source->classObjectType != 2)
4673 return 0x1;
4674 }
4675 if((dest->kind == 9 && source->kind == 9) || (dest->kind == 10 && source->kind == 10))
4676 {
4677 if((dest->enumName && source->enumName && !strcmp(dest->enumName, source->enumName)) || (source->members.first && source->members.first == dest->members.first))
4678 return 0x1;
4679 }
4680 if(dest->kind == 14 && source->kind != 0)
4681 return 0x1;
4682 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))
4683 return 0x1;
4684 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))
4685 return 0x1;
4686 if(((source->kind == 8 && dest->kind == 8) || (source->kind == 19 && dest->kind == 19)) && source->_class)
4687 {
4688 if(source->_class->registered && source->_class->registered->type == 3)
4689 {
4690 if(conversions != (((void *)0)))
4691 {
4692 if(source->_class->registered == dest->_class->registered)
4693 return 0x1;
4694 }
4695 else
4696 {
4697 struct __ecereNameSpace__ecere__com__Class * sourceBase, * destBase;
4698
4699 for(sourceBase = source->_class->registered; sourceBase && sourceBase->base->type != 1000; sourceBase = sourceBase->base)
4700 ;
4701 for(destBase = dest->_class->registered; destBase && destBase->base->type != 1000; destBase = destBase->base)
4702 ;
4703 if(sourceBase == destBase)
4704 return 0x1;
4705 }
4706 }
4707 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))
4708 return 0x1;
4709 else
4710 {
4711 if(enumBaseType && dest->_class && dest->_class->registered && dest->_class->registered->type == 4 && ((source->_class && source->_class->registered && source->_class->registered->type != 4) || source->kind == 8))
4712 {
4713 if(__ecereNameSpace__ecere__com__eClass_IsDerived(dest->_class->registered, source->_class->registered))
4714 {
4715 return 0x1;
4716 }
4717 }
4718 }
4719 }
4720 if(source->kind == 19 && dest->kind == 8 && dest->_class && !strcmp(dest->_class->string, "ecere::com::Class"))
4721 return 0x1;
4722 if(doConversion)
4723 {
4724 if(source->kind == 8)
4725 {
4726 struct __ecereNameSpace__ecere__com__Class * _class;
4727
4728 for(_class = source->_class ? source->_class->registered : (((void *)0)); _class; _class = _class->base)
4729 {
4730 struct __ecereNameSpace__ecere__com__Property * convert;
4731
4732 for(convert = _class->conversions.first; convert; convert = convert->next)
4733 {
4734 if(convert->memberAccess == 1 || _class->module == privateModule)
4735 {
4736 struct Conversion * after = (conversions != (((void *)0))) ? conversions->last : (((void *)0));
4737
4738 if(!convert->dataType)
4739 convert->dataType = ProcessTypeString(convert->dataTypeString, 0x0);
4740 if(MatchTypes(convert->dataType, dest, conversions, (((void *)0)), (((void *)0)), 0x0, 0x1, 0x0, 0x1))
4741 {
4742 if(!conversions && !convert->Get)
4743 return 0x1;
4744 else if(conversions != (((void *)0)))
4745 {
4746 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))
4747 return 0x1;
4748 else
4749 {
4750 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv->isGet = 0x1, conv);
4751
4752 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(conversions, after, conv);
4753 return 0x1;
4754 }
4755 }
4756 }
4757 }
4758 }
4759 }
4760 }
4761 if(dest->kind == 8)
4762 {
4763 struct __ecereNameSpace__ecere__com__Class * _class;
4764
4765 for(_class = dest->_class ? dest->_class->registered : (((void *)0)); _class; _class = _class->base)
4766 {
4767 struct __ecereNameSpace__ecere__com__Property * convert;
4768
4769 for(convert = _class->conversions.first; convert; convert = convert->next)
4770 {
4771 if(convert->memberAccess == 1 || _class->module == privateModule)
4772 {
4773 if(!convert->dataType)
4774 convert->dataType = ProcessTypeString(convert->dataTypeString, 0x0);
4775 if(convert->dataType != dest && MatchTypes(source, convert->dataType, conversions, (((void *)0)), (((void *)0)), 0x1, 0x0, 0x0, 0x1))
4776 {
4777 if(!conversions && !convert->Set)
4778 return 0x1;
4779 else if(conversions != (((void *)0)))
4780 {
4781 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))
4782 return 0x1;
4783 else
4784 {
4785 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv);
4786
4787 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(conversions, conv);
4788 return 0x1;
4789 }
4790 }
4791 }
4792 }
4793 }
4794 }
4795 if(enumBaseType && dest->_class && dest->_class->registered && dest->_class->registered->type == 4)
4796 {
4797 if(!dest->_class->registered->dataType)
4798 dest->_class->registered->dataType = ProcessTypeString(dest->_class->registered->dataTypeString, 0x0);
4799 if(dest->_class->registered->dataType->kind == 8 || source->truth || dest->truth)
4800 {
4801 if(MatchTypes(source, dest->_class->registered->dataType, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
4802 {
4803 return 0x1;
4804 }
4805 }
4806 }
4807 }
4808 if(source->kind == 8)
4809 {
4810 struct __ecereNameSpace__ecere__com__Class * _class;
4811
4812 for(_class = source->_class ? source->_class->registered : (((void *)0)); _class; _class = _class->base)
4813 {
4814 struct __ecereNameSpace__ecere__com__Property * convert;
4815
4816 for(convert = _class->conversions.first; convert; convert = convert->next)
4817 {
4818 if(convert->memberAccess == 1 || _class->module == privateModule)
4819 {
4820 struct Conversion * after = (conversions != (((void *)0))) ? conversions->last : (((void *)0));
4821
4822 if(!convert->dataType)
4823 convert->dataType = ProcessTypeString(convert->dataTypeString, 0x0);
4824 if(convert->dataType != source && MatchTypes(convert->dataType, dest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x1))
4825 {
4826 if(!conversions && !convert->Get)
4827 return 0x1;
4828 else if(conversions != (((void *)0)))
4829 {
4830 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))
4831 return 0x1;
4832 else
4833 {
4834 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv->isGet = 0x1, conv);
4835
4836 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(conversions, after, conv);
4837 return 0x1;
4838 }
4839 }
4840 }
4841 }
4842 }
4843 }
4844 if(enumBaseType && source->_class && source->_class->registered && source->_class->registered->type == 4)
4845 {
4846 if(!source->_class->registered->dataType)
4847 source->_class->registered->dataType = ProcessTypeString(source->_class->registered->dataTypeString, 0x0);
4848 if(MatchTypes(source->_class->registered->dataType, dest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
4849 {
4850 return 0x1;
4851 }
4852 }
4853 }
4854 }
4855 if(source->kind == 8 || source->kind == 19)
4856 ;
4857 else if(dest->kind == source->kind && (dest->kind != 9 && dest->kind != 10 && dest->kind != 11 && dest->kind != 12 && dest->kind != 13 && dest->kind != 16))
4858 return 0x1;
4859 else if(dest->kind == 7 && source->kind == 6)
4860 return 0x1;
4861 else if(dest->kind == 2 && (source->kind == 1 || source->kind == 24))
4862 return 0x1;
4863 else if(dest->kind == 3 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 23))
4864 return 0x1;
4865 else if(dest->kind == 4 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 3 || source->kind == 22 || source->kind == 23))
4866 return 0x1;
4867 else if(dest->kind == 22 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 3 || source->kind == 23 || source->kind == 4))
4868 return 0x1;
4869 else if(dest->kind == 23 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 3 || source->kind == 4 || source->kind == 22))
4870 return 0x1;
4871 else if(source->kind == 15 && (dest->kind == 3 || dest->kind == 2 || dest->kind == 1 || source->kind == 24 || dest->kind == 5 || dest->kind == 4 || dest->kind == 22 || dest->kind == 23))
4872 return 0x1;
4873 else if(dest->kind == 15 && (source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 5 || source->kind == 4 || source->kind == 22 || source->kind == 23))
4874 return 0x1;
4875 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)))
4876 {
4877 struct Type * paramSource, * paramDest;
4878
4879 if(dest->kind == 16)
4880 owningClassDest = dest->methodClass ? dest->methodClass : dest->method->_class;
4881 if(source->kind == 16)
4882 owningClassSource = source->methodClass ? source->methodClass : source->method->_class;
4883 if(dest->kind == 13 && dest->type->kind == 11)
4884 dest = dest->type;
4885 if(source->kind == 13 && source->type->kind == 11)
4886 source = source->type;
4887 if(dest->kind == 16)
4888 dest = dest->method->dataType;
4889 if(source->kind == 16)
4890 source = source->method->dataType;
4891 paramSource = source->params.first;
4892 if(paramSource && paramSource->kind == 0)
4893 paramSource = (((void *)0));
4894 paramDest = dest->params.first;
4895 if(paramDest && paramDest->kind == 0)
4896 paramDest = (((void *)0));
4897 if((dest->staticMethod || (!dest->thisClass && !owningClassDest)) && !(source->staticMethod || (!source->thisClass && !owningClassSource)))
4898 {
4899 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))))
4900 {
4901 if(paramDest && paramDest->kind == 8)
4902 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "method class must be derived from %s\n", (((void *)0))), paramDest->_class->string);
4903 else
4904 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "method class should not take an object\n", (((void *)0))));
4905 return 0x0;
4906 }
4907 paramDest = paramDest->next;
4908 }
4909 else if(!dest->staticMethod && (dest->thisClass || owningClassDest))
4910 {
4911 if((source->staticMethod || (!source->thisClass && !owningClassSource)))
4912 {
4913 if(dest->thisClass)
4914 {
4915 if(!paramSource || paramSource->kind != 8 || !__ecereNameSpace__ecere__com__eClass_IsDerived(paramSource->_class->registered, dest->thisClass->registered))
4916 {
4917 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "method class must be derived from %s\n", (((void *)0))), dest->thisClass->string);
4918 return 0x0;
4919 }
4920 }
4921 else
4922 {
4923 if(!paramSource || paramSource->kind != 8 || (owningClassDest && !__ecereNameSpace__ecere__com__eClass_IsDerived(paramSource->_class->registered, owningClassDest)))
4924 {
4925 if(owningClassDest)
4926 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "%s expected to be derived from method class\n", (((void *)0))), owningClassDest->fullName);
4927 else
4928 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "overriding class expected to be derived from method class\n", (((void *)0))));
4929 return 0x0;
4930 }
4931 }
4932 paramSource = paramSource->next;
4933 }
4934 else
4935 {
4936 if(dest->thisClass)
4937 {
4938 if(!__ecereNameSpace__ecere__com__eClass_IsDerived(source->thisClass ? source->thisClass->registered : owningClassSource, dest->thisClass->registered))
4939 {
4940 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "method class must be derived from %s\n", (((void *)0))), dest->thisClass->string);
4941 return 0x0;
4942 }
4943 }
4944 else
4945 {
4946 if(source->thisClass && source->thisClass->registered && owningClassDest && !__ecereNameSpace__ecere__com__eClass_IsDerived(source->thisClass->registered, owningClassDest))
4947 {
4948 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "%s expected to be derived from method class\n", (((void *)0))), source->thisClass->registered->fullName);
4949 return 0x0;
4950 }
4951 }
4952 }
4953 }
4954 if(!MatchTypes(source->returnType, dest->returnType, (((void *)0)), (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
4955 {
4956 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible return type for function\n", (((void *)0))));
4957 return 0x0;
4958 }
4959 for(; paramDest; paramDest = paramDest->next)
4960 {
4961 if(!paramSource)
4962 {
4963 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "not enough parameters\n", (((void *)0))));
4964 return 0x0;
4965 }
4966 {
4967 struct Type * paramDestType = paramDest;
4968 struct Type * paramSourceType = paramSource;
4969 struct Type * type = paramDestType;
4970
4971 if(paramDest->kind == 20 && paramDest->templateParameter->type == 0 && owningClassSource && paramSource->kind != 20)
4972 {
4973 int id = 0;
4974 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
4975 struct __ecereNameSpace__ecere__com__Class * sClass;
4976
4977 for(sClass = owningClassSource; sClass; sClass = sClass->base)
4978 {
4979 id = 0;
4980 if(sClass->templateClass)
4981 sClass = sClass->templateClass;
4982 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
4983 {
4984 if(curParam->type == 0 && !strcmp(type->templateParameter->identifier->string, curParam->name))
4985 {
4986 for(sClass = sClass->base; sClass; sClass = sClass->base)
4987 {
4988 if(sClass->templateClass)
4989 sClass = sClass->templateClass;
4990 id += sClass->templateParams.count;
4991 }
4992 break;
4993 }
4994 id++;
4995 }
4996 if(curParam)
4997 break;
4998 }
4999 if(curParam)
5000 {
5001 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = owningClassSource->templateArgs[id];
5002
5003 paramDestType = type = ProcessTypeString(arg.dataTypeString, 0x0);
5004 }
5005 }
5006 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)))
5007 {
5008 char type[1024];
5009
5010 type[0] = (char)0;
5011 PrintType(paramDest, type, 0x0, 0x1);
5012 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible parameter %s (expected %s)\n", (((void *)0))), paramSource->name, type);
5013 if(paramDestType != paramDest)
5014 FreeType(paramDestType);
5015 return 0x0;
5016 }
5017 if(paramDestType != paramDest)
5018 FreeType(paramDestType);
5019 }
5020 paramSource = paramSource->next;
5021 }
5022 if(paramSource)
5023 {
5024 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "too many parameters\n", (((void *)0))));
5025 return 0x0;
5026 }
5027 return 0x1;
5028 }
5029 else if((dest->kind == 11 || (dest->kind == 13 && dest->type->kind == 11) || dest->kind == 16) && (source->kind == 13 && source->type->kind == 0))
5030 {
5031 return 0x1;
5032 }
5033 else if((dest->kind == 13 || dest->kind == 12) && (source->kind == 12 || source->kind == 13))
5034 {
5035 if(MatchTypes(source->type, dest->type, (((void *)0)), (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
5036 return 0x1;
5037 }
5038 }
5039 return 0x0;
5040 }
5041
5042 static void FreeConvert(struct Conversion * convert)
5043 {
5044 if(convert->resultType)
5045 FreeType(convert->resultType);
5046 }
5047
5048 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__BTNamedLink;
5049
5050 struct __ecereNameSpace__ecere__com__BTNamedLink
5051 {
5052 char *  name;
5053 struct __ecereNameSpace__ecere__com__BTNamedLink * parent;
5054 struct __ecereNameSpace__ecere__com__BTNamedLink * left;
5055 struct __ecereNameSpace__ecere__com__BTNamedLink * right;
5056 int depth;
5057 void *  data;
5058 } __attribute__ ((gcc_struct));
5059
5060 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__EnumClassData;
5061
5062 struct __ecereNameSpace__ecere__com__EnumClassData
5063 {
5064 struct __ecereNameSpace__ecere__sys__OldList values;
5065 int largest;
5066 } __attribute__ ((gcc_struct));
5067
5068 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__NamedLink;
5069
5070 struct __ecereNameSpace__ecere__sys__NamedLink
5071 {
5072 struct __ecereNameSpace__ecere__sys__NamedLink * prev;
5073 struct __ecereNameSpace__ecere__sys__NamedLink * next;
5074 char *  name;
5075 void *  data;
5076 } __attribute__ ((gcc_struct));
5077
5078 extern void FreeExpContents(struct Expression * exp);
5079
5080 struct __ecereNameSpace__ecere__sys__BTNode * __ecereProp___ecereNameSpace__ecere__sys__BinaryTree_Get_first(struct __ecereNameSpace__ecere__sys__BinaryTree * this);
5081
5082 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp___ecereNameSpace__ecere__sys__BinaryTree_first;
5083
5084 struct __ecereNameSpace__ecere__sys__BTNode * __ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_next(struct __ecereNameSpace__ecere__sys__BTNode * this);
5085
5086 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp___ecereNameSpace__ecere__sys__BTNode_next;
5087
5088 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(struct __ecereNameSpace__ecere__sys__OldList * this, void (*  freeFn)(void * ));
5089
5090 unsigned int MatchWithEnums_NameSpace(struct __ecereNameSpace__ecere__com__NameSpace * nameSpace, struct Expression * sourceExp, struct Type * dest, char * string, struct __ecereNameSpace__ecere__sys__OldList * conversions)
5091 {
5092 struct __ecereNameSpace__ecere__com__BTNamedLink * link;
5093
5094 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)))
5095 {
5096 struct __ecereNameSpace__ecere__com__Class * _class = link->data;
5097
5098 if(_class->type == 4)
5099 {
5100 struct __ecereNameSpace__ecere__sys__OldList converts = 
5101 {
5102 0, 0, 0, 0, 0
5103 };
5104 struct Type * type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5105
5106 type->kind = 8;
5107 if(!_class->symbol)
5108 _class->symbol = FindClass(_class->fullName);
5109 type->_class = _class->symbol;
5110 if(MatchTypes(type, dest, &converts, (((void *)0)), (((void *)0)), 0x1, 0x0, 0x0, 0x0))
5111 {
5112 struct __ecereNameSpace__ecere__sys__NamedLink * value;
5113 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
5114
5115 if(enumClass)
5116 {
5117 struct __ecereNameSpace__ecere__com__Class * baseClass;
5118
5119 for(baseClass = _class; baseClass && baseClass->type == 4; baseClass = baseClass->base)
5120 {
5121 struct __ecereNameSpace__ecere__com__EnumClassData * e = (baseClass ? ((void *)(((char *)baseClass->data) + enumClass->offsetClass)) : (((void *)0)));
5122
5123 for(value = e->values.first; value; value = value->next)
5124 {
5125 if(!strcmp(value->name, string))
5126 break;
5127 }
5128 if(value)
5129 {
5130 FreeExpContents(sourceExp);
5131 FreeType(sourceExp->expType);
5132 sourceExp->isConstant = 0x1;
5133 sourceExp->expType = MkClassType(baseClass->fullName);
5134 {
5135 char constant[256];
5136
5137 sourceExp->type = 2;
5138 if(!strcmp(baseClass->dataTypeString, "int"))
5139 sprintf(constant, "%d", (int)value->data);
5140 else
5141 sprintf(constant, "0x%X", (int)value->data);
5142 sourceExp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
5143 }
5144 while(converts.first)
5145 {
5146 struct Conversion * convert = converts.first;
5147
5148 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(&converts, convert);
5149 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(conversions, convert);
5150 }
5151 ((type ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(type) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(type)) : 0), type = 0);
5152 return 0x1;
5153 }
5154 }
5155 }
5156 }
5157 if(converts.first)
5158 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(&converts, FreeConvert);
5159 ((type ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(type) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(type)) : 0), type = 0);
5160 }
5161 }
5162 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)))
5163 if(MatchWithEnums_NameSpace(nameSpace, sourceExp, dest, string, conversions))
5164 return 0x1;
5165 return 0x0;
5166 }
5167
5168 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__SubModule;
5169
5170 struct __ecereNameSpace__ecere__com__SubModule
5171 {
5172 struct __ecereNameSpace__ecere__com__SubModule * prev;
5173 struct __ecereNameSpace__ecere__com__SubModule * next;
5174 struct __ecereNameSpace__ecere__com__Instance * module;
5175 int importMode;
5176 } __attribute__ ((gcc_struct));
5177
5178 unsigned int ModuleVisibility(struct __ecereNameSpace__ecere__com__Instance * searchIn, struct __ecereNameSpace__ecere__com__Instance * searchFor)
5179 {
5180 struct __ecereNameSpace__ecere__com__SubModule * subModule;
5181
5182 if(searchFor == searchIn)
5183 return 0x1;
5184 for(subModule = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)searchIn + structSize_Instance)))->modules.first; subModule; subModule = subModule->next)
5185 {
5186 if(subModule->importMode == 1 || searchIn == ((struct __ecereNameSpace__ecere__com__Module *)(((char *)searchIn + structSize_Instance)))->application)
5187 {
5188 if(ModuleVisibility(subModule->module, searchFor))
5189 return 0x1;
5190 }
5191 }
5192 return 0x0;
5193 }
5194
5195 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Application;
5196
5197 struct __ecereNameSpace__ecere__com__Application
5198 {
5199 int argc;
5200 char * *  argv;
5201 int exitCode;
5202 unsigned int isGUIApp;
5203 struct __ecereNameSpace__ecere__sys__OldList allModules;
5204 char *  parsedCommand;
5205 struct __ecereNameSpace__ecere__com__NameSpace systemNameSpace;
5206 } __attribute__ ((gcc_struct));
5207
5208 unsigned int MatchWithEnums_Module(struct __ecereNameSpace__ecere__com__Instance * mainModule, struct Expression * sourceExp, struct Type * dest, char * string, struct __ecereNameSpace__ecere__sys__OldList * conversions)
5209 {
5210 struct __ecereNameSpace__ecere__com__Instance * module;
5211
5212 if(MatchWithEnums_NameSpace(&((struct __ecereNameSpace__ecere__com__Application *)(((char *)((struct __ecereNameSpace__ecere__com__Module *)(((char *)mainModule + structSize_Instance)))->application + structSize_Module)))->systemNameSpace, sourceExp, dest, string, conversions))
5213 return 0x1;
5214 if(MatchWithEnums_NameSpace(&((struct __ecereNameSpace__ecere__com__Module *)(((char *)((struct __ecereNameSpace__ecere__com__Module *)(((char *)mainModule + structSize_Instance)))->application + structSize_Instance)))->privateNameSpace, sourceExp, dest, string, conversions))
5215 return 0x1;
5216 if(MatchWithEnums_NameSpace(&((struct __ecereNameSpace__ecere__com__Module *)(((char *)((struct __ecereNameSpace__ecere__com__Module *)(((char *)mainModule + structSize_Instance)))->application + structSize_Instance)))->publicNameSpace, sourceExp, dest, string, conversions))
5217 return 0x1;
5218 for(module = ((struct __ecereNameSpace__ecere__com__Application *)(((char *)((struct __ecereNameSpace__ecere__com__Module *)(((char *)mainModule + structSize_Instance)))->application + structSize_Module)))->allModules.first; module; module = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->next)
5219 {
5220 if(ModuleVisibility(mainModule, module) && MatchWithEnums_NameSpace(&((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->publicNameSpace, sourceExp, dest, string, conversions))
5221 return 0x1;
5222 }
5223 return 0x0;
5224 }
5225
5226 extern unsigned long strtoul(const char *  nptr, char * *  endptr, int base);
5227
5228 void ReadString(char *  output, char *  string);
5229
5230 extern struct Specifier * MkEnum(struct Identifier * id, struct __ecereNameSpace__ecere__sys__OldList * list);
5231
5232 extern struct TypeName * QMkClass(char *  spec, struct Declarator * decl);
5233
5234 extern struct Expression * MkExpBrackets(struct __ecereNameSpace__ecere__sys__OldList * expressions);
5235
5236 unsigned int MatchTypeExpression(struct Expression * sourceExp, struct Type * dest, struct __ecereNameSpace__ecere__sys__OldList * conversions, unsigned int skipUnitBla)
5237 {
5238 struct Type * source = sourceExp->expType;
5239 struct Type * realDest = dest;
5240 struct Type * backupSourceExpType = (((void *)0));
5241
5242 if(dest->kind == 13 && sourceExp->type == 2 && !strtoul(sourceExp->constant, (((void *)0)), 0))
5243 return 0x1;
5244 if(!skipUnitBla && source && dest && source->kind == 8 && dest->kind == 8)
5245 {
5246 if(source->_class && source->_class->registered && source->_class->registered->type == 3)
5247 {
5248 struct __ecereNameSpace__ecere__com__Class * sourceBase, * destBase;
5249
5250 for(sourceBase = source->_class->registered; sourceBase && sourceBase->base && sourceBase->base->type != 1000; sourceBase = sourceBase->base)
5251 ;
5252 for(destBase = dest->_class->registered; destBase && destBase->base && destBase->base->type != 1000; destBase = destBase->base)
5253 ;
5254 if(sourceBase == destBase)
5255 return 0x1;
5256 }
5257 }
5258 if(source)
5259 {
5260 struct __ecereNameSpace__ecere__sys__OldList * specs;
5261 unsigned int flag = 0x0;
5262 long long value = (((int)0x7fffffff));
5263
5264 source->refCount++;
5265 dest->refCount++;
5266 if(sourceExp->type == 2)
5267 {
5268 if(source->isSigned)
5269 value = strtoll(sourceExp->constant, (((void *)0)), 0);
5270 else
5271 value = strtoull(sourceExp->constant, (((void *)0)), 0);
5272 }
5273 else if(sourceExp->type == 4 && sourceExp->op.op == '-' && !sourceExp->op.exp1 && sourceExp->op.exp2 && sourceExp->op.exp2->type == 2)
5274 {
5275 if(source->isSigned)
5276 value = -strtoll(sourceExp->op.exp2->constant, (((void *)0)), 0);
5277 else
5278 value = -strtoull(sourceExp->op.exp2->constant, (((void *)0)), 0);
5279 }
5280 if(dest->kind != 8 && source->kind == 8 && source->_class && source->_class->registered && !strcmp(source->_class->registered->fullName, "ecere::com::unichar"))
5281 {
5282 FreeType(source);
5283 source = __extension__ ({
5284 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5285
5286 __ecereInstance1->kind = 3, __ecereInstance1->isSigned = 0x0, __ecereInstance1->refCount = 1, __ecereInstance1;
5287 });
5288 }
5289 if(dest->kind == 8)
5290 {
5291 struct __ecereNameSpace__ecere__com__Class * _class = dest->_class ? dest->_class->registered : (((void *)0));
5292
5293 if(_class && _class->type == 3)
5294 {
5295 if(source->kind != 8)
5296 {
5297 struct Type * tempType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5298 struct Type * tempDest, * tempSource;
5299
5300 for(; _class->base->type != 1000; _class = _class->base)
5301 ;
5302 tempSource = dest;
5303 tempDest = tempType;
5304 tempType->kind = 8;
5305 if(!_class->symbol)
5306 _class->symbol = FindClass(_class->fullName);
5307 tempType->_class = _class->symbol;
5308 tempType->truth = dest->truth;
5309 if(tempType->_class)
5310 MatchTypes(tempSource, tempDest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0);
5311 backupSourceExpType = sourceExp->expType;
5312 sourceExp->expType = dest;
5313 dest->refCount++;
5314 flag = 0x1;
5315 ((tempType ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(tempType) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(tempType)) : 0), tempType = 0);
5316 }
5317 }
5318 if(_class && _class->type == 2 && source->kind != 8)
5319 {
5320 if(!dest->_class->registered->dataType)
5321 dest->_class->registered->dataType = ProcessTypeString(dest->_class->registered->dataTypeString, 0x0);
5322 if(MatchTypes(source, dest->_class->registered->dataType, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
5323 {
5324 FreeType(source);
5325 FreeType(sourceExp->expType);
5326 source = sourceExp->expType = MkClassType(dest->_class->string);
5327 source->refCount++;
5328 }
5329 }
5330 if(_class && !strcmp(_class->fullName, "ecere::com::Class") && source->kind == 13 && source->type && source->type->kind == 1 && sourceExp->type == 3)
5331 {
5332 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
5333 struct Declarator * decl;
5334 char string[1024];
5335
5336 ReadString(string, sourceExp->string);
5337 decl = SpecDeclFromString(string, specs, (((void *)0)));
5338 FreeExpContents(sourceExp);
5339 FreeType(sourceExp->expType);
5340 sourceExp->type = 26;
5341 sourceExp->_classExp.specifiers = specs;
5342 sourceExp->_classExp.decl = decl;
5343 sourceExp->expType = dest;
5344 dest->refCount++;
5345 FreeType(source);
5346 FreeType(dest);
5347 if(backupSourceExpType)
5348 FreeType(backupSourceExpType);
5349 return 0x1;
5350 }
5351 }
5352 else if(source->kind == 8)
5353 {
5354 struct __ecereNameSpace__ecere__com__Class * _class = source->_class ? source->_class->registered : (((void *)0));
5355
5356 if(_class && (_class->type == 3 || !strcmp(_class->fullName, "bool") || _class->type == 2))
5357 {
5358 if(dest->kind != 8)
5359 {
5360 struct Type * tempType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5361 struct Type * tempDest, * tempSource;
5362
5363 if(!source->_class->registered->dataType)
5364 source->_class->registered->dataType = ProcessTypeString(source->_class->registered->dataTypeString, 0x0);
5365 for(; _class->base->type != 1000; _class = _class->base)
5366 ;
5367 tempDest = source;
5368 tempSource = tempType;
5369 tempType->kind = 8;
5370 tempType->_class = FindClass(_class->fullName);
5371 tempType->truth = source->truth;
5372 tempType->classObjectType = source->classObjectType;
5373 if(tempType->_class)
5374 MatchTypes(tempSource, tempDest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0);
5375 if(conversions->last)
5376 {
5377 ((struct Conversion *)conversions->last)->resultType = dest;
5378 dest->refCount++;
5379 }
5380 FreeType(sourceExp->expType);
5381 sourceExp->expType = MkClassType(_class->fullName);
5382 sourceExp->expType->truth = source->truth;
5383 sourceExp->expType->classObjectType = source->classObjectType;
5384 if(!sourceExp->destType)
5385 {
5386 FreeType(sourceExp->destType);
5387 sourceExp->destType = sourceExp->expType;
5388 if(sourceExp->expType)
5389 sourceExp->expType->refCount++;
5390 }
5391 if(!_class->dataType)
5392 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
5393 FreeType(dest);
5394 dest = MkClassType(source->_class->string);
5395 dest->truth = source->truth;
5396 dest->classObjectType = source->classObjectType;
5397 FreeType(source);
5398 source = _class->dataType;
5399 source->refCount++;
5400 ((tempType ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(tempType) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(tempType)) : 0), tempType = 0);
5401 }
5402 }
5403 }
5404 if(!flag)
5405 {
5406 if(MatchTypes(source, dest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
5407 {
5408 FreeType(source);
5409 FreeType(dest);
5410 return 0x1;
5411 }
5412 }
5413 if(dest->kind == 8)
5414 {
5415 struct __ecereNameSpace__ecere__com__Class * _class = dest->_class ? dest->_class->registered : (((void *)0));
5416
5417 if(_class && !dest->truth && (_class->type == 3 || !strcmp(_class->fullName, "bool") || (_class->type != 1 && !value && source->kind == 3) || _class->type == 2))
5418 {
5419 if(_class->type == 0 || _class->type == 5)
5420 {
5421 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
5422
5423 *newExp = *sourceExp;
5424 if(sourceExp->destType)
5425 sourceExp->destType->refCount++;
5426 if(sourceExp->expType)
5427 sourceExp->expType->refCount++;
5428 sourceExp->type = 11;
5429 sourceExp->cast.typeName = MkTypeName(MkListOne(MkSpecifier(VOID)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0))));
5430 sourceExp->cast.exp = newExp;
5431 FreeType(sourceExp->expType);
5432 sourceExp->expType = (((void *)0));
5433 ProcessExpressionType(sourceExp);
5434 if(!inCompiler)
5435 {
5436 FreeType(sourceExp->expType);
5437 sourceExp->expType = dest;
5438 }
5439 FreeType(source);
5440 if(inCompiler)
5441 FreeType(dest);
5442 if(backupSourceExpType)
5443 FreeType(backupSourceExpType);
5444 return 0x1;
5445 }
5446 if(!_class->dataType)
5447 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
5448 FreeType(dest);
5449 dest = _class->dataType;
5450 dest->refCount++;
5451 }
5452 if(dest->kind == 7 && (source->kind == 7 || source->kind == 6 || dest->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 24))
5453 {
5454 specs = MkListOne(MkSpecifier(DOUBLE));
5455 }
5456 else if(dest->kind == 6 && (source->kind == 6 || dest->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 7))
5457 {
5458 specs = MkListOne(MkSpecifier(FLOAT));
5459 }
5460 else if(dest->kind == 4 && (source->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 6 || source->kind == 7))
5461 {
5462 specs = MkList();
5463 if(!dest->isSigned)
5464 ListAdd(specs, MkSpecifier(UNSIGNED));
5465 ListAdd(specs, MkSpecifier(INT64));
5466 }
5467 else if(dest->kind == 3 && (source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 6 || source->kind == 7))
5468 {
5469 specs = MkList();
5470 if(!dest->isSigned)
5471 ListAdd(specs, MkSpecifier(UNSIGNED));
5472 ListAdd(specs, MkSpecifier(INT));
5473 }
5474 else if(dest->kind == 2 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 3 || source->kind == 6 || source->kind == 7))
5475 {
5476 specs = MkList();
5477 if(!dest->isSigned)
5478 ListAdd(specs, MkSpecifier(UNSIGNED));
5479 ListAdd(specs, MkSpecifier(SHORT));
5480 }
5481 else if(dest->kind == 1 && (source->kind == 1 || source->kind == 24 || source->kind == 2 || source->kind == 3 || source->kind == 6 || source->kind == 7))
5482 {
5483 specs = MkList();
5484 if(!dest->isSigned)
5485 ListAdd(specs, MkSpecifier(UNSIGNED));
5486 ListAdd(specs, MkSpecifier(CHAR));
5487 }
5488 else
5489 {
5490 FreeType(source);
5491 FreeType(dest);
5492 if(backupSourceExpType)
5493 {
5494 if(sourceExp->expType)
5495 FreeType(sourceExp->expType);
5496 sourceExp->expType = backupSourceExpType;
5497 }
5498 return 0x0;
5499 }
5500 }
5501 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 == 24 || source->kind == 1))
5502 {
5503 specs = MkListOne(MkSpecifier(DOUBLE));
5504 }
5505 else if(dest->kind == 6 && (source->kind == 6 || source->kind == 15 || source->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 24 || source->kind == 1))
5506 {
5507 specs = MkListOne(MkSpecifier(FLOAT));
5508 }
5509 else if(dest->kind == 24 && (source->kind == 24 || source->kind == 1 || source->kind == 15 || source->kind == 2 || source->kind == 3) && (value == 1 || value == 0))
5510 {
5511 specs = MkList();
5512 ListAdd(specs, MkSpecifier(BOOL));
5513 }
5514 else if(dest->kind == 1 && (source->kind == 24 || source->kind == 1 || source->kind == 15 || source->kind == 2 || source->kind == 3) && (dest->isSigned ? (value >= -128 && value <= 127) : (value >= 0 && value <= 255)))
5515 {
5516 specs = MkList();
5517 if(!dest->isSigned)
5518 ListAdd(specs, MkSpecifier(UNSIGNED));
5519 ListAdd(specs, MkSpecifier(CHAR));
5520 }
5521 else if(dest->kind == 2 && (source->kind == 15 || source->kind == 24 || source->kind == 1 || source->kind == 2 || (source->kind == 3 && (dest->isSigned ? (value >= -32768 && value <= 32767) : (value >= 0 && value <= 65535)))))
5522 {
5523 specs = MkList();
5524 if(!dest->isSigned)
5525 ListAdd(specs, MkSpecifier(UNSIGNED));
5526 ListAdd(specs, MkSpecifier(SHORT));
5527 }
5528 else if(dest->kind == 3 && (source->kind == 15 || source->kind == 2 || source->kind == 24 || source->kind == 1 || source->kind == 3))
5529 {
5530 specs = MkList();
5531 if(!dest->isSigned)
5532 ListAdd(specs, MkSpecifier(UNSIGNED));
5533 ListAdd(specs, MkSpecifier(INT));
5534 }
5535 else if(dest->kind == 4 && (source->kind == 15 || source->kind == 2 || source->kind == 24 || source->kind == 1 || source->kind == 3 || source->kind == 4))
5536 {
5537 specs = MkList();
5538 if(!dest->isSigned)
5539 ListAdd(specs, MkSpecifier(UNSIGNED));
5540 ListAdd(specs, MkSpecifier(INT64));
5541 }
5542 else if(dest->kind == 15 && (source->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 24 || source->kind == 1))
5543 {
5544 specs = MkListOne(MkEnum(MkIdentifier(dest->enumName), (((void *)0))));
5545 }
5546 else
5547 {
5548 FreeType(source);
5549 FreeType(dest);
5550 if(backupSourceExpType)
5551 {
5552 if(sourceExp->expType)
5553 FreeType(sourceExp->expType);
5554 sourceExp->expType = backupSourceExpType;
5555 }
5556 return 0x0;
5557 }
5558 if(!flag)
5559 {
5560 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
5561
5562 *newExp = *sourceExp;
5563 newExp->prev = (((void *)0));
5564 newExp->next = (((void *)0));
5565 if(sourceExp->destType)
5566 sourceExp->destType->refCount++;
5567 if(sourceExp->expType)
5568 sourceExp->expType->refCount++;
5569 sourceExp->type = 11;
5570 if(realDest->kind == 8)
5571 {
5572 sourceExp->cast.typeName = QMkClass(realDest->_class->string, (((void *)0)));
5573 FreeList(specs, FreeSpecifier);
5574 }
5575 else
5576 sourceExp->cast.typeName = MkTypeName(specs, (((void *)0)));
5577 if(newExp->type == 4)
5578 {
5579 sourceExp->cast.exp = MkExpBrackets(MkListOne(newExp));
5580 }
5581 else
5582 sourceExp->cast.exp = newExp;
5583 FreeType(sourceExp->expType);
5584 sourceExp->expType = (((void *)0));
5585 ProcessExpressionType(sourceExp);
5586 }
5587 else
5588 FreeList(specs, FreeSpecifier);
5589 FreeType(dest);
5590 FreeType(source);
5591 if(backupSourceExpType)
5592 FreeType(backupSourceExpType);
5593 return 0x1;
5594 }
5595 else
5596 {
5597 while((sourceExp->type == 5 || sourceExp->type == 34) && sourceExp->list)
5598 sourceExp = (*sourceExp->list).last;
5599 if(sourceExp->type == 0)
5600 {
5601 struct Identifier * id = sourceExp->identifier;
5602
5603 if(dest->kind == 8)
5604 {
5605 if(dest->_class && dest->_class->registered && dest->_class->registered->type == 4)
5606 {
5607 struct __ecereNameSpace__ecere__com__Class * _class = dest->_class->registered;
5608 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
5609
5610 if(enumClass)
5611 {
5612 for(; _class && _class->type == 4; _class = _class->base)
5613 {
5614 struct __ecereNameSpace__ecere__sys__NamedLink * value;
5615 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
5616
5617 for(value = e->values.first; value; value = value->next)
5618 {
5619 if(!strcmp(value->name, id->string))
5620 break;
5621 }
5622 if(value)
5623 {
5624 FreeExpContents(sourceExp);
5625 FreeType(sourceExp->expType);
5626 sourceExp->isConstant = 0x1;
5627 sourceExp->expType = MkClassType(_class->fullName);
5628 {
5629 char constant[256];
5630
5631 sourceExp->type = 2;
5632 if(_class->dataTypeString && !strcmp(_class->dataTypeString, "int"))
5633 sprintf(constant, "%d", (int)value->data);
5634 else
5635 sprintf(constant, "0x%X", (int)value->data);
5636 sourceExp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
5637 }
5638 return 0x1;
5639 }
5640 }
5641 }
5642 }
5643 }
5644 if(dest->classObjectType != 2 && dest->kind == 8 && MatchWithEnums_Module(privateModule, sourceExp, dest, id->string, conversions))
5645 return 0x1;
5646 }
5647 }
5648 return 0x0;
5649 }
5650
5651 static unsigned int IntAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5652 {
5653 int value2 = op2->i;
5654
5655 exp->type = 2;
5656 exp->string = PrintInt(op1->i + value2);
5657 if(!exp->expType)
5658 {
5659 exp->expType = op1->type;
5660 if(op1->type)
5661 op1->type->refCount++;
5662 }
5663 return 0x1;
5664 }
5665
5666 static unsigned int UIntAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5667 {
5668 unsigned int value2 = op2->ui;
5669
5670 exp->type = 2;
5671 exp->string = PrintUInt(op1->ui + value2);
5672 if(!exp->expType)
5673 {
5674 exp->expType = op1->type;
5675 if(op1->type)
5676 op1->type->refCount++;
5677 }
5678 return 0x1;
5679 }
5680
5681 static unsigned int Int64Add(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5682 {
5683 int value2 = op2->i;
5684
5685 exp->type = 2;
5686 exp->string = PrintInt64(op1->i + value2);
5687 if(!exp->expType)
5688 {
5689 exp->expType = op1->type;
5690 if(op1->type)
5691 op1->type->refCount++;
5692 }
5693 return 0x1;
5694 }
5695
5696 static unsigned int UInt64Add(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5697 {
5698 unsigned int value2 = op2->ui;
5699
5700 exp->type = 2;
5701 exp->string = PrintUInt64(op1->ui + value2);
5702 if(!exp->expType)
5703 {
5704 exp->expType = op1->type;
5705 if(op1->type)
5706 op1->type->refCount++;
5707 }
5708 return 0x1;
5709 }
5710
5711 static unsigned int ShortAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5712 {
5713 short value2 = op2->s;
5714
5715 exp->type = 2;
5716 exp->string = PrintShort(op1->s + value2);
5717 if(!exp->expType)
5718 {
5719 exp->expType = op1->type;
5720 if(op1->type)
5721 op1->type->refCount++;
5722 }
5723 return 0x1;
5724 }
5725
5726 static unsigned int UShortAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5727 {
5728 unsigned short value2 = op2->us;
5729
5730 exp->type = 2;
5731 exp->string = PrintUShort(op1->us + value2);
5732 if(!exp->expType)
5733 {
5734 exp->expType = op1->type;
5735 if(op1->type)
5736 op1->type->refCount++;
5737 }
5738 return 0x1;
5739 }
5740
5741 static unsigned int CharAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5742 {
5743 char value2 = op2->c;
5744
5745 exp->type = 2;
5746 exp->string = PrintChar(op1->c + value2);
5747 if(!exp->expType)
5748 {
5749 exp->expType = op1->type;
5750 if(op1->type)
5751 op1->type->refCount++;
5752 }
5753 return 0x1;
5754 }
5755
5756 static unsigned int UCharAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5757 {
5758 unsigned char value2 = op2->uc;
5759
5760 exp->type = 2;
5761 exp->string = PrintUChar(op1->uc + value2);
5762 if(!exp->expType)
5763 {
5764 exp->expType = op1->type;
5765 if(op1->type)
5766 op1->type->refCount++;
5767 }
5768 return 0x1;
5769 }
5770
5771 static unsigned int FloatAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5772 {
5773 float value2 = op2->f;
5774
5775 exp->type = 2;
5776 exp->string = PrintFloat(op1->f + value2);
5777 if(!exp->expType)
5778 {
5779 exp->expType = op1->type;
5780 if(op1->type)
5781 op1->type->refCount++;
5782 }
5783 return 0x1;
5784 }
5785
5786 static unsigned int DoubleAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5787 {
5788 double value2 = op2->d;
5789
5790 exp->type = 2;
5791 exp->string = PrintDouble(op1->d + value2);
5792 if(!exp->expType)
5793 {
5794 exp->expType = op1->type;
5795 if(op1->type)
5796 op1->type->refCount++;
5797 }
5798 return 0x1;
5799 }
5800
5801 static unsigned int IntSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5802 {
5803 int value2 = op2->i;
5804
5805 exp->type = 2;
5806 exp->string = PrintInt(op1->i - value2);
5807 if(!exp->expType)
5808 {
5809 exp->expType = op1->type;
5810 if(op1->type)
5811 op1->type->refCount++;
5812 }
5813 return 0x1;
5814 }
5815
5816 static unsigned int UIntSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5817 {
5818 unsigned int value2 = op2->ui;
5819
5820 exp->type = 2;
5821 exp->string = PrintUInt(op1->ui - value2);
5822 if(!exp->expType)
5823 {
5824 exp->expType = op1->type;
5825 if(op1->type)
5826 op1->type->refCount++;
5827 }
5828 return 0x1;
5829 }
5830
5831 static unsigned int Int64Sub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5832 {
5833 int value2 = op2->i;
5834
5835 exp->type = 2;
5836 exp->string = PrintInt64(op1->i - value2);
5837 if(!exp->expType)
5838 {
5839 exp->expType = op1->type;
5840 if(op1->type)
5841 op1->type->refCount++;
5842 }
5843 return 0x1;
5844 }
5845
5846 static unsigned int UInt64Sub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5847 {
5848 unsigned int value2 = op2->ui;
5849
5850 exp->type = 2;
5851 exp->string = PrintUInt64(op1->ui - value2);
5852 if(!exp->expType)
5853 {
5854 exp->expType = op1->type;
5855 if(op1->type)
5856 op1->type->refCount++;
5857 }
5858 return 0x1;
5859 }
5860
5861 static unsigned int ShortSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5862 {
5863 short value2 = op2->s;
5864
5865 exp->type = 2;
5866 exp->string = PrintShort(op1->s - value2);
5867 if(!exp->expType)
5868 {
5869 exp->expType = op1->type;
5870 if(op1->type)
5871 op1->type->refCount++;
5872 }
5873 return 0x1;
5874 }
5875
5876 static unsigned int UShortSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5877 {
5878 unsigned short value2 = op2->us;
5879
5880 exp->type = 2;
5881 exp->string = PrintUShort(op1->us - value2);
5882 if(!exp->expType)
5883 {
5884 exp->expType = op1->type;
5885 if(op1->type)
5886 op1->type->refCount++;
5887 }
5888 return 0x1;
5889 }
5890
5891 static unsigned int CharSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5892 {
5893 char value2 = op2->c;
5894
5895 exp->type = 2;
5896 exp->string = PrintChar(op1->c - value2);
5897 if(!exp->expType)
5898 {
5899 exp->expType = op1->type;
5900 if(op1->type)
5901 op1->type->refCount++;
5902 }
5903 return 0x1;
5904 }
5905
5906 static unsigned int UCharSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5907 {
5908 unsigned char value2 = op2->uc;
5909
5910 exp->type = 2;
5911 exp->string = PrintUChar(op1->uc - value2);
5912 if(!exp->expType)
5913 {
5914 exp->expType = op1->type;
5915 if(op1->type)
5916 op1->type->refCount++;
5917 }
5918 return 0x1;
5919 }
5920
5921 static unsigned int FloatSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5922 {
5923 float value2 = op2->f;
5924
5925 exp->type = 2;
5926 exp->string = PrintFloat(op1->f - value2);
5927 if(!exp->expType)
5928 {
5929 exp->expType = op1->type;
5930 if(op1->type)
5931 op1->type->refCount++;
5932 }
5933 return 0x1;
5934 }
5935
5936 static unsigned int DoubleSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5937 {
5938 double value2 = op2->d;
5939
5940 exp->type = 2;
5941 exp->string = PrintDouble(op1->d - value2);
5942 if(!exp->expType)
5943 {
5944 exp->expType = op1->type;
5945 if(op1->type)
5946 op1->type->refCount++;
5947 }
5948 return 0x1;
5949 }
5950
5951 static unsigned int IntMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5952 {
5953 int value2 = op2->i;
5954
5955 exp->type = 2;
5956 exp->string = PrintInt(op1->i * value2);
5957 if(!exp->expType)
5958 {
5959 exp->expType = op1->type;
5960 if(op1->type)
5961 op1->type->refCount++;
5962 }
5963 return 0x1;
5964 }
5965
5966 static unsigned int UIntMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5967 {
5968 unsigned int value2 = op2->ui;
5969
5970 exp->type = 2;
5971 exp->string = PrintUInt(op1->ui * value2);
5972 if(!exp->expType)
5973 {
5974 exp->expType = op1->type;
5975 if(op1->type)
5976 op1->type->refCount++;
5977 }
5978 return 0x1;
5979 }
5980
5981 static unsigned int Int64Mul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5982 {
5983 int value2 = op2->i;
5984
5985 exp->type = 2;
5986 exp->string = PrintInt64(op1->i * value2);
5987 if(!exp->expType)
5988 {
5989 exp->expType = op1->type;
5990 if(op1->type)
5991 op1->type->refCount++;
5992 }
5993 return 0x1;
5994 }
5995
5996 static unsigned int UInt64Mul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5997 {
5998 unsigned int value2 = op2->ui;
5999
6000 exp->type = 2;
6001 exp->string = PrintUInt64(op1->ui * value2);
6002 if(!exp->expType)
6003 {
6004 exp->expType = op1->type;
6005 if(op1->type)
6006 op1->type->refCount++;
6007 }
6008 return 0x1;
6009 }
6010
6011 static unsigned int ShortMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6012 {
6013 short value2 = op2->s;
6014
6015 exp->type = 2;
6016 exp->string = PrintShort(op1->s * value2);
6017 if(!exp->expType)
6018 {
6019 exp->expType = op1->type;
6020 if(op1->type)
6021 op1->type->refCount++;
6022 }
6023 return 0x1;
6024 }
6025
6026 static unsigned int UShortMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6027 {
6028 unsigned short value2 = op2->us;
6029
6030 exp->type = 2;
6031 exp->string = PrintUShort(op1->us * value2);
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 CharMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6042 {
6043 char value2 = op2->c;
6044
6045 exp->type = 2;
6046 exp->string = PrintChar(op1->c * value2);
6047 if(!exp->expType)
6048 {
6049 exp->expType = op1->type;
6050 if(op1->type)
6051 op1->type->refCount++;
6052 }
6053 return 0x1;
6054 }
6055
6056 static unsigned int UCharMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6057 {
6058 unsigned char value2 = op2->uc;
6059
6060 exp->type = 2;
6061 exp->string = PrintUChar(op1->uc * value2);
6062 if(!exp->expType)
6063 {
6064 exp->expType = op1->type;
6065 if(op1->type)
6066 op1->type->refCount++;
6067 }
6068 return 0x1;
6069 }
6070
6071 static unsigned int FloatMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6072 {
6073 float value2 = op2->f;
6074
6075 exp->type = 2;
6076 exp->string = PrintFloat(op1->f * value2);
6077 if(!exp->expType)
6078 {
6079 exp->expType = op1->type;
6080 if(op1->type)
6081 op1->type->refCount++;
6082 }
6083 return 0x1;
6084 }
6085
6086 static unsigned int DoubleMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6087 {
6088 double value2 = op2->d;
6089
6090 exp->type = 2;
6091 exp->string = PrintDouble(op1->d * value2);
6092 if(!exp->expType)
6093 {
6094 exp->expType = op1->type;
6095 if(op1->type)
6096 op1->type->refCount++;
6097 }
6098 return 0x1;
6099 }
6100
6101 static unsigned int IntDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6102 {
6103 int value2 = op2->i;
6104
6105 exp->type = 2;
6106 exp->string = PrintInt(value2 ? (op1->i / value2) : 0);
6107 if(!exp->expType)
6108 {
6109 exp->expType = op1->type;
6110 if(op1->type)
6111 op1->type->refCount++;
6112 }
6113 return 0x1;
6114 }
6115
6116 static unsigned int UIntDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6117 {
6118 unsigned int value2 = op2->ui;
6119
6120 exp->type = 2;
6121 exp->string = PrintUInt(value2 ? (op1->ui / value2) : 0);
6122 if(!exp->expType)
6123 {
6124 exp->expType = op1->type;
6125 if(op1->type)
6126 op1->type->refCount++;
6127 }
6128 return 0x1;
6129 }
6130
6131 static unsigned int Int64Div(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6132 {
6133 int value2 = op2->i;
6134
6135 exp->type = 2;
6136 exp->string = PrintInt64(value2 ? (op1->i / value2) : 0);
6137 if(!exp->expType)
6138 {
6139 exp->expType = op1->type;
6140 if(op1->type)
6141 op1->type->refCount++;
6142 }
6143 return 0x1;
6144 }
6145
6146 static unsigned int UInt64Div(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6147 {
6148 unsigned int value2 = op2->ui;
6149
6150 exp->type = 2;
6151 exp->string = PrintUInt64(value2 ? (op1->ui / value2) : 0);
6152 if(!exp->expType)
6153 {
6154 exp->expType = op1->type;
6155 if(op1->type)
6156 op1->type->refCount++;
6157 }
6158 return 0x1;
6159 }
6160
6161 static unsigned int ShortDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6162 {
6163 short value2 = op2->s;
6164
6165 exp->type = 2;
6166 exp->string = PrintShort(value2 ? (op1->s / value2) : (short)0);
6167 if(!exp->expType)
6168 {
6169 exp->expType = op1->type;
6170 if(op1->type)
6171 op1->type->refCount++;
6172 }
6173 return 0x1;
6174 }
6175
6176 static unsigned int UShortDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6177 {
6178 unsigned short value2 = op2->us;
6179
6180 exp->type = 2;
6181 exp->string = PrintUShort(value2 ? (op1->us / value2) : (unsigned short)0);
6182 if(!exp->expType)
6183 {
6184 exp->expType = op1->type;
6185 if(op1->type)
6186 op1->type->refCount++;
6187 }
6188 return 0x1;
6189 }
6190
6191 static unsigned int CharDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6192 {
6193 char value2 = op2->c;
6194
6195 exp->type = 2;
6196 exp->string = PrintChar(value2 ? (op1->c / value2) : (char)0);
6197 if(!exp->expType)
6198 {
6199 exp->expType = op1->type;
6200 if(op1->type)
6201 op1->type->refCount++;
6202 }
6203 return 0x1;
6204 }
6205
6206 static unsigned int UCharDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6207 {
6208 unsigned char value2 = op2->uc;
6209
6210 exp->type = 2;
6211 exp->string = PrintUChar(value2 ? (op1->uc / value2) : (unsigned char)0);
6212 if(!exp->expType)
6213 {
6214 exp->expType = op1->type;
6215 if(op1->type)
6216 op1->type->refCount++;
6217 }
6218 return 0x1;
6219 }
6220
6221 static unsigned int FloatDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6222 {
6223 float value2 = op2->f;
6224
6225 exp->type = 2;
6226 exp->string = PrintFloat(value2 ? (op1->f / value2) : 0);
6227 if(!exp->expType)
6228 {
6229 exp->expType = op1->type;
6230 if(op1->type)
6231 op1->type->refCount++;
6232 }
6233 return 0x1;
6234 }
6235
6236 static unsigned int DoubleDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6237 {
6238 double value2 = op2->d;
6239
6240 exp->type = 2;
6241 exp->string = PrintDouble(value2 ? (op1->d / value2) : 0);
6242 if(!exp->expType)
6243 {
6244 exp->expType = op1->type;
6245 if(op1->type)
6246 op1->type->refCount++;
6247 }
6248 return 0x1;
6249 }
6250
6251 static unsigned int IntMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6252 {
6253 int value2 = op2->i;
6254
6255 exp->type = 2;
6256 exp->string = PrintInt(value2 ? (op1->i % value2) : 0);
6257 if(!exp->expType)
6258 {
6259 exp->expType = op1->type;
6260 if(op1->type)
6261 op1->type->refCount++;
6262 }
6263 return 0x1;
6264 }
6265
6266 static unsigned int UIntMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6267 {
6268 unsigned int value2 = op2->ui;
6269
6270 exp->type = 2;
6271 exp->string = PrintUInt(value2 ? (op1->ui % value2) : 0);
6272 if(!exp->expType)
6273 {
6274 exp->expType = op1->type;
6275 if(op1->type)
6276 op1->type->refCount++;
6277 }
6278 return 0x1;
6279 }
6280
6281 static unsigned int Int64Mod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6282 {
6283 int value2 = op2->i;
6284
6285 exp->type = 2;
6286 exp->string = PrintInt64(value2 ? (op1->i % value2) : 0);
6287 if(!exp->expType)
6288 {
6289 exp->expType = op1->type;
6290 if(op1->type)
6291 op1->type->refCount++;
6292 }
6293 return 0x1;
6294 }
6295
6296 static unsigned int UInt64Mod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6297 {
6298 unsigned int value2 = op2->ui;
6299
6300 exp->type = 2;
6301 exp->string = PrintUInt64(value2 ? (op1->ui % value2) : 0);
6302 if(!exp->expType)
6303 {
6304 exp->expType = op1->type;
6305 if(op1->type)
6306 op1->type->refCount++;
6307 }
6308 return 0x1;
6309 }
6310
6311 static unsigned int ShortMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6312 {
6313 short value2 = op2->s;
6314
6315 exp->type = 2;
6316 exp->string = PrintShort(value2 ? (op1->s % value2) : (short)0);
6317 if(!exp->expType)
6318 {
6319 exp->expType = op1->type;
6320 if(op1->type)
6321 op1->type->refCount++;
6322 }
6323 return 0x1;
6324 }
6325
6326 static unsigned int UShortMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6327 {
6328 unsigned short value2 = op2->us;
6329
6330 exp->type = 2;
6331 exp->string = PrintUShort(value2 ? (op1->us % value2) : (unsigned short)0);
6332 if(!exp->expType)
6333 {
6334 exp->expType = op1->type;
6335 if(op1->type)
6336 op1->type->refCount++;
6337 }
6338 return 0x1;
6339 }
6340
6341 static unsigned int CharMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6342 {
6343 char value2 = op2->c;
6344
6345 exp->type = 2;
6346 exp->string = PrintChar(value2 ? (op1->c % value2) : (char)0);
6347 if(!exp->expType)
6348 {
6349 exp->expType = op1->type;
6350 if(op1->type)
6351 op1->type->refCount++;
6352 }
6353 return 0x1;
6354 }
6355
6356 static unsigned int UCharMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6357 {
6358 unsigned char value2 = op2->uc;
6359
6360 exp->type = 2;
6361 exp->string = PrintUChar(value2 ? (op1->uc % value2) : (unsigned char)0);
6362 if(!exp->expType)
6363 {
6364 exp->expType = op1->type;
6365 if(op1->type)
6366 op1->type->refCount++;
6367 }
6368 return 0x1;
6369 }
6370
6371 static unsigned int IntNeg(struct Expression * exp, struct Operand * op1)
6372 {
6373 exp->type = 2;
6374 exp->string = PrintInt((-op1->i));
6375 if(!exp->expType)
6376 {
6377 exp->expType = op1->type;
6378 if(op1->type)
6379 op1->type->refCount++;
6380 }
6381 return 0x1;
6382 }
6383
6384 static unsigned int UIntNeg(struct Expression * exp, struct Operand * op1)
6385 {
6386 exp->type = 2;
6387 exp->string = PrintUInt((unsigned int)(-op1->ui));
6388 if(!exp->expType)
6389 {
6390 exp->expType = op1->type;
6391 if(op1->type)
6392 op1->type->refCount++;
6393 }
6394 return 0x1;
6395 }
6396
6397 static unsigned int Int64Neg(struct Expression * exp, struct Operand * op1)
6398 {
6399 exp->type = 2;
6400 exp->string = PrintInt64((-op1->i));
6401 if(!exp->expType)
6402 {
6403 exp->expType = op1->type;
6404 if(op1->type)
6405 op1->type->refCount++;
6406 }
6407 return 0x1;
6408 }
6409
6410 static unsigned int UInt64Neg(struct Expression * exp, struct Operand * op1)
6411 {
6412 exp->type = 2;
6413 exp->string = PrintUInt64((unsigned int)(-op1->ui));
6414 if(!exp->expType)
6415 {
6416 exp->expType = op1->type;
6417 if(op1->type)
6418 op1->type->refCount++;
6419 }
6420 return 0x1;
6421 }
6422
6423 static unsigned int ShortNeg(struct Expression * exp, struct Operand * op1)
6424 {
6425 exp->type = 2;
6426 exp->string = PrintShort((-op1->s));
6427 if(!exp->expType)
6428 {
6429 exp->expType = op1->type;
6430 if(op1->type)
6431 op1->type->refCount++;
6432 }
6433 return 0x1;
6434 }
6435
6436 static unsigned int UShortNeg(struct Expression * exp, struct Operand * op1)
6437 {
6438 exp->type = 2;
6439 exp->string = PrintUShort((unsigned short)(-op1->us));
6440 if(!exp->expType)
6441 {
6442 exp->expType = op1->type;
6443 if(op1->type)
6444 op1->type->refCount++;
6445 }
6446 return 0x1;
6447 }
6448
6449 static unsigned int CharNeg(struct Expression * exp, struct Operand * op1)
6450 {
6451 exp->type = 2;
6452 exp->string = PrintChar((-op1->c));
6453 if(!exp->expType)
6454 {
6455 exp->expType = op1->type;
6456 if(op1->type)
6457 op1->type->refCount++;
6458 }
6459 return 0x1;
6460 }
6461
6462 static unsigned int UCharNeg(struct Expression * exp, struct Operand * op1)
6463 {
6464 exp->type = 2;
6465 exp->string = PrintUChar((unsigned char)(-op1->uc));
6466 if(!exp->expType)
6467 {
6468 exp->expType = op1->type;
6469 if(op1->type)
6470 op1->type->refCount++;
6471 }
6472 return 0x1;
6473 }
6474
6475 static unsigned int FloatNeg(struct Expression * exp, struct Operand * op1)
6476 {
6477 exp->type = 2;
6478 exp->string = PrintFloat((float)(-op1->f));
6479 if(!exp->expType)
6480 {
6481 exp->expType = op1->type;
6482 if(op1->type)
6483 op1->type->refCount++;
6484 }
6485 return 0x1;
6486 }
6487
6488 static unsigned int DoubleNeg(struct Expression * exp, struct Operand * op1)
6489 {
6490 exp->type = 2;
6491 exp->string = PrintDouble((double)(-op1->d));
6492 if(!exp->expType)
6493 {
6494 exp->expType = op1->type;
6495 if(op1->type)
6496 op1->type->refCount++;
6497 }
6498 return 0x1;
6499 }
6500
6501 static unsigned int IntInc(struct Expression * exp, struct Operand * op1)
6502 {
6503 exp->type = 2;
6504 exp->string = PrintInt((++op1->i));
6505 if(!exp->expType)
6506 {
6507 exp->expType = op1->type;
6508 if(op1->type)
6509 op1->type->refCount++;
6510 }
6511 return 0x1;
6512 }
6513
6514 static unsigned int UIntInc(struct Expression * exp, struct Operand * op1)
6515 {
6516 exp->type = 2;
6517 exp->string = PrintUInt((++op1->ui));
6518 if(!exp->expType)
6519 {
6520 exp->expType = op1->type;
6521 if(op1->type)
6522 op1->type->refCount++;
6523 }
6524 return 0x1;
6525 }
6526
6527 static unsigned int Int64Inc(struct Expression * exp, struct Operand * op1)
6528 {
6529 exp->type = 2;
6530 exp->string = PrintInt64((++op1->i));
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 UInt64Inc(struct Expression * exp, struct Operand * op1)
6541 {
6542 exp->type = 2;
6543 exp->string = PrintUInt64((++op1->ui));
6544 if(!exp->expType)
6545 {
6546 exp->expType = op1->type;
6547 if(op1->type)
6548 op1->type->refCount++;
6549 }
6550 return 0x1;
6551 }
6552
6553 static unsigned int ShortInc(struct Expression * exp, struct Operand * op1)
6554 {
6555 exp->type = 2;
6556 exp->string = PrintShort((++op1->s));
6557 if(!exp->expType)
6558 {
6559 exp->expType = op1->type;
6560 if(op1->type)
6561 op1->type->refCount++;
6562 }
6563 return 0x1;
6564 }
6565
6566 static unsigned int UShortInc(struct Expression * exp, struct Operand * op1)
6567 {
6568 exp->type = 2;
6569 exp->string = PrintUShort((++op1->us));
6570 if(!exp->expType)
6571 {
6572 exp->expType = op1->type;
6573 if(op1->type)
6574 op1->type->refCount++;
6575 }
6576 return 0x1;
6577 }
6578
6579 static unsigned int CharInc(struct Expression * exp, struct Operand * op1)
6580 {
6581 exp->type = 2;
6582 exp->string = PrintChar((++op1->c));
6583 if(!exp->expType)
6584 {
6585 exp->expType = op1->type;
6586 if(op1->type)
6587 op1->type->refCount++;
6588 }
6589 return 0x1;
6590 }
6591
6592 static unsigned int UCharInc(struct Expression * exp, struct Operand * op1)
6593 {
6594 exp->type = 2;
6595 exp->string = PrintUChar((++op1->uc));
6596 if(!exp->expType)
6597 {
6598 exp->expType = op1->type;
6599 if(op1->type)
6600 op1->type->refCount++;
6601 }
6602 return 0x1;
6603 }
6604
6605 static unsigned int FloatInc(struct Expression * exp, struct Operand * op1)
6606 {
6607 exp->type = 2;
6608 exp->string = PrintFloat((float)(++op1->f));
6609 if(!exp->expType)
6610 {
6611 exp->expType = op1->type;
6612 if(op1->type)
6613 op1->type->refCount++;
6614 }
6615 return 0x1;
6616 }
6617
6618 static unsigned int DoubleInc(struct Expression * exp, struct Operand * op1)
6619 {
6620 exp->type = 2;
6621 exp->string = PrintDouble((double)(++op1->d));
6622 if(!exp->expType)
6623 {
6624 exp->expType = op1->type;
6625 if(op1->type)
6626 op1->type->refCount++;
6627 }
6628 return 0x1;
6629 }
6630
6631 static unsigned int IntDec(struct Expression * exp, struct Operand * op1)
6632 {
6633 exp->type = 2;
6634 exp->string = PrintInt((--op1->i));
6635 if(!exp->expType)
6636 {
6637 exp->expType = op1->type;
6638 if(op1->type)
6639 op1->type->refCount++;
6640 }
6641 return 0x1;
6642 }
6643
6644 static unsigned int UIntDec(struct Expression * exp, struct Operand * op1)
6645 {
6646 exp->type = 2;
6647 exp->string = PrintUInt((--op1->ui));
6648 if(!exp->expType)
6649 {
6650 exp->expType = op1->type;
6651 if(op1->type)
6652 op1->type->refCount++;
6653 }
6654 return 0x1;
6655 }
6656
6657 static unsigned int Int64Dec(struct Expression * exp, struct Operand * op1)
6658 {
6659 exp->type = 2;
6660 exp->string = PrintInt64((--op1->i));
6661 if(!exp->expType)
6662 {
6663 exp->expType = op1->type;
6664 if(op1->type)
6665 op1->type->refCount++;
6666 }
6667 return 0x1;
6668 }
6669
6670 static unsigned int UInt64Dec(struct Expression * exp, struct Operand * op1)
6671 {
6672 exp->type = 2;
6673 exp->string = PrintUInt64((--op1->ui));
6674 if(!exp->expType)
6675 {
6676 exp->expType = op1->type;
6677 if(op1->type)
6678 op1->type->refCount++;
6679 }
6680 return 0x1;
6681 }
6682
6683 static unsigned int ShortDec(struct Expression * exp, struct Operand * op1)
6684 {
6685 exp->type = 2;
6686 exp->string = PrintShort((--op1->s));
6687 if(!exp->expType)
6688 {
6689 exp->expType = op1->type;
6690 if(op1->type)
6691 op1->type->refCount++;
6692 }
6693 return 0x1;
6694 }
6695
6696 static unsigned int UShortDec(struct Expression * exp, struct Operand * op1)
6697 {
6698 exp->type = 2;
6699 exp->string = PrintUShort((--op1->us));
6700 if(!exp->expType)
6701 {
6702 exp->expType = op1->type;
6703 if(op1->type)
6704 op1->type->refCount++;
6705 }
6706 return 0x1;
6707 }
6708
6709 static unsigned int CharDec(struct Expression * exp, struct Operand * op1)
6710 {
6711 exp->type = 2;
6712 exp->string = PrintChar((--op1->c));
6713 if(!exp->expType)
6714 {
6715 exp->expType = op1->type;
6716 if(op1->type)
6717 op1->type->refCount++;
6718 }
6719 return 0x1;
6720 }
6721
6722 static unsigned int UCharDec(struct Expression * exp, struct Operand * op1)
6723 {
6724 exp->type = 2;
6725 exp->string = PrintUChar((--op1->uc));
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 FloatDec(struct Expression * exp, struct Operand * op1)
6736 {
6737 exp->type = 2;
6738 exp->string = PrintFloat((float)(--op1->f));
6739 if(!exp->expType)
6740 {
6741 exp->expType = op1->type;
6742 if(op1->type)
6743 op1->type->refCount++;
6744 }
6745 return 0x1;
6746 }
6747
6748 static unsigned int DoubleDec(struct Expression * exp, struct Operand * op1)
6749 {
6750 exp->type = 2;
6751 exp->string = PrintDouble((double)(--op1->d));
6752 if(!exp->expType)
6753 {
6754 exp->expType = op1->type;
6755 if(op1->type)
6756 op1->type->refCount++;
6757 }
6758 return 0x1;
6759 }
6760
6761 static unsigned int IntAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6762 {
6763 int value2 = op2->i;
6764
6765 exp->type = 2;
6766 exp->string = PrintInt(op1->i = value2);
6767 if(!exp->expType)
6768 {
6769 exp->expType = op1->type;
6770 if(op1->type)
6771 op1->type->refCount++;
6772 }
6773 return 0x1;
6774 }
6775
6776 static unsigned int UIntAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6777 {
6778 unsigned int value2 = op2->ui;
6779
6780 exp->type = 2;
6781 exp->string = PrintUInt(op1->ui = value2);
6782 if(!exp->expType)
6783 {
6784 exp->expType = op1->type;
6785 if(op1->type)
6786 op1->type->refCount++;
6787 }
6788 return 0x1;
6789 }
6790
6791 static unsigned int Int64Asign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6792 {
6793 int value2 = op2->i;
6794
6795 exp->type = 2;
6796 exp->string = PrintInt64(op1->i = value2);
6797 if(!exp->expType)
6798 {
6799 exp->expType = op1->type;
6800 if(op1->type)
6801 op1->type->refCount++;
6802 }
6803 return 0x1;
6804 }
6805
6806 static unsigned int UInt64Asign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6807 {
6808 unsigned int value2 = op2->ui;
6809
6810 exp->type = 2;
6811 exp->string = PrintUInt64(op1->ui = value2);
6812 if(!exp->expType)
6813 {
6814 exp->expType = op1->type;
6815 if(op1->type)
6816 op1->type->refCount++;
6817 }
6818 return 0x1;
6819 }
6820
6821 static unsigned int ShortAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6822 {
6823 short value2 = op2->s;
6824
6825 exp->type = 2;
6826 exp->string = PrintShort(op1->s = value2);
6827 if(!exp->expType)
6828 {
6829 exp->expType = op1->type;
6830 if(op1->type)
6831 op1->type->refCount++;
6832 }
6833 return 0x1;
6834 }
6835
6836 static unsigned int UShortAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6837 {
6838 unsigned short value2 = op2->us;
6839
6840 exp->type = 2;
6841 exp->string = PrintUShort(op1->us = value2);
6842 if(!exp->expType)
6843 {
6844 exp->expType = op1->type;
6845 if(op1->type)
6846 op1->type->refCount++;
6847 }
6848 return 0x1;
6849 }
6850
6851 static unsigned int CharAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6852 {
6853 char value2 = op2->c;
6854
6855 exp->type = 2;
6856 exp->string = PrintChar(op1->c = value2);
6857 if(!exp->expType)
6858 {
6859 exp->expType = op1->type;
6860 if(op1->type)
6861 op1->type->refCount++;
6862 }
6863 return 0x1;
6864 }
6865
6866 static unsigned int UCharAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6867 {
6868 unsigned char value2 = op2->uc;
6869
6870 exp->type = 2;
6871 exp->string = PrintUChar(op1->uc = value2);
6872 if(!exp->expType)
6873 {
6874 exp->expType = op1->type;
6875 if(op1->type)
6876 op1->type->refCount++;
6877 }
6878 return 0x1;
6879 }
6880
6881 static unsigned int FloatAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6882 {
6883 float value2 = op2->f;
6884
6885 exp->type = 2;
6886 exp->string = PrintFloat(op1->f = value2);
6887 if(!exp->expType)
6888 {
6889 exp->expType = op1->type;
6890 if(op1->type)
6891 op1->type->refCount++;
6892 }
6893 return 0x1;
6894 }
6895
6896 static unsigned int DoubleAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6897 {
6898 double value2 = op2->d;
6899
6900 exp->type = 2;
6901 exp->string = PrintDouble(op1->d = value2);
6902 if(!exp->expType)
6903 {
6904 exp->expType = op1->type;
6905 if(op1->type)
6906 op1->type->refCount++;
6907 }
6908 return 0x1;
6909 }
6910
6911 static unsigned int IntAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6912 {
6913 int value2 = op2->i;
6914
6915 exp->type = 2;
6916 exp->string = PrintInt(op1->i += value2);
6917 if(!exp->expType)
6918 {
6919 exp->expType = op1->type;
6920 if(op1->type)
6921 op1->type->refCount++;
6922 }
6923 return 0x1;
6924 }
6925
6926 static unsigned int UIntAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6927 {
6928 unsigned int value2 = op2->ui;
6929
6930 exp->type = 2;
6931 exp->string = PrintUInt(op1->ui += value2);
6932 if(!exp->expType)
6933 {
6934 exp->expType = op1->type;
6935 if(op1->type)
6936 op1->type->refCount++;
6937 }
6938 return 0x1;
6939 }
6940
6941 static unsigned int Int64AddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6942 {
6943 int value2 = op2->i;
6944
6945 exp->type = 2;
6946 exp->string = PrintInt64(op1->i += value2);
6947 if(!exp->expType)
6948 {
6949 exp->expType = op1->type;
6950 if(op1->type)
6951 op1->type->refCount++;
6952 }
6953 return 0x1;
6954 }
6955
6956 static unsigned int UInt64AddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6957 {
6958 unsigned int value2 = op2->ui;
6959
6960 exp->type = 2;
6961 exp->string = PrintUInt64(op1->ui += value2);
6962 if(!exp->expType)
6963 {
6964 exp->expType = op1->type;
6965 if(op1->type)
6966 op1->type->refCount++;
6967 }
6968 return 0x1;
6969 }
6970
6971 static unsigned int ShortAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6972 {
6973 short value2 = op2->s;
6974
6975 exp->type = 2;
6976 exp->string = PrintShort(op1->s += value2);
6977 if(!exp->expType)
6978 {
6979 exp->expType = op1->type;
6980 if(op1->type)
6981 op1->type->refCount++;
6982 }
6983 return 0x1;
6984 }
6985
6986 static unsigned int UShortAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6987 {
6988 unsigned short value2 = op2->us;
6989
6990 exp->type = 2;
6991 exp->string = PrintUShort(op1->us += value2);
6992 if(!exp->expType)
6993 {
6994 exp->expType = op1->type;
6995 if(op1->type)
6996 op1->type->refCount++;
6997 }
6998 return 0x1;
6999 }
7000
7001 static unsigned int CharAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7002 {
7003 char value2 = op2->c;
7004
7005 exp->type = 2;
7006 exp->string = PrintChar(op1->c += value2);
7007 if(!exp->expType)
7008 {
7009 exp->expType = op1->type;
7010 if(op1->type)
7011 op1->type->refCount++;
7012 }
7013 return 0x1;
7014 }
7015
7016 static unsigned int UCharAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7017 {
7018 unsigned char value2 = op2->uc;
7019
7020 exp->type = 2;
7021 exp->string = PrintUChar(op1->uc += value2);
7022 if(!exp->expType)
7023 {
7024 exp->expType = op1->type;
7025 if(op1->type)
7026 op1->type->refCount++;
7027 }
7028 return 0x1;
7029 }
7030
7031 static unsigned int FloatAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7032 {
7033 float value2 = op2->f;
7034
7035 exp->type = 2;
7036 exp->string = PrintFloat(op1->f += value2);
7037 if(!exp->expType)
7038 {
7039 exp->expType = op1->type;
7040 if(op1->type)
7041 op1->type->refCount++;
7042 }
7043 return 0x1;
7044 }
7045
7046 static unsigned int DoubleAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7047 {
7048 double value2 = op2->d;
7049
7050 exp->type = 2;
7051 exp->string = PrintDouble(op1->d += value2);
7052 if(!exp->expType)
7053 {
7054 exp->expType = op1->type;
7055 if(op1->type)
7056 op1->type->refCount++;
7057 }
7058 return 0x1;
7059 }
7060
7061 static unsigned int IntSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7062 {
7063 int value2 = op2->i;
7064
7065 exp->type = 2;
7066 exp->string = PrintInt(op1->i -= value2);
7067 if(!exp->expType)
7068 {
7069 exp->expType = op1->type;
7070 if(op1->type)
7071 op1->type->refCount++;
7072 }
7073 return 0x1;
7074 }
7075
7076 static unsigned int UIntSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7077 {
7078 unsigned int value2 = op2->ui;
7079
7080 exp->type = 2;
7081 exp->string = PrintUInt(op1->ui -= value2);
7082 if(!exp->expType)
7083 {
7084 exp->expType = op1->type;
7085 if(op1->type)
7086 op1->type->refCount++;
7087 }
7088 return 0x1;
7089 }
7090
7091 static unsigned int Int64SubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7092 {
7093 int value2 = op2->i;
7094
7095 exp->type = 2;
7096 exp->string = PrintInt64(op1->i -= value2);
7097 if(!exp->expType)
7098 {
7099 exp->expType = op1->type;
7100 if(op1->type)
7101 op1->type->refCount++;
7102 }
7103 return 0x1;
7104 }
7105
7106 static unsigned int UInt64SubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7107 {
7108 unsigned int value2 = op2->ui;
7109
7110 exp->type = 2;
7111 exp->string = PrintUInt64(op1->ui -= value2);
7112 if(!exp->expType)
7113 {
7114 exp->expType = op1->type;
7115 if(op1->type)
7116 op1->type->refCount++;
7117 }
7118 return 0x1;
7119 }
7120
7121 static unsigned int ShortSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7122 {
7123 short value2 = op2->s;
7124
7125 exp->type = 2;
7126 exp->string = PrintShort(op1->s -= value2);
7127 if(!exp->expType)
7128 {
7129 exp->expType = op1->type;
7130 if(op1->type)
7131 op1->type->refCount++;
7132 }
7133 return 0x1;
7134 }
7135
7136 static unsigned int UShortSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7137 {
7138 unsigned short value2 = op2->us;
7139
7140 exp->type = 2;
7141 exp->string = PrintUShort(op1->us -= value2);
7142 if(!exp->expType)
7143 {
7144 exp->expType = op1->type;
7145 if(op1->type)
7146 op1->type->refCount++;
7147 }
7148 return 0x1;
7149 }
7150
7151 static unsigned int CharSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7152 {
7153 char value2 = op2->c;
7154
7155 exp->type = 2;
7156 exp->string = PrintChar(op1->c -= value2);
7157 if(!exp->expType)
7158 {
7159 exp->expType = op1->type;
7160 if(op1->type)
7161 op1->type->refCount++;
7162 }
7163 return 0x1;
7164 }
7165
7166 static unsigned int UCharSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7167 {
7168 unsigned char value2 = op2->uc;
7169
7170 exp->type = 2;
7171 exp->string = PrintUChar(op1->uc -= value2);
7172 if(!exp->expType)
7173 {
7174 exp->expType = op1->type;
7175 if(op1->type)
7176 op1->type->refCount++;
7177 }
7178 return 0x1;
7179 }
7180
7181 static unsigned int FloatSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7182 {
7183 float value2 = op2->f;
7184
7185 exp->type = 2;
7186 exp->string = PrintFloat(op1->f -= value2);
7187 if(!exp->expType)
7188 {
7189 exp->expType = op1->type;
7190 if(op1->type)
7191 op1->type->refCount++;
7192 }
7193 return 0x1;
7194 }
7195
7196 static unsigned int DoubleSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7197 {
7198 double value2 = op2->d;
7199
7200 exp->type = 2;
7201 exp->string = PrintDouble(op1->d -= value2);
7202 if(!exp->expType)
7203 {
7204 exp->expType = op1->type;
7205 if(op1->type)
7206 op1->type->refCount++;
7207 }
7208 return 0x1;
7209 }
7210
7211 static unsigned int IntMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7212 {
7213 int value2 = op2->i;
7214
7215 exp->type = 2;
7216 exp->string = PrintInt(op1->i *= value2);
7217 if(!exp->expType)
7218 {
7219 exp->expType = op1->type;
7220 if(op1->type)
7221 op1->type->refCount++;
7222 }
7223 return 0x1;
7224 }
7225
7226 static unsigned int UIntMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7227 {
7228 unsigned int value2 = op2->ui;
7229
7230 exp->type = 2;
7231 exp->string = PrintUInt(op1->ui *= value2);
7232 if(!exp->expType)
7233 {
7234 exp->expType = op1->type;
7235 if(op1->type)
7236 op1->type->refCount++;
7237 }
7238 return 0x1;
7239 }
7240
7241 static unsigned int Int64MulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7242 {
7243 int value2 = op2->i;
7244
7245 exp->type = 2;
7246 exp->string = PrintInt64(op1->i *= value2);
7247 if(!exp->expType)
7248 {
7249 exp->expType = op1->type;
7250 if(op1->type)
7251 op1->type->refCount++;
7252 }
7253 return 0x1;
7254 }
7255
7256 static unsigned int UInt64MulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7257 {
7258 unsigned int value2 = op2->ui;
7259
7260 exp->type = 2;
7261 exp->string = PrintUInt64(op1->ui *= value2);
7262 if(!exp->expType)
7263 {
7264 exp->expType = op1->type;
7265 if(op1->type)
7266 op1->type->refCount++;
7267 }
7268 return 0x1;
7269 }
7270
7271 static unsigned int ShortMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7272 {
7273 short value2 = op2->s;
7274
7275 exp->type = 2;
7276 exp->string = PrintShort(op1->s *= value2);
7277 if(!exp->expType)
7278 {
7279 exp->expType = op1->type;
7280 if(op1->type)
7281 op1->type->refCount++;
7282 }
7283 return 0x1;
7284 }
7285
7286 static unsigned int UShortMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7287 {
7288 unsigned short value2 = op2->us;
7289
7290 exp->type = 2;
7291 exp->string = PrintUShort(op1->us *= value2);
7292 if(!exp->expType)
7293 {
7294 exp->expType = op1->type;
7295 if(op1->type)
7296 op1->type->refCount++;
7297 }
7298 return 0x1;
7299 }
7300
7301 static unsigned int CharMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7302 {
7303 char value2 = op2->c;
7304
7305 exp->type = 2;
7306 exp->string = PrintChar(op1->c *= value2);
7307 if(!exp->expType)
7308 {
7309 exp->expType = op1->type;
7310 if(op1->type)
7311 op1->type->refCount++;
7312 }
7313 return 0x1;
7314 }
7315
7316 static unsigned int UCharMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7317 {
7318 unsigned char value2 = op2->uc;
7319
7320 exp->type = 2;
7321 exp->string = PrintUChar(op1->uc *= value2);
7322 if(!exp->expType)
7323 {
7324 exp->expType = op1->type;
7325 if(op1->type)
7326 op1->type->refCount++;
7327 }
7328 return 0x1;
7329 }
7330
7331 static unsigned int FloatMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7332 {
7333 float value2 = op2->f;
7334
7335 exp->type = 2;
7336 exp->string = PrintFloat(op1->f *= value2);
7337 if(!exp->expType)
7338 {
7339 exp->expType = op1->type;
7340 if(op1->type)
7341 op1->type->refCount++;
7342 }
7343 return 0x1;
7344 }
7345
7346 static unsigned int DoubleMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7347 {
7348 double value2 = op2->d;
7349
7350 exp->type = 2;
7351 exp->string = PrintDouble(op1->d *= value2);
7352 if(!exp->expType)
7353 {
7354 exp->expType = op1->type;
7355 if(op1->type)
7356 op1->type->refCount++;
7357 }
7358 return 0x1;
7359 }
7360
7361 static unsigned int IntDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7362 {
7363 int value2 = op2->i;
7364
7365 exp->type = 2;
7366 exp->string = PrintInt(value2 ? (op1->i /= value2) : 0);
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 UIntDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7377 {
7378 unsigned int value2 = op2->ui;
7379
7380 exp->type = 2;
7381 exp->string = PrintUInt(value2 ? (op1->ui /= value2) : 0);
7382 if(!exp->expType)
7383 {
7384 exp->expType = op1->type;
7385 if(op1->type)
7386 op1->type->refCount++;
7387 }
7388 return 0x1;
7389 }
7390
7391 static unsigned int Int64DivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7392 {
7393 int value2 = op2->i;
7394
7395 exp->type = 2;
7396 exp->string = PrintInt64(value2 ? (op1->i /= value2) : 0);
7397 if(!exp->expType)
7398 {
7399 exp->expType = op1->type;
7400 if(op1->type)
7401 op1->type->refCount++;
7402 }
7403 return 0x1;
7404 }
7405
7406 static unsigned int UInt64DivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7407 {
7408 unsigned int value2 = op2->ui;
7409
7410 exp->type = 2;
7411 exp->string = PrintUInt64(value2 ? (op1->ui /= value2) : 0);
7412 if(!exp->expType)
7413 {
7414 exp->expType = op1->type;
7415 if(op1->type)
7416 op1->type->refCount++;
7417 }
7418 return 0x1;
7419 }
7420
7421 static unsigned int ShortDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7422 {
7423 short value2 = op2->s;
7424
7425 exp->type = 2;
7426 exp->string = PrintShort(value2 ? (op1->s /= value2) : (short)0);
7427 if(!exp->expType)
7428 {
7429 exp->expType = op1->type;
7430 if(op1->type)
7431 op1->type->refCount++;
7432 }
7433 return 0x1;
7434 }
7435
7436 static unsigned int UShortDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7437 {
7438 unsigned short value2 = op2->us;
7439
7440 exp->type = 2;
7441 exp->string = PrintUShort(value2 ? (op1->us /= value2) : (unsigned short)0);
7442 if(!exp->expType)
7443 {
7444 exp->expType = op1->type;
7445 if(op1->type)
7446 op1->type->refCount++;
7447 }
7448 return 0x1;
7449 }
7450
7451 static unsigned int CharDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7452 {
7453 char value2 = op2->c;
7454
7455 exp->type = 2;
7456 exp->string = PrintChar(value2 ? (op1->c /= value2) : (char)0);
7457 if(!exp->expType)
7458 {
7459 exp->expType = op1->type;
7460 if(op1->type)
7461 op1->type->refCount++;
7462 }
7463 return 0x1;
7464 }
7465
7466 static unsigned int UCharDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7467 {
7468 unsigned char value2 = op2->uc;
7469
7470 exp->type = 2;
7471 exp->string = PrintUChar(value2 ? (op1->uc /= value2) : (unsigned char)0);
7472 if(!exp->expType)
7473 {
7474 exp->expType = op1->type;
7475 if(op1->type)
7476 op1->type->refCount++;
7477 }
7478 return 0x1;
7479 }
7480
7481 static unsigned int FloatDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7482 {
7483 float value2 = op2->f;
7484
7485 exp->type = 2;
7486 exp->string = PrintFloat(value2 ? (op1->f /= value2) : 0);
7487 if(!exp->expType)
7488 {
7489 exp->expType = op1->type;
7490 if(op1->type)
7491 op1->type->refCount++;
7492 }
7493 return 0x1;
7494 }
7495
7496 static unsigned int DoubleDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7497 {
7498 double value2 = op2->d;
7499
7500 exp->type = 2;
7501 exp->string = PrintDouble(value2 ? (op1->d /= value2) : 0);
7502 if(!exp->expType)
7503 {
7504 exp->expType = op1->type;
7505 if(op1->type)
7506 op1->type->refCount++;
7507 }
7508 return 0x1;
7509 }
7510
7511 static unsigned int IntModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7512 {
7513 int value2 = op2->i;
7514
7515 exp->type = 2;
7516 exp->string = PrintInt(value2 ? (op1->i %= value2) : 0);
7517 if(!exp->expType)
7518 {
7519 exp->expType = op1->type;
7520 if(op1->type)
7521 op1->type->refCount++;
7522 }
7523 return 0x1;
7524 }
7525
7526 static unsigned int UIntModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7527 {
7528 unsigned int value2 = op2->ui;
7529
7530 exp->type = 2;
7531 exp->string = PrintUInt(value2 ? (op1->ui %= value2) : 0);
7532 if(!exp->expType)
7533 {
7534 exp->expType = op1->type;
7535 if(op1->type)
7536 op1->type->refCount++;
7537 }
7538 return 0x1;
7539 }
7540
7541 static unsigned int Int64ModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7542 {
7543 int value2 = op2->i;
7544
7545 exp->type = 2;
7546 exp->string = PrintInt64(value2 ? (op1->i %= value2) : 0);
7547 if(!exp->expType)
7548 {
7549 exp->expType = op1->type;
7550 if(op1->type)
7551 op1->type->refCount++;
7552 }
7553 return 0x1;
7554 }
7555
7556 static unsigned int UInt64ModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7557 {
7558 unsigned int value2 = op2->ui;
7559
7560 exp->type = 2;
7561 exp->string = PrintUInt64(value2 ? (op1->ui %= value2) : 0);
7562 if(!exp->expType)
7563 {
7564 exp->expType = op1->type;
7565 if(op1->type)
7566 op1->type->refCount++;
7567 }
7568 return 0x1;
7569 }
7570
7571 static unsigned int ShortModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7572 {
7573 short value2 = op2->s;
7574
7575 exp->type = 2;
7576 exp->string = PrintShort(value2 ? (op1->s %= value2) : (short)0);
7577 if(!exp->expType)
7578 {
7579 exp->expType = op1->type;
7580 if(op1->type)
7581 op1->type->refCount++;
7582 }
7583 return 0x1;
7584 }
7585
7586 static unsigned int UShortModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7587 {
7588 unsigned short value2 = op2->us;
7589
7590 exp->type = 2;
7591 exp->string = PrintUShort(value2 ? (op1->us %= value2) : (unsigned short)0);
7592 if(!exp->expType)
7593 {
7594 exp->expType = op1->type;
7595 if(op1->type)
7596 op1->type->refCount++;
7597 }
7598 return 0x1;
7599 }
7600
7601 static unsigned int CharModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7602 {
7603 char value2 = op2->c;
7604
7605 exp->type = 2;
7606 exp->string = PrintChar(value2 ? (op1->c %= value2) : (char)0);
7607 if(!exp->expType)
7608 {
7609 exp->expType = op1->type;
7610 if(op1->type)
7611 op1->type->refCount++;
7612 }
7613 return 0x1;
7614 }
7615
7616 static unsigned int UCharModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7617 {
7618 unsigned char value2 = op2->uc;
7619
7620 exp->type = 2;
7621 exp->string = PrintUChar(value2 ? (op1->uc %= value2) : (unsigned char)0);
7622 if(!exp->expType)
7623 {
7624 exp->expType = op1->type;
7625 if(op1->type)
7626 op1->type->refCount++;
7627 }
7628 return 0x1;
7629 }
7630
7631 static unsigned int IntBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7632 {
7633 int value2 = op2->i;
7634
7635 exp->type = 2;
7636 exp->string = PrintInt(op1->i & value2);
7637 if(!exp->expType)
7638 {
7639 exp->expType = op1->type;
7640 if(op1->type)
7641 op1->type->refCount++;
7642 }
7643 return 0x1;
7644 }
7645
7646 static unsigned int UIntBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7647 {
7648 unsigned int value2 = op2->ui;
7649
7650 exp->type = 2;
7651 exp->string = PrintUInt(op1->ui & value2);
7652 if(!exp->expType)
7653 {
7654 exp->expType = op1->type;
7655 if(op1->type)
7656 op1->type->refCount++;
7657 }
7658 return 0x1;
7659 }
7660
7661 static unsigned int Int64BitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7662 {
7663 int value2 = op2->i;
7664
7665 exp->type = 2;
7666 exp->string = PrintInt64(op1->i & value2);
7667 if(!exp->expType)
7668 {
7669 exp->expType = op1->type;
7670 if(op1->type)
7671 op1->type->refCount++;
7672 }
7673 return 0x1;
7674 }
7675
7676 static unsigned int UInt64BitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7677 {
7678 unsigned int value2 = op2->ui;
7679
7680 exp->type = 2;
7681 exp->string = PrintUInt64(op1->ui & value2);
7682 if(!exp->expType)
7683 {
7684 exp->expType = op1->type;
7685 if(op1->type)
7686 op1->type->refCount++;
7687 }
7688 return 0x1;
7689 }
7690
7691 static unsigned int ShortBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7692 {
7693 short value2 = op2->s;
7694
7695 exp->type = 2;
7696 exp->string = PrintShort(op1->s & value2);
7697 if(!exp->expType)
7698 {
7699 exp->expType = op1->type;
7700 if(op1->type)
7701 op1->type->refCount++;
7702 }
7703 return 0x1;
7704 }
7705
7706 static unsigned int UShortBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7707 {
7708 unsigned short value2 = op2->us;
7709
7710 exp->type = 2;
7711 exp->string = PrintUShort(op1->us & value2);
7712 if(!exp->expType)
7713 {
7714 exp->expType = op1->type;
7715 if(op1->type)
7716 op1->type->refCount++;
7717 }
7718 return 0x1;
7719 }
7720
7721 static unsigned int CharBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7722 {
7723 char value2 = op2->c;
7724
7725 exp->type = 2;
7726 exp->string = PrintChar(op1->c & value2);
7727 if(!exp->expType)
7728 {
7729 exp->expType = op1->type;
7730 if(op1->type)
7731 op1->type->refCount++;
7732 }
7733 return 0x1;
7734 }
7735
7736 static unsigned int UCharBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7737 {
7738 unsigned char value2 = op2->uc;
7739
7740 exp->type = 2;
7741 exp->string = PrintUChar(op1->uc & value2);
7742 if(!exp->expType)
7743 {
7744 exp->expType = op1->type;
7745 if(op1->type)
7746 op1->type->refCount++;
7747 }
7748 return 0x1;
7749 }
7750
7751 static unsigned int IntBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7752 {
7753 int value2 = op2->i;
7754
7755 exp->type = 2;
7756 exp->string = PrintInt(op1->i | value2);
7757 if(!exp->expType)
7758 {
7759 exp->expType = op1->type;
7760 if(op1->type)
7761 op1->type->refCount++;
7762 }
7763 return 0x1;
7764 }
7765
7766 static unsigned int UIntBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7767 {
7768 unsigned int value2 = op2->ui;
7769
7770 exp->type = 2;
7771 exp->string = PrintUInt(op1->ui | value2);
7772 if(!exp->expType)
7773 {
7774 exp->expType = op1->type;
7775 if(op1->type)
7776 op1->type->refCount++;
7777 }
7778 return 0x1;
7779 }
7780
7781 static unsigned int Int64BitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7782 {
7783 int value2 = op2->i;
7784
7785 exp->type = 2;
7786 exp->string = PrintInt64(op1->i | value2);
7787 if(!exp->expType)
7788 {
7789 exp->expType = op1->type;
7790 if(op1->type)
7791 op1->type->refCount++;
7792 }
7793 return 0x1;
7794 }
7795
7796 static unsigned int UInt64BitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7797 {
7798 unsigned int value2 = op2->ui;
7799
7800 exp->type = 2;
7801 exp->string = PrintUInt64(op1->ui | value2);
7802 if(!exp->expType)
7803 {
7804 exp->expType = op1->type;
7805 if(op1->type)
7806 op1->type->refCount++;
7807 }
7808 return 0x1;
7809 }
7810
7811 static unsigned int ShortBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7812 {
7813 short value2 = op2->s;
7814
7815 exp->type = 2;
7816 exp->string = PrintShort(op1->s | value2);
7817 if(!exp->expType)
7818 {
7819 exp->expType = op1->type;
7820 if(op1->type)
7821 op1->type->refCount++;
7822 }
7823 return 0x1;
7824 }
7825
7826 static unsigned int UShortBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7827 {
7828 unsigned short value2 = op2->us;
7829
7830 exp->type = 2;
7831 exp->string = PrintUShort(op1->us | value2);
7832 if(!exp->expType)
7833 {
7834 exp->expType = op1->type;
7835 if(op1->type)
7836 op1->type->refCount++;
7837 }
7838 return 0x1;
7839 }
7840
7841 static unsigned int CharBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7842 {
7843 char value2 = op2->c;
7844
7845 exp->type = 2;
7846 exp->string = PrintChar(op1->c | value2);
7847 if(!exp->expType)
7848 {
7849 exp->expType = op1->type;
7850 if(op1->type)
7851 op1->type->refCount++;
7852 }
7853 return 0x1;
7854 }
7855
7856 static unsigned int UCharBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7857 {
7858 unsigned char value2 = op2->uc;
7859
7860 exp->type = 2;
7861 exp->string = PrintUChar(op1->uc | value2);
7862 if(!exp->expType)
7863 {
7864 exp->expType = op1->type;
7865 if(op1->type)
7866 op1->type->refCount++;
7867 }
7868 return 0x1;
7869 }
7870
7871 static unsigned int IntBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7872 {
7873 int value2 = op2->i;
7874
7875 exp->type = 2;
7876 exp->string = PrintInt(op1->i ^ value2);
7877 if(!exp->expType)
7878 {
7879 exp->expType = op1->type;
7880 if(op1->type)
7881 op1->type->refCount++;
7882 }
7883 return 0x1;
7884 }
7885
7886 static unsigned int UIntBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7887 {
7888 unsigned int value2 = op2->ui;
7889
7890 exp->type = 2;
7891 exp->string = PrintUInt(op1->ui ^ value2);
7892 if(!exp->expType)
7893 {
7894 exp->expType = op1->type;
7895 if(op1->type)
7896 op1->type->refCount++;
7897 }
7898 return 0x1;
7899 }
7900
7901 static unsigned int Int64BitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7902 {
7903 int value2 = op2->i;
7904
7905 exp->type = 2;
7906 exp->string = PrintInt64(op1->i ^ value2);
7907 if(!exp->expType)
7908 {
7909 exp->expType = op1->type;
7910 if(op1->type)
7911 op1->type->refCount++;
7912 }
7913 return 0x1;
7914 }
7915
7916 static unsigned int UInt64BitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7917 {
7918 unsigned int value2 = op2->ui;
7919
7920 exp->type = 2;
7921 exp->string = PrintUInt64(op1->ui ^ value2);
7922 if(!exp->expType)
7923 {
7924 exp->expType = op1->type;
7925 if(op1->type)
7926 op1->type->refCount++;
7927 }
7928 return 0x1;
7929 }
7930
7931 static unsigned int ShortBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7932 {
7933 short value2 = op2->s;
7934
7935 exp->type = 2;
7936 exp->string = PrintShort(op1->s ^ value2);
7937 if(!exp->expType)
7938 {
7939 exp->expType = op1->type;
7940 if(op1->type)
7941 op1->type->refCount++;
7942 }
7943 return 0x1;
7944 }
7945
7946 static unsigned int UShortBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7947 {
7948 unsigned short value2 = op2->us;
7949
7950 exp->type = 2;
7951 exp->string = PrintUShort(op1->us ^ value2);
7952 if(!exp->expType)
7953 {
7954 exp->expType = op1->type;
7955 if(op1->type)
7956 op1->type->refCount++;
7957 }
7958 return 0x1;
7959 }
7960
7961 static unsigned int CharBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7962 {
7963 char value2 = op2->c;
7964
7965 exp->type = 2;
7966 exp->string = PrintChar(op1->c ^ value2);
7967 if(!exp->expType)
7968 {
7969 exp->expType = op1->type;
7970 if(op1->type)
7971 op1->type->refCount++;
7972 }
7973 return 0x1;
7974 }
7975
7976 static unsigned int UCharBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7977 {
7978 unsigned char value2 = op2->uc;
7979
7980 exp->type = 2;
7981 exp->string = PrintUChar(op1->uc ^ value2);
7982 if(!exp->expType)
7983 {
7984 exp->expType = op1->type;
7985 if(op1->type)
7986 op1->type->refCount++;
7987 }
7988 return 0x1;
7989 }
7990
7991 static unsigned int IntLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7992 {
7993 int value2 = op2->i;
7994
7995 exp->type = 2;
7996 exp->string = PrintInt(op1->i << value2);
7997 if(!exp->expType)
7998 {
7999 exp->expType = op1->type;
8000 if(op1->type)
8001 op1->type->refCount++;
8002 }
8003 return 0x1;
8004 }
8005
8006 static unsigned int UIntLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8007 {
8008 unsigned int value2 = op2->ui;
8009
8010 exp->type = 2;
8011 exp->string = PrintUInt(op1->ui << value2);
8012 if(!exp->expType)
8013 {
8014 exp->expType = op1->type;
8015 if(op1->type)
8016 op1->type->refCount++;
8017 }
8018 return 0x1;
8019 }
8020
8021 static unsigned int Int64LShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8022 {
8023 int value2 = op2->i;
8024
8025 exp->type = 2;
8026 exp->string = PrintInt64(op1->i << value2);
8027 if(!exp->expType)
8028 {
8029 exp->expType = op1->type;
8030 if(op1->type)
8031 op1->type->refCount++;
8032 }
8033 return 0x1;
8034 }
8035
8036 static unsigned int UInt64LShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8037 {
8038 unsigned int value2 = op2->ui;
8039
8040 exp->type = 2;
8041 exp->string = PrintUInt64(op1->ui << value2);
8042 if(!exp->expType)
8043 {
8044 exp->expType = op1->type;
8045 if(op1->type)
8046 op1->type->refCount++;
8047 }
8048 return 0x1;
8049 }
8050
8051 static unsigned int ShortLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8052 {
8053 short value2 = op2->s;
8054
8055 exp->type = 2;
8056 exp->string = PrintShort(op1->s << value2);
8057 if(!exp->expType)
8058 {
8059 exp->expType = op1->type;
8060 if(op1->type)
8061 op1->type->refCount++;
8062 }
8063 return 0x1;
8064 }
8065
8066 static unsigned int UShortLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8067 {
8068 unsigned short value2 = op2->us;
8069
8070 exp->type = 2;
8071 exp->string = PrintUShort(op1->us << value2);
8072 if(!exp->expType)
8073 {
8074 exp->expType = op1->type;
8075 if(op1->type)
8076 op1->type->refCount++;
8077 }
8078 return 0x1;
8079 }
8080
8081 static unsigned int CharLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8082 {
8083 char value2 = op2->c;
8084
8085 exp->type = 2;
8086 exp->string = PrintChar(op1->c << value2);
8087 if(!exp->expType)
8088 {
8089 exp->expType = op1->type;
8090 if(op1->type)
8091 op1->type->refCount++;
8092 }
8093 return 0x1;
8094 }
8095
8096 static unsigned int UCharLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8097 {
8098 unsigned char value2 = op2->uc;
8099
8100 exp->type = 2;
8101 exp->string = PrintUChar(op1->uc << value2);
8102 if(!exp->expType)
8103 {
8104 exp->expType = op1->type;
8105 if(op1->type)
8106 op1->type->refCount++;
8107 }
8108 return 0x1;
8109 }
8110
8111 static unsigned int IntRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8112 {
8113 int value2 = op2->i;
8114
8115 exp->type = 2;
8116 exp->string = PrintInt(op1->i >> value2);
8117 if(!exp->expType)
8118 {
8119 exp->expType = op1->type;
8120 if(op1->type)
8121 op1->type->refCount++;
8122 }
8123 return 0x1;
8124 }
8125
8126 static unsigned int UIntRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8127 {
8128 unsigned int value2 = op2->ui;
8129
8130 exp->type = 2;
8131 exp->string = PrintUInt(op1->ui >> value2);
8132 if(!exp->expType)
8133 {
8134 exp->expType = op1->type;
8135 if(op1->type)
8136 op1->type->refCount++;
8137 }
8138 return 0x1;
8139 }
8140
8141 static unsigned int Int64RShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8142 {
8143 int value2 = op2->i;
8144
8145 exp->type = 2;
8146 exp->string = PrintInt64(op1->i >> value2);
8147 if(!exp->expType)
8148 {
8149 exp->expType = op1->type;
8150 if(op1->type)
8151 op1->type->refCount++;
8152 }
8153 return 0x1;
8154 }
8155
8156 static unsigned int UInt64RShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8157 {
8158 unsigned int value2 = op2->ui;
8159
8160 exp->type = 2;
8161 exp->string = PrintUInt64(op1->ui >> value2);
8162 if(!exp->expType)
8163 {
8164 exp->expType = op1->type;
8165 if(op1->type)
8166 op1->type->refCount++;
8167 }
8168 return 0x1;
8169 }
8170
8171 static unsigned int ShortRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8172 {
8173 short value2 = op2->s;
8174
8175 exp->type = 2;
8176 exp->string = PrintShort(op1->s >> value2);
8177 if(!exp->expType)
8178 {
8179 exp->expType = op1->type;
8180 if(op1->type)
8181 op1->type->refCount++;
8182 }
8183 return 0x1;
8184 }
8185
8186 static unsigned int UShortRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8187 {
8188 unsigned short value2 = op2->us;
8189
8190 exp->type = 2;
8191 exp->string = PrintUShort(op1->us >> value2);
8192 if(!exp->expType)
8193 {
8194 exp->expType = op1->type;
8195 if(op1->type)
8196 op1->type->refCount++;
8197 }
8198 return 0x1;
8199 }
8200
8201 static unsigned int CharRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8202 {
8203 char value2 = op2->c;
8204
8205 exp->type = 2;
8206 exp->string = PrintChar(op1->c >> value2);
8207 if(!exp->expType)
8208 {
8209 exp->expType = op1->type;
8210 if(op1->type)
8211 op1->type->refCount++;
8212 }
8213 return 0x1;
8214 }
8215
8216 static unsigned int UCharRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8217 {
8218 unsigned char value2 = op2->uc;
8219
8220 exp->type = 2;
8221 exp->string = PrintUChar(op1->uc >> value2);
8222 if(!exp->expType)
8223 {
8224 exp->expType = op1->type;
8225 if(op1->type)
8226 op1->type->refCount++;
8227 }
8228 return 0x1;
8229 }
8230
8231 static unsigned int IntBitNot(struct Expression * exp, struct Operand * op1)
8232 {
8233 exp->type = 2;
8234 exp->string = PrintInt((~op1->i));
8235 if(!exp->expType)
8236 {
8237 exp->expType = op1->type;
8238 if(op1->type)
8239 op1->type->refCount++;
8240 }
8241 return 0x1;
8242 }
8243
8244 static unsigned int UIntBitNot(struct Expression * exp, struct Operand * op1)
8245 {
8246 exp->type = 2;
8247 exp->string = PrintUInt((unsigned int)(~op1->ui));
8248 if(!exp->expType)
8249 {
8250 exp->expType = op1->type;
8251 if(op1->type)
8252 op1->type->refCount++;
8253 }
8254 return 0x1;
8255 }
8256
8257 static unsigned int Int64BitNot(struct Expression * exp, struct Operand * op1)
8258 {
8259 exp->type = 2;
8260 exp->string = PrintInt64((~op1->i));
8261 if(!exp->expType)
8262 {
8263 exp->expType = op1->type;
8264 if(op1->type)
8265 op1->type->refCount++;
8266 }
8267 return 0x1;
8268 }
8269
8270 static unsigned int UInt64BitNot(struct Expression * exp, struct Operand * op1)
8271 {
8272 exp->type = 2;
8273 exp->string = PrintUInt64((unsigned int)(~op1->ui));
8274 if(!exp->expType)
8275 {
8276 exp->expType = op1->type;
8277 if(op1->type)
8278 op1->type->refCount++;
8279 }
8280 return 0x1;
8281 }
8282
8283 static unsigned int ShortBitNot(struct Expression * exp, struct Operand * op1)
8284 {
8285 exp->type = 2;
8286 exp->string = PrintShort((short)(~op1->s));
8287 if(!exp->expType)
8288 {
8289 exp->expType = op1->type;
8290 if(op1->type)
8291 op1->type->refCount++;
8292 }
8293 return 0x1;
8294 }
8295
8296 static unsigned int UShortBitNot(struct Expression * exp, struct Operand * op1)
8297 {
8298 exp->type = 2;
8299 exp->string = PrintUShort((unsigned short)(~op1->us));
8300 if(!exp->expType)
8301 {
8302 exp->expType = op1->type;
8303 if(op1->type)
8304 op1->type->refCount++;
8305 }
8306 return 0x1;
8307 }
8308
8309 static unsigned int CharBitNot(struct Expression * exp, struct Operand * op1)
8310 {
8311 exp->type = 2;
8312 exp->string = PrintChar((char)(~op1->c));
8313 if(!exp->expType)
8314 {
8315 exp->expType = op1->type;
8316 if(op1->type)
8317 op1->type->refCount++;
8318 }
8319 return 0x1;
8320 }
8321
8322 static unsigned int UCharBitNot(struct Expression * exp, struct Operand * op1)
8323 {
8324 exp->type = 2;
8325 exp->string = PrintUChar((unsigned char)(~op1->uc));
8326 if(!exp->expType)
8327 {
8328 exp->expType = op1->type;
8329 if(op1->type)
8330 op1->type->refCount++;
8331 }
8332 return 0x1;
8333 }
8334
8335 static unsigned int IntAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8336 {
8337 int value2 = op2->i;
8338
8339 exp->type = 2;
8340 exp->string = PrintInt(op1->i &= value2);
8341 if(!exp->expType)
8342 {
8343 exp->expType = op1->type;
8344 if(op1->type)
8345 op1->type->refCount++;
8346 }
8347 return 0x1;
8348 }
8349
8350 static unsigned int UIntAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8351 {
8352 unsigned int value2 = op2->ui;
8353
8354 exp->type = 2;
8355 exp->string = PrintUInt(op1->ui &= value2);
8356 if(!exp->expType)
8357 {
8358 exp->expType = op1->type;
8359 if(op1->type)
8360 op1->type->refCount++;
8361 }
8362 return 0x1;
8363 }
8364
8365 static unsigned int Int64AndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8366 {
8367 int value2 = op2->i;
8368
8369 exp->type = 2;
8370 exp->string = PrintInt64(op1->i &= value2);
8371 if(!exp->expType)
8372 {
8373 exp->expType = op1->type;
8374 if(op1->type)
8375 op1->type->refCount++;
8376 }
8377 return 0x1;
8378 }
8379
8380 static unsigned int UInt64AndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8381 {
8382 unsigned int value2 = op2->ui;
8383
8384 exp->type = 2;
8385 exp->string = PrintUInt64(op1->ui &= value2);
8386 if(!exp->expType)
8387 {
8388 exp->expType = op1->type;
8389 if(op1->type)
8390 op1->type->refCount++;
8391 }
8392 return 0x1;
8393 }
8394
8395 static unsigned int ShortAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8396 {
8397 short value2 = op2->s;
8398
8399 exp->type = 2;
8400 exp->string = PrintShort(op1->s &= value2);
8401 if(!exp->expType)
8402 {
8403 exp->expType = op1->type;
8404 if(op1->type)
8405 op1->type->refCount++;
8406 }
8407 return 0x1;
8408 }
8409
8410 static unsigned int UShortAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8411 {
8412 unsigned short value2 = op2->us;
8413
8414 exp->type = 2;
8415 exp->string = PrintUShort(op1->us &= value2);
8416 if(!exp->expType)
8417 {
8418 exp->expType = op1->type;
8419 if(op1->type)
8420 op1->type->refCount++;
8421 }
8422 return 0x1;
8423 }
8424
8425 static unsigned int CharAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8426 {
8427 char value2 = op2->c;
8428
8429 exp->type = 2;
8430 exp->string = PrintChar(op1->c &= value2);
8431 if(!exp->expType)
8432 {
8433 exp->expType = op1->type;
8434 if(op1->type)
8435 op1->type->refCount++;
8436 }
8437 return 0x1;
8438 }
8439
8440 static unsigned int UCharAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8441 {
8442 unsigned char value2 = op2->uc;
8443
8444 exp->type = 2;
8445 exp->string = PrintUChar(op1->uc &= value2);
8446 if(!exp->expType)
8447 {
8448 exp->expType = op1->type;
8449 if(op1->type)
8450 op1->type->refCount++;
8451 }
8452 return 0x1;
8453 }
8454
8455 static unsigned int IntOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8456 {
8457 int value2 = op2->i;
8458
8459 exp->type = 2;
8460 exp->string = PrintInt(op1->i |= value2);
8461 if(!exp->expType)
8462 {
8463 exp->expType = op1->type;
8464 if(op1->type)
8465 op1->type->refCount++;
8466 }
8467 return 0x1;
8468 }
8469
8470 static unsigned int UIntOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8471 {
8472 unsigned int value2 = op2->ui;
8473
8474 exp->type = 2;
8475 exp->string = PrintUInt(op1->ui |= value2);
8476 if(!exp->expType)
8477 {
8478 exp->expType = op1->type;
8479 if(op1->type)
8480 op1->type->refCount++;
8481 }
8482 return 0x1;
8483 }
8484
8485 static unsigned int Int64OrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8486 {
8487 int value2 = op2->i;
8488
8489 exp->type = 2;
8490 exp->string = PrintInt64(op1->i |= value2);
8491 if(!exp->expType)
8492 {
8493 exp->expType = op1->type;
8494 if(op1->type)
8495 op1->type->refCount++;
8496 }
8497 return 0x1;
8498 }
8499
8500 static unsigned int UInt64OrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8501 {
8502 unsigned int value2 = op2->ui;
8503
8504 exp->type = 2;
8505 exp->string = PrintUInt64(op1->ui |= value2);
8506 if(!exp->expType)
8507 {
8508 exp->expType = op1->type;
8509 if(op1->type)
8510 op1->type->refCount++;
8511 }
8512 return 0x1;
8513 }
8514
8515 static unsigned int ShortOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8516 {
8517 short value2 = op2->s;
8518
8519 exp->type = 2;
8520 exp->string = PrintShort(op1->s |= value2);
8521 if(!exp->expType)
8522 {
8523 exp->expType = op1->type;
8524 if(op1->type)
8525 op1->type->refCount++;
8526 }
8527 return 0x1;
8528 }
8529
8530 static unsigned int UShortOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8531 {
8532 unsigned short value2 = op2->us;
8533
8534 exp->type = 2;
8535 exp->string = PrintUShort(op1->us |= value2);
8536 if(!exp->expType)
8537 {
8538 exp->expType = op1->type;
8539 if(op1->type)
8540 op1->type->refCount++;
8541 }
8542 return 0x1;
8543 }
8544
8545 static unsigned int CharOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8546 {
8547 char value2 = op2->c;
8548
8549 exp->type = 2;
8550 exp->string = PrintChar(op1->c |= value2);
8551 if(!exp->expType)
8552 {
8553 exp->expType = op1->type;
8554 if(op1->type)
8555 op1->type->refCount++;
8556 }
8557 return 0x1;
8558 }
8559
8560 static unsigned int UCharOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8561 {
8562 unsigned char value2 = op2->uc;
8563
8564 exp->type = 2;
8565 exp->string = PrintUChar(op1->uc |= value2);
8566 if(!exp->expType)
8567 {
8568 exp->expType = op1->type;
8569 if(op1->type)
8570 op1->type->refCount++;
8571 }
8572 return 0x1;
8573 }
8574
8575 static unsigned int IntXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8576 {
8577 int value2 = op2->i;
8578
8579 exp->type = 2;
8580 exp->string = PrintInt(op1->i ^= value2);
8581 if(!exp->expType)
8582 {
8583 exp->expType = op1->type;
8584 if(op1->type)
8585 op1->type->refCount++;
8586 }
8587 return 0x1;
8588 }
8589
8590 static unsigned int UIntXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8591 {
8592 unsigned int value2 = op2->ui;
8593
8594 exp->type = 2;
8595 exp->string = PrintUInt(op1->ui ^= value2);
8596 if(!exp->expType)
8597 {
8598 exp->expType = op1->type;
8599 if(op1->type)
8600 op1->type->refCount++;
8601 }
8602 return 0x1;
8603 }
8604
8605 static unsigned int Int64XorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8606 {
8607 int value2 = op2->i;
8608
8609 exp->type = 2;
8610 exp->string = PrintInt64(op1->i ^= value2);
8611 if(!exp->expType)
8612 {
8613 exp->expType = op1->type;
8614 if(op1->type)
8615 op1->type->refCount++;
8616 }
8617 return 0x1;
8618 }
8619
8620 static unsigned int UInt64XorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8621 {
8622 unsigned int value2 = op2->ui;
8623
8624 exp->type = 2;
8625 exp->string = PrintUInt64(op1->ui ^= value2);
8626 if(!exp->expType)
8627 {
8628 exp->expType = op1->type;
8629 if(op1->type)
8630 op1->type->refCount++;
8631 }
8632 return 0x1;
8633 }
8634
8635 static unsigned int ShortXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8636 {
8637 short value2 = op2->s;
8638
8639 exp->type = 2;
8640 exp->string = PrintShort(op1->s ^= value2);
8641 if(!exp->expType)
8642 {
8643 exp->expType = op1->type;
8644 if(op1->type)
8645 op1->type->refCount++;
8646 }
8647 return 0x1;
8648 }
8649
8650 static unsigned int UShortXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8651 {
8652 unsigned short value2 = op2->us;
8653
8654 exp->type = 2;
8655 exp->string = PrintUShort(op1->us ^= value2);
8656 if(!exp->expType)
8657 {
8658 exp->expType = op1->type;
8659 if(op1->type)
8660 op1->type->refCount++;
8661 }
8662 return 0x1;
8663 }
8664
8665 static unsigned int CharXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8666 {
8667 char value2 = op2->c;
8668
8669 exp->type = 2;
8670 exp->string = PrintChar(op1->c ^= value2);
8671 if(!exp->expType)
8672 {
8673 exp->expType = op1->type;
8674 if(op1->type)
8675 op1->type->refCount++;
8676 }
8677 return 0x1;
8678 }
8679
8680 static unsigned int UCharXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8681 {
8682 unsigned char value2 = op2->uc;
8683
8684 exp->type = 2;
8685 exp->string = PrintUChar(op1->uc ^= value2);
8686 if(!exp->expType)
8687 {
8688 exp->expType = op1->type;
8689 if(op1->type)
8690 op1->type->refCount++;
8691 }
8692 return 0x1;
8693 }
8694
8695 static unsigned int IntLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8696 {
8697 int value2 = op2->i;
8698
8699 exp->type = 2;
8700 exp->string = PrintInt(op1->i <<= value2);
8701 if(!exp->expType)
8702 {
8703 exp->expType = op1->type;
8704 if(op1->type)
8705 op1->type->refCount++;
8706 }
8707 return 0x1;
8708 }
8709
8710 static unsigned int UIntLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8711 {
8712 unsigned int value2 = op2->ui;
8713
8714 exp->type = 2;
8715 exp->string = PrintUInt(op1->ui <<= value2);
8716 if(!exp->expType)
8717 {
8718 exp->expType = op1->type;
8719 if(op1->type)
8720 op1->type->refCount++;
8721 }
8722 return 0x1;
8723 }
8724
8725 static unsigned int Int64LShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8726 {
8727 int value2 = op2->i;
8728
8729 exp->type = 2;
8730 exp->string = PrintInt64(op1->i <<= value2);
8731 if(!exp->expType)
8732 {
8733 exp->expType = op1->type;
8734 if(op1->type)
8735 op1->type->refCount++;
8736 }
8737 return 0x1;
8738 }
8739
8740 static unsigned int UInt64LShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8741 {
8742 unsigned int value2 = op2->ui;
8743
8744 exp->type = 2;
8745 exp->string = PrintUInt64(op1->ui <<= value2);
8746 if(!exp->expType)
8747 {
8748 exp->expType = op1->type;
8749 if(op1->type)
8750 op1->type->refCount++;
8751 }
8752 return 0x1;
8753 }
8754
8755 static unsigned int ShortLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8756 {
8757 short value2 = op2->s;
8758
8759 exp->type = 2;
8760 exp->string = PrintShort(op1->s <<= value2);
8761 if(!exp->expType)
8762 {
8763 exp->expType = op1->type;
8764 if(op1->type)
8765 op1->type->refCount++;
8766 }
8767 return 0x1;
8768 }
8769
8770 static unsigned int UShortLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8771 {
8772 unsigned short value2 = op2->us;
8773
8774 exp->type = 2;
8775 exp->string = PrintUShort(op1->us <<= value2);
8776 if(!exp->expType)
8777 {
8778 exp->expType = op1->type;
8779 if(op1->type)
8780 op1->type->refCount++;
8781 }
8782 return 0x1;
8783 }
8784
8785 static unsigned int CharLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8786 {
8787 char value2 = op2->c;
8788
8789 exp->type = 2;
8790 exp->string = PrintChar(op1->c <<= value2);
8791 if(!exp->expType)
8792 {
8793 exp->expType = op1->type;
8794 if(op1->type)
8795 op1->type->refCount++;
8796 }
8797 return 0x1;
8798 }
8799
8800 static unsigned int UCharLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8801 {
8802 unsigned char value2 = op2->uc;
8803
8804 exp->type = 2;
8805 exp->string = PrintUChar(op1->uc <<= value2);
8806 if(!exp->expType)
8807 {
8808 exp->expType = op1->type;
8809 if(op1->type)
8810 op1->type->refCount++;
8811 }
8812 return 0x1;
8813 }
8814
8815 static unsigned int IntRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8816 {
8817 int value2 = op2->i;
8818
8819 exp->type = 2;
8820 exp->string = PrintInt(op1->i >>= value2);
8821 if(!exp->expType)
8822 {
8823 exp->expType = op1->type;
8824 if(op1->type)
8825 op1->type->refCount++;
8826 }
8827 return 0x1;
8828 }
8829
8830 static unsigned int UIntRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8831 {
8832 unsigned int value2 = op2->ui;
8833
8834 exp->type = 2;
8835 exp->string = PrintUInt(op1->ui >>= value2);
8836 if(!exp->expType)
8837 {
8838 exp->expType = op1->type;
8839 if(op1->type)
8840 op1->type->refCount++;
8841 }
8842 return 0x1;
8843 }
8844
8845 static unsigned int Int64RShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8846 {
8847 int value2 = op2->i;
8848
8849 exp->type = 2;
8850 exp->string = PrintInt64(op1->i >>= value2);
8851 if(!exp->expType)
8852 {
8853 exp->expType = op1->type;
8854 if(op1->type)
8855 op1->type->refCount++;
8856 }
8857 return 0x1;
8858 }
8859
8860 static unsigned int UInt64RShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8861 {
8862 unsigned int value2 = op2->ui;
8863
8864 exp->type = 2;
8865 exp->string = PrintUInt64(op1->ui >>= value2);
8866 if(!exp->expType)
8867 {
8868 exp->expType = op1->type;
8869 if(op1->type)
8870 op1->type->refCount++;
8871 }
8872 return 0x1;
8873 }
8874
8875 static unsigned int ShortRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8876 {
8877 short value2 = op2->s;
8878
8879 exp->type = 2;
8880 exp->string = PrintShort(op1->s >>= value2);
8881 if(!exp->expType)
8882 {
8883 exp->expType = op1->type;
8884 if(op1->type)
8885 op1->type->refCount++;
8886 }
8887 return 0x1;
8888 }
8889
8890 static unsigned int UShortRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8891 {
8892 unsigned short value2 = op2->us;
8893
8894 exp->type = 2;
8895 exp->string = PrintUShort(op1->us >>= value2);
8896 if(!exp->expType)
8897 {
8898 exp->expType = op1->type;
8899 if(op1->type)
8900 op1->type->refCount++;
8901 }
8902 return 0x1;
8903 }
8904
8905 static unsigned int CharRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8906 {
8907 char value2 = op2->c;
8908
8909 exp->type = 2;
8910 exp->string = PrintChar(op1->c >>= value2);
8911 if(!exp->expType)
8912 {
8913 exp->expType = op1->type;
8914 if(op1->type)
8915 op1->type->refCount++;
8916 }
8917 return 0x1;
8918 }
8919
8920 static unsigned int UCharRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8921 {
8922 unsigned char value2 = op2->uc;
8923
8924 exp->type = 2;
8925 exp->string = PrintUChar(op1->uc >>= value2);
8926 if(!exp->expType)
8927 {
8928 exp->expType = op1->type;
8929 if(op1->type)
8930 op1->type->refCount++;
8931 }
8932 return 0x1;
8933 }
8934
8935 static unsigned int IntNot(struct Expression * exp, struct Operand * op1)
8936 {
8937 exp->type = 2;
8938 exp->string = PrintInt((int)(!op1->i));
8939 if(!exp->expType)
8940 {
8941 exp->expType = op1->type;
8942 if(op1->type)
8943 op1->type->refCount++;
8944 }
8945 return 0x1;
8946 }
8947
8948 static unsigned int UIntNot(struct Expression * exp, struct Operand * op1)
8949 {
8950 exp->type = 2;
8951 exp->string = PrintUInt((unsigned int)(!op1->ui));
8952 if(!exp->expType)
8953 {
8954 exp->expType = op1->type;
8955 if(op1->type)
8956 op1->type->refCount++;
8957 }
8958 return 0x1;
8959 }
8960
8961 static unsigned int Int64Not(struct Expression * exp, struct Operand * op1)
8962 {
8963 exp->type = 2;
8964 exp->string = PrintInt64((int)(!op1->i));
8965 if(!exp->expType)
8966 {
8967 exp->expType = op1->type;
8968 if(op1->type)
8969 op1->type->refCount++;
8970 }
8971 return 0x1;
8972 }
8973
8974 static unsigned int UInt64Not(struct Expression * exp, struct Operand * op1)
8975 {
8976 exp->type = 2;
8977 exp->string = PrintUInt64((unsigned int)(!op1->ui));
8978 if(!exp->expType)
8979 {
8980 exp->expType = op1->type;
8981 if(op1->type)
8982 op1->type->refCount++;
8983 }
8984 return 0x1;
8985 }
8986
8987 static unsigned int ShortNot(struct Expression * exp, struct Operand * op1)
8988 {
8989 exp->type = 2;
8990 exp->string = PrintShort((short)(!op1->s));
8991 if(!exp->expType)
8992 {
8993 exp->expType = op1->type;
8994 if(op1->type)
8995 op1->type->refCount++;
8996 }
8997 return 0x1;
8998 }
8999
9000 static unsigned int UShortNot(struct Expression * exp, struct Operand * op1)
9001 {
9002 exp->type = 2;
9003 exp->string = PrintUShort((unsigned short)(!op1->us));
9004 if(!exp->expType)
9005 {
9006 exp->expType = op1->type;
9007 if(op1->type)
9008 op1->type->refCount++;
9009 }
9010 return 0x1;
9011 }
9012
9013 static unsigned int CharNot(struct Expression * exp, struct Operand * op1)
9014 {
9015 exp->type = 2;
9016 exp->string = PrintChar((char)(!op1->c));
9017 if(!exp->expType)
9018 {
9019 exp->expType = op1->type;
9020 if(op1->type)
9021 op1->type->refCount++;
9022 }
9023 return 0x1;
9024 }
9025
9026 static unsigned int UCharNot(struct Expression * exp, struct Operand * op1)
9027 {
9028 exp->type = 2;
9029 exp->string = PrintUChar((unsigned char)(!op1->uc));
9030 if(!exp->expType)
9031 {
9032 exp->expType = op1->type;
9033 if(op1->type)
9034 op1->type->refCount++;
9035 }
9036 return 0x1;
9037 }
9038
9039 static unsigned int IntEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9040 {
9041 int value2 = op2->i;
9042
9043 exp->type = 2;
9044 exp->string = PrintInt(op1->i == value2);
9045 if(!exp->expType)
9046 {
9047 exp->expType = op1->type;
9048 if(op1->type)
9049 op1->type->refCount++;
9050 }
9051 return 0x1;
9052 }
9053
9054 static unsigned int UIntEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9055 {
9056 unsigned int value2 = op2->ui;
9057
9058 exp->type = 2;
9059 exp->string = PrintUInt(op1->ui == value2);
9060 if(!exp->expType)
9061 {
9062 exp->expType = op1->type;
9063 if(op1->type)
9064 op1->type->refCount++;
9065 }
9066 return 0x1;
9067 }
9068
9069 static unsigned int Int64Equ(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9070 {
9071 int value2 = op2->i;
9072
9073 exp->type = 2;
9074 exp->string = PrintInt64(op1->i == value2);
9075 if(!exp->expType)
9076 {
9077 exp->expType = op1->type;
9078 if(op1->type)
9079 op1->type->refCount++;
9080 }
9081 return 0x1;
9082 }
9083
9084 static unsigned int UInt64Equ(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9085 {
9086 unsigned int value2 = op2->ui;
9087
9088 exp->type = 2;
9089 exp->string = PrintUInt64(op1->ui == value2);
9090 if(!exp->expType)
9091 {
9092 exp->expType = op1->type;
9093 if(op1->type)
9094 op1->type->refCount++;
9095 }
9096 return 0x1;
9097 }
9098
9099 static unsigned int ShortEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9100 {
9101 short value2 = op2->s;
9102
9103 exp->type = 2;
9104 exp->string = PrintShort(op1->s == value2);
9105 if(!exp->expType)
9106 {
9107 exp->expType = op1->type;
9108 if(op1->type)
9109 op1->type->refCount++;
9110 }
9111 return 0x1;
9112 }
9113
9114 static unsigned int UShortEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9115 {
9116 unsigned short value2 = op2->us;
9117
9118 exp->type = 2;
9119 exp->string = PrintUShort(op1->us == value2);
9120 if(!exp->expType)
9121 {
9122 exp->expType = op1->type;
9123 if(op1->type)
9124 op1->type->refCount++;
9125 }
9126 return 0x1;
9127 }
9128
9129 static unsigned int CharEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9130 {
9131 char value2 = op2->c;
9132
9133 exp->type = 2;
9134 exp->string = PrintChar(op1->c == value2);
9135 if(!exp->expType)
9136 {
9137 exp->expType = op1->type;
9138 if(op1->type)
9139 op1->type->refCount++;
9140 }
9141 return 0x1;
9142 }
9143
9144 static unsigned int UCharEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9145 {
9146 unsigned char value2 = op2->uc;
9147
9148 exp->type = 2;
9149 exp->string = PrintUChar(op1->uc == value2);
9150 if(!exp->expType)
9151 {
9152 exp->expType = op1->type;
9153 if(op1->type)
9154 op1->type->refCount++;
9155 }
9156 return 0x1;
9157 }
9158
9159 static unsigned int FloatEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9160 {
9161 float value2 = op2->f;
9162
9163 exp->type = 2;
9164 exp->string = PrintFloat(op1->f == value2);
9165 if(!exp->expType)
9166 {
9167 exp->expType = op1->type;
9168 if(op1->type)
9169 op1->type->refCount++;
9170 }
9171 return 0x1;
9172 }
9173
9174 static unsigned int DoubleEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9175 {
9176 double value2 = op2->d;
9177
9178 exp->type = 2;
9179 exp->string = PrintDouble(op1->d == value2);
9180 if(!exp->expType)
9181 {
9182 exp->expType = op1->type;
9183 if(op1->type)
9184 op1->type->refCount++;
9185 }
9186 return 0x1;
9187 }
9188
9189 static unsigned int IntNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9190 {
9191 int value2 = op2->i;
9192
9193 exp->type = 2;
9194 exp->string = PrintInt(op1->i != value2);
9195 if(!exp->expType)
9196 {
9197 exp->expType = op1->type;
9198 if(op1->type)
9199 op1->type->refCount++;
9200 }
9201 return 0x1;
9202 }
9203
9204 static unsigned int UIntNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9205 {
9206 unsigned int value2 = op2->ui;
9207
9208 exp->type = 2;
9209 exp->string = PrintUInt(op1->ui != value2);
9210 if(!exp->expType)
9211 {
9212 exp->expType = op1->type;
9213 if(op1->type)
9214 op1->type->refCount++;
9215 }
9216 return 0x1;
9217 }
9218
9219 static unsigned int Int64Nqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9220 {
9221 int value2 = op2->i;
9222
9223 exp->type = 2;
9224 exp->string = PrintInt64(op1->i != value2);
9225 if(!exp->expType)
9226 {
9227 exp->expType = op1->type;
9228 if(op1->type)
9229 op1->type->refCount++;
9230 }
9231 return 0x1;
9232 }
9233
9234 static unsigned int UInt64Nqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9235 {
9236 unsigned int value2 = op2->ui;
9237
9238 exp->type = 2;
9239 exp->string = PrintUInt64(op1->ui != value2);
9240 if(!exp->expType)
9241 {
9242 exp->expType = op1->type;
9243 if(op1->type)
9244 op1->type->refCount++;
9245 }
9246 return 0x1;
9247 }
9248
9249 static unsigned int ShortNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9250 {
9251 short value2 = op2->s;
9252
9253 exp->type = 2;
9254 exp->string = PrintShort(op1->s != value2);
9255 if(!exp->expType)
9256 {
9257 exp->expType = op1->type;
9258 if(op1->type)
9259 op1->type->refCount++;
9260 }
9261 return 0x1;
9262 }
9263
9264 static unsigned int UShortNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9265 {
9266 unsigned short value2 = op2->us;
9267
9268 exp->type = 2;
9269 exp->string = PrintUShort(op1->us != value2);
9270 if(!exp->expType)
9271 {
9272 exp->expType = op1->type;
9273 if(op1->type)
9274 op1->type->refCount++;
9275 }
9276 return 0x1;
9277 }
9278
9279 static unsigned int CharNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9280 {
9281 char value2 = op2->c;
9282
9283 exp->type = 2;
9284 exp->string = PrintChar(op1->c != value2);
9285 if(!exp->expType)
9286 {
9287 exp->expType = op1->type;
9288 if(op1->type)
9289 op1->type->refCount++;
9290 }
9291 return 0x1;
9292 }
9293
9294 static unsigned int UCharNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9295 {
9296 unsigned char value2 = op2->uc;
9297
9298 exp->type = 2;
9299 exp->string = PrintUChar(op1->uc != value2);
9300 if(!exp->expType)
9301 {
9302 exp->expType = op1->type;
9303 if(op1->type)
9304 op1->type->refCount++;
9305 }
9306 return 0x1;
9307 }
9308
9309 static unsigned int FloatNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9310 {
9311 float value2 = op2->f;
9312
9313 exp->type = 2;
9314 exp->string = PrintFloat(op1->f != value2);
9315 if(!exp->expType)
9316 {
9317 exp->expType = op1->type;
9318 if(op1->type)
9319 op1->type->refCount++;
9320 }
9321 return 0x1;
9322 }
9323
9324 static unsigned int DoubleNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9325 {
9326 double value2 = op2->d;
9327
9328 exp->type = 2;
9329 exp->string = PrintDouble(op1->d != value2);
9330 if(!exp->expType)
9331 {
9332 exp->expType = op1->type;
9333 if(op1->type)
9334 op1->type->refCount++;
9335 }
9336 return 0x1;
9337 }
9338
9339 static unsigned int IntAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9340 {
9341 int value2 = op2->i;
9342
9343 exp->type = 2;
9344 exp->string = PrintInt(op1->i && value2);
9345 if(!exp->expType)
9346 {
9347 exp->expType = op1->type;
9348 if(op1->type)
9349 op1->type->refCount++;
9350 }
9351 return 0x1;
9352 }
9353
9354 static unsigned int UIntAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9355 {
9356 unsigned int value2 = op2->ui;
9357
9358 exp->type = 2;
9359 exp->string = PrintUInt(op1->ui && value2);
9360 if(!exp->expType)
9361 {
9362 exp->expType = op1->type;
9363 if(op1->type)
9364 op1->type->refCount++;
9365 }
9366 return 0x1;
9367 }
9368
9369 static unsigned int Int64And(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9370 {
9371 int value2 = op2->i;
9372
9373 exp->type = 2;
9374 exp->string = PrintInt64(op1->i && value2);
9375 if(!exp->expType)
9376 {
9377 exp->expType = op1->type;
9378 if(op1->type)
9379 op1->type->refCount++;
9380 }
9381 return 0x1;
9382 }
9383
9384 static unsigned int UInt64And(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9385 {
9386 unsigned int value2 = op2->ui;
9387
9388 exp->type = 2;
9389 exp->string = PrintUInt64(op1->ui && value2);
9390 if(!exp->expType)
9391 {
9392 exp->expType = op1->type;
9393 if(op1->type)
9394 op1->type->refCount++;
9395 }
9396 return 0x1;
9397 }
9398
9399 static unsigned int ShortAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9400 {
9401 short value2 = op2->s;
9402
9403 exp->type = 2;
9404 exp->string = PrintShort(op1->s && value2);
9405 if(!exp->expType)
9406 {
9407 exp->expType = op1->type;
9408 if(op1->type)
9409 op1->type->refCount++;
9410 }
9411 return 0x1;
9412 }
9413
9414 static unsigned int UShortAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9415 {
9416 unsigned short value2 = op2->us;
9417
9418 exp->type = 2;
9419 exp->string = PrintUShort(op1->us && value2);
9420 if(!exp->expType)
9421 {
9422 exp->expType = op1->type;
9423 if(op1->type)
9424 op1->type->refCount++;
9425 }
9426 return 0x1;
9427 }
9428
9429 static unsigned int CharAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9430 {
9431 char value2 = op2->c;
9432
9433 exp->type = 2;
9434 exp->string = PrintChar(op1->c && value2);
9435 if(!exp->expType)
9436 {
9437 exp->expType = op1->type;
9438 if(op1->type)
9439 op1->type->refCount++;
9440 }
9441 return 0x1;
9442 }
9443
9444 static unsigned int UCharAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9445 {
9446 unsigned char value2 = op2->uc;
9447
9448 exp->type = 2;
9449 exp->string = PrintUChar(op1->uc && value2);
9450 if(!exp->expType)
9451 {
9452 exp->expType = op1->type;
9453 if(op1->type)
9454 op1->type->refCount++;
9455 }
9456 return 0x1;
9457 }
9458
9459 static unsigned int FloatAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9460 {
9461 float value2 = op2->f;
9462
9463 exp->type = 2;
9464 exp->string = PrintFloat(op1->f && value2);
9465 if(!exp->expType)
9466 {
9467 exp->expType = op1->type;
9468 if(op1->type)
9469 op1->type->refCount++;
9470 }
9471 return 0x1;
9472 }
9473
9474 static unsigned int DoubleAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9475 {
9476 double value2 = op2->d;
9477
9478 exp->type = 2;
9479 exp->string = PrintDouble(op1->d && value2);
9480 if(!exp->expType)
9481 {
9482 exp->expType = op1->type;
9483 if(op1->type)
9484 op1->type->refCount++;
9485 }
9486 return 0x1;
9487 }
9488
9489 static unsigned int IntOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9490 {
9491 int value2 = op2->i;
9492
9493 exp->type = 2;
9494 exp->string = PrintInt(op1->i || value2);
9495 if(!exp->expType)
9496 {
9497 exp->expType = op1->type;
9498 if(op1->type)
9499 op1->type->refCount++;
9500 }
9501 return 0x1;
9502 }
9503
9504 static unsigned int UIntOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9505 {
9506 unsigned int value2 = op2->ui;
9507
9508 exp->type = 2;
9509 exp->string = PrintUInt(op1->ui || value2);
9510 if(!exp->expType)
9511 {
9512 exp->expType = op1->type;
9513 if(op1->type)
9514 op1->type->refCount++;
9515 }
9516 return 0x1;
9517 }
9518
9519 static unsigned int Int64Or(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9520 {
9521 int value2 = op2->i;
9522
9523 exp->type = 2;
9524 exp->string = PrintInt64(op1->i || value2);
9525 if(!exp->expType)
9526 {
9527 exp->expType = op1->type;
9528 if(op1->type)
9529 op1->type->refCount++;
9530 }
9531 return 0x1;
9532 }
9533
9534 static unsigned int UInt64Or(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9535 {
9536 unsigned int value2 = op2->ui;
9537
9538 exp->type = 2;
9539 exp->string = PrintUInt64(op1->ui || value2);
9540 if(!exp->expType)
9541 {
9542 exp->expType = op1->type;
9543 if(op1->type)
9544 op1->type->refCount++;
9545 }
9546 return 0x1;
9547 }
9548
9549 static unsigned int ShortOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9550 {
9551 short value2 = op2->s;
9552
9553 exp->type = 2;
9554 exp->string = PrintShort(op1->s || value2);
9555 if(!exp->expType)
9556 {
9557 exp->expType = op1->type;
9558 if(op1->type)
9559 op1->type->refCount++;
9560 }
9561 return 0x1;
9562 }
9563
9564 static unsigned int UShortOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9565 {
9566 unsigned short value2 = op2->us;
9567
9568 exp->type = 2;
9569 exp->string = PrintUShort(op1->us || value2);
9570 if(!exp->expType)
9571 {
9572 exp->expType = op1->type;
9573 if(op1->type)
9574 op1->type->refCount++;
9575 }
9576 return 0x1;
9577 }
9578
9579 static unsigned int CharOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9580 {
9581 char value2 = op2->c;
9582
9583 exp->type = 2;
9584 exp->string = PrintChar(op1->c || value2);
9585 if(!exp->expType)
9586 {
9587 exp->expType = op1->type;
9588 if(op1->type)
9589 op1->type->refCount++;
9590 }
9591 return 0x1;
9592 }
9593
9594 static unsigned int UCharOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9595 {
9596 unsigned char value2 = op2->uc;
9597
9598 exp->type = 2;
9599 exp->string = PrintUChar(op1->uc || value2);
9600 if(!exp->expType)
9601 {
9602 exp->expType = op1->type;
9603 if(op1->type)
9604 op1->type->refCount++;
9605 }
9606 return 0x1;
9607 }
9608
9609 static unsigned int FloatOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9610 {
9611 float value2 = op2->f;
9612
9613 exp->type = 2;
9614 exp->string = PrintFloat(op1->f || value2);
9615 if(!exp->expType)
9616 {
9617 exp->expType = op1->type;
9618 if(op1->type)
9619 op1->type->refCount++;
9620 }
9621 return 0x1;
9622 }
9623
9624 static unsigned int DoubleOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9625 {
9626 double value2 = op2->d;
9627
9628 exp->type = 2;
9629 exp->string = PrintDouble(op1->d || value2);
9630 if(!exp->expType)
9631 {
9632 exp->expType = op1->type;
9633 if(op1->type)
9634 op1->type->refCount++;
9635 }
9636 return 0x1;
9637 }
9638
9639 static unsigned int IntGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9640 {
9641 int value2 = op2->i;
9642
9643 exp->type = 2;
9644 exp->string = PrintInt(op1->i > value2);
9645 if(!exp->expType)
9646 {
9647 exp->expType = op1->type;
9648 if(op1->type)
9649 op1->type->refCount++;
9650 }
9651 return 0x1;
9652 }
9653
9654 static unsigned int UIntGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9655 {
9656 unsigned int value2 = op2->ui;
9657
9658 exp->type = 2;
9659 exp->string = PrintUInt(op1->ui > value2);
9660 if(!exp->expType)
9661 {
9662 exp->expType = op1->type;
9663 if(op1->type)
9664 op1->type->refCount++;
9665 }
9666 return 0x1;
9667 }
9668
9669 static unsigned int Int64Grt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9670 {
9671 int value2 = op2->i;
9672
9673 exp->type = 2;
9674 exp->string = PrintInt64(op1->i > value2);
9675 if(!exp->expType)
9676 {
9677 exp->expType = op1->type;
9678 if(op1->type)
9679 op1->type->refCount++;
9680 }
9681 return 0x1;
9682 }
9683
9684 static unsigned int UInt64Grt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9685 {
9686 unsigned int value2 = op2->ui;
9687
9688 exp->type = 2;
9689 exp->string = PrintUInt64(op1->ui > value2);
9690 if(!exp->expType)
9691 {
9692 exp->expType = op1->type;
9693 if(op1->type)
9694 op1->type->refCount++;
9695 }
9696 return 0x1;
9697 }
9698
9699 static unsigned int ShortGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9700 {
9701 short value2 = op2->s;
9702
9703 exp->type = 2;
9704 exp->string = PrintShort(op1->s > value2);
9705 if(!exp->expType)
9706 {
9707 exp->expType = op1->type;
9708 if(op1->type)
9709 op1->type->refCount++;
9710 }
9711 return 0x1;
9712 }
9713
9714 static unsigned int UShortGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9715 {
9716 unsigned short value2 = op2->us;
9717
9718 exp->type = 2;
9719 exp->string = PrintUShort(op1->us > value2);
9720 if(!exp->expType)
9721 {
9722 exp->expType = op1->type;
9723 if(op1->type)
9724 op1->type->refCount++;
9725 }
9726 return 0x1;
9727 }
9728
9729 static unsigned int CharGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9730 {
9731 char value2 = op2->c;
9732
9733 exp->type = 2;
9734 exp->string = PrintChar(op1->c > value2);
9735 if(!exp->expType)
9736 {
9737 exp->expType = op1->type;
9738 if(op1->type)
9739 op1->type->refCount++;
9740 }
9741 return 0x1;
9742 }
9743
9744 static unsigned int UCharGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9745 {
9746 unsigned char value2 = op2->uc;
9747
9748 exp->type = 2;
9749 exp->string = PrintUChar(op1->uc > value2);
9750 if(!exp->expType)
9751 {
9752 exp->expType = op1->type;
9753 if(op1->type)
9754 op1->type->refCount++;
9755 }
9756 return 0x1;
9757 }
9758
9759 static unsigned int FloatGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9760 {
9761 float value2 = op2->f;
9762
9763 exp->type = 2;
9764 exp->string = PrintFloat(op1->f > value2);
9765 if(!exp->expType)
9766 {
9767 exp->expType = op1->type;
9768 if(op1->type)
9769 op1->type->refCount++;
9770 }
9771 return 0x1;
9772 }
9773
9774 static unsigned int DoubleGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9775 {
9776 double value2 = op2->d;
9777
9778 exp->type = 2;
9779 exp->string = PrintDouble(op1->d > value2);
9780 if(!exp->expType)
9781 {
9782 exp->expType = op1->type;
9783 if(op1->type)
9784 op1->type->refCount++;
9785 }
9786 return 0x1;
9787 }
9788
9789 static unsigned int IntSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9790 {
9791 int value2 = op2->i;
9792
9793 exp->type = 2;
9794 exp->string = PrintInt(op1->i < value2);
9795 if(!exp->expType)
9796 {
9797 exp->expType = op1->type;
9798 if(op1->type)
9799 op1->type->refCount++;
9800 }
9801 return 0x1;
9802 }
9803
9804 static unsigned int UIntSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9805 {
9806 unsigned int value2 = op2->ui;
9807
9808 exp->type = 2;
9809 exp->string = PrintUInt(op1->ui < value2);
9810 if(!exp->expType)
9811 {
9812 exp->expType = op1->type;
9813 if(op1->type)
9814 op1->type->refCount++;
9815 }
9816 return 0x1;
9817 }
9818
9819 static unsigned int Int64Sma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9820 {
9821 int value2 = op2->i;
9822
9823 exp->type = 2;
9824 exp->string = PrintInt64(op1->i < value2);
9825 if(!exp->expType)
9826 {
9827 exp->expType = op1->type;
9828 if(op1->type)
9829 op1->type->refCount++;
9830 }
9831 return 0x1;
9832 }
9833
9834 static unsigned int UInt64Sma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9835 {
9836 unsigned int value2 = op2->ui;
9837
9838 exp->type = 2;
9839 exp->string = PrintUInt64(op1->ui < value2);
9840 if(!exp->expType)
9841 {
9842 exp->expType = op1->type;
9843 if(op1->type)
9844 op1->type->refCount++;
9845 }
9846 return 0x1;
9847 }
9848
9849 static unsigned int ShortSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9850 {
9851 short value2 = op2->s;
9852
9853 exp->type = 2;
9854 exp->string = PrintShort(op1->s < value2);
9855 if(!exp->expType)
9856 {
9857 exp->expType = op1->type;
9858 if(op1->type)
9859 op1->type->refCount++;
9860 }
9861 return 0x1;
9862 }
9863
9864 static unsigned int UShortSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9865 {
9866 unsigned short value2 = op2->us;
9867
9868 exp->type = 2;
9869 exp->string = PrintUShort(op1->us < value2);
9870 if(!exp->expType)
9871 {
9872 exp->expType = op1->type;
9873 if(op1->type)
9874 op1->type->refCount++;
9875 }
9876 return 0x1;
9877 }
9878
9879 static unsigned int CharSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9880 {
9881 char value2 = op2->c;
9882
9883 exp->type = 2;
9884 exp->string = PrintChar(op1->c < value2);
9885 if(!exp->expType)
9886 {
9887 exp->expType = op1->type;
9888 if(op1->type)
9889 op1->type->refCount++;
9890 }
9891 return 0x1;
9892 }
9893
9894 static unsigned int UCharSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9895 {
9896 unsigned char value2 = op2->uc;
9897
9898 exp->type = 2;
9899 exp->string = PrintUChar(op1->uc < value2);
9900 if(!exp->expType)
9901 {
9902 exp->expType = op1->type;
9903 if(op1->type)
9904 op1->type->refCount++;
9905 }
9906 return 0x1;
9907 }
9908
9909 static unsigned int FloatSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9910 {
9911 float value2 = op2->f;
9912
9913 exp->type = 2;
9914 exp->string = PrintFloat(op1->f < value2);
9915 if(!exp->expType)
9916 {
9917 exp->expType = op1->type;
9918 if(op1->type)
9919 op1->type->refCount++;
9920 }
9921 return 0x1;
9922 }
9923
9924 static unsigned int DoubleSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9925 {
9926 double value2 = op2->d;
9927
9928 exp->type = 2;
9929 exp->string = PrintDouble(op1->d < value2);
9930 if(!exp->expType)
9931 {
9932 exp->expType = op1->type;
9933 if(op1->type)
9934 op1->type->refCount++;
9935 }
9936 return 0x1;
9937 }
9938
9939 static unsigned int IntGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9940 {
9941 int value2 = op2->i;
9942
9943 exp->type = 2;
9944 exp->string = PrintInt(op1->i >= value2);
9945 if(!exp->expType)
9946 {
9947 exp->expType = op1->type;
9948 if(op1->type)
9949 op1->type->refCount++;
9950 }
9951 return 0x1;
9952 }
9953
9954 static unsigned int UIntGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9955 {
9956 unsigned int value2 = op2->ui;
9957
9958 exp->type = 2;
9959 exp->string = PrintUInt(op1->ui >= value2);
9960 if(!exp->expType)
9961 {
9962 exp->expType = op1->type;
9963 if(op1->type)
9964 op1->type->refCount++;
9965 }
9966 return 0x1;
9967 }
9968
9969 static unsigned int Int64GrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9970 {
9971 int value2 = op2->i;
9972
9973 exp->type = 2;
9974 exp->string = PrintInt64(op1->i >= value2);
9975 if(!exp->expType)
9976 {
9977 exp->expType = op1->type;
9978 if(op1->type)
9979 op1->type->refCount++;
9980 }
9981 return 0x1;
9982 }
9983
9984 static unsigned int UInt64GrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9985 {
9986 unsigned int value2 = op2->ui;
9987
9988 exp->type = 2;
9989 exp->string = PrintUInt64(op1->ui >= value2);
9990 if(!exp->expType)
9991 {
9992 exp->expType = op1->type;
9993 if(op1->type)
9994 op1->type->refCount++;
9995 }
9996 return 0x1;
9997 }
9998
9999 static unsigned int ShortGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10000 {
10001 short value2 = op2->s;
10002
10003 exp->type = 2;
10004 exp->string = PrintShort(op1->s >= value2);
10005 if(!exp->expType)
10006 {
10007 exp->expType = op1->type;
10008 if(op1->type)
10009 op1->type->refCount++;
10010 }
10011 return 0x1;
10012 }
10013
10014 static unsigned int UShortGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10015 {
10016 unsigned short value2 = op2->us;
10017
10018 exp->type = 2;
10019 exp->string = PrintUShort(op1->us >= value2);
10020 if(!exp->expType)
10021 {
10022 exp->expType = op1->type;
10023 if(op1->type)
10024 op1->type->refCount++;
10025 }
10026 return 0x1;
10027 }
10028
10029 static unsigned int CharGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10030 {
10031 char value2 = op2->c;
10032
10033 exp->type = 2;
10034 exp->string = PrintChar(op1->c >= value2);
10035 if(!exp->expType)
10036 {
10037 exp->expType = op1->type;
10038 if(op1->type)
10039 op1->type->refCount++;
10040 }
10041 return 0x1;
10042 }
10043
10044 static unsigned int UCharGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10045 {
10046 unsigned char value2 = op2->uc;
10047
10048 exp->type = 2;
10049 exp->string = PrintUChar(op1->uc >= value2);
10050 if(!exp->expType)
10051 {
10052 exp->expType = op1->type;
10053 if(op1->type)
10054 op1->type->refCount++;
10055 }
10056 return 0x1;
10057 }
10058
10059 static unsigned int FloatGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10060 {
10061 float value2 = op2->f;
10062
10063 exp->type = 2;
10064 exp->string = PrintFloat(op1->f >= value2);
10065 if(!exp->expType)
10066 {
10067 exp->expType = op1->type;
10068 if(op1->type)
10069 op1->type->refCount++;
10070 }
10071 return 0x1;
10072 }
10073
10074 static unsigned int DoubleGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10075 {
10076 double value2 = op2->d;
10077
10078 exp->type = 2;
10079 exp->string = PrintDouble(op1->d >= value2);
10080 if(!exp->expType)
10081 {
10082 exp->expType = op1->type;
10083 if(op1->type)
10084 op1->type->refCount++;
10085 }
10086 return 0x1;
10087 }
10088
10089 static unsigned int IntSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10090 {
10091 int value2 = op2->i;
10092
10093 exp->type = 2;
10094 exp->string = PrintInt(op1->i <= value2);
10095 if(!exp->expType)
10096 {
10097 exp->expType = op1->type;
10098 if(op1->type)
10099 op1->type->refCount++;
10100 }
10101 return 0x1;
10102 }
10103
10104 static unsigned int UIntSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10105 {
10106 unsigned int value2 = op2->ui;
10107
10108 exp->type = 2;
10109 exp->string = PrintUInt(op1->ui <= value2);
10110 if(!exp->expType)
10111 {
10112 exp->expType = op1->type;
10113 if(op1->type)
10114 op1->type->refCount++;
10115 }
10116 return 0x1;
10117 }
10118
10119 static unsigned int Int64SmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10120 {
10121 int value2 = op2->i;
10122
10123 exp->type = 2;
10124 exp->string = PrintInt64(op1->i <= value2);
10125 if(!exp->expType)
10126 {
10127 exp->expType = op1->type;
10128 if(op1->type)
10129 op1->type->refCount++;
10130 }
10131 return 0x1;
10132 }
10133
10134 static unsigned int UInt64SmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10135 {
10136 unsigned int value2 = op2->ui;
10137
10138 exp->type = 2;
10139 exp->string = PrintUInt64(op1->ui <= value2);
10140 if(!exp->expType)
10141 {
10142 exp->expType = op1->type;
10143 if(op1->type)
10144 op1->type->refCount++;
10145 }
10146 return 0x1;
10147 }
10148
10149 static unsigned int ShortSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10150 {
10151 short value2 = op2->s;
10152
10153 exp->type = 2;
10154 exp->string = PrintShort(op1->s <= value2);
10155 if(!exp->expType)
10156 {
10157 exp->expType = op1->type;
10158 if(op1->type)
10159 op1->type->refCount++;
10160 }
10161 return 0x1;
10162 }
10163
10164 static unsigned int UShortSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10165 {
10166 unsigned short value2 = op2->us;
10167
10168 exp->type = 2;
10169 exp->string = PrintUShort(op1->us <= value2);
10170 if(!exp->expType)
10171 {
10172 exp->expType = op1->type;
10173 if(op1->type)
10174 op1->type->refCount++;
10175 }
10176 return 0x1;
10177 }
10178
10179 static unsigned int CharSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10180 {
10181 char value2 = op2->c;
10182
10183 exp->type = 2;
10184 exp->string = PrintChar(op1->c <= value2);
10185 if(!exp->expType)
10186 {
10187 exp->expType = op1->type;
10188 if(op1->type)
10189 op1->type->refCount++;
10190 }
10191 return 0x1;
10192 }
10193
10194 static unsigned int UCharSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10195 {
10196 unsigned char value2 = op2->uc;
10197
10198 exp->type = 2;
10199 exp->string = PrintUChar(op1->uc <= value2);
10200 if(!exp->expType)
10201 {
10202 exp->expType = op1->type;
10203 if(op1->type)
10204 op1->type->refCount++;
10205 }
10206 return 0x1;
10207 }
10208
10209 static unsigned int FloatSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10210 {
10211 float value2 = op2->f;
10212
10213 exp->type = 2;
10214 exp->string = PrintFloat(op1->f <= value2);
10215 if(!exp->expType)
10216 {
10217 exp->expType = op1->type;
10218 if(op1->type)
10219 op1->type->refCount++;
10220 }
10221 return 0x1;
10222 }
10223
10224 static unsigned int DoubleSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10225 {
10226 double value2 = op2->d;
10227
10228 exp->type = 2;
10229 exp->string = PrintDouble(op1->d <= value2);
10230 if(!exp->expType)
10231 {
10232 exp->expType = op1->type;
10233 if(op1->type)
10234 op1->type->refCount++;
10235 }
10236 return 0x1;
10237 }
10238
10239 static unsigned int IntCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10240 {
10241 exp->type = 2;
10242 exp->string = PrintInt(op1->i ? op2->i : op3->i);
10243 if(!exp->expType)
10244 {
10245 exp->expType = op1->type;
10246 if(op1->type)
10247 op1->type->refCount++;
10248 }
10249 return 0x1;
10250 }
10251
10252 static unsigned int UIntCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10253 {
10254 exp->type = 2;
10255 exp->string = PrintUInt(op1->ui ? op2->ui : op3->ui);
10256 if(!exp->expType)
10257 {
10258 exp->expType = op1->type;
10259 if(op1->type)
10260 op1->type->refCount++;
10261 }
10262 return 0x1;
10263 }
10264
10265 static unsigned int Int64Cond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10266 {
10267 exp->type = 2;
10268 exp->string = PrintInt64(op1->i ? op2->i : op3->i);
10269 if(!exp->expType)
10270 {
10271 exp->expType = op1->type;
10272 if(op1->type)
10273 op1->type->refCount++;
10274 }
10275 return 0x1;
10276 }
10277
10278 static unsigned int UInt64Cond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10279 {
10280 exp->type = 2;
10281 exp->string = PrintUInt64(op1->ui ? op2->ui : op3->ui);
10282 if(!exp->expType)
10283 {
10284 exp->expType = op1->type;
10285 if(op1->type)
10286 op1->type->refCount++;
10287 }
10288 return 0x1;
10289 }
10290
10291 static unsigned int ShortCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10292 {
10293 exp->type = 2;
10294 exp->string = PrintShort(op1->s ? op2->s : op3->s);
10295 if(!exp->expType)
10296 {
10297 exp->expType = op1->type;
10298 if(op1->type)
10299 op1->type->refCount++;
10300 }
10301 return 0x1;
10302 }
10303
10304 static unsigned int UShortCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10305 {
10306 exp->type = 2;
10307 exp->string = PrintUShort(op1->us ? op2->us : op3->us);
10308 if(!exp->expType)
10309 {
10310 exp->expType = op1->type;
10311 if(op1->type)
10312 op1->type->refCount++;
10313 }
10314 return 0x1;
10315 }
10316
10317 static unsigned int CharCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10318 {
10319 exp->type = 2;
10320 exp->string = PrintChar(op1->c ? op2->c : op3->c);
10321 if(!exp->expType)
10322 {
10323 exp->expType = op1->type;
10324 if(op1->type)
10325 op1->type->refCount++;
10326 }
10327 return 0x1;
10328 }
10329
10330 static unsigned int UCharCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10331 {
10332 exp->type = 2;
10333 exp->string = PrintUChar(op1->uc ? op2->uc : op3->uc);
10334 if(!exp->expType)
10335 {
10336 exp->expType = op1->type;
10337 if(op1->type)
10338 op1->type->refCount++;
10339 }
10340 return 0x1;
10341 }
10342
10343 static unsigned int FloatCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10344 {
10345 exp->type = 2;
10346 exp->string = PrintFloat(op1->f ? op2->f : op3->f);
10347 if(!exp->expType)
10348 {
10349 exp->expType = op1->type;
10350 if(op1->type)
10351 op1->type->refCount++;
10352 }
10353 return 0x1;
10354 }
10355
10356 static unsigned int DoubleCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10357 {
10358 exp->type = 2;
10359 exp->string = PrintDouble(op1->d ? op2->d : op3->d);
10360 if(!exp->expType)
10361 {
10362 exp->expType = op1->type;
10363 if(op1->type)
10364 op1->type->refCount++;
10365 }
10366 return 0x1;
10367 }
10368
10369 struct OpTable intOps = 
10370 {
10371 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
10372 };
10373
10374 struct OpTable uintOps = 
10375 {
10376 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
10377 };
10378
10379 struct OpTable int64Ops = 
10380 {
10381 Int64Add, Int64Sub, Int64Mul, Int64Div, Int64Mod, Int64Neg, Int64Inc, Int64Dec, Int64Asign, Int64AddAsign, Int64SubAsign, Int64MulAsign, Int64DivAsign, Int64ModAsign, Int64BitAnd, Int64BitOr, Int64BitXor, Int64LShift, Int64RShift, Int64BitNot, Int64AndAsign, Int64OrAsign, Int64XorAsign, Int64LShiftAsign, Int64RShiftAsign, Int64Not, Int64Equ, Int64Nqu, Int64And, Int64Or, Int64Grt, Int64Sma, Int64GrtEqu, Int64SmaEqu, Int64Cond
10382 };
10383
10384 struct OpTable uint64Ops = 
10385 {
10386 UInt64Add, UInt64Sub, UInt64Mul, UInt64Div, UInt64Mod, UInt64Neg, UInt64Inc, UInt64Dec, UInt64Asign, UInt64AddAsign, UInt64SubAsign, UInt64MulAsign, UInt64DivAsign, UInt64ModAsign, UInt64BitAnd, UInt64BitOr, UInt64BitXor, UInt64LShift, UInt64RShift, UInt64BitNot, UInt64AndAsign, UInt64OrAsign, UInt64XorAsign, UInt64LShiftAsign, UInt64RShiftAsign, UInt64Not, UInt64Equ, UInt64Nqu, UInt64And, UInt64Or, UInt64Grt, UInt64Sma, UInt64GrtEqu, UInt64SmaEqu, UInt64Cond
10387 };
10388
10389 struct OpTable shortOps = 
10390 {
10391 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
10392 };
10393
10394 struct OpTable ushortOps = 
10395 {
10396 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
10397 };
10398
10399 struct OpTable floatOps = 
10400 {
10401 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
10402 };
10403
10404 struct OpTable doubleOps = 
10405 {
10406 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
10407 };
10408
10409 struct OpTable charOps = 
10410 {
10411 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
10412 };
10413
10414 struct OpTable ucharOps = 
10415 {
10416 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
10417 };
10418
10419 void ReadString(char * output, char * string)
10420 {
10421 int len = strlen(string);
10422 int c, d = 0;
10423 unsigned int quoted = 0x0, escaped = 0x0;
10424
10425 for(c = 0; c < len; c++)
10426 {
10427 char ch = string[c];
10428
10429 if(escaped)
10430 {
10431 switch(ch)
10432 {
10433 case 'n':
10434 output[d] = '\n';
10435 break;
10436 case 't':
10437 output[d] = '\t';
10438 break;
10439 case 'a':
10440 output[d] = '\a';
10441 break;
10442 case 'b':
10443 output[d] = '\b';
10444 break;
10445 case 'f':
10446 output[d] = '\f';
10447 break;
10448 case 'r':
10449 output[d] = '\r';
10450 break;
10451 case 'v':
10452 output[d] = '\v';
10453 break;
10454 case '\\':
10455 output[d] = '\\';
10456 break;
10457 case '\"':
10458 output[d] = '\"';
10459 break;
10460 default:
10461 output[d++] = '\\';
10462 output[d] = ch;
10463 }
10464 d++;
10465 escaped = 0x0;
10466 }
10467 else
10468 {
10469 if(ch == '\"')
10470 quoted ^= 0x1;
10471 else if(quoted)
10472 {
10473 if(ch == '\\')
10474 escaped = 0x1;
10475 else
10476 output[d++] = ch;
10477 }
10478 }
10479 }
10480 output[d] = '\0';
10481 }
10482
10483 extern long long __ecereNameSpace__ecere__com___strtoi64(char *  string, char * *  endString, int base);
10484
10485 extern uint64 __ecereNameSpace__ecere__com___strtoui64(char *  string, char * *  endString, int base);
10486
10487 extern double strtod(char * , char * * );
10488
10489 struct Operand GetOperand(struct Expression * exp)
10490 {
10491 struct Operand op = 
10492 {
10493 0, 0, 0, 0, 
10494 {
10495 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
10496 }
10497 };
10498 struct Type * type = exp->expType;
10499
10500 if(type)
10501 {
10502 while(type->kind == 8 && type->_class->registered && (type->_class->registered->type == 2 || type->_class->registered->type == 3 || type->_class->registered->type == 4))
10503 {
10504 if(!type->_class->registered->dataType)
10505 type->_class->registered->dataType = ProcessTypeString(type->_class->registered->dataTypeString, 0x0);
10506 type = type->_class->registered->dataType;
10507 }
10508 op.kind = type->kind;
10509 op.type = exp->expType;
10510 if(exp->isConstant && exp->type == 2)
10511 {
10512 switch(op.kind)
10513 {
10514 case 24:
10515 case 1:
10516 {
10517 if(exp->constant[0] == '\'')
10518 op.c = exp->constant[1];
10519 else if(type->isSigned)
10520 {
10521 op.c = (char)strtol(exp->constant, (((void *)0)), 0);
10522 op.ops = charOps;
10523 }
10524 else
10525 {
10526 op.uc = (unsigned char)strtoul(exp->constant, (((void *)0)), 0);
10527 op.ops = ucharOps;
10528 }
10529 break;
10530 }
10531 case 2:
10532 if(type->isSigned)
10533 {
10534 op.s = (short)strtol(exp->constant, (((void *)0)), 0);
10535 op.ops = shortOps;
10536 }
10537 else
10538 {
10539 op.us = (unsigned short)strtoul(exp->constant, (((void *)0)), 0);
10540 op.ops = ushortOps;
10541 }
10542 break;
10543 case 3:
10544 case 5:
10545 if(type->isSigned)
10546 {
10547 op.i = strtol(exp->constant, (((void *)0)), 0);
10548 op.ops = intOps;
10549 }
10550 else
10551 {
10552 op.ui = strtoul(exp->constant, (((void *)0)), 0);
10553 op.ops = uintOps;
10554 }
10555 op.kind = 3;
10556 break;
10557 case 4:
10558 if(type->isSigned)
10559 {
10560 op.i64 = __ecereNameSpace__ecere__com___strtoi64(exp->constant, (((void *)0)), 0);
10561 op.ops = intOps;
10562 }
10563 else
10564 {
10565 op.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->constant, (((void *)0)), 0);
10566 op.ops = uintOps;
10567 }
10568 op.kind = 4;
10569 break;
10570 case 22:
10571 if(type->isSigned)
10572 {
10573 op.i64 = __ecereNameSpace__ecere__com___strtoi64(exp->constant, (((void *)0)), 0);
10574 op.ops = int64Ops;
10575 }
10576 else
10577 {
10578 op.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->constant, (((void *)0)), 0);
10579 op.ops = uint64Ops;
10580 }
10581 op.kind = 4;
10582 break;
10583 case 23:
10584 if(type->isSigned)
10585 {
10586 op.i64 = __ecereNameSpace__ecere__com___strtoi64(exp->constant, (((void *)0)), 0);
10587 op.ops = int64Ops;
10588 }
10589 else
10590 {
10591 op.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->constant, (((void *)0)), 0);
10592 op.ops = uint64Ops;
10593 }
10594 op.kind = 4;
10595 break;
10596 case 6:
10597 op.f = (float)strtod(exp->constant, (((void *)0)));
10598 op.ops = floatOps;
10599 break;
10600 case 7:
10601 op.d = (double)strtod(exp->constant, (((void *)0)));
10602 op.ops = doubleOps;
10603 break;
10604 case 12:
10605 case 13:
10606 case 8:
10607 op.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->constant, (((void *)0)), 0);
10608 op.kind = 13;
10609 op.ops = uintOps;
10610 break;
10611 }
10612 }
10613 }
10614 return op;
10615 }
10616
10617 int __ecereVMethodID_class_OnGetString;
10618
10619 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_int;
10620
10621 static void UnusedFunction()
10622 {
10623 int a;
10624
10625 ((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);
10626 }
10627
10628 extern int __ecereVMethodID_class_OnGetString;
10629
10630 static void PopulateInstanceProcessMember(struct Instantiation * inst, struct __ecereNameSpace__ecere__sys__OldList * memberList, struct __ecereNameSpace__ecere__com__DataMember * parentDataMember, unsigned int offset)
10631 {
10632 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
10633
10634 for(dataMember = parentDataMember->members.first; dataMember; dataMember = dataMember->next)
10635 {
10636 if(!dataMember->name && (dataMember->type == 2 || dataMember->type == 1))
10637 PopulateInstanceProcessMember(inst, memberList, dataMember, offset + dataMember->offset);
10638 else
10639 {
10640 struct Expression * exp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
10641 struct MemberInit * member = MkMemberInit(MkListOne(MkIdentifier(dataMember->name)), MkInitializerAssignment(exp));
10642 struct Type * type;
10643 void * ptr = inst->data + dataMember->offset + offset;
10644 char * result = (((void *)0));
10645
10646 exp->loc = member->loc = inst->loc;
10647 ((struct Identifier *)(*member->identifiers).first)->loc = inst->loc;
10648 if(!dataMember->dataType)
10649 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
10650 type = dataMember->dataType;
10651 if(type->kind == 8)
10652 {
10653 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
10654
10655 if(_class->type == 4)
10656 {
10657 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
10658
10659 if(enumClass)
10660 {
10661 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
10662 struct __ecereNameSpace__ecere__sys__NamedLink * item;
10663
10664 for(item = e->values.first; item; item = item->next)
10665 {
10666 if((int)item->data == *(int *)ptr)
10667 {
10668 result = item->name;
10669 break;
10670 }
10671 }
10672 if(result)
10673 {
10674 exp->identifier = MkIdentifier(result);
10675 exp->type = 0;
10676 exp->destType = MkClassType(_class->fullName);
10677 ProcessExpressionType(exp);
10678 }
10679 }
10680 }
10681 if(_class->type == 4 || _class->type == 3 || _class->type == 2)
10682 {
10683 if(!_class->dataType)
10684 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
10685 type = _class->dataType;
10686 }
10687 }
10688 if(!result)
10689 {
10690 switch(type->kind)
10691 {
10692 case 6:
10693 {
10694 FreeExpContents(exp);
10695 exp->constant = PrintFloat(*(float *)ptr);
10696 exp->type = 2;
10697 break;
10698 }
10699 case 7:
10700 {
10701 FreeExpContents(exp);
10702 exp->constant = PrintDouble(*(double *)ptr);
10703 exp->type = 2;
10704 break;
10705 }
10706 case 3:
10707 {
10708 FreeExpContents(exp);
10709 exp->constant = PrintInt(*(int *)ptr);
10710 exp->type = 2;
10711 break;
10712 }
10713 case 4:
10714 {
10715 FreeExpContents(exp);
10716 exp->constant = PrintInt64(*(long long *)ptr);
10717 exp->type = 2;
10718 break;
10719 }
10720 case 22:
10721 {
10722 FreeExpContents(exp);
10723 exp->constant = PrintInt64((long long)*(intptr_t *)ptr);
10724 exp->type = 2;
10725 break;
10726 }
10727 case 23:
10728 {
10729 FreeExpContents(exp);
10730 exp->constant = PrintInt64((long long)*(intptr_t *)ptr);
10731 exp->type = 2;
10732 break;
10733 }
10734 default:
10735 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Unhandled type populating instance\n", (((void *)0))));
10736 }
10737 }
10738 ListAdd(memberList, member);
10739 }
10740 if(parentDataMember->type == 1)
10741 break;
10742 }
10743 }
10744
10745 extern struct MembersInit * MkMembersInitList(struct __ecereNameSpace__ecere__sys__OldList * dataMembers);
10746
10747 void PopulateInstance(struct Instantiation * inst)
10748 {
10749 struct Symbol * classSym = inst->_class->symbol;
10750 struct __ecereNameSpace__ecere__com__Class * _class = classSym->registered;
10751 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
10752 struct __ecereNameSpace__ecere__sys__OldList * memberList = MkList();
10753
10754 if(!inst->members)
10755 inst->members = MkListOne(MkMembersInitList(memberList));
10756 else
10757 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*inst->members), MkMembersInitList(memberList));
10758 for(dataMember = _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
10759 {
10760 if(!dataMember->isProperty)
10761 {
10762 if(!dataMember->name && (dataMember->type == 2 || dataMember->type == 1))
10763 PopulateInstanceProcessMember(inst, memberList, dataMember, dataMember->offset);
10764 else
10765 {
10766 struct Expression * exp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
10767 struct MemberInit * member = MkMemberInit(MkListOne(MkIdentifier(dataMember->name)), MkInitializerAssignment(exp));
10768 struct Type * type;
10769 void * ptr = inst->data + dataMember->offset;
10770 char * result = (((void *)0));
10771
10772 exp->loc = member->loc = inst->loc;
10773 ((struct Identifier *)(*member->identifiers).first)->loc = inst->loc;
10774 if(!dataMember->dataType)
10775 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
10776 type = dataMember->dataType;
10777 if(type->kind == 8)
10778 {
10779 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
10780
10781 if(_class->type == 4)
10782 {
10783 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
10784
10785 if(enumClass)
10786 {
10787 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
10788 struct __ecereNameSpace__ecere__sys__NamedLink * item;
10789
10790 for(item = e->values.first; item; item = item->next)
10791 {
10792 if((int)item->data == *(int *)ptr)
10793 {
10794 result = item->name;
10795 break;
10796 }
10797 }
10798 }
10799 if(result)
10800 {
10801 exp->identifier = MkIdentifier(result);
10802 exp->type = 0;
10803 exp->destType = MkClassType(_class->fullName);
10804 ProcessExpressionType(exp);
10805 }
10806 }
10807 if(_class->type == 4 || _class->type == 3 || _class->type == 2)
10808 {
10809 if(!_class->dataType)
10810 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
10811 type = _class->dataType;
10812 }
10813 }
10814 if(!result)
10815 {
10816 switch(type->kind)
10817 {
10818 case 6:
10819 {
10820 exp->constant = PrintFloat(*(float *)ptr);
10821 exp->type = 2;
10822 break;
10823 }
10824 case 7:
10825 {
10826 exp->constant = PrintDouble(*(double *)ptr);
10827 exp->type = 2;
10828 break;
10829 }
10830 case 3:
10831 {
10832 exp->constant = PrintInt(*(int *)ptr);
10833 exp->type = 2;
10834 break;
10835 }
10836 case 4:
10837 {
10838 exp->constant = PrintInt64(*(long long *)ptr);
10839 exp->type = 2;
10840 break;
10841 }
10842 case 22:
10843 {
10844 exp->constant = PrintInt64((long long)*(intptr_t *)ptr);
10845 exp->type = 2;
10846 break;
10847 }
10848 default:
10849 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Unhandled type populating instance\n", (((void *)0))));
10850 }
10851 }
10852 ListAdd(memberList, member);
10853 }
10854 }
10855 }
10856 }
10857
10858 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);
10859
10860 extern void FreeInstance(struct Instantiation * inst);
10861
10862 void ComputeInstantiation(struct Expression * exp)
10863 {
10864 struct Instantiation * inst = exp->instance;
10865 struct MembersInit * members;
10866 struct Symbol * classSym = inst->_class ? inst->_class->symbol : (((void *)0));
10867 struct __ecereNameSpace__ecere__com__Class * _class = classSym ? classSym->registered : (((void *)0));
10868 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
10869 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
10870 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
10871 int subMemberStackPos = 0;
10872 uint64 bits = 0;
10873
10874 if(_class && (_class->type == 1 || _class->type == 0 || _class->type == 5))
10875 {
10876 if(inst->data)
10877 return ;
10878 if(_class->type == 0 || _class->type == 5)
10879 {
10880 inst->data = (unsigned char *)__ecereNameSpace__ecere__com__eInstance_New(_class);
10881 if(_class->type == 0)
10882 ((struct __ecereNameSpace__ecere__com__Instance *)(char *)((struct __ecereNameSpace__ecere__com__Instance *)inst->data))->_refCount++;
10883 }
10884 else
10885 inst->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10886 }
10887 if(inst->members)
10888 {
10889 for(members = (*inst->members).first; members; members = members->next)
10890 {
10891 switch(members->type)
10892 {
10893 case 0:
10894 {
10895 if(members->dataMembers)
10896 {
10897 struct MemberInit * member;
10898
10899 for(member = (*members->dataMembers).first; member; member = member->next)
10900 {
10901 struct Identifier * ident = member->identifiers ? (*member->identifiers).first : (((void *)0));
10902 unsigned int found = 0x0;
10903 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
10904 struct __ecereNameSpace__ecere__com__DataMember * dataMember = (((void *)0));
10905 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
10906 unsigned int dataMemberOffset;
10907
10908 if(!ident)
10909 {
10910 __ecereNameSpace__ecere__com__eClass_FindNextMember(_class, &curClass, &curMember, subMemberStack, &subMemberStackPos);
10911 if(curMember)
10912 {
10913 if(curMember->isProperty)
10914 prop = (struct __ecereNameSpace__ecere__com__Property *)curMember;
10915 else
10916 {
10917 dataMember = curMember;
10918 __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(_class, dataMember->name, &dataMemberOffset, privateModule, (((void *)0)), (((void *)0)));
10919 if(_class->type == 0)
10920 dataMemberOffset += _class->base->structSize;
10921 }
10922 found = 0x1;
10923 }
10924 }
10925 else
10926 {
10927 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, ident->string, privateModule);
10928 if(prop)
10929 {
10930 found = 0x1;
10931 if(prop->memberAccess == 1)
10932 {
10933 curMember = (struct __ecereNameSpace__ecere__com__DataMember *)prop;
10934 curClass = prop->_class;
10935 }
10936 }
10937 else
10938 {
10939 struct __ecereNameSpace__ecere__com__DataMember * _subMemberStack[256];
10940 int _subMemberStackPos = 0;
10941
10942 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(_class, ident->string, &dataMemberOffset, privateModule, _subMemberStack, &_subMemberStackPos);
10943 if(dataMember)
10944 {
10945 found = 0x1;
10946 if(dataMember->memberAccess == 1)
10947 {
10948 curMember = dataMember;
10949 curClass = dataMember->_class;
10950 memcpy(subMemberStack, _subMemberStack, sizeof(struct __ecereNameSpace__ecere__com__DataMember *) * _subMemberStackPos);
10951 subMemberStackPos = _subMemberStackPos;
10952 }
10953 }
10954 }
10955 }
10956 if(found && member->initializer && member->initializer->type == 0)
10957 {
10958 struct Expression * value = member->initializer->exp;
10959 struct Type * type = (((void *)0));
10960 unsigned int deepMember = 0x0;
10961
10962 if(prop)
10963 {
10964 type = prop->dataType;
10965 }
10966 else if(dataMember)
10967 {
10968 if(!dataMember->dataType)
10969 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
10970 type = dataMember->dataType;
10971 }
10972 if(ident && ident->next)
10973 {
10974 deepMember = 0x1;
10975 for(ident = ident->next; ident && type; ident = ident->next)
10976 {
10977 if(type->kind == 8)
10978 {
10979 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(type->_class->registered, ident->string, privateModule);
10980 if(prop)
10981 type = prop->dataType;
10982 else
10983 {
10984 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(type->_class->registered, ident->string, &dataMemberOffset, privateModule, (((void *)0)), (((void *)0)));
10985 if(dataMember)
10986 type = dataMember->dataType;
10987 }
10988 }
10989 else if(type->kind == 9 || type->kind == 10)
10990 {
10991 struct Type * memberType;
10992
10993 for(memberType = type->members.first; memberType; memberType = memberType->next)
10994 {
10995 if(!strcmp(memberType->name, ident->string))
10996 {
10997 type = memberType;
10998 break;
10999 }
11000 }
11001 }
11002 }
11003 }
11004 if(value)
11005 {
11006 FreeType(value->destType);
11007 value->destType = type;
11008 if(type)
11009 type->refCount++;
11010 ComputeExpression(value);
11011 }
11012 if(!deepMember && type && value && (_class->type == 1 || _class->type == 0 || _class->type == 5))
11013 {
11014 if(type->kind == 8)
11015 {
11016 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
11017
11018 if(_class->type == 2 || _class->type == 3 || _class->type == 4)
11019 {
11020 if(!_class->dataType)
11021 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
11022 type = _class->dataType;
11023 }
11024 }
11025 if(dataMember)
11026 {
11027 void * ptr = inst->data + dataMemberOffset;
11028
11029 if(value->type == 2)
11030 {
11031 switch(type->kind)
11032 {
11033 case 3:
11034 {
11035 GetInt(value, (int *)ptr);
11036 break;
11037 }
11038 case 4:
11039 {
11040 GetInt64(value, (long long *)ptr);
11041 break;
11042 }
11043 case 22:
11044 {
11045 GetIntPtr(value, (intptr_t *)ptr);
11046 break;
11047 }
11048 case 23:
11049 {
11050 GetIntSize(value, (ssize_t *)ptr);
11051 break;
11052 }
11053 case 6:
11054 {
11055 GetFloat(value, (float *)ptr);
11056 break;
11057 }
11058 case 7:
11059 {
11060 GetDouble(value, (double *)ptr);
11061 break;
11062 }
11063 }
11064 }
11065 else if(value->type == 1)
11066 {
11067 if(type->kind == 8)
11068 {
11069 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
11070
11071 if(_class->type == 1)
11072 {
11073 ComputeTypeSize(type);
11074 if(value->instance->data)
11075 memcpy(ptr, value->instance->data, type->size);
11076 }
11077 }
11078 }
11079 }
11080 else if(prop)
11081 {
11082 if(value->type == 1 && value->instance->data)
11083 {
11084 if(type->kind == 8)
11085 {
11086 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
11087
11088 if(_class && (_class->type != 0 || __ecereNameSpace__ecere__com__eClass_IsDerived(((struct __ecereNameSpace__ecere__com__Instance *)(char *)((struct __ecereNameSpace__ecere__com__Instance *)value->instance->data))->_class, _class)))
11089 {
11090 void (* Set)(void *, void *) = (void *)prop->Set;
11091
11092 Set(inst->data, value->instance->data);
11093 PopulateInstance(inst);
11094 }
11095 }
11096 }
11097 else if(value->type == 2)
11098 {
11099 switch(type->kind)
11100 {
11101 case 7:
11102 {
11103 void (* Set)(void *, double) = (void *)prop->Set;
11104
11105 Set(inst->data, strtod(value->constant, (((void *)0))));
11106 break;
11107 }
11108 case 6:
11109 {
11110 void (* Set)(void *, float) = (void *)prop->Set;
11111
11112 Set(inst->data, (float)(strtod(value->constant, (((void *)0)))));
11113 break;
11114 }
11115 case 3:
11116 {
11117 void (* Set)(void *, int) = (void *)prop->Set;
11118
11119 Set(inst->data, strtol(value->constant, (((void *)0)), 0));
11120 break;
11121 }
11122 case 4:
11123 {
11124 void (* Set)(void *, long long) = (void *)prop->Set;
11125
11126 Set(inst->data, __ecereNameSpace__ecere__com___strtoi64(value->constant, (((void *)0)), 0));
11127 break;
11128 }
11129 case 22:
11130 {
11131 void (* Set)(void *, intptr_t) = (void *)prop->Set;
11132
11133 Set(inst->data, (intptr_t)__ecereNameSpace__ecere__com___strtoi64(value->constant, (((void *)0)), 0));
11134 break;
11135 }
11136 case 23:
11137 {
11138 void (* Set)(void *, ssize_t) = (void *)prop->Set;
11139
11140 Set(inst->data, (ssize_t)__ecereNameSpace__ecere__com___strtoi64(value->constant, (((void *)0)), 0));
11141 break;
11142 }
11143 }
11144 }
11145 else if(value->type == 3)
11146 {
11147 char temp[1024];
11148
11149 ReadString(temp, value->string);
11150 ((void (*)(void *, void *))(void *)prop->Set)(inst->data, temp);
11151 }
11152 }
11153 }
11154 else if(!deepMember && type && _class->type == 3)
11155 {
11156 if(prop)
11157 {
11158 if(value->type == 2)
11159 {
11160 if(type->kind == 8)
11161 {
11162 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
11163
11164 if(_class->type == 3)
11165 {
11166 if(!_class->dataType)
11167 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
11168 type = _class->dataType;
11169 }
11170 }
11171 switch(type->kind)
11172 {
11173 case 6:
11174 {
11175 float fValue;
11176 float (* Set)(float) = (void *)prop->Set;
11177
11178 GetFloat(member->initializer->exp, &fValue);
11179 exp->constant = PrintFloat(Set(fValue));
11180 exp->type = 2;
11181 break;
11182 }
11183 case 7:
11184 {
11185 double dValue;
11186 double (* Set)(double) = (void *)prop->Set;
11187
11188 GetDouble(member->initializer->exp, &dValue);
11189 exp->constant = PrintDouble(Set(dValue));
11190 exp->type = 2;
11191 break;
11192 }
11193 }
11194 }
11195 }
11196 }
11197 else if(!deepMember && type && _class->type == 2)
11198 {
11199 if(prop)
11200 {
11201 if(value->type == 1 && value->instance->data)
11202 {
11203 unsigned int (* Set)(void *) = (void *)prop->Set;
11204
11205 bits = Set(value->instance->data);
11206 }
11207 else if(value->type == 2)
11208 {
11209 }
11210 }
11211 else if(dataMember)
11212 {
11213 struct __ecereNameSpace__ecere__com__BitMember * bitMember = (struct __ecereNameSpace__ecere__com__BitMember *)dataMember;
11214 struct Type * type;
11215 int part = 0;
11216
11217 GetInt(value, &part);
11218 bits = (bits & ~bitMember->mask);
11219 if(!bitMember->dataType)
11220 bitMember->dataType = ProcessTypeString(bitMember->dataTypeString, 0x0);
11221 type = bitMember->dataType;
11222 if(type->kind == 8 && type->_class && type->_class->registered)
11223 {
11224 if(!type->_class->registered->dataType)
11225 type->_class->registered->dataType = ProcessTypeString(type->_class->registered->dataTypeString, 0x0);
11226 type = type->_class->registered->dataType;
11227 }
11228 switch(type->kind)
11229 {
11230 case 24:
11231 case 1:
11232 if(type->isSigned)
11233 bits |= ((char)part << bitMember->pos);
11234 else
11235 bits |= ((unsigned char)part << bitMember->pos);
11236 break;
11237 case 2:
11238 if(type->isSigned)
11239 bits |= ((short)part << bitMember->pos);
11240 else
11241 bits |= ((unsigned short)part << bitMember->pos);
11242 break;
11243 case 3:
11244 case 5:
11245 if(type->isSigned)
11246 bits |= (part << bitMember->pos);
11247 else
11248 bits |= ((unsigned int)part << bitMember->pos);
11249 break;
11250 case 4:
11251 if(type->isSigned)
11252 bits |= ((long long)part << bitMember->pos);
11253 else
11254 bits |= ((uint64)part << bitMember->pos);
11255 break;
11256 case 22:
11257 if(type->isSigned)
11258 {
11259 bits |= ((intptr_t)part << bitMember->pos);
11260 }
11261 else
11262 {
11263 bits |= ((uintptr_t)part << bitMember->pos);
11264 }
11265 break;
11266 case 23:
11267 if(type->isSigned)
11268 {
11269 bits |= ((ssize_t)part << bitMember->pos);
11270 }
11271 else
11272 {
11273 bits |= ((size_t)part << bitMember->pos);
11274 }
11275 break;
11276 }
11277 }
11278 }
11279 }
11280 else
11281 {
11282 if(_class && _class->type == 3)
11283 {
11284 ComputeExpression(member->initializer->exp);
11285 exp->constant = member->initializer->exp->constant;
11286 exp->type = 2;
11287 member->initializer->exp->constant = (((void *)0));
11288 }
11289 }
11290 }
11291 }
11292 break;
11293 }
11294 }
11295 }
11296 }
11297 if(_class && _class->type == 2)
11298 {
11299 exp->constant = PrintHexUInt(bits);
11300 exp->type = 2;
11301 }
11302 if(exp->type != 1)
11303 {
11304 FreeInstance(inst);
11305 }
11306 }
11307
11308 void CallOperator(struct Expression * exp, struct Expression * exp1, struct Expression * exp2, struct Operand * op1, struct Operand * op2)
11309 {
11310 if(exp->op.op == SIZEOF)
11311 {
11312 FreeExpContents(exp);
11313 exp->type = 2;
11314 exp->constant = PrintUInt(ComputeTypeSize(op1->type));
11315 }
11316 else
11317 {
11318 if(!exp->op.exp1)
11319 {
11320 switch(exp->op.op)
11321 {
11322 case '+':
11323 {
11324 struct Expression * exp2 = exp->op.exp2;
11325
11326 exp->op.exp2 = (((void *)0));
11327 FreeExpContents(exp);
11328 FreeType(exp->expType);
11329 FreeType(exp->destType);
11330 *exp = *exp2;
11331 ((exp2 ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(exp2) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(exp2)) : 0), exp2 = 0);
11332 break;
11333 }
11334 case '-':
11335 if(op1->ops.Neg)
11336 {
11337 FreeExpContents(exp);
11338 op1->ops.Neg(exp, op1);
11339 }
11340 break;
11341 case '~':
11342 if(op1->ops.BitNot)
11343 {
11344 FreeExpContents(exp);
11345 op1->ops.BitNot(exp, op1);
11346 }
11347 break;
11348 case '!':
11349 if(op1->ops.Not)
11350 {
11351 FreeExpContents(exp);
11352 op1->ops.Not(exp, op1);
11353 }
11354 break;
11355 }
11356 }
11357 else
11358 {
11359 switch(exp->op.op)
11360 {
11361 case '+':
11362 if(op1->ops.Add)
11363 {
11364 FreeExpContents(exp);
11365 op1->ops.Add(exp, op1, op2);
11366 }
11367 break;
11368 case '-':
11369 if(op1->ops.Sub)
11370 {
11371 FreeExpContents(exp);
11372 op1->ops.Sub(exp, op1, op2);
11373 }
11374 break;
11375 case '*':
11376 if(op1->ops.Mul)
11377 {
11378 FreeExpContents(exp);
11379 op1->ops.Mul(exp, op1, op2);
11380 }
11381 break;
11382 case '/':
11383 if(op1->ops.Div)
11384 {
11385 FreeExpContents(exp);
11386 op1->ops.Div(exp, op1, op2);
11387 }
11388 break;
11389 case '%':
11390 if(op1->ops.Mod)
11391 {
11392 FreeExpContents(exp);
11393 op1->ops.Mod(exp, op1, op2);
11394 }
11395 break;
11396 case '&':
11397 if(exp->op.exp2)
11398 {
11399 if(op1->ops.BitAnd)
11400 {
11401 FreeExpContents(exp);
11402 op1->ops.BitAnd(exp, op1, op2);
11403 }
11404 }
11405 break;
11406 case '|':
11407 if(op1->ops.BitOr)
11408 {
11409 FreeExpContents(exp);
11410 op1->ops.BitOr(exp, op1, op2);
11411 }
11412 break;
11413 case '^':
11414 if(op1->ops.BitXor)
11415 {
11416 FreeExpContents(exp);
11417 op1->ops.BitXor(exp, op1, op2);
11418 }
11419 break;
11420 case LEFT_OP:
11421 if(op1->ops.LShift)
11422 {
11423 FreeExpContents(exp);
11424 op1->ops.LShift(exp, op1, op2);
11425 }
11426 break;
11427 case RIGHT_OP:
11428 if(op1->ops.RShift)
11429 {
11430 FreeExpContents(exp);
11431 op1->ops.RShift(exp, op1, op2);
11432 }
11433 break;
11434 case EQ_OP:
11435 if(op1->ops.Equ)
11436 {
11437 FreeExpContents(exp);
11438 op1->ops.Equ(exp, op1, op2);
11439 }
11440 break;
11441 case NE_OP:
11442 if(op1->ops.Nqu)
11443 {
11444 FreeExpContents(exp);
11445 op1->ops.Nqu(exp, op1, op2);
11446 }
11447 break;
11448 case AND_OP:
11449 if(op1->ops.And)
11450 {
11451 FreeExpContents(exp);
11452 op1->ops.And(exp, op1, op2);
11453 }
11454 break;
11455 case OR_OP:
11456 if(op1->ops.Or)
11457 {
11458 FreeExpContents(exp);
11459 op1->ops.Or(exp, op1, op2);
11460 }
11461 break;
11462 case '>':
11463 if(op1->ops.Grt)
11464 {
11465 FreeExpContents(exp);
11466 op1->ops.Grt(exp, op1, op2);
11467 }
11468 break;
11469 case '<':
11470 if(op1->ops.Sma)
11471 {
11472 FreeExpContents(exp);
11473 op1->ops.Sma(exp, op1, op2);
11474 }
11475 break;
11476 case GE_OP:
11477 if(op1->ops.GrtEqu)
11478 {
11479 FreeExpContents(exp);
11480 op1->ops.GrtEqu(exp, op1, op2);
11481 }
11482 break;
11483 case LE_OP:
11484 if(op1->ops.SmaEqu)
11485 {
11486 FreeExpContents(exp);
11487 op1->ops.SmaEqu(exp, op1, op2);
11488 }
11489 break;
11490 }
11491 }
11492 }
11493 }
11494
11495 void PrintTypeNoConst(struct Type * type, char *  string, unsigned int printName, unsigned int fullName);
11496
11497 extern struct Expression * MkExpIdentifier(struct Identifier * id);
11498
11499 void ComputeExpression(struct Expression * exp)
11500 {
11501 char expString[10240];
11502
11503 expString[0] = '\0';
11504 switch(exp->type)
11505 {
11506 case 1:
11507 {
11508 ComputeInstantiation(exp);
11509 break;
11510 }
11511 case 4:
11512 {
11513 struct Expression * exp1, * exp2 = (((void *)0));
11514 struct Operand op1 = 
11515 {
11516 0, 0, 0, 0, 
11517 {
11518 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
11519 }
11520 };
11521 struct Operand op2 = 
11522 {
11523 0, 0, 0, 0, 
11524 {
11525 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
11526 }
11527 };
11528
11529 if(exp->op.exp2)
11530 ComputeExpression(exp->op.exp2);
11531 if(exp->op.exp1)
11532 {
11533 ComputeExpression(exp->op.exp1);
11534 exp1 = exp->op.exp1;
11535 exp2 = exp->op.exp2;
11536 op1 = GetOperand(exp1);
11537 if(op1.type)
11538 op1.type->refCount++;
11539 if(exp2)
11540 {
11541 op2 = GetOperand(exp2);
11542 if(op2.type)
11543 op2.type->refCount++;
11544 }
11545 }
11546 else
11547 {
11548 exp1 = exp->op.exp2;
11549 op1 = GetOperand(exp1);
11550 if(op1.type)
11551 op1.type->refCount++;
11552 }
11553 CallOperator(exp, exp1, exp2, &op1, &op2);
11554 if(op1.type)
11555 FreeType(op1.type);
11556 if(op2.type)
11557 FreeType(op2.type);
11558 break;
11559 }
11560 case 5:
11561 case 34:
11562 {
11563 struct Expression * e, * n;
11564
11565 for(e = (*exp->list).first; e; e = n)
11566 {
11567 n = e->next;
11568 if(!n)
11569 {
11570 struct __ecereNameSpace__ecere__sys__OldList * list = exp->list;
11571
11572 ComputeExpression(e);
11573 FreeType(exp->expType);
11574 FreeType(exp->destType);
11575 *exp = *e;
11576 ((e ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(e) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(e)) : 0), e = 0);
11577 (__ecereNameSpace__ecere__com__eSystem_Delete(list), list = 0);
11578 }
11579 else
11580 {
11581 FreeExpression(e);
11582 }
11583 }
11584 break;
11585 }
11586 case 8:
11587 {
11588 struct Expression * memberExp = exp->member.exp;
11589 struct Identifier * memberID = exp->member.member;
11590 struct Type * type;
11591
11592 ComputeExpression(exp->member.exp);
11593 type = exp->member.exp->expType;
11594 if(type)
11595 {
11596 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)));
11597 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
11598 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
11599 struct __ecereNameSpace__ecere__com__Class * convertTo = (((void *)0));
11600
11601 if(type->kind == 19 && exp->member.exp->type == 26)
11602 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "ecere::com::Class");
11603 if(!_class)
11604 {
11605 char string[256];
11606 struct Symbol * classSym;
11607
11608 string[0] = '\0';
11609 PrintTypeNoConst(type, string, 0x0, 0x1);
11610 classSym = FindClass(string);
11611 _class = classSym ? classSym->registered : (((void *)0));
11612 }
11613 if(exp->member.member)
11614 {
11615 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, exp->member.member->string, privateModule);
11616 if(!prop)
11617 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, exp->member.member->string, privateModule, (((void *)0)), (((void *)0)));
11618 }
11619 if(!prop && !member && _class && exp->member.member)
11620 {
11621 struct Symbol * classSym = FindClass(exp->member.member->string);
11622
11623 convertTo = _class;
11624 _class = classSym ? classSym->registered : (((void *)0));
11625 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, convertTo->fullName, privateModule);
11626 }
11627 if(prop)
11628 {
11629 if(prop->compiled)
11630 {
11631 struct Type * type = prop->dataType;
11632
11633 if(_class->type == 3)
11634 {
11635 if(type->kind == 8)
11636 {
11637 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
11638
11639 if(_class->type == 3)
11640 {
11641 if(!_class->dataType)
11642 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
11643 type = _class->dataType;
11644 }
11645 }
11646 switch(type->kind)
11647 {
11648 case 6:
11649 {
11650 float value;
11651 float (* Get)(float) = (void *)prop->Get;
11652
11653 GetFloat(exp->member.exp, &value);
11654 exp->constant = PrintFloat(Get ? Get(value) : value);
11655 exp->type = 2;
11656 break;
11657 }
11658 case 7:
11659 {
11660 double value;
11661 double (* Get)(double);
11662
11663 GetDouble(exp->member.exp, &value);
11664 if(convertTo)
11665 Get = (void *)prop->Set;
11666 else
11667 Get = (void *)prop->Get;
11668 exp->constant = PrintDouble(Get ? Get(value) : value);
11669 exp->type = 2;
11670 break;
11671 }
11672 }
11673 }
11674 else
11675 {
11676 if(convertTo)
11677 {
11678 struct Expression * value = exp->member.exp;
11679 struct Type * type;
11680
11681 if(!prop->dataType)
11682 ProcessPropertyType(prop);
11683 type = prop->dataType;
11684 if(!type)
11685 {
11686 }
11687 else if(_class->type == 1)
11688 {
11689 switch(type->kind)
11690 {
11691 case 8:
11692 {
11693 struct __ecereNameSpace__ecere__com__Class * propertyClass = type->_class->registered;
11694
11695 if(propertyClass->type == 1 && value->type == 1)
11696 {
11697 void (* Set)(void *, void *) = (void *)prop->Set;
11698
11699 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
11700 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
11701 exp->instance->_class = MkSpecifierName(_class->fullName);
11702 exp->instance->loc = exp->loc;
11703 exp->type = 1;
11704 Set(exp->instance->data, value->instance->data);
11705 PopulateInstance(exp->instance);
11706 }
11707 break;
11708 }
11709 case 3:
11710 {
11711 int intValue;
11712 void (* Set)(void *, int) = (void *)prop->Set;
11713
11714 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
11715 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
11716 exp->instance->_class = MkSpecifierName(_class->fullName);
11717 exp->instance->loc = exp->loc;
11718 exp->type = 1;
11719 GetInt(value, &intValue);
11720 Set(exp->instance->data, intValue);
11721 PopulateInstance(exp->instance);
11722 break;
11723 }
11724 case 4:
11725 {
11726 long long intValue;
11727 void (* Set)(void *, long long) = (void *)prop->Set;
11728
11729 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
11730 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
11731 exp->instance->_class = MkSpecifierName(_class->fullName);
11732 exp->instance->loc = exp->loc;
11733 exp->type = 1;
11734 GetInt64(value, &intValue);
11735 Set(exp->instance->data, intValue);
11736 PopulateInstance(exp->instance);
11737 break;
11738 }
11739 case 22:
11740 {
11741 intptr_t intValue;
11742 void (* Set)(void *, intptr_t) = (void *)prop->Set;
11743
11744 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
11745 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
11746 exp->instance->_class = MkSpecifierName(_class->fullName);
11747 exp->instance->loc = exp->loc;
11748 exp->type = 1;
11749 GetIntPtr(value, &intValue);
11750 Set(exp->instance->data, intValue);
11751 PopulateInstance(exp->instance);
11752 break;
11753 }
11754 case 23:
11755 {
11756 ssize_t intValue;
11757 void (* Set)(void *, ssize_t) = (void *)prop->Set;
11758
11759 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
11760 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
11761 exp->instance->_class = MkSpecifierName(_class->fullName);
11762 exp->instance->loc = exp->loc;
11763 exp->type = 1;
11764 GetIntSize(value, &intValue);
11765 Set(exp->instance->data, intValue);
11766 PopulateInstance(exp->instance);
11767 break;
11768 }
11769 case 7:
11770 {
11771 double doubleValue;
11772 void (* Set)(void *, double) = (void *)prop->Set;
11773
11774 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
11775 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
11776 exp->instance->_class = MkSpecifierName(_class->fullName);
11777 exp->instance->loc = exp->loc;
11778 exp->type = 1;
11779 GetDouble(value, &doubleValue);
11780 Set(exp->instance->data, doubleValue);
11781 PopulateInstance(exp->instance);
11782 break;
11783 }
11784 }
11785 }
11786 else if(_class->type == 2)
11787 {
11788 switch(type->kind)
11789 {
11790 case 8:
11791 {
11792 struct __ecereNameSpace__ecere__com__Class * propertyClass = type->_class->registered;
11793
11794 if(propertyClass->type == 1 && value->instance->data)
11795 {
11796 unsigned int (* Set)(void *) = (void *)prop->Set;
11797 unsigned int bits = Set(value->instance->data);
11798
11799 exp->constant = PrintHexUInt(bits);
11800 exp->type = 2;
11801 break;
11802 }
11803 else if(_class->type == 2)
11804 {
11805 unsigned int value;
11806 unsigned int (* Set)(unsigned int) = (void *)prop->Set;
11807 unsigned int bits;
11808
11809 GetUInt(exp->member.exp, &value);
11810 bits = Set(value);
11811 exp->constant = PrintHexUInt(bits);
11812 exp->type = 2;
11813 }
11814 }
11815 }
11816 }
11817 }
11818 else
11819 {
11820 if(_class->type == 2)
11821 {
11822 unsigned int value;
11823
11824 GetUInt(exp->member.exp, &value);
11825 switch(type->kind)
11826 {
11827 case 8:
11828 {
11829 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
11830
11831 if(_class->type == 1)
11832 {
11833 void (* Get)(unsigned int, void *) = (void *)prop->Get;
11834
11835 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
11836 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
11837 exp->instance->_class = MkSpecifierName(_class->fullName);
11838 exp->instance->loc = exp->loc;
11839 exp->type = 1;
11840 Get(value, exp->instance->data);
11841 PopulateInstance(exp->instance);
11842 }
11843 else if(_class->type == 2)
11844 {
11845 unsigned int (* Get)(unsigned int) = (void *)prop->Get;
11846 uint64 bits = Get(value);
11847
11848 exp->constant = PrintHexUInt64(bits);
11849 exp->type = 2;
11850 }
11851 break;
11852 }
11853 }
11854 }
11855 else if(_class->type == 1)
11856 {
11857 char * value = (exp->member.exp->type == 1) ? exp->member.exp->instance->data : (((void *)0));
11858
11859 switch(type->kind)
11860 {
11861 case 8:
11862 {
11863 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
11864
11865 if(_class->type == 1 && value)
11866 {
11867 void (* Get)(void *, void *) = (void *)prop->Get;
11868
11869 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
11870 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
11871 exp->instance->_class = MkSpecifierName(_class->fullName);
11872 exp->instance->loc = exp->loc;
11873 exp->type = 1;
11874 Get(value, exp->instance->data);
11875 PopulateInstance(exp->instance);
11876 }
11877 break;
11878 }
11879 }
11880 }
11881 }
11882 }
11883 }
11884 else
11885 {
11886 exp->isConstant = 0x0;
11887 }
11888 }
11889 else if(member)
11890 {
11891 }
11892 }
11893 if(exp->type != 8)
11894 {
11895 FreeExpression(memberExp);
11896 FreeIdentifier(memberID);
11897 }
11898 break;
11899 }
11900 case 10:
11901 {
11902 struct Type * type = ProcessType(exp->typeName->qualifiers, exp->typeName->declarator);
11903
11904 FreeExpContents(exp);
11905 exp->constant = PrintUInt(ComputeTypeSize(type));
11906 exp->type = 2;
11907 FreeType(type);
11908 break;
11909 }
11910 case 15:
11911 {
11912 struct Symbol * classSym = exp->_class->symbol;
11913
11914 if(classSym && classSym->registered)
11915 {
11916 if(classSym->registered->fixed)
11917 {
11918 FreeSpecifier(exp->_class);
11919 exp->constant = PrintUInt(classSym->registered->templateClass ? classSym->registered->templateClass->structSize : classSym->registered->structSize);
11920 exp->type = 2;
11921 }
11922 else
11923 {
11924 char className[1024];
11925
11926 strcpy(className, "__ecereClass_");
11927 FullClassNameCat(className, classSym->string, 0x1);
11928 MangleClassName(className);
11929 DeclareClass(classSym, className);
11930 FreeExpContents(exp);
11931 exp->type = 9;
11932 exp->member.exp = MkExpIdentifier(MkIdentifier(className));
11933 exp->member.member = MkIdentifier("structSize");
11934 }
11935 }
11936 break;
11937 }
11938 case 11:
11939 {
11940 struct Type * type;
11941 struct Expression * e = exp;
11942
11943 if(exp->type == 11)
11944 {
11945 if(exp->cast.exp)
11946 ComputeExpression(exp->cast.exp);
11947 e = exp->cast.exp;
11948 }
11949 if(e && exp->expType)
11950 {
11951 type = exp->expType;
11952 if(type->kind == 8)
11953 {
11954 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
11955
11956 if(_class && (_class->type == 3 || _class->type == 2))
11957 {
11958 if(!_class->dataType)
11959 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
11960 type = _class->dataType;
11961 }
11962 }
11963 switch(type->kind)
11964 {
11965 case 24:
11966 case 1:
11967 if(type->isSigned)
11968 {
11969 char value;
11970
11971 GetChar(e, &value);
11972 FreeExpContents(exp);
11973 exp->constant = PrintChar(value);
11974 exp->type = 2;
11975 }
11976 else
11977 {
11978 unsigned char value;
11979
11980 GetUChar(e, &value);
11981 FreeExpContents(exp);
11982 exp->constant = PrintUChar(value);
11983 exp->type = 2;
11984 }
11985 break;
11986 case 2:
11987 if(type->isSigned)
11988 {
11989 short value;
11990
11991 GetShort(e, &value);
11992 FreeExpContents(exp);
11993 exp->constant = PrintShort(value);
11994 exp->type = 2;
11995 }
11996 else
11997 {
11998 unsigned short value;
11999
12000 GetUShort(e, &value);
12001 FreeExpContents(exp);
12002 exp->constant = PrintUShort(value);
12003 exp->type = 2;
12004 }
12005 break;
12006 case 3:
12007 if(type->isSigned)
12008 {
12009 int value;
12010
12011 GetInt(e, &value);
12012 FreeExpContents(exp);
12013 exp->constant = PrintInt(value);
12014 exp->type = 2;
12015 }
12016 else
12017 {
12018 unsigned int value;
12019
12020 GetUInt(e, &value);
12021 FreeExpContents(exp);
12022 exp->constant = PrintUInt(value);
12023 exp->type = 2;
12024 }
12025 break;
12026 case 4:
12027 if(type->isSigned)
12028 {
12029 long long value;
12030
12031 GetInt64(e, &value);
12032 FreeExpContents(exp);
12033 exp->constant = PrintInt64(value);
12034 exp->type = 2;
12035 }
12036 else
12037 {
12038 uint64 value;
12039
12040 GetUInt64(e, &value);
12041 FreeExpContents(exp);
12042 exp->constant = PrintUInt64(value);
12043 exp->type = 2;
12044 }
12045 break;
12046 case 22:
12047 if(type->isSigned)
12048 {
12049 intptr_t value;
12050
12051 GetIntPtr(e, &value);
12052 FreeExpContents(exp);
12053 exp->constant = PrintInt64((long long)value);
12054 exp->type = 2;
12055 }
12056 else
12057 {
12058 uintptr_t value;
12059
12060 GetUIntPtr(e, &value);
12061 FreeExpContents(exp);
12062 exp->constant = PrintUInt64((uint64)value);
12063 exp->type = 2;
12064 }
12065 break;
12066 case 23:
12067 if(type->isSigned)
12068 {
12069 ssize_t value;
12070
12071 GetIntSize(e, &value);
12072 FreeExpContents(exp);
12073 exp->constant = PrintInt64((long long)value);
12074 exp->type = 2;
12075 }
12076 else
12077 {
12078 size_t value;
12079
12080 GetUIntSize(e, &value);
12081 FreeExpContents(exp);
12082 exp->constant = PrintUInt64((uint64)value);
12083 exp->type = 2;
12084 }
12085 break;
12086 case 6:
12087 {
12088 float value;
12089
12090 GetFloat(e, &value);
12091 FreeExpContents(exp);
12092 exp->constant = PrintFloat(value);
12093 exp->type = 2;
12094 break;
12095 }
12096 case 7:
12097 {
12098 double value;
12099
12100 GetDouble(e, &value);
12101 FreeExpContents(exp);
12102 exp->constant = PrintDouble(value);
12103 exp->type = 2;
12104 break;
12105 }
12106 }
12107 }
12108 break;
12109 }
12110 case 12:
12111 {
12112 struct Operand op1 = 
12113 {
12114 0, 0, 0, 0, 
12115 {
12116 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
12117 }
12118 };
12119 struct Operand op2 = 
12120 {
12121 0, 0, 0, 0, 
12122 {
12123 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
12124 }
12125 };
12126 struct Operand op3 = 
12127 {
12128 0, 0, 0, 0, 
12129 {
12130 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
12131 }
12132 };
12133
12134 if(exp->cond.exp)
12135 ComputeExpression((*exp->cond.exp).last);
12136 if(exp->cond.elseExp)
12137 ComputeExpression(exp->cond.elseExp);
12138 if(exp->cond.cond)
12139 ComputeExpression(exp->cond.cond);
12140 op1 = GetOperand(exp->cond.cond);
12141 if(op1.type)
12142 op1.type->refCount++;
12143 op2 = GetOperand((*exp->cond.exp).last);
12144 if(op2.type)
12145 op2.type->refCount++;
12146 op3 = GetOperand(exp->cond.elseExp);
12147 if(op3.type)
12148 op3.type->refCount++;
12149 if(op1.ops.Cond)
12150 {
12151 FreeExpContents(exp);
12152 op1.ops.Cond(exp, &op1, &op2, &op3);
12153 }
12154 if(op1.type)
12155 FreeType(op1.type);
12156 if(op2.type)
12157 FreeType(op2.type);
12158 if(op3.type)
12159 FreeType(op3.type);
12160 break;
12161 }
12162 }
12163 }
12164
12165 void ApplyAnyObjectLogic(struct Expression * e);
12166
12167 extern void CopyTypeInto(struct Type * type, struct Type * src);
12168
12169 static unsigned int CheckExpressionType(struct Expression * exp, struct Type * destType, unsigned int skipUnitBla)
12170 {
12171 unsigned int result = 0x1;
12172
12173 if(destType)
12174 {
12175 struct __ecereNameSpace__ecere__sys__OldList converts = 
12176 {
12177 0, 0, 0, 0, 0
12178 };
12179 struct Conversion * convert;
12180
12181 if(destType->kind == 0)
12182 return 0x0;
12183 if(!MatchTypeExpression(exp, destType, &converts, skipUnitBla))
12184 result = 0x0;
12185 if(converts.count)
12186 {
12187 for(convert = converts.first; convert; convert = convert->next)
12188 {
12189 unsigned int empty = !(convert->isGet ? (void *)convert->convert->Get : (void *)convert->convert->Set);
12190
12191 if(!empty)
12192 {
12193 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12194 int objectType = exp->expType ? exp->expType->classObjectType : 0;
12195
12196 *newExp = *exp;
12197 newExp->destType = (((void *)0));
12198 if(convert->isGet)
12199 {
12200 exp->type = 8;
12201 exp->addedThis = 0x1;
12202 exp->member.exp = newExp;
12203 FreeType(exp->member.exp->expType);
12204 exp->member.exp->expType = MkClassType(convert->convert->_class->fullName);
12205 exp->member.exp->expType->classObjectType = objectType;
12206 exp->member.member = MkIdentifier(convert->convert->dataTypeString);
12207 exp->member.memberType = 1;
12208 exp->expType = convert->resultType ? convert->resultType : convert->convert->dataType;
12209 exp->needCast = 0x1;
12210 if(exp->expType)
12211 exp->expType->refCount++;
12212 ApplyAnyObjectLogic(exp->member.exp);
12213 }
12214 else
12215 {
12216 {
12217 exp->type = 8;
12218 exp->addedThis = 0x1;
12219 exp->member.exp = newExp;
12220 if(newExp->expType && newExp->expType->kind == 8 && newExp->expType->_class && newExp->expType->_class->registered && newExp->expType->_class->registered->type == 5)
12221 {
12222 newExp->byReference = 0x1;
12223 }
12224 FreeType(exp->member.exp->expType);
12225 exp->member.exp->expType = (((void *)0));
12226 if(convert->convert->dataType)
12227 {
12228 exp->member.exp->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
12229 CopyTypeInto(exp->member.exp->expType, convert->convert->dataType);
12230 exp->member.exp->expType->refCount = 1;
12231 exp->member.exp->expType->classObjectType = objectType;
12232 ApplyAnyObjectLogic(exp->member.exp);
12233 }
12234 exp->member.member = MkIdentifier(convert->convert->_class->fullName);
12235 exp->member.memberType = 4;
12236 exp->expType = convert->resultType ? convert->resultType : MkClassType(convert->convert->_class->fullName);
12237 exp->needCast = 0x1;
12238 if(convert->resultType)
12239 convert->resultType->refCount++;
12240 }
12241 }
12242 }
12243 else
12244 {
12245 FreeType(exp->expType);
12246 if(convert->isGet)
12247 {
12248 exp->expType = convert->resultType ? convert->resultType : convert->convert->dataType;
12249 exp->needCast = 0x1;
12250 if(exp->expType)
12251 exp->expType->refCount++;
12252 }
12253 else
12254 {
12255 exp->expType = convert->resultType ? convert->resultType : MkClassType(convert->convert->_class->fullName);
12256 exp->needCast = 0x1;
12257 if(convert->resultType)
12258 convert->resultType->refCount++;
12259 }
12260 }
12261 }
12262 if(exp->isConstant && inCompiler)
12263 ComputeExpression(exp);
12264 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(&converts, FreeConvert);
12265 }
12266 if(!result && exp->expType && converts.count)
12267 {
12268 result = MatchTypes(exp->expType, exp->destType, (((void *)0)), (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0);
12269 }
12270 if(!result && exp->expType && exp->destType)
12271 {
12272 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))
12273 result = 0x1;
12274 }
12275 }
12276 return result;
12277 }
12278
12279 extern struct Statement * MkCompoundStmt(struct __ecereNameSpace__ecere__sys__OldList * declarations, struct __ecereNameSpace__ecere__sys__OldList * statements);
12280
12281 extern struct Statement * MkExpressionStmt(struct __ecereNameSpace__ecere__sys__OldList * expressions);
12282
12283 extern struct Expression * MkExpMember(struct Expression * expression, struct Identifier * member);
12284
12285 void CheckTemplateTypes(struct Expression * exp)
12286 {
12287 if(exp->destType && exp->destType->passAsTemplate && exp->expType && exp->expType->kind != 20 && !exp->expType->passAsTemplate)
12288 {
12289 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12290 struct Statement * compound;
12291 struct Context * context;
12292
12293 *newExp = *exp;
12294 if(exp->destType)
12295 exp->destType->refCount++;
12296 if(exp->expType)
12297 exp->expType->refCount++;
12298 newExp->prev = (((void *)0));
12299 newExp->next = (((void *)0));
12300 switch(exp->expType->kind)
12301 {
12302 case 7:
12303 if(exp->destType->classObjectType)
12304 {
12305 if(exp->destType)
12306 exp->destType->refCount--;
12307 if(exp->expType)
12308 exp->expType->refCount--;
12309 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
12310 }
12311 else
12312 {
12313 struct __ecereNameSpace__ecere__sys__OldList * specs;
12314 struct __ecereNameSpace__ecere__sys__OldList * unionDefs = MkList();
12315 struct __ecereNameSpace__ecere__sys__OldList * statements = MkList();
12316
12317 context = PushContext();
12318 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(DOUBLE)), MkListOne(MkDeclaratorIdentifier(MkIdentifier("d"))), (((void *)0)))));
12319 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifierName("uint64")), MkListOne(MkDeclaratorIdentifier(MkIdentifier("i"))), (((void *)0)))));
12320 specs = MkListOne(MkStructOrUnion(4, (((void *)0)), unionDefs));
12321 exp->type = 25;
12322 exp->compound = MkCompoundStmt(MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internal_union")), (((void *)0)))))), statements);
12323 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("d")), '=', newExp))));
12324 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("i")))));
12325 exp->compound->compound.context = context;
12326 PopContext(context);
12327 }
12328 break;
12329 default:
12330 exp->type = 11;
12331 exp->cast.typeName = MkTypeName(MkListOne(MkSpecifierName("uint64")), (((void *)0)));
12332 exp->cast.exp = MkExpBrackets(MkListOne(newExp));
12333 break;
12334 }
12335 }
12336 else if(exp->expType && exp->expType->passAsTemplate && exp->destType && ((unsigned int)((exp->usage & 0x1) >> 0)) && exp->destType->kind != 20 && !exp->destType->passAsTemplate)
12337 {
12338 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12339 struct Statement * compound;
12340 struct Context * context;
12341
12342 *newExp = *exp;
12343 if(exp->destType)
12344 exp->destType->refCount++;
12345 if(exp->expType)
12346 exp->expType->refCount++;
12347 newExp->prev = (((void *)0));
12348 newExp->next = (((void *)0));
12349 switch(exp->expType->kind)
12350 {
12351 case 7:
12352 if(exp->destType->classObjectType)
12353 {
12354 if(exp->destType)
12355 exp->destType->refCount--;
12356 if(exp->expType)
12357 exp->expType->refCount--;
12358 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
12359 }
12360 else
12361 {
12362 struct __ecereNameSpace__ecere__sys__OldList * specs;
12363 struct __ecereNameSpace__ecere__sys__OldList * unionDefs = MkList();
12364 struct __ecereNameSpace__ecere__sys__OldList * statements = MkList();
12365
12366 context = PushContext();
12367 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(DOUBLE)), MkListOne(MkDeclaratorIdentifier(MkIdentifier("d"))), (((void *)0)))));
12368 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifierName("uint64")), MkListOne(MkDeclaratorIdentifier(MkIdentifier("i"))), (((void *)0)))));
12369 specs = MkListOne(MkStructOrUnion(4, (((void *)0)), unionDefs));
12370 exp->type = 25;
12371 exp->compound = MkCompoundStmt(MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internal_union")), (((void *)0)))))), statements);
12372 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("i")), '=', newExp))));
12373 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("d")))));
12374 exp->compound->compound.context = context;
12375 PopContext(context);
12376 }
12377 break;
12378 case 8:
12379 {
12380 if(exp->expType->_class && exp->expType->_class->registered && exp->expType->_class->registered->type == 1)
12381 {
12382 exp->type = 5;
12383 exp->list = MkListOne(MkExpOp((((void *)0)), '*', MkExpCast(MkTypeName(MkListOne(MkSpecifierName(exp->expType->_class->string)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), newExp)));
12384 ProcessExpressionType((*exp->list).first);
12385 break;
12386 }
12387 else
12388 {
12389 exp->type = 5;
12390 exp->list = MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName(exp->expType->_class->string)), (((void *)0))), newExp));
12391 newExp->needCast = 0x1;
12392 ProcessExpressionType((*exp->list).first);
12393 break;
12394 }
12395 }
12396 default:
12397 {
12398 if(exp->expType->kind == 20)
12399 {
12400 struct Type * type = ProcessTemplateParameterType(exp->expType->templateParameter);
12401
12402 if(type)
12403 {
12404 FreeType(exp->destType);
12405 FreeType(exp->expType);
12406 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
12407 break;
12408 }
12409 }
12410 if(newExp->type == 8 && newExp->member.memberType == 3)
12411 {
12412 exp->type = 4;
12413 exp->op.op = '*';
12414 exp->op.exp1 = (((void *)0));
12415 exp->op.exp2 = MkExpCast(MkTypeName(MkListOne(MkSpecifierName("uint64")), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), MkExpBrackets(MkListOne(MkExpOp((((void *)0)), '&', newExp))));
12416 }
12417 else
12418 {
12419 char typeString[1024];
12420 struct Declarator * decl;
12421 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
12422
12423 typeString[0] = '\0';
12424 PrintType(exp->expType, typeString, 0x0, 0x0);
12425 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
12426 exp->type = 11;
12427 exp->cast.typeName = MkTypeName(specs, decl);
12428 exp->cast.exp = MkExpBrackets(MkListOne(newExp));
12429 exp->cast.exp->needCast = 0x1;
12430 }
12431 break;
12432 }
12433 }
12434 }
12435 }
12436
12437 extern int strncmp(const char * , const char * , size_t n);
12438
12439 struct __ecereNameSpace__ecere__sys__BTNode * __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindPrefix(struct __ecereNameSpace__ecere__sys__BinaryTree * this, char *  key);
12440
12441 static struct Symbol * ScanWithNameSpace(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, char * nameSpace, char * name)
12442 {
12443 int nsLen = strlen(nameSpace);
12444 struct Symbol * symbol;
12445
12446 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)))
12447 {
12448 char * s = symbol->string;
12449
12450 if(!strncmp(s, nameSpace, nsLen))
12451 {
12452 int c;
12453 char * namePart;
12454
12455 for(c = strlen(s) - 1; c >= 0; c--)
12456 if(s[c] == ':')
12457 break;
12458 namePart = s + c + 1;
12459 if(!strcmp(namePart, name))
12460 {
12461 return symbol;
12462 }
12463 }
12464 else
12465 break;
12466 }
12467 return (((void *)0));
12468 }
12469
12470 static struct Symbol * FindWithNameSpace(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, char * name)
12471 {
12472 int c;
12473 char nameSpace[1024];
12474 char * namePart;
12475 unsigned int gotColon = 0x0;
12476
12477 nameSpace[0] = '\0';
12478 for(c = strlen(name) - 1; c >= 0; c--)
12479 if(name[c] == ':')
12480 {
12481 gotColon = 0x1;
12482 break;
12483 }
12484 namePart = name + c + 1;
12485 while(c >= 0 && name[c] == ':')
12486 c--;
12487 if(c >= 0)
12488 {
12489 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, name);
12490
12491 if(symbol)
12492 return symbol;
12493 memcpy(nameSpace, name, c + 1);
12494 nameSpace[c + 1] = (char)0;
12495 return ScanWithNameSpace(tree, nameSpace, namePart);
12496 }
12497 else if(gotColon)
12498 {
12499 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, namePart);
12500
12501 return symbol;
12502 }
12503 else
12504 {
12505 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, namePart);
12506
12507 if(symbol)
12508 return symbol;
12509 return ScanWithNameSpace(tree, "", namePart);
12510 }
12511 return (((void *)0));
12512 }
12513
12514 static void ProcessDeclaration(struct Declaration * decl);
12515
12516 struct Symbol * FindSymbol(char * name, struct Context * startContext, struct Context * endContext, unsigned int isStruct, unsigned int globalNameSpace)
12517 {
12518 struct Context * ctx;
12519 struct Symbol * symbol = (((void *)0));
12520
12521 for(ctx = startContext; ctx && !symbol; ctx = ctx->parent)
12522 {
12523 if(ctx == globalContext && !globalNameSpace && ctx->hasNameSpace)
12524 {
12525 symbol = (((void *)0));
12526 if(thisNameSpace)
12527 {
12528 char curName[1024];
12529
12530 strcpy(curName, thisNameSpace);
12531 strcat(curName, "::");
12532 strcat(curName, name);
12533 symbol = FindWithNameSpace(isStruct ? &ctx->structSymbols : &ctx->symbols, curName);
12534 }
12535 if(!symbol)
12536 symbol = FindWithNameSpace(isStruct ? &ctx->structSymbols : &ctx->symbols, name);
12537 }
12538 else
12539 symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString((isStruct ? &ctx->structSymbols : &ctx->symbols), name);
12540 if(symbol || ctx == endContext)
12541 break;
12542 }
12543 if(inCompiler && curExternal && symbol && ctx == globalContext && curExternal->symbol && symbol->id > curExternal->symbol->idCode && symbol->pointerExternal)
12544 {
12545 if(symbol->pointerExternal->type == 0)
12546 {
12547 struct FunctionDefinition * function = symbol->pointerExternal->function;
12548 struct Context * tmpContext = curContext;
12549
12550 curContext = (((void *)0));
12551 symbol->pointerExternal = MkExternalDeclaration(MkDeclaration(CopyList(function->specifiers, CopySpecifier), MkListOne(MkInitDeclarator(CopyDeclarator(function->declarator), (((void *)0))))));
12552 curContext = tmpContext;
12553 symbol->pointerExternal->symbol = symbol;
12554 DeclareType(symbol->type, 0x1, 0x1);
12555 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, symbol->pointerExternal);
12556 symbol->id = curExternal->symbol->idCode;
12557 }
12558 else if(symbol->pointerExternal->type == 1 && curExternal->symbol->idCode < symbol->pointerExternal->symbol->id)
12559 {
12560 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
12561 symbol->id = curExternal->symbol->idCode;
12562 }
12563 }
12564 return symbol;
12565 }
12566
12567 static void GetTypeSpecs(struct Type * type, struct __ecereNameSpace__ecere__sys__OldList * specs)
12568 {
12569 if(!type->isSigned && type->kind != 22 && type->kind != 23)
12570 ListAdd(specs, MkSpecifier(UNSIGNED));
12571 switch(type->kind)
12572 {
12573 case 8:
12574 {
12575 if(type->_class->registered)
12576 {
12577 if(!type->_class->registered->dataType)
12578 type->_class->registered->dataType = ProcessTypeString(type->_class->registered->dataTypeString, 0x0);
12579 GetTypeSpecs(type->_class->registered->dataType, specs);
12580 }
12581 break;
12582 }
12583 case 7:
12584 ListAdd(specs, MkSpecifier(DOUBLE));
12585 break;
12586 case 6:
12587 ListAdd(specs, MkSpecifier(FLOAT));
12588 break;
12589 case 1:
12590 ListAdd(specs, MkSpecifier(CHAR));
12591 break;
12592 case 24:
12593 ListAdd(specs, MkSpecifier(_BOOL));
12594 break;
12595 case 2:
12596 ListAdd(specs, MkSpecifier(SHORT));
12597 break;
12598 case 4:
12599 ListAdd(specs, MkSpecifier(INT64));
12600 break;
12601 case 22:
12602 ListAdd(specs, MkSpecifierName(type->isSigned ? "intptr" : "uintptr"));
12603 break;
12604 case 23:
12605 ListAdd(specs, MkSpecifierName(type->isSigned ? "intsize" : "uintsize"));
12606 break;
12607 case 3:
12608 default:
12609 ListAdd(specs, MkSpecifier(INT));
12610 break;
12611 }
12612 }
12613
12614 static void PrintArraySize(struct Type * arrayType, char * string)
12615 {
12616 char size[256];
12617
12618 size[0] = '\0';
12619 strcat(size, "[");
12620 if(arrayType->enumClass)
12621 strcat(size, arrayType->enumClass->string);
12622 else if(arrayType->arraySizeExp)
12623 PrintExpression(arrayType->arraySizeExp, size);
12624 strcat(size, "]");
12625 strcat(string, size);
12626 }
12627
12628 static void PrintTypeSpecs(struct Type * type, char * string, unsigned int fullName, unsigned int printConst)
12629 {
12630 if(type)
12631 {
12632 if(printConst && type->constant)
12633 strcat(string, "const ");
12634 switch(type->kind)
12635 {
12636 case 8:
12637 {
12638 struct Symbol * c = type->_class;
12639
12640 if(type->classObjectType == 2)
12641 strcat(string, "typed_object");
12642 else if(type->classObjectType == 3)
12643 strcat(string, "any_object");
12644 else
12645 {
12646 if(c && c->string)
12647 strcat(string, (fullName || !c->registered) ? c->string : c->registered->name);
12648 }
12649 if(type->byReference)
12650 strcat(string, " &");
12651 break;
12652 }
12653 case 0:
12654 strcat(string, "void");
12655 break;
12656 case 3:
12657 strcat(string, type->isSigned ? "int" : "uint");
12658 break;
12659 case 4:
12660 strcat(string, type->isSigned ? "int64" : "uint64");
12661 break;
12662 case 22:
12663 strcat(string, type->isSigned ? "intptr" : "uintptr");
12664 break;
12665 case 23:
12666 strcat(string, type->isSigned ? "intsize" : "uintsize");
12667 break;
12668 case 1:
12669 strcat(string, type->isSigned ? "char" : "byte");
12670 break;
12671 case 24:
12672 strcat(string, "_Bool");
12673 break;
12674 case 2:
12675 strcat(string, type->isSigned ? "short" : "uint16");
12676 break;
12677 case 6:
12678 strcat(string, "float");
12679 break;
12680 case 7:
12681 strcat(string, "double");
12682 break;
12683 case 9:
12684 if(type->enumName)
12685 {
12686 strcat(string, "struct ");
12687 strcat(string, type->enumName);
12688 }
12689 else if(type->typeName)
12690 strcat(string, type->typeName);
12691 else
12692 {
12693 struct Type * member;
12694
12695 strcat(string, "struct { ");
12696 for(member = type->members.first; member; member = member->next)
12697 {
12698 PrintType(member, string, 0x1, fullName);
12699 strcat(string, "; ");
12700 }
12701 strcat(string, "}");
12702 }
12703 break;
12704 case 10:
12705 if(type->enumName)
12706 {
12707 strcat(string, "union ");
12708 strcat(string, type->enumName);
12709 }
12710 else if(type->typeName)
12711 strcat(string, type->typeName);
12712 else
12713 {
12714 strcat(string, "union ");
12715 strcat(string, "(unnamed)");
12716 }
12717 break;
12718 case 15:
12719 if(type->enumName)
12720 {
12721 strcat(string, "enum ");
12722 strcat(string, type->enumName);
12723 }
12724 else if(type->typeName)
12725 strcat(string, type->typeName);
12726 else
12727 strcat(string, "int");
12728 break;
12729 case 14:
12730 strcat(string, "...");
12731 break;
12732 case 19:
12733 strcat(string, "subclass(");
12734 strcat(string, type->_class ? type->_class->string : "int");
12735 strcat(string, ")");
12736 break;
12737 case 20:
12738 strcat(string, type->templateParameter->identifier->string);
12739 break;
12740 case 21:
12741 strcat(string, "thisclass");
12742 break;
12743 case 17:
12744 strcat(string, "__builtin_va_list");
12745 break;
12746 }
12747 }
12748 }
12749
12750 extern char *  __ecereNameSpace__ecere__sys__RSearchString(char *  buffer, char *  subStr, int maxLen, unsigned int matchCase, unsigned int matchWord);
12751
12752 static void PrintName(struct Type * type, char * string, unsigned int fullName)
12753 {
12754 if(type->name && type->name[0])
12755 {
12756 if(fullName)
12757 strcat(string, type->name);
12758 else
12759 {
12760 char * name = __ecereNameSpace__ecere__sys__RSearchString(type->name, "::", strlen(type->name), 0x1, 0x0);
12761
12762 if(name)
12763 name += 2;
12764 else
12765 name = type->name;
12766 strcat(string, name);
12767 }
12768 }
12769 }
12770
12771 static void PrintAttribs(struct Type * type, char * string)
12772 {
12773 if(type)
12774 {
12775 if(type->dllExport)
12776 strcat(string, "dllexport ");
12777 if(type->attrStdcall)
12778 strcat(string, "stdcall ");
12779 }
12780 }
12781
12782 static void PrePrintType(struct Type * type, char * string, unsigned int fullName, struct Type * parentType, unsigned int printConst)
12783 {
12784 if(type->kind == 12 || type->kind == 13 || type->kind == 11 || type->kind == 16)
12785 {
12786 struct Type * attrType = (((void *)0));
12787
12788 if((type->kind == 11 || type->kind == 16) && (!parentType || parentType->kind != 13))
12789 PrintAttribs(type, string);
12790 if(printConst && type->constant && (type->kind == 11 || type->kind == 16))
12791 strcat(string, " const");
12792 PrePrintType(type->kind == 16 ? type->method->dataType : type->type, string, fullName, type, printConst);
12793 if(type->kind == 13 && (type->type->kind == 12 || type->type->kind == 11 || type->type->kind == 16))
12794 strcat(string, " (");
12795 if(type->kind == 13)
12796 {
12797 if(type->type->kind == 11 || type->type->kind == 16)
12798 PrintAttribs(type->type, string);
12799 }
12800 if(type->kind == 13)
12801 {
12802 if(type->type->kind == 11 || type->type->kind == 16 || type->type->kind == 12)
12803 strcat(string, "*");
12804 else
12805 strcat(string, " *");
12806 }
12807 if(printConst && type->constant && type->kind == 13)
12808 strcat(string, " const");
12809 }
12810 else
12811 PrintTypeSpecs(type, string, fullName, printConst);
12812 }
12813
12814 static void PostPrintType(struct Type * type, char * string, unsigned int fullName)
12815 {
12816 if(type->kind == 13 && (type->type->kind == 12 || type->type->kind == 11 || type->type->kind == 16))
12817 strcat(string, ")");
12818 if(type->kind == 12)
12819 PrintArraySize(type, string);
12820 else if(type->kind == 11)
12821 {
12822 struct Type * param;
12823
12824 strcat(string, "(");
12825 for(param = type->params.first; param; param = param->next)
12826 {
12827 PrintType(param, string, 0x1, fullName);
12828 if(param->next)
12829 strcat(string, ", ");
12830 }
12831 strcat(string, ")");
12832 }
12833 if(type->kind == 12 || type->kind == 13 || type->kind == 11 || type->kind == 16)
12834 PostPrintType(type->kind == 16 ? type->method->dataType : type->type, string, fullName);
12835 }
12836
12837 static void _PrintType(struct Type * type, char * string, unsigned int printName, unsigned int fullName, unsigned int printConst)
12838 {
12839 PrePrintType(type, string, fullName, (((void *)0)), printConst);
12840 if(type->thisClass || (printName && type->name && type->name[0]))
12841 strcat(string, " ");
12842 if((type->thisClass || type->staticMethod))
12843 {
12844 struct Symbol * _class = type->thisClass;
12845
12846 if((type->classObjectType == 2 || type->classObjectType == 1) || (_class && !strcmp(_class->string, "class")))
12847 {
12848 if(type->classObjectType == 1)
12849 strcat(string, "class");
12850 else
12851 strcat(string, type->byReference ? "typed_object&" : "typed_object");
12852 }
12853 else if(_class && _class->string)
12854 {
12855 char * s = _class->string;
12856
12857 if(fullName)
12858 strcat(string, s);
12859 else
12860 {
12861 char * name = __ecereNameSpace__ecere__sys__RSearchString(s, "::", strlen(s), 0x1, 0x0);
12862
12863 if(name)
12864 name += 2;
12865 else
12866 name = s;
12867 strcat(string, name);
12868 }
12869 }
12870 strcat(string, "::");
12871 }
12872 if(printName && type->name)
12873 PrintName(type, string, fullName);
12874 PostPrintType(type, string, fullName);
12875 if(type->bitFieldCount)
12876 {
12877 char count[100];
12878
12879 sprintf(count, ":%d", type->bitFieldCount);
12880 strcat(string, count);
12881 }
12882 }
12883
12884 void PrintType(struct Type * type, char * string, unsigned int printName, unsigned int fullName)
12885 {
12886 _PrintType(type, string, printName, fullName, 0x1);
12887 }
12888
12889 void PrintTypeNoConst(struct Type * type, char * string, unsigned int printName, unsigned int fullName)
12890 {
12891 _PrintType(type, string, printName, fullName, 0x0);
12892 }
12893
12894 static struct Type * FindMember(struct Type * type, char * string)
12895 {
12896 struct Type * memberType;
12897
12898 for(memberType = type->members.first; memberType; memberType = memberType->next)
12899 {
12900 if(!memberType->name)
12901 {
12902 struct Type * subType = FindMember(memberType, string);
12903
12904 if(subType)
12905 return subType;
12906 }
12907 else if(!strcmp(memberType->name, string))
12908 return memberType;
12909 }
12910 return (((void *)0));
12911 }
12912
12913 struct Type * FindMemberAndOffset(struct Type * type, char * string, unsigned int * offset)
12914 {
12915 struct Type * memberType;
12916
12917 for(memberType = type->members.first; memberType; memberType = memberType->next)
12918 {
12919 if(!memberType->name)
12920 {
12921 struct Type * subType = FindMember(memberType, string);
12922
12923 if(subType)
12924 {
12925 *offset += memberType->offset;
12926 return subType;
12927 }
12928 }
12929 else if(!strcmp(memberType->name, string))
12930 {
12931 *offset += memberType->offset;
12932 return memberType;
12933 }
12934 }
12935 return (((void *)0));
12936 }
12937
12938 extern unsigned int parseError;
12939
12940 unsigned int GetParseError()
12941 {
12942 return parseError;
12943 }
12944
12945 extern struct __ecereNameSpace__ecere__com__Instance * fileInput;
12946
12947 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Write;
12948
12949 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__File;
12950
12951 struct Expression * ParseExpressionString(char * expression)
12952 {
12953 parseError = 0x0;
12954 fileInput = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
12955 ((int (*)(struct __ecereNameSpace__ecere__com__Instance *, void *  buffer, unsigned int size, unsigned int count))__extension__ ({
12956 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
12957
12958 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
12959 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Write])(fileInput, expression, 1, strlen(expression));
12960 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))__extension__ ({
12961 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
12962
12963 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
12964 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(fileInput, 0, 0);
12965 echoOn = 0x0;
12966 parsedExpression = (((void *)0));
12967 resetScanner();
12968 expression_yyparse();
12969 (__ecereNameSpace__ecere__com__eInstance_DecRef(fileInput), fileInput = 0);
12970 return parsedExpression;
12971 }
12972
12973 extern char *  QMkString(char *  source);
12974
12975 static unsigned int ResolveIdWithClass(struct Expression * exp, struct __ecereNameSpace__ecere__com__Class * _class, unsigned int skipIDClassCheck)
12976 {
12977 struct Identifier * id = exp->identifier;
12978 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
12979 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
12980 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
12981 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
12982
12983 if(_class && _class->type == 4)
12984 {
12985 struct __ecereNameSpace__ecere__sys__NamedLink * value = (((void *)0));
12986 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
12987
12988 if(enumClass)
12989 {
12990 struct __ecereNameSpace__ecere__com__Class * baseClass;
12991
12992 for(baseClass = _class; baseClass && baseClass->type == 4; baseClass = baseClass->base)
12993 {
12994 struct __ecereNameSpace__ecere__com__EnumClassData * e = (baseClass ? ((void *)(((char *)baseClass->data) + enumClass->offsetClass)) : (((void *)0)));
12995
12996 for(value = e->values.first; value; value = value->next)
12997 {
12998 if(!strcmp(value->name, id->string))
12999 break;
13000 }
13001 if(value)
13002 {
13003 char constant[256];
13004
13005 FreeExpContents(exp);
13006 exp->type = 2;
13007 exp->isConstant = 0x1;
13008 if(!strcmp(baseClass->dataTypeString, "int"))
13009 sprintf(constant, "%d", (int)value->data);
13010 else
13011 sprintf(constant, "0x%X", (int)value->data);
13012 exp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
13013 exp->expType = MkClassType(baseClass->fullName);
13014 break;
13015 }
13016 }
13017 }
13018 if(value)
13019 return 0x1;
13020 }
13021 if((method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule)))
13022 {
13023 ProcessMethodType(method);
13024 exp->expType = __extension__ ({
13025 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13026
13027 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 16, __ecereInstance1->method = method, __ecereInstance1->methodClass = (skipIDClassCheck || (id && id->_class)) ? _class : (((void *)0)), __ecereInstance1;
13028 });
13029 return 0x1;
13030 }
13031 else if((prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule)))
13032 {
13033 if(!prop->dataType)
13034 ProcessPropertyType(prop);
13035 exp->expType = prop->dataType;
13036 if(prop->dataType)
13037 prop->dataType->refCount++;
13038 return 0x1;
13039 }
13040 else if((member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)))))
13041 {
13042 if(!member->dataType)
13043 member->dataType = ProcessTypeString(member->dataTypeString, 0x0);
13044 exp->expType = member->dataType;
13045 if(member->dataType)
13046 member->dataType->refCount++;
13047 return 0x1;
13048 }
13049 else if((classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(_class, id->string)))
13050 {
13051 if(!classProp->dataType)
13052 classProp->dataType = ProcessTypeString(classProp->dataTypeString, 0x0);
13053 if(classProp->constant)
13054 {
13055 FreeExpContents(exp);
13056 exp->isConstant = 0x1;
13057 if(classProp->dataType->kind == 13 && classProp->dataType->type->kind == 1)
13058 {
13059 exp->type = 3;
13060 exp->constant = QMkString((char *)classProp->Get(_class));
13061 }
13062 else
13063 {
13064 char constant[256];
13065
13066 exp->type = 2;
13067 sprintf(constant, "%d", (int)classProp->Get(_class));
13068 exp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
13069 }
13070 }
13071 else
13072 {
13073 }
13074 exp->expType = classProp->dataType;
13075 if(classProp->dataType)
13076 classProp->dataType->refCount++;
13077 return 0x1;
13078 }
13079 return 0x0;
13080 }
13081
13082 static struct GlobalData * ScanGlobalData(struct __ecereNameSpace__ecere__com__NameSpace * nameSpace, char * name)
13083 {
13084 struct __ecereNameSpace__ecere__sys__BinaryTree * tree = &nameSpace->functions;
13085 struct GlobalData * data = (struct GlobalData *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString((&*tree), name);
13086 struct __ecereNameSpace__ecere__com__NameSpace * child;
13087
13088 if(!data)
13089 {
13090 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)))
13091 {
13092 data = ScanGlobalData(child, name);
13093 if(data)
13094 break;
13095 }
13096 }
13097 return data;
13098 }
13099
13100 extern struct __ecereNameSpace__ecere__com__NameSpace *  globalData;
13101
13102 extern char *  strncpy(char * , const char * , size_t n);
13103
13104 static struct GlobalData * FindGlobalData(char * name)
13105 {
13106 int start = 0, c;
13107 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
13108
13109 nameSpace = globalData;
13110 for(c = 0; name[c]; c++)
13111 {
13112 if(name[c] == '.' || (name[c] == ':' && name[c + 1] == ':'))
13113 {
13114 struct __ecereNameSpace__ecere__com__NameSpace * newSpace;
13115 char * spaceName = __ecereNameSpace__ecere__com__eSystem_New(sizeof(char) * (c - start + 1));
13116
13117 strncpy(spaceName, name + start, c - start);
13118 spaceName[c - start] = '\0';
13119 newSpace = (struct __ecereNameSpace__ecere__com__NameSpace *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(&(*nameSpace).nameSpaces, spaceName);
13120 (__ecereNameSpace__ecere__com__eSystem_Delete(spaceName), spaceName = 0);
13121 if(!newSpace)
13122 return (((void *)0));
13123 nameSpace = newSpace;
13124 if(name[c] == ':')
13125 c++;
13126 start = c + 1;
13127 }
13128 }
13129 if(c - start)
13130 {
13131 return ScanGlobalData(nameSpace, name + start);
13132 }
13133 return (((void *)0));
13134 }
13135
13136 static int definedExpStackPos;
13137
13138 static void * definedExpStack[512];
13139
13140 void ReplaceExpContents(struct Expression * checkedExp, struct Expression * newExp)
13141 {
13142 struct Expression * prev = checkedExp->prev, * next = checkedExp->next;
13143
13144 FreeExpContents(checkedExp);
13145 FreeType(checkedExp->expType);
13146 FreeType(checkedExp->destType);
13147 *checkedExp = *newExp;
13148 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
13149 checkedExp->prev = prev;
13150 checkedExp->next = next;
13151 }
13152
13153 extern struct Expression * MkExpCall(struct Expression * expression, struct __ecereNameSpace__ecere__sys__OldList * arguments);
13154
13155 extern int printf(char * , ...);
13156
13157 void __ecereMethod_Expression_Clear();
13158
13159 void ApplyAnyObjectLogic(struct Expression * e)
13160 {
13161 struct Type * destType = e->destType;
13162
13163 if(destType && (destType->classObjectType == 3))
13164 {
13165 if(e && e->expType)
13166 {
13167 struct Type * type = e->expType;
13168 struct __ecereNameSpace__ecere__com__Class * _class = (((void *)0));
13169
13170 if(type->kind == 8 && type->_class && type->_class->registered)
13171 {
13172 _class = type->_class->registered;
13173 }
13174 else if(type->kind == 19)
13175 {
13176 _class = FindClass("ecere::com::Class")->registered;
13177 }
13178 else
13179 {
13180 char string[1024] = "";
13181 struct Symbol * classSym;
13182
13183 PrintTypeNoConst(type, string, 0x0, 0x1);
13184 classSym = FindClass(string);
13185 if(classSym)
13186 _class = classSym->registered;
13187 }
13188 if((_class && (_class->type == 4 || _class->type == 3 || _class->type == 2 || _class->type == 1000) && strcmp(_class->fullName, "class") && strcmp(_class->fullName, "uintptr") && strcmp(_class->fullName, "intptr")) || (!e->expType->classObjectType && (((type->kind != 13 && type->kind != 22 && type->kind != 19 && (type->kind != 8 || !type->_class || !type->_class->registered || type->_class->registered->type == 1))) || destType->byReference)))
13189 {
13190 if(!_class || strcmp(_class->fullName, "char *"))
13191 {
13192 struct Expression * checkedExp = e, * newExp;
13193
13194 while(((checkedExp->type == 5 || checkedExp->type == 34 || checkedExp->type == 25) && checkedExp->list) || checkedExp->type == 11)
13195 {
13196 if(checkedExp->type == 5 || checkedExp->type == 34 || checkedExp->type == 25)
13197 {
13198 if(checkedExp->type == 25)
13199 {
13200 checkedExp = (*((struct Statement *)(*checkedExp->compound->compound.statements).last)->expressions).last;
13201 }
13202 else
13203 checkedExp = (*checkedExp->list).last;
13204 }
13205 else if(checkedExp->type == 11)
13206 checkedExp = checkedExp->cast.exp;
13207 }
13208 if(checkedExp && checkedExp->type == 4 && checkedExp->op.op == '*' && !checkedExp->op.exp1)
13209 {
13210 newExp = checkedExp->op.exp2;
13211 checkedExp->op.exp2 = (((void *)0));
13212 FreeExpContents(checkedExp);
13213 if(e->expType && e->expType->passAsTemplate)
13214 {
13215 char size[100];
13216
13217 ComputeTypeSize(e->expType);
13218 sprintf(size, "%d", e->expType->size);
13219 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))))));
13220 }
13221 ReplaceExpContents(checkedExp, newExp);
13222 e->byReference = 0x1;
13223 }
13224 else if(!e->byReference || (_class && _class->type == 5))
13225 {
13226 struct Expression * checkedExp, * newExp;
13227
13228 {
13229 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;
13230
13231 if(_class && _class->type != 5 && _class->type != 0 && _class->type != 1 && !hasAddress)
13232 {
13233 struct Context * context = PushContext();
13234 struct Declarator * decl;
13235 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13236 char typeString[1024];
13237 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
13238
13239 typeString[0] = '\0';
13240 *newExp = *e;
13241 newExp->prev = (((void *)0));
13242 newExp->next = (((void *)0));
13243 newExp->expType = (((void *)0));
13244 PrintTypeNoConst(e->expType, typeString, 0x0, 0x1);
13245 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
13246 newExp->destType = ProcessType(specs, decl);
13247 curContext = context;
13248 if(curCompound)
13249 {
13250 char name[100];
13251 struct __ecereNameSpace__ecere__sys__OldList * stmts = MkList();
13252
13253 e->type = 25;
13254 sprintf(name, "__internalValue%03X", internalValueCounter++);
13255 if(!curCompound->compound.declarations)
13256 curCompound->compound.declarations = MkList();
13257 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*curCompound->compound.declarations), (((void *)0)), MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(name)), (((void *)0))))));
13258 ListAdd(stmts, MkExpressionStmt(MkListOne(MkExpOp(MkExpIdentifier(MkIdentifier(name)), '=', newExp))));
13259 ListAdd(stmts, MkExpressionStmt(MkListOne(MkExpIdentifier(MkIdentifier(name)))));
13260 e->compound = MkCompoundStmt((((void *)0)), stmts);
13261 }
13262 else
13263 printf("libec: compiler error, curCompound is null in ApplyAnyObjectLogic\n");
13264 {
13265 struct Type * type = e->destType;
13266
13267 e->destType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13268 CopyTypeInto(e->destType, type);
13269 e->destType->refCount = 1;
13270 e->destType->classObjectType = 0;
13271 FreeType(type);
13272 }
13273 e->compound->compound.context = context;
13274 PopContext(context);
13275 curContext = context->parent;
13276 }
13277 }
13278 checkedExp = e;
13279 while(((checkedExp->type == 5 || checkedExp->type == 34 || checkedExp->type == 25) && checkedExp->list) || checkedExp->type == 11)
13280 {
13281 if(checkedExp->type == 5 || checkedExp->type == 34 || checkedExp->type == 25)
13282 {
13283 if(checkedExp->type == 25)
13284 {
13285 checkedExp = (*((struct Statement *)(*checkedExp->compound->compound.statements).last)->expressions).last;
13286 }
13287 else
13288 checkedExp = (*checkedExp->list).last;
13289 }
13290 else if(checkedExp->type == 11)
13291 checkedExp = checkedExp->cast.exp;
13292 }
13293 {
13294 struct Expression * operand = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
13295
13296 *operand = *checkedExp;
13297 checkedExp->destType = (((void *)0));
13298 checkedExp->expType = (((void *)0));
13299 __ecereMethod_Expression_Clear(checkedExp);
13300 checkedExp->type = 4;
13301 checkedExp->op.op = '&';
13302 checkedExp->op.exp1 = (((void *)0));
13303 checkedExp->op.exp2 = operand;
13304 }
13305 }
13306 }
13307 }
13308 }
13309 }
13310 {
13311 }
13312 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))))
13313 {
13314 if(e->expType->classObjectType && destType && destType->classObjectType)
13315 {
13316 return ;
13317 }
13318 else
13319 {
13320 struct Expression * thisExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
13321
13322 *thisExp = *e;
13323 thisExp->prev = (((void *)0));
13324 thisExp->next = (((void *)0));
13325 __ecereMethod_Expression_Clear(e);
13326 e->type = 5;
13327 e->list = MkListOne(MkExpOp((((void *)0)), '*', thisExp->type == 0 ? thisExp : MkExpBrackets(MkListOne(thisExp))));
13328 if(thisExp->expType->kind == 8 && thisExp->expType->_class && thisExp->expType->_class->registered && thisExp->expType->_class->registered->type == 5)
13329 ((struct Expression *)(*e->list).first)->byReference = 0x1;
13330 {
13331 e->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13332 CopyTypeInto(e->expType, thisExp->expType);
13333 e->expType->byReference = 0x0;
13334 e->expType->refCount = 1;
13335 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))
13336 {
13337 e->expType->classObjectType = 0;
13338 }
13339 }
13340 }
13341 }
13342 else if(destType && e->expType && (e->expType->classObjectType == 3 || e->expType->classObjectType == 2) && !destType->classObjectType && destType->kind != 0)
13343 {
13344 if(destType->kind == 14)
13345 {
13346 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Unspecified type\n", (((void *)0))));
13347 }
13348 else if(!(destType->truth && e->expType->kind == 8 && e->expType->_class && e->expType->_class->registered && e->expType->_class->registered->type == 1))
13349 {
13350 unsigned int byReference = e->expType->byReference;
13351 struct Expression * thisExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
13352 struct Declarator * decl;
13353 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13354 char typeString[1024];
13355 struct Type * type;
13356 int backupClassObjectType;
13357 unsigned int backupByReference;
13358
13359 if(e->expType->kind == 8 && e->expType->_class && e->expType->_class->registered && strcmp(e->expType->_class->registered->name, "class"))
13360 type = e->expType;
13361 else
13362 type = destType;
13363 backupClassObjectType = type->classObjectType;
13364 backupByReference = type->byReference;
13365 type->classObjectType = 0;
13366 type->byReference = 0x0;
13367 typeString[0] = '\0';
13368 PrintType(type, typeString, 0x0, 0x1);
13369 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
13370 type->classObjectType = backupClassObjectType;
13371 type->byReference = backupByReference;
13372 *thisExp = *e;
13373 thisExp->prev = (((void *)0));
13374 thisExp->next = (((void *)0));
13375 __ecereMethod_Expression_Clear(e);
13376 if((type->kind == 8 && type->_class && type->_class->registered && (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 != 22 && type->kind != 12 && type->kind != 8) || (!destType->byReference && byReference && (destType->kind != 13 || type->kind != 13)))
13377 {
13378 e->type = 4;
13379 e->op.op = '*';
13380 e->op.exp1 = (((void *)0));
13381 e->op.exp2 = MkExpCast(MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl)), thisExp);
13382 e->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13383 CopyTypeInto(e->expType, type);
13384 e->expType->byReference = 0x0;
13385 e->expType->refCount = 1;
13386 }
13387 else
13388 {
13389 e->type = 11;
13390 e->cast.typeName = MkTypeName(specs, decl);
13391 e->cast.exp = thisExp;
13392 e->byReference = 0x1;
13393 e->expType = type;
13394 type->refCount++;
13395 }
13396 e->destType = destType;
13397 destType->refCount++;
13398 }
13399 }
13400 }
13401
13402 extern char *  strstr(const char * , const char * );
13403
13404 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__DefinedExpression;
13405
13406 struct __ecereNameSpace__ecere__com__DefinedExpression
13407 {
13408 struct __ecereNameSpace__ecere__com__DefinedExpression * prev;
13409 struct __ecereNameSpace__ecere__com__DefinedExpression * next;
13410 char *  name;
13411 char *  value;
13412 struct __ecereNameSpace__ecere__com__NameSpace *  nameSpace;
13413 } __attribute__ ((gcc_struct));
13414
13415 extern struct __ecereNameSpace__ecere__com__DefinedExpression * __ecereNameSpace__ecere__com__eSystem_FindDefine(struct __ecereNameSpace__ecere__com__Instance * module, char *  name);
13416
13417 extern struct __ecereNameSpace__ecere__com__GlobalFunction * __ecereNameSpace__ecere__com__eSystem_FindFunction(struct __ecereNameSpace__ecere__com__Instance * module, char *  name);
13418
13419 extern unsigned int __ecereNameSpace__ecere__sys__UTF8GetChar(char *  string, int *  numBytes);
13420
13421 extern struct Expression * GetTemplateArgExp(struct TemplateParameter * param, struct __ecereNameSpace__ecere__com__Class * curClass, unsigned int pointer);
13422
13423 extern struct Expression * MkExpCondition(struct Expression * cond, struct __ecereNameSpace__ecere__sys__OldList * expressions, struct Expression * elseExp);
13424
13425 extern struct Expression * CopyExpression(struct Expression * exp);
13426
13427 extern struct Expression * MkExpTypeSize(struct TypeName * typeName);
13428
13429 extern struct Expression * MkExpClass(struct __ecereNameSpace__ecere__sys__OldList *  specifiers, struct Declarator * decl);
13430
13431 static void ProcessStatement(struct Statement * stmt);
13432
13433 extern struct Expression * MkExpExtensionInitializer(struct TypeName * typeName, struct Initializer * initializer);
13434
13435 extern struct Initializer * MkInitializerList(struct __ecereNameSpace__ecere__sys__OldList * list);
13436
13437 extern char *  __ecereNameSpace__ecere__com__PrintString(struct __ecereNameSpace__ecere__com__Class * class, void * object, ...);
13438
13439 extern char *  sourceFile;
13440
13441 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear(struct __ecereNameSpace__ecere__sys__OldList * this);
13442
13443 void ProcessExpressionType(struct Expression * exp)
13444 {
13445 unsigned int unresolved = 0x0;
13446 struct Location oldyylloc = yylloc;
13447 unsigned int notByReference = 0x0;
13448
13449 if(!exp || exp->expType)
13450 return ;
13451 yylloc = exp->loc;
13452 switch(exp->type)
13453 {
13454 case 0:
13455 {
13456 struct Identifier * id = exp->identifier;
13457
13458 if(!id)
13459 return ;
13460 if(id->_class && id->_class->name)
13461 {
13462 id->classSym = id->_class->symbol;
13463 }
13464 if(strstr(id->string, "__ecereClass") == id->string)
13465 {
13466 exp->expType = ProcessTypeString("ecere::com::Class", 0x1);
13467 break;
13468 }
13469 else if(id->_class && (id->classSym || (id->_class->name && !strcmp(id->_class->name, "property"))))
13470 {
13471 ReplaceClassMembers(exp, thisClass);
13472 if(exp->type != 0)
13473 {
13474 ProcessExpressionType(exp);
13475 break;
13476 }
13477 if(id->classSym && ResolveIdWithClass(exp, id->classSym->registered, 0x0))
13478 break;
13479 }
13480 else
13481 {
13482 struct Symbol * symbol = FindSymbol(id->string, curContext, topContext, 0x0, id->_class && id->_class->name == (((void *)0)));
13483
13484 if(!symbol)
13485 {
13486 if(exp->destType && CheckExpressionType(exp, exp->destType, 0x0))
13487 break;
13488 else
13489 {
13490 if(thisClass)
13491 {
13492 ReplaceClassMembers(exp, thisClass ? thisClass : currentClass);
13493 if(exp->type != 0)
13494 {
13495 ProcessExpressionType(exp);
13496 break;
13497 }
13498 }
13499 else if(currentClass && !id->_class)
13500 {
13501 if(ResolveIdWithClass(exp, currentClass, 0x1))
13502 break;
13503 }
13504 symbol = FindSymbol(id->string, topContext->parent, globalContext, 0x0, id->_class && id->_class->name == (((void *)0)));
13505 }
13506 }
13507 if(symbol)
13508 {
13509 struct Type * type = symbol->type;
13510 struct __ecereNameSpace__ecere__com__Class * _class = (type && type->kind == 8 && type->_class) ? type->_class->registered : (((void *)0));
13511
13512 if(_class && !strcmp(id->string, "this") && !type->classObjectType)
13513 {
13514 struct Context * context = SetupTemplatesContext(_class);
13515
13516 type = ReplaceThisClassType(_class);
13517 FinishTemplatesContext(context);
13518 if(type)
13519 type->refCount = 0;
13520 }
13521 FreeSpecifier(id->_class);
13522 id->_class = (((void *)0));
13523 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
13524 id->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
13525 id->classSym = (((void *)0));
13526 exp->expType = type;
13527 if(type)
13528 type->refCount++;
13529 if(type && (type->kind == 15 || (_class && _class->type == 4)))
13530 exp->isConstant = 0x1;
13531 if(symbol->isParam || !strcmp(id->string, "this"))
13532 {
13533 if(_class && _class->type == 1 && !type->declaredWithStruct)
13534 exp->byReference = 0x1;
13535 }
13536 if(symbol->isIterator)
13537 {
13538 if(symbol->isIterator == 3)
13539 {
13540 exp->type = 5;
13541 exp->list = MkListOne(MkExpOp((((void *)0)), '*', MkExpIdentifier(exp->identifier)));
13542 ((struct Expression *)(*exp->list).first)->op.exp2->expType = exp->expType;
13543 exp->expType = (((void *)0));
13544 ProcessExpressionType(exp);
13545 }
13546 else if(symbol->isIterator != 4)
13547 {
13548 exp->type = 8;
13549 exp->member.exp = MkExpIdentifier(exp->identifier);
13550 exp->member.exp->expType = exp->expType;
13551 exp->member.member = MkIdentifier("data");
13552 exp->expType = (((void *)0));
13553 ProcessExpressionType(exp);
13554 }
13555 }
13556 break;
13557 }
13558 else
13559 {
13560 struct __ecereNameSpace__ecere__com__DefinedExpression * definedExp = (((void *)0));
13561
13562 if(thisNameSpace && !(id->_class && !id->_class->name))
13563 {
13564 char name[1024];
13565
13566 strcpy(name, thisNameSpace);
13567 strcat(name, "::");
13568 strcat(name, id->string);
13569 definedExp = __ecereNameSpace__ecere__com__eSystem_FindDefine(privateModule, name);
13570 }
13571 if(!definedExp)
13572 definedExp = __ecereNameSpace__ecere__com__eSystem_FindDefine(privateModule, id->string);
13573 if(definedExp)
13574 {
13575 int c;
13576
13577 for(c = 0; c < definedExpStackPos; c++)
13578 if(definedExpStack[c] == definedExp)
13579 break;
13580 if(c == definedExpStackPos && c < sizeof definedExpStack / sizeof(void *))
13581 {
13582 struct Location backupYylloc = yylloc;
13583
13584 definedExpStack[definedExpStackPos++] = definedExp;
13585 fileInput = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
13586 ((int (*)(struct __ecereNameSpace__ecere__com__Instance *, void *  buffer, unsigned int size, unsigned int count))__extension__ ({
13587 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
13588
13589 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
13590 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Write])(fileInput, definedExp->value, 1, strlen(definedExp->value));
13591 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))__extension__ ({
13592 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
13593
13594 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
13595 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(fileInput, 0, 0);
13596 echoOn = 0x0;
13597 parsedExpression = (((void *)0));
13598 resetScanner();
13599 expression_yyparse();
13600 (__ecereNameSpace__ecere__com__eInstance_DecRef(fileInput), fileInput = 0);
13601 yylloc = backupYylloc;
13602 if(parsedExpression)
13603 {
13604 FreeIdentifier(id);
13605 exp->type = 5;
13606 exp->list = MkListOne(parsedExpression);
13607 parsedExpression->loc = yylloc;
13608 ProcessExpressionType(exp);
13609 definedExpStackPos--;
13610 return ;
13611 }
13612 definedExpStackPos--;
13613 }
13614 else
13615 {
13616 if(inCompiler)
13617 {
13618 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Recursion in defined expression %s\n", (((void *)0))), id->string);
13619 }
13620 }
13621 }
13622 else
13623 {
13624 struct GlobalData * data = (((void *)0));
13625
13626 if(thisNameSpace && !(id->_class && !id->_class->name))
13627 {
13628 char name[1024];
13629
13630 strcpy(name, thisNameSpace);
13631 strcat(name, "::");
13632 strcat(name, id->string);
13633 data = FindGlobalData(name);
13634 }
13635 if(!data)
13636 data = FindGlobalData(id->string);
13637 if(data)
13638 {
13639 DeclareGlobalData(data);
13640 exp->expType = data->dataType;
13641 if(data->dataType)
13642 data->dataType->refCount++;
13643 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
13644 id->string = __ecereNameSpace__ecere__sys__CopyString(data->fullName);
13645 FreeSpecifier(id->_class);
13646 id->_class = (((void *)0));
13647 break;
13648 }
13649 else
13650 {
13651 struct __ecereNameSpace__ecere__com__GlobalFunction * function = (((void *)0));
13652
13653 if(thisNameSpace && !(id->_class && !id->_class->name))
13654 {
13655 char name[1024];
13656
13657 strcpy(name, thisNameSpace);
13658 strcat(name, "::");
13659 strcat(name, id->string);
13660 function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, name);
13661 }
13662 if(!function)
13663 function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, id->string);
13664 if(function)
13665 {
13666 char name[1024];
13667
13668 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
13669 id->string = __ecereNameSpace__ecere__sys__CopyString(function->name);
13670 name[0] = (char)0;
13671 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType != 1 && (!function->dataType || !function->dataType->dllExport))
13672 strcpy(name, "__ecereFunction_");
13673 FullClassNameCat(name, id->string, 0x0);
13674 if(DeclareFunction(function, name))
13675 {
13676 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
13677 id->string = __ecereNameSpace__ecere__sys__CopyString(name);
13678 }
13679 exp->expType = function->dataType;
13680 if(function->dataType)
13681 function->dataType->refCount++;
13682 FreeSpecifier(id->_class);
13683 id->_class = (((void *)0));
13684 break;
13685 }
13686 }
13687 }
13688 }
13689 }
13690 unresolved = 0x1;
13691 break;
13692 }
13693 case 1:
13694 {
13695 struct __ecereNameSpace__ecere__com__Class * _class;
13696
13697 if(!exp->instance->_class)
13698 {
13699 if(exp->destType && exp->destType->kind == 8 && exp->destType->_class)
13700 {
13701 exp->instance->_class = MkSpecifierName(exp->destType->_class->string);
13702 }
13703 }
13704 ProcessInstantiationType(exp->instance);
13705 exp->isConstant = exp->instance->isConstant;
13706 if(exp->instance->_class)
13707 {
13708 exp->expType = MkClassType(exp->instance->_class->name);
13709 }
13710 break;
13711 }
13712 case 2:
13713 {
13714 if(!exp->expType)
13715 {
13716 char * constant = exp->constant;
13717 struct Type * type = (type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), type->refCount = 1, type->constant = 0x1, type);
13718
13719 exp->expType = type;
13720 if(constant[0] == '\'')
13721 {
13722 if((int)((unsigned char *)constant)[1] > 127)
13723 {
13724 int nb;
13725 unsigned int ch = __ecereNameSpace__ecere__sys__UTF8GetChar(constant + 1, &nb);
13726
13727 if(nb < 2)
13728 ch = constant[1];
13729 (__ecereNameSpace__ecere__com__eSystem_Delete(constant), constant = 0);
13730 exp->constant = PrintUInt(ch);
13731 type->kind = 8;
13732 type->_class = FindClass("unichar");
13733 type->isSigned = 0x0;
13734 }
13735 else
13736 {
13737 type->kind = 1;
13738 type->isSigned = 0x1;
13739 }
13740 }
13741 else
13742 {
13743 char * dot = strchr(constant, '.');
13744 unsigned int isHex = (constant[0] == '0' && (constant[1] == 'x' || constant[1] == 'X'));
13745 char * exponent;
13746
13747 if(isHex)
13748 {
13749 exponent = strchr(constant, 'p');
13750 if(!exponent)
13751 exponent = strchr(constant, 'P');
13752 }
13753 else
13754 {
13755 exponent = strchr(constant, 'e');
13756 if(!exponent)
13757 exponent = strchr(constant, 'E');
13758 }
13759 if(dot || exponent)
13760 {
13761 if(strchr(constant, 'f') || strchr(constant, 'F'))
13762 type->kind = 6;
13763 else
13764 type->kind = 7;
13765 type->isSigned = 0x1;
13766 }
13767 else
13768 {
13769 unsigned int isSigned = constant[0] == '-';
13770 long long i64 = strtoll(constant, (((void *)0)), 0);
13771 uint64 ui64 = strtoull(constant, (((void *)0)), 0);
13772 unsigned int is64Bit = 0x0;
13773
13774 if(isSigned)
13775 {
13776 if(i64 < (((int)0x80000000)))
13777 is64Bit = 0x1;
13778 }
13779 else
13780 {
13781 if(ui64 > (((int)0x7fffffff)))
13782 {
13783 if(ui64 > (0xffffffff))
13784 {
13785 is64Bit = 0x1;
13786 if(ui64 <= (((long long)0x7fffffffffffffffLL)) && (constant[0] != '0' || !constant[1]))
13787 isSigned = 0x1;
13788 }
13789 }
13790 else if(constant[0] != '0' || !constant[1])
13791 isSigned = 0x1;
13792 }
13793 type->kind = is64Bit ? 4 : 3;
13794 type->isSigned = isSigned;
13795 }
13796 }
13797 exp->isConstant = 0x1;
13798 if(exp->destType && exp->destType->kind == 7)
13799 type->kind = 7;
13800 else if(exp->destType && exp->destType->kind == 6)
13801 type->kind = 6;
13802 else if(exp->destType && exp->destType->kind == 4)
13803 type->kind = 4;
13804 }
13805 break;
13806 }
13807 case 3:
13808 {
13809 exp->isConstant = 0x1;
13810 exp->expType = __extension__ ({
13811 struct Type * __ecereInstance2 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13812
13813 __ecereInstance2->refCount = 1, __ecereInstance2->kind = 13, __ecereInstance2->type = __extension__ ({
13814 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13815
13816 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 1, __ecereInstance1->constant = 0x1, __ecereInstance1->isSigned = 0x1, __ecereInstance1;
13817 }), __ecereInstance2;
13818 });
13819 break;
13820 }
13821 case 13:
13822 case 28:
13823 ProcessExpressionType(exp->_new.size);
13824 exp->expType = __extension__ ({
13825 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13826
13827 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 13, __ecereInstance1->type = ProcessType(exp->_new.typeName->qualifiers, exp->_new.typeName->declarator), __ecereInstance1;
13828 });
13829 DeclareType(exp->expType->type, 0x0, 0x0);
13830 break;
13831 case 14:
13832 case 29:
13833 ProcessExpressionType(exp->_renew.size);
13834 ProcessExpressionType(exp->_renew.exp);
13835 exp->expType = __extension__ ({
13836 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13837
13838 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 13, __ecereInstance1->type = ProcessType(exp->_renew.typeName->qualifiers, exp->_renew.typeName->declarator), __ecereInstance1;
13839 });
13840 DeclareType(exp->expType->type, 0x0, 0x0);
13841 break;
13842 case 4:
13843 {
13844 unsigned int assign = 0x0, boolResult = 0x0, boolOps = 0x0;
13845 struct Type * type1 = (((void *)0)), * type2 = (((void *)0));
13846 unsigned int useDestType = 0x0, useSideType = 0x0;
13847 struct Location oldyylloc = yylloc;
13848 unsigned int useSideUnit = 0x0;
13849 struct Type * dummy = (dummy = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), dummy->count = 1, dummy->refCount = 1, dummy);
13850
13851 switch(exp->op.op)
13852 {
13853 case '=':
13854 case MUL_ASSIGN:
13855 case DIV_ASSIGN:
13856 case MOD_ASSIGN:
13857 case ADD_ASSIGN:
13858 case SUB_ASSIGN:
13859 case LEFT_ASSIGN:
13860 case RIGHT_ASSIGN:
13861 case AND_ASSIGN:
13862 case XOR_ASSIGN:
13863 case OR_ASSIGN:
13864 assign = 0x1;
13865 break;
13866 case '!':
13867 break;
13868 case AND_OP:
13869 case OR_OP:
13870 boolOps = 0x1;
13871 boolResult = 0x1;
13872 break;
13873 case EQ_OP:
13874 case '<':
13875 case '>':
13876 case LE_OP:
13877 case GE_OP:
13878 case NE_OP:
13879 boolResult = 0x1;
13880 useSideType = 0x1;
13881 break;
13882 case '+':
13883 case '-':
13884 useSideUnit = 0x1;
13885 case '|':
13886 case '&':
13887 case '^':
13888 case '/':
13889 case '%':
13890 case '*':
13891 if(exp->op.op != '*' || exp->op.exp1)
13892 {
13893 useSideType = 0x1;
13894 useDestType = 0x1;
13895 }
13896 break;
13897 }
13898 if(exp->op.op == '&')
13899 {
13900 if(!exp->op.exp1 && exp->op.exp2 && exp->op.exp2->type == 0 && exp->op.exp2->identifier)
13901 {
13902 struct Identifier * id = exp->op.exp2->identifier;
13903 struct Symbol * symbol = FindSymbol(id->string, curContext, topContext, 0x0, id->_class && id->_class->name == (((void *)0)));
13904
13905 if(symbol && symbol->isIterator == 2)
13906 {
13907 exp->type = 8;
13908 exp->member.exp = exp->op.exp2;
13909 exp->member.member = MkIdentifier("key");
13910 exp->expType = (((void *)0));
13911 exp->op.exp2->expType = symbol->type;
13912 symbol->type->refCount++;
13913 ProcessExpressionType(exp);
13914 FreeType(dummy);
13915 break;
13916 }
13917 }
13918 }
13919 if(exp->op.exp1)
13920 {
13921 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))
13922 {
13923 if(exp->op.exp1->destType)
13924 FreeType(exp->op.exp1->destType);
13925 exp->op.exp1->destType = exp->destType;
13926 if(exp->destType)
13927 exp->destType->refCount++;
13928 }
13929 else if(!assign)
13930 {
13931 if(exp->op.exp1->destType)
13932 FreeType(exp->op.exp1->destType);
13933 exp->op.exp1->destType = dummy;
13934 dummy->refCount++;
13935 }
13936 if(exp->op.exp1->destType && exp->op.op != '=')
13937 exp->op.exp1->destType->count++;
13938 ProcessExpressionType(exp->op.exp1);
13939 if(exp->op.exp1->destType && exp->op.op != '=')
13940 exp->op.exp1->destType->count--;
13941 if(exp->op.exp1->destType == dummy)
13942 {
13943 FreeType(dummy);
13944 exp->op.exp1->destType = (((void *)0));
13945 }
13946 type1 = exp->op.exp1->expType;
13947 }
13948 if(exp->op.exp2)
13949 {
13950 char expString[10240];
13951
13952 expString[0] = '\0';
13953 if(exp->op.exp2->type == 1 && !exp->op.exp2->instance->_class)
13954 {
13955 if(exp->op.exp1)
13956 {
13957 exp->op.exp2->destType = exp->op.exp1->expType;
13958 if(exp->op.exp1->expType)
13959 exp->op.exp1->expType->refCount++;
13960 }
13961 else
13962 {
13963 exp->op.exp2->destType = exp->destType;
13964 if(exp->destType)
13965 exp->destType->refCount++;
13966 }
13967 if(type1)
13968 type1->refCount++;
13969 exp->expType = type1;
13970 }
13971 else if(assign)
13972 {
13973 if(inCompiler)
13974 PrintExpression(exp->op.exp2, expString);
13975 if(type1 && type1->kind == 13)
13976 {
13977 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)
13978 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "operator %s illegal on pointer\n", (((void *)0))), exp->op.op);
13979 else if(exp->op.op == '=')
13980 {
13981 if(exp->op.exp2->destType)
13982 FreeType(exp->op.exp2->destType);
13983 exp->op.exp2->destType = type1;
13984 if(type1)
13985 type1->refCount++;
13986 }
13987 }
13988 else
13989 {
13990 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)
13991 ;
13992 else
13993 {
13994 if(exp->op.exp2->destType)
13995 FreeType(exp->op.exp2->destType);
13996 exp->op.exp2->destType = type1;
13997 if(type1)
13998 type1->refCount++;
13999 }
14000 }
14001 if(type1)
14002 type1->refCount++;
14003 exp->expType = type1;
14004 }
14005 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)))
14006 {
14007 if(exp->op.exp2->destType)
14008 FreeType(exp->op.exp2->destType);
14009 exp->op.exp2->destType = exp->destType;
14010 if(exp->destType)
14011 exp->destType->refCount++;
14012 }
14013 else
14014 {
14015 if(exp->op.exp2->destType)
14016 FreeType(exp->op.exp2->destType);
14017 exp->op.exp2->destType = dummy;
14018 dummy->refCount++;
14019 }
14020 if(type1 && boolResult && useSideType && type1->kind == 8 && type1->_class && type1->_class->registered && (type1->_class->registered->type == 2 || type1->_class->registered->type == 4))
14021 {
14022 FreeType(exp->op.exp2->destType);
14023 exp->op.exp2->destType = type1;
14024 type1->refCount++;
14025 }
14026 if(exp->op.exp2->destType && exp->op.op != '=')
14027 exp->op.exp2->destType->count++;
14028 ProcessExpressionType(exp->op.exp2);
14029 if(exp->op.exp2->destType && exp->op.op != '=')
14030 exp->op.exp2->destType->count--;
14031 if(assign && type1 && type1->kind == 13 && exp->op.exp2->expType)
14032 {
14033 if(exp->op.exp2->expType->kind == 23 || exp->op.exp2->expType->kind == 22 || exp->op.exp2->expType->kind == 4 || exp->op.exp2->expType->kind == 3 || exp->op.exp2->expType->kind == 2 || exp->op.exp2->expType->kind == 1)
14034 {
14035 if(exp->op.op != '=' && type1->type->kind == 0)
14036 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "void *: unknown size\n", (((void *)0))));
14037 }
14038 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)))
14039 {
14040 if(exp->op.op == ADD_ASSIGN)
14041 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "cannot add two pointers\n", (((void *)0))));
14042 }
14043 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))
14044 {
14045 if(exp->op.op == ADD_ASSIGN)
14046 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "cannot add two pointers\n", (((void *)0))));
14047 }
14048 else if(inCompiler)
14049 {
14050 char type1String[1024];
14051 char type2String[1024];
14052
14053 type1String[0] = '\0';
14054 type2String[0] = '\0';
14055 PrintType(exp->op.exp2->expType, type1String, 0x0, 0x1);
14056 PrintType(type1, type2String, 0x0, 0x1);
14057 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14058 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expression %s (%s); expected %s\n", (((void *)0))), expString, type1String, type2String);
14059 }
14060 }
14061 if(exp->op.exp2->destType == dummy)
14062 {
14063 FreeType(dummy);
14064 exp->op.exp2->destType = (((void *)0));
14065 }
14066 if(exp->op.op == '-' && !exp->op.exp1 && exp->op.exp2->expType && !exp->op.exp2->expType->isSigned)
14067 {
14068 type2 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14069 type2->refCount = 1;
14070 CopyTypeInto(type2, exp->op.exp2->expType);
14071 type2->isSigned = 0x1;
14072 }
14073 else if(exp->op.op == '~' && !exp->op.exp1 && exp->op.exp2->expType && (!exp->op.exp2->expType->isSigned || exp->op.exp2->expType->kind != 3))
14074 {
14075 type2 = __extension__ ({
14076 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14077
14078 __ecereInstance1->kind = 3, __ecereInstance1;
14079 });
14080 type2->refCount = 1;
14081 type2->isSigned = 0x1;
14082 }
14083 else
14084 {
14085 type2 = exp->op.exp2->expType;
14086 if(type2)
14087 type2->refCount++;
14088 }
14089 }
14090 dummy->kind = 0;
14091 if(exp->op.op == SIZEOF)
14092 {
14093 exp->expType = __extension__ ({
14094 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14095
14096 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 3, __ecereInstance1;
14097 });
14098 exp->isConstant = 0x1;
14099 }
14100 else if(exp->op.op == '*' && !exp->op.exp1)
14101 {
14102 exp->expType = Dereference(type2);
14103 if(type2 && type2->kind == 8)
14104 notByReference = 0x1;
14105 }
14106 else if(exp->op.op == '&' && !exp->op.exp1)
14107 exp->expType = Reference(type2);
14108 else if(!assign)
14109 {
14110 if(boolOps)
14111 {
14112 if(exp->op.exp1)
14113 {
14114 if(exp->op.exp1->destType)
14115 FreeType(exp->op.exp1->destType);
14116 exp->op.exp1->destType = MkClassType("bool");
14117 exp->op.exp1->destType->truth = 0x1;
14118 if(!exp->op.exp1->expType)
14119 ProcessExpressionType(exp->op.exp1);
14120 else
14121 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
14122 FreeType(exp->op.exp1->expType);
14123 exp->op.exp1->expType = MkClassType("bool");
14124 exp->op.exp1->expType->truth = 0x1;
14125 }
14126 if(exp->op.exp2)
14127 {
14128 if(exp->op.exp2->destType)
14129 FreeType(exp->op.exp2->destType);
14130 exp->op.exp2->destType = MkClassType("bool");
14131 exp->op.exp2->destType->truth = 0x1;
14132 if(!exp->op.exp2->expType)
14133 ProcessExpressionType(exp->op.exp2);
14134 else
14135 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
14136 FreeType(exp->op.exp2->expType);
14137 exp->op.exp2->expType = MkClassType("bool");
14138 exp->op.exp2->expType->truth = 0x1;
14139 }
14140 }
14141 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")))))
14142 {
14143 if(type1 && type2 && ((type1->kind == 8 && type1->_class && strcmp(type1->_class->string, "String")) == (type2->kind == 8 && type2->_class && strcmp(type2->_class->string, "String"))))
14144 {
14145 if(exp->op.exp2->destType)
14146 FreeType(exp->op.exp2->destType);
14147 exp->op.exp2->destType = type1;
14148 type1->refCount++;
14149 if(exp->op.exp1->destType)
14150 FreeType(exp->op.exp1->destType);
14151 exp->op.exp1->destType = type2;
14152 type2->refCount++;
14153 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)
14154 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "operating on %s and %s with an untyped result, assuming %s\n", (((void *)0))), type1->_class->string, type2->_class->string, type1->_class->string);
14155 if(type1->kind == 13 && type1->type->kind == 20 && type2->kind != 13)
14156 {
14157 struct Expression * argExp = GetTemplateArgExp(type1->type->templateParameter, thisClass, 0x1);
14158
14159 if(argExp)
14160 {
14161 struct Expression * classExp = MkExpMember(argExp, MkIdentifier("dataTypeClass"));
14162
14163 exp->op.exp1 = MkExpBrackets(MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName("byte")), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), exp->op.exp1)));
14164 ProcessExpressionType(exp->op.exp1);
14165 if(type2->kind != 13)
14166 {
14167 ProcessExpressionType(classExp);
14168 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"))))))));
14169 if(!exp->op.exp2->expType)
14170 {
14171 if(type2)
14172 FreeType(type2);
14173 type2 = exp->op.exp2->expType = ProcessTypeString("int", 0x0);
14174 type2->refCount++;
14175 }
14176 ProcessExpressionType(exp->op.exp2);
14177 }
14178 }
14179 }
14180 if(!boolResult && ((type1->kind == 13 || type1->kind == 12 || (type1->kind == 8 && !strcmp(type1->_class->string, "String"))) && (type2->kind == 23 || type2->kind == 22 || type2->kind == 4 || type2->kind == 3 || type2->kind == 2 || type2->kind == 1)))
14181 {
14182 if(type1->kind != 8 && type1->type->kind == 0)
14183 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "void *: unknown size\n", (((void *)0))));
14184 exp->expType = type1;
14185 if(type1)
14186 type1->refCount++;
14187 }
14188 else if(!boolResult && ((type2->kind == 13 || type2->kind == 12 || (type2->kind == 8 && !strcmp(type2->_class->string, "String"))) && (type1->kind == 23 || type1->kind == 22 || type1->kind == 4 || type1->kind == 3 || type1->kind == 2 || type1->kind == 1)))
14189 {
14190 if(type2->kind != 8 && type2->type->kind == 0)
14191 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "void *: unknown size\n", (((void *)0))));
14192 exp->expType = type2;
14193 if(type2)
14194 type2->refCount++;
14195 }
14196 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))
14197 {
14198 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "different levels of indirection\n", (((void *)0))));
14199 }
14200 else
14201 {
14202 unsigned int success = 0x0;
14203
14204 if(type1->kind == 13 && type2->kind == 13)
14205 {
14206 if(exp->op.op == '+')
14207 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "cannot add two pointers\n", (((void *)0))));
14208 else if(exp->op.op == '-')
14209 {
14210 if(MatchTypes(type1->type, type2->type, (((void *)0)), (((void *)0)), (((void *)0)), 0x0, 0x0, 0x0, 0x0))
14211 {
14212 exp->expType = __extension__ ({
14213 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14214
14215 __ecereInstance1->kind = 3, __ecereInstance1->refCount = 1, __ecereInstance1;
14216 });
14217 success = 0x1;
14218 if(type1->type->kind == 20)
14219 {
14220 struct Expression * argExp = GetTemplateArgExp(type1->type->templateParameter, thisClass, 0x1);
14221
14222 if(argExp)
14223 {
14224 struct Expression * classExp = MkExpMember(argExp, MkIdentifier("dataTypeClass"));
14225
14226 ProcessExpressionType(classExp);
14227 exp->type = 5;
14228 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")))))));
14229 ProcessExpressionType(((struct Expression *)(*exp->list).first)->op.exp2);
14230 FreeType(dummy);
14231 return ;
14232 }
14233 }
14234 }
14235 }
14236 }
14237 if(!success && exp->op.exp1->type == 2)
14238 {
14239 if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
14240 {
14241 if(exp->expType)
14242 FreeType(exp->expType);
14243 exp->expType = exp->op.exp1->destType;
14244 if(exp->op.exp1->destType)
14245 exp->op.exp1->destType->refCount++;
14246 success = 0x1;
14247 }
14248 else if(CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0))
14249 {
14250 if(exp->expType)
14251 FreeType(exp->expType);
14252 exp->expType = exp->op.exp2->destType;
14253 if(exp->op.exp2->destType)
14254 exp->op.exp2->destType->refCount++;
14255 success = 0x1;
14256 }
14257 }
14258 else if(!success)
14259 {
14260 if(CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0))
14261 {
14262 if(exp->expType)
14263 FreeType(exp->expType);
14264 exp->expType = exp->op.exp2->destType;
14265 if(exp->op.exp2->destType)
14266 exp->op.exp2->destType->refCount++;
14267 success = 0x1;
14268 }
14269 else if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
14270 {
14271 if(exp->expType)
14272 FreeType(exp->expType);
14273 exp->expType = exp->op.exp1->destType;
14274 if(exp->op.exp1->destType)
14275 exp->op.exp1->destType->refCount++;
14276 success = 0x1;
14277 }
14278 }
14279 if(!success)
14280 {
14281 char expString1[10240];
14282 char expString2[10240];
14283 char type1[1024];
14284 char type2[1024];
14285
14286 expString1[0] = '\0';
14287 expString2[0] = '\0';
14288 type1[0] = '\0';
14289 type2[0] = '\0';
14290 if(inCompiler)
14291 {
14292 PrintExpression(exp->op.exp1, expString1);
14293 __ecereNameSpace__ecere__sys__ChangeCh(expString1, '\n', ' ');
14294 PrintExpression(exp->op.exp2, expString2);
14295 __ecereNameSpace__ecere__sys__ChangeCh(expString2, '\n', ' ');
14296 PrintType(exp->op.exp1->expType, type1, 0x0, 0x1);
14297 PrintType(exp->op.exp2->expType, type2, 0x0, 0x1);
14298 }
14299 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expressions %s (%s) and %s (%s)\n", (((void *)0))), expString1, type1, expString2, type2);
14300 }
14301 }
14302 }
14303 else if(!boolResult && (!useSideUnit) && type2 && type1 && type2->kind == 8 && type1->kind != 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 3)
14304 {
14305 if(exp->op.exp1->destType)
14306 FreeType(exp->op.exp1->destType);
14307 exp->op.exp1->destType = type2->_class->registered->dataType;
14308 if(type2->_class->registered->dataType)
14309 type2->_class->registered->dataType->refCount++;
14310 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
14311 exp->expType = type2;
14312 if(type2)
14313 type2->refCount++;
14314 }
14315 else if(!boolResult && (!useSideUnit) && type1 && type2 && type1->kind == 8 && type2->kind != 8 && type1->_class && type1->_class->registered && type1->_class->registered->type == 3)
14316 {
14317 if(exp->op.exp2->destType)
14318 FreeType(exp->op.exp2->destType);
14319 exp->op.exp2->destType = type1->_class->registered->dataType;
14320 if(type1->_class->registered->dataType)
14321 type1->_class->registered->dataType->refCount++;
14322 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
14323 exp->expType = type1;
14324 if(type1)
14325 type1->refCount++;
14326 }
14327 else if(type1)
14328 {
14329 unsigned int valid = 0x0;
14330
14331 if(!boolResult && useSideUnit && type1 && type1->kind == 8 && type1->_class->registered && type1->_class->registered->type == 3 && type2 && type2->kind != 8)
14332 {
14333 if(exp->op.exp2->destType)
14334 FreeType(exp->op.exp2->destType);
14335 if(!type1->_class->registered->dataType)
14336 type1->_class->registered->dataType = ProcessTypeString(type1->_class->registered->dataTypeString, 0x0);
14337 exp->op.exp2->destType = type1->_class->registered->dataType;
14338 exp->op.exp2->destType->refCount++;
14339 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
14340 if(type2)
14341 FreeType(type2);
14342 type2 = exp->op.exp2->destType;
14343 if(type2)
14344 type2->refCount++;
14345 exp->expType = type2;
14346 type2->refCount++;
14347 }
14348 if(!boolResult && useSideUnit && type2 && type2->kind == 8 && type2->_class->registered && type2->_class->registered->type == 3 && type1 && type1->kind != 8)
14349 {
14350 if(exp->op.exp1->destType)
14351 FreeType(exp->op.exp1->destType);
14352 if(!type2->_class->registered->dataType)
14353 type2->_class->registered->dataType = ProcessTypeString(type2->_class->registered->dataTypeString, 0x0);
14354 exp->op.exp1->destType = type2->_class->registered->dataType;
14355 exp->op.exp1->destType->refCount++;
14356 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
14357 type1 = exp->op.exp1->destType;
14358 exp->expType = type1;
14359 type1->refCount++;
14360 }
14361 if(!boolResult || exp->op.op == '>' || exp->op.op == '<')
14362 {
14363 if(type1->kind == 8 && type1->_class && type1->_class->registered && type1->_class->registered->type == 4 && exp->op.exp2->expType)
14364 {
14365 if(CheckExpressionType(exp->op.exp1, exp->op.exp2->expType, 0x0))
14366 {
14367 if(exp->expType)
14368 FreeType(exp->expType);
14369 exp->expType = exp->op.exp1->expType;
14370 if(exp->op.exp2->expType)
14371 exp->op.exp1->expType->refCount++;
14372 valid = 0x1;
14373 }
14374 }
14375 else if(type2 && (type2->kind == 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 4 && exp->op.exp1->expType))
14376 {
14377 if(CheckExpressionType(exp->op.exp2, exp->op.exp1->expType, 0x0))
14378 {
14379 if(exp->expType)
14380 FreeType(exp->expType);
14381 exp->expType = exp->op.exp2->expType;
14382 if(exp->op.exp2->expType)
14383 exp->op.exp2->expType->refCount++;
14384 valid = 0x1;
14385 }
14386 }
14387 }
14388 if(!valid)
14389 {
14390 if(exp->op.exp2->destType)
14391 FreeType(exp->op.exp2->destType);
14392 exp->op.exp2->destType = type1;
14393 type1->refCount++;
14394 if(CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0))
14395 {
14396 if(exp->expType)
14397 FreeType(exp->expType);
14398 exp->expType = exp->op.exp2->destType;
14399 if(exp->op.exp2->destType)
14400 exp->op.exp2->destType->refCount++;
14401 }
14402 else if(type1 && type2)
14403 {
14404 char expString1[10240];
14405 char expString2[10240];
14406 char type1String[1024];
14407 char type2String[1024];
14408
14409 expString1[0] = '\0';
14410 expString2[0] = '\0';
14411 type1String[0] = '\0';
14412 type2String[0] = '\0';
14413 if(inCompiler)
14414 {
14415 PrintExpression(exp->op.exp1, expString1);
14416 __ecereNameSpace__ecere__sys__ChangeCh(expString1, '\n', ' ');
14417 PrintExpression(exp->op.exp2, expString2);
14418 __ecereNameSpace__ecere__sys__ChangeCh(expString2, '\n', ' ');
14419 PrintType(exp->op.exp1->expType, type1String, 0x0, 0x1);
14420 PrintType(exp->op.exp2->expType, type2String, 0x0, 0x1);
14421 }
14422 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expressions %s (%s) and %s (%s)\n", (((void *)0))), expString1, type1String, expString2, type2String);
14423 if(type1->kind == 8 && type1->_class && type1->_class->registered && type1->_class->registered->type == 4)
14424 {
14425 exp->expType = exp->op.exp1->expType;
14426 if(exp->op.exp1->expType)
14427 exp->op.exp1->expType->refCount++;
14428 }
14429 else if(type2->kind == 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 4)
14430 {
14431 exp->expType = exp->op.exp2->expType;
14432 if(exp->op.exp2->expType)
14433 exp->op.exp2->expType->refCount++;
14434 }
14435 }
14436 }
14437 }
14438 else if(type2)
14439 {
14440 if(type2->kind == 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 4)
14441 {
14442 struct Type * oldType = exp->op.exp1->expType;
14443
14444 exp->op.exp1->expType = (((void *)0));
14445 if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
14446 FreeType(oldType);
14447 else
14448 exp->op.exp1->expType = oldType;
14449 }
14450 if(exp->op.exp1->destType)
14451 FreeType(exp->op.exp1->destType);
14452 exp->op.exp1->destType = type2;
14453 type2->refCount++;
14454 if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
14455 {
14456 if(exp->expType)
14457 FreeType(exp->expType);
14458 exp->expType = exp->op.exp1->destType;
14459 if(exp->op.exp1->destType)
14460 exp->op.exp1->destType->refCount++;
14461 }
14462 }
14463 }
14464 else if(type2 && (!type1 || (type2->kind == 8 && type1->kind != 8)))
14465 {
14466 if(type1 && type2->_class && type2->_class->registered && type2->_class->registered->type == 3)
14467 {
14468 if(exp->op.exp1->destType)
14469 FreeType(exp->op.exp1->destType);
14470 exp->op.exp1->destType = type2->_class->registered->dataType;
14471 if(type2->_class->registered->dataType)
14472 type2->_class->registered->dataType->refCount++;
14473 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
14474 }
14475 if(exp->op.op == '!')
14476 {
14477 exp->expType = MkClassType("bool");
14478 exp->expType->truth = 0x1;
14479 }
14480 else
14481 {
14482 exp->expType = type2;
14483 if(type2)
14484 type2->refCount++;
14485 }
14486 }
14487 else if(type1 && (!type2 || (type1->kind == 8 && type2->kind != 8)))
14488 {
14489 if(type2 && type1->_class && type1->_class->registered && type1->_class->registered->type == 3)
14490 {
14491 if(exp->op.exp2->destType)
14492 FreeType(exp->op.exp2->destType);
14493 exp->op.exp2->destType = type1->_class->registered->dataType;
14494 if(type1->_class->registered->dataType)
14495 type1->_class->registered->dataType->refCount++;
14496 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
14497 }
14498 exp->expType = type1;
14499 if(type1)
14500 type1->refCount++;
14501 }
14502 }
14503 yylloc = exp->loc;
14504 if(exp->op.exp1 && !exp->op.exp1->expType)
14505 {
14506 char expString[10000];
14507
14508 expString[0] = '\0';
14509 if(inCompiler)
14510 {
14511 PrintExpression(exp->op.exp1, expString);
14512 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14513 }
14514 if(expString[0])
14515 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s\n", (((void *)0))), expString);
14516 }
14517 if(exp->op.exp2 && !exp->op.exp2->expType)
14518 {
14519 char expString[10240];
14520
14521 expString[0] = '\0';
14522 if(inCompiler)
14523 {
14524 PrintExpression(exp->op.exp2, expString);
14525 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14526 }
14527 if(expString[0])
14528 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s\n", (((void *)0))), expString);
14529 }
14530 if(boolResult)
14531 {
14532 FreeType(exp->expType);
14533 exp->expType = MkClassType("bool");
14534 exp->expType->truth = 0x1;
14535 }
14536 if(exp->op.op != SIZEOF)
14537 exp->isConstant = (!exp->op.exp1 || exp->op.exp1->isConstant) && (!exp->op.exp2 || exp->op.exp2->isConstant);
14538 if(exp->op.op == SIZEOF && exp->op.exp2->expType)
14539 {
14540 DeclareType(exp->op.exp2->expType, 0x0, 0x0);
14541 }
14542 yylloc = oldyylloc;
14543 FreeType(dummy);
14544 if(type2)
14545 FreeType(type2);
14546 break;
14547 }
14548 case 5:
14549 case 34:
14550 {
14551 struct Expression * e;
14552
14553 exp->isConstant = 0x1;
14554 for(e = (*exp->list).first; e; e = e->next)
14555 {
14556 unsigned int inced = 0x0;
14557
14558 if(!e->next)
14559 {
14560 FreeType(e->destType);
14561 e->destType = exp->destType;
14562 if(e->destType)
14563 {
14564 exp->destType->refCount++;
14565 e->destType->count++;
14566 inced = 0x1;
14567 }
14568 }
14569 ProcessExpressionType(e);
14570 if(inced)
14571 exp->destType->count--;
14572 if(!exp->expType && !e->next)
14573 {
14574 exp->expType = e->expType;
14575 if(e->expType)
14576 e->expType->refCount++;
14577 }
14578 if(!e->isConstant)
14579 exp->isConstant = 0x0;
14580 }
14581 e = (*exp->list).first;
14582 if(!e->next && e->type == 8)
14583 {
14584 struct Expression * next = exp->next, * prev = exp->prev;
14585
14586 FreeType(exp->expType);
14587 FreeType(exp->destType);
14588 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->list), exp->list = 0);
14589 *exp = *e;
14590 exp->prev = prev;
14591 exp->next = next;
14592 ((e ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(e) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(e)) : 0), e = 0);
14593 ProcessExpressionType(exp);
14594 }
14595 break;
14596 }
14597 case 6:
14598 {
14599 struct Expression * e;
14600
14601 exp->isConstant = 0x1;
14602 ProcessExpressionType(exp->index.exp);
14603 if(!exp->index.exp->isConstant)
14604 exp->isConstant = 0x0;
14605 if(exp->index.exp->expType)
14606 {
14607 struct Type * source = exp->index.exp->expType;
14608
14609 if(source->kind == 8 && source->_class && source->_class->registered)
14610 {
14611 struct __ecereNameSpace__ecere__com__Class * _class = source->_class->registered;
14612 struct __ecereNameSpace__ecere__com__Class * c = _class->templateClass ? _class->templateClass : _class;
14613
14614 if(_class != containerClass && __ecereNameSpace__ecere__com__eClass_IsDerived(c, containerClass) && _class->templateArgs)
14615 {
14616 exp->expType = ProcessTypeString(_class->templateArgs[2].dataTypeString, 0x0);
14617 if(exp->index.index && (*exp->index.index).last)
14618 {
14619 ((struct Expression *)(*exp->index.index).last)->destType = ProcessTypeString(_class->templateArgs[1].dataTypeString, 0x0);
14620 }
14621 }
14622 }
14623 }
14624 for(e = (*exp->index.index).first; e; e = e->next)
14625 {
14626 if(!e->next && exp->index.exp->expType && exp->index.exp->expType->kind == 12 && exp->index.exp->expType->enumClass)
14627 {
14628 if(e->destType)
14629 FreeType(e->destType);
14630 e->destType = MkClassType(exp->index.exp->expType->enumClass->string);
14631 }
14632 ProcessExpressionType(e);
14633 if(!e->next)
14634 {
14635 }
14636 if(!e->isConstant)
14637 exp->isConstant = 0x0;
14638 }
14639 if(!exp->expType)
14640 exp->expType = Dereference(exp->index.exp->expType);
14641 if(exp->expType)
14642 DeclareType(exp->expType, 0x0, 0x0);
14643 break;
14644 }
14645 case 7:
14646 {
14647 struct Expression * e;
14648 struct Type * functionType;
14649 struct Type * methodType = (((void *)0));
14650 char name[1024];
14651
14652 name[0] = '\0';
14653 if(inCompiler)
14654 {
14655 PrintExpression(exp->call.exp, name);
14656 if(exp->call.exp->expType && !exp->call.exp->expType->returnType)
14657 {
14658 PrintExpression(exp->call.exp, name);
14659 }
14660 }
14661 if(exp->call.exp->type == 0)
14662 {
14663 struct Expression * idExp = exp->call.exp;
14664 struct Identifier * id = idExp->identifier;
14665
14666 if(!strcmp(id->string, "__builtin_frame_address"))
14667 {
14668 exp->expType = ProcessTypeString("void *", 0x1);
14669 if(exp->call.arguments && (*exp->call.arguments).first)
14670 ProcessExpressionType((*exp->call.arguments).first);
14671 break;
14672 }
14673 else if(!strcmp(id->string, "__ENDIAN_PAD"))
14674 {
14675 exp->expType = ProcessTypeString("int", 0x1);
14676 if(exp->call.arguments && (*exp->call.arguments).first)
14677 ProcessExpressionType((*exp->call.arguments).first);
14678 break;
14679 }
14680 else if(!strcmp(id->string, "Max") || !strcmp(id->string, "Min") || !strcmp(id->string, "Sgn") || !strcmp(id->string, "Abs"))
14681 {
14682 struct Expression * a = (((void *)0));
14683 struct Expression * b = (((void *)0));
14684 struct Expression * tempExp1 = (((void *)0)), * tempExp2 = (((void *)0));
14685
14686 if((!strcmp(id->string, "Max") || !strcmp(id->string, "Min")) && (*exp->call.arguments).count == 2)
14687 {
14688 a = (*exp->call.arguments).first;
14689 b = (*exp->call.arguments).last;
14690 tempExp1 = a;
14691 tempExp2 = b;
14692 }
14693 else if((*exp->call.arguments).count == 1)
14694 {
14695 a = (*exp->call.arguments).first;
14696 tempExp1 = a;
14697 }
14698 if(a)
14699 {
14700 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear((&*exp->call.arguments));
14701 idExp->identifier = (((void *)0));
14702 FreeExpContents(exp);
14703 ProcessExpressionType(a);
14704 if(b)
14705 ProcessExpressionType(b);
14706 exp->type = 5;
14707 exp->list = MkList();
14708 if(a->expType && (!b || b->expType))
14709 {
14710 if((!a->isConstant && a->type != 0) || (b && !b->isConstant && b->type != 0))
14711 {
14712 if(inCompiler)
14713 {
14714 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
14715 struct __ecereNameSpace__ecere__sys__OldList * decls = MkList();
14716 struct Declaration * decl;
14717 char temp1[1024], temp2[1024];
14718
14719 GetTypeSpecs(a->expType, specs);
14720 if(a && !a->isConstant && a->type != 0)
14721 {
14722 sprintf(temp1, "__simpleStruct%d", curContext->simpleID++);
14723 ListAdd(decls, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(temp1)), (((void *)0))));
14724 tempExp1 = QMkExpId(temp1);
14725 tempExp1->expType = a->expType;
14726 if(a->expType)
14727 a->expType->refCount++;
14728 ListAdd(exp->list, MkExpOp(CopyExpression(tempExp1), '=', a));
14729 }
14730 if(b && !b->isConstant && b->type != 0)
14731 {
14732 sprintf(temp2, "__simpleStruct%d", curContext->simpleID++);
14733 ListAdd(decls, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(temp2)), (((void *)0))));
14734 tempExp2 = QMkExpId(temp2);
14735 tempExp2->expType = b->expType;
14736 if(b->expType)
14737 b->expType->refCount++;
14738 ListAdd(exp->list, MkExpOp(CopyExpression(tempExp2), '=', b));
14739 }
14740 decl = MkDeclaration(specs, decls);
14741 if(!curCompound->compound.declarations)
14742 curCompound->compound.declarations = MkList();
14743 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*curCompound->compound.declarations), (((void *)0)), decl);
14744 }
14745 }
14746 }
14747 if(!strcmp(id->string, "Max") || !strcmp(id->string, "Min"))
14748 {
14749 int op = (!strcmp(id->string, "Max")) ? '>' : '<';
14750
14751 ListAdd(exp->list, MkExpCondition(MkExpBrackets(MkListOne(MkExpOp(CopyExpression(tempExp1), op, CopyExpression(tempExp2)))), MkListOne(CopyExpression(tempExp1)), CopyExpression(tempExp2)));
14752 exp->expType = a->expType;
14753 if(a->expType)
14754 a->expType->refCount++;
14755 }
14756 else if(!strcmp(id->string, "Abs"))
14757 {
14758 ListAdd(exp->list, MkExpCondition(MkExpBrackets(MkListOne(MkExpOp(CopyExpression(tempExp1), '<', MkExpConstant("0")))), MkListOne(MkExpOp((((void *)0)), '-', CopyExpression(tempExp1))), CopyExpression(tempExp1)));
14759 exp->expType = a->expType;
14760 if(a->expType)
14761 a->expType->refCount++;
14762 }
14763 else if(!strcmp(id->string, "Sgn"))
14764 {
14765 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"))))));
14766 exp->expType = ProcessTypeString("int", 0x0);
14767 }
14768 FreeExpression(tempExp1);
14769 if(tempExp2)
14770 FreeExpression(tempExp2);
14771 FreeIdentifier(id);
14772 break;
14773 }
14774 }
14775 }
14776 {
14777 struct Type * dummy = (dummy = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), dummy->count = 1, dummy->refCount = 1, dummy);
14778
14779 if(!exp->call.exp->destType)
14780 {
14781 exp->call.exp->destType = dummy;
14782 dummy->refCount++;
14783 }
14784 ProcessExpressionType(exp->call.exp);
14785 if(exp->call.exp->destType == dummy)
14786 {
14787 FreeType(dummy);
14788 exp->call.exp->destType = (((void *)0));
14789 }
14790 FreeType(dummy);
14791 }
14792 functionType = exp->call.exp->expType;
14793 if(functionType && functionType->kind == 16)
14794 {
14795 methodType = functionType;
14796 functionType = methodType->method->dataType;
14797 if(exp->call.exp->expType->usedClass)
14798 {
14799 char typeString[1024];
14800
14801 typeString[0] = '\0';
14802 {
14803 struct Symbol * back = functionType->thisClass;
14804
14805 functionType->thisClass = (((void *)0));
14806 PrintType(functionType, typeString, 0x1, 0x1);
14807 functionType->thisClass = back;
14808 }
14809 if(strstr(typeString, "thisclass"))
14810 {
14811 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
14812 struct Declarator * decl;
14813
14814 {
14815 struct Context * context = SetupTemplatesContext(exp->call.exp->expType->usedClass);
14816
14817 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
14818 if(thisClass != (exp->call.exp->expType->usedClass->templateClass ? exp->call.exp->expType->usedClass->templateClass : exp->call.exp->expType->usedClass))
14819 thisClassParams = 0x0;
14820 ReplaceThisClassSpecifiers(specs, exp->call.exp->expType->usedClass);
14821 {
14822 struct __ecereNameSpace__ecere__com__Class * backupThisClass = thisClass;
14823
14824 thisClass = exp->call.exp->expType->usedClass;
14825 ProcessDeclarator(decl);
14826 thisClass = backupThisClass;
14827 }
14828 thisClassParams = 0x1;
14829 functionType = ProcessType(specs, decl);
14830 functionType->refCount = 0;
14831 FinishTemplatesContext(context);
14832 }
14833 FreeList(specs, FreeSpecifier);
14834 FreeDeclarator(decl);
14835 }
14836 }
14837 }
14838 if(functionType && functionType->kind == 13 && functionType->type && functionType->type->kind == 11)
14839 {
14840 struct Type * type = functionType->type;
14841
14842 if(!functionType->refCount)
14843 {
14844 functionType->type = (((void *)0));
14845 FreeType(functionType);
14846 }
14847 functionType = type;
14848 }
14849 if(functionType && functionType->kind != 11)
14850 {
14851 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "called object %s is not a function\n", (((void *)0))), name);
14852 }
14853 else if(functionType)
14854 {
14855 unsigned int emptyParams = 0x0, noParams = 0x0;
14856 struct Expression * e = exp->call.arguments ? (*exp->call.arguments).first : (((void *)0));
14857 struct Type * type = functionType->params.first;
14858 struct Expression * memberExp = (exp->call.exp->type == 8) ? exp->call.exp : (((void *)0));
14859 int extra = 0;
14860 struct Location oldyylloc = yylloc;
14861
14862 if(!type)
14863 emptyParams = 0x1;
14864 if(functionType->extraParam && e && functionType->thisClass)
14865 {
14866 e->destType = MkClassType(functionType->thisClass->string);
14867 e = e->next;
14868 }
14869 if(!functionType->staticMethod && !functionType->extraParam)
14870 {
14871 if(memberExp && memberExp->member.exp && memberExp->member.exp->expType && memberExp->member.exp->expType->kind == 19 && memberExp->member.exp->expType->_class)
14872 {
14873 type = MkClassType(memberExp->member.exp->expType->_class->string);
14874 if(e)
14875 {
14876 e->destType = type;
14877 e = e->next;
14878 type = functionType->params.first;
14879 }
14880 else
14881 type->refCount = 0;
14882 }
14883 else if(!memberExp && (functionType->thisClass || (methodType && methodType->methodClass)))
14884 {
14885 type = MkClassType(functionType->thisClass ? functionType->thisClass->string : (methodType ? methodType->methodClass->fullName : (((void *)0))));
14886 type->byReference = functionType->byReference;
14887 type->typedByReference = functionType->typedByReference;
14888 if(e)
14889 {
14890 if(e->next && type->kind == 8 && (functionType && functionType->thisClass) && functionType->classObjectType == 2)
14891 e = e->next;
14892 e->destType = type;
14893 e = e->next;
14894 type = functionType->params.first;
14895 }
14896 else
14897 type->refCount = 0;
14898 }
14899 }
14900 if(type && type->kind == 0)
14901 {
14902 noParams = 0x1;
14903 if(!type->refCount)
14904 FreeType(type);
14905 type = (((void *)0));
14906 }
14907 for(; e; e = e->next)
14908 {
14909 if(!type && !emptyParams)
14910 {
14911 yylloc = e->loc;
14912 if(methodType && methodType->methodClass)
14913 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "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);
14914 else
14915 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "too many arguments for function %s (%d given, expected %d)\n", (((void *)0))), name, (*exp->call.arguments).count, noParams ? 0 : functionType->params.count);
14916 break;
14917 }
14918 if(methodType && type && type->kind == 20 && type->templateParameter->type == 0)
14919 {
14920 struct Type * templatedType = (((void *)0));
14921 struct __ecereNameSpace__ecere__com__Class * _class = methodType->usedClass;
14922 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
14923 int id = 0;
14924
14925 if(_class && _class->templateArgs)
14926 {
14927 struct __ecereNameSpace__ecere__com__Class * sClass;
14928
14929 for(sClass = _class; sClass; sClass = sClass->base)
14930 {
14931 if(sClass->templateClass)
14932 sClass = sClass->templateClass;
14933 id = 0;
14934 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
14935 {
14936 if(curParam->type == 0 && !strcmp(type->templateParameter->identifier->string, curParam->name))
14937 {
14938 struct __ecereNameSpace__ecere__com__Class * nextClass;
14939
14940 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
14941 {
14942 if(nextClass->templateClass)
14943 nextClass = nextClass->templateClass;
14944 id += nextClass->templateParams.count;
14945 }
14946 break;
14947 }
14948 id++;
14949 }
14950 if(curParam)
14951 break;
14952 }
14953 }
14954 if(curParam && _class->templateArgs[id].dataTypeString)
14955 {
14956 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = _class->templateArgs[id];
14957
14958 {
14959 struct Context * context = SetupTemplatesContext(_class);
14960
14961 templatedType = ProcessTypeString(arg.dataTypeString, 0x0);
14962 FinishTemplatesContext(context);
14963 }
14964 e->destType = templatedType;
14965 if(templatedType)
14966 {
14967 templatedType->passAsTemplate = 0x1;
14968 }
14969 }
14970 else
14971 {
14972 e->destType = type;
14973 if(type)
14974 type->refCount++;
14975 }
14976 }
14977 else
14978 {
14979 if(type && type->kind == 14 && type->prev && type->prev->kind == 8 && type->prev->classObjectType)
14980 {
14981 e->destType = type->prev;
14982 e->destType->refCount++;
14983 }
14984 else
14985 {
14986 e->destType = type;
14987 if(type)
14988 type->refCount++;
14989 }
14990 }
14991 if(type && type->kind != 14)
14992 {
14993 struct Type * next = type->next;
14994
14995 if(!type->refCount)
14996 FreeType(type);
14997 type = next;
14998 }
14999 }
15000 if(type && type->kind != 14)
15001 {
15002 if(methodType && methodType->methodClass)
15003 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "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);
15004 else
15005 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "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);
15006 }
15007 yylloc = oldyylloc;
15008 if(type && !type->refCount)
15009 FreeType(type);
15010 }
15011 else
15012 {
15013 functionType = __extension__ ({
15014 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
15015
15016 __ecereInstance1->refCount = 0, __ecereInstance1->kind = 11, __ecereInstance1;
15017 });
15018 if(exp->call.exp->type == 0)
15019 {
15020 char * string = exp->call.exp->identifier->string;
15021
15022 if(inCompiler)
15023 {
15024 struct Symbol * symbol;
15025 struct Location oldyylloc = yylloc;
15026
15027 yylloc = exp->call.exp->identifier->loc;
15028 if(strstr(string, "__builtin_") == string)
15029 {
15030 if(exp->destType)
15031 {
15032 functionType->returnType = exp->destType;
15033 exp->destType->refCount++;
15034 }
15035 }
15036 else
15037 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "%s undefined; assuming extern returning int\n", (((void *)0))), string);
15038 symbol = __extension__ ({
15039 struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
15040
15041 __ecereInstance1->string = __ecereNameSpace__ecere__sys__CopyString(string), __ecereInstance1->type = ProcessTypeString("int()", 0x1), __ecereInstance1;
15042 });
15043 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)symbol);
15044 if(strstr(symbol->string, "::"))
15045 globalContext->hasNameSpace = 0x1;
15046 yylloc = oldyylloc;
15047 }
15048 }
15049 else if(exp->call.exp->type == 8)
15050 {
15051 }
15052 else
15053 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "callable object undefined; extern assuming returning int\n", (((void *)0))));
15054 if(!functionType->returnType)
15055 {
15056 functionType->returnType = __extension__ ({
15057 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
15058
15059 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 3, __ecereInstance1;
15060 });
15061 }
15062 }
15063 if(functionType && functionType->kind == 11)
15064 {
15065 exp->expType = functionType->returnType;
15066 if(functionType->returnType)
15067 functionType->returnType->refCount++;
15068 if(!functionType->refCount)
15069 FreeType(functionType);
15070 }
15071 if(exp->call.arguments)
15072 {
15073 for(e = (*exp->call.arguments).first; e; e = e->next)
15074 {
15075 struct Type * destType = e->destType;
15076
15077 ProcessExpressionType(e);
15078 }
15079 }
15080 break;
15081 }
15082 case 8:
15083 {
15084 struct Type * type;
15085 struct Location oldyylloc = yylloc;
15086 unsigned int thisPtr;
15087 struct Expression * checkExp = exp->member.exp;
15088
15089 while(checkExp)
15090 {
15091 if(checkExp->type == 11)
15092 checkExp = checkExp->cast.exp;
15093 else if(checkExp->type == 5)
15094 checkExp = checkExp->list ? (*checkExp->list).first : (((void *)0));
15095 else
15096 break;
15097 }
15098 thisPtr = (checkExp && checkExp->type == 0 && !strcmp(checkExp->identifier->string, "this"));
15099 exp->thisPtr = thisPtr;
15100 if(exp->member.member && exp->member.member->_class && exp->member.member->_class->name)
15101 {
15102 exp->member.member->classSym = exp->member.member->_class->symbol;
15103 }
15104 ProcessExpressionType(exp->member.exp);
15105 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)
15106 {
15107 exp->isConstant = 0x0;
15108 }
15109 else
15110 exp->isConstant = exp->member.exp->isConstant;
15111 type = exp->member.exp->expType;
15112 yylloc = exp->loc;
15113 if(type && (type->kind == 20))
15114 {
15115 struct __ecereNameSpace__ecere__com__Class * _class = thisClass ? thisClass : currentClass;
15116 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param = (((void *)0));
15117
15118 if(_class)
15119 {
15120 for(param = _class->templateParams.first; param; param = param->next)
15121 {
15122 if(param->type == 1 && exp->member.member && exp->member.member->string && !strcmp(param->name, exp->member.member->string))
15123 break;
15124 }
15125 }
15126 if(param && param->defaultArg.member)
15127 {
15128 struct Expression * argExp = GetTemplateArgExpByName(param->name, thisClass, 1);
15129
15130 if(argExp)
15131 {
15132 struct Expression * expMember = exp->member.exp;
15133 struct Declarator * decl;
15134 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15135 char thisClassTypeString[1024];
15136
15137 FreeIdentifier(exp->member.member);
15138 ProcessExpressionType(argExp);
15139 {
15140 char * colon = strstr(param->defaultArg.memberString, "::");
15141
15142 if(colon)
15143 {
15144 char className[1024];
15145 struct __ecereNameSpace__ecere__com__Class * sClass;
15146
15147 memcpy(thisClassTypeString, param->defaultArg.memberString, colon - param->defaultArg.memberString);
15148 thisClassTypeString[colon - param->defaultArg.memberString] = '\0';
15149 }
15150 else
15151 strcpy(thisClassTypeString, _class->fullName);
15152 }
15153 decl = SpecDeclFromString(param->defaultArg.member->dataTypeString, specs, (((void *)0)));
15154 exp->expType = ProcessType(specs, decl);
15155 if(exp->expType->kind == 8 && exp->expType->_class && exp->expType->_class->registered && exp->expType->_class->registered->templateClass)
15156 {
15157 struct __ecereNameSpace__ecere__com__Class * expClass = exp->expType->_class->registered;
15158 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
15159 int c;
15160 int paramCount = 0;
15161 int lastParam = -1;
15162 char templateString[1024];
15163 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
15164
15165 sprintf(templateString, "%s<", expClass->templateClass->fullName);
15166 for(cClass = expClass; cClass; cClass = cClass->base)
15167 {
15168 int p = 0;
15169
15170 for(param = cClass->templateParams.first; param; param = param->next)
15171 {
15172 int id = p;
15173 struct __ecereNameSpace__ecere__com__Class * sClass;
15174 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
15175
15176 for(sClass = cClass->base; sClass; sClass = sClass->base)
15177 id += sClass->templateParams.count;
15178 arg = expClass->templateArgs[id];
15179 for(sClass = _class; sClass; sClass = sClass->base)
15180 {
15181 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * cParam;
15182 int p = 0;
15183 struct __ecereNameSpace__ecere__com__Class * nextClass;
15184
15185 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
15186 p += nextClass->templateParams.count;
15187 for(cParam = sClass->templateParams.first; cParam; cParam = cParam->next, p++)
15188 {
15189 if(cParam->type == 0 && arg.dataTypeString && !strcmp(cParam->name, arg.dataTypeString))
15190 {
15191 if(_class->templateArgs && arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
15192 {
15193 arg.dataTypeString = _class->templateArgs[p].dataTypeString;
15194 arg.dataTypeClass = _class->templateArgs[p].dataTypeClass;
15195 break;
15196 }
15197 }
15198 }
15199 }
15200 {
15201 char argument[256];
15202
15203 argument[0] = '\0';
15204 switch(param->type)
15205 {
15206 case 2:
15207 {
15208 char expString[1024];
15209 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15210 struct Declarator * decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
15211 struct Expression * exp;
15212 char * string = PrintHexUInt64(arg.expression.ui64);
15213
15214 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
15215 (__ecereNameSpace__ecere__com__eSystem_Delete(string), string = 0);
15216 ProcessExpressionType(exp);
15217 ComputeExpression(exp);
15218 expString[0] = '\0';
15219 PrintExpression(exp, expString);
15220 strcat(argument, expString);
15221 FreeExpression(exp);
15222 break;
15223 }
15224 case 1:
15225 {
15226 strcat(argument, arg.member->name);
15227 break;
15228 }
15229 case 0:
15230 {
15231 if(arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
15232 {
15233 if(!strcmp(arg.dataTypeString, "thisclass"))
15234 strcat(argument, thisClassTypeString);
15235 else
15236 strcat(argument, arg.dataTypeString);
15237 }
15238 break;
15239 }
15240 }
15241 if(argument[0])
15242 {
15243 if(paramCount)
15244 strcat(templateString, ", ");
15245 if(lastParam != p - 1)
15246 {
15247 strcat(templateString, param->name);
15248 strcat(templateString, " = ");
15249 }
15250 strcat(templateString, argument);
15251 paramCount++;
15252 lastParam = p;
15253 }
15254 p++;
15255 }
15256 }
15257 }
15258 {
15259 int len = strlen(templateString);
15260
15261 if(templateString[len - 1] == '>')
15262 templateString[len++] = ' ';
15263 templateString[len++] = '>';
15264 templateString[len++] = '\0';
15265 }
15266 {
15267 struct Context * context = SetupTemplatesContext(_class);
15268
15269 FreeType(exp->expType);
15270 exp->expType = ProcessTypeString(templateString, 0x0);
15271 FinishTemplatesContext(context);
15272 }
15273 }
15274 exp->type = 5;
15275 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")))))))));
15276 }
15277 }
15278 else if(type->templateParameter && type->templateParameter->type == 0 && (type->templateParameter->dataType || type->templateParameter->dataTypeString))
15279 {
15280 type = ProcessTemplateParameterType(type->templateParameter);
15281 }
15282 }
15283 if(type && (type->kind == 20))
15284 ;
15285 else if(type && (type->kind == 8 || type->kind == 19 || type->kind == 3 || type->kind == 15 || type->kind == 4 || type->kind == 2 || type->kind == 5 || type->kind == 1 || type->kind == 24 || type->kind == 22 || type->kind == 23 || type->kind == 6 || type->kind == 7 || (type->kind == 13 && type->type->kind == 1)))
15286 {
15287 struct Identifier * id = exp->member.member;
15288 int typeKind = type->kind;
15289 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));
15290
15291 if(typeKind == 19 && exp->member.exp->type == 26)
15292 {
15293 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "ecere::com::Class");
15294 typeKind = 8;
15295 }
15296 if(id)
15297 {
15298 if(typeKind == 3 || typeKind == 15)
15299 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "int");
15300 else if(!_class)
15301 {
15302 if(type->kind == 8 && type->_class && type->_class->registered)
15303 {
15304 _class = type->_class->registered;
15305 }
15306 else if((type->kind == 12 || type->kind == 13) && type->type && type->type->kind == 1)
15307 {
15308 _class = FindClass("char *")->registered;
15309 }
15310 else if(type->kind == 13)
15311 {
15312 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "uintptr");
15313 FreeType(exp->expType);
15314 exp->expType = ProcessTypeString("uintptr", 0x0);
15315 exp->byReference = 0x1;
15316 }
15317 else
15318 {
15319 char string[1024] = "";
15320 struct Symbol * classSym;
15321
15322 PrintTypeNoConst(type, string, 0x0, 0x1);
15323 classSym = FindClass(string);
15324 if(classSym)
15325 _class = classSym->registered;
15326 }
15327 }
15328 }
15329 if(_class && id)
15330 {
15331 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
15332 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
15333 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
15334 struct __ecereNameSpace__ecere__com__Property * revConvert = (((void *)0));
15335 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
15336
15337 if(id && id->_class && id->_class->name && !strcmp(id->_class->name, "property"))
15338 exp->member.memberType = 1;
15339 if(id && id->_class && type->_class && !__ecereNameSpace__ecere__com__eClass_IsDerived(type->_class->registered, _class))
15340 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "invalid class specifier %s for object of class %s\n", (((void *)0))), _class->fullName, type->_class->string);
15341 if(typeKind != 19)
15342 {
15343 if((exp->member.memberType == 0 && thisPtr) || exp->member.memberType == 3)
15344 {
15345 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
15346 if(member && member->_class != (_class->templateClass ? _class->templateClass : _class) && exp->member.memberType != 3)
15347 {
15348 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
15349 if(prop)
15350 member = (((void *)0));
15351 }
15352 if(!member && !prop)
15353 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
15354 if((member && member->_class == (_class->templateClass ? _class->templateClass : _class)) || (prop && prop->_class == (_class->templateClass ? _class->templateClass : _class)))
15355 exp->member.thisPtr = 0x1;
15356 }
15357 else
15358 {
15359 if(!id->classSym)
15360 {
15361 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, (((void *)0)));
15362 if(!id->_class || !id->_class->name || strcmp(id->_class->name, "property"))
15363 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, (((void *)0)), (((void *)0)), (((void *)0)));
15364 }
15365 if(!prop && !member)
15366 {
15367 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, (((void *)0)));
15368 if(!method)
15369 {
15370 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
15371 if(!id->_class || !id->_class->name || strcmp(id->_class->name, "property"))
15372 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
15373 }
15374 }
15375 if(member && prop)
15376 {
15377 if(member->_class != prop->_class && !id->_class && __ecereNameSpace__ecere__com__eClass_IsDerived(member->_class, prop->_class))
15378 prop = (((void *)0));
15379 else
15380 member = (((void *)0));
15381 }
15382 }
15383 }
15384 if(!prop && !member && !method)
15385 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule);
15386 if(!prop && !member && !method)
15387 {
15388 if(typeKind == 19)
15389 {
15390 classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(type->_class->registered, exp->member.member->string);
15391 if(classProp)
15392 {
15393 exp->member.memberType = 5;
15394 exp->expType = ProcessTypeString(classProp->dataTypeString, 0x0);
15395 }
15396 else
15397 {
15398 char structName[1024];
15399 struct Identifier * id = exp->member.member;
15400 struct Expression * classExp = exp->member.exp;
15401
15402 type->refCount++;
15403 FreeType(classExp->expType);
15404 classExp->expType = ProcessTypeString("ecere::com::Class", 0x0);
15405 strcpy(structName, "__ecereClassData_");
15406 FullClassNameCat(structName, type->_class->string, 0x0);
15407 exp->type = 9;
15408 exp->member.member = id;
15409 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"))))))));
15410 FreeType(type);
15411 ProcessExpressionType(exp);
15412 return ;
15413 }
15414 }
15415 else
15416 {
15417 struct Symbol * classSym = FindClass(id->string);
15418
15419 if(classSym)
15420 {
15421 struct __ecereNameSpace__ecere__com__Class * convertClass = classSym->registered;
15422
15423 if(convertClass)
15424 revConvert = __ecereNameSpace__ecere__com__eClass_FindProperty(convertClass, _class->fullName, privateModule);
15425 }
15426 }
15427 }
15428 if(prop)
15429 {
15430 exp->member.memberType = 1;
15431 if(!prop->dataType)
15432 ProcessPropertyType(prop);
15433 exp->expType = prop->dataType;
15434 if(prop->dataType)
15435 prop->dataType->refCount++;
15436 }
15437 else if(member)
15438 {
15439 if(exp->member.exp->expType->classObjectType == 2 && !strcmp(exp->member.member->string, "_class"))
15440 {
15441 FreeExpContents(exp);
15442 exp->type = 0;
15443 exp->identifier = MkIdentifier("class");
15444 ProcessExpressionType(exp);
15445 return ;
15446 }
15447 exp->member.memberType = 3;
15448 DeclareStruct(_class->fullName, 0x0);
15449 if(!member->dataType)
15450 {
15451 struct Context * context = SetupTemplatesContext(_class);
15452
15453 member->dataType = ProcessTypeString(member->dataTypeString, 0x0);
15454 FinishTemplatesContext(context);
15455 }
15456 exp->expType = member->dataType;
15457 if(member->dataType)
15458 member->dataType->refCount++;
15459 }
15460 else if(revConvert)
15461 {
15462 exp->member.memberType = 4;
15463 exp->expType = MkClassType(revConvert->_class->fullName);
15464 }
15465 else if(method)
15466 {
15467 {
15468 exp->member.memberType = 2;
15469 }
15470 if(!method->dataType)
15471 ProcessMethodType(method);
15472 exp->expType = __extension__ ({
15473 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
15474
15475 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 16, __ecereInstance1->method = method, __ecereInstance1;
15476 });
15477 exp->expType->methodClass = (id && id->_class) ? _class : (((void *)0));
15478 exp->expType->usedClass = _class;
15479 }
15480 else if(!classProp)
15481 {
15482 if(exp->member.exp->expType->classObjectType == 2 && !strcmp(exp->member.member->string, "_class"))
15483 {
15484 FreeExpContents(exp);
15485 exp->type = 0;
15486 exp->identifier = MkIdentifier("class");
15487 ProcessExpressionType(exp);
15488 return ;
15489 }
15490 yylloc = exp->member.member->loc;
15491 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't find member %s in class %s\n", (((void *)0))), id->string, _class->fullName);
15492 if(inCompiler)
15493 __ecereNameSpace__ecere__com__eClass_AddDataMember(_class, id->string, "int", 0, 0, 1);
15494 }
15495 if(_class && exp->expType)
15496 {
15497 struct __ecereNameSpace__ecere__com__Class * tClass;
15498
15499 tClass = _class;
15500 while(tClass && !tClass->templateClass)
15501 tClass = tClass->base;
15502 if(tClass && exp->expType->kind == 20 && exp->expType->templateParameter->type == 0)
15503 {
15504 int id = 0;
15505 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
15506 struct __ecereNameSpace__ecere__com__Class * sClass;
15507
15508 for(sClass = tClass; sClass; sClass = sClass->base)
15509 {
15510 id = 0;
15511 if(sClass->templateClass)
15512 sClass = sClass->templateClass;
15513 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
15514 {
15515 if(curParam->type == 0 && !strcmp(exp->expType->templateParameter->identifier->string, curParam->name))
15516 {
15517 for(sClass = sClass->base; sClass; sClass = sClass->base)
15518 id += sClass->templateParams.count;
15519 break;
15520 }
15521 id++;
15522 }
15523 if(curParam)
15524 break;
15525 }
15526 if(curParam && tClass->templateArgs[id].dataTypeString)
15527 {
15528 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = tClass->templateArgs[id];
15529 struct Context * context = SetupTemplatesContext(tClass);
15530
15531 FreeType(exp->expType);
15532 exp->expType = ProcessTypeString(arg.dataTypeString, 0x0);
15533 if(exp->expType)
15534 {
15535 if(exp->expType->kind == 21)
15536 {
15537 FreeType(exp->expType);
15538 exp->expType = ReplaceThisClassType(_class);
15539 }
15540 if(tClass->templateClass)
15541 exp->expType->passAsTemplate = 0x1;
15542 if(!exp->destType)
15543 {
15544 exp->destType = ProcessTypeString(arg.dataTypeString, 0x0);
15545 if(exp->destType->kind == 21)
15546 {
15547 FreeType(exp->destType);
15548 exp->destType = ReplaceThisClassType(_class);
15549 }
15550 }
15551 }
15552 FinishTemplatesContext(context);
15553 }
15554 }
15555 else if(tClass && exp->expType->kind == 13 && exp->expType->type && exp->expType->type->kind == 20 && exp->expType->type->templateParameter->type == 0)
15556 {
15557 int id = 0;
15558 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
15559 struct __ecereNameSpace__ecere__com__Class * sClass;
15560
15561 for(sClass = tClass; sClass; sClass = sClass->base)
15562 {
15563 id = 0;
15564 if(sClass->templateClass)
15565 sClass = sClass->templateClass;
15566 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
15567 {
15568 if(curParam->type == 0 && !strcmp(exp->expType->type->templateParameter->identifier->string, curParam->name))
15569 {
15570 for(sClass = sClass->base; sClass; sClass = sClass->base)
15571 id += sClass->templateParams.count;
15572 break;
15573 }
15574 id++;
15575 }
15576 if(curParam)
15577 break;
15578 }
15579 if(curParam)
15580 {
15581 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = tClass->templateArgs[id];
15582 struct Context * context = SetupTemplatesContext(tClass);
15583 struct Type * basicType;
15584
15585 basicType = ProcessTypeString(arg.dataTypeString, 0x0);
15586 if(basicType)
15587 {
15588 if(basicType->kind == 21)
15589 {
15590 FreeType(basicType);
15591 basicType = ReplaceThisClassType(_class);
15592 }
15593 FreeType(exp->expType);
15594 exp->expType = __extension__ ({
15595 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
15596
15597 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 13, __ecereInstance1->type = basicType, __ecereInstance1;
15598 });
15599 if(!exp->destType)
15600 {
15601 exp->destType = exp->expType;
15602 exp->destType->refCount++;
15603 }
15604 {
15605 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
15606 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15607 struct Declarator * decl;
15608
15609 decl = SpecDeclFromString(arg.dataTypeString, specs, (((void *)0)));
15610 *newExp = *exp;
15611 if(exp->destType)
15612 exp->destType->refCount++;
15613 if(exp->expType)
15614 exp->expType->refCount++;
15615 exp->type = 11;
15616 exp->cast.typeName = MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl));
15617 exp->cast.exp = newExp;
15618 }
15619 }
15620 FinishTemplatesContext(context);
15621 }
15622 }
15623 else if(tClass && exp->expType->kind == 8 && exp->expType->_class && strchr(exp->expType->_class->string, '<'))
15624 {
15625 struct __ecereNameSpace__ecere__com__Class * expClass = exp->expType->_class->registered;
15626
15627 if(expClass)
15628 {
15629 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
15630 int c;
15631 int p = 0;
15632 int paramCount = 0;
15633 int lastParam = -1;
15634 char templateString[1024];
15635 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
15636
15637 sprintf(templateString, "%s<", expClass->templateClass->fullName);
15638 while(cClass != expClass)
15639 {
15640 struct __ecereNameSpace__ecere__com__Class * sClass;
15641
15642 for(sClass = expClass; sClass && sClass->base != cClass; sClass = sClass->base)
15643 ;
15644 cClass = sClass;
15645 for(param = cClass->templateParams.first; param; param = param->next)
15646 {
15647 struct __ecereNameSpace__ecere__com__Class * cClassCur = (((void *)0));
15648 int c;
15649 int cp = 0;
15650 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * paramCur = (((void *)0));
15651 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
15652
15653 while(cClassCur != tClass && !paramCur)
15654 {
15655 struct __ecereNameSpace__ecere__com__Class * sClassCur;
15656
15657 for(sClassCur = tClass; sClassCur && sClassCur->base != cClassCur; sClassCur = sClassCur->base)
15658 ;
15659 cClassCur = sClassCur;
15660 for(paramCur = cClassCur->templateParams.first; paramCur; paramCur = paramCur->next)
15661 {
15662 if(!strcmp(paramCur->name, param->name))
15663 {
15664 break;
15665 }
15666 cp++;
15667 }
15668 }
15669 if(paramCur && paramCur->type == 0)
15670 arg = tClass->templateArgs[cp];
15671 else
15672 arg = expClass->templateArgs[p];
15673 {
15674 char argument[256];
15675
15676 argument[0] = '\0';
15677 switch(param->type)
15678 {
15679 case 2:
15680 {
15681 char expString[1024];
15682 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15683 struct Declarator * decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
15684 struct Expression * exp;
15685 char * string = PrintHexUInt64(arg.expression.ui64);
15686
15687 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
15688 (__ecereNameSpace__ecere__com__eSystem_Delete(string), string = 0);
15689 ProcessExpressionType(exp);
15690 ComputeExpression(exp);
15691 expString[0] = '\0';
15692 PrintExpression(exp, expString);
15693 strcat(argument, expString);
15694 FreeExpression(exp);
15695 break;
15696 }
15697 case 1:
15698 {
15699 strcat(argument, arg.member->name);
15700 break;
15701 }
15702 case 0:
15703 {
15704 if(arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
15705 strcat(argument, arg.dataTypeString);
15706 break;
15707 }
15708 }
15709 if(argument[0])
15710 {
15711 if(paramCount)
15712 strcat(templateString, ", ");
15713 if(lastParam != p - 1)
15714 {
15715 strcat(templateString, param->name);
15716 strcat(templateString, " = ");
15717 }
15718 strcat(templateString, argument);
15719 paramCount++;
15720 lastParam = p;
15721 }
15722 }
15723 p++;
15724 }
15725 }
15726 {
15727 int len = strlen(templateString);
15728
15729 if(templateString[len - 1] == '>')
15730 templateString[len++] = ' ';
15731 templateString[len++] = '>';
15732 templateString[len++] = '\0';
15733 }
15734 FreeType(exp->expType);
15735 {
15736 struct Context * context = SetupTemplatesContext(tClass);
15737
15738 exp->expType = ProcessTypeString(templateString, 0x0);
15739 FinishTemplatesContext(context);
15740 }
15741 }
15742 }
15743 }
15744 }
15745 else
15746 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "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)");
15747 }
15748 else if(type && (type->kind == 9 || type->kind == 10))
15749 {
15750 struct Type * memberType = exp->member.member ? FindMember(type, exp->member.member->string) : (((void *)0));
15751
15752 if(memberType)
15753 {
15754 exp->expType = memberType;
15755 if(memberType)
15756 memberType->refCount++;
15757 }
15758 }
15759 else
15760 {
15761 char expString[10240];
15762
15763 expString[0] = '\0';
15764 if(inCompiler)
15765 {
15766 PrintExpression(exp, expString);
15767 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
15768 }
15769 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "member operator on non-structure type expression %s\n", (((void *)0))), expString);
15770 }
15771 if(exp->expType && exp->expType->kind == 21 && (!exp->destType || exp->destType->kind != 21))
15772 {
15773 if(type && (type->kind == 8 || type->kind == 19 || type->kind == 3 || type->kind == 15))
15774 {
15775 struct Identifier * id = exp->member.member;
15776 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));
15777
15778 if(_class)
15779 {
15780 FreeType(exp->expType);
15781 exp->expType = ReplaceThisClassType(_class);
15782 }
15783 }
15784 }
15785 yylloc = oldyylloc;
15786 break;
15787 }
15788 case 9:
15789 {
15790 struct Type * destType = exp->destType;
15791
15792 if(exp->member.member && exp->member.member->_class && exp->member.member->_class->name)
15793 {
15794 exp->member.member->classSym = exp->member.member->_class->symbol;
15795 }
15796 exp->member.exp = MkExpBrackets(MkListOne(MkExpOp((((void *)0)), '*', exp->member.exp)));
15797 exp->type = 8;
15798 if(destType)
15799 destType->count++;
15800 ProcessExpressionType(exp);
15801 if(destType)
15802 destType->count--;
15803 break;
15804 }
15805 case 15:
15806 {
15807 struct Symbol * classSym = exp->_class->symbol;
15808
15809 if(classSym && classSym->registered)
15810 {
15811 if(classSym->registered->type == 5)
15812 {
15813 char name[1024];
15814
15815 name[0] = '\0';
15816 DeclareStruct(classSym->string, 0x0);
15817 FreeSpecifier(exp->_class);
15818 exp->type = 10;
15819 FullClassNameCat(name, classSym->string, 0x0);
15820 exp->typeName = MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(name), (((void *)0)))), (((void *)0)));
15821 }
15822 else
15823 {
15824 if(classSym->registered->fixed)
15825 {
15826 FreeSpecifier(exp->_class);
15827 exp->constant = PrintUInt(classSym->registered->templateClass ? classSym->registered->templateClass->structSize : classSym->registered->structSize);
15828 exp->type = 2;
15829 }
15830 else
15831 {
15832 char className[1024];
15833
15834 strcpy(className, "__ecereClass_");
15835 FullClassNameCat(className, classSym->string, 0x1);
15836 MangleClassName(className);
15837 DeclareClass(classSym, className);
15838 FreeExpContents(exp);
15839 exp->type = 9;
15840 exp->member.exp = MkExpIdentifier(MkIdentifier(className));
15841 exp->member.member = MkIdentifier("structSize");
15842 }
15843 }
15844 }
15845 exp->expType = __extension__ ({
15846 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
15847
15848 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 3, __ecereInstance1;
15849 });
15850 break;
15851 }
15852 case 10:
15853 {
15854 struct Type * type = ProcessType(exp->typeName->qualifiers, exp->typeName->declarator);
15855
15856 exp->expType = __extension__ ({
15857 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
15858
15859 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 3, __ecereInstance1;
15860 });
15861 exp->isConstant = 0x1;
15862 DeclareType(type, 0x0, 0x0);
15863 FreeType(type);
15864 break;
15865 }
15866 case 11:
15867 {
15868 struct Type * type = ProcessType(exp->cast.typeName->qualifiers, exp->cast.typeName->declarator);
15869
15870 type->count = 1;
15871 FreeType(exp->cast.exp->destType);
15872 exp->cast.exp->destType = type;
15873 type->refCount++;
15874 ProcessExpressionType(exp->cast.exp);
15875 type->count = 0;
15876 exp->expType = type;
15877 if(!exp->cast.exp->needCast && !NeedCast(exp->cast.exp->expType, type))
15878 {
15879 void * prev = exp->prev, * next = exp->next;
15880 struct Type * expType = exp->cast.exp->destType;
15881 struct Expression * castExp = exp->cast.exp;
15882 struct Type * destType = exp->destType;
15883
15884 if(expType)
15885 expType->refCount++;
15886 FreeType(exp->expType);
15887 FreeTypeName(exp->cast.typeName);
15888 *exp = *castExp;
15889 FreeType(exp->expType);
15890 FreeType(exp->destType);
15891 exp->expType = expType;
15892 exp->destType = destType;
15893 ((castExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(castExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(castExp)) : 0), castExp = 0);
15894 exp->prev = prev;
15895 exp->next = next;
15896 }
15897 else
15898 {
15899 exp->isConstant = exp->cast.exp->isConstant;
15900 }
15901 break;
15902 }
15903 case 35:
15904 {
15905 struct Type * type = ProcessType(exp->initializer.typeName->qualifiers, exp->initializer.typeName->declarator);
15906
15907 exp->expType = type;
15908 break;
15909 }
15910 case 36:
15911 {
15912 struct Type * type = ProcessType(exp->vaArg.typeName->qualifiers, exp->vaArg.typeName->declarator);
15913
15914 ProcessExpressionType(exp->vaArg.exp);
15915 exp->expType = type;
15916 break;
15917 }
15918 case 12:
15919 {
15920 struct Expression * e;
15921
15922 exp->isConstant = 0x1;
15923 FreeType(exp->cond.cond->destType);
15924 exp->cond.cond->destType = MkClassType("bool");
15925 exp->cond.cond->destType->truth = 0x1;
15926 ProcessExpressionType(exp->cond.cond);
15927 if(!exp->cond.cond->isConstant)
15928 exp->isConstant = 0x0;
15929 for(e = (*exp->cond.exp).first; e; e = e->next)
15930 {
15931 if(!e->next)
15932 {
15933 FreeType(e->destType);
15934 e->destType = exp->destType;
15935 if(e->destType)
15936 e->destType->refCount++;
15937 }
15938 ProcessExpressionType(e);
15939 if(!e->next)
15940 {
15941 exp->expType = e->expType;
15942 if(e->expType)
15943 e->expType->refCount++;
15944 }
15945 if(!e->isConstant)
15946 exp->isConstant = 0x0;
15947 }
15948 FreeType(exp->cond.elseExp->destType);
15949 exp->cond.elseExp->destType = exp->destType ? exp->destType : exp->expType;
15950 if(exp->cond.elseExp->destType)
15951 exp->cond.elseExp->destType->refCount++;
15952 ProcessExpressionType(exp->cond.elseExp);
15953 if(!exp->cond.elseExp->isConstant)
15954 exp->isConstant = 0x0;
15955 break;
15956 }
15957 case 25:
15958 {
15959 if(exp->compound && exp->compound->compound.statements && (*exp->compound->compound.statements).last)
15960 {
15961 struct Statement * last = (*exp->compound->compound.statements).last;
15962
15963 if(last->type == 3 && last->expressions && (*last->expressions).last)
15964 {
15965 ((struct Expression *)(*last->expressions).last)->destType = exp->destType;
15966 if(exp->destType)
15967 exp->destType->refCount++;
15968 }
15969 ProcessStatement(exp->compound);
15970 exp->expType = (last->expressions && (*last->expressions).last) ? ((struct Expression *)(*last->expressions).last)->expType : (((void *)0));
15971 if(exp->expType)
15972 exp->expType->refCount++;
15973 }
15974 break;
15975 }
15976 case 26:
15977 {
15978 struct Specifier * spec = (*exp->_classExp.specifiers).first;
15979
15980 if(spec && spec->type == 1)
15981 {
15982 exp->expType = MkClassType(spec->name);
15983 exp->expType->kind = 19;
15984 exp->byReference = 0x1;
15985 }
15986 else
15987 {
15988 exp->expType = MkClassType("ecere::com::Class");
15989 exp->byReference = 0x1;
15990 }
15991 break;
15992 }
15993 case 27:
15994 {
15995 struct __ecereNameSpace__ecere__com__Class * _class = thisClass ? thisClass : currentClass;
15996
15997 if(_class)
15998 {
15999 struct Identifier * id = exp->classData.id;
16000 char structName[1024];
16001 struct Expression * classExp;
16002
16003 strcpy(structName, "__ecereClassData_");
16004 FullClassNameCat(structName, _class->fullName, 0x0);
16005 exp->type = 9;
16006 exp->member.member = id;
16007 if(curCompound && FindSymbol("this", curContext, curCompound->compound.context, 0x0, 0x0))
16008 classExp = MkExpMember(MkExpIdentifier(MkIdentifier("this")), MkIdentifier("_class"));
16009 else
16010 classExp = MkExpIdentifier(MkIdentifier("class"));
16011 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"))))))));
16012 ProcessExpressionType(exp);
16013 return ;
16014 }
16015 break;
16016 }
16017 case 37:
16018 {
16019 struct Type * type = (((void *)0));
16020 char * typeString = (((void *)0));
16021 char typeStringBuf[1024];
16022
16023 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))
16024 {
16025 struct __ecereNameSpace__ecere__com__Class * templateClass = exp->destType->_class->registered;
16026
16027 typeString = templateClass->templateArgs[2].dataTypeString;
16028 }
16029 else if(exp->list)
16030 {
16031 struct Expression * e;
16032
16033 for(e = (*exp->list).first; e; e = e->next)
16034 {
16035 ProcessExpressionType(e);
16036 if(e->expType)
16037 {
16038 if(!type)
16039 {
16040 type = e->expType;
16041 type->refCount++;
16042 }
16043 else
16044 {
16045 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
16046 {
16047 FreeType(type);
16048 type = e->expType;
16049 e->expType = (((void *)0));
16050 e = (*exp->list).first;
16051 ProcessExpressionType(e);
16052 if(e->expType)
16053 {
16054 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
16055 {
16056 FreeType(e->expType);
16057 e->expType = (((void *)0));
16058 FreeType(type);
16059 type = (((void *)0));
16060 break;
16061 }
16062 }
16063 }
16064 }
16065 if(e->expType)
16066 {
16067 FreeType(e->expType);
16068 e->expType = (((void *)0));
16069 }
16070 }
16071 }
16072 if(type)
16073 {
16074 typeStringBuf[0] = '\0';
16075 PrintTypeNoConst(type, typeStringBuf, 0x0, 0x1);
16076 typeString = typeStringBuf;
16077 FreeType(type);
16078 type = (((void *)0));
16079 }
16080 }
16081 if(typeString)
16082 {
16083 char templateString[1024];
16084 struct __ecereNameSpace__ecere__sys__OldList * initializers = MkList();
16085 struct __ecereNameSpace__ecere__sys__OldList * structInitializers = MkList();
16086 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
16087 struct Expression * expExt;
16088 struct Declarator * decl = SpecDeclFromString(typeString, specs, (((void *)0)));
16089
16090 sprintf(templateString, "Container<%s>", typeString);
16091 if(exp->list)
16092 {
16093 struct Expression * e;
16094
16095 type = ProcessTypeString(typeString, 0x0);
16096 while(e = (*exp->list).first)
16097 {
16098 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*exp->list), e);
16099 e->destType = type;
16100 type->refCount++;
16101 ProcessExpressionType(e);
16102 ListAdd(initializers, MkInitializerAssignment(e));
16103 }
16104 FreeType(type);
16105 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->list), exp->list = 0);
16106 }
16107 DeclareStruct("ecere::com::BuiltInContainer", 0x0);
16108 ListAdd(structInitializers, MkInitializerAssignment(MkExpMember(MkExpClass(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0))), MkIdentifier("_vTbl"))));
16109 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
16110 ListAdd(structInitializers, MkInitializerAssignment(MkExpClass(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0)))));
16111 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
16112 ListAdd(structInitializers, MkInitializerAssignment(MkExpConstant("0")));
16113 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
16114 ListAdd(structInitializers, MkInitializerAssignment(MkExpExtensionInitializer(MkTypeName(specs, MkDeclaratorArray(decl, (((void *)0)))), MkInitializerList(initializers))));
16115 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
16116 ListAdd(structInitializers, MkInitializerAssignment(__extension__ ({
16117 struct Expression * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
16118
16119 __ecereInstance1->type = 2, __ecereInstance1->constant = __ecereNameSpace__ecere__com__PrintString(__ecereClass_int, &(*initializers).count, (void *)0), __ecereInstance1;
16120 })));
16121 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
16122 ListAdd(structInitializers, MkInitializerAssignment(MkExpClass(CopyList(specs, CopySpecifier), CopyDeclarator(decl))));
16123 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
16124 exp->expType = ProcessTypeString(templateString, 0x0);
16125 exp->type = 5;
16126 exp->list = MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName(templateString)), (((void *)0))), MkExpOp((((void *)0)), '&', expExt = MkExpExtensionInitializer(MkTypeName(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0))), MkInitializerList(structInitializers)))));
16127 ProcessExpressionType(expExt);
16128 }
16129 else
16130 {
16131 exp->expType = ProcessTypeString("Container", 0x0);
16132 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Couldn't determine type of array elements\n", (((void *)0))));
16133 }
16134 break;
16135 }
16136 }
16137 if(exp->expType && exp->expType->kind == 21 && thisClass && (!exp->destType || exp->destType->kind != 21))
16138 {
16139 FreeType(exp->expType);
16140 exp->expType = ReplaceThisClassType(thisClass);
16141 }
16142 if(exp->expType && (exp->expType->kind == 9 || exp->expType->kind == 10 || exp->expType->kind == 15) && !exp->expType->members.first && exp->expType->enumName)
16143 {
16144 struct Symbol * symbol = FindSymbol(exp->expType->enumName, curContext, globalContext, 0x1, 0x0);
16145
16146 if(symbol)
16147 {
16148 if(exp->expType->kind != 15)
16149 {
16150 struct Type * member;
16151 char * enumName = __ecereNameSpace__ecere__sys__CopyString(exp->expType->enumName);
16152
16153 FreeType(exp->expType);
16154 exp->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16155 exp->expType->kind = symbol->type->kind;
16156 exp->expType->refCount++;
16157 exp->expType->enumName = enumName;
16158 exp->expType->members = symbol->type->members;
16159 for(member = symbol->type->members.first; member; member = member->next)
16160 member->refCount++;
16161 }
16162 else
16163 {
16164 struct __ecereNameSpace__ecere__sys__NamedLink * member;
16165
16166 for(member = symbol->type->members.first; member; member = member->next)
16167 {
16168 struct __ecereNameSpace__ecere__sys__NamedLink * value = (value = __ecereNameSpace__ecere__com__eSystem_New0(structSize_NamedLink), value->name = __ecereNameSpace__ecere__sys__CopyString(member->name), value);
16169
16170 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&exp->expType->members, value);
16171 }
16172 }
16173 }
16174 }
16175 yylloc = exp->loc;
16176 if(exp->destType && (exp->destType->kind == 0 || exp->destType->kind == 18))
16177 ;
16178 else if(exp->destType && !exp->destType->keepCast)
16179 {
16180 if(!CheckExpressionType(exp, exp->destType, 0x0))
16181 {
16182 if(!exp->destType->count || unresolved)
16183 {
16184 if(!exp->expType)
16185 {
16186 yylloc = exp->loc;
16187 if(exp->destType->kind != 14)
16188 {
16189 char type2[1024];
16190
16191 type2[0] = '\0';
16192 if(inCompiler)
16193 {
16194 char expString[10240];
16195
16196 expString[0] = '\0';
16197 PrintType(exp->destType, type2, 0x0, 0x1);
16198 if(inCompiler)
16199 {
16200 PrintExpression(exp, expString);
16201 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
16202 }
16203 if(unresolved)
16204 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved identifier %s; expected %s\n", (((void *)0))), expString, type2);
16205 else if(exp->type != 16)
16206 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s; expected %s\n", (((void *)0))), expString, type2);
16207 }
16208 }
16209 else
16210 {
16211 char expString[10240];
16212
16213 expString[0] = '\0';
16214 if(inCompiler)
16215 {
16216 PrintExpression(exp, expString);
16217 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
16218 }
16219 if(unresolved)
16220 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved identifier %s\n", (((void *)0))), expString);
16221 else if(exp->type != 16)
16222 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s\n", (((void *)0))), expString);
16223 }
16224 }
16225 else
16226 {
16227 char type1[1024];
16228 char type2[1024];
16229
16230 type1[0] = '\0';
16231 type2[0] = '\0';
16232 if(inCompiler)
16233 {
16234 PrintType(exp->expType, type1, 0x0, 0x1);
16235 PrintType(exp->destType, type2, 0x0, 0x1);
16236 }
16237 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)))
16238 ;
16239 else
16240 {
16241 char expString[10240];
16242
16243 expString[0] = '\0';
16244 if(inCompiler)
16245 {
16246 PrintExpression(exp, expString);
16247 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
16248 }
16249 if(!sourceFile || (strcmp(sourceFile, "src\\lexer.ec") && strcmp(sourceFile, "src/lexer.ec") && strcmp(sourceFile, "src\\grammar.ec") && strcmp(sourceFile, "src/grammar.ec")))
16250 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expression %s (%s); expected %s\n", (((void *)0))), expString, type1, type2);
16251 FreeType(exp->expType);
16252 exp->destType->refCount++;
16253 exp->expType = exp->destType;
16254 }
16255 }
16256 }
16257 }
16258 else if(exp->destType && exp->destType->kind == 14 && exp->expType && exp->expType->passAsTemplate)
16259 {
16260 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
16261 char typeString[1024];
16262 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
16263 struct Declarator * decl;
16264
16265 typeString[0] = '\0';
16266 *newExp = *exp;
16267 if(exp->expType)
16268 exp->expType->refCount++;
16269 if(exp->expType)
16270 exp->expType->refCount++;
16271 exp->type = 11;
16272 newExp->destType = exp->expType;
16273 PrintType(exp->expType, typeString, 0x0, 0x0);
16274 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
16275 exp->cast.typeName = MkTypeName(specs, decl);
16276 exp->cast.exp = newExp;
16277 }
16278 }
16279 else if(unresolved)
16280 {
16281 if(exp->identifier->_class && exp->identifier->_class->name)
16282 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved identifier %s::%s\n", (((void *)0))), exp->identifier->_class->name, exp->identifier->string);
16283 else if(exp->identifier->string && exp->identifier->string[0])
16284 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved identifier %s\n", (((void *)0))), exp->identifier->string);
16285 }
16286 else if(!exp->expType && exp->type != 16)
16287 {
16288 char expString[10240];
16289
16290 expString[0] = '\0';
16291 if(inCompiler)
16292 {
16293 PrintExpression(exp, expString);
16294 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
16295 }
16296 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s\n", (((void *)0))), expString);
16297 }
16298 if(inCompiler)
16299 ApplyAnyObjectLogic(exp);
16300 if(!notByReference && exp->expType && exp->expType->kind == 8 && exp->expType->_class && exp->expType->_class->registered && exp->expType->_class->registered->type == 5 && (!exp->destType || (exp->destType->kind != 3 && exp->destType->kind != 4 && exp->destType->kind != 22 && exp->destType->kind != 23 && exp->destType->kind != 5 && exp->destType->kind != 2 && exp->destType->kind != 1 && exp->destType->kind != 24)))
16301 {
16302 exp->byReference = 0x1;
16303 }
16304 yylloc = oldyylloc;
16305 }
16306
16307 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)
16308 {
16309 if(*curMember)
16310 {
16311 *curMember = (*curMember)->next;
16312 if(subMemberStackPos && *subMemberStackPos > 0 && subMemberStack[*subMemberStackPos - 1]->type == 1)
16313 {
16314 *curMember = subMemberStack[--(*subMemberStackPos)];
16315 *curMember = (*curMember)->next;
16316 }
16317 while((*curMember) && (*curMember)->isProperty)
16318 *curMember = (*curMember)->next;
16319 if(subMemberStackPos)
16320 {
16321 while((*curMember) && !(*curMember)->isProperty && !(*curMember)->name && ((*curMember)->type == 2 || (*curMember)->type == 1))
16322 {
16323 subMemberStack[(*subMemberStackPos)++] = *curMember;
16324 *curMember = (*curMember)->members.first;
16325 while(*curMember && (*curMember)->isProperty)
16326 *curMember = (*curMember)->next;
16327 }
16328 }
16329 }
16330 while(!*curMember)
16331 {
16332 if(!*curMember)
16333 {
16334 if(subMemberStackPos && *subMemberStackPos)
16335 {
16336 *curMember = subMemberStack[--(*subMemberStackPos)];
16337 *curMember = (*curMember)->next;
16338 }
16339 else
16340 {
16341 struct __ecereNameSpace__ecere__com__Class * lastCurClass = *curClass;
16342
16343 if(*curClass == _class)
16344 break;
16345 for(*curClass = _class; (*curClass)->base != lastCurClass && (*curClass)->base->type != 1000; *curClass = (*curClass)->base)
16346 ;
16347 *curMember = (*curClass)->membersAndProperties.first;
16348 }
16349 while((*curMember) && (*curMember)->isProperty)
16350 *curMember = (*curMember)->next;
16351 if(subMemberStackPos)
16352 {
16353 while((*curMember) && !(*curMember)->isProperty && !(*curMember)->name && ((*curMember)->type == 2 || (*curMember)->type == 1))
16354 {
16355 subMemberStack[(*subMemberStackPos)++] = *curMember;
16356 *curMember = (*curMember)->members.first;
16357 while(*curMember && (*curMember)->isProperty)
16358 *curMember = (*curMember)->next;
16359 }
16360 }
16361 }
16362 }
16363 }
16364
16365 static void ProcessInitializer(struct Initializer * init, struct Type * type)
16366 {
16367 switch(init->type)
16368 {
16369 case 0:
16370 if(!init->exp || init->exp->type != 1 || !init->exp->instance || init->exp->instance->_class || !type || type->kind == 8)
16371 {
16372 if(init->exp && !init->exp->destType)
16373 {
16374 FreeType(init->exp->destType);
16375 init->exp->destType = type;
16376 if(type)
16377 type->refCount++;
16378 }
16379 if(init->exp)
16380 {
16381 ProcessExpressionType(init->exp);
16382 init->isConstant = init->exp->isConstant;
16383 }
16384 break;
16385 }
16386 else
16387 {
16388 struct Expression * exp = init->exp;
16389 struct Instantiation * inst = exp->instance;
16390 struct MembersInit * members;
16391
16392 init->type = 1;
16393 init->list = MkList();
16394 if(inst->members)
16395 {
16396 for(members = (*inst->members).first; members; members = members->next)
16397 {
16398 if(members->type == 0)
16399 {
16400 struct MemberInit * member;
16401
16402 for(member = (*members->dataMembers).first; member; member = member->next)
16403 {
16404 ListAdd(init->list, member->initializer);
16405 member->initializer = (((void *)0));
16406 }
16407 }
16408 }
16409 }
16410 FreeExpression(exp);
16411 }
16412 case 1:
16413 {
16414 struct Initializer * i;
16415 struct Type * initializerType = (((void *)0));
16416 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
16417 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
16418 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
16419 int subMemberStackPos = 0;
16420
16421 if(type && type->kind == 12)
16422 initializerType = Dereference(type);
16423 else if(type && (type->kind == 9 || type->kind == 10))
16424 initializerType = type->members.first;
16425 for(i = (*init->list).first; i; i = i->next)
16426 {
16427 if(type && type->kind == 8 && type->_class && type->_class->registered)
16428 {
16429 FindNextDataMember(type->_class->registered, &curClass, &curMember, subMemberStack, &subMemberStackPos);
16430 if(curMember)
16431 {
16432 if(!curMember->dataType)
16433 curMember->dataType = ProcessTypeString(curMember->dataTypeString, 0x0);
16434 initializerType = curMember->dataType;
16435 }
16436 }
16437 ProcessInitializer(i, initializerType);
16438 if(initializerType && type && (type->kind == 9 || type->kind == 10))
16439 initializerType = initializerType->next;
16440 if(!i->isConstant)
16441 init->isConstant = 0x0;
16442 }
16443 if(type && type->kind == 12)
16444 FreeType(initializerType);
16445 if(type && type->kind != 12 && type->kind != 9 && type->kind != 10 && (type->kind != 8 || !type->_class->registered || type->_class->registered->type != 1))
16446 {
16447 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Assigning list initializer to non list\n", (((void *)0))));
16448 }
16449 break;
16450 }
16451 }
16452 }
16453
16454 extern struct Symbol * FindType(struct Context * ctx, char *  name);
16455
16456 static void ProcessClass(struct __ecereNameSpace__ecere__sys__OldList * definitions, struct Symbol * symbol);
16457
16458 static void ProcessSpecifier(struct Specifier * spec, unsigned int declareStruct)
16459 {
16460 switch(spec->type)
16461 {
16462 case 0:
16463 {
16464 if(spec->specifier == THISCLASS)
16465 {
16466 if(thisClass)
16467 {
16468 spec->type = 1;
16469 spec->name = ReplaceThisClass(thisClass);
16470 spec->symbol = FindClass(spec->name);
16471 ProcessSpecifier(spec, declareStruct);
16472 }
16473 }
16474 break;
16475 }
16476 case 1:
16477 {
16478 struct Symbol * symbol = FindType(curContext, spec->name);
16479
16480 if(symbol)
16481 DeclareType(symbol->type, 0x1, 0x1);
16482 else if((symbol = spec->symbol) && symbol->registered && symbol->registered->type == 1 && declareStruct)
16483 DeclareStruct(spec->name, 0x0);
16484 break;
16485 }
16486 case 2:
16487 {
16488 struct Enumerator * e;
16489
16490 if(spec->list)
16491 {
16492 for(e = (*spec->list).first; e; e = e->next)
16493 {
16494 if(e->exp)
16495 ProcessExpressionType(e->exp);
16496 }
16497 }
16498 break;
16499 }
16500 case 3:
16501 case 4:
16502 {
16503 if(spec->definitions)
16504 {
16505 struct ClassDef * def;
16506 struct Symbol * symbol = spec->id ? FindClass(spec->id->string) : (((void *)0));
16507
16508 ProcessClass(spec->definitions, symbol);
16509 }
16510 break;
16511 }
16512 }
16513 }
16514
16515 static void ProcessDeclarator(struct Declarator * decl)
16516 {
16517 switch(decl->type)
16518 {
16519 case 1:
16520 if(decl->identifier->classSym)
16521 {
16522 FreeSpecifier(decl->identifier->_class);
16523 decl->identifier->_class = (((void *)0));
16524 }
16525 break;
16526 case 3:
16527 if(decl->array.exp)
16528 ProcessExpressionType(decl->array.exp);
16529 case 0:
16530 case 2:
16531 case 4:
16532 case 5:
16533 case 6:
16534 case 7:
16535 if(decl->declarator)
16536 ProcessDeclarator(decl->declarator);
16537 if(decl->type == 4)
16538 {
16539 struct Identifier * id = GetDeclId(decl);
16540
16541 if(id && id->_class)
16542 {
16543 struct TypeName * param = (param = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TypeName), param->qualifiers = MkListOne(id->_class), param->declarator = (((void *)0)), param);
16544
16545 if(!decl->function.parameters)
16546 decl->function.parameters = MkList();
16547 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*decl->function.parameters), (((void *)0)), param);
16548 id->_class = (((void *)0));
16549 }
16550 if(decl->function.parameters)
16551 {
16552 struct TypeName * param;
16553
16554 for(param = (*decl->function.parameters).first; param; param = param->next)
16555 {
16556 if(param->qualifiers && (*param->qualifiers).first)
16557 {
16558 struct Specifier * spec = (*param->qualifiers).first;
16559
16560 if(spec && spec->specifier == TYPED_OBJECT)
16561 {
16562 struct Declarator * d = param->declarator;
16563 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);
16564
16565 FreeList(param->qualifiers, FreeSpecifier);
16566 param->qualifiers = MkListOne(MkStructOrUnion(3, MkIdentifier("__ecereNameSpace__ecere__com__Class"), (((void *)0))));
16567 param->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier("class")));
16568 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*decl->function.parameters), param, newParam);
16569 param = newParam;
16570 }
16571 else if(spec && spec->specifier == ANY_OBJECT)
16572 {
16573 struct Declarator * d = param->declarator;
16574
16575 FreeList(param->qualifiers, FreeSpecifier);
16576 param->qualifiers = MkListOne(MkSpecifier(VOID));
16577 param->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d);
16578 }
16579 else if(spec->specifier == THISCLASS)
16580 {
16581 if(thisClass)
16582 {
16583 spec->type = 1;
16584 spec->name = ReplaceThisClass(thisClass);
16585 spec->symbol = FindClass(spec->name);
16586 ProcessSpecifier(spec, 0x0);
16587 }
16588 }
16589 }
16590 if(param->declarator)
16591 ProcessDeclarator(param->declarator);
16592 }
16593 }
16594 }
16595 break;
16596 }
16597 }
16598
16599 extern struct Identifier * CopyIdentifier(struct Identifier * id);
16600
16601 extern void FreeInitDeclarator(struct InitDeclarator * decl);
16602
16603 static void ProcessDeclaration(struct Declaration * decl)
16604 {
16605 yylloc = decl->loc;
16606 switch(decl->type)
16607 {
16608 case 1:
16609 {
16610 unsigned int declareStruct = 0x0;
16611
16612 if(decl->declarators)
16613 {
16614 struct InitDeclarator * d;
16615
16616 for(d = (*decl->declarators).first; d; d = d->next)
16617 {
16618 struct Type * type, * subType;
16619
16620 ProcessDeclarator(d->declarator);
16621 type = ProcessType(decl->specifiers, d->declarator);
16622 if(d->initializer)
16623 {
16624 ProcessInitializer(d->initializer, type);
16625 if((*decl->declarators).count == 1 && d->initializer->type == 0 && d->initializer->exp->type == 1)
16626 {
16627 if(type->kind == 8 && type->_class == d->initializer->exp->expType->_class)
16628 {
16629 struct Instantiation * inst = d->initializer->exp->instance;
16630
16631 inst->exp = MkExpIdentifier(CopyIdentifier(GetDeclId(d->declarator)));
16632 d->initializer->exp->instance = (((void *)0));
16633 if(decl->specifiers)
16634 FreeList(decl->specifiers, FreeSpecifier);
16635 FreeList(decl->declarators, FreeInitDeclarator);
16636 d = (((void *)0));
16637 decl->type = 2;
16638 decl->inst = inst;
16639 }
16640 }
16641 }
16642 for(subType = type; subType; )
16643 {
16644 if(subType->kind == 8)
16645 {
16646 declareStruct = 0x1;
16647 break;
16648 }
16649 else if(subType->kind == 13)
16650 break;
16651 else if(subType->kind == 12)
16652 subType = subType->arrayType;
16653 else
16654 break;
16655 }
16656 FreeType(type);
16657 if(!d)
16658 break;
16659 }
16660 }
16661 if(decl->specifiers)
16662 {
16663 struct Specifier * s;
16664
16665 for(s = (*decl->specifiers).first; s; s = s->next)
16666 {
16667 ProcessSpecifier(s, declareStruct);
16668 }
16669 }
16670 break;
16671 }
16672 case 2:
16673 {
16674 ProcessInstantiationType(decl->inst);
16675 break;
16676 }
16677 case 0:
16678 {
16679 struct Specifier * spec;
16680 struct Declarator * d;
16681 unsigned int declareStruct = 0x0;
16682
16683 if(decl->declarators)
16684 {
16685 for(d = (*decl->declarators).first; d; d = d->next)
16686 {
16687 struct Type * type = ProcessType(decl->specifiers, d->declarator);
16688 struct Type * subType;
16689
16690 ProcessDeclarator(d);
16691 for(subType = type; subType; )
16692 {
16693 if(subType->kind == 8)
16694 {
16695 declareStruct = 0x1;
16696 break;
16697 }
16698 else if(subType->kind == 13)
16699 break;
16700 else if(subType->kind == 12)
16701 subType = subType->arrayType;
16702 else
16703 break;
16704 }
16705 FreeType(type);
16706 }
16707 }
16708 if(decl->specifiers)
16709 {
16710 for(spec = (*decl->specifiers).first; spec; spec = spec->next)
16711 ProcessSpecifier(spec, declareStruct);
16712 }
16713 break;
16714 }
16715 }
16716 }
16717
16718 static struct FunctionDefinition * curFunction;
16719
16720 static void CreateFireWatcher(struct __ecereNameSpace__ecere__com__Property * prop, struct Expression * object, struct Statement * stmt)
16721 {
16722 char propName[1024], propNameM[1024];
16723 char getName[1024], setName[1024];
16724 struct __ecereNameSpace__ecere__sys__OldList * args;
16725
16726 DeclareProperty(prop, setName, getName);
16727 strcpy(propName, "__ecereProp_");
16728 FullClassNameCat(propName, prop->_class->fullName, 0x0);
16729 strcat(propName, "_");
16730 FullClassNameCat(propName, prop->name, 0x1);
16731 MangleClassName(propName);
16732 strcpy(propNameM, "__ecerePropM_");
16733 FullClassNameCat(propNameM, prop->_class->fullName, 0x0);
16734 strcat(propNameM, "_");
16735 FullClassNameCat(propNameM, prop->name, 0x1);
16736 MangleClassName(propNameM);
16737 if(prop->isWatchable)
16738 {
16739 args = MkList();
16740 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
16741 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
16742 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireWatchers")), args));
16743 args = MkList();
16744 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
16745 ListAdd(args, MkExpIdentifier(MkIdentifier(propNameM)));
16746 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireWatchers")), args));
16747 }
16748 {
16749 args = MkList();
16750 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
16751 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
16752 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireSelfWatchers")), args));
16753 args = MkList();
16754 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
16755 ListAdd(args, MkExpIdentifier(MkIdentifier(propNameM)));
16756 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireSelfWatchers")), args));
16757 }
16758 if(curFunction->propSet && !strcmp(curFunction->propSet->string, prop->name) && (!object || (object->type == 0 && !strcmp(object->identifier->string, "this"))))
16759 curFunction->propSet->fireWatchersDone = 0x1;
16760 }
16761
16762 extern struct Declaration * MkDeclarationInst(struct Instantiation * inst);
16763
16764 extern struct Instantiation * MkInstantiationNamed(struct __ecereNameSpace__ecere__sys__OldList * specs, struct Expression * exp, struct __ecereNameSpace__ecere__sys__OldList * members);
16765
16766 extern struct Statement * MkIfStmt(struct __ecereNameSpace__ecere__sys__OldList * exp, struct Statement * statement, struct Statement * elseStmt);
16767
16768 extern struct Statement * MkForStmt(struct Statement * init, struct Statement * check, struct __ecereNameSpace__ecere__sys__OldList * inc, struct Statement * statement);
16769
16770 extern struct Statement * MkWhileStmt(struct __ecereNameSpace__ecere__sys__OldList * exp, struct Statement * statement);
16771
16772 extern struct ClassFunction * MkClassFunction(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct Specifier * _class, struct Declarator * decl, struct __ecereNameSpace__ecere__sys__OldList * declList);
16773
16774 extern void ProcessClassFunctionBody(struct ClassFunction * func, struct Statement * body);
16775
16776 extern void FreePropertyWatch(struct PropertyWatch * watcher);
16777
16778 static void ProcessStatement(struct Statement * stmt)
16779 {
16780 yylloc = stmt->loc;
16781 switch(stmt->type)
16782 {
16783 case 0:
16784 ProcessStatement(stmt->labeled.stmt);
16785 break;
16786 case 1:
16787 if(stmt->caseStmt.exp)
16788 {
16789 FreeType(stmt->caseStmt.exp->destType);
16790 stmt->caseStmt.exp->destType = curSwitchType;
16791 if(curSwitchType)
16792 curSwitchType->refCount++;
16793 ProcessExpressionType(stmt->caseStmt.exp);
16794 ComputeExpression(stmt->caseStmt.exp);
16795 }
16796 if(stmt->caseStmt.stmt)
16797 ProcessStatement(stmt->caseStmt.stmt);
16798 break;
16799 case 2:
16800 {
16801 if(stmt->compound.context)
16802 {
16803 struct Declaration * decl;
16804 struct Statement * s;
16805 struct Statement * prevCompound = curCompound;
16806 struct Context * prevContext = curContext;
16807
16808 if(!stmt->compound.isSwitch)
16809 curCompound = stmt;
16810 curContext = stmt->compound.context;
16811 if(stmt->compound.declarations)
16812 {
16813 for(decl = (*stmt->compound.declarations).first; decl; decl = decl->next)
16814 ProcessDeclaration(decl);
16815 }
16816 if(stmt->compound.statements)
16817 {
16818 for(s = (*stmt->compound.statements).first; s; s = s->next)
16819 ProcessStatement(s);
16820 }
16821 curContext = prevContext;
16822 curCompound = prevCompound;
16823 }
16824 break;
16825 }
16826 case 3:
16827 {
16828 struct Expression * exp;
16829
16830 if(stmt->expressions)
16831 {
16832 for(exp = (*stmt->expressions).first; exp; exp = exp->next)
16833 ProcessExpressionType(exp);
16834 }
16835 break;
16836 }
16837 case 4:
16838 {
16839 struct Expression * exp;
16840
16841 FreeType(((struct Expression *)(*stmt->ifStmt.exp).last)->destType);
16842 ((struct Expression *)(*stmt->ifStmt.exp).last)->destType = MkClassType("bool");
16843 ((struct Expression *)(*stmt->ifStmt.exp).last)->destType->truth = 0x1;
16844 for(exp = (*stmt->ifStmt.exp).first; exp; exp = exp->next)
16845 {
16846 ProcessExpressionType(exp);
16847 }
16848 if(stmt->ifStmt.stmt)
16849 ProcessStatement(stmt->ifStmt.stmt);
16850 if(stmt->ifStmt.elseStmt)
16851 ProcessStatement(stmt->ifStmt.elseStmt);
16852 break;
16853 }
16854 case 5:
16855 {
16856 struct Type * oldSwitchType = curSwitchType;
16857
16858 if(stmt->switchStmt.exp)
16859 {
16860 struct Expression * exp;
16861
16862 for(exp = (*stmt->switchStmt.exp).first; exp; exp = exp->next)
16863 {
16864 if(!exp->next)
16865 {
16866 ProcessExpressionType(exp);
16867 }
16868 if(!exp->next)
16869 curSwitchType = exp->expType;
16870 }
16871 }
16872 ProcessStatement(stmt->switchStmt.stmt);
16873 curSwitchType = oldSwitchType;
16874 break;
16875 }
16876 case 6:
16877 {
16878 if(stmt->whileStmt.exp)
16879 {
16880 struct Expression * exp;
16881
16882 FreeType(((struct Expression *)(*stmt->whileStmt.exp).last)->destType);
16883 ((struct Expression *)(*stmt->whileStmt.exp).last)->destType = MkClassType("bool");
16884 ((struct Expression *)(*stmt->whileStmt.exp).last)->destType->truth = 0x1;
16885 for(exp = (*stmt->whileStmt.exp).first; exp; exp = exp->next)
16886 {
16887 ProcessExpressionType(exp);
16888 }
16889 }
16890 if(stmt->whileStmt.stmt)
16891 ProcessStatement(stmt->whileStmt.stmt);
16892 break;
16893 }
16894 case 7:
16895 {
16896 if(stmt->doWhile.exp)
16897 {
16898 struct Expression * exp;
16899
16900 if((*stmt->doWhile.exp).last)
16901 {
16902 FreeType(((struct Expression *)(*stmt->doWhile.exp).last)->destType);
16903 ((struct Expression *)(*stmt->doWhile.exp).last)->destType = MkClassType("bool");
16904 ((struct Expression *)(*stmt->doWhile.exp).last)->destType->truth = 0x1;
16905 }
16906 for(exp = (*stmt->doWhile.exp).first; exp; exp = exp->next)
16907 {
16908 ProcessExpressionType(exp);
16909 }
16910 }
16911 if(stmt->doWhile.stmt)
16912 ProcessStatement(stmt->doWhile.stmt);
16913 break;
16914 }
16915 case 8:
16916 {
16917 struct Expression * exp;
16918
16919 if(stmt->forStmt.init)
16920 ProcessStatement(stmt->forStmt.init);
16921 if(stmt->forStmt.check && stmt->forStmt.check->expressions)
16922 {
16923 FreeType(((struct Expression *)(*stmt->forStmt.check->expressions).last)->destType);
16924 ((struct Expression *)(*stmt->forStmt.check->expressions).last)->destType = MkClassType("bool");
16925 ((struct Expression *)(*stmt->forStmt.check->expressions).last)->destType->truth = 0x1;
16926 }
16927 if(stmt->forStmt.check)
16928 ProcessStatement(stmt->forStmt.check);
16929 if(stmt->forStmt.increment)
16930 {
16931 for(exp = (*stmt->forStmt.increment).first; exp; exp = exp->next)
16932 ProcessExpressionType(exp);
16933 }
16934 if(stmt->forStmt.stmt)
16935 ProcessStatement(stmt->forStmt.stmt);
16936 break;
16937 }
16938 case 18:
16939 {
16940 struct Identifier * id = stmt->forEachStmt.id;
16941 struct __ecereNameSpace__ecere__sys__OldList * exp = stmt->forEachStmt.exp;
16942 struct __ecereNameSpace__ecere__sys__OldList * filter = stmt->forEachStmt.filter;
16943 struct Statement * block = stmt->forEachStmt.stmt;
16944 char iteratorType[1024];
16945 struct Type * source;
16946 struct Expression * e;
16947 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));
16948 struct Expression * arrayExp;
16949 char * typeString = (((void *)0));
16950 int builtinCount = 0;
16951
16952 for(e = exp ? (*exp).first : (((void *)0)); e; e = e->next)
16953 {
16954 if(!e->next)
16955 {
16956 FreeType(e->destType);
16957 e->destType = ProcessTypeString("Container", 0x0);
16958 }
16959 if(!isBuiltin || e->next)
16960 ProcessExpressionType(e);
16961 }
16962 source = (exp && (*exp).last) ? ((struct Expression *)(*exp).last)->expType : (((void *)0));
16963 if(isBuiltin || (source && source->kind == 8 && source->_class && source->_class->registered && source->_class->registered != containerClass && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, containerClass)))
16964 {
16965 struct __ecereNameSpace__ecere__com__Class * _class = source ? source->_class->registered : (((void *)0));
16966 struct Symbol * symbol;
16967 struct Expression * expIt = (((void *)0));
16968 unsigned int isMap = 0x0, isArray = 0x0, isLinkList = 0x0, isList = 0x0, isCustomAVLTree = 0x0, isAVLTree = 0x0;
16969 struct __ecereNameSpace__ecere__com__Class * arrayClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "Array");
16970 struct __ecereNameSpace__ecere__com__Class * linkListClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "LinkList");
16971 struct __ecereNameSpace__ecere__com__Class * customAVLTreeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "CustomAVLTree");
16972
16973 stmt->type = 2;
16974 stmt->compound.context = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Context);
16975 stmt->compound.context->parent = curContext;
16976 curContext = stmt->compound.context;
16977 if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, customAVLTreeClass))
16978 {
16979 struct __ecereNameSpace__ecere__com__Class * mapClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "Map");
16980 struct __ecereNameSpace__ecere__com__Class * avlTreeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "AVLTree");
16981
16982 isCustomAVLTree = 0x1;
16983 if(__ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, avlTreeClass))
16984 isAVLTree = 0x1;
16985 else if(__ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, mapClass))
16986 isMap = 0x1;
16987 }
16988 else if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, arrayClass))
16989 isArray = 0x1;
16990 else if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, linkListClass))
16991 {
16992 struct __ecereNameSpace__ecere__com__Class * listClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "List");
16993
16994 isLinkList = 0x1;
16995 isList = __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, listClass);
16996 }
16997 if(isArray)
16998 {
16999 struct Declarator * decl;
17000 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
17001
17002 decl = SpecDeclFromString(_class->templateArgs[2].dataTypeString, specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(id)));
17003 stmt->compound.declarations = MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(decl, (((void *)0))))));
17004 ListAdd(stmt->compound.declarations, MkDeclaration(MkListOne(MkSpecifierName(source->_class->registered->fullName)), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internalArray")), MkInitializerAssignment(MkExpBrackets(exp))))));
17005 }
17006 else if(isBuiltin)
17007 {
17008 struct Type * type = (((void *)0));
17009 char typeStringBuf[1024];
17010
17011 arrayExp = (((struct Expression *)(*exp).last)->type == 37) ? (struct Expression *)(*exp).last : ((struct Expression *)(*exp).last)->cast.exp;
17012 if(((struct Expression *)(*exp).last)->type == 11)
17013 {
17014 struct TypeName * typeName = ((struct Expression *)(*exp).last)->cast.typeName;
17015
17016 if(typeName)
17017 arrayExp->destType = ProcessType(typeName->qualifiers, typeName->declarator);
17018 }
17019 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)
17020 {
17021 struct __ecereNameSpace__ecere__com__Class * templateClass = arrayExp->destType->_class->registered;
17022
17023 typeString = templateClass->templateArgs[2].dataTypeString;
17024 }
17025 else if(arrayExp->list)
17026 {
17027 struct Expression * e;
17028
17029 for(e = (*arrayExp->list).first; e; e = e->next)
17030 {
17031 ProcessExpressionType(e);
17032 if(e->expType)
17033 {
17034 if(!type)
17035 {
17036 type = e->expType;
17037 type->refCount++;
17038 }
17039 else
17040 {
17041 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
17042 {
17043 FreeType(type);
17044 type = e->expType;
17045 e->expType = (((void *)0));
17046 e = (*arrayExp->list).first;
17047 ProcessExpressionType(e);
17048 if(e->expType)
17049 {
17050 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
17051 {
17052 FreeType(e->expType);
17053 e->expType = (((void *)0));
17054 FreeType(type);
17055 type = (((void *)0));
17056 break;
17057 }
17058 }
17059 }
17060 }
17061 if(e->expType)
17062 {
17063 FreeType(e->expType);
17064 e->expType = (((void *)0));
17065 }
17066 }
17067 }
17068 if(type)
17069 {
17070 typeStringBuf[0] = '\0';
17071 PrintType(type, typeStringBuf, 0x0, 0x1);
17072 typeString = typeStringBuf;
17073 FreeType(type);
17074 }
17075 }
17076 if(typeString)
17077 {
17078 struct __ecereNameSpace__ecere__sys__OldList * initializers = MkList();
17079 struct Declarator * decl;
17080 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
17081
17082 if(arrayExp->list)
17083 {
17084 struct Expression * e;
17085
17086 builtinCount = (*arrayExp->list).count;
17087 type = ProcessTypeString(typeString, 0x0);
17088 while(e = (*arrayExp->list).first)
17089 {
17090 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*arrayExp->list), e);
17091 e->destType = type;
17092 type->refCount++;
17093 ProcessExpressionType(e);
17094 ListAdd(initializers, MkInitializerAssignment(e));
17095 }
17096 FreeType(type);
17097 (__ecereNameSpace__ecere__com__eSystem_Delete(arrayExp->list), arrayExp->list = 0);
17098 }
17099 decl = SpecDeclFromString(typeString, specs, MkDeclaratorIdentifier(id));
17100 stmt->compound.declarations = MkListOne(MkDeclaration(CopyList(specs, CopySpecifier), MkListOne(MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl), (((void *)0))))));
17101 ListAdd(stmt->compound.declarations, MkDeclaration(specs, MkListOne(MkInitDeclarator(PlugDeclarator(decl, MkDeclaratorArray(MkDeclaratorIdentifier(MkIdentifier("__internalArray")), (((void *)0)))), MkInitializerList(initializers)))));
17102 FreeList(exp, FreeExpression);
17103 }
17104 else
17105 {
17106 arrayExp->expType = ProcessTypeString("Container", 0x0);
17107 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Couldn't determine type of array elements\n", (((void *)0))));
17108 }
17109 }
17110 else if(isLinkList && !isList)
17111 {
17112 struct Declarator * decl;
17113 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
17114
17115 decl = SpecDeclFromString(_class->templateArgs[3].dataTypeString, specs, MkDeclaratorIdentifier(id));
17116 stmt->compound.declarations = MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(decl, (((void *)0))))));
17117 ListAdd(stmt->compound.declarations, MkDeclaration(MkListOne(MkSpecifierName(source->_class->registered->fullName)), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internalLinkList")), MkInitializerAssignment(MkExpBrackets(exp))))));
17118 }
17119 else if(_class->templateArgs)
17120 {
17121 if(isMap)
17122 sprintf(iteratorType, "MapIterator<%s, %s >", _class->templateArgs[5].dataTypeString, _class->templateArgs[6].dataTypeString);
17123 else
17124 sprintf(iteratorType, "Iterator<%s, %s >", _class->templateArgs[2].dataTypeString, _class->templateArgs[1].dataTypeString);
17125 stmt->compound.declarations = MkListOne(MkDeclarationInst(MkInstantiationNamed(MkListOne(MkSpecifierName(iteratorType)), MkExpIdentifier(id), MkListOne(MkMembersInitList(MkListOne(MkMemberInit(isMap ? MkListOne(MkIdentifier("map")) : (((void *)0)), MkInitializerAssignment(MkExpBrackets(exp)))))))));
17126 }
17127 symbol = FindSymbol(id->string, curContext, curContext, 0x0, 0x0);
17128 if(block)
17129 {
17130 switch(block->type)
17131 {
17132 case 2:
17133 if(block->compound.context)
17134 block->compound.context->parent = stmt->compound.context;
17135 break;
17136 case 4:
17137 if(block->ifStmt.stmt && block->ifStmt.stmt->type == 2 && block->ifStmt.stmt->compound.context)
17138 block->ifStmt.stmt->compound.context->parent = stmt->compound.context;
17139 if(block->ifStmt.elseStmt && block->ifStmt.elseStmt->type == 2 && block->ifStmt.elseStmt->compound.context)
17140 block->ifStmt.elseStmt->compound.context->parent = stmt->compound.context;
17141 break;
17142 case 5:
17143 if(block->switchStmt.stmt && block->switchStmt.stmt->type == 2 && block->switchStmt.stmt->compound.context)
17144 block->switchStmt.stmt->compound.context->parent = stmt->compound.context;
17145 break;
17146 case 6:
17147 if(block->whileStmt.stmt && block->whileStmt.stmt->type == 2 && block->whileStmt.stmt->compound.context)
17148 block->whileStmt.stmt->compound.context->parent = stmt->compound.context;
17149 break;
17150 case 7:
17151 if(block->doWhile.stmt && block->doWhile.stmt->type == 2 && block->doWhile.stmt->compound.context)
17152 block->doWhile.stmt->compound.context->parent = stmt->compound.context;
17153 break;
17154 case 8:
17155 if(block->forStmt.stmt && block->forStmt.stmt->type == 2 && block->forStmt.stmt->compound.context)
17156 block->forStmt.stmt->compound.context->parent = stmt->compound.context;
17157 break;
17158 case 18:
17159 if(block->forEachStmt.stmt && block->forEachStmt.stmt->type == 2 && block->forEachStmt.stmt->compound.context)
17160 block->forEachStmt.stmt->compound.context->parent = stmt->compound.context;
17161 break;
17162 }
17163 }
17164 if(filter)
17165 {
17166 block = MkIfStmt(filter, block, (((void *)0)));
17167 }
17168 if(isArray)
17169 {
17170 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));
17171 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.init);
17172 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.check);
17173 ProcessExpressionType((*((struct Statement *)(*stmt->compound.statements).first)->forStmt.increment).first);
17174 }
17175 else if(isBuiltin)
17176 {
17177 char count[128];
17178
17179 sprintf(count, "%d", builtinCount);
17180 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));
17181 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.init);
17182 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.check);
17183 ProcessExpressionType((*((struct Statement *)(*stmt->compound.statements).first)->forStmt.increment).first);
17184 }
17185 else if(isLinkList && !isList)
17186 {
17187 struct __ecereNameSpace__ecere__com__Class * typeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, _class->templateArgs[3].dataTypeString);
17188 struct __ecereNameSpace__ecere__com__Class * listItemClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, "ListItem");
17189
17190 if(typeClass && __ecereNameSpace__ecere__com__eClass_IsDerived(typeClass, listItemClass) && _class->templateArgs[5].dataTypeString && !strcmp(_class->templateArgs[5].dataTypeString, "LT::link"))
17191 {
17192 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));
17193 }
17194 else
17195 {
17196 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
17197 struct Declarator * decl = SpecDeclFromString(_class->templateArgs[3].dataTypeString, specs, (((void *)0)));
17198
17199 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));
17200 }
17201 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.init);
17202 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.check);
17203 ProcessExpressionType((*((struct Statement *)(*stmt->compound.statements).first)->forStmt.increment).first);
17204 }
17205 else
17206 {
17207 stmt->compound.statements = MkListOne(MkWhileStmt(MkListOne(MkExpCall(MkExpMember(expIt = MkExpIdentifier(CopyIdentifier(id)), MkIdentifier("Next")), (((void *)0)))), block));
17208 }
17209 ProcessExpressionType(expIt);
17210 if((*stmt->compound.declarations).first)
17211 ProcessDeclaration((*stmt->compound.declarations).first);
17212 if(symbol)
17213 symbol->isIterator = isMap ? 2 : ((isArray || isBuiltin) ? 3 : (isLinkList ? (isList ? 5 : 4) : (isCustomAVLTree ? 6 : 1)));
17214 ProcessStatement(stmt);
17215 curContext = stmt->compound.context->parent;
17216 break;
17217 }
17218 else
17219 {
17220 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Expression is not a container\n", (((void *)0))));
17221 }
17222 break;
17223 }
17224 case 9:
17225 break;
17226 case 10:
17227 break;
17228 case 11:
17229 break;
17230 case 12:
17231 {
17232 struct Expression * exp;
17233
17234 if(stmt->expressions)
17235 {
17236 for(exp = (*stmt->expressions).first; exp; exp = exp->next)
17237 {
17238 if(!exp->next)
17239 {
17240 if(curFunction && !curFunction->type)
17241 curFunction->type = ProcessType(curFunction->specifiers, curFunction->declarator);
17242 FreeType(exp->destType);
17243 exp->destType = (curFunction && curFunction->type && curFunction->type->kind == 11) ? curFunction->type->returnType : (((void *)0));
17244 if(exp->destType)
17245 exp->destType->refCount++;
17246 }
17247 ProcessExpressionType(exp);
17248 }
17249 }
17250 break;
17251 }
17252 case 14:
17253 {
17254 ProcessDeclaration(stmt->decl);
17255 break;
17256 }
17257 case 13:
17258 {
17259 struct AsmField * field;
17260
17261 if(stmt->asmStmt.inputFields)
17262 {
17263 for(field = (*stmt->asmStmt.inputFields).first; field; field = field->next)
17264 if(field->expression)
17265 ProcessExpressionType(field->expression);
17266 }
17267 if(stmt->asmStmt.outputFields)
17268 {
17269 for(field = (*stmt->asmStmt.outputFields).first; field; field = field->next)
17270 if(field->expression)
17271 ProcessExpressionType(field->expression);
17272 }
17273 if(stmt->asmStmt.clobberedFields)
17274 {
17275 for(field = (*stmt->asmStmt.clobberedFields).first; field; field = field->next)
17276 {
17277 if(field->expression)
17278 ProcessExpressionType(field->expression);
17279 }
17280 }
17281 break;
17282 }
17283 case 17:
17284 {
17285 struct PropertyWatch * propWatch;
17286 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->_watch.watches;
17287 struct Expression * object = stmt->_watch.object;
17288 struct Expression * watcher = stmt->_watch.watcher;
17289
17290 if(watcher)
17291 ProcessExpressionType(watcher);
17292 if(object)
17293 ProcessExpressionType(object);
17294 if(inCompiler)
17295 {
17296 if(watcher || thisClass)
17297 {
17298 struct External * external = curExternal;
17299 struct Context * context = curContext;
17300
17301 stmt->type = 3;
17302 stmt->expressions = MkList();
17303 curExternal = external->prev;
17304 for(propWatch = (*watches).first; propWatch; propWatch = propWatch->next)
17305 {
17306 struct ClassFunction * func;
17307 char watcherName[1024];
17308 struct __ecereNameSpace__ecere__com__Class * watcherClass = watcher ? ((watcher->expType && watcher->expType->kind == 8 && watcher->expType->_class) ? watcher->expType->_class->registered : (((void *)0))) : thisClass;
17309 struct External * createdExternal;
17310 struct External * externalDecl = MkExternalDeclaration((((void *)0)));
17311
17312 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, externalDecl);
17313 sprintf(watcherName, "__ecerePropertyWatcher_%d", propWatcherID++);
17314 if(propWatch->deleteWatch)
17315 strcat(watcherName, "_delete");
17316 else
17317 {
17318 struct Identifier * propID;
17319
17320 for(propID = (*propWatch->properties).first; propID; propID = propID->next)
17321 {
17322 strcat(watcherName, "_");
17323 strcat(watcherName, propID->string);
17324 }
17325 }
17326 if(object && object->expType && object->expType->kind == 8 && object->expType->_class && object->expType->_class->registered)
17327 {
17328 func = MkClassFunction(MkListOne(MkSpecifier(VOID)), (((void *)0)), MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(watcherName)), MkListOne(MkTypeName(MkListOne(MkSpecifierName(object->expType->_class->string)), MkDeclaratorIdentifier(MkIdentifier("value"))))), (((void *)0)));
17329 ProcessClassFunctionBody(func, propWatch->compound);
17330 propWatch->compound = (((void *)0));
17331 createdExternal = ProcessClassFunction(watcherClass, func, ast, curExternal, 0x1);
17332 createdExternal->symbol->idCode = external->symbol->idCode;
17333 curExternal = createdExternal;
17334 ProcessFunction(createdExternal->function);
17335 {
17336 struct Declaration * decl = MkDeclaration(CopyList(createdExternal->function->specifiers, CopySpecifier), MkListOne(MkInitDeclarator(CopyDeclarator(createdExternal->function->declarator), (((void *)0)))));
17337
17338 externalDecl->declaration = decl;
17339 if(decl->symbol && !decl->symbol->pointerExternal)
17340 decl->symbol->pointerExternal = externalDecl;
17341 }
17342 if(propWatch->deleteWatch)
17343 {
17344 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
17345
17346 ListAdd(args, CopyExpression(object));
17347 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
17348 ListAdd(args, MkExpIdentifier(MkIdentifier(watcherName)));
17349 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_WatchDestruction")), args));
17350 }
17351 else
17352 {
17353 struct __ecereNameSpace__ecere__com__Class * _class = object->expType->_class->registered;
17354 struct Identifier * propID;
17355
17356 for(propID = (*propWatch->properties).first; propID; propID = propID->next)
17357 {
17358 char propName[1024];
17359 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
17360
17361 if(prop)
17362 {
17363 char getName[1024], setName[1024];
17364 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
17365
17366 DeclareProperty(prop, setName, getName);
17367 strcpy(propName, "__ecereProp_");
17368 FullClassNameCat(propName, prop->_class->fullName, 0x0);
17369 strcat(propName, "_");
17370 FullClassNameCat(propName, prop->name, 0x1);
17371 ListAdd(args, CopyExpression(object));
17372 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
17373 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
17374 ListAdd(args, MkExpIdentifier(MkIdentifier(watcherName)));
17375 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_Watch")), args));
17376 }
17377 else
17378 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Property %s not found in class %s\n", (((void *)0))), prop->name, _class->fullName);
17379 }
17380 }
17381 }
17382 else
17383 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Invalid watched object\n", (((void *)0))));
17384 }
17385 curExternal = external;
17386 curContext = context;
17387 if(watcher)
17388 FreeExpression(watcher);
17389 if(object)
17390 FreeExpression(object);
17391 FreeList(watches, FreePropertyWatch);
17392 }
17393 else
17394 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "No observer specified and not inside a _class\n", (((void *)0))));
17395 }
17396 else
17397 {
17398 for(propWatch = (*watches).first; propWatch; propWatch = propWatch->next)
17399 {
17400 ProcessStatement(propWatch->compound);
17401 }
17402 }
17403 break;
17404 }
17405 case 15:
17406 {
17407 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->_watch.watches;
17408 struct Expression * object = stmt->_watch.object;
17409 struct __ecereNameSpace__ecere__com__Class * _class;
17410
17411 if(object)
17412 ProcessExpressionType(object);
17413 if(inCompiler)
17414 {
17415 _class = object ? ((object->expType && object->expType->kind == 8 && object->expType->_class) ? object->expType->_class->registered : (((void *)0))) : thisClass;
17416 if(_class)
17417 {
17418 struct Identifier * propID;
17419
17420 stmt->type = 3;
17421 stmt->expressions = MkList();
17422 if(!watches && curFunction->propSet && (!object || (object->type == 0 && !strcmp(object->identifier->string, "this"))))
17423 {
17424 watches = MkListOne(MkIdentifier(curFunction->propSet->string));
17425 }
17426 else if(!watches)
17427 {
17428 }
17429 if(watches)
17430 {
17431 for(propID = (*watches).first; propID; propID = propID->next)
17432 {
17433 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
17434
17435 if(prop)
17436 {
17437 CreateFireWatcher(prop, object, stmt);
17438 }
17439 else
17440 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Property %s not found in class %s\n", (((void *)0))), propID->string, _class->fullName);
17441 }
17442 }
17443 else
17444 {
17445 struct __ecereNameSpace__ecere__com__Property * prop;
17446 struct __ecereNameSpace__ecere__com__Class * base;
17447
17448 for(base = _class; base; base = base->base)
17449 {
17450 for(prop = base->membersAndProperties.first; prop; prop = prop->next)
17451 {
17452 if(prop->isProperty && prop->isWatchable)
17453 {
17454 CreateFireWatcher(prop, object, stmt);
17455 }
17456 }
17457 }
17458 }
17459 if(object)
17460 FreeExpression(object);
17461 FreeList(watches, FreeIdentifier);
17462 }
17463 else
17464 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Invalid object specified and not inside a class\n", (((void *)0))));
17465 }
17466 break;
17467 }
17468 case 16:
17469 {
17470 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->_watch.watches;
17471 struct Expression * object = stmt->_watch.object;
17472 struct Expression * watcher = stmt->_watch.watcher;
17473 struct __ecereNameSpace__ecere__com__Class * _class;
17474
17475 if(object)
17476 ProcessExpressionType(object);
17477 if(watcher)
17478 ProcessExpressionType(watcher);
17479 if(inCompiler)
17480 {
17481 _class = (object && object->expType && object->expType->kind == 8 && object->expType->_class) ? object->expType->_class->registered : (((void *)0));
17482 if(watcher || thisClass)
17483 {
17484 if(_class)
17485 {
17486 struct Identifier * propID;
17487
17488 stmt->type = 3;
17489 stmt->expressions = MkList();
17490 if(!watches)
17491 {
17492 struct __ecereNameSpace__ecere__sys__OldList * args;
17493
17494 args = MkList();
17495 ListAdd(args, CopyExpression(object));
17496 ListAdd(args, MkExpConstant("0"));
17497 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
17498 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_StopWatching")), args));
17499 }
17500 else
17501 {
17502 for(propID = (*watches).first; propID; propID = propID->next)
17503 {
17504 char propName[1024];
17505 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
17506
17507 if(prop)
17508 {
17509 char getName[1024], setName[1024];
17510 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
17511
17512 DeclareProperty(prop, setName, getName);
17513 strcpy(propName, "__ecereProp_");
17514 FullClassNameCat(propName, prop->_class->fullName, 0x0);
17515 strcat(propName, "_");
17516 FullClassNameCat(propName, prop->name, 0x1);
17517 MangleClassName(propName);
17518 ListAdd(args, CopyExpression(object));
17519 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
17520 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
17521 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_StopWatching")), args));
17522 }
17523 else
17524 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Property %s not found in class %s\n", (((void *)0))), prop->name, _class->fullName);
17525 }
17526 }
17527 if(object)
17528 FreeExpression(object);
17529 if(watcher)
17530 FreeExpression(watcher);
17531 FreeList(watches, FreeIdentifier);
17532 }
17533 else
17534 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Invalid object specified and not inside a class\n", (((void *)0))));
17535 }
17536 else
17537 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "No observer specified and not inside a class\n", (((void *)0))));
17538 }
17539 break;
17540 }
17541 }
17542 }
17543
17544 extern struct Expression * QBrackets(struct Expression * exp);
17545
17546 extern struct TypeName * QMkType(char *  spec, struct Declarator * decl);
17547
17548 extern struct Declarator * QMkPtrDecl(char *  id);
17549
17550 extern struct Expression * MkExpPointer(struct Expression * expression, struct Identifier * member);
17551
17552 extern struct Expression * QMkExpCond(struct Expression * cond, struct Expression * exp, struct Expression * elseExp);
17553
17554 extern struct Statement * MkFireWatchersStmt(struct Expression * object, struct __ecereNameSpace__ecere__sys__OldList * watches);
17555
17556 static void ProcessFunction(struct FunctionDefinition * function)
17557 {
17558 struct Identifier * id = GetDeclId(function->declarator);
17559 struct Symbol * symbol = function->declarator ? function->declarator->symbol : (((void *)0));
17560 struct Type * type = symbol ? symbol->type : (((void *)0));
17561 struct __ecereNameSpace__ecere__com__Class * oldThisClass = thisClass;
17562 struct Context * oldTopContext = topContext;
17563
17564 yylloc = function->loc;
17565 if(type && type->thisClass)
17566 {
17567 struct Symbol * classSym = type->thisClass;
17568 struct __ecereNameSpace__ecere__com__Class * _class = type->thisClass->registered;
17569 char className[1024];
17570 char structName[1024];
17571 struct Declarator * funcDecl;
17572 struct Symbol * thisSymbol;
17573 unsigned int typedObject = 0x0;
17574
17575 if(_class && !_class->base)
17576 {
17577 _class = currentClass;
17578 if(_class && !_class->symbol)
17579 _class->symbol = FindClass(_class->fullName);
17580 classSym = _class ? _class->symbol : (((void *)0));
17581 typedObject = 0x1;
17582 }
17583 thisClass = _class;
17584 if(inCompiler && _class)
17585 {
17586 if(type->kind == 11)
17587 {
17588 if(symbol->type->params.count == 1 && ((struct Type *)symbol->type->params.first)->kind == 0)
17589 {
17590 struct Type * param = symbol->type->params.first;
17591
17592 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(&symbol->type->params, param);
17593 FreeType(param);
17594 }
17595 if(type->classObjectType != 1)
17596 {
17597 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(&symbol->type->params, (((void *)0)), MkClassType(_class->fullName));
17598 symbol->type->staticMethod = 0x1;
17599 symbol->type->thisClass = (((void *)0));
17600 symbol->type->extraParam = 0x0;
17601 }
17602 }
17603 strcpy(className, "__ecereClass_");
17604 FullClassNameCat(className, _class->fullName, 0x1);
17605 MangleClassName(className);
17606 structName[0] = (char)0;
17607 FullClassNameCat(structName, _class->fullName, 0x0);
17608 funcDecl = GetFuncDecl(function->declarator);
17609 if(funcDecl)
17610 {
17611 if(funcDecl->function.parameters && (*funcDecl->function.parameters).count == 1)
17612 {
17613 struct TypeName * param = (*funcDecl->function.parameters).first;
17614
17615 if(param->qualifiers && (*param->qualifiers).count == 1 && ((struct Specifier *)(*param->qualifiers).first)->specifier == VOID && !param->declarator)
17616 {
17617 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->function.parameters), param);
17618 FreeTypeName(param);
17619 }
17620 }
17621 if(!function->propertyNoThis)
17622 {
17623 struct TypeName * thisParam;
17624
17625 if(type->classObjectType != 1)
17626 {
17627 thisParam = QMkClass(_class->fullName, MkDeclaratorIdentifier(MkIdentifier("this")));
17628 if(!funcDecl->function.parameters)
17629 funcDecl->function.parameters = MkList();
17630 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
17631 }
17632 if(typedObject)
17633 {
17634 if(type->classObjectType != 1)
17635 {
17636 if(type->byReference || _class->type == 3 || _class->type == 1000 || _class->type == 4 || _class->type == 2)
17637 thisParam->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), thisParam->declarator);
17638 }
17639 thisParam = __extension__ ({
17640 struct TypeName * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TypeName);
17641
17642 __ecereInstance1->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier("class"))), __ecereInstance1->qualifiers = MkListOne(MkStructOrUnion(3, MkIdentifier("__ecereNameSpace__ecere__com__Class"), (((void *)0)))), __ecereInstance1;
17643 });
17644 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
17645 }
17646 }
17647 }
17648 if(symbol && symbol->pointerExternal && symbol->pointerExternal->type == 1)
17649 {
17650 struct InitDeclarator * initDecl = (*symbol->pointerExternal->declaration->declarators).first;
17651
17652 funcDecl = GetFuncDecl(initDecl->declarator);
17653 if(funcDecl)
17654 {
17655 if(funcDecl->function.parameters && (*funcDecl->function.parameters).count == 1)
17656 {
17657 struct TypeName * param = (*funcDecl->function.parameters).first;
17658
17659 if(param->qualifiers && (*param->qualifiers).count == 1 && ((struct Specifier *)(*param->qualifiers).first)->specifier == VOID && !param->declarator)
17660 {
17661 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->function.parameters), param);
17662 FreeTypeName(param);
17663 }
17664 }
17665 if(type->classObjectType != 1)
17666 {
17667 if((_class->type != 2 && _class->type != 3 && _class->type != 4) || function != (struct FunctionDefinition *)symbol->externalSet)
17668 {
17669 struct TypeName * thisParam = QMkClass(_class->fullName, MkDeclaratorIdentifier(MkIdentifier("this")));
17670
17671 if(!funcDecl->function.parameters)
17672 funcDecl->function.parameters = MkList();
17673 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
17674 }
17675 }
17676 }
17677 }
17678 }
17679 if(function->body)
17680 {
17681 if(type->classObjectType != 1)
17682 {
17683 thisSymbol = __extension__ ({
17684 struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
17685
17686 __ecereInstance1->string = __ecereNameSpace__ecere__sys__CopyString("this"), __ecereInstance1->type = classSym ? MkClassType(classSym->string) : (((void *)0)), __ecereInstance1;
17687 });
17688 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&function->body->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
17689 if(typedObject && thisSymbol->type)
17690 {
17691 thisSymbol->type->classObjectType = 2;
17692 thisSymbol->type->byReference = type->byReference;
17693 thisSymbol->type->typedByReference = type->byReference;
17694 }
17695 }
17696 }
17697 if(inCompiler && _class && (_class->type == 0) && type->classObjectType != 1)
17698 {
17699 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
17700
17701 {
17702 struct __ecereNameSpace__ecere__com__Class * base;
17703
17704 for(base = _class; base && base->type != 1000; base = base->next)
17705 {
17706 for(member = base->membersAndProperties.first; member; member = member->next)
17707 if(!member->isProperty)
17708 break;
17709 if(member)
17710 break;
17711 }
17712 }
17713 for(member = _class->membersAndProperties.first; member; member = member->next)
17714 if(!member->isProperty)
17715 break;
17716 if(member)
17717 {
17718 char pointerName[1024];
17719 struct Declaration * decl;
17720 struct Initializer * initializer;
17721 struct Expression * exp, * bytePtr;
17722
17723 strcpy(pointerName, "__ecerePointer_");
17724 FullClassNameCat(pointerName, _class->fullName, 0x0);
17725 {
17726 char className[1024];
17727
17728 strcpy(className, "__ecereClass_");
17729 FullClassNameCat(className, classSym->string, 0x1);
17730 MangleClassName(className);
17731 DeclareClass(classSym, className);
17732 }
17733 bytePtr = QBrackets(MkExpCast(QMkType("char", QMkPtrDecl((((void *)0)))), QMkExpId("this")));
17734 if(_class->fixed)
17735 {
17736 char string[256];
17737
17738 sprintf(string, "%d", _class->offset);
17739 exp = QBrackets(MkExpOp(bytePtr, '+', MkExpConstant(string)));
17740 }
17741 else
17742 {
17743 exp = QBrackets(MkExpOp(bytePtr, '+', MkExpPointer(QMkExpId(className), MkIdentifier("offset"))));
17744 }
17745 exp = QBrackets(QMkExpCond(QMkExpId("this"), exp, MkExpConstant("0")));
17746 exp->expType = __extension__ ({
17747 struct Type * __ecereInstance2 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
17748
17749 __ecereInstance2->refCount = 1, __ecereInstance2->kind = 13, __ecereInstance2->type = __extension__ ({
17750 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
17751
17752 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 0, __ecereInstance1;
17753 }), __ecereInstance2;
17754 });
17755 if(function->body)
17756 {
17757 yylloc = function->body->loc;
17758 initializer = MkInitializerAssignment(MkExpCast(MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(structName), (((void *)0)))), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), exp));
17759 {
17760 struct Context * prevContext = curContext;
17761
17762 curContext = function->body->compound.context;
17763 decl = MkDeclaration(MkListOne(MkStructOrUnion(3, MkIdentifier(structName), (((void *)0)))), MkListOne(MkInitDeclarator(QMkPtrDecl(pointerName), initializer)));
17764 curContext = prevContext;
17765 }
17766 decl->symbol = (((void *)0));
17767 if(!function->body->compound.declarations)
17768 function->body->compound.declarations = MkList();
17769 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*function->body->compound.declarations), (((void *)0)), decl);
17770 }
17771 }
17772 }
17773 }
17774 else
17775 thisClass = (((void *)0));
17776 if(id)
17777 {
17778 FreeSpecifier(id->_class);
17779 id->_class = (((void *)0));
17780 if(symbol && symbol->pointerExternal && symbol->pointerExternal->type == 1)
17781 {
17782 struct InitDeclarator * initDecl = (*symbol->pointerExternal->declaration->declarators).first;
17783
17784 id = GetDeclId(initDecl->declarator);
17785 FreeSpecifier(id->_class);
17786 id->_class = (((void *)0));
17787 }
17788 }
17789 if(function->body)
17790 topContext = function->body->compound.context;
17791 {
17792 struct FunctionDefinition * oldFunction = curFunction;
17793
17794 curFunction = function;
17795 if(function->body)
17796 ProcessStatement(function->body);
17797 if(inCompiler && function->propSet && !function->propSet->fireWatchersDone)
17798 {
17799 struct Statement * prevCompound = curCompound;
17800 struct Context * prevContext = curContext;
17801 struct Statement * fireWatchers = MkFireWatchersStmt((((void *)0)), (((void *)0)));
17802
17803 if(!function->body->compound.statements)
17804 function->body->compound.statements = MkList();
17805 ListAdd(function->body->compound.statements, fireWatchers);
17806 curCompound = function->body;
17807 curContext = function->body->compound.context;
17808 ProcessStatement(fireWatchers);
17809 curContext = prevContext;
17810 curCompound = prevCompound;
17811 }
17812 curFunction = oldFunction;
17813 }
17814 if(function->declarator)
17815 {
17816 ProcessDeclarator(function->declarator);
17817 }
17818 topContext = oldTopContext;
17819 thisClass = oldThisClass;
17820 }
17821
17822 extern void FreeSymbol(struct Symbol * symbol);
17823
17824 void __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Remove(struct __ecereNameSpace__ecere__sys__BinaryTree * this, struct __ecereNameSpace__ecere__sys__BTNode * node);
17825
17826 static void ProcessClass(struct __ecereNameSpace__ecere__sys__OldList * definitions, struct Symbol * symbol)
17827 {
17828 struct ClassDef * def;
17829 struct External * external = curExternal;
17830 struct __ecereNameSpace__ecere__com__Class * regClass = symbol ? symbol->registered : (((void *)0));
17831
17832 for(def = definitions->first; def; def = def->next)
17833 {
17834 if(def->type == 0)
17835 {
17836 if(def->function->declarator)
17837 curExternal = def->function->declarator->symbol->pointerExternal;
17838 else
17839 curExternal = external;
17840 ProcessFunction((struct FunctionDefinition *)def->function);
17841 }
17842 else if(def->type == 2)
17843 {
17844 if(def->decl->type == 2)
17845 {
17846 thisClass = regClass;
17847 ProcessInstantiationType(def->decl->inst);
17848 thisClass = (((void *)0));
17849 }
17850 else
17851 {
17852 struct __ecereNameSpace__ecere__com__Class * backThisClass = thisClass;
17853
17854 if(regClass)
17855 thisClass = regClass;
17856 ProcessDeclaration(def->decl);
17857 thisClass = backThisClass;
17858 }
17859 }
17860 else if(def->type == 1 && def->defProperties)
17861 {
17862 struct MemberInit * defProperty;
17863 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);
17864
17865 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
17866 for(defProperty = (*def->defProperties).first; defProperty; defProperty = defProperty->next)
17867 {
17868 thisClass = regClass;
17869 ProcessMemberInitData(defProperty, regClass, (((void *)0)), (((void *)0)), (((void *)0)), (((void *)0)));
17870 thisClass = (((void *)0));
17871 }
17872 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Remove(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
17873 FreeSymbol(thisSymbol);
17874 }
17875 else if(def->type == 3 && def->propertyDef)
17876 {
17877 struct PropertyDef * prop = def->propertyDef;
17878
17879 thisClass = regClass;
17880 if(prop->setStmt)
17881 {
17882 if(regClass)
17883 {
17884 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
17885
17886 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->setStmt->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
17887 }
17888 curExternal = prop->symbol ? prop->symbol->externalSet : (((void *)0));
17889 ProcessStatement(prop->setStmt);
17890 }
17891 if(prop->getStmt)
17892 {
17893 if(regClass)
17894 {
17895 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
17896
17897 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->getStmt->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
17898 }
17899 curExternal = prop->symbol ? prop->symbol->externalGet : (((void *)0));
17900 ProcessStatement(prop->getStmt);
17901 }
17902 if(prop->issetStmt)
17903 {
17904 if(regClass)
17905 {
17906 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
17907
17908 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->issetStmt->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
17909 }
17910 curExternal = prop->symbol ? prop->symbol->externalIsSet : (((void *)0));
17911 ProcessStatement(prop->issetStmt);
17912 }
17913 thisClass = (((void *)0));
17914 }
17915 else if(def->type == 4 && def->propertyWatch)
17916 {
17917 struct PropertyWatch * propertyWatch = def->propertyWatch;
17918
17919 thisClass = regClass;
17920 if(propertyWatch->compound)
17921 {
17922 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);
17923
17924 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&propertyWatch->compound->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
17925 curExternal = (((void *)0));
17926 ProcessStatement(propertyWatch->compound);
17927 }
17928 thisClass = (((void *)0));
17929 }
17930 }
17931 }
17932
17933 void DeclareFunctionUtil(char * s)
17934 {
17935 struct __ecereNameSpace__ecere__com__GlobalFunction * function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, s);
17936
17937 if(function)
17938 {
17939 char name[1024];
17940
17941 name[0] = (char)0;
17942 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType != 1 && (!function->dataType || !function->dataType->dllExport))
17943 strcpy(name, "__ecereFunction_");
17944 FullClassNameCat(name, s, 0x0);
17945 DeclareFunction(function, name);
17946 }
17947 }
17948
17949 extern struct __ecereNameSpace__ecere__com__Instance * GetPrivateModule(void);
17950
17951 void ComputeDataTypes()
17952 {
17953 struct External * external;
17954 struct External * temp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_External);
17955 struct External * after = (((void *)0));
17956
17957 currentClass = (((void *)0));
17958 containerClass = __ecereNameSpace__ecere__com__eSystem_FindClass(GetPrivateModule(), "Container");
17959 for(external = (*ast).first; external; external = external->next)
17960 {
17961 if(external->type == 1)
17962 {
17963 struct Declaration * decl = external->declaration;
17964
17965 if(decl)
17966 {
17967 struct __ecereNameSpace__ecere__sys__OldList * decls = decl->declarators;
17968
17969 if(decls)
17970 {
17971 struct InitDeclarator * initDecl = (*decls).first;
17972
17973 if(initDecl)
17974 {
17975 struct Declarator * declarator = initDecl->declarator;
17976
17977 if(declarator && declarator->type == 1)
17978 {
17979 struct Identifier * id = declarator->identifier;
17980
17981 if(id && id->string)
17982 {
17983 if(!strcmp(id->string, "uintptr_t") || !strcmp(id->string, "intptr_t") || !strcmp(id->string, "size_t") || !strcmp(id->string, "ssize_t"))
17984 {
17985 external->symbol->id = -1001, external->symbol->idCode = -1001;
17986 after = external;
17987 }
17988 }
17989 }
17990 }
17991 }
17992 }
17993 }
17994 }
17995 temp->symbol = __extension__ ({
17996 struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
17997
17998 __ecereInstance1->id = -1000, __ecereInstance1->idCode = -1000, __ecereInstance1;
17999 });
18000 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), after, temp);
18001 curExternal = temp;
18002 DeclareFunctionUtil("eSystem_New");
18003 DeclareFunctionUtil("eSystem_New0");
18004 DeclareFunctionUtil("eSystem_Renew");
18005 DeclareFunctionUtil("eSystem_Renew0");
18006 DeclareFunctionUtil("eSystem_Delete");
18007 DeclareFunctionUtil("eClass_GetProperty");
18008 DeclareFunctionUtil("eInstance_FireSelfWatchers");
18009 DeclareStruct("ecere::com::Class", 0x0);
18010 DeclareStruct("ecere::com::Instance", 0x0);
18011 DeclareStruct("ecere::com::Property", 0x0);
18012 DeclareStruct("ecere::com::DataMember", 0x0);
18013 DeclareStruct("ecere::com::Method", 0x0);
18014 DeclareStruct("ecere::com::SerialBuffer", 0x0);
18015 DeclareStruct("ecere::com::ClassTemplateArgument", 0x0);
18016 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*ast), temp);
18017 for(external = (*ast).first; external; external = external->next)
18018 {
18019 afterExternal = curExternal = external;
18020 if(external->type == 0)
18021 {
18022 currentClass = external->function->_class;
18023 ProcessFunction(external->function);
18024 }
18025 else if(external->type == 1)
18026 {
18027 currentClass = (((void *)0));
18028 ProcessDeclaration(external->declaration);
18029 }
18030 else if(external->type == 2)
18031 {
18032 struct ClassDefinition * _class = external->_class;
18033
18034 currentClass = external->symbol->registered;
18035 if(_class->definitions)
18036 {
18037 ProcessClass(_class->definitions, _class->symbol);
18038 }
18039 if(inCompiler)
18040 {
18041 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*ast), external);
18042 ((external ? (__ecereClass_External->Destructor ? __ecereClass_External->Destructor(external) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(external)) : 0), external = 0);
18043 }
18044 }
18045 else if(external->type == 4)
18046 {
18047 thisNameSpace = external->id->string;
18048 }
18049 }
18050 currentClass = (((void *)0));
18051 thisNameSpace = (((void *)0));
18052 ((temp->symbol ? (__ecereClass_Symbol->Destructor ? __ecereClass_Symbol->Destructor(temp->symbol) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(temp->symbol)) : 0), temp->symbol = 0);
18053 ((temp ? (__ecereClass_External->Destructor ? __ecereClass_External->Destructor(temp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(temp)) : 0), temp = 0);
18054 }
18055
18056 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);
18057
18058 extern struct __ecereNameSpace__ecere__com__Class * __ecereNameSpace__ecere__com__eSystem_RegisterClass(int type, char *  name, char *  baseName, int size, int sizeClass, unsigned int (*  Constructor)(void * ), void (*  Destructor)(void * ), struct __ecereNameSpace__ecere__com__Instance * module, int declMode, int inheritanceAccess);
18059
18060 extern struct __ecereNameSpace__ecere__com__Instance * __thisModule;
18061
18062 void __ecereRegisterModule_pass15(struct __ecereNameSpace__ecere__com__Instance * module)
18063 {
18064 struct __ecereNameSpace__ecere__com__Class * class;
18065
18066 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetYydebug", "void SetYydebug(bool b)", SetYydebug, module, 1);
18067 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetThisClass", "void SetThisClass(ecere::com::Class c)", SetThisClass, module, 1);
18068 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetThisClass", "ecere::com::Class GetThisClass(void)", GetThisClass, module, 1);
18069 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintExpression", "void PrintExpression(Expression exp, char * string)", PrintExpression, module, 1);
18070 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessTemplateParameterType", "Type ProcessTemplateParameterType(TemplateParameter param)", ProcessTemplateParameterType, module, 2);
18071 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("NeedCast", "bool NeedCast(Type type1, Type type2)", NeedCast, module, 2);
18072 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintInt", "char * PrintInt(int64 result)", PrintInt, module, 1);
18073 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUInt", "char * PrintUInt(uint64 result)", PrintUInt, module, 1);
18074 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintInt64", "char * PrintInt64(int64 result)", PrintInt64, module, 1);
18075 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUInt64", "char * PrintUInt64(uint64 result)", PrintUInt64, module, 1);
18076 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintHexUInt", "char * PrintHexUInt(uint64 result)", PrintHexUInt, module, 1);
18077 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintHexUInt64", "char * PrintHexUInt64(uint64 result)", PrintHexUInt64, module, 1);
18078 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintShort", "char * PrintShort(short result)", PrintShort, module, 1);
18079 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUShort", "char * PrintUShort(uint16 result)", PrintUShort, module, 1);
18080 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintChar", "char * PrintChar(char result)", PrintChar, module, 1);
18081 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUChar", "char * PrintUChar(byte result)", PrintUChar, module, 1);
18082 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintFloat", "char * PrintFloat(float result)", PrintFloat, module, 1);
18083 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintDouble", "char * PrintDouble(double result)", PrintDouble, module, 1);
18084 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetInt", "bool GetInt(Expression exp, int * value2)", GetInt, module, 1);
18085 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUInt", "bool GetUInt(Expression exp, uint * value2)", GetUInt, module, 1);
18086 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetInt64", "bool GetInt64(Expression exp, int64 * value2)", GetInt64, module, 1);
18087 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUInt64", "bool GetUInt64(Expression exp, uint64 * value2)", GetUInt64, module, 1);
18088 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetIntPtr", "bool GetIntPtr(Expression exp, intptr * value2)", GetIntPtr, module, 1);
18089 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUIntPtr", "bool GetUIntPtr(Expression exp, uintptr * value2)", GetUIntPtr, module, 1);
18090 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetIntSize", "bool GetIntSize(Expression exp, intsize * value2)", GetIntSize, module, 1);
18091 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUIntSize", "bool GetUIntSize(Expression exp, uintsize * value2)", GetUIntSize, module, 1);
18092 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetShort", "bool GetShort(Expression exp, short * value2)", GetShort, module, 1);
18093 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUShort", "bool GetUShort(Expression exp, uint16 * value2)", GetUShort, module, 1);
18094 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetChar", "bool GetChar(Expression exp, char * value2)", GetChar, module, 1);
18095 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUChar", "bool GetUChar(Expression exp, byte * value2)", GetUChar, module, 1);
18096 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetFloat", "bool GetFloat(Expression exp, float * value2)", GetFloat, module, 1);
18097 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetDouble", "bool GetDouble(Expression exp, double * value2)", GetDouble, module, 1);
18098 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeClassMembers", "void ComputeClassMembers(ecere::com::Class _class, bool isMember)", ComputeClassMembers, module, 2);
18099 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeModuleClasses", "void ComputeModuleClasses(ecere::com::Module module)", ComputeModuleClasses, module, 1);
18100 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeTypeSize", "int ComputeTypeSize(Type type)", ComputeTypeSize, module, 1);
18101 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("AddMembers", "int AddMembers(ecere::sys::OldList * declarations, ecere::com::Class _class, bool isMember, uint * retSize, ecere::com::Class topClass, bool * addedPadding)", AddMembers, module, 2);
18102 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareStruct", "void DeclareStruct(char * name, bool skipNoHead)", DeclareStruct, module, 2);
18103 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareProperty", "void DeclareProperty(ecere::com::Property prop, char * setName, char * getName)", DeclareProperty, module, 2);
18104 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("Dereference", "Type Dereference(Type source)", Dereference, module, 1);
18105 __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);
18106 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessInstantiationType", "void ProcessInstantiationType(Instantiation inst)", ProcessInstantiationType, module, 2);
18107 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindTemplateArg", "ecere::com::ClassTemplateArgument * FindTemplateArg(ecere::com::Class _class, TemplateParameter param)", FindTemplateArg, module, 2);
18108 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetupTemplatesContext", "Context SetupTemplatesContext(ecere::com::Class _class)", SetupTemplatesContext, module, 1);
18109 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FinishTemplatesContext", "void FinishTemplatesContext(Context context)", FinishTemplatesContext, module, 1);
18110 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessMethodType", "void ProcessMethodType(ecere::com::Method method)", ProcessMethodType, module, 1);
18111 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessPropertyType", "void ProcessPropertyType(ecere::com::Property prop)", ProcessPropertyType, module, 1);
18112 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareMethod", "void DeclareMethod(ecere::com::Method method, char * name)", DeclareMethod, module, 1);
18113 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClass", "char * ReplaceThisClass(ecere::com::Class _class)", ReplaceThisClass, module, 2);
18114 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClassType", "Type ReplaceThisClassType(ecere::com::Class _class)", ReplaceThisClassType, module, 2);
18115 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClassSpecifiers", "void ReplaceThisClassSpecifiers(ecere::sys::OldList specs, ecere::com::Class _class)", ReplaceThisClassSpecifiers, module, 2);
18116 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareFunction", "bool DeclareFunction(ecere::com::GlobalFunction function, char * name)", DeclareFunction, module, 2);
18117 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareGlobalData", "void DeclareGlobalData(GlobalData data)", DeclareGlobalData, module, 2);
18118 class = __ecereNameSpace__ecere__com__eSystem_RegisterClass(5, "Conversion", 0, sizeof(struct Conversion), 0, 0, 0, module, 2, 1);
18119 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->application == ((struct __ecereNameSpace__ecere__com__Module *)(((char *)__thisModule + structSize_Instance)))->application && class)
18120 __ecereClass_Conversion = class;
18121 __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);
18122 __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);
18123 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ModuleVisibility", "bool ModuleVisibility(ecere::com::Module searchIn, ecere::com::Module searchFor)", ModuleVisibility, module, 1);
18124 __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);
18125 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("MatchTypeExpression", "bool MatchTypeExpression(Expression sourceExp, Type dest, ecere::sys::OldList conversions, bool skipUnitBla)", MatchTypeExpression, module, 2);
18126 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReadString", "void ReadString(char * output, char * string)", ReadString, module, 1);
18127 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOperand", "Operand GetOperand(Expression exp)", GetOperand, module, 1);
18128 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PopulateInstance", "void PopulateInstance(Instantiation inst)", PopulateInstance, module, 1);
18129 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeInstantiation", "void ComputeInstantiation(Expression exp)", ComputeInstantiation, module, 1);
18130 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CallOperator", "void CallOperator(Expression exp, Expression exp1, Expression exp2, Operand op1, Operand op2)", CallOperator, module, 1);
18131 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeExpression", "void ComputeExpression(Expression exp)", ComputeExpression, module, 1);
18132 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CheckTemplateTypes", "void CheckTemplateTypes(Expression exp)", CheckTemplateTypes, module, 1);
18133 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindSymbol", "Symbol FindSymbol(char * name, Context startContext, Context endContext, bool isStruct, bool globalNameSpace)", FindSymbol, module, 1);
18134 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintType", "void PrintType(Type type, char * string, bool printName, bool fullName)", PrintType, module, 1);
18135 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintTypeNoConst", "void PrintTypeNoConst(Type type, char * string, bool printName, bool fullName)", PrintTypeNoConst, module, 1);
18136 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindMemberAndOffset", "Type FindMemberAndOffset(Type type, char * string, uint * offset)", FindMemberAndOffset, module, 1);
18137 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetParseError", "bool GetParseError(void)", GetParseError, module, 1);
18138 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ParseExpressionString", "Expression ParseExpressionString(char * expression)", ParseExpressionString, module, 1);
18139 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceExpContents", "void ReplaceExpContents(Expression checkedExp, Expression newExp)", ReplaceExpContents, module, 1);
18140 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ApplyAnyObjectLogic", "void ApplyAnyObjectLogic(Expression e)", ApplyAnyObjectLogic, module, 1);
18141 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessExpressionType", "void ProcessExpressionType(Expression exp)", ProcessExpressionType, module, 1);
18142 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareFunctionUtil", "void DeclareFunctionUtil(String s)", DeclareFunctionUtil, module, 1);
18143 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeDataTypes", "void ComputeDataTypes(void)", ComputeDataTypes, module, 1);
18144 }
18145
18146 void __ecereUnregisterModule_pass15(struct __ecereNameSpace__ecere__com__Instance * module)
18147 {
18148
18149 }
18150