7f495cb67b3cb3688d1dd681c275523038c5100d
[sdk] / compiler / bootstrap / libec / bootstrap / pass15.c
1 /* Code generated from eC source file: pass15.ec */
2 #if defined(_WIN32)
3 #define __runtimePlatform 1
4 #elif defined(__APPLE__)
5 #define __runtimePlatform 3
6 #else
7 #define __runtimePlatform 2
8 #endif
9 #if defined(__GNUC__)
10 typedef long long int64;
11 typedef unsigned long long uint64;
12 #ifndef _WIN32
13 #define __declspec(x)
14 #endif
15 #elif defined(__TINYC__)
16 #include <stdarg.h>
17 #define __builtin_va_list va_list
18 #define __builtin_va_start va_start
19 #define __builtin_va_end va_end
20 #ifdef _WIN32
21 #define strcasecmp stricmp
22 #define strncasecmp strnicmp
23 #define __declspec(x) __attribute__((x))
24 #else
25 #define __declspec(x)
26 #endif
27 typedef long long int64;
28 typedef unsigned long long uint64;
29 #else
30 typedef __int64 int64;
31 typedef unsigned __int64 uint64;
32 #endif
33 #ifdef __BIG_ENDIAN__
34 #define __ENDIAN_PAD(x) (8 - (x))
35 #else
36 #define __ENDIAN_PAD(x) 0
37 #endif
38 #if defined(_WIN32)
39 #   if defined(__GNUC__) || defined(__TINYC__)
40 #      define ecere_stdcall __attribute__((__stdcall__))
41 #      define ecere_gcc_struct __attribute__((gcc_struct))
42 #   else
43 #      define ecere_stdcall __stdcall
44 #      define ecere_gcc_struct
45 #   endif
46 #else
47 #   define ecere_stdcall
48 #   define ecere_gcc_struct
49 #endif
50 #include <stdint.h>
51 #include <sys/types.h>
52 enum yytokentype
53 {
54 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, WIDE_STRING_LITERAL = 373, BUILTIN_OFFSETOF = 374
55 };
56
57 extern int returnCode;
58
59 extern unsigned int yydebug;
60
61 extern unsigned int echoOn;
62
63 void resetScanner();
64
65 int propWatcherID;
66
67 int expression_yyparse();
68
69 static char * thisNameSpace;
70
71 unsigned int thisClassParams = 1;
72
73 unsigned int internalValueCounter;
74
75 extern unsigned int outputLineNumbers;
76
77 extern struct __ecereNameSpace__ecere__com__Property * __ecereProp_float_isInf;
78
79 extern struct __ecereNameSpace__ecere__com__Property * __ecereProp_float_signBit;
80
81 extern struct __ecereNameSpace__ecere__com__Property * __ecereProp_float_isNan;
82
83 extern struct __ecereNameSpace__ecere__com__Property * __ecereProp_double_isInf;
84
85 extern struct __ecereNameSpace__ecere__com__Property * __ecereProp_double_signBit;
86
87 extern struct __ecereNameSpace__ecere__com__Property * __ecereProp_double_isNan;
88
89 extern int targetBits;
90
91 extern unsigned int inCompiler;
92
93 extern unsigned int inPreCompiler;
94
95 extern unsigned int inDebugger;
96
97 extern struct __ecereNameSpace__ecere__com__Property * __ecereProp___ecereNameSpace__ecere__sys__BinaryTree_first;
98
99 extern struct __ecereNameSpace__ecere__com__Property * __ecereProp___ecereNameSpace__ecere__sys__BTNode_next;
100
101 int UnescapeString(char * d, char * s, int len)
102 {
103 int j = 0, k = 0;
104 char ch;
105
106 while(j < len && (ch = s[j]))
107 {
108 switch(ch)
109 {
110 case '\\':
111 switch((ch = s[++j]))
112 {
113 case 'n':
114 d[k] = '\n';
115 break;
116 case 't':
117 d[k] = '\t';
118 break;
119 case 'a':
120 d[k] = '\a';
121 break;
122 case 'b':
123 d[k] = '\b';
124 break;
125 case 'f':
126 d[k] = '\f';
127 break;
128 case 'r':
129 d[k] = '\r';
130 break;
131 case 'v':
132 d[k] = '\v';
133 break;
134 case '\\':
135 d[k] = '\\';
136 break;
137 case '\"':
138 d[k] = '\"';
139 break;
140 case '\'':
141 d[k] = '\'';
142 break;
143 default:
144 d[k] = '\\';
145 d[k] = ch;
146 }
147 break;
148 default:
149 d[k] = ch;
150 }
151 j++, k++;
152 }
153 d[k] = '\0';
154 return k;
155 }
156
157 char * OffsetEscapedString(char * s, int len, int offset)
158 {
159 char ch;
160 int j = 0, k = 0;
161
162 while(j < len && k < offset && (ch = s[j]))
163 {
164 if(ch == '\\')
165 ++j;
166 j++, k++;
167 }
168 return (k == offset) ? s + j : (((void *)0));
169 }
170
171 extern int __ecereVMethodID_class_OnGetString;
172
173 extern struct __ecereNameSpace__ecere__com__Property * __ecereProp_Type_isPointerType;
174
175 extern unsigned int parseError;
176
177 static int definedExpStackPos;
178
179 static void * definedExpStack[512];
180
181 extern const char *  sourceFile;
182
183 extern struct __ecereNameSpace__ecere__com__Property * __ecereProp_Type_specConst;
184
185 unsigned int reachedPass15;
186
187 extern unsigned int memoryGuard;
188
189 struct __ecereNameSpace__ecere__sys__OldList
190 {
191 void *  first;
192 void *  last;
193 int count;
194 unsigned int offset;
195 unsigned int circ;
196 } ecere_gcc_struct;
197
198 struct __ecereNameSpace__ecere__com__DataValue
199 {
200 union
201 {
202 char c;
203 unsigned char uc;
204 short s;
205 unsigned short us;
206 int i;
207 unsigned int ui;
208 void *  p;
209 float f;
210 double d;
211 long long i64;
212 uint64 ui64;
213 } ecere_gcc_struct __anon1;
214 } ecere_gcc_struct;
215
216 struct __ecereNameSpace__ecere__com__SerialBuffer
217 {
218 unsigned char *  _buffer;
219 unsigned int count;
220 unsigned int _size;
221 unsigned int pos;
222 } ecere_gcc_struct;
223
224 extern void *  __ecereNameSpace__ecere__com__eSystem_New(unsigned int size);
225
226 extern void *  __ecereNameSpace__ecere__com__eSystem_New0(unsigned int size);
227
228 extern void *  __ecereNameSpace__ecere__com__eSystem_Renew(void *  memory, unsigned int size);
229
230 extern void *  __ecereNameSpace__ecere__com__eSystem_Renew0(void *  memory, unsigned int size);
231
232 extern void __ecereNameSpace__ecere__com__eSystem_Delete(void *  memory);
233
234 struct Pointer;
235
236 struct Attrib;
237
238 struct Attribute;
239
240 struct TemplateArgument;
241
242 struct DBTableEntry;
243
244 struct DBIndexItem;
245
246 struct DBTableDef;
247
248 struct CodePosition
249 {
250 int line;
251 int charPos;
252 int pos;
253 int included;
254 } ecere_gcc_struct;
255
256 extern size_t strlen(const char * );
257
258 extern int strcmp(const char * , const char * );
259
260 extern int sprintf(char * , const char * , ...);
261
262 extern char *  strcat(char * , const char * );
263
264 extern char *  __ecereNameSpace__ecere__sys__CopyString(const char *  string);
265
266 extern int isprint(int c);
267
268 extern char *  strcpy(char * , const char * );
269
270 extern void Compiler_Error(const char *  format, ...);
271
272 extern const char *  __ecereNameSpace__ecere__GetTranslatedString(const char * name, const char *  string, const char *  stringAndContext);
273
274 struct __ecereNameSpace__ecere__com__LinkList
275 {
276 void * first;
277 void * last;
278 int count;
279 } ecere_gcc_struct;
280
281 extern char *  strchr(const char * , int);
282
283 extern void FullClassNameCat(char *  output, const char *  className, unsigned int includeTemplateParams);
284
285 extern void *  memcpy(void * , const void * , size_t size);
286
287 extern void __ecereNameSpace__ecere__sys__ChangeCh(char *  string, char ch1, char ch2);
288
289 extern void Compiler_Warning(const char *  format, ...);
290
291 extern unsigned long strtoul(const char *  nptr, char * *  endptr, int base);
292
293 extern long long strtoll(const char *  nptr, char * *  endptr, int base);
294
295 extern uint64 strtoull(const char *  nptr, char * *  endptr, int base);
296
297 extern int strtol(const char * , char * * , int base);
298
299 extern long long __ecereNameSpace__ecere__com___strtoi64(const char *  string, const char * *  endString, int base);
300
301 extern uint64 __ecereNameSpace__ecere__com___strtoui64(const char *  string, const char * *  endString, int base);
302
303 extern double strtod(const char * , char * * );
304
305 extern int strncmp(const char * , const char * , size_t n);
306
307 extern char *  __ecereNameSpace__ecere__sys__RSearchString(const char *  buffer, const char *  subStr, int maxLen, unsigned int matchCase, unsigned int matchWord);
308
309 extern char *  QMkString(const char *  source);
310
311 extern char *  strncpy(char * , const char * , size_t n);
312
313 extern int printf(const char * , ...);
314
315 extern char *  strstr(const char * , const char * );
316
317 extern unsigned int __ecereNameSpace__ecere__sys__UTF8GetChar(const char *  string, int *  numBytes);
318
319 extern unsigned int (* __ecereProp_float_Get_isInf)(float this);
320
321 extern int (* __ecereProp_float_Get_signBit)(float this);
322
323 extern unsigned int (* __ecereProp_float_Get_isNan)(float this);
324
325 extern unsigned int (* __ecereProp_double_Get_isInf)(double this);
326
327 extern int (* __ecereProp_double_Get_signBit)(double this);
328
329 extern unsigned int (* __ecereProp_double_Get_isNan)(double this);
330
331 extern float (* __ecereMethod_float_inf)(void);
332
333 extern float (* __ecereMethod_float_nan)(void);
334
335 extern double (* __ecereMethod_double_inf)(void);
336
337 extern double (* __ecereMethod_double_nan)(void);
338
339 int __ecereVMethodID_class_OnGetString;
340
341 void SetYydebug(unsigned int b)
342 {
343 yydebug = b;
344 }
345
346 unsigned int GetParseError()
347 {
348 return parseError;
349 }
350
351 extern struct __ecereNameSpace__ecere__sys__OldList * ast;
352
353 extern struct __ecereNameSpace__ecere__sys__OldList *  MkList(void);
354
355 extern struct __ecereNameSpace__ecere__sys__OldList *  MkListOne(void *  item);
356
357 extern void ListAdd(struct __ecereNameSpace__ecere__sys__OldList * list, void *  item);
358
359 extern void FreeList(struct __ecereNameSpace__ecere__sys__OldList * list, void (*  FreeFunction)(void * ));
360
361 struct __ecereNameSpace__ecere__com__EnumClassData
362 {
363 struct __ecereNameSpace__ecere__sys__OldList values;
364 long long largest;
365 } ecere_gcc_struct;
366
367 extern struct __ecereNameSpace__ecere__sys__OldList *  CopyList(struct __ecereNameSpace__ecere__sys__OldList *  source, void *  (*  CopyFunction)(void * ));
368
369 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(struct __ecereNameSpace__ecere__sys__OldList * this, void *  item);
370
371 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(struct __ecereNameSpace__ecere__sys__OldList * this, void *  prevItem, void *  item);
372
373 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(struct __ecereNameSpace__ecere__sys__OldList * this, void *  item);
374
375 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(struct __ecereNameSpace__ecere__sys__OldList * this, void (*  freeFn)(void * ));
376
377 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear(struct __ecereNameSpace__ecere__sys__OldList * this);
378
379 extern struct Pointer * MkPointer(struct __ecereNameSpace__ecere__sys__OldList * qualifiers, struct Pointer * pointer);
380
381 extern struct Attrib * MkAttrib(int type, struct __ecereNameSpace__ecere__sys__OldList *  attribs);
382
383 struct Location
384 {
385 struct CodePosition start;
386 struct CodePosition end;
387 } ecere_gcc_struct;
388
389 void ReadString(char * output, char * string)
390 {
391 int len = strlen(string);
392 int c, d = 0;
393 unsigned int quoted = 0, escaped = 0;
394
395 for(c = 0; c < len; c++)
396 {
397 char ch = string[c];
398
399 if(escaped)
400 {
401 switch(ch)
402 {
403 case 'n':
404 output[d] = '\n';
405 break;
406 case 't':
407 output[d] = '\t';
408 break;
409 case 'a':
410 output[d] = '\a';
411 break;
412 case 'b':
413 output[d] = '\b';
414 break;
415 case 'f':
416 output[d] = '\f';
417 break;
418 case 'r':
419 output[d] = '\r';
420 break;
421 case 'v':
422 output[d] = '\v';
423 break;
424 case '\\':
425 output[d] = '\\';
426 break;
427 case '\"':
428 output[d] = '\"';
429 break;
430 case '\'':
431 output[d] = '\'';
432 break;
433 default:
434 output[d] = ch;
435 }
436 d++;
437 escaped = 0;
438 }
439 else
440 {
441 if(ch == '\"')
442 quoted ^= 1;
443 else if(quoted)
444 {
445 if(ch == '\\')
446 escaped = 1;
447 else
448 output[d++] = ch;
449 }
450 }
451 }
452 output[d] = '\0';
453 }
454
455 char * PrintInt(long long result)
456 {
457 char temp[100];
458
459 if(result > (((int)0x7fffffff)))
460 sprintf(temp, ((__runtimePlatform == 1) ? "0x%I64X" : "0x%llX"), result);
461 else
462 sprintf(temp, ((__runtimePlatform == 1) ? "%I64d" : "%lld"), result);
463 if(result > (((int)0x7fffffff)) || result < (((int)0x80000000)))
464 strcat(temp, "LL");
465 return __ecereNameSpace__ecere__sys__CopyString(temp);
466 }
467
468 char * PrintUInt(uint64 result)
469 {
470 char temp[100];
471
472 if(result > (0xffffffff))
473 sprintf(temp, ((__runtimePlatform == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
474 else if(result > (((int)0x7fffffff)))
475 sprintf(temp, ((__runtimePlatform == 1) ? "0x%I64X" : "0x%llX"), result);
476 else
477 sprintf(temp, ((__runtimePlatform == 1) ? "%I64d" : "%lld"), result);
478 return __ecereNameSpace__ecere__sys__CopyString(temp);
479 }
480
481 char * PrintInt64(long long result)
482 {
483 char temp[100];
484
485 if(result > (((int)0x7fffffff)) || result < (((int)0x80000000)))
486 sprintf(temp, ((__runtimePlatform == 1) ? "%I64dLL" : "%lldLL"), result);
487 else
488 sprintf(temp, ((__runtimePlatform == 1) ? "%I64d" : "%lld"), result);
489 return __ecereNameSpace__ecere__sys__CopyString(temp);
490 }
491
492 char * PrintUInt64(uint64 result)
493 {
494 char temp[100];
495
496 if(result > (0xffffffff))
497 sprintf(temp, ((__runtimePlatform == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
498 else if(result > (((int)0x7fffffff)))
499 sprintf(temp, ((__runtimePlatform == 1) ? "0x%I64X" : "0x%llX"), result);
500 else
501 sprintf(temp, ((__runtimePlatform == 1) ? "%I64d" : "%lld"), result);
502 return __ecereNameSpace__ecere__sys__CopyString(temp);
503 }
504
505 char * PrintHexUInt(uint64 result)
506 {
507 char temp[100];
508
509 if(result > (0xffffffff))
510 sprintf(temp, ((__runtimePlatform == 1) ? "0x%I64X" : "0x%llX"), result);
511 else
512 sprintf(temp, ((__runtimePlatform == 1) ? "0x%I64X" : "0x%llX"), result);
513 if(result > (0xffffffff))
514 strcat(temp, "LL");
515 return __ecereNameSpace__ecere__sys__CopyString(temp);
516 }
517
518 char * PrintHexUInt64(uint64 result)
519 {
520 char temp[100];
521
522 if(result > (0xffffffff))
523 sprintf(temp, ((__runtimePlatform == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
524 else
525 sprintf(temp, ((__runtimePlatform == 1) ? "0x%I64X" : "0x%llX"), result);
526 return __ecereNameSpace__ecere__sys__CopyString(temp);
527 }
528
529 char * PrintShort(short result)
530 {
531 char temp[100];
532
533 sprintf(temp, "%d", (unsigned short)result);
534 return __ecereNameSpace__ecere__sys__CopyString(temp);
535 }
536
537 char * PrintUShort(unsigned short result)
538 {
539 char temp[100];
540
541 if(result > 32767)
542 sprintf(temp, "0x%X", (int)result);
543 else
544 sprintf(temp, "%d", (int)result);
545 return __ecereNameSpace__ecere__sys__CopyString(temp);
546 }
547
548 char * PrintUChar(unsigned char result)
549 {
550 char temp[100];
551
552 sprintf(temp, "0x%X", result);
553 return __ecereNameSpace__ecere__sys__CopyString(temp);
554 }
555
556 char * PrintChar(char result)
557 {
558 char temp[100];
559
560 if(result > 0 && isprint(result))
561 sprintf(temp, "'%c'", result);
562 else if(result < 0)
563 sprintf(temp, "%d", (int)result);
564 else
565 sprintf(temp, "0x%X", (unsigned char)result);
566 return __ecereNameSpace__ecere__sys__CopyString(temp);
567 }
568
569 char * PrintFloat(float result)
570 {
571 char temp[350];
572
573 if(__ecereProp_float_Get_isInf(result))
574 {
575 if(__ecereProp_float_Get_signBit(result))
576 strcpy(temp, "-inf");
577 else
578 strcpy(temp, "inf");
579 }
580 else if(__ecereProp_float_Get_isNan(result))
581 {
582 if(__ecereProp_float_Get_signBit(result))
583 strcpy(temp, "-nan");
584 else
585 strcpy(temp, "nan");
586 }
587 else
588 sprintf(temp, "%.16ff", result);
589 return __ecereNameSpace__ecere__sys__CopyString(temp);
590 }
591
592 char * PrintDouble(double result)
593 {
594 char temp[350];
595
596 if(__ecereProp_double_Get_isInf(result))
597 {
598 if(__ecereProp_double_Get_signBit(result))
599 strcpy(temp, "-inf");
600 else
601 strcpy(temp, "inf");
602 }
603 else if(__ecereProp_double_Get_isNan(result))
604 {
605 if(__ecereProp_double_Get_signBit(result))
606 strcpy(temp, "-nan");
607 else
608 strcpy(temp, "nan");
609 }
610 else
611 sprintf(temp, "%.16f", result);
612 return __ecereNameSpace__ecere__sys__CopyString(temp);
613 }
614
615 extern struct Location yylloc;
616
617 struct ExtDecl
618 {
619 struct Location loc;
620 int type;
621 union
622 {
623 char * s;
624 struct Attrib * attr;
625 } ecere_gcc_struct __anon1;
626 } ecere_gcc_struct;
627
628 extern struct ExtDecl * MkExtDeclAttrib(struct Attrib * attr);
629
630 struct Expression;
631
632 extern struct Expression * parsedExpression;
633
634 extern struct Expression * QMkExpId(const char *  id);
635
636 extern struct Expression * MkExpOp(struct Expression * exp1, int op, struct Expression * exp2);
637
638 void ComputeExpression(struct Expression * exp);
639
640 extern struct Expression * MkExpConstant(const char *  string);
641
642 extern struct Attribute * MkAttribute(char * attr, struct Expression * exp);
643
644 extern void FreeExpression(struct Expression * exp);
645
646 extern void FreeExpContents(struct Expression * exp);
647
648 extern struct Expression * GetNonBracketsExp(struct Expression * exp);
649
650 extern struct Expression * CopyExpression(struct Expression * exp);
651
652 extern struct Expression * MkExpBrackets(struct __ecereNameSpace__ecere__sys__OldList * expressions);
653
654 extern struct Expression * MkExpCall(struct Expression * expression, struct __ecereNameSpace__ecere__sys__OldList * arguments);
655
656 extern struct Expression * MkExpCondition(struct Expression * cond, struct __ecereNameSpace__ecere__sys__OldList * expressions, struct Expression * elseExp);
657
658 extern struct Expression * MoveExpContents(struct Expression * exp);
659
660 extern struct Expression * QBrackets(struct Expression * exp);
661
662 extern struct Expression * QMkExpCond(struct Expression * cond, struct Expression * exp, struct Expression * elseExp);
663
664 struct Statement;
665
666 static struct Statement * curCompound;
667
668 extern struct Statement * MkCompoundStmt(struct __ecereNameSpace__ecere__sys__OldList * declarations, struct __ecereNameSpace__ecere__sys__OldList * statements);
669
670 extern struct Statement * MkExpressionStmt(struct __ecereNameSpace__ecere__sys__OldList * expressions);
671
672 extern struct Statement * MkIfStmt(struct __ecereNameSpace__ecere__sys__OldList * exp, struct Statement * statement, struct Statement * elseStmt);
673
674 extern struct Statement * MkForStmt(struct Statement * init, struct Statement * check, struct __ecereNameSpace__ecere__sys__OldList * inc, struct Statement * statement);
675
676 extern struct Statement * MkWhileStmt(struct __ecereNameSpace__ecere__sys__OldList * exp, struct Statement * statement);
677
678 extern struct Statement * MkFireWatchersStmt(struct Expression * object, struct __ecereNameSpace__ecere__sys__OldList * watches);
679
680 struct External;
681
682 struct External * curExternal, * afterExternal;
683
684 extern void FreeExternal(struct External * external);
685
686 struct Type;
687
688 static struct Type * curSwitchType;
689
690 extern struct Type * ProcessTypeString(const char *  string, unsigned int staticMethod);
691
692 extern void FreeType(struct Type * type);
693
694 extern struct Type * MkClassType(const char *  name);
695
696 extern void CopyTypeInto(struct Type * type, struct Type * src);
697
698 struct __ecereNameSpace__ecere__com__Class;
699
700 struct __ecereNameSpace__ecere__com__Instance
701 {
702 void * *  _vTbl;
703 struct __ecereNameSpace__ecere__com__Class * _class;
704 int _refCount;
705 } ecere_gcc_struct;
706
707 extern long long __ecereNameSpace__ecere__com__eClass_GetProperty(struct __ecereNameSpace__ecere__com__Class * _class, const char *  name);
708
709 extern void __ecereNameSpace__ecere__com__eClass_SetProperty(struct __ecereNameSpace__ecere__com__Class * _class, const char *  name, long long value);
710
711 static struct __ecereNameSpace__ecere__com__Class * currentClass;
712
713 struct __ecereNameSpace__ecere__com__Class * thisClass;
714
715 struct __ecereNameSpace__ecere__com__Class * containerClass;
716
717 extern unsigned int __ecereNameSpace__ecere__com__eClass_IsDerived(struct __ecereNameSpace__ecere__com__Class * _class, struct __ecereNameSpace__ecere__com__Class * from);
718
719 extern struct Expression * GetTemplateArgExpByName(const char *  paramName, struct __ecereNameSpace__ecere__com__Class * curClass, int tplType);
720
721 extern void *  __ecereNameSpace__ecere__com__eInstance_New(struct __ecereNameSpace__ecere__com__Class * _class);
722
723 extern void __ecereNameSpace__ecere__com__eInstance_SetMethod(struct __ecereNameSpace__ecere__com__Instance * instance, const char *  name, void *  function);
724
725 extern void __ecereNameSpace__ecere__com__eInstance_IncRef(struct __ecereNameSpace__ecere__com__Instance * instance);
726
727 extern void OutputExpression(struct Expression * exp, struct __ecereNameSpace__ecere__com__Instance * f);
728
729 extern struct __ecereNameSpace__ecere__com__Instance * fileInput;
730
731 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek;
732
733 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Read;
734
735 extern void __ecereNameSpace__ecere__com__eInstance_DecRef(struct __ecereNameSpace__ecere__com__Instance * instance);
736
737 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Write;
738
739 void SetThisClass(struct __ecereNameSpace__ecere__com__Class * c)
740 {
741 thisClass = c;
742 }
743
744 struct __ecereNameSpace__ecere__com__Class * GetThisClass()
745 {
746 return thisClass;
747 }
748
749 struct Context;
750
751 extern struct Context * curContext;
752
753 extern struct Context * topContext;
754
755 extern struct Context * PushContext(void);
756
757 extern void PopContext(struct Context * ctx);
758
759 extern void FreeContext(struct Context * context);
760
761 extern struct Context * globalContext;
762
763 struct ModuleImport;
764
765 extern struct ModuleImport * mainModule;
766
767 struct ModuleImport
768 {
769 struct ModuleImport * prev;
770 struct ModuleImport * next;
771 char *  name;
772 struct __ecereNameSpace__ecere__sys__OldList classes;
773 struct __ecereNameSpace__ecere__sys__OldList functions;
774 int importType;
775 int importAccess;
776 } ecere_gcc_struct;
777
778 struct __ecereNameSpace__ecere__com__NameSpace;
779
780 extern struct __ecereNameSpace__ecere__com__NameSpace *  globalData;
781
782 struct FunctionDefinition;
783
784 static struct FunctionDefinition * curFunction;
785
786 struct __ecereNameSpace__ecere__sys__BTNode;
787
788 struct __ecereNameSpace__ecere__sys__BTNode
789 {
790 uintptr_t key;
791 struct __ecereNameSpace__ecere__sys__BTNode * parent;
792 struct __ecereNameSpace__ecere__sys__BTNode * left;
793 struct __ecereNameSpace__ecere__sys__BTNode * right;
794 int depth;
795 } ecere_gcc_struct;
796
797 struct __ecereNameSpace__ecere__sys__BTNode * __ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_next(struct __ecereNameSpace__ecere__sys__BTNode * this);
798
799 struct __ecereNameSpace__ecere__com__Property;
800
801 struct __ecereNameSpace__ecere__com__Property
802 {
803 struct __ecereNameSpace__ecere__com__Property * prev;
804 struct __ecereNameSpace__ecere__com__Property * next;
805 const char *  name;
806 unsigned int isProperty;
807 int memberAccess;
808 int id;
809 struct __ecereNameSpace__ecere__com__Class * _class;
810 const char *  dataTypeString;
811 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
812 struct Type * dataType;
813 void (*  Set)(void * , int);
814 int (*  Get)(void * );
815 unsigned int (*  IsSet)(void * );
816 void *  data;
817 void *  symbol;
818 int vid;
819 unsigned int conversion;
820 unsigned int watcherOffset;
821 const char *  category;
822 unsigned int compiled;
823 unsigned int selfWatchable;
824 unsigned int isWatchable;
825 } ecere_gcc_struct;
826
827 extern void __ecereNameSpace__ecere__com__eInstance_FireSelfWatchers(struct __ecereNameSpace__ecere__com__Instance * instance, struct __ecereNameSpace__ecere__com__Property * _property);
828
829 extern void __ecereNameSpace__ecere__com__eInstance_StopWatching(struct __ecereNameSpace__ecere__com__Instance * instance, struct __ecereNameSpace__ecere__com__Property * _property, struct __ecereNameSpace__ecere__com__Instance * object);
830
831 extern void __ecereNameSpace__ecere__com__eInstance_Watch(void *  instance, struct __ecereNameSpace__ecere__com__Property * _property, void *  object, void (*  callback)(void * , void * ));
832
833 extern void __ecereNameSpace__ecere__com__eInstance_FireWatchers(struct __ecereNameSpace__ecere__com__Instance * instance, struct __ecereNameSpace__ecere__com__Property * _property);
834
835 struct Identifier;
836
837 extern void FreeIdentifier(struct Identifier * id);
838
839 extern struct Identifier * MkIdentifier(const char *  string);
840
841 extern struct Expression * MkExpIdentifier(struct Identifier * id);
842
843 extern struct Expression * MkExpMember(struct Expression * expression, struct Identifier * member);
844
845 extern struct Identifier * CopyIdentifier(struct Identifier * id);
846
847 extern struct Expression * MkExpPointer(struct Expression * expression, struct Identifier * member);
848
849 struct __ecereNameSpace__ecere__sys__OldLink;
850
851 struct __ecereNameSpace__ecere__sys__OldLink
852 {
853 struct __ecereNameSpace__ecere__sys__OldLink * prev;
854 struct __ecereNameSpace__ecere__sys__OldLink * next;
855 void *  data;
856 } ecere_gcc_struct;
857
858 struct Declaration;
859
860 extern struct External * MkExternalDeclaration(struct Declaration * declaration);
861
862 extern struct Declaration * MkDeclaration(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct __ecereNameSpace__ecere__sys__OldList * initDeclarators);
863
864 struct Specifier;
865
866 extern struct Declaration * MkStructDeclaration(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct __ecereNameSpace__ecere__sys__OldList * declarators, struct Specifier * extStorage);
867
868 extern struct Specifier * MkStructOrUnion(int type, struct Identifier * id, struct __ecereNameSpace__ecere__sys__OldList * definitions);
869
870 extern struct Specifier * MkSpecifier(int specifier);
871
872 extern struct Specifier * MkSpecifierName(const char *  name);
873
874 extern struct Specifier * MkSpecifierExtended(struct ExtDecl * extDecl);
875
876 extern void FreeSpecifier(struct Specifier * spec);
877
878 extern struct Specifier * MkEnum(struct Identifier * id, struct __ecereNameSpace__ecere__sys__OldList * list);
879
880 struct Statement
881 {
882 struct Statement * prev;
883 struct Statement * next;
884 struct Location loc;
885 int type;
886 union
887 {
888 struct __ecereNameSpace__ecere__sys__OldList *  expressions;
889 struct
890 {
891 struct Identifier * id;
892 struct Statement * stmt;
893 } ecere_gcc_struct labeled;
894 struct
895 {
896 struct Expression * exp;
897 struct Statement * stmt;
898 } ecere_gcc_struct caseStmt;
899 struct
900 {
901 struct __ecereNameSpace__ecere__sys__OldList * declarations;
902 struct __ecereNameSpace__ecere__sys__OldList * statements;
903 struct Context * context;
904 unsigned int isSwitch;
905 } ecere_gcc_struct compound;
906 struct
907 {
908 struct __ecereNameSpace__ecere__sys__OldList * exp;
909 struct Statement * stmt;
910 struct Statement * elseStmt;
911 } ecere_gcc_struct ifStmt;
912 struct
913 {
914 struct __ecereNameSpace__ecere__sys__OldList * exp;
915 struct Statement * stmt;
916 } ecere_gcc_struct switchStmt;
917 struct
918 {
919 struct __ecereNameSpace__ecere__sys__OldList * exp;
920 struct Statement * stmt;
921 } ecere_gcc_struct whileStmt;
922 struct
923 {
924 struct __ecereNameSpace__ecere__sys__OldList * exp;
925 struct Statement * stmt;
926 } ecere_gcc_struct doWhile;
927 struct
928 {
929 struct Statement * init;
930 struct Statement * check;
931 struct __ecereNameSpace__ecere__sys__OldList * increment;
932 struct Statement * stmt;
933 } ecere_gcc_struct forStmt;
934 struct
935 {
936 struct Identifier * id;
937 } ecere_gcc_struct gotoStmt;
938 struct
939 {
940 struct Specifier * spec;
941 char * statements;
942 struct __ecereNameSpace__ecere__sys__OldList * inputFields;
943 struct __ecereNameSpace__ecere__sys__OldList * outputFields;
944 struct __ecereNameSpace__ecere__sys__OldList * clobberedFields;
945 } ecere_gcc_struct asmStmt;
946 struct
947 {
948 struct Expression * watcher;
949 struct Expression * object;
950 struct __ecereNameSpace__ecere__sys__OldList * watches;
951 } ecere_gcc_struct _watch;
952 struct
953 {
954 struct Identifier * id;
955 struct __ecereNameSpace__ecere__sys__OldList * exp;
956 struct __ecereNameSpace__ecere__sys__OldList * filter;
957 struct Statement * stmt;
958 } ecere_gcc_struct forEachStmt;
959 struct Declaration * decl;
960 } ecere_gcc_struct __anon1;
961 } ecere_gcc_struct;
962
963 extern struct Specifier * CopySpecifier(struct Specifier * spec);
964
965 extern struct Expression * MkExpClassSize(struct Specifier * _class);
966
967 struct Symbol;
968
969 struct Identifier
970 {
971 struct Identifier * prev;
972 struct Identifier * next;
973 struct Location loc;
974 struct Symbol * classSym;
975 struct Specifier * _class;
976 char *  string;
977 struct Identifier * badID;
978 } ecere_gcc_struct;
979
980 extern struct Symbol * FindStruct(struct Context * ctx, const char *  name);
981
982 extern struct Symbol * FindClass(const char *  name);
983
984 extern void DeclareClass(struct External * neededFor, struct Symbol * classSym, const char *  className);
985
986 extern struct Symbol * FindType(struct Context * ctx, const char *  name);
987
988 extern void FreeSymbol(struct Symbol * symbol);
989
990 struct ClassDef;
991
992 extern struct ClassDef * MkClassDefDeclaration(struct Declaration * decl);
993
994 extern void FreeClassDef(struct ClassDef * def);
995
996 struct Declarator;
997
998 extern struct Type * ProcessType(struct __ecereNameSpace__ecere__sys__OldList * specs, struct Declarator * decl);
999
1000 struct TemplateDatatype
1001 {
1002 struct __ecereNameSpace__ecere__sys__OldList *  specifiers;
1003 struct Declarator * decl;
1004 } ecere_gcc_struct;
1005
1006 extern struct Declarator * SpecDeclFromString(const char *  string, struct __ecereNameSpace__ecere__sys__OldList *  specs, struct Declarator * baseDecl);
1007
1008 extern struct Declarator * MkDeclaratorPointer(struct Pointer * pointer, struct Declarator * declarator);
1009
1010 extern struct Declarator * MkDeclaratorIdentifier(struct Identifier * id);
1011
1012 extern struct Declarator * MkStructDeclarator(struct Declarator * declarator, struct Expression * exp);
1013
1014 extern struct Declarator * MkDeclaratorArray(struct Declarator * declarator, struct Expression * exp);
1015
1016 struct Declarator
1017 {
1018 struct Declarator * prev;
1019 struct Declarator * next;
1020 struct Location loc;
1021 int type;
1022 struct Symbol * symbol;
1023 struct Declarator * declarator;
1024 union
1025 {
1026 struct Identifier * identifier;
1027 struct
1028 {
1029 struct Expression * exp;
1030 struct Expression * posExp;
1031 struct Attrib * attrib;
1032 } ecere_gcc_struct structDecl;
1033 struct
1034 {
1035 struct Expression * exp;
1036 struct Specifier * enumClass;
1037 } ecere_gcc_struct array;
1038 struct
1039 {
1040 struct __ecereNameSpace__ecere__sys__OldList * parameters;
1041 } ecere_gcc_struct function;
1042 struct
1043 {
1044 struct Pointer * pointer;
1045 } ecere_gcc_struct pointer;
1046 struct
1047 {
1048 struct ExtDecl * extended;
1049 } ecere_gcc_struct extended;
1050 } ecere_gcc_struct __anon1;
1051 } ecere_gcc_struct;
1052
1053 extern struct Identifier * GetDeclId(struct Declarator * decl);
1054
1055 extern struct Declarator * MkDeclaratorBrackets(struct Declarator * declarator);
1056
1057 extern struct Declarator * PlugDeclarator(struct Declarator * decl, struct Declarator * baseDecl);
1058
1059 extern struct Declarator * MkDeclaratorFunction(struct Declarator * declarator, struct __ecereNameSpace__ecere__sys__OldList * parameters);
1060
1061 extern void FreeDeclarator(struct Declarator * decl);
1062
1063 extern struct Declarator * GetFuncDecl(struct Declarator * decl);
1064
1065 extern struct Expression * MkExpClass(struct __ecereNameSpace__ecere__sys__OldList *  specifiers, struct Declarator * decl);
1066
1067 extern struct Declarator * CopyDeclarator(struct Declarator * declarator);
1068
1069 struct FunctionDefinition
1070 {
1071 struct FunctionDefinition * prev;
1072 struct FunctionDefinition * next;
1073 struct Location loc;
1074 struct __ecereNameSpace__ecere__sys__OldList *  specifiers;
1075 struct Declarator * declarator;
1076 struct __ecereNameSpace__ecere__sys__OldList *  declarations;
1077 struct Statement * body;
1078 struct __ecereNameSpace__ecere__com__Class * _class;
1079 struct __ecereNameSpace__ecere__sys__OldList attached;
1080 int declMode;
1081 struct Type * type;
1082 struct Symbol * propSet;
1083 int tempCount;
1084 unsigned int propertyNoThis;
1085 } ecere_gcc_struct;
1086
1087 extern struct Declarator * QMkPtrDecl(const char *  id);
1088
1089 struct ClassFunction;
1090
1091 struct ClassFunction
1092 {
1093 struct ClassFunction * prev;
1094 struct ClassFunction * next;
1095 struct Location loc;
1096 struct __ecereNameSpace__ecere__sys__OldList *  specifiers;
1097 struct Declarator * declarator;
1098 struct __ecereNameSpace__ecere__sys__OldList *  declarations;
1099 struct Statement * body;
1100 struct __ecereNameSpace__ecere__com__Class * _class;
1101 struct __ecereNameSpace__ecere__sys__OldList attached;
1102 int declMode;
1103 struct Type * type;
1104 struct Symbol * propSet;
1105 unsigned int isVirtual;
1106 unsigned int isConstructor;
1107 unsigned int isDestructor;
1108 unsigned int dontMangle;
1109 int id;
1110 int idCode;
1111 } ecere_gcc_struct;
1112
1113 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);
1114
1115 extern void FreeClassFunction(struct ClassFunction * func);
1116
1117 extern struct ClassFunction * MkClassFunction(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct Specifier * _class, struct Declarator * decl, struct __ecereNameSpace__ecere__sys__OldList * declList);
1118
1119 extern void ProcessClassFunctionBody(struct ClassFunction * func, struct Statement * body);
1120
1121 struct TypeName;
1122
1123 extern struct Expression * MkExpCast(struct TypeName * typeName, struct Expression * expression);
1124
1125 extern struct TypeName * MkTypeName(struct __ecereNameSpace__ecere__sys__OldList * qualifiers, struct Declarator * declarator);
1126
1127 struct TypeName
1128 {
1129 struct TypeName * prev;
1130 struct TypeName * next;
1131 struct Location loc;
1132 struct __ecereNameSpace__ecere__sys__OldList *  qualifiers;
1133 struct Declarator * declarator;
1134 int classObjectType;
1135 struct Expression * bitCount;
1136 } ecere_gcc_struct;
1137
1138 extern void FreeTypeName(struct TypeName * typeName);
1139
1140 extern struct TypeName * QMkClass(const char *  spec, struct Declarator * decl);
1141
1142 extern struct Expression * MkExpTypeSize(struct TypeName * typeName);
1143
1144 extern unsigned int IsVoidPtrCast(struct TypeName * typeName);
1145
1146 extern struct TypeName * QMkType(const char *  spec, struct Declarator * decl);
1147
1148 struct __ecereNameSpace__ecere__com__BTNamedLink;
1149
1150 struct __ecereNameSpace__ecere__com__BTNamedLink
1151 {
1152 const char *  name;
1153 struct __ecereNameSpace__ecere__com__BTNamedLink * parent;
1154 struct __ecereNameSpace__ecere__com__BTNamedLink * left;
1155 struct __ecereNameSpace__ecere__com__BTNamedLink * right;
1156 int depth;
1157 void *  data;
1158 } ecere_gcc_struct;
1159
1160 struct __ecereNameSpace__ecere__sys__NamedLink64;
1161
1162 struct __ecereNameSpace__ecere__sys__NamedLink64
1163 {
1164 struct __ecereNameSpace__ecere__sys__NamedLink64 * prev;
1165 struct __ecereNameSpace__ecere__sys__NamedLink64 * next;
1166 char *  name;
1167 long long data;
1168 } ecere_gcc_struct;
1169
1170 struct Instantiation;
1171
1172 struct Declaration
1173 {
1174 struct Declaration * prev;
1175 struct Declaration * next;
1176 struct Location loc;
1177 int type;
1178 union
1179 {
1180 struct
1181 {
1182 struct __ecereNameSpace__ecere__sys__OldList *  specifiers;
1183 struct __ecereNameSpace__ecere__sys__OldList *  declarators;
1184 } ecere_gcc_struct __anon1;
1185 struct Instantiation * inst;
1186 struct
1187 {
1188 struct Identifier * id;
1189 struct Expression * exp;
1190 } ecere_gcc_struct __anon2;
1191 } ecere_gcc_struct __anon1;
1192 struct Specifier * extStorage;
1193 struct Symbol * symbol;
1194 int declMode;
1195 } ecere_gcc_struct;
1196
1197 struct Instantiation
1198 {
1199 struct Instantiation * prev;
1200 struct Instantiation * next;
1201 struct Location loc;
1202 struct Specifier * _class;
1203 struct Expression * exp;
1204 struct __ecereNameSpace__ecere__sys__OldList *  members;
1205 struct Symbol * symbol;
1206 unsigned int fullSet;
1207 unsigned int isConstant;
1208 unsigned char *  data;
1209 struct Location nameLoc;
1210 struct Location insideLoc;
1211 unsigned int built;
1212 } ecere_gcc_struct;
1213
1214 extern void FreeInstance(struct Instantiation * inst);
1215
1216 extern struct Declaration * MkDeclarationInst(struct Instantiation * inst);
1217
1218 extern struct Instantiation * MkInstantiationNamed(struct __ecereNameSpace__ecere__sys__OldList * specs, struct Expression * exp, struct __ecereNameSpace__ecere__sys__OldList * members);
1219
1220 struct InitDeclarator;
1221
1222 extern void FreeInitDeclarator(struct InitDeclarator * decl);
1223
1224 struct PropertyWatch;
1225
1226 struct PropertyWatch
1227 {
1228 struct PropertyWatch * prev;
1229 struct PropertyWatch * next;
1230 struct Location loc;
1231 struct Statement * compound;
1232 struct __ecereNameSpace__ecere__sys__OldList *  properties;
1233 unsigned int deleteWatch;
1234 } ecere_gcc_struct;
1235
1236 extern void FreePropertyWatch(struct PropertyWatch * watcher);
1237
1238 struct PropertyImport;
1239
1240 struct PropertyImport
1241 {
1242 struct PropertyImport * prev;
1243 struct PropertyImport * next;
1244 char *  name;
1245 unsigned int isVirtual;
1246 unsigned int hasSet;
1247 unsigned int hasGet;
1248 } ecere_gcc_struct;
1249
1250 struct MethodImport;
1251
1252 struct MethodImport
1253 {
1254 struct MethodImport * prev;
1255 struct MethodImport * next;
1256 char *  name;
1257 unsigned int isVirtual;
1258 } ecere_gcc_struct;
1259
1260 struct FunctionImport;
1261
1262 struct FunctionImport
1263 {
1264 struct FunctionImport * prev;
1265 struct FunctionImport * next;
1266 char *  name;
1267 } ecere_gcc_struct;
1268
1269 struct ClassImport;
1270
1271 struct ClassImport
1272 {
1273 struct ClassImport * prev;
1274 struct ClassImport * next;
1275 char *  name;
1276 struct __ecereNameSpace__ecere__sys__OldList methods;
1277 struct __ecereNameSpace__ecere__sys__OldList properties;
1278 unsigned int itself;
1279 int isRemote;
1280 } ecere_gcc_struct;
1281
1282 struct Initializer;
1283
1284 struct Expression
1285 {
1286 struct Expression * prev;
1287 struct Expression * next;
1288 struct Location loc;
1289 int type;
1290 union
1291 {
1292 struct
1293 {
1294 char *  constant;
1295 struct Identifier * identifier;
1296 } ecere_gcc_struct __anon1;
1297 struct Statement * compound;
1298 struct Instantiation * instance;
1299 struct
1300 {
1301 char *  string;
1302 unsigned int intlString;
1303 unsigned int wideString;
1304 } ecere_gcc_struct __anon2;
1305 struct __ecereNameSpace__ecere__sys__OldList *  list;
1306 struct
1307 {
1308 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
1309 struct Declarator * decl;
1310 } ecere_gcc_struct _classExp;
1311 struct
1312 {
1313 struct Identifier * id;
1314 } ecere_gcc_struct classData;
1315 struct
1316 {
1317 struct Expression * exp;
1318 struct __ecereNameSpace__ecere__sys__OldList * arguments;
1319 struct Location argLoc;
1320 } ecere_gcc_struct call;
1321 struct
1322 {
1323 struct Expression * exp;
1324 struct __ecereNameSpace__ecere__sys__OldList * index;
1325 } ecere_gcc_struct index;
1326 struct
1327 {
1328 struct Expression * exp;
1329 struct Identifier * member;
1330 int memberType;
1331 unsigned int thisPtr;
1332 } ecere_gcc_struct member;
1333 struct
1334 {
1335 int op;
1336 struct Expression * exp1;
1337 struct Expression * exp2;
1338 } ecere_gcc_struct op;
1339 struct TypeName * typeName;
1340 struct Specifier * _class;
1341 struct
1342 {
1343 struct TypeName * typeName;
1344 struct Expression * exp;
1345 } ecere_gcc_struct cast;
1346 struct
1347 {
1348 struct Expression * cond;
1349 struct __ecereNameSpace__ecere__sys__OldList * exp;
1350 struct Expression * elseExp;
1351 } ecere_gcc_struct cond;
1352 struct
1353 {
1354 struct TypeName * typeName;
1355 struct Expression * size;
1356 } ecere_gcc_struct _new;
1357 struct
1358 {
1359 struct TypeName * typeName;
1360 struct Expression * size;
1361 struct Expression * exp;
1362 } ecere_gcc_struct _renew;
1363 struct
1364 {
1365 char * table;
1366 struct Identifier * id;
1367 } ecere_gcc_struct db;
1368 struct
1369 {
1370 struct Expression * ds;
1371 struct Expression * name;
1372 } ecere_gcc_struct dbopen;
1373 struct
1374 {
1375 struct TypeName * typeName;
1376 struct Initializer * initializer;
1377 } ecere_gcc_struct initializer;
1378 struct
1379 {
1380 struct Expression * exp;
1381 struct TypeName * typeName;
1382 } ecere_gcc_struct vaArg;
1383 struct
1384 {
1385 struct TypeName * typeName;
1386 struct Identifier * id;
1387 } ecere_gcc_struct offset;
1388 } ecere_gcc_struct __anon1;
1389 unsigned int debugValue;
1390 struct __ecereNameSpace__ecere__com__DataValue val;
1391 uint64 address;
1392 unsigned int hasAddress;
1393 struct Type * expType;
1394 struct Type * destType;
1395 unsigned int usage;
1396 int tempCount;
1397 unsigned int byReference;
1398 unsigned int isConstant;
1399 unsigned int addedThis;
1400 unsigned int needCast;
1401 unsigned int thisPtr;
1402 unsigned int opDestType;
1403 unsigned int usedInComparison;
1404 unsigned int ambiguousUnits;
1405 unsigned int parentOpDestType;
1406 unsigned int needTemplateCast;
1407 } ecere_gcc_struct;
1408
1409 extern struct InitDeclarator * MkInitDeclarator(struct Declarator * declarator, struct Initializer * initializer);
1410
1411 struct Initializer
1412 {
1413 struct Initializer * prev;
1414 struct Initializer * next;
1415 struct Location loc;
1416 int type;
1417 union
1418 {
1419 struct Expression * exp;
1420 struct __ecereNameSpace__ecere__sys__OldList *  list;
1421 } ecere_gcc_struct __anon1;
1422 unsigned int isConstant;
1423 struct Identifier * id;
1424 } ecere_gcc_struct;
1425
1426 extern struct Initializer * MkInitializerAssignment(struct Expression * exp);
1427
1428 extern struct Expression * MkExpExtensionInitializer(struct TypeName * typeName, struct Initializer * initializer);
1429
1430 extern struct Initializer * MkInitializerList(struct __ecereNameSpace__ecere__sys__OldList * list);
1431
1432 struct InitDeclarator
1433 {
1434 struct InitDeclarator * prev;
1435 struct InitDeclarator * next;
1436 struct Location loc;
1437 struct Declarator * declarator;
1438 struct Initializer * initializer;
1439 } ecere_gcc_struct;
1440
1441 void ApplyLocation(struct Expression * exp, struct Location * loc)
1442 {
1443 exp->loc = *loc;
1444 switch(exp->type)
1445 {
1446 case 4:
1447 if(exp->__anon1.op.exp1)
1448 ApplyLocation(exp->__anon1.op.exp1, loc);
1449 if(exp->__anon1.op.exp2)
1450 ApplyLocation(exp->__anon1.op.exp2, loc);
1451 break;
1452 case 5:
1453 if(exp->__anon1.list)
1454 {
1455 struct Expression * e;
1456
1457 for(e = (*exp->__anon1.list).first; e; e = e->next)
1458 ApplyLocation(e, loc);
1459 }
1460 break;
1461 case 6:
1462 if(exp->__anon1.index.index)
1463 {
1464 struct Expression * e;
1465
1466 for(e = (*exp->__anon1.index.index).first; e; e = e->next)
1467 ApplyLocation(e, loc);
1468 }
1469 if(exp->__anon1.index.exp)
1470 ApplyLocation(exp->__anon1.index.exp, loc);
1471 break;
1472 case 7:
1473 if(exp->__anon1.call.arguments)
1474 {
1475 struct Expression * arg;
1476
1477 for(arg = (*exp->__anon1.call.arguments).first; arg; arg = arg->next)
1478 ApplyLocation(arg, loc);
1479 }
1480 if(exp->__anon1.call.exp)
1481 ApplyLocation(exp->__anon1.call.exp, loc);
1482 break;
1483 case 8:
1484 case 9:
1485 if(exp->__anon1.member.exp)
1486 ApplyLocation(exp->__anon1.member.exp, loc);
1487 break;
1488 case 11:
1489 if(exp->__anon1.cast.exp)
1490 ApplyLocation(exp->__anon1.cast.exp, loc);
1491 break;
1492 case 12:
1493 if(exp->__anon1.cond.exp)
1494 {
1495 struct Expression * e;
1496
1497 for(e = (*exp->__anon1.cond.exp).first; e; e = e->next)
1498 ApplyLocation(e, loc);
1499 }
1500 if(exp->__anon1.cond.cond)
1501 ApplyLocation(exp->__anon1.cond.cond, loc);
1502 if(exp->__anon1.cond.elseExp)
1503 ApplyLocation(exp->__anon1.cond.elseExp, loc);
1504 break;
1505 case 34:
1506 if(exp->__anon1.vaArg.exp)
1507 ApplyLocation(exp->__anon1.vaArg.exp, loc);
1508 break;
1509 default:
1510 break;
1511 }
1512 }
1513
1514 void __ecereMethod_Expression_Clear();
1515
1516 struct MembersInit;
1517
1518 struct MembersInit
1519 {
1520 struct MembersInit * prev;
1521 struct MembersInit * next;
1522 struct Location loc;
1523 int type;
1524 union
1525 {
1526 struct __ecereNameSpace__ecere__sys__OldList *  dataMembers;
1527 struct ClassFunction * function;
1528 } ecere_gcc_struct __anon1;
1529 } ecere_gcc_struct;
1530
1531 extern struct MembersInit * MkMembersInitList(struct __ecereNameSpace__ecere__sys__OldList * dataMembers);
1532
1533 struct Operand;
1534
1535 struct OpTable
1536 {
1537 unsigned int (*  Add)(struct Expression *, struct Operand *, struct Operand *);
1538 unsigned int (*  Sub)(struct Expression *, struct Operand *, struct Operand *);
1539 unsigned int (*  Mul)(struct Expression *, struct Operand *, struct Operand *);
1540 unsigned int (*  Div)(struct Expression *, struct Operand *, struct Operand *);
1541 unsigned int (*  Mod)(struct Expression *, struct Operand *, struct Operand *);
1542 unsigned int (*  Neg)(struct Expression *, struct Operand *);
1543 unsigned int (*  Inc)(struct Expression *, struct Operand *);
1544 unsigned int (*  Dec)(struct Expression *, struct Operand *);
1545 unsigned int (*  Asign)(struct Expression *, struct Operand *, struct Operand *);
1546 unsigned int (*  AddAsign)(struct Expression *, struct Operand *, struct Operand *);
1547 unsigned int (*  SubAsign)(struct Expression *, struct Operand *, struct Operand *);
1548 unsigned int (*  MulAsign)(struct Expression *, struct Operand *, struct Operand *);
1549 unsigned int (*  DivAsign)(struct Expression *, struct Operand *, struct Operand *);
1550 unsigned int (*  ModAsign)(struct Expression *, struct Operand *, struct Operand *);
1551 unsigned int (*  BitAnd)(struct Expression *, struct Operand *, struct Operand *);
1552 unsigned int (*  BitOr)(struct Expression *, struct Operand *, struct Operand *);
1553 unsigned int (*  BitXor)(struct Expression *, struct Operand *, struct Operand *);
1554 unsigned int (*  LShift)(struct Expression *, struct Operand *, struct Operand *);
1555 unsigned int (*  RShift)(struct Expression *, struct Operand *, struct Operand *);
1556 unsigned int (*  BitNot)(struct Expression *, struct Operand *);
1557 unsigned int (*  AndAsign)(struct Expression *, struct Operand *, struct Operand *);
1558 unsigned int (*  OrAsign)(struct Expression *, struct Operand *, struct Operand *);
1559 unsigned int (*  XorAsign)(struct Expression *, struct Operand *, struct Operand *);
1560 unsigned int (*  LShiftAsign)(struct Expression *, struct Operand *, struct Operand *);
1561 unsigned int (*  RShiftAsign)(struct Expression *, struct Operand *, struct Operand *);
1562 unsigned int (*  Not)(struct Expression *, struct Operand *);
1563 unsigned int (*  Equ)(struct Expression *, struct Operand *, struct Operand *);
1564 unsigned int (*  Nqu)(struct Expression *, struct Operand *, struct Operand *);
1565 unsigned int (*  And)(struct Expression *, struct Operand *, struct Operand *);
1566 unsigned int (*  Or)(struct Expression *, struct Operand *, struct Operand *);
1567 unsigned int (*  Grt)(struct Expression *, struct Operand *, struct Operand *);
1568 unsigned int (*  Sma)(struct Expression *, struct Operand *, struct Operand *);
1569 unsigned int (*  GrtEqu)(struct Expression *, struct Operand *, struct Operand *);
1570 unsigned int (*  SmaEqu)(struct Expression *, struct Operand *, struct Operand *);
1571 unsigned int (*  Cond)(struct Expression *, struct Operand *, struct Operand *, struct Operand *);
1572 } ecere_gcc_struct;
1573
1574 struct Operand
1575 {
1576 int kind;
1577 struct Type * type;
1578 unsigned int ptrSize;
1579 union
1580 {
1581 char c;
1582 unsigned char uc;
1583 short s;
1584 unsigned short us;
1585 int i;
1586 unsigned int ui;
1587 float f;
1588 double d;
1589 long long i64;
1590 uint64 ui64;
1591 } ecere_gcc_struct __anon1;
1592 struct OpTable ops;
1593 } ecere_gcc_struct;
1594
1595 struct External *  _DeclareStruct(struct External *  neededBy, const char *  name, unsigned int skipNoHead, unsigned int needDereference, unsigned int fwdDecl);
1596
1597 struct External * DeclareStruct(struct External * neededBy, const char * name, unsigned int skipNoHead, unsigned int needDereference)
1598 {
1599 return _DeclareStruct(neededBy, name, skipNoHead, needDereference, 0);
1600 }
1601
1602 static void _DeclareType(struct External *  neededFor, struct Type *  type, unsigned int needDereference, unsigned int forFunctionDef, unsigned int fwdDecl);
1603
1604 void DeclareType(struct External * neededFor, struct Type * type, unsigned int needDereference, unsigned int forFunctionDef)
1605 {
1606 _DeclareType(neededFor, type, needDereference, forFunctionDef, 0);
1607 }
1608
1609 void DeclareTypeForwardDeclare(struct External * neededFor, struct Type * type, unsigned int needDereference, unsigned int forFunctionDef)
1610 {
1611 _DeclareType(neededFor, type, needDereference, forFunctionDef, 1);
1612 }
1613
1614 static void _PrintType(struct Type *  type, char *  string, unsigned int printName, unsigned int fullName, unsigned int printConst);
1615
1616 void PrintType(struct Type * type, char * string, unsigned int printName, unsigned int fullName)
1617 {
1618 _PrintType(type, string, printName, fullName, 1);
1619 }
1620
1621 void PrintTypeNoConst(struct Type * type, char * string, unsigned int printName, unsigned int fullName)
1622 {
1623 _PrintType(type, string, printName, fullName, 0);
1624 }
1625
1626 struct __ecereNameSpace__ecere__com__Method;
1627
1628 struct __ecereNameSpace__ecere__com__Method
1629 {
1630 const char *  name;
1631 struct __ecereNameSpace__ecere__com__Method * parent;
1632 struct __ecereNameSpace__ecere__com__Method * left;
1633 struct __ecereNameSpace__ecere__com__Method * right;
1634 int depth;
1635 int (*  function)();
1636 int vid;
1637 int type;
1638 struct __ecereNameSpace__ecere__com__Class * _class;
1639 void *  symbol;
1640 const char *  dataTypeString;
1641 struct Type * dataType;
1642 int memberAccess;
1643 } ecere_gcc_struct;
1644
1645 struct Symbol
1646 {
1647 char *  string;
1648 struct Symbol * parent;
1649 struct Symbol * left;
1650 struct Symbol * right;
1651 int depth;
1652 struct Type * type;
1653 union
1654 {
1655 struct __ecereNameSpace__ecere__com__Method * method;
1656 struct __ecereNameSpace__ecere__com__Property * _property;
1657 struct __ecereNameSpace__ecere__com__Class * registered;
1658 } ecere_gcc_struct __anon1;
1659 unsigned int notYetDeclared;
1660 union
1661 {
1662 struct
1663 {
1664 struct External * pointerExternal;
1665 struct External * structExternal;
1666 } ecere_gcc_struct __anon1;
1667 struct
1668 {
1669 struct External * externalGet;
1670 struct External * externalSet;
1671 struct External * externalPtr;
1672 struct External * externalIsSet;
1673 } ecere_gcc_struct __anon2;
1674 struct
1675 {
1676 struct External * methodExternal;
1677 struct External * methodCodeExternal;
1678 } ecere_gcc_struct __anon3;
1679 } ecere_gcc_struct __anon2;
1680 unsigned int imported;
1681 unsigned int declaredStructSym;
1682 struct __ecereNameSpace__ecere__com__Class * _class;
1683 unsigned int declaredStruct;
1684 unsigned int needConstructor;
1685 unsigned int needDestructor;
1686 char *  constructorName;
1687 char *  structName;
1688 char *  className;
1689 char *  destructorName;
1690 struct ModuleImport * module;
1691 struct ClassImport * _import;
1692 struct Location nameLoc;
1693 unsigned int isParam;
1694 unsigned int isRemote;
1695 unsigned int isStruct;
1696 unsigned int fireWatchersDone;
1697 int declaring;
1698 unsigned int classData;
1699 unsigned int isStatic;
1700 char *  shortName;
1701 struct __ecereNameSpace__ecere__sys__OldList *  templateParams;
1702 struct __ecereNameSpace__ecere__sys__OldList templatedClasses;
1703 struct Context * ctx;
1704 int isIterator;
1705 struct Expression * propCategory;
1706 unsigned int mustRegister;
1707 } ecere_gcc_struct;
1708
1709 struct __ecereNameSpace__ecere__com__ClassProperty;
1710
1711 extern struct __ecereNameSpace__ecere__com__ClassProperty * __ecereNameSpace__ecere__com__eClass_FindClassProperty(struct __ecereNameSpace__ecere__com__Class * _class, const char *  name);
1712
1713 struct __ecereNameSpace__ecere__com__ClassProperty
1714 {
1715 const char *  name;
1716 struct __ecereNameSpace__ecere__com__ClassProperty * parent;
1717 struct __ecereNameSpace__ecere__com__ClassProperty * left;
1718 struct __ecereNameSpace__ecere__com__ClassProperty * right;
1719 int depth;
1720 void (*  Set)(struct __ecereNameSpace__ecere__com__Class *, long long);
1721 long long (*  Get)(struct __ecereNameSpace__ecere__com__Class *);
1722 const char *  dataTypeString;
1723 struct Type * dataType;
1724 unsigned int constant;
1725 } ecere_gcc_struct;
1726
1727 struct __ecereNameSpace__ecere__com__BitMember;
1728
1729 struct __ecereNameSpace__ecere__com__BitMember
1730 {
1731 struct __ecereNameSpace__ecere__com__BitMember * prev;
1732 struct __ecereNameSpace__ecere__com__BitMember * next;
1733 const char *  name;
1734 unsigned int isProperty;
1735 int memberAccess;
1736 int id;
1737 struct __ecereNameSpace__ecere__com__Class * _class;
1738 const char *  dataTypeString;
1739 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
1740 struct Type * dataType;
1741 int type;
1742 int size;
1743 int pos;
1744 uint64 mask;
1745 } ecere_gcc_struct;
1746
1747 struct __ecereNameSpace__ecere__com__DataMember;
1748
1749 struct __ecereNameSpace__ecere__com__ClassTemplateArgument
1750 {
1751 union
1752 {
1753 struct
1754 {
1755 const char *  dataTypeString;
1756 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
1757 } ecere_gcc_struct __anon1;
1758 struct __ecereNameSpace__ecere__com__DataValue expression;
1759 struct
1760 {
1761 const char *  memberString;
1762 union
1763 {
1764 struct __ecereNameSpace__ecere__com__DataMember * member;
1765 struct __ecereNameSpace__ecere__com__Property * prop;
1766 struct __ecereNameSpace__ecere__com__Method * method;
1767 } ecere_gcc_struct __anon1;
1768 } ecere_gcc_struct __anon2;
1769 } ecere_gcc_struct __anon1;
1770 } ecere_gcc_struct;
1771
1772 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);
1773
1774 extern struct __ecereNameSpace__ecere__com__DataMember * __ecereNameSpace__ecere__com__eClass_AddDataMember(struct __ecereNameSpace__ecere__com__Class * _class, const char *  name, const char *  type, unsigned int size, unsigned int alignment, int declMode);
1775
1776 struct TemplateParameter;
1777
1778 struct TemplateParameter
1779 {
1780 struct TemplateParameter * prev;
1781 struct TemplateParameter * next;
1782 struct Location loc;
1783 int type;
1784 struct Identifier * identifier;
1785 union
1786 {
1787 struct TemplateDatatype * dataType;
1788 int memberType;
1789 } ecere_gcc_struct __anon1;
1790 struct TemplateArgument * defaultArgument;
1791 const char *  dataTypeString;
1792 struct Type * baseType;
1793 } ecere_gcc_struct;
1794
1795 struct Type
1796 {
1797 struct Type * prev;
1798 struct Type * next;
1799 int refCount;
1800 union
1801 {
1802 struct Symbol * _class;
1803 struct
1804 {
1805 struct __ecereNameSpace__ecere__sys__OldList members;
1806 char *  enumName;
1807 } ecere_gcc_struct __anon1;
1808 struct
1809 {
1810 struct Type * returnType;
1811 struct __ecereNameSpace__ecere__sys__OldList params;
1812 struct Symbol * thisClass;
1813 unsigned int staticMethod;
1814 struct TemplateParameter * thisClassTemplate;
1815 } ecere_gcc_struct __anon2;
1816 struct
1817 {
1818 struct __ecereNameSpace__ecere__com__Method * method;
1819 struct __ecereNameSpace__ecere__com__Class * methodClass;
1820 struct __ecereNameSpace__ecere__com__Class * usedClass;
1821 } ecere_gcc_struct __anon3;
1822 struct
1823 {
1824 struct Type * arrayType;
1825 int arraySize;
1826 struct Expression * arraySizeExp;
1827 unsigned int freeExp;
1828 struct Symbol * enumClass;
1829 } ecere_gcc_struct __anon4;
1830 struct Type * type;
1831 struct TemplateParameter * templateParameter;
1832 } ecere_gcc_struct __anon1;
1833 int kind;
1834 unsigned int size;
1835 char *  name;
1836 char *  typeName;
1837 struct __ecereNameSpace__ecere__com__Class * thisClassFrom;
1838 int promotedFrom;
1839 int classObjectType;
1840 int alignment;
1841 unsigned int offset;
1842 int bitFieldCount;
1843 int count;
1844 int bitMemberSize;
1845 unsigned int isSigned : 1;
1846 unsigned int constant : 1;
1847 unsigned int truth : 1;
1848 unsigned int byReference : 1;
1849 unsigned int extraParam : 1;
1850 unsigned int directClassAccess : 1;
1851 unsigned int computing : 1;
1852 unsigned int keepCast : 1;
1853 unsigned int passAsTemplate : 1;
1854 unsigned int dllExport : 1;
1855 unsigned int attrStdcall : 1;
1856 unsigned int declaredWithStruct : 1;
1857 unsigned int typedByReference : 1;
1858 unsigned int casted : 1;
1859 unsigned int pointerAlignment : 1;
1860 unsigned int isLong : 1;
1861 unsigned int signedBeforePromotion : 1;
1862 } ecere_gcc_struct;
1863
1864 struct Specifier
1865 {
1866 struct Specifier * prev;
1867 struct Specifier * next;
1868 struct Location loc;
1869 int type;
1870 union
1871 {
1872 int specifier;
1873 struct
1874 {
1875 struct ExtDecl * extDecl;
1876 char *  name;
1877 struct Symbol * symbol;
1878 struct __ecereNameSpace__ecere__sys__OldList *  templateArgs;
1879 struct Specifier * nsSpec;
1880 } ecere_gcc_struct __anon1;
1881 struct
1882 {
1883 struct Identifier * id;
1884 struct __ecereNameSpace__ecere__sys__OldList *  list;
1885 struct __ecereNameSpace__ecere__sys__OldList *  baseSpecs;
1886 struct __ecereNameSpace__ecere__sys__OldList *  definitions;
1887 unsigned int addNameSpace;
1888 struct Context * ctx;
1889 struct ExtDecl * extDeclStruct;
1890 } ecere_gcc_struct __anon2;
1891 struct Expression * expression;
1892 struct Specifier * _class;
1893 struct TemplateParameter * templateParameter;
1894 } ecere_gcc_struct __anon1;
1895 } ecere_gcc_struct;
1896
1897 extern struct Expression * GetTemplateArgExp(struct TemplateParameter * param, struct __ecereNameSpace__ecere__com__Class * curClass, unsigned int pointer);
1898
1899 struct TemplatedType
1900 {
1901 uintptr_t key;
1902 struct __ecereNameSpace__ecere__sys__BTNode * parent;
1903 struct __ecereNameSpace__ecere__sys__BTNode * left;
1904 struct __ecereNameSpace__ecere__sys__BTNode * right;
1905 int depth;
1906 struct TemplateParameter * param;
1907 } ecere_gcc_struct;
1908
1909 struct Type * ProcessTemplateParameterType(struct TemplateParameter * param)
1910 {
1911 if(param && param->type == 0 && (param->__anon1.dataType || param->dataTypeString))
1912 {
1913 if(!param->baseType)
1914 {
1915 if(param->dataTypeString)
1916 param->baseType = ProcessTypeString(param->dataTypeString, 0);
1917 else
1918 param->baseType = ProcessType(param->__anon1.dataType->specifiers, param->__anon1.dataType->decl);
1919 }
1920 return param->baseType;
1921 }
1922 return (((void *)0));
1923 }
1924
1925 unsigned int NeedCast(struct Type * type1, struct Type * type2)
1926 {
1927 if(!type1 || !type2 || type1->keepCast || type2->keepCast)
1928 return 1;
1929 if(type1->kind == 20 && type2->kind == 4 && type2->passAsTemplate == 0)
1930 {
1931 return 0;
1932 }
1933 if(type1->kind == type2->kind && type1->isLong == type2->isLong)
1934 {
1935 switch(type1->kind)
1936 {
1937 case 24:
1938 case 1:
1939 case 2:
1940 case 3:
1941 case 4:
1942 case 22:
1943 case 23:
1944 if(type1->passAsTemplate && !type2->passAsTemplate)
1945 return 1;
1946 return type1->isSigned != type2->isSigned;
1947 case 8:
1948 return type1->__anon1._class != type2->__anon1._class;
1949 case 13:
1950 return (type1->__anon1.type && type2->__anon1.type && type1->__anon1.type->constant != type2->__anon1.type->constant) || NeedCast(type1->__anon1.type, type2->__anon1.type);
1951 default:
1952 return 1;
1953 }
1954 }
1955 return 1;
1956 }
1957
1958 unsigned int GetOpInt(struct Operand * op2, int * value2)
1959 {
1960 if(op2->kind == 3 && op2->type->isSigned)
1961 *value2 = op2->__anon1.i;
1962 else if(op2->kind == 3)
1963 *value2 = (int)op2->__anon1.ui;
1964 else if(op2->kind == 4 && op2->type->isSigned)
1965 *value2 = (int)op2->__anon1.i64;
1966 else if(op2->kind == 4)
1967 *value2 = (int)op2->__anon1.ui64;
1968 else if(op2->kind == 23 && op2->type->isSigned)
1969 *value2 = (int)op2->__anon1.i64;
1970 else if(op2->kind == 23)
1971 *value2 = (int)op2->__anon1.ui64;
1972 else if(op2->kind == 22 && op2->type->isSigned)
1973 *value2 = (int)op2->__anon1.i64;
1974 else if(op2->kind == 22)
1975 *value2 = (int)op2->__anon1.ui64;
1976 else if(op2->kind == 2 && op2->type->isSigned)
1977 *value2 = (int)op2->__anon1.s;
1978 else if(op2->kind == 2)
1979 *value2 = (int)op2->__anon1.us;
1980 else if(op2->kind == 1 && op2->type->isSigned)
1981 *value2 = (int)op2->__anon1.c;
1982 else if(op2->kind == 24 || op2->kind == 1)
1983 *value2 = (int)op2->__anon1.uc;
1984 else if(op2->kind == 6)
1985 *value2 = (int)op2->__anon1.f;
1986 else if(op2->kind == 7)
1987 *value2 = (int)op2->__anon1.d;
1988 else if(op2->kind == 13)
1989 *value2 = (int)op2->__anon1.ui64;
1990 else
1991 return 0;
1992 return 1;
1993 }
1994
1995 unsigned int GetOpUInt(struct Operand * op2, unsigned int * value2)
1996 {
1997 if(op2->kind == 3 && op2->type->isSigned)
1998 *value2 = (unsigned int)op2->__anon1.i;
1999 else if(op2->kind == 3)
2000 *value2 = op2->__anon1.ui;
2001 else if(op2->kind == 4 && op2->type->isSigned)
2002 *value2 = (unsigned int)op2->__anon1.i64;
2003 else if(op2->kind == 4)
2004 *value2 = (unsigned int)op2->__anon1.ui64;
2005 else if(op2->kind == 23 && op2->type->isSigned)
2006 *value2 = (unsigned int)op2->__anon1.i64;
2007 else if(op2->kind == 23)
2008 *value2 = (unsigned int)op2->__anon1.ui64;
2009 else if(op2->kind == 22 && op2->type->isSigned)
2010 *value2 = (unsigned int)op2->__anon1.i64;
2011 else if(op2->kind == 22)
2012 *value2 = (unsigned int)op2->__anon1.ui64;
2013 else if(op2->kind == 2 && op2->type->isSigned)
2014 *value2 = (unsigned int)op2->__anon1.s;
2015 else if(op2->kind == 2)
2016 *value2 = (unsigned int)op2->__anon1.us;
2017 else if(op2->kind == 1 && op2->type->isSigned)
2018 *value2 = (unsigned int)op2->__anon1.c;
2019 else if(op2->kind == 24 || op2->kind == 1)
2020 *value2 = (unsigned int)op2->__anon1.uc;
2021 else if(op2->kind == 6)
2022 *value2 = (unsigned int)op2->__anon1.f;
2023 else if(op2->kind == 7)
2024 *value2 = (unsigned int)op2->__anon1.d;
2025 else if(op2->kind == 13)
2026 *value2 = (unsigned int)op2->__anon1.ui64;
2027 else
2028 return 0;
2029 return 1;
2030 }
2031
2032 unsigned int GetOpInt64(struct Operand * op2, long long * value2)
2033 {
2034 if(op2->kind == 3 && op2->type->isSigned)
2035 *value2 = (long long)op2->__anon1.i;
2036 else if(op2->kind == 3)
2037 *value2 = (long long)op2->__anon1.ui;
2038 else if(op2->kind == 4 && op2->type->isSigned)
2039 *value2 = op2->__anon1.i64;
2040 else if(op2->kind == 4)
2041 *value2 = (long long)op2->__anon1.ui64;
2042 else if(op2->kind == 23 && op2->type->isSigned)
2043 *value2 = op2->__anon1.i64;
2044 else if(op2->kind == 23)
2045 *value2 = (long long)op2->__anon1.ui64;
2046 else if(op2->kind == 22 && op2->type->isSigned)
2047 *value2 = op2->__anon1.i64;
2048 else if(op2->kind == 22)
2049 *value2 = (long long)op2->__anon1.ui64;
2050 else if(op2->kind == 2 && op2->type->isSigned)
2051 *value2 = (long long)op2->__anon1.s;
2052 else if(op2->kind == 2)
2053 *value2 = (long long)op2->__anon1.us;
2054 else if(op2->kind == 1 && op2->type->isSigned)
2055 *value2 = (long long)op2->__anon1.c;
2056 else if(op2->kind == 24 || op2->kind == 1)
2057 *value2 = (long long)op2->__anon1.uc;
2058 else if(op2->kind == 6)
2059 *value2 = (long long)op2->__anon1.f;
2060 else if(op2->kind == 7)
2061 *value2 = (long long)op2->__anon1.d;
2062 else if(op2->kind == 13)
2063 *value2 = (long long)op2->__anon1.ui64;
2064 else
2065 return 0;
2066 return 1;
2067 }
2068
2069 unsigned int GetOpUInt64(struct Operand * op2, uint64 * value2)
2070 {
2071 if(op2->kind == 3 && op2->type->isSigned)
2072 *value2 = (uint64)op2->__anon1.i;
2073 else if(op2->kind == 3)
2074 *value2 = (uint64)op2->__anon1.ui;
2075 else if(op2->kind == 4 && op2->type->isSigned)
2076 *value2 = (uint64)op2->__anon1.i64;
2077 else if(op2->kind == 4)
2078 *value2 = op2->__anon1.ui64;
2079 else if(op2->kind == 23 && op2->type->isSigned)
2080 *value2 = (uint64)op2->__anon1.i64;
2081 else if(op2->kind == 23)
2082 *value2 = op2->__anon1.ui64;
2083 else if(op2->kind == 22 && op2->type->isSigned)
2084 *value2 = (uint64)op2->__anon1.i64;
2085 else if(op2->kind == 22)
2086 *value2 = op2->__anon1.ui64;
2087 else if(op2->kind == 2 && op2->type->isSigned)
2088 *value2 = (uint64)op2->__anon1.s;
2089 else if(op2->kind == 2)
2090 *value2 = (uint64)op2->__anon1.us;
2091 else if(op2->kind == 1 && op2->type->isSigned)
2092 *value2 = (uint64)op2->__anon1.c;
2093 else if(op2->kind == 24 || op2->kind == 1)
2094 *value2 = (uint64)op2->__anon1.uc;
2095 else if(op2->kind == 6)
2096 *value2 = (uint64)op2->__anon1.f;
2097 else if(op2->kind == 7)
2098 *value2 = (uint64)op2->__anon1.d;
2099 else if(op2->kind == 13)
2100 *value2 = op2->__anon1.ui64;
2101 else
2102 return 0;
2103 return 1;
2104 }
2105
2106 unsigned int GetOpIntPtr(struct Operand * op2, intptr_t * value2)
2107 {
2108 if(op2->kind == 3 && op2->type->isSigned)
2109 *value2 = (intptr_t)op2->__anon1.i;
2110 else if(op2->kind == 3)
2111 *value2 = (intptr_t)op2->__anon1.ui;
2112 else if(op2->kind == 4 && op2->type->isSigned)
2113 *value2 = (intptr_t)op2->__anon1.i64;
2114 else if(op2->kind == 4)
2115 *value2 = (intptr_t)op2->__anon1.ui64;
2116 else if(op2->kind == 23 && op2->type->isSigned)
2117 *value2 = (intptr_t)op2->__anon1.i64;
2118 else if(op2->kind == 23)
2119 *value2 = (intptr_t)op2->__anon1.ui64;
2120 else if(op2->kind == 22 && op2->type->isSigned)
2121 *value2 = (intptr_t)op2->__anon1.i64;
2122 else if(op2->kind == 22)
2123 *value2 = (intptr_t)op2->__anon1.ui64;
2124 else if(op2->kind == 2 && op2->type->isSigned)
2125 *value2 = (intptr_t)op2->__anon1.s;
2126 else if(op2->kind == 2)
2127 *value2 = (intptr_t)op2->__anon1.us;
2128 else if(op2->kind == 1 && op2->type->isSigned)
2129 *value2 = (intptr_t)op2->__anon1.c;
2130 else if(op2->kind == 24 || op2->kind == 1)
2131 *value2 = (intptr_t)op2->__anon1.uc;
2132 else if(op2->kind == 6)
2133 *value2 = (intptr_t)op2->__anon1.f;
2134 else if(op2->kind == 7)
2135 *value2 = (intptr_t)op2->__anon1.d;
2136 else if(op2->kind == 13)
2137 *value2 = (intptr_t)op2->__anon1.ui64;
2138 else
2139 return 0;
2140 return 1;
2141 }
2142
2143 unsigned int GetOpUIntPtr(struct Operand * op2, uintptr_t * value2)
2144 {
2145 if(op2->kind == 3 && op2->type->isSigned)
2146 *value2 = (uintptr_t)op2->__anon1.i;
2147 else if(op2->kind == 3)
2148 *value2 = (uintptr_t)op2->__anon1.ui;
2149 else if(op2->kind == 4 && op2->type->isSigned)
2150 *value2 = (uintptr_t)op2->__anon1.i64;
2151 else if(op2->kind == 4)
2152 *value2 = (uintptr_t)op2->__anon1.ui64;
2153 else if(op2->kind == 23 && op2->type->isSigned)
2154 *value2 = (uintptr_t)op2->__anon1.i64;
2155 else if(op2->kind == 23)
2156 *value2 = (uintptr_t)op2->__anon1.ui64;
2157 else if(op2->kind == 22 && op2->type->isSigned)
2158 *value2 = (uintptr_t)op2->__anon1.i64;
2159 else if(op2->kind == 22)
2160 *value2 = (uintptr_t)op2->__anon1.ui64;
2161 else if(op2->kind == 2 && op2->type->isSigned)
2162 *value2 = (uintptr_t)op2->__anon1.s;
2163 else if(op2->kind == 2)
2164 *value2 = (uintptr_t)op2->__anon1.us;
2165 else if(op2->kind == 1 && op2->type->isSigned)
2166 *value2 = (uintptr_t)op2->__anon1.c;
2167 else if(op2->kind == 24 || op2->kind == 1)
2168 *value2 = (uintptr_t)op2->__anon1.uc;
2169 else if(op2->kind == 6)
2170 *value2 = (uintptr_t)op2->__anon1.f;
2171 else if(op2->kind == 7)
2172 *value2 = (uintptr_t)op2->__anon1.d;
2173 else if(op2->kind == 13)
2174 *value2 = (uintptr_t)op2->__anon1.ui64;
2175 else
2176 return 0;
2177 return 1;
2178 }
2179
2180 unsigned int GetOpIntSize(struct Operand * op2, ssize_t * value2)
2181 {
2182 if(op2->kind == 3 && op2->type->isSigned)
2183 *value2 = (ssize_t)op2->__anon1.i;
2184 else if(op2->kind == 3)
2185 *value2 = (ssize_t)op2->__anon1.ui;
2186 else if(op2->kind == 4 && op2->type->isSigned)
2187 *value2 = (ssize_t)op2->__anon1.i64;
2188 else if(op2->kind == 4)
2189 *value2 = (ssize_t)op2->__anon1.ui64;
2190 else if(op2->kind == 23 && op2->type->isSigned)
2191 *value2 = (ssize_t)op2->__anon1.i64;
2192 else if(op2->kind == 23)
2193 *value2 = (ssize_t)op2->__anon1.ui64;
2194 else if(op2->kind == 22 && op2->type->isSigned)
2195 *value2 = (ssize_t)op2->__anon1.i64;
2196 else if(op2->kind == 22)
2197 *value2 = (ssize_t)op2->__anon1.ui64;
2198 else if(op2->kind == 2 && op2->type->isSigned)
2199 *value2 = (ssize_t)op2->__anon1.s;
2200 else if(op2->kind == 2)
2201 *value2 = (ssize_t)op2->__anon1.us;
2202 else if(op2->kind == 1 && op2->type->isSigned)
2203 *value2 = (ssize_t)op2->__anon1.c;
2204 else if(op2->kind == 24 || op2->kind == 1)
2205 *value2 = (ssize_t)op2->__anon1.uc;
2206 else if(op2->kind == 6)
2207 *value2 = (ssize_t)op2->__anon1.f;
2208 else if(op2->kind == 7)
2209 *value2 = (ssize_t)op2->__anon1.d;
2210 else if(op2->kind == 13)
2211 *value2 = (ssize_t)op2->__anon1.ui64;
2212 else
2213 return 0;
2214 return 1;
2215 }
2216
2217 unsigned int GetOpUIntSize(struct Operand * op2, size_t * value2)
2218 {
2219 if(op2->kind == 3 && op2->type->isSigned)
2220 *value2 = (size_t)op2->__anon1.i;
2221 else if(op2->kind == 3)
2222 *value2 = (size_t)op2->__anon1.ui;
2223 else if(op2->kind == 4 && op2->type->isSigned)
2224 *value2 = (size_t)op2->__anon1.i64;
2225 else if(op2->kind == 4)
2226 *value2 = (size_t)op2->__anon1.ui64;
2227 else if(op2->kind == 23 && op2->type->isSigned)
2228 *value2 = (size_t)op2->__anon1.i64;
2229 else if(op2->kind == 23)
2230 *value2 = (size_t)op2->__anon1.ui64;
2231 else if(op2->kind == 22 && op2->type->isSigned)
2232 *value2 = (size_t)op2->__anon1.i64;
2233 else if(op2->kind == 22)
2234 *value2 = (size_t)op2->__anon1.ui64;
2235 else if(op2->kind == 2 && op2->type->isSigned)
2236 *value2 = (size_t)op2->__anon1.s;
2237 else if(op2->kind == 2)
2238 *value2 = (size_t)op2->__anon1.us;
2239 else if(op2->kind == 1 && op2->type->isSigned)
2240 *value2 = (size_t)op2->__anon1.c;
2241 else if(op2->kind == 24 || op2->kind == 1)
2242 *value2 = (size_t)op2->__anon1.uc;
2243 else if(op2->kind == 6)
2244 *value2 = (size_t)op2->__anon1.f;
2245 else if(op2->kind == 7)
2246 *value2 = (size_t)op2->__anon1.d;
2247 else if(op2->kind == 13)
2248 *value2 = (size_t)op2->__anon1.ui64;
2249 else
2250 return 0;
2251 return 1;
2252 }
2253
2254 unsigned int GetOpShort(struct Operand * op2, short * value2)
2255 {
2256 if(op2->kind == 3 && op2->type->isSigned)
2257 *value2 = (short)op2->__anon1.i;
2258 else if(op2->kind == 3)
2259 *value2 = (short)op2->__anon1.ui;
2260 else if(op2->kind == 4 && op2->type->isSigned)
2261 *value2 = (short)op2->__anon1.i64;
2262 else if(op2->kind == 4)
2263 *value2 = (short)op2->__anon1.ui64;
2264 else if(op2->kind == 23 && op2->type->isSigned)
2265 *value2 = (short)op2->__anon1.i64;
2266 else if(op2->kind == 23)
2267 *value2 = (short)op2->__anon1.ui64;
2268 else if(op2->kind == 22 && op2->type->isSigned)
2269 *value2 = (short)op2->__anon1.i64;
2270 else if(op2->kind == 22)
2271 *value2 = (short)op2->__anon1.ui64;
2272 else if(op2->kind == 2 && op2->type->isSigned)
2273 *value2 = op2->__anon1.s;
2274 else if(op2->kind == 2)
2275 *value2 = (short)op2->__anon1.us;
2276 else if(op2->kind == 1 && op2->type->isSigned)
2277 *value2 = (short)op2->__anon1.c;
2278 else if(op2->kind == 24 || op2->kind == 1)
2279 *value2 = (short)op2->__anon1.uc;
2280 else if(op2->kind == 6)
2281 *value2 = (short)op2->__anon1.f;
2282 else if(op2->kind == 7)
2283 *value2 = (short)op2->__anon1.d;
2284 else if(op2->kind == 13)
2285 *value2 = (short)op2->__anon1.ui64;
2286 else
2287 return 0;
2288 return 1;
2289 }
2290
2291 unsigned int GetOpUShort(struct Operand * op2, unsigned short * value2)
2292 {
2293 if(op2->kind == 3 && op2->type->isSigned)
2294 *value2 = (unsigned short)op2->__anon1.i;
2295 else if(op2->kind == 3)
2296 *value2 = (unsigned short)op2->__anon1.ui;
2297 else if(op2->kind == 4 && op2->type->isSigned)
2298 *value2 = (unsigned short)op2->__anon1.i64;
2299 else if(op2->kind == 4)
2300 *value2 = (unsigned short)op2->__anon1.ui64;
2301 else if(op2->kind == 23 && op2->type->isSigned)
2302 *value2 = (unsigned short)op2->__anon1.i64;
2303 else if(op2->kind == 23)
2304 *value2 = (unsigned short)op2->__anon1.ui64;
2305 else if(op2->kind == 22 && op2->type->isSigned)
2306 *value2 = (unsigned short)op2->__anon1.i64;
2307 else if(op2->kind == 22)
2308 *value2 = (unsigned short)op2->__anon1.ui64;
2309 else if(op2->kind == 2 && op2->type->isSigned)
2310 *value2 = (unsigned short)op2->__anon1.s;
2311 else if(op2->kind == 2)
2312 *value2 = op2->__anon1.us;
2313 else if(op2->kind == 1 && op2->type->isSigned)
2314 *value2 = (unsigned short)op2->__anon1.c;
2315 else if(op2->kind == 24 || op2->kind == 1)
2316 *value2 = (unsigned short)op2->__anon1.uc;
2317 else if(op2->kind == 6)
2318 *value2 = (unsigned short)op2->__anon1.f;
2319 else if(op2->kind == 7)
2320 *value2 = (unsigned short)op2->__anon1.d;
2321 else if(op2->kind == 13)
2322 *value2 = (unsigned short)op2->__anon1.ui64;
2323 else
2324 return 0;
2325 return 1;
2326 }
2327
2328 unsigned int GetOpChar(struct Operand * op2, char * value2)
2329 {
2330 if(op2->kind == 3 && op2->type->isSigned)
2331 *value2 = (char)op2->__anon1.i;
2332 else if(op2->kind == 3)
2333 *value2 = (char)op2->__anon1.ui;
2334 else if(op2->kind == 4 && op2->type->isSigned)
2335 *value2 = (char)op2->__anon1.i64;
2336 else if(op2->kind == 4)
2337 *value2 = (char)op2->__anon1.ui64;
2338 else if(op2->kind == 23 && op2->type->isSigned)
2339 *value2 = (char)op2->__anon1.i64;
2340 else if(op2->kind == 23)
2341 *value2 = (char)op2->__anon1.ui64;
2342 else if(op2->kind == 22 && op2->type->isSigned)
2343 *value2 = (char)op2->__anon1.i64;
2344 else if(op2->kind == 22)
2345 *value2 = (char)op2->__anon1.ui64;
2346 else if(op2->kind == 2 && op2->type->isSigned)
2347 *value2 = (char)op2->__anon1.s;
2348 else if(op2->kind == 2)
2349 *value2 = (char)op2->__anon1.us;
2350 else if(op2->kind == 1 && op2->type->isSigned)
2351 *value2 = op2->__anon1.c;
2352 else if(op2->kind == 24 || op2->kind == 1)
2353 *value2 = (char)op2->__anon1.uc;
2354 else if(op2->kind == 6)
2355 *value2 = (char)op2->__anon1.f;
2356 else if(op2->kind == 7)
2357 *value2 = (char)op2->__anon1.d;
2358 else if(op2->kind == 13)
2359 *value2 = (char)op2->__anon1.ui64;
2360 else
2361 return 0;
2362 return 1;
2363 }
2364
2365 unsigned int GetOpUChar(struct Operand * op2, unsigned char * value2)
2366 {
2367 if(op2->kind == 3 && op2->type->isSigned)
2368 *value2 = (unsigned char)op2->__anon1.i;
2369 else if(op2->kind == 3)
2370 *value2 = (unsigned char)op2->__anon1.ui;
2371 else if(op2->kind == 4 && op2->type->isSigned)
2372 *value2 = (unsigned char)op2->__anon1.i64;
2373 else if(op2->kind == 4)
2374 *value2 = (unsigned char)op2->__anon1.ui64;
2375 else if(op2->kind == 23 && op2->type->isSigned)
2376 *value2 = (unsigned char)op2->__anon1.i64;
2377 else if(op2->kind == 23)
2378 *value2 = (unsigned char)op2->__anon1.ui64;
2379 else if(op2->kind == 22 && op2->type->isSigned)
2380 *value2 = (unsigned char)op2->__anon1.i64;
2381 else if(op2->kind == 22)
2382 *value2 = (unsigned char)op2->__anon1.ui64;
2383 else if(op2->kind == 2 && op2->type->isSigned)
2384 *value2 = (unsigned char)op2->__anon1.s;
2385 else if(op2->kind == 2)
2386 *value2 = (unsigned char)op2->__anon1.us;
2387 else if(op2->kind == 1 && op2->type->isSigned)
2388 *value2 = (unsigned char)op2->__anon1.c;
2389 else if(op2->kind == 24 || op2->kind == 1)
2390 *value2 = op2->__anon1.uc;
2391 else if(op2->kind == 6)
2392 *value2 = (unsigned char)op2->__anon1.f;
2393 else if(op2->kind == 7)
2394 *value2 = (unsigned char)op2->__anon1.d;
2395 else if(op2->kind == 13)
2396 *value2 = (unsigned char)op2->__anon1.ui64;
2397 else
2398 return 0;
2399 return 1;
2400 }
2401
2402 unsigned int GetOpFloat(struct Operand * op2, float * value2)
2403 {
2404 if(op2->kind == 3 && op2->type->isSigned)
2405 *value2 = (float)(float)op2->__anon1.i;
2406 else if(op2->kind == 3)
2407 *value2 = (float)(float)op2->__anon1.ui;
2408 else if(op2->kind == 4 && op2->type->isSigned)
2409 *value2 = (float)(float)op2->__anon1.i64;
2410 else if(op2->kind == 4)
2411 *value2 = (float)(float)op2->__anon1.ui64;
2412 else if(op2->kind == 23 && op2->type->isSigned)
2413 *value2 = (float)(float)op2->__anon1.i64;
2414 else if(op2->kind == 23)
2415 *value2 = (float)(float)op2->__anon1.ui64;
2416 else if(op2->kind == 22 && op2->type->isSigned)
2417 *value2 = (float)(float)op2->__anon1.i64;
2418 else if(op2->kind == 22)
2419 *value2 = (float)(float)op2->__anon1.ui64;
2420 else if(op2->kind == 2 && op2->type->isSigned)
2421 *value2 = (float)(float)op2->__anon1.s;
2422 else if(op2->kind == 2)
2423 *value2 = (float)(float)op2->__anon1.us;
2424 else if(op2->kind == 1 && op2->type->isSigned)
2425 *value2 = (float)(float)op2->__anon1.c;
2426 else if(op2->kind == 24 || op2->kind == 1)
2427 *value2 = (float)(float)op2->__anon1.uc;
2428 else if(op2->kind == 6)
2429 *value2 = (float)op2->__anon1.f;
2430 else if(op2->kind == 7)
2431 *value2 = (float)op2->__anon1.d;
2432 else if(op2->kind == 13)
2433 *value2 = (float)(float)op2->__anon1.ui64;
2434 else
2435 return 0;
2436 return 1;
2437 }
2438
2439 unsigned int GetOpDouble(struct Operand * op2, double * value2)
2440 {
2441 if(op2->kind == 3 && op2->type->isSigned)
2442 *value2 = (double)(double)op2->__anon1.i;
2443 else if(op2->kind == 3)
2444 *value2 = (double)(double)op2->__anon1.ui;
2445 else if(op2->kind == 4 && op2->type->isSigned)
2446 *value2 = (double)(double)op2->__anon1.i64;
2447 else if(op2->kind == 4)
2448 *value2 = (double)(double)op2->__anon1.ui64;
2449 else if(op2->kind == 23 && op2->type->isSigned)
2450 *value2 = (double)(double)op2->__anon1.i64;
2451 else if(op2->kind == 23)
2452 *value2 = (double)(double)op2->__anon1.ui64;
2453 else if(op2->kind == 22 && op2->type->isSigned)
2454 *value2 = (double)(double)op2->__anon1.i64;
2455 else if(op2->kind == 22)
2456 *value2 = (double)(double)op2->__anon1.ui64;
2457 else if(op2->kind == 2 && op2->type->isSigned)
2458 *value2 = (double)(double)op2->__anon1.s;
2459 else if(op2->kind == 2)
2460 *value2 = (double)(double)op2->__anon1.us;
2461 else if(op2->kind == 1 && op2->type->isSigned)
2462 *value2 = (double)(double)op2->__anon1.c;
2463 else if(op2->kind == 24 || op2->kind == 1)
2464 *value2 = (double)(double)op2->__anon1.uc;
2465 else if(op2->kind == 6)
2466 *value2 = (double)op2->__anon1.f;
2467 else if(op2->kind == 7)
2468 *value2 = (double)op2->__anon1.d;
2469 else if(op2->kind == 13)
2470 *value2 = (double)(double)op2->__anon1.ui64;
2471 else
2472 return 0;
2473 return 1;
2474 }
2475
2476 static unsigned int IntAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2477 {
2478 int value2 = op2->__anon1.i;
2479
2480 exp->type = 2;
2481 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i + value2));
2482 if(!exp->expType)
2483 {
2484 exp->expType = op1->type;
2485 if(op1->type)
2486 op1->type->refCount++;
2487 }
2488 return 1;
2489 }
2490
2491 static unsigned int UIntAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2492 {
2493 unsigned int value2 = op2->__anon1.ui;
2494
2495 exp->type = 2;
2496 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui + value2));
2497 if(!exp->expType)
2498 {
2499 exp->expType = op1->type;
2500 if(op1->type)
2501 op1->type->refCount++;
2502 }
2503 return 1;
2504 }
2505
2506 static unsigned int Int64Add(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2507 {
2508 long long value2 = op2->__anon1.i64;
2509
2510 exp->type = 2;
2511 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 + value2));
2512 if(!exp->expType)
2513 {
2514 exp->expType = op1->type;
2515 if(op1->type)
2516 op1->type->refCount++;
2517 }
2518 return 1;
2519 }
2520
2521 static unsigned int UInt64Add(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2522 {
2523 uint64 value2 = op2->__anon1.ui64;
2524
2525 exp->type = 2;
2526 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 + value2));
2527 if(!exp->expType)
2528 {
2529 exp->expType = op1->type;
2530 if(op1->type)
2531 op1->type->refCount++;
2532 }
2533 return 1;
2534 }
2535
2536 static unsigned int ShortAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2537 {
2538 short value2 = op2->__anon1.s;
2539
2540 exp->type = 2;
2541 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s + value2));
2542 if(!exp->expType)
2543 {
2544 exp->expType = op1->type;
2545 if(op1->type)
2546 op1->type->refCount++;
2547 }
2548 return 1;
2549 }
2550
2551 static unsigned int UShortAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2552 {
2553 unsigned short value2 = op2->__anon1.us;
2554
2555 exp->type = 2;
2556 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us + value2));
2557 if(!exp->expType)
2558 {
2559 exp->expType = op1->type;
2560 if(op1->type)
2561 op1->type->refCount++;
2562 }
2563 return 1;
2564 }
2565
2566 static unsigned int CharAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2567 {
2568 char value2 = op2->__anon1.c;
2569
2570 exp->type = 2;
2571 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c + value2));
2572 if(!exp->expType)
2573 {
2574 exp->expType = op1->type;
2575 if(op1->type)
2576 op1->type->refCount++;
2577 }
2578 return 1;
2579 }
2580
2581 static unsigned int UCharAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2582 {
2583 unsigned char value2 = op2->__anon1.uc;
2584
2585 exp->type = 2;
2586 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc + value2));
2587 if(!exp->expType)
2588 {
2589 exp->expType = op1->type;
2590 if(op1->type)
2591 op1->type->refCount++;
2592 }
2593 return 1;
2594 }
2595
2596 static unsigned int FloatAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2597 {
2598 float value2 = op2->__anon1.f;
2599
2600 exp->type = 2;
2601 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f + value2));
2602 if(!exp->expType)
2603 {
2604 exp->expType = op1->type;
2605 if(op1->type)
2606 op1->type->refCount++;
2607 }
2608 return 1;
2609 }
2610
2611 static unsigned int DoubleAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2612 {
2613 double value2 = op2->__anon1.d;
2614
2615 exp->type = 2;
2616 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d + value2));
2617 if(!exp->expType)
2618 {
2619 exp->expType = op1->type;
2620 if(op1->type)
2621 op1->type->refCount++;
2622 }
2623 return 1;
2624 }
2625
2626 static unsigned int IntSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2627 {
2628 int value2 = op2->__anon1.i;
2629
2630 exp->type = 2;
2631 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i - value2));
2632 if(!exp->expType)
2633 {
2634 exp->expType = op1->type;
2635 if(op1->type)
2636 op1->type->refCount++;
2637 }
2638 return 1;
2639 }
2640
2641 static unsigned int UIntSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2642 {
2643 unsigned int value2 = op2->__anon1.ui;
2644
2645 exp->type = 2;
2646 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui - value2));
2647 if(!exp->expType)
2648 {
2649 exp->expType = op1->type;
2650 if(op1->type)
2651 op1->type->refCount++;
2652 }
2653 return 1;
2654 }
2655
2656 static unsigned int Int64Sub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2657 {
2658 long long value2 = op2->__anon1.i64;
2659
2660 exp->type = 2;
2661 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 - value2));
2662 if(!exp->expType)
2663 {
2664 exp->expType = op1->type;
2665 if(op1->type)
2666 op1->type->refCount++;
2667 }
2668 return 1;
2669 }
2670
2671 static unsigned int UInt64Sub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2672 {
2673 uint64 value2 = op2->__anon1.ui64;
2674
2675 exp->type = 2;
2676 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 - value2));
2677 if(!exp->expType)
2678 {
2679 exp->expType = op1->type;
2680 if(op1->type)
2681 op1->type->refCount++;
2682 }
2683 return 1;
2684 }
2685
2686 static unsigned int ShortSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2687 {
2688 short value2 = op2->__anon1.s;
2689
2690 exp->type = 2;
2691 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s - value2));
2692 if(!exp->expType)
2693 {
2694 exp->expType = op1->type;
2695 if(op1->type)
2696 op1->type->refCount++;
2697 }
2698 return 1;
2699 }
2700
2701 static unsigned int UShortSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2702 {
2703 unsigned short value2 = op2->__anon1.us;
2704
2705 exp->type = 2;
2706 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us - value2));
2707 if(!exp->expType)
2708 {
2709 exp->expType = op1->type;
2710 if(op1->type)
2711 op1->type->refCount++;
2712 }
2713 return 1;
2714 }
2715
2716 static unsigned int CharSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2717 {
2718 char value2 = op2->__anon1.c;
2719
2720 exp->type = 2;
2721 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c - value2));
2722 if(!exp->expType)
2723 {
2724 exp->expType = op1->type;
2725 if(op1->type)
2726 op1->type->refCount++;
2727 }
2728 return 1;
2729 }
2730
2731 static unsigned int UCharSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2732 {
2733 unsigned char value2 = op2->__anon1.uc;
2734
2735 exp->type = 2;
2736 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc - value2));
2737 if(!exp->expType)
2738 {
2739 exp->expType = op1->type;
2740 if(op1->type)
2741 op1->type->refCount++;
2742 }
2743 return 1;
2744 }
2745
2746 static unsigned int FloatSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2747 {
2748 float value2 = op2->__anon1.f;
2749
2750 exp->type = 2;
2751 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f - value2));
2752 if(!exp->expType)
2753 {
2754 exp->expType = op1->type;
2755 if(op1->type)
2756 op1->type->refCount++;
2757 }
2758 return 1;
2759 }
2760
2761 static unsigned int DoubleSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2762 {
2763 double value2 = op2->__anon1.d;
2764
2765 exp->type = 2;
2766 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d - value2));
2767 if(!exp->expType)
2768 {
2769 exp->expType = op1->type;
2770 if(op1->type)
2771 op1->type->refCount++;
2772 }
2773 return 1;
2774 }
2775
2776 static unsigned int IntMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2777 {
2778 int value2 = op2->__anon1.i;
2779
2780 exp->type = 2;
2781 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i * value2));
2782 if(!exp->expType)
2783 {
2784 exp->expType = op1->type;
2785 if(op1->type)
2786 op1->type->refCount++;
2787 }
2788 return 1;
2789 }
2790
2791 static unsigned int UIntMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2792 {
2793 unsigned int value2 = op2->__anon1.ui;
2794
2795 exp->type = 2;
2796 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui * value2));
2797 if(!exp->expType)
2798 {
2799 exp->expType = op1->type;
2800 if(op1->type)
2801 op1->type->refCount++;
2802 }
2803 return 1;
2804 }
2805
2806 static unsigned int Int64Mul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2807 {
2808 long long value2 = op2->__anon1.i64;
2809
2810 exp->type = 2;
2811 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 * value2));
2812 if(!exp->expType)
2813 {
2814 exp->expType = op1->type;
2815 if(op1->type)
2816 op1->type->refCount++;
2817 }
2818 return 1;
2819 }
2820
2821 static unsigned int UInt64Mul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2822 {
2823 uint64 value2 = op2->__anon1.ui64;
2824
2825 exp->type = 2;
2826 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 * value2));
2827 if(!exp->expType)
2828 {
2829 exp->expType = op1->type;
2830 if(op1->type)
2831 op1->type->refCount++;
2832 }
2833 return 1;
2834 }
2835
2836 static unsigned int ShortMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2837 {
2838 short value2 = op2->__anon1.s;
2839
2840 exp->type = 2;
2841 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s * value2));
2842 if(!exp->expType)
2843 {
2844 exp->expType = op1->type;
2845 if(op1->type)
2846 op1->type->refCount++;
2847 }
2848 return 1;
2849 }
2850
2851 static unsigned int UShortMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2852 {
2853 unsigned short value2 = op2->__anon1.us;
2854
2855 exp->type = 2;
2856 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us * value2));
2857 if(!exp->expType)
2858 {
2859 exp->expType = op1->type;
2860 if(op1->type)
2861 op1->type->refCount++;
2862 }
2863 return 1;
2864 }
2865
2866 static unsigned int CharMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2867 {
2868 char value2 = op2->__anon1.c;
2869
2870 exp->type = 2;
2871 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c * value2));
2872 if(!exp->expType)
2873 {
2874 exp->expType = op1->type;
2875 if(op1->type)
2876 op1->type->refCount++;
2877 }
2878 return 1;
2879 }
2880
2881 static unsigned int UCharMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2882 {
2883 unsigned char value2 = op2->__anon1.uc;
2884
2885 exp->type = 2;
2886 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc * value2));
2887 if(!exp->expType)
2888 {
2889 exp->expType = op1->type;
2890 if(op1->type)
2891 op1->type->refCount++;
2892 }
2893 return 1;
2894 }
2895
2896 static unsigned int FloatMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2897 {
2898 float value2 = op2->__anon1.f;
2899
2900 exp->type = 2;
2901 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f * value2));
2902 if(!exp->expType)
2903 {
2904 exp->expType = op1->type;
2905 if(op1->type)
2906 op1->type->refCount++;
2907 }
2908 return 1;
2909 }
2910
2911 static unsigned int DoubleMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2912 {
2913 double value2 = op2->__anon1.d;
2914
2915 exp->type = 2;
2916 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d * value2));
2917 if(!exp->expType)
2918 {
2919 exp->expType = op1->type;
2920 if(op1->type)
2921 op1->type->refCount++;
2922 }
2923 return 1;
2924 }
2925
2926 static unsigned int IntDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2927 {
2928 int value2 = op2->__anon1.i;
2929
2930 exp->type = 2;
2931 exp->__anon1.__anon2.string = PrintInt(value2 ? ((op1->__anon1.i / value2)) : 0);
2932 if(!exp->expType)
2933 {
2934 exp->expType = op1->type;
2935 if(op1->type)
2936 op1->type->refCount++;
2937 }
2938 return 1;
2939 }
2940
2941 static unsigned int UIntDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2942 {
2943 unsigned int value2 = op2->__anon1.ui;
2944
2945 exp->type = 2;
2946 exp->__anon1.__anon2.string = PrintUInt(value2 ? ((op1->__anon1.ui / value2)) : 0);
2947 if(!exp->expType)
2948 {
2949 exp->expType = op1->type;
2950 if(op1->type)
2951 op1->type->refCount++;
2952 }
2953 return 1;
2954 }
2955
2956 static unsigned int Int64Div(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2957 {
2958 long long value2 = op2->__anon1.i64;
2959
2960 exp->type = 2;
2961 exp->__anon1.__anon2.string = PrintInt64(value2 ? ((op1->__anon1.i64 / value2)) : 0);
2962 if(!exp->expType)
2963 {
2964 exp->expType = op1->type;
2965 if(op1->type)
2966 op1->type->refCount++;
2967 }
2968 return 1;
2969 }
2970
2971 static unsigned int UInt64Div(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2972 {
2973 uint64 value2 = op2->__anon1.ui64;
2974
2975 exp->type = 2;
2976 exp->__anon1.__anon2.string = PrintUInt64(value2 ? ((op1->__anon1.ui64 / value2)) : 0);
2977 if(!exp->expType)
2978 {
2979 exp->expType = op1->type;
2980 if(op1->type)
2981 op1->type->refCount++;
2982 }
2983 return 1;
2984 }
2985
2986 static unsigned int ShortDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2987 {
2988 short value2 = op2->__anon1.s;
2989
2990 exp->type = 2;
2991 exp->__anon1.__anon2.string = PrintShort(value2 ? ((short)(op1->__anon1.s / value2)) : 0);
2992 if(!exp->expType)
2993 {
2994 exp->expType = op1->type;
2995 if(op1->type)
2996 op1->type->refCount++;
2997 }
2998 return 1;
2999 }
3000
3001 static unsigned int UShortDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3002 {
3003 unsigned short value2 = op2->__anon1.us;
3004
3005 exp->type = 2;
3006 exp->__anon1.__anon2.string = PrintUShort(value2 ? ((unsigned short)(op1->__anon1.us / value2)) : 0);
3007 if(!exp->expType)
3008 {
3009 exp->expType = op1->type;
3010 if(op1->type)
3011 op1->type->refCount++;
3012 }
3013 return 1;
3014 }
3015
3016 static unsigned int CharDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3017 {
3018 char value2 = op2->__anon1.c;
3019
3020 exp->type = 2;
3021 exp->__anon1.__anon2.string = PrintChar(value2 ? ((char)(op1->__anon1.c / value2)) : 0);
3022 if(!exp->expType)
3023 {
3024 exp->expType = op1->type;
3025 if(op1->type)
3026 op1->type->refCount++;
3027 }
3028 return 1;
3029 }
3030
3031 static unsigned int UCharDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3032 {
3033 unsigned char value2 = op2->__anon1.uc;
3034
3035 exp->type = 2;
3036 exp->__anon1.__anon2.string = PrintUChar(value2 ? ((unsigned char)(op1->__anon1.uc / value2)) : 0);
3037 if(!exp->expType)
3038 {
3039 exp->expType = op1->type;
3040 if(op1->type)
3041 op1->type->refCount++;
3042 }
3043 return 1;
3044 }
3045
3046 static unsigned int FloatDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3047 {
3048 float value2 = op2->__anon1.f;
3049
3050 exp->type = 2;
3051 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f / value2));
3052 if(!exp->expType)
3053 {
3054 exp->expType = op1->type;
3055 if(op1->type)
3056 op1->type->refCount++;
3057 }
3058 return 1;
3059 }
3060
3061 static unsigned int DoubleDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3062 {
3063 double value2 = op2->__anon1.d;
3064
3065 exp->type = 2;
3066 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d / value2));
3067 if(!exp->expType)
3068 {
3069 exp->expType = op1->type;
3070 if(op1->type)
3071 op1->type->refCount++;
3072 }
3073 return 1;
3074 }
3075
3076 static unsigned int IntMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3077 {
3078 int value2 = op2->__anon1.i;
3079
3080 exp->type = 2;
3081 exp->__anon1.__anon2.string = PrintInt(value2 ? ((op1->__anon1.i % value2)) : 0);
3082 if(!exp->expType)
3083 {
3084 exp->expType = op1->type;
3085 if(op1->type)
3086 op1->type->refCount++;
3087 }
3088 return 1;
3089 }
3090
3091 static unsigned int UIntMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3092 {
3093 unsigned int value2 = op2->__anon1.ui;
3094
3095 exp->type = 2;
3096 exp->__anon1.__anon2.string = PrintUInt(value2 ? ((op1->__anon1.ui % value2)) : 0);
3097 if(!exp->expType)
3098 {
3099 exp->expType = op1->type;
3100 if(op1->type)
3101 op1->type->refCount++;
3102 }
3103 return 1;
3104 }
3105
3106 static unsigned int Int64Mod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3107 {
3108 long long value2 = op2->__anon1.i64;
3109
3110 exp->type = 2;
3111 exp->__anon1.__anon2.string = PrintInt64(value2 ? ((op1->__anon1.i64 % value2)) : 0);
3112 if(!exp->expType)
3113 {
3114 exp->expType = op1->type;
3115 if(op1->type)
3116 op1->type->refCount++;
3117 }
3118 return 1;
3119 }
3120
3121 static unsigned int UInt64Mod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3122 {
3123 uint64 value2 = op2->__anon1.ui64;
3124
3125 exp->type = 2;
3126 exp->__anon1.__anon2.string = PrintUInt64(value2 ? ((op1->__anon1.ui64 % value2)) : 0);
3127 if(!exp->expType)
3128 {
3129 exp->expType = op1->type;
3130 if(op1->type)
3131 op1->type->refCount++;
3132 }
3133 return 1;
3134 }
3135
3136 static unsigned int ShortMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3137 {
3138 short value2 = op2->__anon1.s;
3139
3140 exp->type = 2;
3141 exp->__anon1.__anon2.string = PrintShort(value2 ? ((short)(op1->__anon1.s % value2)) : 0);
3142 if(!exp->expType)
3143 {
3144 exp->expType = op1->type;
3145 if(op1->type)
3146 op1->type->refCount++;
3147 }
3148 return 1;
3149 }
3150
3151 static unsigned int UShortMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3152 {
3153 unsigned short value2 = op2->__anon1.us;
3154
3155 exp->type = 2;
3156 exp->__anon1.__anon2.string = PrintUShort(value2 ? ((unsigned short)(op1->__anon1.us % value2)) : 0);
3157 if(!exp->expType)
3158 {
3159 exp->expType = op1->type;
3160 if(op1->type)
3161 op1->type->refCount++;
3162 }
3163 return 1;
3164 }
3165
3166 static unsigned int CharMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3167 {
3168 char value2 = op2->__anon1.c;
3169
3170 exp->type = 2;
3171 exp->__anon1.__anon2.string = PrintChar(value2 ? ((char)(op1->__anon1.c % value2)) : 0);
3172 if(!exp->expType)
3173 {
3174 exp->expType = op1->type;
3175 if(op1->type)
3176 op1->type->refCount++;
3177 }
3178 return 1;
3179 }
3180
3181 static unsigned int UCharMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3182 {
3183 unsigned char value2 = op2->__anon1.uc;
3184
3185 exp->type = 2;
3186 exp->__anon1.__anon2.string = PrintUChar(value2 ? ((unsigned char)(op1->__anon1.uc % value2)) : 0);
3187 if(!exp->expType)
3188 {
3189 exp->expType = op1->type;
3190 if(op1->type)
3191 op1->type->refCount++;
3192 }
3193 return 1;
3194 }
3195
3196 static unsigned int IntNeg(struct Expression * exp, struct Operand * op1)
3197 {
3198 exp->type = 2;
3199 exp->__anon1.__anon2.string = PrintInt((-op1->__anon1.i));
3200 if(!exp->expType)
3201 {
3202 exp->expType = op1->type;
3203 if(op1->type)
3204 op1->type->refCount++;
3205 }
3206 return 1;
3207 }
3208
3209 static unsigned int UIntNeg(struct Expression * exp, struct Operand * op1)
3210 {
3211 exp->type = 2;
3212 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(-op1->__anon1.ui));
3213 if(!exp->expType)
3214 {
3215 exp->expType = op1->type;
3216 if(op1->type)
3217 op1->type->refCount++;
3218 }
3219 return 1;
3220 }
3221
3222 static unsigned int Int64Neg(struct Expression * exp, struct Operand * op1)
3223 {
3224 exp->type = 2;
3225 exp->__anon1.__anon2.string = PrintInt64((-op1->__anon1.i64));
3226 if(!exp->expType)
3227 {
3228 exp->expType = op1->type;
3229 if(op1->type)
3230 op1->type->refCount++;
3231 }
3232 return 1;
3233 }
3234
3235 static unsigned int UInt64Neg(struct Expression * exp, struct Operand * op1)
3236 {
3237 exp->type = 2;
3238 exp->__anon1.__anon2.string = PrintUInt64((uint64)(-op1->__anon1.ui64));
3239 if(!exp->expType)
3240 {
3241 exp->expType = op1->type;
3242 if(op1->type)
3243 op1->type->refCount++;
3244 }
3245 return 1;
3246 }
3247
3248 static unsigned int ShortNeg(struct Expression * exp, struct Operand * op1)
3249 {
3250 exp->type = 2;
3251 exp->__anon1.__anon2.string = PrintShort((-op1->__anon1.s));
3252 if(!exp->expType)
3253 {
3254 exp->expType = op1->type;
3255 if(op1->type)
3256 op1->type->refCount++;
3257 }
3258 return 1;
3259 }
3260
3261 static unsigned int UShortNeg(struct Expression * exp, struct Operand * op1)
3262 {
3263 exp->type = 2;
3264 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(-op1->__anon1.us));
3265 if(!exp->expType)
3266 {
3267 exp->expType = op1->type;
3268 if(op1->type)
3269 op1->type->refCount++;
3270 }
3271 return 1;
3272 }
3273
3274 static unsigned int CharNeg(struct Expression * exp, struct Operand * op1)
3275 {
3276 exp->type = 2;
3277 exp->__anon1.__anon2.string = PrintChar((-op1->__anon1.c));
3278 if(!exp->expType)
3279 {
3280 exp->expType = op1->type;
3281 if(op1->type)
3282 op1->type->refCount++;
3283 }
3284 return 1;
3285 }
3286
3287 static unsigned int UCharNeg(struct Expression * exp, struct Operand * op1)
3288 {
3289 exp->type = 2;
3290 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(-op1->__anon1.uc));
3291 if(!exp->expType)
3292 {
3293 exp->expType = op1->type;
3294 if(op1->type)
3295 op1->type->refCount++;
3296 }
3297 return 1;
3298 }
3299
3300 static unsigned int FloatNeg(struct Expression * exp, struct Operand * op1)
3301 {
3302 exp->type = 2;
3303 exp->__anon1.__anon2.string = PrintFloat((float)(-op1->__anon1.f));
3304 if(!exp->expType)
3305 {
3306 exp->expType = op1->type;
3307 if(op1->type)
3308 op1->type->refCount++;
3309 }
3310 return 1;
3311 }
3312
3313 static unsigned int DoubleNeg(struct Expression * exp, struct Operand * op1)
3314 {
3315 exp->type = 2;
3316 exp->__anon1.__anon2.string = PrintDouble((double)(-op1->__anon1.d));
3317 if(!exp->expType)
3318 {
3319 exp->expType = op1->type;
3320 if(op1->type)
3321 op1->type->refCount++;
3322 }
3323 return 1;
3324 }
3325
3326 static unsigned int IntInc(struct Expression * exp, struct Operand * op1)
3327 {
3328 exp->type = 2;
3329 exp->__anon1.__anon2.string = PrintInt((++op1->__anon1.i));
3330 if(!exp->expType)
3331 {
3332 exp->expType = op1->type;
3333 if(op1->type)
3334 op1->type->refCount++;
3335 }
3336 return 1;
3337 }
3338
3339 static unsigned int UIntInc(struct Expression * exp, struct Operand * op1)
3340 {
3341 exp->type = 2;
3342 exp->__anon1.__anon2.string = PrintUInt((++op1->__anon1.ui));
3343 if(!exp->expType)
3344 {
3345 exp->expType = op1->type;
3346 if(op1->type)
3347 op1->type->refCount++;
3348 }
3349 return 1;
3350 }
3351
3352 static unsigned int Int64Inc(struct Expression * exp, struct Operand * op1)
3353 {
3354 exp->type = 2;
3355 exp->__anon1.__anon2.string = PrintInt64((++op1->__anon1.i64));
3356 if(!exp->expType)
3357 {
3358 exp->expType = op1->type;
3359 if(op1->type)
3360 op1->type->refCount++;
3361 }
3362 return 1;
3363 }
3364
3365 static unsigned int UInt64Inc(struct Expression * exp, struct Operand * op1)
3366 {
3367 exp->type = 2;
3368 exp->__anon1.__anon2.string = PrintUInt64((++op1->__anon1.ui64));
3369 if(!exp->expType)
3370 {
3371 exp->expType = op1->type;
3372 if(op1->type)
3373 op1->type->refCount++;
3374 }
3375 return 1;
3376 }
3377
3378 static unsigned int ShortInc(struct Expression * exp, struct Operand * op1)
3379 {
3380 exp->type = 2;
3381 exp->__anon1.__anon2.string = PrintShort((++op1->__anon1.s));
3382 if(!exp->expType)
3383 {
3384 exp->expType = op1->type;
3385 if(op1->type)
3386 op1->type->refCount++;
3387 }
3388 return 1;
3389 }
3390
3391 static unsigned int UShortInc(struct Expression * exp, struct Operand * op1)
3392 {
3393 exp->type = 2;
3394 exp->__anon1.__anon2.string = PrintUShort((++op1->__anon1.us));
3395 if(!exp->expType)
3396 {
3397 exp->expType = op1->type;
3398 if(op1->type)
3399 op1->type->refCount++;
3400 }
3401 return 1;
3402 }
3403
3404 static unsigned int CharInc(struct Expression * exp, struct Operand * op1)
3405 {
3406 exp->type = 2;
3407 exp->__anon1.__anon2.string = PrintChar((++op1->__anon1.c));
3408 if(!exp->expType)
3409 {
3410 exp->expType = op1->type;
3411 if(op1->type)
3412 op1->type->refCount++;
3413 }
3414 return 1;
3415 }
3416
3417 static unsigned int UCharInc(struct Expression * exp, struct Operand * op1)
3418 {
3419 exp->type = 2;
3420 exp->__anon1.__anon2.string = PrintUChar((++op1->__anon1.uc));
3421 if(!exp->expType)
3422 {
3423 exp->expType = op1->type;
3424 if(op1->type)
3425 op1->type->refCount++;
3426 }
3427 return 1;
3428 }
3429
3430 static unsigned int FloatInc(struct Expression * exp, struct Operand * op1)
3431 {
3432 exp->type = 2;
3433 exp->__anon1.__anon2.string = PrintFloat((float)(++op1->__anon1.f));
3434 if(!exp->expType)
3435 {
3436 exp->expType = op1->type;
3437 if(op1->type)
3438 op1->type->refCount++;
3439 }
3440 return 1;
3441 }
3442
3443 static unsigned int DoubleInc(struct Expression * exp, struct Operand * op1)
3444 {
3445 exp->type = 2;
3446 exp->__anon1.__anon2.string = PrintDouble((double)(++op1->__anon1.d));
3447 if(!exp->expType)
3448 {
3449 exp->expType = op1->type;
3450 if(op1->type)
3451 op1->type->refCount++;
3452 }
3453 return 1;
3454 }
3455
3456 static unsigned int IntDec(struct Expression * exp, struct Operand * op1)
3457 {
3458 exp->type = 2;
3459 exp->__anon1.__anon2.string = PrintInt((--op1->__anon1.i));
3460 if(!exp->expType)
3461 {
3462 exp->expType = op1->type;
3463 if(op1->type)
3464 op1->type->refCount++;
3465 }
3466 return 1;
3467 }
3468
3469 static unsigned int UIntDec(struct Expression * exp, struct Operand * op1)
3470 {
3471 exp->type = 2;
3472 exp->__anon1.__anon2.string = PrintUInt((--op1->__anon1.ui));
3473 if(!exp->expType)
3474 {
3475 exp->expType = op1->type;
3476 if(op1->type)
3477 op1->type->refCount++;
3478 }
3479 return 1;
3480 }
3481
3482 static unsigned int Int64Dec(struct Expression * exp, struct Operand * op1)
3483 {
3484 exp->type = 2;
3485 exp->__anon1.__anon2.string = PrintInt64((--op1->__anon1.i64));
3486 if(!exp->expType)
3487 {
3488 exp->expType = op1->type;
3489 if(op1->type)
3490 op1->type->refCount++;
3491 }
3492 return 1;
3493 }
3494
3495 static unsigned int UInt64Dec(struct Expression * exp, struct Operand * op1)
3496 {
3497 exp->type = 2;
3498 exp->__anon1.__anon2.string = PrintUInt64((--op1->__anon1.ui64));
3499 if(!exp->expType)
3500 {
3501 exp->expType = op1->type;
3502 if(op1->type)
3503 op1->type->refCount++;
3504 }
3505 return 1;
3506 }
3507
3508 static unsigned int ShortDec(struct Expression * exp, struct Operand * op1)
3509 {
3510 exp->type = 2;
3511 exp->__anon1.__anon2.string = PrintShort((--op1->__anon1.s));
3512 if(!exp->expType)
3513 {
3514 exp->expType = op1->type;
3515 if(op1->type)
3516 op1->type->refCount++;
3517 }
3518 return 1;
3519 }
3520
3521 static unsigned int UShortDec(struct Expression * exp, struct Operand * op1)
3522 {
3523 exp->type = 2;
3524 exp->__anon1.__anon2.string = PrintUShort((--op1->__anon1.us));
3525 if(!exp->expType)
3526 {
3527 exp->expType = op1->type;
3528 if(op1->type)
3529 op1->type->refCount++;
3530 }
3531 return 1;
3532 }
3533
3534 static unsigned int CharDec(struct Expression * exp, struct Operand * op1)
3535 {
3536 exp->type = 2;
3537 exp->__anon1.__anon2.string = PrintChar((--op1->__anon1.c));
3538 if(!exp->expType)
3539 {
3540 exp->expType = op1->type;
3541 if(op1->type)
3542 op1->type->refCount++;
3543 }
3544 return 1;
3545 }
3546
3547 static unsigned int UCharDec(struct Expression * exp, struct Operand * op1)
3548 {
3549 exp->type = 2;
3550 exp->__anon1.__anon2.string = PrintUChar((--op1->__anon1.uc));
3551 if(!exp->expType)
3552 {
3553 exp->expType = op1->type;
3554 if(op1->type)
3555 op1->type->refCount++;
3556 }
3557 return 1;
3558 }
3559
3560 static unsigned int FloatDec(struct Expression * exp, struct Operand * op1)
3561 {
3562 exp->type = 2;
3563 exp->__anon1.__anon2.string = PrintFloat((float)(--op1->__anon1.f));
3564 if(!exp->expType)
3565 {
3566 exp->expType = op1->type;
3567 if(op1->type)
3568 op1->type->refCount++;
3569 }
3570 return 1;
3571 }
3572
3573 static unsigned int DoubleDec(struct Expression * exp, struct Operand * op1)
3574 {
3575 exp->type = 2;
3576 exp->__anon1.__anon2.string = PrintDouble((double)(--op1->__anon1.d));
3577 if(!exp->expType)
3578 {
3579 exp->expType = op1->type;
3580 if(op1->type)
3581 op1->type->refCount++;
3582 }
3583 return 1;
3584 }
3585
3586 static unsigned int IntAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3587 {
3588 int value2 = op2->__anon1.i;
3589
3590 exp->type = 2;
3591 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i = value2));
3592 if(!exp->expType)
3593 {
3594 exp->expType = op1->type;
3595 if(op1->type)
3596 op1->type->refCount++;
3597 }
3598 return 1;
3599 }
3600
3601 static unsigned int UIntAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3602 {
3603 unsigned int value2 = op2->__anon1.ui;
3604
3605 exp->type = 2;
3606 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui = value2));
3607 if(!exp->expType)
3608 {
3609 exp->expType = op1->type;
3610 if(op1->type)
3611 op1->type->refCount++;
3612 }
3613 return 1;
3614 }
3615
3616 static unsigned int Int64Asign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3617 {
3618 long long value2 = op2->__anon1.i64;
3619
3620 exp->type = 2;
3621 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 = value2));
3622 if(!exp->expType)
3623 {
3624 exp->expType = op1->type;
3625 if(op1->type)
3626 op1->type->refCount++;
3627 }
3628 return 1;
3629 }
3630
3631 static unsigned int UInt64Asign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3632 {
3633 uint64 value2 = op2->__anon1.ui64;
3634
3635 exp->type = 2;
3636 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 = value2));
3637 if(!exp->expType)
3638 {
3639 exp->expType = op1->type;
3640 if(op1->type)
3641 op1->type->refCount++;
3642 }
3643 return 1;
3644 }
3645
3646 static unsigned int ShortAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3647 {
3648 short value2 = op2->__anon1.s;
3649
3650 exp->type = 2;
3651 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s = value2));
3652 if(!exp->expType)
3653 {
3654 exp->expType = op1->type;
3655 if(op1->type)
3656 op1->type->refCount++;
3657 }
3658 return 1;
3659 }
3660
3661 static unsigned int UShortAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3662 {
3663 unsigned short value2 = op2->__anon1.us;
3664
3665 exp->type = 2;
3666 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us = value2));
3667 if(!exp->expType)
3668 {
3669 exp->expType = op1->type;
3670 if(op1->type)
3671 op1->type->refCount++;
3672 }
3673 return 1;
3674 }
3675
3676 static unsigned int CharAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3677 {
3678 char value2 = op2->__anon1.c;
3679
3680 exp->type = 2;
3681 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c = value2));
3682 if(!exp->expType)
3683 {
3684 exp->expType = op1->type;
3685 if(op1->type)
3686 op1->type->refCount++;
3687 }
3688 return 1;
3689 }
3690
3691 static unsigned int UCharAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3692 {
3693 unsigned char value2 = op2->__anon1.uc;
3694
3695 exp->type = 2;
3696 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc = value2));
3697 if(!exp->expType)
3698 {
3699 exp->expType = op1->type;
3700 if(op1->type)
3701 op1->type->refCount++;
3702 }
3703 return 1;
3704 }
3705
3706 static unsigned int FloatAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3707 {
3708 float value2 = op2->__anon1.f;
3709
3710 exp->type = 2;
3711 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f = value2));
3712 if(!exp->expType)
3713 {
3714 exp->expType = op1->type;
3715 if(op1->type)
3716 op1->type->refCount++;
3717 }
3718 return 1;
3719 }
3720
3721 static unsigned int DoubleAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3722 {
3723 double value2 = op2->__anon1.d;
3724
3725 exp->type = 2;
3726 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d = value2));
3727 if(!exp->expType)
3728 {
3729 exp->expType = op1->type;
3730 if(op1->type)
3731 op1->type->refCount++;
3732 }
3733 return 1;
3734 }
3735
3736 static unsigned int IntAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3737 {
3738 int value2 = op2->__anon1.i;
3739
3740 exp->type = 2;
3741 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i += value2));
3742 if(!exp->expType)
3743 {
3744 exp->expType = op1->type;
3745 if(op1->type)
3746 op1->type->refCount++;
3747 }
3748 return 1;
3749 }
3750
3751 static unsigned int UIntAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3752 {
3753 unsigned int value2 = op2->__anon1.ui;
3754
3755 exp->type = 2;
3756 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui += value2));
3757 if(!exp->expType)
3758 {
3759 exp->expType = op1->type;
3760 if(op1->type)
3761 op1->type->refCount++;
3762 }
3763 return 1;
3764 }
3765
3766 static unsigned int Int64AddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3767 {
3768 long long value2 = op2->__anon1.i64;
3769
3770 exp->type = 2;
3771 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 += value2));
3772 if(!exp->expType)
3773 {
3774 exp->expType = op1->type;
3775 if(op1->type)
3776 op1->type->refCount++;
3777 }
3778 return 1;
3779 }
3780
3781 static unsigned int UInt64AddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3782 {
3783 uint64 value2 = op2->__anon1.ui64;
3784
3785 exp->type = 2;
3786 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 += value2));
3787 if(!exp->expType)
3788 {
3789 exp->expType = op1->type;
3790 if(op1->type)
3791 op1->type->refCount++;
3792 }
3793 return 1;
3794 }
3795
3796 static unsigned int ShortAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3797 {
3798 short value2 = op2->__anon1.s;
3799
3800 exp->type = 2;
3801 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s += value2));
3802 if(!exp->expType)
3803 {
3804 exp->expType = op1->type;
3805 if(op1->type)
3806 op1->type->refCount++;
3807 }
3808 return 1;
3809 }
3810
3811 static unsigned int UShortAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3812 {
3813 unsigned short value2 = op2->__anon1.us;
3814
3815 exp->type = 2;
3816 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us += value2));
3817 if(!exp->expType)
3818 {
3819 exp->expType = op1->type;
3820 if(op1->type)
3821 op1->type->refCount++;
3822 }
3823 return 1;
3824 }
3825
3826 static unsigned int CharAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3827 {
3828 char value2 = op2->__anon1.c;
3829
3830 exp->type = 2;
3831 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c += value2));
3832 if(!exp->expType)
3833 {
3834 exp->expType = op1->type;
3835 if(op1->type)
3836 op1->type->refCount++;
3837 }
3838 return 1;
3839 }
3840
3841 static unsigned int UCharAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3842 {
3843 unsigned char value2 = op2->__anon1.uc;
3844
3845 exp->type = 2;
3846 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc += value2));
3847 if(!exp->expType)
3848 {
3849 exp->expType = op1->type;
3850 if(op1->type)
3851 op1->type->refCount++;
3852 }
3853 return 1;
3854 }
3855
3856 static unsigned int FloatAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3857 {
3858 float value2 = op2->__anon1.f;
3859
3860 exp->type = 2;
3861 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f += value2));
3862 if(!exp->expType)
3863 {
3864 exp->expType = op1->type;
3865 if(op1->type)
3866 op1->type->refCount++;
3867 }
3868 return 1;
3869 }
3870
3871 static unsigned int DoubleAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3872 {
3873 double value2 = op2->__anon1.d;
3874
3875 exp->type = 2;
3876 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d += value2));
3877 if(!exp->expType)
3878 {
3879 exp->expType = op1->type;
3880 if(op1->type)
3881 op1->type->refCount++;
3882 }
3883 return 1;
3884 }
3885
3886 static unsigned int IntSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3887 {
3888 int value2 = op2->__anon1.i;
3889
3890 exp->type = 2;
3891 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i -= value2));
3892 if(!exp->expType)
3893 {
3894 exp->expType = op1->type;
3895 if(op1->type)
3896 op1->type->refCount++;
3897 }
3898 return 1;
3899 }
3900
3901 static unsigned int UIntSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3902 {
3903 unsigned int value2 = op2->__anon1.ui;
3904
3905 exp->type = 2;
3906 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui -= value2));
3907 if(!exp->expType)
3908 {
3909 exp->expType = op1->type;
3910 if(op1->type)
3911 op1->type->refCount++;
3912 }
3913 return 1;
3914 }
3915
3916 static unsigned int Int64SubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3917 {
3918 long long value2 = op2->__anon1.i64;
3919
3920 exp->type = 2;
3921 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 -= value2));
3922 if(!exp->expType)
3923 {
3924 exp->expType = op1->type;
3925 if(op1->type)
3926 op1->type->refCount++;
3927 }
3928 return 1;
3929 }
3930
3931 static unsigned int UInt64SubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3932 {
3933 uint64 value2 = op2->__anon1.ui64;
3934
3935 exp->type = 2;
3936 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 -= value2));
3937 if(!exp->expType)
3938 {
3939 exp->expType = op1->type;
3940 if(op1->type)
3941 op1->type->refCount++;
3942 }
3943 return 1;
3944 }
3945
3946 static unsigned int ShortSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3947 {
3948 short value2 = op2->__anon1.s;
3949
3950 exp->type = 2;
3951 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s -= value2));
3952 if(!exp->expType)
3953 {
3954 exp->expType = op1->type;
3955 if(op1->type)
3956 op1->type->refCount++;
3957 }
3958 return 1;
3959 }
3960
3961 static unsigned int UShortSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3962 {
3963 unsigned short value2 = op2->__anon1.us;
3964
3965 exp->type = 2;
3966 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us -= value2));
3967 if(!exp->expType)
3968 {
3969 exp->expType = op1->type;
3970 if(op1->type)
3971 op1->type->refCount++;
3972 }
3973 return 1;
3974 }
3975
3976 static unsigned int CharSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3977 {
3978 char value2 = op2->__anon1.c;
3979
3980 exp->type = 2;
3981 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c -= value2));
3982 if(!exp->expType)
3983 {
3984 exp->expType = op1->type;
3985 if(op1->type)
3986 op1->type->refCount++;
3987 }
3988 return 1;
3989 }
3990
3991 static unsigned int UCharSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3992 {
3993 unsigned char value2 = op2->__anon1.uc;
3994
3995 exp->type = 2;
3996 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc -= value2));
3997 if(!exp->expType)
3998 {
3999 exp->expType = op1->type;
4000 if(op1->type)
4001 op1->type->refCount++;
4002 }
4003 return 1;
4004 }
4005
4006 static unsigned int FloatSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4007 {
4008 float value2 = op2->__anon1.f;
4009
4010 exp->type = 2;
4011 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f -= value2));
4012 if(!exp->expType)
4013 {
4014 exp->expType = op1->type;
4015 if(op1->type)
4016 op1->type->refCount++;
4017 }
4018 return 1;
4019 }
4020
4021 static unsigned int DoubleSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4022 {
4023 double value2 = op2->__anon1.d;
4024
4025 exp->type = 2;
4026 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d -= value2));
4027 if(!exp->expType)
4028 {
4029 exp->expType = op1->type;
4030 if(op1->type)
4031 op1->type->refCount++;
4032 }
4033 return 1;
4034 }
4035
4036 static unsigned int IntMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4037 {
4038 int value2 = op2->__anon1.i;
4039
4040 exp->type = 2;
4041 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i *= value2));
4042 if(!exp->expType)
4043 {
4044 exp->expType = op1->type;
4045 if(op1->type)
4046 op1->type->refCount++;
4047 }
4048 return 1;
4049 }
4050
4051 static unsigned int UIntMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4052 {
4053 unsigned int value2 = op2->__anon1.ui;
4054
4055 exp->type = 2;
4056 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui *= value2));
4057 if(!exp->expType)
4058 {
4059 exp->expType = op1->type;
4060 if(op1->type)
4061 op1->type->refCount++;
4062 }
4063 return 1;
4064 }
4065
4066 static unsigned int Int64MulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4067 {
4068 long long value2 = op2->__anon1.i64;
4069
4070 exp->type = 2;
4071 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 *= value2));
4072 if(!exp->expType)
4073 {
4074 exp->expType = op1->type;
4075 if(op1->type)
4076 op1->type->refCount++;
4077 }
4078 return 1;
4079 }
4080
4081 static unsigned int UInt64MulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4082 {
4083 uint64 value2 = op2->__anon1.ui64;
4084
4085 exp->type = 2;
4086 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 *= value2));
4087 if(!exp->expType)
4088 {
4089 exp->expType = op1->type;
4090 if(op1->type)
4091 op1->type->refCount++;
4092 }
4093 return 1;
4094 }
4095
4096 static unsigned int ShortMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4097 {
4098 short value2 = op2->__anon1.s;
4099
4100 exp->type = 2;
4101 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s *= value2));
4102 if(!exp->expType)
4103 {
4104 exp->expType = op1->type;
4105 if(op1->type)
4106 op1->type->refCount++;
4107 }
4108 return 1;
4109 }
4110
4111 static unsigned int UShortMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4112 {
4113 unsigned short value2 = op2->__anon1.us;
4114
4115 exp->type = 2;
4116 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us *= value2));
4117 if(!exp->expType)
4118 {
4119 exp->expType = op1->type;
4120 if(op1->type)
4121 op1->type->refCount++;
4122 }
4123 return 1;
4124 }
4125
4126 static unsigned int CharMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4127 {
4128 char value2 = op2->__anon1.c;
4129
4130 exp->type = 2;
4131 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c *= value2));
4132 if(!exp->expType)
4133 {
4134 exp->expType = op1->type;
4135 if(op1->type)
4136 op1->type->refCount++;
4137 }
4138 return 1;
4139 }
4140
4141 static unsigned int UCharMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4142 {
4143 unsigned char value2 = op2->__anon1.uc;
4144
4145 exp->type = 2;
4146 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc *= value2));
4147 if(!exp->expType)
4148 {
4149 exp->expType = op1->type;
4150 if(op1->type)
4151 op1->type->refCount++;
4152 }
4153 return 1;
4154 }
4155
4156 static unsigned int FloatMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4157 {
4158 float value2 = op2->__anon1.f;
4159
4160 exp->type = 2;
4161 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f *= value2));
4162 if(!exp->expType)
4163 {
4164 exp->expType = op1->type;
4165 if(op1->type)
4166 op1->type->refCount++;
4167 }
4168 return 1;
4169 }
4170
4171 static unsigned int DoubleMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4172 {
4173 double value2 = op2->__anon1.d;
4174
4175 exp->type = 2;
4176 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d *= value2));
4177 if(!exp->expType)
4178 {
4179 exp->expType = op1->type;
4180 if(op1->type)
4181 op1->type->refCount++;
4182 }
4183 return 1;
4184 }
4185
4186 static unsigned int IntDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4187 {
4188 int value2 = op2->__anon1.i;
4189
4190 exp->type = 2;
4191 exp->__anon1.__anon2.string = PrintInt(value2 ? ((op1->__anon1.i /= value2)) : 0);
4192 if(!exp->expType)
4193 {
4194 exp->expType = op1->type;
4195 if(op1->type)
4196 op1->type->refCount++;
4197 }
4198 return 1;
4199 }
4200
4201 static unsigned int UIntDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4202 {
4203 unsigned int value2 = op2->__anon1.ui;
4204
4205 exp->type = 2;
4206 exp->__anon1.__anon2.string = PrintUInt(value2 ? ((op1->__anon1.ui /= value2)) : 0);
4207 if(!exp->expType)
4208 {
4209 exp->expType = op1->type;
4210 if(op1->type)
4211 op1->type->refCount++;
4212 }
4213 return 1;
4214 }
4215
4216 static unsigned int Int64DivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4217 {
4218 long long value2 = op2->__anon1.i64;
4219
4220 exp->type = 2;
4221 exp->__anon1.__anon2.string = PrintInt64(value2 ? ((op1->__anon1.i64 /= value2)) : 0);
4222 if(!exp->expType)
4223 {
4224 exp->expType = op1->type;
4225 if(op1->type)
4226 op1->type->refCount++;
4227 }
4228 return 1;
4229 }
4230
4231 static unsigned int UInt64DivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4232 {
4233 uint64 value2 = op2->__anon1.ui64;
4234
4235 exp->type = 2;
4236 exp->__anon1.__anon2.string = PrintUInt64(value2 ? ((op1->__anon1.ui64 /= value2)) : 0);
4237 if(!exp->expType)
4238 {
4239 exp->expType = op1->type;
4240 if(op1->type)
4241 op1->type->refCount++;
4242 }
4243 return 1;
4244 }
4245
4246 static unsigned int ShortDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4247 {
4248 short value2 = op2->__anon1.s;
4249
4250 exp->type = 2;
4251 exp->__anon1.__anon2.string = PrintShort(value2 ? ((op1->__anon1.s /= value2)) : 0);
4252 if(!exp->expType)
4253 {
4254 exp->expType = op1->type;
4255 if(op1->type)
4256 op1->type->refCount++;
4257 }
4258 return 1;
4259 }
4260
4261 static unsigned int UShortDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4262 {
4263 unsigned short value2 = op2->__anon1.us;
4264
4265 exp->type = 2;
4266 exp->__anon1.__anon2.string = PrintUShort(value2 ? ((op1->__anon1.us /= value2)) : 0);
4267 if(!exp->expType)
4268 {
4269 exp->expType = op1->type;
4270 if(op1->type)
4271 op1->type->refCount++;
4272 }
4273 return 1;
4274 }
4275
4276 static unsigned int CharDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4277 {
4278 char value2 = op2->__anon1.c;
4279
4280 exp->type = 2;
4281 exp->__anon1.__anon2.string = PrintChar(value2 ? ((op1->__anon1.c /= value2)) : 0);
4282 if(!exp->expType)
4283 {
4284 exp->expType = op1->type;
4285 if(op1->type)
4286 op1->type->refCount++;
4287 }
4288 return 1;
4289 }
4290
4291 static unsigned int UCharDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4292 {
4293 unsigned char value2 = op2->__anon1.uc;
4294
4295 exp->type = 2;
4296 exp->__anon1.__anon2.string = PrintUChar(value2 ? ((op1->__anon1.uc /= value2)) : 0);
4297 if(!exp->expType)
4298 {
4299 exp->expType = op1->type;
4300 if(op1->type)
4301 op1->type->refCount++;
4302 }
4303 return 1;
4304 }
4305
4306 static unsigned int FloatDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4307 {
4308 float value2 = op2->__anon1.f;
4309
4310 exp->type = 2;
4311 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f /= value2));
4312 if(!exp->expType)
4313 {
4314 exp->expType = op1->type;
4315 if(op1->type)
4316 op1->type->refCount++;
4317 }
4318 return 1;
4319 }
4320
4321 static unsigned int DoubleDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4322 {
4323 double value2 = op2->__anon1.d;
4324
4325 exp->type = 2;
4326 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d /= value2));
4327 if(!exp->expType)
4328 {
4329 exp->expType = op1->type;
4330 if(op1->type)
4331 op1->type->refCount++;
4332 }
4333 return 1;
4334 }
4335
4336 static unsigned int IntModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4337 {
4338 int value2 = op2->__anon1.i;
4339
4340 exp->type = 2;
4341 exp->__anon1.__anon2.string = PrintInt(value2 ? ((op1->__anon1.i %= value2)) : 0);
4342 if(!exp->expType)
4343 {
4344 exp->expType = op1->type;
4345 if(op1->type)
4346 op1->type->refCount++;
4347 }
4348 return 1;
4349 }
4350
4351 static unsigned int UIntModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4352 {
4353 unsigned int value2 = op2->__anon1.ui;
4354
4355 exp->type = 2;
4356 exp->__anon1.__anon2.string = PrintUInt(value2 ? ((op1->__anon1.ui %= value2)) : 0);
4357 if(!exp->expType)
4358 {
4359 exp->expType = op1->type;
4360 if(op1->type)
4361 op1->type->refCount++;
4362 }
4363 return 1;
4364 }
4365
4366 static unsigned int Int64ModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4367 {
4368 long long value2 = op2->__anon1.i64;
4369
4370 exp->type = 2;
4371 exp->__anon1.__anon2.string = PrintInt64(value2 ? ((op1->__anon1.i64 %= value2)) : 0);
4372 if(!exp->expType)
4373 {
4374 exp->expType = op1->type;
4375 if(op1->type)
4376 op1->type->refCount++;
4377 }
4378 return 1;
4379 }
4380
4381 static unsigned int UInt64ModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4382 {
4383 uint64 value2 = op2->__anon1.ui64;
4384
4385 exp->type = 2;
4386 exp->__anon1.__anon2.string = PrintUInt64(value2 ? ((op1->__anon1.ui64 %= value2)) : 0);
4387 if(!exp->expType)
4388 {
4389 exp->expType = op1->type;
4390 if(op1->type)
4391 op1->type->refCount++;
4392 }
4393 return 1;
4394 }
4395
4396 static unsigned int ShortModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4397 {
4398 short value2 = op2->__anon1.s;
4399
4400 exp->type = 2;
4401 exp->__anon1.__anon2.string = PrintShort(value2 ? ((op1->__anon1.s %= value2)) : 0);
4402 if(!exp->expType)
4403 {
4404 exp->expType = op1->type;
4405 if(op1->type)
4406 op1->type->refCount++;
4407 }
4408 return 1;
4409 }
4410
4411 static unsigned int UShortModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4412 {
4413 unsigned short value2 = op2->__anon1.us;
4414
4415 exp->type = 2;
4416 exp->__anon1.__anon2.string = PrintUShort(value2 ? ((op1->__anon1.us %= value2)) : 0);
4417 if(!exp->expType)
4418 {
4419 exp->expType = op1->type;
4420 if(op1->type)
4421 op1->type->refCount++;
4422 }
4423 return 1;
4424 }
4425
4426 static unsigned int CharModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4427 {
4428 char value2 = op2->__anon1.c;
4429
4430 exp->type = 2;
4431 exp->__anon1.__anon2.string = PrintChar(value2 ? ((op1->__anon1.c %= value2)) : 0);
4432 if(!exp->expType)
4433 {
4434 exp->expType = op1->type;
4435 if(op1->type)
4436 op1->type->refCount++;
4437 }
4438 return 1;
4439 }
4440
4441 static unsigned int UCharModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4442 {
4443 unsigned char value2 = op2->__anon1.uc;
4444
4445 exp->type = 2;
4446 exp->__anon1.__anon2.string = PrintUChar(value2 ? ((op1->__anon1.uc %= value2)) : 0);
4447 if(!exp->expType)
4448 {
4449 exp->expType = op1->type;
4450 if(op1->type)
4451 op1->type->refCount++;
4452 }
4453 return 1;
4454 }
4455
4456 static unsigned int IntBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4457 {
4458 int value2 = op2->__anon1.i;
4459
4460 exp->type = 2;
4461 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i & value2));
4462 if(!exp->expType)
4463 {
4464 exp->expType = op1->type;
4465 if(op1->type)
4466 op1->type->refCount++;
4467 }
4468 return 1;
4469 }
4470
4471 static unsigned int UIntBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4472 {
4473 unsigned int value2 = op2->__anon1.ui;
4474
4475 exp->type = 2;
4476 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui & value2));
4477 if(!exp->expType)
4478 {
4479 exp->expType = op1->type;
4480 if(op1->type)
4481 op1->type->refCount++;
4482 }
4483 return 1;
4484 }
4485
4486 static unsigned int Int64BitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4487 {
4488 long long value2 = op2->__anon1.i64;
4489
4490 exp->type = 2;
4491 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 & value2));
4492 if(!exp->expType)
4493 {
4494 exp->expType = op1->type;
4495 if(op1->type)
4496 op1->type->refCount++;
4497 }
4498 return 1;
4499 }
4500
4501 static unsigned int UInt64BitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4502 {
4503 uint64 value2 = op2->__anon1.ui64;
4504
4505 exp->type = 2;
4506 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 & value2));
4507 if(!exp->expType)
4508 {
4509 exp->expType = op1->type;
4510 if(op1->type)
4511 op1->type->refCount++;
4512 }
4513 return 1;
4514 }
4515
4516 static unsigned int ShortBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4517 {
4518 short value2 = op2->__anon1.s;
4519
4520 exp->type = 2;
4521 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s & value2));
4522 if(!exp->expType)
4523 {
4524 exp->expType = op1->type;
4525 if(op1->type)
4526 op1->type->refCount++;
4527 }
4528 return 1;
4529 }
4530
4531 static unsigned int UShortBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4532 {
4533 unsigned short value2 = op2->__anon1.us;
4534
4535 exp->type = 2;
4536 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us & value2));
4537 if(!exp->expType)
4538 {
4539 exp->expType = op1->type;
4540 if(op1->type)
4541 op1->type->refCount++;
4542 }
4543 return 1;
4544 }
4545
4546 static unsigned int CharBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4547 {
4548 char value2 = op2->__anon1.c;
4549
4550 exp->type = 2;
4551 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c & value2));
4552 if(!exp->expType)
4553 {
4554 exp->expType = op1->type;
4555 if(op1->type)
4556 op1->type->refCount++;
4557 }
4558 return 1;
4559 }
4560
4561 static unsigned int UCharBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4562 {
4563 unsigned char value2 = op2->__anon1.uc;
4564
4565 exp->type = 2;
4566 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc & value2));
4567 if(!exp->expType)
4568 {
4569 exp->expType = op1->type;
4570 if(op1->type)
4571 op1->type->refCount++;
4572 }
4573 return 1;
4574 }
4575
4576 static unsigned int IntBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4577 {
4578 int value2 = op2->__anon1.i;
4579
4580 exp->type = 2;
4581 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i | value2));
4582 if(!exp->expType)
4583 {
4584 exp->expType = op1->type;
4585 if(op1->type)
4586 op1->type->refCount++;
4587 }
4588 return 1;
4589 }
4590
4591 static unsigned int UIntBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4592 {
4593 unsigned int value2 = op2->__anon1.ui;
4594
4595 exp->type = 2;
4596 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui | value2));
4597 if(!exp->expType)
4598 {
4599 exp->expType = op1->type;
4600 if(op1->type)
4601 op1->type->refCount++;
4602 }
4603 return 1;
4604 }
4605
4606 static unsigned int Int64BitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4607 {
4608 long long value2 = op2->__anon1.i64;
4609
4610 exp->type = 2;
4611 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 | value2));
4612 if(!exp->expType)
4613 {
4614 exp->expType = op1->type;
4615 if(op1->type)
4616 op1->type->refCount++;
4617 }
4618 return 1;
4619 }
4620
4621 static unsigned int UInt64BitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4622 {
4623 uint64 value2 = op2->__anon1.ui64;
4624
4625 exp->type = 2;
4626 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 | value2));
4627 if(!exp->expType)
4628 {
4629 exp->expType = op1->type;
4630 if(op1->type)
4631 op1->type->refCount++;
4632 }
4633 return 1;
4634 }
4635
4636 static unsigned int ShortBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4637 {
4638 short value2 = op2->__anon1.s;
4639
4640 exp->type = 2;
4641 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s | value2));
4642 if(!exp->expType)
4643 {
4644 exp->expType = op1->type;
4645 if(op1->type)
4646 op1->type->refCount++;
4647 }
4648 return 1;
4649 }
4650
4651 static unsigned int UShortBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4652 {
4653 unsigned short value2 = op2->__anon1.us;
4654
4655 exp->type = 2;
4656 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us | value2));
4657 if(!exp->expType)
4658 {
4659 exp->expType = op1->type;
4660 if(op1->type)
4661 op1->type->refCount++;
4662 }
4663 return 1;
4664 }
4665
4666 static unsigned int CharBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4667 {
4668 char value2 = op2->__anon1.c;
4669
4670 exp->type = 2;
4671 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c | value2));
4672 if(!exp->expType)
4673 {
4674 exp->expType = op1->type;
4675 if(op1->type)
4676 op1->type->refCount++;
4677 }
4678 return 1;
4679 }
4680
4681 static unsigned int UCharBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4682 {
4683 unsigned char value2 = op2->__anon1.uc;
4684
4685 exp->type = 2;
4686 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc | value2));
4687 if(!exp->expType)
4688 {
4689 exp->expType = op1->type;
4690 if(op1->type)
4691 op1->type->refCount++;
4692 }
4693 return 1;
4694 }
4695
4696 static unsigned int IntBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4697 {
4698 int value2 = op2->__anon1.i;
4699
4700 exp->type = 2;
4701 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i ^ value2));
4702 if(!exp->expType)
4703 {
4704 exp->expType = op1->type;
4705 if(op1->type)
4706 op1->type->refCount++;
4707 }
4708 return 1;
4709 }
4710
4711 static unsigned int UIntBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4712 {
4713 unsigned int value2 = op2->__anon1.ui;
4714
4715 exp->type = 2;
4716 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui ^ value2));
4717 if(!exp->expType)
4718 {
4719 exp->expType = op1->type;
4720 if(op1->type)
4721 op1->type->refCount++;
4722 }
4723 return 1;
4724 }
4725
4726 static unsigned int Int64BitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4727 {
4728 long long value2 = op2->__anon1.i64;
4729
4730 exp->type = 2;
4731 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 ^ value2));
4732 if(!exp->expType)
4733 {
4734 exp->expType = op1->type;
4735 if(op1->type)
4736 op1->type->refCount++;
4737 }
4738 return 1;
4739 }
4740
4741 static unsigned int UInt64BitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4742 {
4743 uint64 value2 = op2->__anon1.ui64;
4744
4745 exp->type = 2;
4746 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 ^ value2));
4747 if(!exp->expType)
4748 {
4749 exp->expType = op1->type;
4750 if(op1->type)
4751 op1->type->refCount++;
4752 }
4753 return 1;
4754 }
4755
4756 static unsigned int ShortBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4757 {
4758 short value2 = op2->__anon1.s;
4759
4760 exp->type = 2;
4761 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s ^ value2));
4762 if(!exp->expType)
4763 {
4764 exp->expType = op1->type;
4765 if(op1->type)
4766 op1->type->refCount++;
4767 }
4768 return 1;
4769 }
4770
4771 static unsigned int UShortBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4772 {
4773 unsigned short value2 = op2->__anon1.us;
4774
4775 exp->type = 2;
4776 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us ^ value2));
4777 if(!exp->expType)
4778 {
4779 exp->expType = op1->type;
4780 if(op1->type)
4781 op1->type->refCount++;
4782 }
4783 return 1;
4784 }
4785
4786 static unsigned int CharBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4787 {
4788 char value2 = op2->__anon1.c;
4789
4790 exp->type = 2;
4791 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c ^ value2));
4792 if(!exp->expType)
4793 {
4794 exp->expType = op1->type;
4795 if(op1->type)
4796 op1->type->refCount++;
4797 }
4798 return 1;
4799 }
4800
4801 static unsigned int UCharBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4802 {
4803 unsigned char value2 = op2->__anon1.uc;
4804
4805 exp->type = 2;
4806 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc ^ value2));
4807 if(!exp->expType)
4808 {
4809 exp->expType = op1->type;
4810 if(op1->type)
4811 op1->type->refCount++;
4812 }
4813 return 1;
4814 }
4815
4816 static unsigned int IntLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4817 {
4818 int value2 = op2->__anon1.i;
4819
4820 exp->type = 2;
4821 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i << value2));
4822 if(!exp->expType)
4823 {
4824 exp->expType = op1->type;
4825 if(op1->type)
4826 op1->type->refCount++;
4827 }
4828 return 1;
4829 }
4830
4831 static unsigned int UIntLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4832 {
4833 unsigned int value2 = op2->__anon1.ui;
4834
4835 exp->type = 2;
4836 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui << value2));
4837 if(!exp->expType)
4838 {
4839 exp->expType = op1->type;
4840 if(op1->type)
4841 op1->type->refCount++;
4842 }
4843 return 1;
4844 }
4845
4846 static unsigned int Int64LShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4847 {
4848 long long value2 = op2->__anon1.i64;
4849
4850 exp->type = 2;
4851 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 << value2));
4852 if(!exp->expType)
4853 {
4854 exp->expType = op1->type;
4855 if(op1->type)
4856 op1->type->refCount++;
4857 }
4858 return 1;
4859 }
4860
4861 static unsigned int UInt64LShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4862 {
4863 uint64 value2 = op2->__anon1.ui64;
4864
4865 exp->type = 2;
4866 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 << value2));
4867 if(!exp->expType)
4868 {
4869 exp->expType = op1->type;
4870 if(op1->type)
4871 op1->type->refCount++;
4872 }
4873 return 1;
4874 }
4875
4876 static unsigned int ShortLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4877 {
4878 short value2 = op2->__anon1.s;
4879
4880 exp->type = 2;
4881 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s << value2));
4882 if(!exp->expType)
4883 {
4884 exp->expType = op1->type;
4885 if(op1->type)
4886 op1->type->refCount++;
4887 }
4888 return 1;
4889 }
4890
4891 static unsigned int UShortLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4892 {
4893 unsigned short value2 = op2->__anon1.us;
4894
4895 exp->type = 2;
4896 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us << value2));
4897 if(!exp->expType)
4898 {
4899 exp->expType = op1->type;
4900 if(op1->type)
4901 op1->type->refCount++;
4902 }
4903 return 1;
4904 }
4905
4906 static unsigned int CharLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4907 {
4908 char value2 = op2->__anon1.c;
4909
4910 exp->type = 2;
4911 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c << value2));
4912 if(!exp->expType)
4913 {
4914 exp->expType = op1->type;
4915 if(op1->type)
4916 op1->type->refCount++;
4917 }
4918 return 1;
4919 }
4920
4921 static unsigned int UCharLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4922 {
4923 unsigned char value2 = op2->__anon1.uc;
4924
4925 exp->type = 2;
4926 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc << value2));
4927 if(!exp->expType)
4928 {
4929 exp->expType = op1->type;
4930 if(op1->type)
4931 op1->type->refCount++;
4932 }
4933 return 1;
4934 }
4935
4936 static unsigned int IntRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4937 {
4938 int value2 = op2->__anon1.i;
4939
4940 exp->type = 2;
4941 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i >> value2));
4942 if(!exp->expType)
4943 {
4944 exp->expType = op1->type;
4945 if(op1->type)
4946 op1->type->refCount++;
4947 }
4948 return 1;
4949 }
4950
4951 static unsigned int UIntRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4952 {
4953 unsigned int value2 = op2->__anon1.ui;
4954
4955 exp->type = 2;
4956 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui >> value2));
4957 if(!exp->expType)
4958 {
4959 exp->expType = op1->type;
4960 if(op1->type)
4961 op1->type->refCount++;
4962 }
4963 return 1;
4964 }
4965
4966 static unsigned int Int64RShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4967 {
4968 long long value2 = op2->__anon1.i64;
4969
4970 exp->type = 2;
4971 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 >> value2));
4972 if(!exp->expType)
4973 {
4974 exp->expType = op1->type;
4975 if(op1->type)
4976 op1->type->refCount++;
4977 }
4978 return 1;
4979 }
4980
4981 static unsigned int UInt64RShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4982 {
4983 uint64 value2 = op2->__anon1.ui64;
4984
4985 exp->type = 2;
4986 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 >> value2));
4987 if(!exp->expType)
4988 {
4989 exp->expType = op1->type;
4990 if(op1->type)
4991 op1->type->refCount++;
4992 }
4993 return 1;
4994 }
4995
4996 static unsigned int ShortRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4997 {
4998 short value2 = op2->__anon1.s;
4999
5000 exp->type = 2;
5001 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s >> value2));
5002 if(!exp->expType)
5003 {
5004 exp->expType = op1->type;
5005 if(op1->type)
5006 op1->type->refCount++;
5007 }
5008 return 1;
5009 }
5010
5011 static unsigned int UShortRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5012 {
5013 unsigned short value2 = op2->__anon1.us;
5014
5015 exp->type = 2;
5016 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us >> value2));
5017 if(!exp->expType)
5018 {
5019 exp->expType = op1->type;
5020 if(op1->type)
5021 op1->type->refCount++;
5022 }
5023 return 1;
5024 }
5025
5026 static unsigned int CharRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5027 {
5028 char value2 = op2->__anon1.c;
5029
5030 exp->type = 2;
5031 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c >> value2));
5032 if(!exp->expType)
5033 {
5034 exp->expType = op1->type;
5035 if(op1->type)
5036 op1->type->refCount++;
5037 }
5038 return 1;
5039 }
5040
5041 static unsigned int UCharRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5042 {
5043 unsigned char value2 = op2->__anon1.uc;
5044
5045 exp->type = 2;
5046 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc >> value2));
5047 if(!exp->expType)
5048 {
5049 exp->expType = op1->type;
5050 if(op1->type)
5051 op1->type->refCount++;
5052 }
5053 return 1;
5054 }
5055
5056 static unsigned int IntBitNot(struct Expression * exp, struct Operand * op1)
5057 {
5058 exp->type = 2;
5059 exp->__anon1.__anon2.string = PrintInt((~op1->__anon1.i));
5060 if(!exp->expType)
5061 {
5062 exp->expType = op1->type;
5063 if(op1->type)
5064 op1->type->refCount++;
5065 }
5066 return 1;
5067 }
5068
5069 static unsigned int UIntBitNot(struct Expression * exp, struct Operand * op1)
5070 {
5071 exp->type = 2;
5072 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(~op1->__anon1.ui));
5073 if(!exp->expType)
5074 {
5075 exp->expType = op1->type;
5076 if(op1->type)
5077 op1->type->refCount++;
5078 }
5079 return 1;
5080 }
5081
5082 static unsigned int Int64BitNot(struct Expression * exp, struct Operand * op1)
5083 {
5084 exp->type = 2;
5085 exp->__anon1.__anon2.string = PrintInt64((long long)(~op1->__anon1.i64));
5086 if(!exp->expType)
5087 {
5088 exp->expType = op1->type;
5089 if(op1->type)
5090 op1->type->refCount++;
5091 }
5092 return 1;
5093 }
5094
5095 static unsigned int UInt64BitNot(struct Expression * exp, struct Operand * op1)
5096 {
5097 exp->type = 2;
5098 exp->__anon1.__anon2.string = PrintUInt64((uint64)(~op1->__anon1.ui64));
5099 if(!exp->expType)
5100 {
5101 exp->expType = op1->type;
5102 if(op1->type)
5103 op1->type->refCount++;
5104 }
5105 return 1;
5106 }
5107
5108 static unsigned int ShortBitNot(struct Expression * exp, struct Operand * op1)
5109 {
5110 exp->type = 2;
5111 exp->__anon1.__anon2.string = PrintShort((short)(~op1->__anon1.s));
5112 if(!exp->expType)
5113 {
5114 exp->expType = op1->type;
5115 if(op1->type)
5116 op1->type->refCount++;
5117 }
5118 return 1;
5119 }
5120
5121 static unsigned int UShortBitNot(struct Expression * exp, struct Operand * op1)
5122 {
5123 exp->type = 2;
5124 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(~op1->__anon1.us));
5125 if(!exp->expType)
5126 {
5127 exp->expType = op1->type;
5128 if(op1->type)
5129 op1->type->refCount++;
5130 }
5131 return 1;
5132 }
5133
5134 static unsigned int CharBitNot(struct Expression * exp, struct Operand * op1)
5135 {
5136 exp->type = 2;
5137 exp->__anon1.__anon2.string = PrintChar((char)(~op1->__anon1.c));
5138 if(!exp->expType)
5139 {
5140 exp->expType = op1->type;
5141 if(op1->type)
5142 op1->type->refCount++;
5143 }
5144 return 1;
5145 }
5146
5147 static unsigned int UCharBitNot(struct Expression * exp, struct Operand * op1)
5148 {
5149 exp->type = 2;
5150 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(~op1->__anon1.uc));
5151 if(!exp->expType)
5152 {
5153 exp->expType = op1->type;
5154 if(op1->type)
5155 op1->type->refCount++;
5156 }
5157 return 1;
5158 }
5159
5160 static unsigned int IntAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5161 {
5162 int value2 = op2->__anon1.i;
5163
5164 exp->type = 2;
5165 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i &= value2));
5166 if(!exp->expType)
5167 {
5168 exp->expType = op1->type;
5169 if(op1->type)
5170 op1->type->refCount++;
5171 }
5172 return 1;
5173 }
5174
5175 static unsigned int UIntAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5176 {
5177 unsigned int value2 = op2->__anon1.ui;
5178
5179 exp->type = 2;
5180 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui &= value2));
5181 if(!exp->expType)
5182 {
5183 exp->expType = op1->type;
5184 if(op1->type)
5185 op1->type->refCount++;
5186 }
5187 return 1;
5188 }
5189
5190 static unsigned int Int64AndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5191 {
5192 long long value2 = op2->__anon1.i64;
5193
5194 exp->type = 2;
5195 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 &= value2));
5196 if(!exp->expType)
5197 {
5198 exp->expType = op1->type;
5199 if(op1->type)
5200 op1->type->refCount++;
5201 }
5202 return 1;
5203 }
5204
5205 static unsigned int UInt64AndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5206 {
5207 uint64 value2 = op2->__anon1.ui64;
5208
5209 exp->type = 2;
5210 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 &= value2));
5211 if(!exp->expType)
5212 {
5213 exp->expType = op1->type;
5214 if(op1->type)
5215 op1->type->refCount++;
5216 }
5217 return 1;
5218 }
5219
5220 static unsigned int ShortAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5221 {
5222 short value2 = op2->__anon1.s;
5223
5224 exp->type = 2;
5225 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s &= value2));
5226 if(!exp->expType)
5227 {
5228 exp->expType = op1->type;
5229 if(op1->type)
5230 op1->type->refCount++;
5231 }
5232 return 1;
5233 }
5234
5235 static unsigned int UShortAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5236 {
5237 unsigned short value2 = op2->__anon1.us;
5238
5239 exp->type = 2;
5240 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us &= value2));
5241 if(!exp->expType)
5242 {
5243 exp->expType = op1->type;
5244 if(op1->type)
5245 op1->type->refCount++;
5246 }
5247 return 1;
5248 }
5249
5250 static unsigned int CharAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5251 {
5252 char value2 = op2->__anon1.c;
5253
5254 exp->type = 2;
5255 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c &= value2));
5256 if(!exp->expType)
5257 {
5258 exp->expType = op1->type;
5259 if(op1->type)
5260 op1->type->refCount++;
5261 }
5262 return 1;
5263 }
5264
5265 static unsigned int UCharAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5266 {
5267 unsigned char value2 = op2->__anon1.uc;
5268
5269 exp->type = 2;
5270 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc &= value2));
5271 if(!exp->expType)
5272 {
5273 exp->expType = op1->type;
5274 if(op1->type)
5275 op1->type->refCount++;
5276 }
5277 return 1;
5278 }
5279
5280 static unsigned int IntOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5281 {
5282 int value2 = op2->__anon1.i;
5283
5284 exp->type = 2;
5285 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i |= value2));
5286 if(!exp->expType)
5287 {
5288 exp->expType = op1->type;
5289 if(op1->type)
5290 op1->type->refCount++;
5291 }
5292 return 1;
5293 }
5294
5295 static unsigned int UIntOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5296 {
5297 unsigned int value2 = op2->__anon1.ui;
5298
5299 exp->type = 2;
5300 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui |= value2));
5301 if(!exp->expType)
5302 {
5303 exp->expType = op1->type;
5304 if(op1->type)
5305 op1->type->refCount++;
5306 }
5307 return 1;
5308 }
5309
5310 static unsigned int Int64OrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5311 {
5312 long long value2 = op2->__anon1.i64;
5313
5314 exp->type = 2;
5315 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 |= value2));
5316 if(!exp->expType)
5317 {
5318 exp->expType = op1->type;
5319 if(op1->type)
5320 op1->type->refCount++;
5321 }
5322 return 1;
5323 }
5324
5325 static unsigned int UInt64OrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5326 {
5327 uint64 value2 = op2->__anon1.ui64;
5328
5329 exp->type = 2;
5330 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 |= value2));
5331 if(!exp->expType)
5332 {
5333 exp->expType = op1->type;
5334 if(op1->type)
5335 op1->type->refCount++;
5336 }
5337 return 1;
5338 }
5339
5340 static unsigned int ShortOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5341 {
5342 short value2 = op2->__anon1.s;
5343
5344 exp->type = 2;
5345 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s |= value2));
5346 if(!exp->expType)
5347 {
5348 exp->expType = op1->type;
5349 if(op1->type)
5350 op1->type->refCount++;
5351 }
5352 return 1;
5353 }
5354
5355 static unsigned int UShortOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5356 {
5357 unsigned short value2 = op2->__anon1.us;
5358
5359 exp->type = 2;
5360 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us |= value2));
5361 if(!exp->expType)
5362 {
5363 exp->expType = op1->type;
5364 if(op1->type)
5365 op1->type->refCount++;
5366 }
5367 return 1;
5368 }
5369
5370 static unsigned int CharOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5371 {
5372 char value2 = op2->__anon1.c;
5373
5374 exp->type = 2;
5375 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c |= value2));
5376 if(!exp->expType)
5377 {
5378 exp->expType = op1->type;
5379 if(op1->type)
5380 op1->type->refCount++;
5381 }
5382 return 1;
5383 }
5384
5385 static unsigned int UCharOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5386 {
5387 unsigned char value2 = op2->__anon1.uc;
5388
5389 exp->type = 2;
5390 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc |= value2));
5391 if(!exp->expType)
5392 {
5393 exp->expType = op1->type;
5394 if(op1->type)
5395 op1->type->refCount++;
5396 }
5397 return 1;
5398 }
5399
5400 static unsigned int IntXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5401 {
5402 int value2 = op2->__anon1.i;
5403
5404 exp->type = 2;
5405 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i ^= value2));
5406 if(!exp->expType)
5407 {
5408 exp->expType = op1->type;
5409 if(op1->type)
5410 op1->type->refCount++;
5411 }
5412 return 1;
5413 }
5414
5415 static unsigned int UIntXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5416 {
5417 unsigned int value2 = op2->__anon1.ui;
5418
5419 exp->type = 2;
5420 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui ^= value2));
5421 if(!exp->expType)
5422 {
5423 exp->expType = op1->type;
5424 if(op1->type)
5425 op1->type->refCount++;
5426 }
5427 return 1;
5428 }
5429
5430 static unsigned int Int64XorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5431 {
5432 long long value2 = op2->__anon1.i64;
5433
5434 exp->type = 2;
5435 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 ^= value2));
5436 if(!exp->expType)
5437 {
5438 exp->expType = op1->type;
5439 if(op1->type)
5440 op1->type->refCount++;
5441 }
5442 return 1;
5443 }
5444
5445 static unsigned int UInt64XorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5446 {
5447 uint64 value2 = op2->__anon1.ui64;
5448
5449 exp->type = 2;
5450 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 ^= value2));
5451 if(!exp->expType)
5452 {
5453 exp->expType = op1->type;
5454 if(op1->type)
5455 op1->type->refCount++;
5456 }
5457 return 1;
5458 }
5459
5460 static unsigned int ShortXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5461 {
5462 short value2 = op2->__anon1.s;
5463
5464 exp->type = 2;
5465 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s ^= value2));
5466 if(!exp->expType)
5467 {
5468 exp->expType = op1->type;
5469 if(op1->type)
5470 op1->type->refCount++;
5471 }
5472 return 1;
5473 }
5474
5475 static unsigned int UShortXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5476 {
5477 unsigned short value2 = op2->__anon1.us;
5478
5479 exp->type = 2;
5480 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us ^= value2));
5481 if(!exp->expType)
5482 {
5483 exp->expType = op1->type;
5484 if(op1->type)
5485 op1->type->refCount++;
5486 }
5487 return 1;
5488 }
5489
5490 static unsigned int CharXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5491 {
5492 char value2 = op2->__anon1.c;
5493
5494 exp->type = 2;
5495 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c ^= value2));
5496 if(!exp->expType)
5497 {
5498 exp->expType = op1->type;
5499 if(op1->type)
5500 op1->type->refCount++;
5501 }
5502 return 1;
5503 }
5504
5505 static unsigned int UCharXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5506 {
5507 unsigned char value2 = op2->__anon1.uc;
5508
5509 exp->type = 2;
5510 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc ^= value2));
5511 if(!exp->expType)
5512 {
5513 exp->expType = op1->type;
5514 if(op1->type)
5515 op1->type->refCount++;
5516 }
5517 return 1;
5518 }
5519
5520 static unsigned int IntLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5521 {
5522 int value2 = op2->__anon1.i;
5523
5524 exp->type = 2;
5525 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i <<= value2));
5526 if(!exp->expType)
5527 {
5528 exp->expType = op1->type;
5529 if(op1->type)
5530 op1->type->refCount++;
5531 }
5532 return 1;
5533 }
5534
5535 static unsigned int UIntLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5536 {
5537 unsigned int value2 = op2->__anon1.ui;
5538
5539 exp->type = 2;
5540 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui <<= value2));
5541 if(!exp->expType)
5542 {
5543 exp->expType = op1->type;
5544 if(op1->type)
5545 op1->type->refCount++;
5546 }
5547 return 1;
5548 }
5549
5550 static unsigned int Int64LShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5551 {
5552 long long value2 = op2->__anon1.i64;
5553
5554 exp->type = 2;
5555 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 <<= value2));
5556 if(!exp->expType)
5557 {
5558 exp->expType = op1->type;
5559 if(op1->type)
5560 op1->type->refCount++;
5561 }
5562 return 1;
5563 }
5564
5565 static unsigned int UInt64LShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5566 {
5567 uint64 value2 = op2->__anon1.ui64;
5568
5569 exp->type = 2;
5570 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 <<= value2));
5571 if(!exp->expType)
5572 {
5573 exp->expType = op1->type;
5574 if(op1->type)
5575 op1->type->refCount++;
5576 }
5577 return 1;
5578 }
5579
5580 static unsigned int ShortLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5581 {
5582 short value2 = op2->__anon1.s;
5583
5584 exp->type = 2;
5585 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s <<= value2));
5586 if(!exp->expType)
5587 {
5588 exp->expType = op1->type;
5589 if(op1->type)
5590 op1->type->refCount++;
5591 }
5592 return 1;
5593 }
5594
5595 static unsigned int UShortLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5596 {
5597 unsigned short value2 = op2->__anon1.us;
5598
5599 exp->type = 2;
5600 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us <<= value2));
5601 if(!exp->expType)
5602 {
5603 exp->expType = op1->type;
5604 if(op1->type)
5605 op1->type->refCount++;
5606 }
5607 return 1;
5608 }
5609
5610 static unsigned int CharLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5611 {
5612 char value2 = op2->__anon1.c;
5613
5614 exp->type = 2;
5615 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c <<= value2));
5616 if(!exp->expType)
5617 {
5618 exp->expType = op1->type;
5619 if(op1->type)
5620 op1->type->refCount++;
5621 }
5622 return 1;
5623 }
5624
5625 static unsigned int UCharLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5626 {
5627 unsigned char value2 = op2->__anon1.uc;
5628
5629 exp->type = 2;
5630 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc <<= value2));
5631 if(!exp->expType)
5632 {
5633 exp->expType = op1->type;
5634 if(op1->type)
5635 op1->type->refCount++;
5636 }
5637 return 1;
5638 }
5639
5640 static unsigned int IntRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5641 {
5642 int value2 = op2->__anon1.i;
5643
5644 exp->type = 2;
5645 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i >>= value2));
5646 if(!exp->expType)
5647 {
5648 exp->expType = op1->type;
5649 if(op1->type)
5650 op1->type->refCount++;
5651 }
5652 return 1;
5653 }
5654
5655 static unsigned int UIntRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5656 {
5657 unsigned int value2 = op2->__anon1.ui;
5658
5659 exp->type = 2;
5660 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui >>= value2));
5661 if(!exp->expType)
5662 {
5663 exp->expType = op1->type;
5664 if(op1->type)
5665 op1->type->refCount++;
5666 }
5667 return 1;
5668 }
5669
5670 static unsigned int Int64RShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5671 {
5672 long long value2 = op2->__anon1.i64;
5673
5674 exp->type = 2;
5675 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 >>= value2));
5676 if(!exp->expType)
5677 {
5678 exp->expType = op1->type;
5679 if(op1->type)
5680 op1->type->refCount++;
5681 }
5682 return 1;
5683 }
5684
5685 static unsigned int UInt64RShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5686 {
5687 uint64 value2 = op2->__anon1.ui64;
5688
5689 exp->type = 2;
5690 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 >>= value2));
5691 if(!exp->expType)
5692 {
5693 exp->expType = op1->type;
5694 if(op1->type)
5695 op1->type->refCount++;
5696 }
5697 return 1;
5698 }
5699
5700 static unsigned int ShortRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5701 {
5702 short value2 = op2->__anon1.s;
5703
5704 exp->type = 2;
5705 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s >>= value2));
5706 if(!exp->expType)
5707 {
5708 exp->expType = op1->type;
5709 if(op1->type)
5710 op1->type->refCount++;
5711 }
5712 return 1;
5713 }
5714
5715 static unsigned int UShortRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5716 {
5717 unsigned short value2 = op2->__anon1.us;
5718
5719 exp->type = 2;
5720 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us >>= value2));
5721 if(!exp->expType)
5722 {
5723 exp->expType = op1->type;
5724 if(op1->type)
5725 op1->type->refCount++;
5726 }
5727 return 1;
5728 }
5729
5730 static unsigned int CharRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5731 {
5732 char value2 = op2->__anon1.c;
5733
5734 exp->type = 2;
5735 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c >>= value2));
5736 if(!exp->expType)
5737 {
5738 exp->expType = op1->type;
5739 if(op1->type)
5740 op1->type->refCount++;
5741 }
5742 return 1;
5743 }
5744
5745 static unsigned int UCharRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5746 {
5747 unsigned char value2 = op2->__anon1.uc;
5748
5749 exp->type = 2;
5750 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc >>= value2));
5751 if(!exp->expType)
5752 {
5753 exp->expType = op1->type;
5754 if(op1->type)
5755 op1->type->refCount++;
5756 }
5757 return 1;
5758 }
5759
5760 static unsigned int IntNot(struct Expression * exp, struct Operand * op1)
5761 {
5762 exp->type = 2;
5763 exp->__anon1.__anon2.string = PrintInt((int)(!op1->__anon1.i));
5764 if(!exp->expType)
5765 {
5766 exp->expType = op1->type;
5767 if(op1->type)
5768 op1->type->refCount++;
5769 }
5770 return 1;
5771 }
5772
5773 static unsigned int UIntNot(struct Expression * exp, struct Operand * op1)
5774 {
5775 exp->type = 2;
5776 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(!op1->__anon1.ui));
5777 if(!exp->expType)
5778 {
5779 exp->expType = op1->type;
5780 if(op1->type)
5781 op1->type->refCount++;
5782 }
5783 return 1;
5784 }
5785
5786 static unsigned int Int64Not(struct Expression * exp, struct Operand * op1)
5787 {
5788 exp->type = 2;
5789 exp->__anon1.__anon2.string = PrintInt64((long long)(!op1->__anon1.i64));
5790 if(!exp->expType)
5791 {
5792 exp->expType = op1->type;
5793 if(op1->type)
5794 op1->type->refCount++;
5795 }
5796 return 1;
5797 }
5798
5799 static unsigned int UInt64Not(struct Expression * exp, struct Operand * op1)
5800 {
5801 exp->type = 2;
5802 exp->__anon1.__anon2.string = PrintUInt64((uint64)(!op1->__anon1.ui64));
5803 if(!exp->expType)
5804 {
5805 exp->expType = op1->type;
5806 if(op1->type)
5807 op1->type->refCount++;
5808 }
5809 return 1;
5810 }
5811
5812 static unsigned int ShortNot(struct Expression * exp, struct Operand * op1)
5813 {
5814 exp->type = 2;
5815 exp->__anon1.__anon2.string = PrintShort((short)(!op1->__anon1.s));
5816 if(!exp->expType)
5817 {
5818 exp->expType = op1->type;
5819 if(op1->type)
5820 op1->type->refCount++;
5821 }
5822 return 1;
5823 }
5824
5825 static unsigned int UShortNot(struct Expression * exp, struct Operand * op1)
5826 {
5827 exp->type = 2;
5828 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(!op1->__anon1.us));
5829 if(!exp->expType)
5830 {
5831 exp->expType = op1->type;
5832 if(op1->type)
5833 op1->type->refCount++;
5834 }
5835 return 1;
5836 }
5837
5838 static unsigned int CharNot(struct Expression * exp, struct Operand * op1)
5839 {
5840 exp->type = 2;
5841 exp->__anon1.__anon2.string = PrintChar((char)(!op1->__anon1.c));
5842 if(!exp->expType)
5843 {
5844 exp->expType = op1->type;
5845 if(op1->type)
5846 op1->type->refCount++;
5847 }
5848 return 1;
5849 }
5850
5851 static unsigned int UCharNot(struct Expression * exp, struct Operand * op1)
5852 {
5853 exp->type = 2;
5854 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(!op1->__anon1.uc));
5855 if(!exp->expType)
5856 {
5857 exp->expType = op1->type;
5858 if(op1->type)
5859 op1->type->refCount++;
5860 }
5861 return 1;
5862 }
5863
5864 static unsigned int IntEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5865 {
5866 int value2 = op2->__anon1.i;
5867
5868 exp->type = 2;
5869 exp->__anon1.__anon2.string = PrintInt((int)(op1->__anon1.i == value2));
5870 if(!exp->expType)
5871 {
5872 exp->expType = op1->type;
5873 if(op1->type)
5874 op1->type->refCount++;
5875 }
5876 return 1;
5877 }
5878
5879 static unsigned int UIntEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5880 {
5881 unsigned int value2 = op2->__anon1.ui;
5882
5883 exp->type = 2;
5884 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(op1->__anon1.ui == value2));
5885 if(!exp->expType)
5886 {
5887 exp->expType = op1->type;
5888 if(op1->type)
5889 op1->type->refCount++;
5890 }
5891 return 1;
5892 }
5893
5894 static unsigned int Int64Equ(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5895 {
5896 long long value2 = op2->__anon1.i64;
5897
5898 exp->type = 2;
5899 exp->__anon1.__anon2.string = PrintInt64((long long)(op1->__anon1.i64 == value2));
5900 if(!exp->expType)
5901 {
5902 exp->expType = op1->type;
5903 if(op1->type)
5904 op1->type->refCount++;
5905 }
5906 return 1;
5907 }
5908
5909 static unsigned int UInt64Equ(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5910 {
5911 uint64 value2 = op2->__anon1.ui64;
5912
5913 exp->type = 2;
5914 exp->__anon1.__anon2.string = PrintUInt64((uint64)(op1->__anon1.ui64 == value2));
5915 if(!exp->expType)
5916 {
5917 exp->expType = op1->type;
5918 if(op1->type)
5919 op1->type->refCount++;
5920 }
5921 return 1;
5922 }
5923
5924 static unsigned int ShortEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5925 {
5926 short value2 = op2->__anon1.s;
5927
5928 exp->type = 2;
5929 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s == value2));
5930 if(!exp->expType)
5931 {
5932 exp->expType = op1->type;
5933 if(op1->type)
5934 op1->type->refCount++;
5935 }
5936 return 1;
5937 }
5938
5939 static unsigned int UShortEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5940 {
5941 unsigned short value2 = op2->__anon1.us;
5942
5943 exp->type = 2;
5944 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us == value2));
5945 if(!exp->expType)
5946 {
5947 exp->expType = op1->type;
5948 if(op1->type)
5949 op1->type->refCount++;
5950 }
5951 return 1;
5952 }
5953
5954 static unsigned int CharEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5955 {
5956 char value2 = op2->__anon1.c;
5957
5958 exp->type = 2;
5959 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c == value2));
5960 if(!exp->expType)
5961 {
5962 exp->expType = op1->type;
5963 if(op1->type)
5964 op1->type->refCount++;
5965 }
5966 return 1;
5967 }
5968
5969 static unsigned int UCharEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5970 {
5971 unsigned char value2 = op2->__anon1.uc;
5972
5973 exp->type = 2;
5974 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc == value2));
5975 if(!exp->expType)
5976 {
5977 exp->expType = op1->type;
5978 if(op1->type)
5979 op1->type->refCount++;
5980 }
5981 return 1;
5982 }
5983
5984 static unsigned int FloatEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5985 {
5986 float value2 = op2->__anon1.f;
5987
5988 exp->type = 2;
5989 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f == value2));
5990 if(!exp->expType)
5991 {
5992 exp->expType = op1->type;
5993 if(op1->type)
5994 op1->type->refCount++;
5995 }
5996 return 1;
5997 }
5998
5999 static unsigned int DoubleEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6000 {
6001 double value2 = op2->__anon1.d;
6002
6003 exp->type = 2;
6004 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d == value2));
6005 if(!exp->expType)
6006 {
6007 exp->expType = op1->type;
6008 if(op1->type)
6009 op1->type->refCount++;
6010 }
6011 return 1;
6012 }
6013
6014 static unsigned int IntNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6015 {
6016 int value2 = op2->__anon1.i;
6017
6018 exp->type = 2;
6019 exp->__anon1.__anon2.string = PrintInt((int)(op1->__anon1.i != value2));
6020 if(!exp->expType)
6021 {
6022 exp->expType = op1->type;
6023 if(op1->type)
6024 op1->type->refCount++;
6025 }
6026 return 1;
6027 }
6028
6029 static unsigned int UIntNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6030 {
6031 unsigned int value2 = op2->__anon1.ui;
6032
6033 exp->type = 2;
6034 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(op1->__anon1.ui != value2));
6035 if(!exp->expType)
6036 {
6037 exp->expType = op1->type;
6038 if(op1->type)
6039 op1->type->refCount++;
6040 }
6041 return 1;
6042 }
6043
6044 static unsigned int Int64Nqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6045 {
6046 long long value2 = op2->__anon1.i64;
6047
6048 exp->type = 2;
6049 exp->__anon1.__anon2.string = PrintInt64((long long)(op1->__anon1.i64 != value2));
6050 if(!exp->expType)
6051 {
6052 exp->expType = op1->type;
6053 if(op1->type)
6054 op1->type->refCount++;
6055 }
6056 return 1;
6057 }
6058
6059 static unsigned int UInt64Nqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6060 {
6061 uint64 value2 = op2->__anon1.ui64;
6062
6063 exp->type = 2;
6064 exp->__anon1.__anon2.string = PrintUInt64((uint64)(op1->__anon1.ui64 != value2));
6065 if(!exp->expType)
6066 {
6067 exp->expType = op1->type;
6068 if(op1->type)
6069 op1->type->refCount++;
6070 }
6071 return 1;
6072 }
6073
6074 static unsigned int ShortNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6075 {
6076 short value2 = op2->__anon1.s;
6077
6078 exp->type = 2;
6079 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s != value2));
6080 if(!exp->expType)
6081 {
6082 exp->expType = op1->type;
6083 if(op1->type)
6084 op1->type->refCount++;
6085 }
6086 return 1;
6087 }
6088
6089 static unsigned int UShortNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6090 {
6091 unsigned short value2 = op2->__anon1.us;
6092
6093 exp->type = 2;
6094 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us != value2));
6095 if(!exp->expType)
6096 {
6097 exp->expType = op1->type;
6098 if(op1->type)
6099 op1->type->refCount++;
6100 }
6101 return 1;
6102 }
6103
6104 static unsigned int CharNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6105 {
6106 char value2 = op2->__anon1.c;
6107
6108 exp->type = 2;
6109 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c != value2));
6110 if(!exp->expType)
6111 {
6112 exp->expType = op1->type;
6113 if(op1->type)
6114 op1->type->refCount++;
6115 }
6116 return 1;
6117 }
6118
6119 static unsigned int UCharNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6120 {
6121 unsigned char value2 = op2->__anon1.uc;
6122
6123 exp->type = 2;
6124 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc != value2));
6125 if(!exp->expType)
6126 {
6127 exp->expType = op1->type;
6128 if(op1->type)
6129 op1->type->refCount++;
6130 }
6131 return 1;
6132 }
6133
6134 static unsigned int FloatNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6135 {
6136 float value2 = op2->__anon1.f;
6137
6138 exp->type = 2;
6139 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f != value2));
6140 if(!exp->expType)
6141 {
6142 exp->expType = op1->type;
6143 if(op1->type)
6144 op1->type->refCount++;
6145 }
6146 return 1;
6147 }
6148
6149 static unsigned int DoubleNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6150 {
6151 double value2 = op2->__anon1.d;
6152
6153 exp->type = 2;
6154 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d != value2));
6155 if(!exp->expType)
6156 {
6157 exp->expType = op1->type;
6158 if(op1->type)
6159 op1->type->refCount++;
6160 }
6161 return 1;
6162 }
6163
6164 static unsigned int IntAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6165 {
6166 int value2 = op2->__anon1.i;
6167
6168 exp->type = 2;
6169 exp->__anon1.__anon2.string = PrintInt((int)(op1->__anon1.i && value2));
6170 if(!exp->expType)
6171 {
6172 exp->expType = op1->type;
6173 if(op1->type)
6174 op1->type->refCount++;
6175 }
6176 return 1;
6177 }
6178
6179 static unsigned int UIntAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6180 {
6181 unsigned int value2 = op2->__anon1.ui;
6182
6183 exp->type = 2;
6184 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(op1->__anon1.ui && value2));
6185 if(!exp->expType)
6186 {
6187 exp->expType = op1->type;
6188 if(op1->type)
6189 op1->type->refCount++;
6190 }
6191 return 1;
6192 }
6193
6194 static unsigned int Int64And(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6195 {
6196 long long value2 = op2->__anon1.i64;
6197
6198 exp->type = 2;
6199 exp->__anon1.__anon2.string = PrintInt64((long long)(op1->__anon1.i64 && value2));
6200 if(!exp->expType)
6201 {
6202 exp->expType = op1->type;
6203 if(op1->type)
6204 op1->type->refCount++;
6205 }
6206 return 1;
6207 }
6208
6209 static unsigned int UInt64And(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6210 {
6211 uint64 value2 = op2->__anon1.ui64;
6212
6213 exp->type = 2;
6214 exp->__anon1.__anon2.string = PrintUInt64((uint64)(op1->__anon1.ui64 && value2));
6215 if(!exp->expType)
6216 {
6217 exp->expType = op1->type;
6218 if(op1->type)
6219 op1->type->refCount++;
6220 }
6221 return 1;
6222 }
6223
6224 static unsigned int ShortAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6225 {
6226 short value2 = op2->__anon1.s;
6227
6228 exp->type = 2;
6229 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s && value2));
6230 if(!exp->expType)
6231 {
6232 exp->expType = op1->type;
6233 if(op1->type)
6234 op1->type->refCount++;
6235 }
6236 return 1;
6237 }
6238
6239 static unsigned int UShortAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6240 {
6241 unsigned short value2 = op2->__anon1.us;
6242
6243 exp->type = 2;
6244 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us && value2));
6245 if(!exp->expType)
6246 {
6247 exp->expType = op1->type;
6248 if(op1->type)
6249 op1->type->refCount++;
6250 }
6251 return 1;
6252 }
6253
6254 static unsigned int CharAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6255 {
6256 char value2 = op2->__anon1.c;
6257
6258 exp->type = 2;
6259 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c && value2));
6260 if(!exp->expType)
6261 {
6262 exp->expType = op1->type;
6263 if(op1->type)
6264 op1->type->refCount++;
6265 }
6266 return 1;
6267 }
6268
6269 static unsigned int UCharAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6270 {
6271 unsigned char value2 = op2->__anon1.uc;
6272
6273 exp->type = 2;
6274 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc && value2));
6275 if(!exp->expType)
6276 {
6277 exp->expType = op1->type;
6278 if(op1->type)
6279 op1->type->refCount++;
6280 }
6281 return 1;
6282 }
6283
6284 static unsigned int FloatAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6285 {
6286 float value2 = op2->__anon1.f;
6287
6288 exp->type = 2;
6289 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f && value2));
6290 if(!exp->expType)
6291 {
6292 exp->expType = op1->type;
6293 if(op1->type)
6294 op1->type->refCount++;
6295 }
6296 return 1;
6297 }
6298
6299 static unsigned int DoubleAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6300 {
6301 double value2 = op2->__anon1.d;
6302
6303 exp->type = 2;
6304 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d && value2));
6305 if(!exp->expType)
6306 {
6307 exp->expType = op1->type;
6308 if(op1->type)
6309 op1->type->refCount++;
6310 }
6311 return 1;
6312 }
6313
6314 static unsigned int IntOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6315 {
6316 int value2 = op2->__anon1.i;
6317
6318 exp->type = 2;
6319 exp->__anon1.__anon2.string = PrintInt((int)(op1->__anon1.i || value2));
6320 if(!exp->expType)
6321 {
6322 exp->expType = op1->type;
6323 if(op1->type)
6324 op1->type->refCount++;
6325 }
6326 return 1;
6327 }
6328
6329 static unsigned int UIntOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6330 {
6331 unsigned int value2 = op2->__anon1.ui;
6332
6333 exp->type = 2;
6334 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(op1->__anon1.ui || value2));
6335 if(!exp->expType)
6336 {
6337 exp->expType = op1->type;
6338 if(op1->type)
6339 op1->type->refCount++;
6340 }
6341 return 1;
6342 }
6343
6344 static unsigned int Int64Or(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6345 {
6346 long long value2 = op2->__anon1.i64;
6347
6348 exp->type = 2;
6349 exp->__anon1.__anon2.string = PrintInt64((long long)(op1->__anon1.i64 || value2));
6350 if(!exp->expType)
6351 {
6352 exp->expType = op1->type;
6353 if(op1->type)
6354 op1->type->refCount++;
6355 }
6356 return 1;
6357 }
6358
6359 static unsigned int UInt64Or(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6360 {
6361 uint64 value2 = op2->__anon1.ui64;
6362
6363 exp->type = 2;
6364 exp->__anon1.__anon2.string = PrintUInt64((uint64)(op1->__anon1.ui64 || value2));
6365 if(!exp->expType)
6366 {
6367 exp->expType = op1->type;
6368 if(op1->type)
6369 op1->type->refCount++;
6370 }
6371 return 1;
6372 }
6373
6374 static unsigned int ShortOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6375 {
6376 short value2 = op2->__anon1.s;
6377
6378 exp->type = 2;
6379 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s || value2));
6380 if(!exp->expType)
6381 {
6382 exp->expType = op1->type;
6383 if(op1->type)
6384 op1->type->refCount++;
6385 }
6386 return 1;
6387 }
6388
6389 static unsigned int UShortOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6390 {
6391 unsigned short value2 = op2->__anon1.us;
6392
6393 exp->type = 2;
6394 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us || value2));
6395 if(!exp->expType)
6396 {
6397 exp->expType = op1->type;
6398 if(op1->type)
6399 op1->type->refCount++;
6400 }
6401 return 1;
6402 }
6403
6404 static unsigned int CharOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6405 {
6406 char value2 = op2->__anon1.c;
6407
6408 exp->type = 2;
6409 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c || value2));
6410 if(!exp->expType)
6411 {
6412 exp->expType = op1->type;
6413 if(op1->type)
6414 op1->type->refCount++;
6415 }
6416 return 1;
6417 }
6418
6419 static unsigned int UCharOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6420 {
6421 unsigned char value2 = op2->__anon1.uc;
6422
6423 exp->type = 2;
6424 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc || value2));
6425 if(!exp->expType)
6426 {
6427 exp->expType = op1->type;
6428 if(op1->type)
6429 op1->type->refCount++;
6430 }
6431 return 1;
6432 }
6433
6434 static unsigned int FloatOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6435 {
6436 float value2 = op2->__anon1.f;
6437
6438 exp->type = 2;
6439 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f || value2));
6440 if(!exp->expType)
6441 {
6442 exp->expType = op1->type;
6443 if(op1->type)
6444 op1->type->refCount++;
6445 }
6446 return 1;
6447 }
6448
6449 static unsigned int DoubleOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6450 {
6451 double value2 = op2->__anon1.d;
6452
6453 exp->type = 2;
6454 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d || value2));
6455 if(!exp->expType)
6456 {
6457 exp->expType = op1->type;
6458 if(op1->type)
6459 op1->type->refCount++;
6460 }
6461 return 1;
6462 }
6463
6464 static unsigned int IntGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6465 {
6466 int value2 = op2->__anon1.i;
6467
6468 exp->type = 2;
6469 exp->__anon1.__anon2.string = PrintInt((int)(op1->__anon1.i > value2));
6470 if(!exp->expType)
6471 {
6472 exp->expType = op1->type;
6473 if(op1->type)
6474 op1->type->refCount++;
6475 }
6476 return 1;
6477 }
6478
6479 static unsigned int UIntGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6480 {
6481 unsigned int value2 = op2->__anon1.ui;
6482
6483 exp->type = 2;
6484 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(op1->__anon1.ui > value2));
6485 if(!exp->expType)
6486 {
6487 exp->expType = op1->type;
6488 if(op1->type)
6489 op1->type->refCount++;
6490 }
6491 return 1;
6492 }
6493
6494 static unsigned int Int64Grt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6495 {
6496 long long value2 = op2->__anon1.i64;
6497
6498 exp->type = 2;
6499 exp->__anon1.__anon2.string = PrintInt64((long long)(op1->__anon1.i64 > value2));
6500 if(!exp->expType)
6501 {
6502 exp->expType = op1->type;
6503 if(op1->type)
6504 op1->type->refCount++;
6505 }
6506 return 1;
6507 }
6508
6509 static unsigned int UInt64Grt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6510 {
6511 uint64 value2 = op2->__anon1.ui64;
6512
6513 exp->type = 2;
6514 exp->__anon1.__anon2.string = PrintUInt64((uint64)(op1->__anon1.ui64 > value2));
6515 if(!exp->expType)
6516 {
6517 exp->expType = op1->type;
6518 if(op1->type)
6519 op1->type->refCount++;
6520 }
6521 return 1;
6522 }
6523
6524 static unsigned int ShortGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6525 {
6526 short value2 = op2->__anon1.s;
6527
6528 exp->type = 2;
6529 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s > value2));
6530 if(!exp->expType)
6531 {
6532 exp->expType = op1->type;
6533 if(op1->type)
6534 op1->type->refCount++;
6535 }
6536 return 1;
6537 }
6538
6539 static unsigned int UShortGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6540 {
6541 unsigned short value2 = op2->__anon1.us;
6542
6543 exp->type = 2;
6544 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us > value2));
6545 if(!exp->expType)
6546 {
6547 exp->expType = op1->type;
6548 if(op1->type)
6549 op1->type->refCount++;
6550 }
6551 return 1;
6552 }
6553
6554 static unsigned int CharGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6555 {
6556 char value2 = op2->__anon1.c;
6557
6558 exp->type = 2;
6559 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c > value2));
6560 if(!exp->expType)
6561 {
6562 exp->expType = op1->type;
6563 if(op1->type)
6564 op1->type->refCount++;
6565 }
6566 return 1;
6567 }
6568
6569 static unsigned int UCharGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6570 {
6571 unsigned char value2 = op2->__anon1.uc;
6572
6573 exp->type = 2;
6574 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc > value2));
6575 if(!exp->expType)
6576 {
6577 exp->expType = op1->type;
6578 if(op1->type)
6579 op1->type->refCount++;
6580 }
6581 return 1;
6582 }
6583
6584 static unsigned int FloatGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6585 {
6586 float value2 = op2->__anon1.f;
6587
6588 exp->type = 2;
6589 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f > value2));
6590 if(!exp->expType)
6591 {
6592 exp->expType = op1->type;
6593 if(op1->type)
6594 op1->type->refCount++;
6595 }
6596 return 1;
6597 }
6598
6599 static unsigned int DoubleGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6600 {
6601 double value2 = op2->__anon1.d;
6602
6603 exp->type = 2;
6604 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d > value2));
6605 if(!exp->expType)
6606 {
6607 exp->expType = op1->type;
6608 if(op1->type)
6609 op1->type->refCount++;
6610 }
6611 return 1;
6612 }
6613
6614 static unsigned int IntSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6615 {
6616 int value2 = op2->__anon1.i;
6617
6618 exp->type = 2;
6619 exp->__anon1.__anon2.string = PrintInt((int)(op1->__anon1.i < value2));
6620 if(!exp->expType)
6621 {
6622 exp->expType = op1->type;
6623 if(op1->type)
6624 op1->type->refCount++;
6625 }
6626 return 1;
6627 }
6628
6629 static unsigned int UIntSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6630 {
6631 unsigned int value2 = op2->__anon1.ui;
6632
6633 exp->type = 2;
6634 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(op1->__anon1.ui < value2));
6635 if(!exp->expType)
6636 {
6637 exp->expType = op1->type;
6638 if(op1->type)
6639 op1->type->refCount++;
6640 }
6641 return 1;
6642 }
6643
6644 static unsigned int Int64Sma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6645 {
6646 long long value2 = op2->__anon1.i64;
6647
6648 exp->type = 2;
6649 exp->__anon1.__anon2.string = PrintInt64((long long)(op1->__anon1.i64 < value2));
6650 if(!exp->expType)
6651 {
6652 exp->expType = op1->type;
6653 if(op1->type)
6654 op1->type->refCount++;
6655 }
6656 return 1;
6657 }
6658
6659 static unsigned int UInt64Sma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6660 {
6661 uint64 value2 = op2->__anon1.ui64;
6662
6663 exp->type = 2;
6664 exp->__anon1.__anon2.string = PrintUInt64((uint64)(op1->__anon1.ui64 < value2));
6665 if(!exp->expType)
6666 {
6667 exp->expType = op1->type;
6668 if(op1->type)
6669 op1->type->refCount++;
6670 }
6671 return 1;
6672 }
6673
6674 static unsigned int ShortSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6675 {
6676 short value2 = op2->__anon1.s;
6677
6678 exp->type = 2;
6679 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s < value2));
6680 if(!exp->expType)
6681 {
6682 exp->expType = op1->type;
6683 if(op1->type)
6684 op1->type->refCount++;
6685 }
6686 return 1;
6687 }
6688
6689 static unsigned int UShortSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6690 {
6691 unsigned short value2 = op2->__anon1.us;
6692
6693 exp->type = 2;
6694 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us < value2));
6695 if(!exp->expType)
6696 {
6697 exp->expType = op1->type;
6698 if(op1->type)
6699 op1->type->refCount++;
6700 }
6701 return 1;
6702 }
6703
6704 static unsigned int CharSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6705 {
6706 char value2 = op2->__anon1.c;
6707
6708 exp->type = 2;
6709 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c < value2));
6710 if(!exp->expType)
6711 {
6712 exp->expType = op1->type;
6713 if(op1->type)
6714 op1->type->refCount++;
6715 }
6716 return 1;
6717 }
6718
6719 static unsigned int UCharSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6720 {
6721 unsigned char value2 = op2->__anon1.uc;
6722
6723 exp->type = 2;
6724 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc < value2));
6725 if(!exp->expType)
6726 {
6727 exp->expType = op1->type;
6728 if(op1->type)
6729 op1->type->refCount++;
6730 }
6731 return 1;
6732 }
6733
6734 static unsigned int FloatSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6735 {
6736 float value2 = op2->__anon1.f;
6737
6738 exp->type = 2;
6739 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f < value2));
6740 if(!exp->expType)
6741 {
6742 exp->expType = op1->type;
6743 if(op1->type)
6744 op1->type->refCount++;
6745 }
6746 return 1;
6747 }
6748
6749 static unsigned int DoubleSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6750 {
6751 double value2 = op2->__anon1.d;
6752
6753 exp->type = 2;
6754 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d < value2));
6755 if(!exp->expType)
6756 {
6757 exp->expType = op1->type;
6758 if(op1->type)
6759 op1->type->refCount++;
6760 }
6761 return 1;
6762 }
6763
6764 static unsigned int IntGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6765 {
6766 int value2 = op2->__anon1.i;
6767
6768 exp->type = 2;
6769 exp->__anon1.__anon2.string = PrintInt((int)(op1->__anon1.i >= value2));
6770 if(!exp->expType)
6771 {
6772 exp->expType = op1->type;
6773 if(op1->type)
6774 op1->type->refCount++;
6775 }
6776 return 1;
6777 }
6778
6779 static unsigned int UIntGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6780 {
6781 unsigned int value2 = op2->__anon1.ui;
6782
6783 exp->type = 2;
6784 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(op1->__anon1.ui >= value2));
6785 if(!exp->expType)
6786 {
6787 exp->expType = op1->type;
6788 if(op1->type)
6789 op1->type->refCount++;
6790 }
6791 return 1;
6792 }
6793
6794 static unsigned int Int64GrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6795 {
6796 long long value2 = op2->__anon1.i64;
6797
6798 exp->type = 2;
6799 exp->__anon1.__anon2.string = PrintInt64((long long)(op1->__anon1.i64 >= value2));
6800 if(!exp->expType)
6801 {
6802 exp->expType = op1->type;
6803 if(op1->type)
6804 op1->type->refCount++;
6805 }
6806 return 1;
6807 }
6808
6809 static unsigned int UInt64GrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6810 {
6811 uint64 value2 = op2->__anon1.ui64;
6812
6813 exp->type = 2;
6814 exp->__anon1.__anon2.string = PrintUInt64((uint64)(op1->__anon1.ui64 >= value2));
6815 if(!exp->expType)
6816 {
6817 exp->expType = op1->type;
6818 if(op1->type)
6819 op1->type->refCount++;
6820 }
6821 return 1;
6822 }
6823
6824 static unsigned int ShortGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6825 {
6826 short value2 = op2->__anon1.s;
6827
6828 exp->type = 2;
6829 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s >= value2));
6830 if(!exp->expType)
6831 {
6832 exp->expType = op1->type;
6833 if(op1->type)
6834 op1->type->refCount++;
6835 }
6836 return 1;
6837 }
6838
6839 static unsigned int UShortGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6840 {
6841 unsigned short value2 = op2->__anon1.us;
6842
6843 exp->type = 2;
6844 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us >= value2));
6845 if(!exp->expType)
6846 {
6847 exp->expType = op1->type;
6848 if(op1->type)
6849 op1->type->refCount++;
6850 }
6851 return 1;
6852 }
6853
6854 static unsigned int CharGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6855 {
6856 char value2 = op2->__anon1.c;
6857
6858 exp->type = 2;
6859 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c >= value2));
6860 if(!exp->expType)
6861 {
6862 exp->expType = op1->type;
6863 if(op1->type)
6864 op1->type->refCount++;
6865 }
6866 return 1;
6867 }
6868
6869 static unsigned int UCharGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6870 {
6871 unsigned char value2 = op2->__anon1.uc;
6872
6873 exp->type = 2;
6874 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc >= value2));
6875 if(!exp->expType)
6876 {
6877 exp->expType = op1->type;
6878 if(op1->type)
6879 op1->type->refCount++;
6880 }
6881 return 1;
6882 }
6883
6884 static unsigned int FloatGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6885 {
6886 float value2 = op2->__anon1.f;
6887
6888 exp->type = 2;
6889 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f >= value2));
6890 if(!exp->expType)
6891 {
6892 exp->expType = op1->type;
6893 if(op1->type)
6894 op1->type->refCount++;
6895 }
6896 return 1;
6897 }
6898
6899 static unsigned int DoubleGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6900 {
6901 double value2 = op2->__anon1.d;
6902
6903 exp->type = 2;
6904 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d >= value2));
6905 if(!exp->expType)
6906 {
6907 exp->expType = op1->type;
6908 if(op1->type)
6909 op1->type->refCount++;
6910 }
6911 return 1;
6912 }
6913
6914 static unsigned int IntSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6915 {
6916 int value2 = op2->__anon1.i;
6917
6918 exp->type = 2;
6919 exp->__anon1.__anon2.string = PrintInt((int)(op1->__anon1.i <= value2));
6920 if(!exp->expType)
6921 {
6922 exp->expType = op1->type;
6923 if(op1->type)
6924 op1->type->refCount++;
6925 }
6926 return 1;
6927 }
6928
6929 static unsigned int UIntSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6930 {
6931 unsigned int value2 = op2->__anon1.ui;
6932
6933 exp->type = 2;
6934 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(op1->__anon1.ui <= value2));
6935 if(!exp->expType)
6936 {
6937 exp->expType = op1->type;
6938 if(op1->type)
6939 op1->type->refCount++;
6940 }
6941 return 1;
6942 }
6943
6944 static unsigned int Int64SmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6945 {
6946 long long value2 = op2->__anon1.i64;
6947
6948 exp->type = 2;
6949 exp->__anon1.__anon2.string = PrintInt64((long long)(op1->__anon1.i64 <= value2));
6950 if(!exp->expType)
6951 {
6952 exp->expType = op1->type;
6953 if(op1->type)
6954 op1->type->refCount++;
6955 }
6956 return 1;
6957 }
6958
6959 static unsigned int UInt64SmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6960 {
6961 uint64 value2 = op2->__anon1.ui64;
6962
6963 exp->type = 2;
6964 exp->__anon1.__anon2.string = PrintUInt64((uint64)(op1->__anon1.ui64 <= value2));
6965 if(!exp->expType)
6966 {
6967 exp->expType = op1->type;
6968 if(op1->type)
6969 op1->type->refCount++;
6970 }
6971 return 1;
6972 }
6973
6974 static unsigned int ShortSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6975 {
6976 short value2 = op2->__anon1.s;
6977
6978 exp->type = 2;
6979 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s <= value2));
6980 if(!exp->expType)
6981 {
6982 exp->expType = op1->type;
6983 if(op1->type)
6984 op1->type->refCount++;
6985 }
6986 return 1;
6987 }
6988
6989 static unsigned int UShortSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6990 {
6991 unsigned short value2 = op2->__anon1.us;
6992
6993 exp->type = 2;
6994 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us <= value2));
6995 if(!exp->expType)
6996 {
6997 exp->expType = op1->type;
6998 if(op1->type)
6999 op1->type->refCount++;
7000 }
7001 return 1;
7002 }
7003
7004 static unsigned int CharSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7005 {
7006 char value2 = op2->__anon1.c;
7007
7008 exp->type = 2;
7009 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c <= value2));
7010 if(!exp->expType)
7011 {
7012 exp->expType = op1->type;
7013 if(op1->type)
7014 op1->type->refCount++;
7015 }
7016 return 1;
7017 }
7018
7019 static unsigned int UCharSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7020 {
7021 unsigned char value2 = op2->__anon1.uc;
7022
7023 exp->type = 2;
7024 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc <= value2));
7025 if(!exp->expType)
7026 {
7027 exp->expType = op1->type;
7028 if(op1->type)
7029 op1->type->refCount++;
7030 }
7031 return 1;
7032 }
7033
7034 static unsigned int FloatSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7035 {
7036 float value2 = op2->__anon1.f;
7037
7038 exp->type = 2;
7039 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f <= value2));
7040 if(!exp->expType)
7041 {
7042 exp->expType = op1->type;
7043 if(op1->type)
7044 op1->type->refCount++;
7045 }
7046 return 1;
7047 }
7048
7049 static unsigned int DoubleSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7050 {
7051 double value2 = op2->__anon1.d;
7052
7053 exp->type = 2;
7054 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d <= value2));
7055 if(!exp->expType)
7056 {
7057 exp->expType = op1->type;
7058 if(op1->type)
7059 op1->type->refCount++;
7060 }
7061 return 1;
7062 }
7063
7064 static unsigned int IntCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
7065 {
7066 exp->type = 2;
7067 exp->__anon1.__anon2.string = PrintInt(op1->__anon1.i ? op2->__anon1.i : op3->__anon1.i);
7068 if(!exp->expType)
7069 {
7070 exp->expType = op1->type;
7071 if(op1->type)
7072 op1->type->refCount++;
7073 }
7074 return 1;
7075 }
7076
7077 static unsigned int UIntCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
7078 {
7079 exp->type = 2;
7080 exp->__anon1.__anon2.string = PrintUInt(op1->__anon1.ui ? op2->__anon1.ui : op3->__anon1.ui);
7081 if(!exp->expType)
7082 {
7083 exp->expType = op1->type;
7084 if(op1->type)
7085 op1->type->refCount++;
7086 }
7087 return 1;
7088 }
7089
7090 static unsigned int Int64Cond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
7091 {
7092 exp->type = 2;
7093 exp->__anon1.__anon2.string = PrintInt64(op1->__anon1.i64 ? op2->__anon1.i64 : op3->__anon1.i64);
7094 if(!exp->expType)
7095 {
7096 exp->expType = op1->type;
7097 if(op1->type)
7098 op1->type->refCount++;
7099 }
7100 return 1;
7101 }
7102
7103 static unsigned int UInt64Cond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
7104 {
7105 exp->type = 2;
7106 exp->__anon1.__anon2.string = PrintUInt64(op1->__anon1.ui64 ? op2->__anon1.ui64 : op3->__anon1.ui64);
7107 if(!exp->expType)
7108 {
7109 exp->expType = op1->type;
7110 if(op1->type)
7111 op1->type->refCount++;
7112 }
7113 return 1;
7114 }
7115
7116 static unsigned int ShortCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
7117 {
7118 exp->type = 2;
7119 exp->__anon1.__anon2.string = PrintShort(op1->__anon1.s ? op2->__anon1.s : op3->__anon1.s);
7120 if(!exp->expType)
7121 {
7122 exp->expType = op1->type;
7123 if(op1->type)
7124 op1->type->refCount++;
7125 }
7126 return 1;
7127 }
7128
7129 static unsigned int UShortCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
7130 {
7131 exp->type = 2;
7132 exp->__anon1.__anon2.string = PrintUShort(op1->__anon1.us ? op2->__anon1.us : op3->__anon1.us);
7133 if(!exp->expType)
7134 {
7135 exp->expType = op1->type;
7136 if(op1->type)
7137 op1->type->refCount++;
7138 }
7139 return 1;
7140 }
7141
7142 static unsigned int CharCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
7143 {
7144 exp->type = 2;
7145 exp->__anon1.__anon2.string = PrintChar(op1->__anon1.c ? op2->__anon1.c : op3->__anon1.c);
7146 if(!exp->expType)
7147 {
7148 exp->expType = op1->type;
7149 if(op1->type)
7150 op1->type->refCount++;
7151 }
7152 return 1;
7153 }
7154
7155 static unsigned int UCharCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
7156 {
7157 exp->type = 2;
7158 exp->__anon1.__anon2.string = PrintUChar(op1->__anon1.uc ? op2->__anon1.uc : op3->__anon1.uc);
7159 if(!exp->expType)
7160 {
7161 exp->expType = op1->type;
7162 if(op1->type)
7163 op1->type->refCount++;
7164 }
7165 return 1;
7166 }
7167
7168 static void PrintName(struct Type * type, char * string, unsigned int fullName)
7169 {
7170 if(type->name && type->name[0])
7171 {
7172 if(fullName)
7173 strcat(string, type->name);
7174 else
7175 {
7176 char * name = __ecereNameSpace__ecere__sys__RSearchString(type->name, "::", strlen(type->name), 1, 0);
7177
7178 if(name)
7179 name += 2;
7180 else
7181 name = type->name;
7182 strcat(string, name);
7183 }
7184 }
7185 }
7186
7187 static void PrintAttribs(struct Type * type, char * string)
7188 {
7189 if(type)
7190 {
7191 if(type->dllExport)
7192 strcat(string, "dllexport ");
7193 if(type->attrStdcall)
7194 strcat(string, "stdcall ");
7195 }
7196 }
7197
7198 static struct Type * FindMember(struct Type * type, char * string)
7199 {
7200 struct Type * memberType;
7201
7202 for(memberType = type->__anon1.__anon1.members.first; memberType; memberType = memberType->next)
7203 {
7204 if(!memberType->name)
7205 {
7206 struct Type * subType = FindMember(memberType, string);
7207
7208 if(subType)
7209 return subType;
7210 }
7211 else if(!strcmp(memberType->name, string))
7212 return memberType;
7213 }
7214 return (((void *)0));
7215 }
7216
7217 unsigned int __ecereProp_Type_Get_isPointerType(struct Type * this);
7218
7219 unsigned int __ecereProp_Type_Get_specConst(struct Type * this);
7220
7221 static unsigned int Promote(struct Operand * op, int kind, unsigned int isSigned)
7222 {
7223 unsigned int result = 0;
7224
7225 switch(kind)
7226 {
7227 case 2:
7228 if(op->kind == 1 || op->kind == 15 || op->kind == 24)
7229 result = isSigned ? GetOpShort(op, &op->__anon1.s) : GetOpUShort(op, &op->__anon1.us);
7230 break;
7231 case 3:
7232 case 5:
7233 if(op->kind == 1 || op->kind == 2 || op->kind == 15 || op->kind == 24)
7234 result = isSigned ? GetOpInt(op, &op->__anon1.i) : GetOpUInt(op, &op->__anon1.ui);
7235 break;
7236 case 4:
7237 if(op->kind == 1 || op->kind == 2 || op->kind == 3 || op->kind == 4 || op->kind == 5 || op->kind == 6 || op->kind == 7 || op->kind == 13 || op->kind == 15 || op->kind == 22 || op->kind == 23 || op->kind == 24)
7238 result = isSigned ? GetOpInt64(op, &op->__anon1.i64) : GetOpUInt64(op, &op->__anon1.ui64);
7239 break;
7240 case 6:
7241 if(op->kind == 1 || op->kind == 2 || op->kind == 3 || op->kind == 4 || op->kind == 5 || op->kind == 15 || op->kind == 22 || op->kind == 23 || op->kind == 24)
7242 result = GetOpFloat(op, &op->__anon1.f);
7243 break;
7244 case 7:
7245 if(op->kind == 1 || op->kind == 2 || op->kind == 3 || op->kind == 4 || op->kind == 5 || op->kind == 6 || op->kind == 15 || op->kind == 22 || op->kind == 23 || op->kind == 24)
7246 result = GetOpDouble(op, &op->__anon1.d);
7247 break;
7248 case 13:
7249 if(op->kind == 1 || op->kind == 2 || op->kind == 3 || op->kind == 4 || op->kind == 5 || op->kind == 6 || op->kind == 7 || op->kind == 13 || op->kind == 15 || op->kind == 22 || op->kind == 23 || op->kind == 24)
7250 result = GetOpUInt64(op, &op->__anon1.ui64);
7251 break;
7252 case 15:
7253 if(op->kind == 1 || op->kind == 2 || op->kind == 3 || op->kind == 4 || op->kind == 5 || op->kind == 6 || op->kind == 7 || op->kind == 13 || op->kind == 15 || op->kind == 22 || op->kind == 23 || op->kind == 24)
7254 result = isSigned ? GetOpInt(op, &op->__anon1.i) : GetOpUInt(op, &op->__anon1.ui);
7255 break;
7256 case 22:
7257 if(op->kind == 1 || op->kind == 2 || op->kind == 3 || op->kind == 5 || op->kind == 15 || op->kind == 24)
7258 result = isSigned ? GetOpInt64(op, &op->__anon1.i64) : GetOpUInt64(op, &op->__anon1.ui64);
7259 break;
7260 case 23:
7261 if(op->kind == 1 || op->kind == 2 || op->kind == 3 || op->kind == 5 || op->kind == 15 || op->kind == 24)
7262 result = isSigned ? GetOpInt64(op, &op->__anon1.i64) : GetOpUInt64(op, &op->__anon1.ui64);
7263 break;
7264 }
7265 return result;
7266 }
7267
7268 struct OpTable floatOps =
7269 {
7270 (void *)(FloatAdd), (void *)(FloatSub), (void *)(FloatMul), (void *)(FloatDiv), (((void *)0)), (void *)(FloatNeg), (void *)(FloatInc), (void *)(FloatDec), (void *)(FloatAsign), (void *)(FloatAddAsign), (void *)(FloatSubAsign), (void *)(FloatMulAsign), (void *)(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)), (void *)(FloatEqu), (void *)(FloatNqu), (void *)(FloatAnd), (void *)(FloatOr), (void *)(FloatGrt), (void *)(FloatSma), (void *)(FloatGrtEqu), (void *)(FloatSmaEqu)
7271 };
7272
7273 struct OpTable doubleOps =
7274 {
7275 (void *)(DoubleAdd), (void *)(DoubleSub), (void *)(DoubleMul), (void *)(DoubleDiv), (((void *)0)), (void *)(DoubleNeg), (void *)(DoubleInc), (void *)(DoubleDec), (void *)(DoubleAsign), (void *)(DoubleAddAsign), (void *)(DoubleSubAsign), (void *)(DoubleMulAsign), (void *)(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)), (void *)(DoubleEqu), (void *)(DoubleNqu), (void *)(DoubleAnd), (void *)(DoubleOr), (void *)(DoubleGrt), (void *)(DoubleSma), (void *)(DoubleGrtEqu), (void *)(DoubleSmaEqu)
7276 };
7277
7278 struct OpTable intOps =
7279 {
7280 (void *)(IntAdd), (void *)(IntSub), (void *)(IntMul), (void *)(IntDiv), (void *)(IntMod), (void *)(IntNeg), (void *)(IntInc), (void *)(IntDec), (void *)(IntAsign), (void *)(IntAddAsign), (void *)(IntSubAsign), (void *)(IntMulAsign), (void *)(IntDivAsign), (void *)(IntModAsign), (void *)(IntBitAnd), (void *)(IntBitOr), (void *)(IntBitXor), (void *)(IntLShift), (void *)(IntRShift), (void *)(IntBitNot), (void *)(IntAndAsign), (void *)(IntOrAsign), (void *)(IntXorAsign), (void *)(IntLShiftAsign), (void *)(IntRShiftAsign), (void *)(IntNot), (void *)(IntEqu), (void *)(IntNqu), (void *)(IntAnd), (void *)(IntOr), (void *)(IntGrt), (void *)(IntSma), (void *)(IntGrtEqu), (void *)(IntSmaEqu), (void *)(IntCond)
7281 };
7282
7283 struct OpTable uintOps =
7284 {
7285 (void *)(UIntAdd), (void *)(UIntSub), (void *)(UIntMul), (void *)(UIntDiv), (void *)(UIntMod), (void *)(UIntNeg), (void *)(UIntInc), (void *)(UIntDec), (void *)(UIntAsign), (void *)(UIntAddAsign), (void *)(UIntSubAsign), (void *)(UIntMulAsign), (void *)(UIntDivAsign), (void *)(UIntModAsign), (void *)(UIntBitAnd), (void *)(UIntBitOr), (void *)(UIntBitXor), (void *)(UIntLShift), (void *)(UIntRShift), (void *)(UIntBitNot), (void *)(UIntAndAsign), (void *)(UIntOrAsign), (void *)(UIntXorAsign), (void *)(UIntLShiftAsign), (void *)(UIntRShiftAsign), (void *)(UIntNot), (void *)(UIntEqu), (void *)(UIntNqu), (void *)(UIntAnd), (void *)(UIntOr), (void *)(UIntGrt), (void *)(UIntSma), (void *)(UIntGrtEqu), (void *)(UIntSmaEqu), (void *)(UIntCond)
7286 };
7287
7288 struct OpTable int64Ops =
7289 {
7290 (void *)(Int64Add), (void *)(Int64Sub), (void *)(Int64Mul), (void *)(Int64Div), (void *)(Int64Mod), (void *)(Int64Neg), (void *)(Int64Inc), (void *)(Int64Dec), (void *)(Int64Asign), (void *)(Int64AddAsign), (void *)(Int64SubAsign), (void *)(Int64MulAsign), (void *)(Int64DivAsign), (void *)(Int64ModAsign), (void *)(Int64BitAnd), (void *)(Int64BitOr), (void *)(Int64BitXor), (void *)(Int64LShift), (void *)(Int64RShift), (void *)(Int64BitNot), (void *)(Int64AndAsign), (void *)(Int64OrAsign), (void *)(Int64XorAsign), (void *)(Int64LShiftAsign), (void *)(Int64RShiftAsign), (void *)(Int64Not), (void *)(Int64Equ), (void *)(Int64Nqu), (void *)(Int64And), (void *)(Int64Or), (void *)(Int64Grt), (void *)(Int64Sma), (void *)(Int64GrtEqu), (void *)(Int64SmaEqu), (void *)(Int64Cond)
7291 };
7292
7293 struct OpTable uint64Ops =
7294 {
7295 (void *)(UInt64Add), (void *)(UInt64Sub), (void *)(UInt64Mul), (void *)(UInt64Div), (void *)(UInt64Mod), (void *)(UInt64Neg), (void *)(UInt64Inc), (void *)(UInt64Dec), (void *)(UInt64Asign), (void *)(UInt64AddAsign), (void *)(UInt64SubAsign), (void *)(UInt64MulAsign), (void *)(UInt64DivAsign), (void *)(UInt64ModAsign), (void *)(UInt64BitAnd), (void *)(UInt64BitOr), (void *)(UInt64BitXor), (void *)(UInt64LShift), (void *)(UInt64RShift), (void *)(UInt64BitNot), (void *)(UInt64AndAsign), (void *)(UInt64OrAsign), (void *)(UInt64XorAsign), (void *)(UInt64LShiftAsign), (void *)(UInt64RShiftAsign), (void *)(UInt64Not), (void *)(UInt64Equ), (void *)(UInt64Nqu), (void *)(UInt64And), (void *)(UInt64Or), (void *)(UInt64Grt), (void *)(UInt64Sma), (void *)(UInt64GrtEqu), (void *)(UInt64SmaEqu), (void *)(UInt64Cond)
7296 };
7297
7298 struct OpTable shortOps =
7299 {
7300 (void *)(ShortAdd), (void *)(ShortSub), (void *)(ShortMul), (void *)(ShortDiv), (void *)(ShortMod), (void *)(ShortNeg), (void *)(ShortInc), (void *)(ShortDec), (void *)(ShortAsign), (void *)(ShortAddAsign), (void *)(ShortSubAsign), (void *)(ShortMulAsign), (void *)(ShortDivAsign), (void *)(ShortModAsign), (void *)(ShortBitAnd), (void *)(ShortBitOr), (void *)(ShortBitXor), (void *)(ShortLShift), (void *)(ShortRShift), (void *)(ShortBitNot), (void *)(ShortAndAsign), (void *)(ShortOrAsign), (void *)(ShortXorAsign), (void *)(ShortLShiftAsign), (void *)(ShortRShiftAsign), (void *)(ShortNot), (void *)(ShortEqu), (void *)(ShortNqu), (void *)(ShortAnd), (void *)(ShortOr), (void *)(ShortGrt), (void *)(ShortSma), (void *)(ShortGrtEqu), (void *)(ShortSmaEqu), (void *)(ShortCond)
7301 };
7302
7303 struct OpTable ushortOps =
7304 {
7305 (void *)(UShortAdd), (void *)(UShortSub), (void *)(UShortMul), (void *)(UShortDiv), (void *)(UShortMod), (void *)(UShortNeg), (void *)(UShortInc), (void *)(UShortDec), (void *)(UShortAsign), (void *)(UShortAddAsign), (void *)(UShortSubAsign), (void *)(UShortMulAsign), (void *)(UShortDivAsign), (void *)(UShortModAsign), (void *)(UShortBitAnd), (void *)(UShortBitOr), (void *)(UShortBitXor), (void *)(UShortLShift), (void *)(UShortRShift), (void *)(UShortBitNot), (void *)(UShortAndAsign), (void *)(UShortOrAsign), (void *)(UShortXorAsign), (void *)(UShortLShiftAsign), (void *)(UShortRShiftAsign), (void *)(UShortNot), (void *)(UShortEqu), (void *)(UShortNqu), (void *)(UShortAnd), (void *)(UShortOr), (void *)(UShortGrt), (void *)(UShortSma), (void *)(UShortGrtEqu), (void *)(UShortSmaEqu), (void *)(UShortCond)
7306 };
7307
7308 struct OpTable charOps =
7309 {
7310 (void *)(CharAdd), (void *)(CharSub), (void *)(CharMul), (void *)(CharDiv), (void *)(CharMod), (void *)(CharNeg), (void *)(CharInc), (void *)(CharDec), (void *)(CharAsign), (void *)(CharAddAsign), (void *)(CharSubAsign), (void *)(CharMulAsign), (void *)(CharDivAsign), (void *)(CharModAsign), (void *)(CharBitAnd), (void *)(CharBitOr), (void *)(CharBitXor), (void *)(CharLShift), (void *)(CharRShift), (void *)(CharBitNot), (void *)(CharAndAsign), (void *)(CharOrAsign), (void *)(CharXorAsign), (void *)(CharLShiftAsign), (void *)(CharRShiftAsign), (void *)(CharNot), (void *)(CharEqu), (void *)(CharNqu), (void *)(CharAnd), (void *)(CharOr), (void *)(CharGrt), (void *)(CharSma), (void *)(CharGrtEqu), (void *)(CharSmaEqu), (void *)(CharCond)
7311 };
7312
7313 struct OpTable ucharOps =
7314 {
7315 (void *)(UCharAdd), (void *)(UCharSub), (void *)(UCharMul), (void *)(UCharDiv), (void *)(UCharMod), (void *)(UCharNeg), (void *)(UCharInc), (void *)(UCharDec), (void *)(UCharAsign), (void *)(UCharAddAsign), (void *)(UCharSubAsign), (void *)(UCharMulAsign), (void *)(UCharDivAsign), (void *)(UCharModAsign), (void *)(UCharBitAnd), (void *)(UCharBitOr), (void *)(UCharBitXor), (void *)(UCharLShift), (void *)(UCharRShift), (void *)(UCharBitNot), (void *)(UCharAndAsign), (void *)(UCharOrAsign), (void *)(UCharXorAsign), (void *)(UCharLShiftAsign), (void *)(UCharRShiftAsign), (void *)(UCharNot), (void *)(UCharEqu), (void *)(UCharNqu), (void *)(UCharAnd), (void *)(UCharOr), (void *)(UCharGrt), (void *)(UCharSma), (void *)(UCharGrtEqu), (void *)(UCharSmaEqu), (void *)(UCharCond)
7316 };
7317
7318 struct Type * FindMemberAndOffset(struct Type * type, char * string, unsigned int * offset)
7319 {
7320 struct Type * memberType;
7321
7322 for(memberType = type->__anon1.__anon1.members.first; memberType; memberType = memberType->next)
7323 {
7324 if(!memberType->name)
7325 {
7326 struct Type * subType = FindMember(memberType, string);
7327
7328 if(subType)
7329 {
7330 *offset += memberType->offset;
7331 return subType;
7332 }
7333 }
7334 else if(!strcmp(memberType->name, string))
7335 {
7336 *offset += memberType->offset;
7337 return memberType;
7338 }
7339 }
7340 return (((void *)0));
7341 }
7342
7343 struct __ecereNameSpace__ecere__com__Module;
7344
7345 extern struct __ecereNameSpace__ecere__com__Property * __ecereNameSpace__ecere__com__eClass_FindProperty(struct __ecereNameSpace__ecere__com__Class * _class, const char *  name, struct __ecereNameSpace__ecere__com__Instance * module);
7346
7347 extern struct __ecereNameSpace__ecere__com__Instance * privateModule;
7348
7349 extern struct __ecereNameSpace__ecere__com__Method * __ecereNameSpace__ecere__com__eClass_FindMethod(struct __ecereNameSpace__ecere__com__Class * _class, const char *  name, struct __ecereNameSpace__ecere__com__Instance * module);
7350
7351 extern struct __ecereNameSpace__ecere__com__DataMember * __ecereNameSpace__ecere__com__eClass_FindDataMember(struct __ecereNameSpace__ecere__com__Class * _class, const char *  name, struct __ecereNameSpace__ecere__com__Instance * module, struct __ecereNameSpace__ecere__com__DataMember **  subMemberStack, int *  subMemberStackPos);
7352
7353 extern struct ModuleImport * FindModule(struct __ecereNameSpace__ecere__com__Instance * moduleToFind);
7354
7355 extern struct __ecereNameSpace__ecere__com__Class * __ecereNameSpace__ecere__com__eSystem_FindClass(struct __ecereNameSpace__ecere__com__Instance * module, const char *  name);
7356
7357 struct GlobalData
7358 {
7359 uintptr_t key;
7360 struct __ecereNameSpace__ecere__sys__BTNode * parent;
7361 struct __ecereNameSpace__ecere__sys__BTNode * left;
7362 struct __ecereNameSpace__ecere__sys__BTNode * right;
7363 int depth;
7364 struct __ecereNameSpace__ecere__com__Instance * module;
7365 char *  dataTypeString;
7366 struct Type * dataType;
7367 void *  symbol;
7368 char *  fullName;
7369 } ecere_gcc_struct;
7370
7371 extern struct __ecereNameSpace__ecere__com__DataMember * __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(struct __ecereNameSpace__ecere__com__Class * _class, const char *  name, unsigned int *  offset, struct __ecereNameSpace__ecere__com__Instance * module, struct __ecereNameSpace__ecere__com__DataMember **  subMemberStack, int *  subMemberStackPos);
7372
7373 extern struct __ecereNameSpace__ecere__com__Instance * GetPrivateModule(void);
7374
7375 extern struct __ecereNameSpace__ecere__com__Class * __ecereNameSpace__ecere__com__eSystem_RegisterClass(int type, const char *  name, const char *  baseName, int size, int sizeClass, unsigned int (*  Constructor)(void * ), void (*  Destructor)(void * ), struct __ecereNameSpace__ecere__com__Instance * module, int declMode, int inheritanceAccess);
7376
7377 extern struct __ecereNameSpace__ecere__com__Instance * __thisModule;
7378
7379 struct __ecereNameSpace__ecere__com__DefinedExpression;
7380
7381 extern struct __ecereNameSpace__ecere__com__DefinedExpression * __ecereNameSpace__ecere__com__eSystem_FindDefine(struct __ecereNameSpace__ecere__com__Instance * module, const char *  name);
7382
7383 struct __ecereNameSpace__ecere__com__DefinedExpression
7384 {
7385 struct __ecereNameSpace__ecere__com__DefinedExpression * prev;
7386 struct __ecereNameSpace__ecere__com__DefinedExpression * next;
7387 const char *  name;
7388 const char *  value;
7389 struct __ecereNameSpace__ecere__com__NameSpace *  nameSpace;
7390 } ecere_gcc_struct;
7391
7392 struct __ecereNameSpace__ecere__sys__BinaryTree;
7393
7394 struct __ecereNameSpace__ecere__sys__BinaryTree
7395 {
7396 struct __ecereNameSpace__ecere__sys__BTNode * root;
7397 int count;
7398 int (*  CompareKey)(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, uintptr_t a, uintptr_t b);
7399 void (*  FreeKey)(void *  key);
7400 } ecere_gcc_struct;
7401
7402 struct __ecereNameSpace__ecere__com__Class
7403 {
7404 struct __ecereNameSpace__ecere__com__Class * prev;
7405 struct __ecereNameSpace__ecere__com__Class * next;
7406 const char *  name;
7407 int offset;
7408 int structSize;
7409 void * *  _vTbl;
7410 int vTblSize;
7411 unsigned int (*  Constructor)(void * );
7412 void (*  Destructor)(void * );
7413 int offsetClass;
7414 int sizeClass;
7415 struct __ecereNameSpace__ecere__com__Class * base;
7416 struct __ecereNameSpace__ecere__sys__BinaryTree methods;
7417 struct __ecereNameSpace__ecere__sys__BinaryTree members;
7418 struct __ecereNameSpace__ecere__sys__BinaryTree prop;
7419 struct __ecereNameSpace__ecere__sys__OldList membersAndProperties;
7420 struct __ecereNameSpace__ecere__sys__BinaryTree classProperties;
7421 struct __ecereNameSpace__ecere__sys__OldList derivatives;
7422 int memberID;
7423 int startMemberID;
7424 int type;
7425 struct __ecereNameSpace__ecere__com__Instance * module;
7426 struct __ecereNameSpace__ecere__com__NameSpace *  nameSpace;
7427 const char *  dataTypeString;
7428 struct Type * dataType;
7429 int typeSize;
7430 int defaultAlignment;
7431 void (*  Initialize)();
7432 int memberOffset;
7433 struct __ecereNameSpace__ecere__sys__OldList selfWatchers;
7434 const char *  designerClass;
7435 unsigned int noExpansion;
7436 const char *  defaultProperty;
7437 unsigned int comRedefinition;
7438 int count;
7439 int isRemote;
7440 unsigned int internalDecl;
7441 void *  data;
7442 unsigned int computeSize;
7443 short structAlignment;
7444 short pointerAlignment;
7445 int destructionWatchOffset;
7446 unsigned int fixed;
7447 struct __ecereNameSpace__ecere__sys__OldList delayedCPValues;
7448 int inheritanceAccess;
7449 const char *  fullName;
7450 void *  symbol;
7451 struct __ecereNameSpace__ecere__sys__OldList conversions;
7452 struct __ecereNameSpace__ecere__sys__OldList templateParams;
7453 struct __ecereNameSpace__ecere__com__ClassTemplateArgument *  templateArgs;
7454 struct __ecereNameSpace__ecere__com__Class * templateClass;
7455 struct __ecereNameSpace__ecere__sys__OldList templatized;
7456 int numParams;
7457 unsigned int isInstanceClass;
7458 unsigned int byValueSystemClass;
7459 } ecere_gcc_struct;
7460
7461 struct __ecereNameSpace__ecere__com__NameSpace
7462 {
7463 const char *  name;
7464 struct __ecereNameSpace__ecere__com__NameSpace *  btParent;
7465 struct __ecereNameSpace__ecere__com__NameSpace *  left;
7466 struct __ecereNameSpace__ecere__com__NameSpace *  right;
7467 int depth;
7468 struct __ecereNameSpace__ecere__com__NameSpace *  parent;
7469 struct __ecereNameSpace__ecere__sys__BinaryTree nameSpaces;
7470 struct __ecereNameSpace__ecere__sys__BinaryTree classes;
7471 struct __ecereNameSpace__ecere__sys__BinaryTree defines;
7472 struct __ecereNameSpace__ecere__sys__BinaryTree functions;
7473 } ecere_gcc_struct;
7474
7475 struct __ecereNameSpace__ecere__com__DataMember
7476 {
7477 struct __ecereNameSpace__ecere__com__DataMember * prev;
7478 struct __ecereNameSpace__ecere__com__DataMember * next;
7479 const char *  name;
7480 unsigned int isProperty;
7481 int memberAccess;
7482 int id;
7483 struct __ecereNameSpace__ecere__com__Class * _class;
7484 const char *  dataTypeString;
7485 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
7486 struct Type * dataType;
7487 int type;
7488 int offset;
7489 int memberID;
7490 struct __ecereNameSpace__ecere__sys__OldList members;
7491 struct __ecereNameSpace__ecere__sys__BinaryTree membersAlpha;
7492 int memberOffset;
7493 short structAlignment;
7494 short pointerAlignment;
7495 } ecere_gcc_struct;
7496
7497 struct __ecereNameSpace__ecere__sys__BTNode * __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(struct __ecereNameSpace__ecere__sys__BinaryTree * this, const char *  key);
7498
7499 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(struct __ecereNameSpace__ecere__sys__BinaryTree * this, struct __ecereNameSpace__ecere__sys__BTNode * node);
7500
7501 struct __ecereNameSpace__ecere__sys__BTNode * __ecereProp___ecereNameSpace__ecere__sys__BinaryTree_Get_first(struct __ecereNameSpace__ecere__sys__BinaryTree * this);
7502
7503 struct __ecereNameSpace__ecere__sys__BTNode * __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindPrefix(struct __ecereNameSpace__ecere__sys__BinaryTree * this, const char *  key);
7504
7505 void __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Remove(struct __ecereNameSpace__ecere__sys__BinaryTree * this, struct __ecereNameSpace__ecere__sys__BTNode * node);
7506
7507 static struct __ecereNameSpace__ecere__com__Class * __ecereClass_Conversion;
7508
7509 static void _DeclareType(struct External * neededFor, struct Type * type, unsigned int needDereference, unsigned int forFunctionDef, unsigned int fwdDecl)
7510 {
7511 if(inCompiler)
7512 {
7513 if(type->kind == 11)
7514 {
7515 struct Type * param;
7516
7517 for(param = type->__anon1.__anon2.params.first; param; param = param->next)
7518 _DeclareType(neededFor, param, forFunctionDef, 0, fwdDecl);
7519 _DeclareType(neededFor, type->__anon1.__anon2.returnType, forFunctionDef, 0, fwdDecl);
7520 }
7521 else if(type->kind == 13)
7522 _DeclareType(neededFor, type->__anon1.type, 0, 0, fwdDecl);
7523 else if(type->kind == 8)
7524 {
7525 struct __ecereNameSpace__ecere__com__Class * c = type->__anon1._class->__anon1.registered;
7526
7527 _DeclareStruct(neededFor, c ? c->fullName : "ecere::com::Instance", c ? c->type == 5 : 0, needDereference && c && c->type == 1, fwdDecl);
7528 }
7529 else if(type->kind == 9 || type->kind == 10)
7530 {
7531 struct Type * member;
7532
7533 for(member = type->__anon1.__anon1.members.first; member; member = member->next)
7534 _DeclareType(neededFor, member, needDereference, forFunctionDef, fwdDecl);
7535 }
7536 else if(type->kind == 12)
7537 _DeclareType(neededFor, type->__anon1.__anon4.arrayType, 1, 0, fwdDecl);
7538 }
7539 }
7540
7541 static unsigned int CheckConstCompatibility(struct Type * source, struct Type * dest, unsigned int warn)
7542 {
7543 unsigned int status = 1;
7544
7545 if(((source->kind == 8 && source->__anon1._class && source->__anon1._class->__anon1.registered) || source->kind == 12 || source->kind == 13) && ((dest->kind == 8 && dest->__anon1._class && dest->__anon1._class->__anon1.registered) || dest->kind == 13))
7546 {
7547 struct __ecereNameSpace__ecere__com__Class * sourceClass = source->kind == 8 ? source->__anon1._class->__anon1.registered : (((void *)0));
7548 struct __ecereNameSpace__ecere__com__Class * destClass = dest->kind == 8 ? dest->__anon1._class->__anon1.registered : (((void *)0));
7549
7550 if((!sourceClass || (sourceClass && sourceClass->type == 0 && !sourceClass->structSize)) && (!destClass || (destClass && destClass->type == 0 && !destClass->structSize)))
7551 {
7552 struct Type * sourceType = source, * destType = dest;
7553
7554 while((sourceType->kind == 13 || sourceType->kind == 12) && sourceType->__anon1.type)
7555 sourceType = sourceType->__anon1.type;
7556 while((destType->kind == 13 || destType->kind == 12) && destType->__anon1.type)
7557 destType = destType->__anon1.type;
7558 if(!destType->constant && sourceType->constant)
7559 {
7560 status = 0;
7561 if(warn)
7562 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "discarding const qualifier\n", (((void *)0))));
7563 }
7564 }
7565 }
7566 return status;
7567 }
7568
7569 struct Operand GetOperand(struct Expression * exp)
7570 {
7571 struct Operand op =
7572 {
7573 0, 0, 0,
7574 .__anon1 = {
7575 .c = 0
7576 },
7577 {
7578 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
7579 }
7580 };
7581 struct Type * type = exp->expType;
7582
7583 if(type)
7584 {
7585 while(type->kind == 8 && type->__anon1._class && type->__anon1._class->__anon1.registered && (type->__anon1._class->__anon1.registered->type == 2 || type->__anon1._class->__anon1.registered->type == 3 || type->__anon1._class->__anon1.registered->type == 4))
7586 {
7587 if(!type->__anon1._class->__anon1.registered->dataType)
7588 type->__anon1._class->__anon1.registered->dataType = ProcessTypeString(type->__anon1._class->__anon1.registered->dataTypeString, 0);
7589 type = type->__anon1._class->__anon1.registered->dataType;
7590 }
7591 if(exp->type == 3 && op.kind == 13)
7592 {
7593 op.__anon1.ui64 = (uint64)(uintptr_t)exp->__anon1.__anon2.string;
7594 op.kind = 13;
7595 op.ops = uint64Ops;
7596 }
7597 else if(exp->isConstant && exp->type == 2)
7598 {
7599 op.kind = type->kind;
7600 op.type = type;
7601 switch(op.kind)
7602 {
7603 case 24:
7604 case 1:
7605 {
7606 if(exp->__anon1.__anon1.constant[0] == '\'')
7607 {
7608 op.__anon1.c = exp->__anon1.__anon1.constant[1];
7609 op.ops = charOps;
7610 }
7611 else if(type->isSigned)
7612 {
7613 op.__anon1.c = (char)strtol(exp->__anon1.__anon1.constant, (((void *)0)), 0);
7614 op.ops = charOps;
7615 }
7616 else
7617 {
7618 op.__anon1.uc = (unsigned char)strtoul(exp->__anon1.__anon1.constant, (((void *)0)), 0);
7619 op.ops = ucharOps;
7620 }
7621 break;
7622 }
7623 case 2:
7624 if(exp->__anon1.__anon1.constant[0] == '\'')
7625 {
7626 op.__anon1.s = exp->__anon1.__anon1.constant[1];
7627 op.ops = shortOps;
7628 }
7629 else if(type->isSigned)
7630 {
7631 op.__anon1.s = (short)strtol(exp->__anon1.__anon1.constant, (((void *)0)), 0);
7632 op.ops = shortOps;
7633 }
7634 else
7635 {
7636 op.__anon1.us = (unsigned short)strtoul(exp->__anon1.__anon1.constant, (((void *)0)), 0);
7637 op.ops = ushortOps;
7638 }
7639 break;
7640 case 3:
7641 case 5:
7642 if(exp->__anon1.__anon1.constant[0] == '\'')
7643 {
7644 op.__anon1.i = exp->__anon1.__anon1.constant[1];
7645 op.ops = intOps;
7646 }
7647 else if(type->isSigned)
7648 {
7649 op.__anon1.i = strtol(exp->__anon1.__anon1.constant, (((void *)0)), 0);
7650 op.ops = intOps;
7651 }
7652 else
7653 {
7654 op.__anon1.ui = (unsigned int)strtoul(exp->__anon1.__anon1.constant, (((void *)0)), 0);
7655 op.ops = uintOps;
7656 }
7657 op.kind = 3;
7658 break;
7659 case 4:
7660 if(type->isSigned)
7661 {
7662 op.__anon1.i64 = __ecereNameSpace__ecere__com___strtoi64(exp->__anon1.__anon1.constant, (((void *)0)), 0);
7663 op.ops = int64Ops;
7664 }
7665 else
7666 {
7667 op.__anon1.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->__anon1.__anon1.constant, (((void *)0)), 0);
7668 op.ops = uint64Ops;
7669 }
7670 op.kind = 4;
7671 break;
7672 case 22:
7673 if(type->isSigned)
7674 {
7675 op.__anon1.i64 = __ecereNameSpace__ecere__com___strtoi64(exp->__anon1.__anon1.constant, (((void *)0)), 0);
7676 op.ops = int64Ops;
7677 }
7678 else
7679 {
7680 op.__anon1.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->__anon1.__anon1.constant, (((void *)0)), 0);
7681 op.ops = uint64Ops;
7682 }
7683 op.kind = 4;
7684 break;
7685 case 23:
7686 if(type->isSigned)
7687 {
7688 op.__anon1.i64 = __ecereNameSpace__ecere__com___strtoi64(exp->__anon1.__anon1.constant, (((void *)0)), 0);
7689 op.ops = int64Ops;
7690 }
7691 else
7692 {
7693 op.__anon1.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->__anon1.__anon1.constant, (((void *)0)), 0);
7694 op.ops = uint64Ops;
7695 }
7696 op.kind = 4;
7697 break;
7698 case 6:
7699 if(!strcmp(exp->__anon1.__anon1.constant, "inf"))
7700 op.__anon1.f = __ecereMethod_float_inf();
7701 else if(!strcmp(exp->__anon1.__anon1.constant, "-inf"))
7702 op.__anon1.f = -__ecereMethod_float_inf();
7703 else if(!strcmp(exp->__anon1.__anon1.constant, "nan"))
7704 op.__anon1.f = __ecereMethod_float_nan();
7705 else if(!strcmp(exp->__anon1.__anon1.constant, "-nan"))
7706 op.__anon1.f = -__ecereMethod_float_nan();
7707 else
7708 op.__anon1.f = (float)strtod(exp->__anon1.__anon1.constant, (((void *)0)));
7709 op.ops = floatOps;
7710 break;
7711 case 7:
7712 if(!strcmp(exp->__anon1.__anon1.constant, "inf"))
7713 op.__anon1.d = __ecereMethod_double_inf();
7714 else if(!strcmp(exp->__anon1.__anon1.constant, "-inf"))
7715 op.__anon1.d = -__ecereMethod_double_inf();
7716 else if(!strcmp(exp->__anon1.__anon1.constant, "nan"))
7717 op.__anon1.d = __ecereMethod_double_nan();
7718 else if(!strcmp(exp->__anon1.__anon1.constant, "-nan"))
7719 op.__anon1.d = -__ecereMethod_double_nan();
7720 else
7721 op.__anon1.d = (double)strtod(exp->__anon1.__anon1.constant, (((void *)0)));
7722 op.ops = doubleOps;
7723 break;
7724 case 12:
7725 case 13:
7726 case 8:
7727 op.__anon1.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->__anon1.__anon1.constant, (((void *)0)), 0);
7728 op.kind = 13;
7729 op.ops = uint64Ops;
7730 break;
7731 }
7732 }
7733 }
7734 return op;
7735 }
7736
7737 static long long GetEnumValue(struct __ecereNameSpace__ecere__com__Class * _class, void * ptr)
7738 {
7739 long long v = 0;
7740
7741 switch(_class->typeSize)
7742 {
7743 case 8:
7744 if(!strcmp(_class->dataTypeString, "uint64"))
7745 v = (long long)*(uint64 *)ptr;
7746 else
7747 v = *(long long *)ptr;
7748 break;
7749 case 4:
7750 if(!strcmp(_class->dataTypeString, "uint"))
7751 v = (long long)*(unsigned int *)ptr;
7752 else
7753 v = (long long)*(int *)ptr;
7754 break;
7755 case 2:
7756 if(!strcmp(_class->dataTypeString, "uint16"))
7757 v = (long long)*(unsigned short *)ptr;
7758 else
7759 v = (long long)*(short *)ptr;
7760 break;
7761 case 1:
7762 if(!strcmp(_class->dataTypeString, "byte"))
7763 v = (long long)*(unsigned char *)ptr;
7764 else
7765 v = (long long)*(char *)ptr;
7766 break;
7767 }
7768 return v;
7769 }
7770
7771 static void GetTypeSpecs(struct Type * type, struct __ecereNameSpace__ecere__sys__OldList * specs)
7772 {
7773 if(!type->isSigned && type->kind != 22 && type->kind != 23)
7774 ListAdd(specs, MkSpecifier(UNSIGNED));
7775 switch(type->kind)
7776 {
7777 case 8:
7778 {
7779 if(type->__anon1._class->__anon1.registered)
7780 {
7781 if(!type->__anon1._class->__anon1.registered->dataType)
7782 type->__anon1._class->__anon1.registered->dataType = ProcessTypeString(type->__anon1._class->__anon1.registered->dataTypeString, 0);
7783 GetTypeSpecs(type->__anon1._class->__anon1.registered->dataType, specs);
7784 }
7785 break;
7786 }
7787 case 7:
7788 ListAdd(specs, MkSpecifier(DOUBLE));
7789 break;
7790 case 6:
7791 ListAdd(specs, MkSpecifier(FLOAT));
7792 break;
7793 case 1:
7794 ListAdd(specs, MkSpecifier(CHAR));
7795 break;
7796 case 24:
7797 ListAdd(specs, MkSpecifier(_BOOL));
7798 break;
7799 case 2:
7800 ListAdd(specs, MkSpecifier(SHORT));
7801 break;
7802 case 4:
7803 ListAdd(specs, MkSpecifier(INT64));
7804 break;
7805 case 22:
7806 ListAdd(specs, MkSpecifierName(type->isSigned ? "intptr" : "uintptr"));
7807 break;
7808 case 23:
7809 ListAdd(specs, MkSpecifierName(type->isSigned ? "intsize" : "uintsize"));
7810 break;
7811 case 3:
7812 default:
7813 ListAdd(specs, MkSpecifier(INT));
7814 break;
7815 }
7816 }
7817
7818 static void PrintTypeSpecs(struct Type * type, char * string, unsigned int fullName, unsigned int printConst)
7819 {
7820 if(type)
7821 {
7822 if(printConst && type->constant)
7823 strcat(string, "const ");
7824 switch(type->kind)
7825 {
7826 case 8:
7827 {
7828 struct Symbol * c = type->__anon1._class;
7829 unsigned int isObjectBaseClass = !c || !c->string || !strcmp(c->string, "class");
7830
7831 if(type->classObjectType == 2 && isObjectBaseClass)
7832 strcat(string, "typed_object");
7833 else if(type->classObjectType == 3 && isObjectBaseClass)
7834 strcat(string, "any_object");
7835 else
7836 {
7837 if(c && c->string)
7838 strcat(string, (fullName || !c->__anon1.registered) ? c->string : c->__anon1.registered->name);
7839 }
7840 if(type->byReference)
7841 strcat(string, " &");
7842 break;
7843 }
7844 case 0:
7845 strcat(string, "void");
7846 break;
7847 case 3:
7848 strcat(string, type->isSigned ? "int" : "uint");
7849 break;
7850 case 4:
7851 strcat(string, type->isSigned ? "int64" : "uint64");
7852 break;
7853 case 22:
7854 strcat(string, type->isSigned ? "intptr" : "uintptr");
7855 break;
7856 case 23:
7857 strcat(string, type->isSigned ? "intsize" : "uintsize");
7858 break;
7859 case 1:
7860 strcat(string, type->isSigned ? "char" : "byte");
7861 break;
7862 case 24:
7863 strcat(string, "_Bool");
7864 break;
7865 case 2:
7866 strcat(string, type->isSigned ? "short" : "uint16");
7867 break;
7868 case 6:
7869 strcat(string, "float");
7870 break;
7871 case 7:
7872 strcat(string, "double");
7873 break;
7874 case 9:
7875 if(type->__anon1.__anon1.enumName)
7876 {
7877 strcat(string, "struct ");
7878 strcat(string, type->__anon1.__anon1.enumName);
7879 }
7880 else if(type->typeName)
7881 strcat(string, type->typeName);
7882 else
7883 {
7884 struct Type * member;
7885
7886 strcat(string, "struct { ");
7887 for(member = type->__anon1.__anon1.members.first; member; member = member->next)
7888 {
7889 PrintType(member, string, 1, fullName);
7890 strcat(string, "; ");
7891 }
7892 strcat(string, "}");
7893 }
7894 break;
7895 case 10:
7896 if(type->__anon1.__anon1.enumName)
7897 {
7898 strcat(string, "union ");
7899 strcat(string, type->__anon1.__anon1.enumName);
7900 }
7901 else if(type->typeName)
7902 strcat(string, type->typeName);
7903 else
7904 {
7905 strcat(string, "union ");
7906 strcat(string, "(unnamed)");
7907 }
7908 break;
7909 case 15:
7910 if(type->__anon1.__anon1.enumName)
7911 {
7912 strcat(string, "enum ");
7913 strcat(string, type->__anon1.__anon1.enumName);
7914 }
7915 else if(type->typeName)
7916 strcat(string, type->typeName);
7917 else
7918 strcat(string, "int");
7919 break;
7920 case 14:
7921 strcat(string, "...");
7922 break;
7923 case 19:
7924 strcat(string, "subclass(");
7925 strcat(string, type->__anon1._class ? type->__anon1._class->string : "int");
7926 strcat(string, ")");
7927 break;
7928 case 20:
7929 strcat(string, type->__anon1.templateParameter->identifier->string);
7930 break;
7931 case 21:
7932 strcat(string, "thisclass");
7933 break;
7934 case 17:
7935 strcat(string, "__builtin_va_list");
7936 break;
7937 }
7938 }
7939 }
7940
7941 unsigned int RelatedUnits(struct __ecereNameSpace__ecere__com__Class * c1, struct __ecereNameSpace__ecere__com__Class * c2)
7942 {
7943 if(c1->base->type == 3)
7944 c1 = c1->base;
7945 if(c2->base->type == 3)
7946 c2 = c2->base;
7947 return c1 == c2;
7948 }
7949
7950 extern char *  __ecereNameSpace__ecere__com__PrintString(struct __ecereNameSpace__ecere__com__Class * class, const void * object, ...);
7951
7952 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__TempFile;
7953
7954 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassImport;
7955
7956 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Symbol;
7957
7958 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_PropertyImport;
7959
7960 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Type;
7961
7962 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplatedType;
7963
7964 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplateParameter;
7965
7966 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_MethodImport;
7967
7968 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_FunctionImport;
7969
7970 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Expression;
7971
7972 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Instantiation;
7973
7974 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__NamedLink64;
7975
7976 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TypeName;
7977
7978 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Context;
7979
7980 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Module;
7981
7982 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__LinkList;
7983
7984 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Application;
7985
7986 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_int;
7987
7988 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Instance;
7989
7990 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__File;
7991
7992 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_External;
7993
7994 struct __ecereNameSpace__ecere__com__Application
7995 {
7996 int argc;
7997 const char * *  argv;
7998 int exitCode;
7999 unsigned int isGUIApp;
8000 struct __ecereNameSpace__ecere__sys__OldList allModules;
8001 char *  parsedCommand;
8002 struct __ecereNameSpace__ecere__com__NameSpace systemNameSpace;
8003 } ecere_gcc_struct;
8004
8005 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)
8006 {
8007 if(*curMember)
8008 {
8009 *curMember = (*curMember)->next;
8010 if(subMemberStackPos && *subMemberStackPos > 0 && subMemberStack[*subMemberStackPos - 1]->type == 1)
8011 {
8012 *curMember = subMemberStack[--(*subMemberStackPos)];
8013 *curMember = (*curMember)->next;
8014 }
8015 while((*curMember) && (*curMember)->isProperty)
8016 *curMember = (*curMember)->next;
8017 if(subMemberStackPos)
8018 {
8019 while((*curMember) && !(*curMember)->isProperty && !(*curMember)->name && ((*curMember)->type == 2 || (*curMember)->type == 1))
8020 {
8021 subMemberStack[(*subMemberStackPos)++] = *curMember;
8022 *curMember = (*curMember)->members.first;
8023 while(*curMember && (*curMember)->isProperty)
8024 *curMember = (*curMember)->next;
8025 }
8026 }
8027 }
8028 while(!*curMember)
8029 {
8030 if(!*curMember)
8031 {
8032 if(subMemberStackPos && *subMemberStackPos)
8033 {
8034 *curMember = subMemberStack[--(*subMemberStackPos)];
8035 *curMember = (*curMember)->next;
8036 }
8037 else
8038 {
8039 struct __ecereNameSpace__ecere__com__Class * lastCurClass = *curClass;
8040
8041 if(*curClass == _class)
8042 break;
8043 for(*curClass = _class; (*curClass)->base != lastCurClass && (*curClass)->base->type != 1000; *curClass = (*curClass)->base)
8044 ;
8045 *curMember = (*curClass)->membersAndProperties.first;
8046 }
8047 while((*curMember) && (*curMember)->isProperty)
8048 *curMember = (*curMember)->next;
8049 if(subMemberStackPos)
8050 {
8051 while((*curMember) && !(*curMember)->isProperty && !(*curMember)->name && ((*curMember)->type == 2 || (*curMember)->type == 1))
8052 {
8053 subMemberStack[(*subMemberStackPos)++] = *curMember;
8054 *curMember = (*curMember)->members.first;
8055 while(*curMember && (*curMember)->isProperty)
8056 *curMember = (*curMember)->next;
8057 }
8058 }
8059 }
8060 }
8061 }
8062
8063 static struct GlobalData * ScanGlobalData(struct __ecereNameSpace__ecere__com__NameSpace * nameSpace, char * name)
8064 {
8065 struct __ecereNameSpace__ecere__sys__BinaryTree * tree = &nameSpace->functions;
8066 struct GlobalData * data = (struct GlobalData *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString((&*tree), name);
8067 struct __ecereNameSpace__ecere__com__NameSpace * child;
8068
8069 if(!data)
8070 {
8071 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)))
8072 {
8073 data = ScanGlobalData(child, name);
8074 if(data)
8075 break;
8076 }
8077 }
8078 return data;
8079 }
8080
8081 static struct Symbol * ScanWithNameSpace(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, const char * nameSpace, const char * name)
8082 {
8083 int nsLen = strlen(nameSpace);
8084 struct Symbol * symbol;
8085
8086 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)))
8087 {
8088 char * s = symbol->string;
8089
8090 if(!strncmp(s, nameSpace, nsLen))
8091 {
8092 int c;
8093 char * namePart;
8094
8095 for(c = strlen(s) - 1; c >= 0; c--)
8096 if(s[c] == ':')
8097 break;
8098 namePart = s + c + 1;
8099 if(!strcmp(namePart, name))
8100 {
8101 return symbol;
8102 }
8103 }
8104 else
8105 break;
8106 }
8107 return (((void *)0));
8108 }
8109
8110 unsigned int GetInt(struct Expression * exp, int * value2)
8111 {
8112 struct Operand op2 = GetOperand(exp);
8113
8114 return GetOpInt(&op2, value2);
8115 }
8116
8117 unsigned int GetUInt(struct Expression * exp, unsigned int * value2)
8118 {
8119 struct Operand op2 = GetOperand(exp);
8120
8121 return GetOpUInt(&op2, value2);
8122 }
8123
8124 unsigned int GetInt64(struct Expression * exp, long long * value2)
8125 {
8126 struct Operand op2 = GetOperand(exp);
8127
8128 return GetOpInt64(&op2, value2);
8129 }
8130
8131 unsigned int GetUInt64(struct Expression * exp, uint64 * value2)
8132 {
8133 struct Operand op2 = GetOperand(exp);
8134
8135 return GetOpUInt64(&op2, value2);
8136 }
8137
8138 unsigned int GetIntPtr(struct Expression * exp, intptr_t * value2)
8139 {
8140 struct Operand op2 = GetOperand(exp);
8141
8142 return GetOpIntPtr(&op2, value2);
8143 }
8144
8145 unsigned int GetUIntPtr(struct Expression * exp, uintptr_t * value2)
8146 {
8147 struct Operand op2 = GetOperand(exp);
8148
8149 return GetOpUIntPtr(&op2, value2);
8150 }
8151
8152 unsigned int GetIntSize(struct Expression * exp, ssize_t * value2)
8153 {
8154 struct Operand op2 = GetOperand(exp);
8155
8156 return GetOpIntSize(&op2, value2);
8157 }
8158
8159 unsigned int GetUIntSize(struct Expression * exp, size_t * value2)
8160 {
8161 struct Operand op2 = GetOperand(exp);
8162
8163 return GetOpUIntSize(&op2, value2);
8164 }
8165
8166 unsigned int GetShort(struct Expression * exp, short * value2)
8167 {
8168 struct Operand op2 = GetOperand(exp);
8169
8170 return GetOpShort(&op2, value2);
8171 }
8172
8173 unsigned int GetUShort(struct Expression * exp, unsigned short * value2)
8174 {
8175 struct Operand op2 = GetOperand(exp);
8176
8177 return GetOpUShort(&op2, value2);
8178 }
8179
8180 unsigned int GetChar(struct Expression * exp, char * value2)
8181 {
8182 struct Operand op2 = GetOperand(exp);
8183
8184 return GetOpChar(&op2, value2);
8185 }
8186
8187 unsigned int GetUChar(struct Expression * exp, unsigned char * value2)
8188 {
8189 struct Operand op2 = GetOperand(exp);
8190
8191 return GetOpUChar(&op2, value2);
8192 }
8193
8194 unsigned int GetFloat(struct Expression * exp, float * value2)
8195 {
8196 struct Operand op2 = GetOperand(exp);
8197
8198 return GetOpFloat(&op2, value2);
8199 }
8200
8201 unsigned int GetDouble(struct Expression * exp, double * value2)
8202 {
8203 struct Operand op2 = GetOperand(exp);
8204
8205 return GetOpDouble(&op2, value2);
8206 }
8207
8208 static void PrePrintType(struct Type * type, char * string, unsigned int fullName, struct Type * parentType, unsigned int printConst)
8209 {
8210 if(type->kind == 12 || type->kind == 13 || type->kind == 11 || type->kind == 16)
8211 {
8212 if((type->kind == 11 || type->kind == 16) && (!parentType || parentType->kind != 13))
8213 PrintAttribs(type, string);
8214 if(printConst && type->constant && (type->kind == 11 || type->kind == 16))
8215 strcat(string, " const");
8216 PrePrintType(type->kind == 16 ? type->__anon1.__anon3.method->dataType : type->__anon1.type, string, fullName, type, printConst);
8217 if(type->kind == 13 && (type->__anon1.type->kind == 12 || type->__anon1.type->kind == 11 || type->__anon1.type->kind == 16))
8218 strcat(string, " (");
8219 if(type->kind == 13)
8220 {
8221 if(type->__anon1.type->kind == 11 || type->__anon1.type->kind == 16)
8222 PrintAttribs(type->__anon1.type, string);
8223 }
8224 if(type->kind == 13)
8225 {
8226 if(type->__anon1.type->kind == 11 || type->__anon1.type->kind == 16 || type->__anon1.type->kind == 12)
8227 strcat(string, "*");
8228 else
8229 strcat(string, " *");
8230 }
8231 if(printConst && type->constant && type->kind == 13)
8232 strcat(string, " const");
8233 }
8234 else
8235 PrintTypeSpecs(type, string, fullName, printConst);
8236 }
8237
8238 void PrintExpression(struct Expression * exp, char * string)
8239 {
8240 {
8241 struct __ecereNameSpace__ecere__com__Instance * f = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
8242 int count;
8243 unsigned int backOutputLineNumbers = outputLineNumbers;
8244
8245 outputLineNumbers = 0;
8246 if(exp)
8247 OutputExpression(exp, f);
8248 (__extension__ ({
8249 unsigned int (*  __internal_VirtualMethod)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode);
8250
8251 __internal_VirtualMethod = ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))__extension__ ({
8252 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = f;
8253
8254 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__TempFile->_vTbl;
8255 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek]);
8256 __internal_VirtualMethod ? __internal_VirtualMethod(f, 0, 0) : (unsigned int)1;
8257 }));
8258 count = strlen(string);
8259 count += (__extension__ ({
8260 int (*  __internal_VirtualMethod)(struct __ecereNameSpace__ecere__com__Instance *, void *  buffer, unsigned int size, unsigned int count);
8261
8262 __internal_VirtualMethod = ((int (*)(struct __ecereNameSpace__ecere__com__Instance *, void *  buffer, unsigned int size, unsigned int count))__extension__ ({
8263 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = f;
8264
8265 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__TempFile->_vTbl;
8266 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Read]);
8267 __internal_VirtualMethod ? __internal_VirtualMethod(f, string + count, 1, 1023) : (int)1;
8268 }));
8269 string[count] = '\0';
8270 (__ecereNameSpace__ecere__com__eInstance_DecRef(f), f = 0);
8271 outputLineNumbers = backOutputLineNumbers;
8272 }
8273 }
8274
8275 struct Type * Dereference(struct Type * source)
8276 {
8277 struct Type * type = (((void *)0));
8278
8279 if(source)
8280 {
8281 if(source->kind == 13 || source->kind == 12)
8282 {
8283 type = source->__anon1.type;
8284 source->__anon1.type->refCount++;
8285 }
8286 else if(source->kind == 8 && !strcmp(source->__anon1._class->string, "String"))
8287 {
8288 type = __extension__ ({
8289 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
8290
8291 __ecereInstance1->kind = 1, __ecereInstance1->refCount = 1, __ecereInstance1;
8292 });
8293 }
8294 else if(source->kind == 8 && source->__anon1._class && source->__anon1._class->__anon1.registered && source->__anon1._class->__anon1.registered->type == 5)
8295 {
8296 type = source;
8297 source->refCount++;
8298 }
8299 else
8300 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "cannot dereference type\n", (((void *)0))));
8301 }
8302 return type;
8303 }
8304
8305 static struct Type * Reference(struct Type * source)
8306 {
8307 struct Type * type = (((void *)0));
8308
8309 if(source)
8310 {
8311 type = __extension__ ({
8312 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
8313
8314 __ecereInstance1->kind = 13, __ecereInstance1->__anon1.type = source, __ecereInstance1->refCount = 1, __ecereInstance1;
8315 });
8316 source->refCount++;
8317 }
8318 return type;
8319 }
8320
8321 void modifyPassAsTemplate(struct Type ** typePtr, unsigned int value)
8322 {
8323 if(*typePtr && (*typePtr)->passAsTemplate != value)
8324 {
8325 struct Type * type = (type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), type->refCount = 1, type);
8326
8327 CopyTypeInto(type, *typePtr);
8328 type->passAsTemplate = value;
8329 FreeType(*typePtr);
8330 *typePtr = type;
8331 }
8332 }
8333
8334 void ReplaceExpContents(struct Expression * checkedExp, struct Expression * newExp)
8335 {
8336 struct Expression * prev = checkedExp->prev, * next = checkedExp->next;
8337
8338 FreeExpContents(checkedExp);
8339 FreeType(checkedExp->expType);
8340 FreeType(checkedExp->destType);
8341 *checkedExp = *newExp;
8342 ((newExp ? __extension__ ({
8343 void * __ecerePtrToDelete = (newExp);
8344
8345 __ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)__ecerePtrToDelete) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(__ecerePtrToDelete);
8346 }) : 0), newExp = 0);
8347 checkedExp->prev = prev;
8348 checkedExp->next = next;
8349 }
8350
8351 void FinishTemplatesContext(struct Context * context)
8352 {
8353 PopContext(context);
8354 FreeContext(context);
8355 ((context ? __extension__ ({
8356 void * __ecerePtrToDelete = (context);
8357
8358 __ecereClass_Context->Destructor ? __ecereClass_Context->Destructor((void *)__ecerePtrToDelete) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(__ecerePtrToDelete);
8359 }) : 0), context = 0);
8360 }
8361
8362 static __attribute__((unused)) void UnusedFunction()
8363 {
8364 int a;
8365
8366 (__extension__ ({
8367 const char *  (*  __internal_VirtualMethod)(struct __ecereNameSpace__ecere__com__Class * , const void * , char *  tempString, void *  fieldData, unsigned int *  needClass);
8368
8369 __internal_VirtualMethod = ((const char *  (*)(struct __ecereNameSpace__ecere__com__Class *, const void *, char *  tempString, void *  fieldData, unsigned int *  needClass))__ecereClass_int->_vTbl[__ecereVMethodID_class_OnGetString]);
8370 __internal_VirtualMethod ? __internal_VirtualMethod(__ecereClass_int, (void *)&a, 0, 0, 0) : (const char * )1;
8371 }));
8372 }
8373
8374 struct Expression * ParseExpressionString(char * expression)
8375 {
8376 parseError = 0;
8377 fileInput = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
8378 (__extension__ ({
8379 int (*  __internal_VirtualMethod)(struct __ecereNameSpace__ecere__com__Instance *, const void *  buffer, unsigned int size, unsigned int count);
8380
8381 __internal_VirtualMethod = ((int (*)(struct __ecereNameSpace__ecere__com__Instance *, const void *  buffer, unsigned int size, unsigned int count))__extension__ ({
8382 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
8383
8384 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
8385 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Write]);
8386 __internal_VirtualMethod ? __internal_VirtualMethod(fileInput, expression, 1, strlen(expression)) : (int)1;
8387 }));
8388 (__extension__ ({
8389 unsigned int (*  __internal_VirtualMethod)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode);
8390
8391 __internal_VirtualMethod = ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))__extension__ ({
8392 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
8393
8394 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
8395 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek]);
8396 __internal_VirtualMethod ? __internal_VirtualMethod(fileInput, 0, 0) : (unsigned int)1;
8397 }));
8398 echoOn = 0;
8399 parsedExpression = (((void *)0));
8400 resetScanner();
8401 expression_yyparse();
8402 (__ecereNameSpace__ecere__com__eInstance_DecRef(fileInput), fileInput = 0);
8403 return parsedExpression;
8404 }
8405
8406 struct __ecereNameSpace__ecere__com__Module
8407 {
8408 struct __ecereNameSpace__ecere__com__Instance * application;
8409 struct __ecereNameSpace__ecere__sys__OldList classes;
8410 struct __ecereNameSpace__ecere__sys__OldList defines;
8411 struct __ecereNameSpace__ecere__sys__OldList functions;
8412 struct __ecereNameSpace__ecere__sys__OldList modules;
8413 struct __ecereNameSpace__ecere__com__Instance * prev;
8414 struct __ecereNameSpace__ecere__com__Instance * next;
8415 const char *  name;
8416 void *  library;
8417 void *  Unload;
8418 int importType;
8419 int origImportType;
8420 struct __ecereNameSpace__ecere__com__NameSpace privateNameSpace;
8421 struct __ecereNameSpace__ecere__com__NameSpace publicNameSpace;
8422 } ecere_gcc_struct;
8423
8424 static struct GlobalData * FindGlobalData(char * name)
8425 {
8426 int start = 0, c;
8427 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
8428
8429 nameSpace = globalData;
8430 for(c = 0; name[c]; c++)
8431 {
8432 if(name[c] == '.' || (name[c] == ':' && name[c + 1] == ':'))
8433 {
8434 struct __ecereNameSpace__ecere__com__NameSpace * newSpace;
8435 char * spaceName = __ecereNameSpace__ecere__com__eSystem_New(sizeof(char) * (c - start + 1));
8436
8437 strncpy(spaceName, name + start, c - start);
8438 spaceName[c - start] = '\0';
8439 newSpace = (struct __ecereNameSpace__ecere__com__NameSpace *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(&(*nameSpace).nameSpaces, spaceName);
8440 (__ecereNameSpace__ecere__com__eSystem_Delete(spaceName), spaceName = 0);
8441 if(!newSpace)
8442 return (((void *)0));
8443 nameSpace = newSpace;
8444 if(name[c] == ':')
8445 c++;
8446 start = c + 1;
8447 }
8448 }
8449 if(c - start)
8450 {
8451 return ScanGlobalData(nameSpace, name + start);
8452 }
8453 return (((void *)0));
8454 }
8455
8456 static struct Symbol * FindWithNameSpace(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, const char * name)
8457 {
8458 int c;
8459 char nameSpace[1024];
8460 const char * namePart;
8461 unsigned int gotColon = 0;
8462
8463 nameSpace[0] = '\0';
8464 for(c = strlen(name) - 1; c >= 0; c--)
8465 if(name[c] == ':')
8466 {
8467 gotColon = 1;
8468 break;
8469 }
8470 namePart = name + c + 1;
8471 while(c >= 0 && name[c] == ':')
8472 c--;
8473 if(c >= 0)
8474 {
8475 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, name);
8476
8477 if(symbol)
8478 return symbol;
8479 memcpy(nameSpace, name, c + 1);
8480 nameSpace[c + 1] = 0;
8481 return ScanWithNameSpace(tree, nameSpace, namePart);
8482 }
8483 else if(gotColon)
8484 {
8485 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, namePart);
8486
8487 return symbol;
8488 }
8489 else
8490 {
8491 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, namePart);
8492
8493 if(symbol)
8494 return symbol;
8495 return ScanWithNameSpace(tree, "", namePart);
8496 }
8497 return (((void *)0));
8498 }
8499
8500 static void PrintArraySize(struct Type * arrayType, char * string)
8501 {
8502 char size[256];
8503
8504 size[0] = '\0';
8505 strcat(size, "[");
8506 if(arrayType->__anon1.__anon4.enumClass)
8507 strcat(size, arrayType->__anon1.__anon4.enumClass->string);
8508 else if(arrayType->__anon1.__anon4.arraySizeExp)
8509 PrintExpression(arrayType->__anon1.__anon4.arraySizeExp, size);
8510 strcat(size, "]");
8511 strcat(string, size);
8512 }
8513
8514 void __ecereUnregisterModule_pass15(struct __ecereNameSpace__ecere__com__Instance * module)
8515 {
8516
8517 }
8518
8519 static void PostPrintType(struct Type * type, char * string, unsigned int fullName)
8520 {
8521 if(type->kind == 13 && (type->__anon1.type->kind == 12 || type->__anon1.type->kind == 11 || type->__anon1.type->kind == 16))
8522 strcat(string, ")");
8523 if(type->kind == 12)
8524 PrintArraySize(type, string);
8525 else if(type->kind == 11)
8526 {
8527 struct Type * param;
8528
8529 strcat(string, "(");
8530 for(param = type->__anon1.__anon2.params.first; param; param = param->next)
8531 {
8532 PrintType(param, string, 1, fullName);
8533 if(param->next)
8534 strcat(string, ", ");
8535 }
8536 strcat(string, ")");
8537 }
8538 if(type->kind == 12 || type->kind == 13 || type->kind == 11 || type->kind == 16)
8539 PostPrintType(type->kind == 16 ? type->__anon1.__anon3.method->dataType : type->__anon1.type, string, fullName);
8540 }
8541
8542 static void _PrintType(struct Type * type, char * string, unsigned int printName, unsigned int fullName, unsigned int printConst)
8543 {
8544 PrePrintType(type, string, fullName, (((void *)0)), printConst);
8545 if(type->__anon1.__anon2.thisClass || (printName && type->name && type->name[0]))
8546 strcat(string, " ");
8547 if((type->__anon1.__anon2.thisClass || type->__anon1.__anon2.staticMethod))
8548 {
8549 struct Symbol * _class = type->__anon1.__anon2.thisClass;
8550
8551 if((type->classObjectType == 2 || type->classObjectType == 1) || (_class && !strcmp(_class->string, "class")))
8552 {
8553 if(type->classObjectType == 1)
8554 strcat(string, "class");
8555 else
8556 strcat(string, type->byReference ? "typed_object&" : "typed_object");
8557 }
8558 else if(_class && _class->string)
8559 {
8560 char * s = _class->string;
8561
8562 if(fullName)
8563 strcat(string, s);
8564 else
8565 {
8566 char * name = __ecereNameSpace__ecere__sys__RSearchString(s, "::", strlen(s), 1, 0);
8567
8568 if(name)
8569 name += 2;
8570 else
8571 name = s;
8572 strcat(string, name);
8573 }
8574 }
8575 strcat(string, "::");
8576 }
8577 if(printName && type->name)
8578 PrintName(type, string, fullName);
8579 PostPrintType(type, string, fullName);
8580 if(type->bitFieldCount)
8581 {
8582 char count[100];
8583
8584 sprintf(count, ":%d", type->bitFieldCount);
8585 strcat(string, count);
8586 }
8587 }
8588
8589 struct Conversion;
8590
8591 struct Conversion
8592 {
8593 struct Conversion * prev, * next;
8594 struct __ecereNameSpace__ecere__com__Property * convert;
8595 unsigned int isGet;
8596 struct Type * resultType;
8597 } ecere_gcc_struct;
8598
8599 static void FreeConvert(struct Conversion * convert)
8600 {
8601 if(convert->resultType)
8602 FreeType(convert->resultType);
8603 }
8604
8605 struct Enumerator;
8606
8607 struct Enumerator
8608 {
8609 struct Enumerator * prev;
8610 struct Enumerator * next;
8611 struct Location loc;
8612 struct Identifier * id;
8613 struct Expression * exp;
8614 } ecere_gcc_struct;
8615
8616 struct AsmField;
8617
8618 struct AsmField
8619 {
8620 struct AsmField * prev;
8621 struct AsmField * next;
8622 struct Location loc;
8623 char *  command;
8624 struct Expression * expression;
8625 struct Identifier * symbolic;
8626 } ecere_gcc_struct;
8627
8628 struct ClassDefinition;
8629
8630 struct Context
8631 {
8632 struct Context * parent;
8633 struct __ecereNameSpace__ecere__sys__BinaryTree types;
8634 struct __ecereNameSpace__ecere__sys__BinaryTree classes;
8635 struct __ecereNameSpace__ecere__sys__BinaryTree symbols;
8636 struct __ecereNameSpace__ecere__sys__BinaryTree structSymbols;
8637 int nextID;
8638 int simpleID;
8639 struct __ecereNameSpace__ecere__sys__BinaryTree templateTypes;
8640 struct ClassDefinition * classDef;
8641 unsigned int templateTypesOnly;
8642 unsigned int hasNameSpace;
8643 } ecere_gcc_struct;
8644
8645 struct External
8646 {
8647 struct External * prev;
8648 struct External * next;
8649 struct Location loc;
8650 int type;
8651 struct Symbol * symbol;
8652 union
8653 {
8654 struct FunctionDefinition * function;
8655 struct ClassDefinition * _class;
8656 struct Declaration * declaration;
8657 char *  importString;
8658 struct Identifier * id;
8659 struct DBTableDef * table;
8660 } ecere_gcc_struct __anon1;
8661 int importType;
8662 struct External * fwdDecl;
8663 struct __ecereNameSpace__ecere__com__Instance * outgoing;
8664 struct __ecereNameSpace__ecere__com__Instance * incoming;
8665 int nonBreakableIncoming;
8666 } ecere_gcc_struct;
8667
8668 struct ClassDefinition
8669 {
8670 struct ClassDefinition * prev;
8671 struct ClassDefinition * next;
8672 struct Location loc;
8673 struct Specifier * _class;
8674 struct __ecereNameSpace__ecere__sys__OldList *  baseSpecs;
8675 struct __ecereNameSpace__ecere__sys__OldList *  definitions;
8676 struct Symbol * symbol;
8677 struct Location blockStart;
8678 struct Location nameLoc;
8679 int declMode;
8680 unsigned int deleteWatchable;
8681 } ecere_gcc_struct;
8682
8683 void __ecereMethod_External_CreateUniqueEdge(struct External * this, struct External * from, unsigned int soft);
8684
8685 void __ecereMethod_External_CreateEdge(struct External * this, struct External * from, unsigned int soft);
8686
8687 void DeclareGlobalData(struct External * neededFor, struct GlobalData * data)
8688 {
8689 struct Symbol * symbol = data->symbol;
8690
8691 if(!symbol || !symbol->__anon2.__anon1.pointerExternal)
8692 {
8693 if(inCompiler)
8694 {
8695 if(!symbol)
8696 symbol = data->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
8697 }
8698 if(!data->dataType)
8699 data->dataType = ProcessTypeString(data->dataTypeString, 0);
8700 if(inCompiler)
8701 {
8702 struct Declaration * decl;
8703 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
8704 struct Declarator * d;
8705 struct External * external;
8706
8707 specifiers = MkList();
8708 declarators = MkList();
8709 ListAdd(specifiers, MkSpecifier(EXTERN));
8710 d = MkDeclaratorIdentifier(MkIdentifier(data->fullName));
8711 d = SpecDeclFromString(data->dataTypeString, specifiers, d);
8712 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
8713 decl = MkDeclaration(specifiers, declarators);
8714 external = MkExternalDeclaration(decl);
8715 if(curExternal)
8716 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
8717 external->symbol = symbol;
8718 symbol->__anon2.__anon1.pointerExternal = external;
8719 DeclareType(external, data->dataType, 1, 1);
8720 }
8721 }
8722 if(inCompiler && neededFor && symbol && symbol->__anon2.__anon1.pointerExternal)
8723 __ecereMethod_External_CreateUniqueEdge(neededFor, symbol->__anon2.__anon1.pointerExternal, 0);
8724 }
8725
8726 struct Symbol * FindSymbol(const char * name, struct Context * startContext, struct Context * endContext, unsigned int isStruct, unsigned int globalNameSpace)
8727 {
8728 struct Context * ctx;
8729 struct Symbol * symbol = (((void *)0));
8730
8731 for(ctx = startContext; ctx && !symbol; ctx = ctx->parent)
8732 {
8733 if(ctx == globalContext && !globalNameSpace && ctx->hasNameSpace)
8734 {
8735 symbol = (((void *)0));
8736 if(thisNameSpace)
8737 {
8738 char curName[1024];
8739
8740 strcpy(curName, thisNameSpace);
8741 strcat(curName, "::");
8742 strcat(curName, name);
8743 symbol = FindWithNameSpace(isStruct ? &ctx->structSymbols : &ctx->symbols, curName);
8744 }
8745 if(!symbol)
8746 symbol = FindWithNameSpace(isStruct ? &ctx->structSymbols : &ctx->symbols, name);
8747 }
8748 else
8749 symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString((isStruct ? &ctx->structSymbols : &ctx->symbols), name);
8750 if(symbol || ctx == endContext)
8751 break;
8752 }
8753 if(inCompiler && symbol && ctx == globalContext && symbol->__anon2.__anon1.pointerExternal && curExternal && symbol->__anon2.__anon1.pointerExternal != curExternal)
8754 __ecereMethod_External_CreateUniqueEdge(curExternal, symbol->__anon2.__anon1.pointerExternal, symbol->__anon2.__anon1.pointerExternal->type == 0);
8755 return symbol;
8756 }
8757
8758 struct PropertyDef;
8759
8760 struct ClassDef
8761 {
8762 struct ClassDef * prev;
8763 struct ClassDef * next;
8764 struct Location loc;
8765 int type;
8766 union
8767 {
8768 struct Declaration * decl;
8769 struct ClassFunction * function;
8770 struct __ecereNameSpace__ecere__sys__OldList *  defProperties;
8771 struct PropertyDef * propertyDef;
8772 struct PropertyWatch * propertyWatch;
8773 char *  designer;
8774 struct Identifier * defaultProperty;
8775 struct
8776 {
8777 struct Identifier * id;
8778 struct Initializer * initializer;
8779 } ecere_gcc_struct __anon1;
8780 } ecere_gcc_struct __anon1;
8781 int memberAccess;
8782 void *  object;
8783 } ecere_gcc_struct;
8784
8785 struct PropertyDef
8786 {
8787 struct PropertyDef * prev;
8788 struct PropertyDef * next;
8789 struct Location loc;
8790 struct __ecereNameSpace__ecere__sys__OldList *  specifiers;
8791 struct Declarator * declarator;
8792 struct Identifier * id;
8793 struct Statement * getStmt;
8794 struct Statement * setStmt;
8795 struct Statement * issetStmt;
8796 struct Symbol * symbol;
8797 struct Expression * category;
8798 struct
8799 {
8800 unsigned int conversion : 1;
8801 unsigned int isWatchable : 1;
8802 unsigned int isDBProp : 1;
8803 } ecere_gcc_struct __anon1;
8804 } ecere_gcc_struct;
8805
8806 static void IdentifyAnonStructs(struct __ecereNameSpace__ecere__sys__OldList * definitions)
8807 {
8808 struct ClassDef * def;
8809 int anonID = 1;
8810
8811 for(def = (*definitions).first; def; def = def->next)
8812 {
8813 if(def->type == 2)
8814 {
8815 struct Declaration * decl = def->__anon1.decl;
8816
8817 if(decl && decl->__anon1.__anon1.specifiers)
8818 {
8819 struct Specifier * spec;
8820 unsigned int isStruct = 0;
8821
8822 for(spec = (*decl->__anon1.__anon1.specifiers).first; spec; spec = spec->next)
8823 {
8824 if(spec->type == 3 || spec->type == 4)
8825 {
8826 if(spec->__anon1.__anon2.definitions)
8827 IdentifyAnonStructs(spec->__anon1.__anon2.definitions);
8828 isStruct = 1;
8829 }
8830 }
8831 if(isStruct)
8832 {
8833 struct Declarator * d = (((void *)0));
8834
8835 if(decl->__anon1.__anon1.declarators)
8836 {
8837 for(d = (*decl->__anon1.__anon1.declarators).first; d; d = d->next)
8838 {
8839 struct Identifier * idDecl = GetDeclId(d);
8840
8841 if(idDecl)
8842 break;
8843 }
8844 }
8845 if(!d)
8846 {
8847 char id[100];
8848
8849 sprintf(id, "__anon%d", anonID++);
8850 if(!decl->__anon1.__anon1.declarators)
8851 decl->__anon1.__anon1.declarators = MkList();
8852 ListAdd(decl->__anon1.__anon1.declarators, MkDeclaratorIdentifier(MkIdentifier(id)));
8853 }
8854 }
8855 }
8856 }
8857 }
8858 }
8859
8860 struct MemberInit;
8861
8862 typedef union YYSTYPE
8863 {
8864 int specifierType;
8865 int i;
8866 int declMode;
8867 struct Identifier * id;
8868 struct Expression * exp;
8869 struct Specifier * specifier;
8870 struct __ecereNameSpace__ecere__sys__OldList * list;
8871 struct Enumerator * enumerator;
8872 struct Declarator * declarator;
8873 struct Pointer * pointer;
8874 struct Initializer * initializer;
8875 struct InitDeclarator * initDeclarator;
8876 struct TypeName * typeName;
8877 struct Declaration * declaration;
8878 struct Statement * stmt;
8879 struct FunctionDefinition * function;
8880 struct External * external;
8881 struct Context * context;
8882 struct AsmField * asmField;
8883 struct Attrib * attrib;
8884 struct ExtDecl * extDecl;
8885 struct Attribute * attribute;
8886 struct Instantiation * instance;
8887 struct MembersInit * membersInit;
8888 struct MemberInit * memberInit;
8889 struct ClassFunction * classFunction;
8890 struct ClassDefinition * _class;
8891 struct ClassDef * classDef;
8892 struct PropertyDef * prop;
8893 char * string;
8894 struct Symbol * symbol;
8895 struct PropertyWatch * propertyWatch;
8896 struct TemplateParameter * templateParameter;
8897 struct TemplateArgument * templateArgument;
8898 struct TemplateDatatype * templateDatatype;
8899 struct DBTableEntry * dbtableEntry;
8900 struct DBIndexItem * dbindexItem;
8901 struct DBTableDef * dbtableDef;
8902 } ecere_gcc_struct YYSTYPE;
8903
8904 extern YYSTYPE yylval;
8905
8906 struct MemberInit
8907 {
8908 struct MemberInit * prev;
8909 struct MemberInit * next;
8910 struct Location loc;
8911 struct Location realLoc;
8912 struct __ecereNameSpace__ecere__sys__OldList *  identifiers;
8913 struct Initializer * initializer;
8914 unsigned int used;
8915 unsigned int variable;
8916 unsigned int takeOutExp;
8917 } ecere_gcc_struct;
8918
8919 extern struct MemberInit * MkMemberInit(struct __ecereNameSpace__ecere__sys__OldList * ids, struct Initializer * initializer);
8920
8921 struct __ecereNameSpace__ecere__com__ClassTemplateParameter;
8922
8923 struct __ecereNameSpace__ecere__com__ClassTemplateParameter
8924 {
8925 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * prev;
8926 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * next;
8927 const char *  name;
8928 int type;
8929 union
8930 {
8931 const char *  dataTypeString;
8932 int memberType;
8933 } ecere_gcc_struct __anon1;
8934 struct __ecereNameSpace__ecere__com__ClassTemplateArgument defaultArg;
8935 void *  param;
8936 } ecere_gcc_struct;
8937
8938 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * FindTemplateArg(struct __ecereNameSpace__ecere__com__Class * _class, struct TemplateParameter * param)
8939 {
8940 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * arg = (((void *)0));
8941 int id = 0;
8942 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
8943 struct __ecereNameSpace__ecere__com__Class * sClass;
8944
8945 for(sClass = _class; sClass; sClass = sClass->base)
8946 {
8947 id = 0;
8948 if(sClass->templateClass)
8949 sClass = sClass->templateClass;
8950 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
8951 {
8952 if(curParam->type == 0 && !strcmp(param->identifier->string, curParam->name))
8953 {
8954 for(sClass = sClass->base; sClass; sClass = sClass->base)
8955 {
8956 if(sClass->templateClass)
8957 sClass = sClass->templateClass;
8958 id += sClass->templateParams.count;
8959 }
8960 break;
8961 }
8962 id++;
8963 }
8964 if(curParam)
8965 break;
8966 }
8967 if(curParam)
8968 {
8969 arg = &_class->templateArgs[id];
8970 if(arg && param->type == 0)
8971 (*arg).__anon1.__anon1.dataTypeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, (*arg).__anon1.__anon1.dataTypeString);
8972 }
8973 return arg;
8974 }
8975
8976 struct Context * SetupTemplatesContext(struct __ecereNameSpace__ecere__com__Class * _class)
8977 {
8978 struct Context * context = PushContext();
8979
8980 context->templateTypesOnly = 1;
8981 if(_class->symbol && ((struct Symbol *)_class->symbol)->templateParams)
8982 {
8983 struct TemplateParameter * param = (*((struct Symbol *)_class->symbol)->templateParams).first;
8984
8985 for(; param; param = param->next)
8986 {
8987 if(param->type == 0 && param->identifier)
8988 {
8989 struct TemplatedType * type = (type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TemplatedType), type->key = (uintptr_t)param->identifier->string, type->param = param, type);
8990
8991 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&curContext->templateTypes, (struct __ecereNameSpace__ecere__sys__BTNode *)type);
8992 }
8993 }
8994 }
8995 else if(_class)
8996 {
8997 struct __ecereNameSpace__ecere__com__Class * sClass;
8998
8999 for(sClass = _class; sClass; sClass = sClass->base)
9000 {
9001 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * p;
9002
9003 for(p = sClass->templateParams.first; p; p = p->next)
9004 {
9005 if(p->type == 0)
9006 {
9007 struct TemplateParameter * param = p->param;
9008 struct TemplatedType * type;
9009
9010 if(!param)
9011 {
9012 p->param = param = __extension__ ({
9013 struct TemplateParameter * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TemplateParameter);
9014
9015 __ecereInstance1->identifier = MkIdentifier(p->name), __ecereInstance1->type = p->type, __ecereInstance1->dataTypeString = p->__anon1.dataTypeString, __ecereInstance1;
9016 });
9017 }
9018 type = __extension__ ({
9019 struct TemplatedType * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TemplatedType);
9020
9021 __ecereInstance1->key = (uintptr_t)p->name, __ecereInstance1->param = param, __ecereInstance1;
9022 });
9023 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&curContext->templateTypes, (struct __ecereNameSpace__ecere__sys__BTNode *)type);
9024 }
9025 }
9026 }
9027 }
9028 return context;
9029 }
9030
9031 char * ReplaceThisClass(struct __ecereNameSpace__ecere__com__Class * _class)
9032 {
9033 if(thisClassParams && _class->templateParams.count && !_class->templateClass)
9034 {
9035 unsigned int first = 1;
9036 int p = 0;
9037 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
9038 int lastParam = -1;
9039 char className[1024];
9040
9041 strcpy(className, _class->fullName);
9042 for(param = _class->templateParams.first; param; param = param->next)
9043 {
9044 {
9045 if(first)
9046 strcat(className, "<");
9047 if(!first)
9048 strcat(className, ", ");
9049 if(lastParam + 1 != p)
9050 {
9051 strcat(className, param->name);
9052 strcat(className, " = ");
9053 }
9054 strcat(className, param->name);
9055 first = 0;
9056 lastParam = p;
9057 }
9058 p++;
9059 }
9060 if(!first)
9061 {
9062 int len = strlen(className);
9063
9064 if(className[len - 1] == '>')
9065 className[len++] = ' ';
9066 className[len++] = '>';
9067 className[len++] = '\0';
9068 }
9069 return __ecereNameSpace__ecere__sys__CopyString(className);
9070 }
9071 else
9072 return __ecereNameSpace__ecere__sys__CopyString(_class->fullName);
9073 }
9074
9075 struct Type * ReplaceThisClassType(struct __ecereNameSpace__ecere__com__Class * _class)
9076 {
9077 struct Type * type;
9078
9079 if(thisClassParams && _class->templateParams.count && !_class->templateClass)
9080 {
9081 unsigned int first = 1;
9082 int p = 0;
9083 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
9084 int lastParam = -1;
9085 char className[1024];
9086
9087 strcpy(className, _class->fullName);
9088 for(param = _class->templateParams.first; param; param = param->next)
9089 {
9090 {
9091 if(first)
9092 strcat(className, "<");
9093 if(!first)
9094 strcat(className, ", ");
9095 if(lastParam + 1 != p)
9096 {
9097 strcat(className, param->name);
9098 strcat(className, " = ");
9099 }
9100 strcat(className, param->name);
9101 first = 0;
9102 lastParam = p;
9103 }
9104 p++;
9105 }
9106 if(!first)
9107 {
9108 int len = strlen(className);
9109
9110 if(className[len - 1] == '>')
9111 className[len++] = ' ';
9112 className[len++] = '>';
9113 className[len++] = '\0';
9114 }
9115 type = MkClassType(className);
9116 }
9117 else
9118 {
9119 type = MkClassType(_class->fullName);
9120 }
9121 return type;
9122 }
9123
9124 static int DeclareMembers(struct External * neededBy, struct __ecereNameSpace__ecere__com__Class * _class, unsigned int isMember)
9125 {
9126 struct __ecereNameSpace__ecere__com__DataMember * topMember = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
9127 struct __ecereNameSpace__ecere__com__DataMember * member;
9128 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
9129
9130 if(!isMember && (_class->type == 1 || _class->type == 5) && _class->base->type != 1000)
9131 DeclareMembers(neededBy, _class->base, 0);
9132 for(member = isMember ? topMember->members.first : _class->membersAndProperties.first; member; member = member->next)
9133 {
9134 if(!member->isProperty)
9135 {
9136 switch(member->type)
9137 {
9138 case 0:
9139 {
9140 if(!member->dataType && member->dataTypeString)
9141 member->dataType = ProcessTypeString(member->dataTypeString, 0);
9142 if(member->dataType)
9143 DeclareType(neededBy, member->dataType, 1, 0);
9144 break;
9145 }
9146 case 1:
9147 case 2:
9148 {
9149 DeclareMembers(neededBy, (struct __ecereNameSpace__ecere__com__Class *)member, 1);
9150 break;
9151 }
9152 }
9153 }
9154 }
9155 if(context)
9156 FinishTemplatesContext(context);
9157 return topMember ? topMember->memberID : _class->memberID;
9158 }
9159
9160 void ProcessMethodType(struct __ecereNameSpace__ecere__com__Method * method)
9161 {
9162 if(!method->dataType)
9163 {
9164 struct Context * context = SetupTemplatesContext(method->_class);
9165
9166 method->dataType = ProcessTypeString(method->dataTypeString, 0);
9167 FinishTemplatesContext(context);
9168 if(method->type != 1 && method->dataType)
9169 {
9170 if(!method->dataType->__anon1.__anon2.thisClass && !method->dataType->__anon1.__anon2.staticMethod)
9171 {
9172 if(!method->_class->symbol)
9173 method->_class->symbol = FindClass(method->_class->fullName);
9174 method->dataType->__anon1.__anon2.thisClass = method->_class->symbol;
9175 }
9176 }
9177 }
9178 }
9179
9180 void ProcessPropertyType(struct __ecereNameSpace__ecere__com__Property * prop)
9181 {
9182 if(!prop->dataType)
9183 {
9184 struct Context * context = SetupTemplatesContext(prop->_class);
9185
9186 prop->dataType = ProcessTypeString(prop->dataTypeString, 0);
9187 FinishTemplatesContext(context);
9188 }
9189 }
9190
9191 void ReplaceThisClassSpecifiers(struct __ecereNameSpace__ecere__sys__OldList * specs, struct __ecereNameSpace__ecere__com__Class * _class)
9192 {
9193 if(specs != (((void *)0)) && _class)
9194 {
9195 struct Specifier * spec;
9196
9197 for(spec = specs->first; spec; spec = spec->next)
9198 {
9199 if(spec->type == 0 && spec->__anon1.specifier == THISCLASS)
9200 {
9201 spec->type = 1;
9202 spec->__anon1.__anon1.name = ReplaceThisClass(_class);
9203 spec->__anon1.__anon1.symbol = FindClass(spec->__anon1.__anon1.name);
9204 }
9205 }
9206 }
9207 }
9208
9209 static unsigned int ResolveIdWithClass(struct Expression * exp, struct __ecereNameSpace__ecere__com__Class * _class, unsigned int skipIDClassCheck)
9210 {
9211 struct Identifier * id = exp->__anon1.__anon1.identifier;
9212 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
9213 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
9214 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
9215 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
9216
9217 if(_class && _class->type == 4)
9218 {
9219 struct __ecereNameSpace__ecere__sys__NamedLink64 * value = (((void *)0));
9220 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
9221
9222 if(enumClass)
9223 {
9224 struct __ecereNameSpace__ecere__com__Class * baseClass;
9225
9226 for(baseClass = _class; baseClass && baseClass->type == 4; baseClass = baseClass->base)
9227 {
9228 struct __ecereNameSpace__ecere__com__EnumClassData * e = (baseClass ? ((void *)(((char *)baseClass->data) + enumClass->offsetClass)) : (((void *)0)));
9229
9230 for(value = e->values.first; value; value = value->next)
9231 {
9232 if(!strcmp(value->name, id->string))
9233 break;
9234 }
9235 if(value)
9236 {
9237 exp->isConstant = 1;
9238 if(inCompiler || inPreCompiler || inDebugger)
9239 {
9240 char constant[256];
9241
9242 FreeExpContents(exp);
9243 exp->type = 2;
9244 if(!strcmp(baseClass->dataTypeString, "int") || !strcmp(baseClass->dataTypeString, "int64") || !strcmp(baseClass->dataTypeString, "char") || !strcmp(baseClass->dataTypeString, "short"))
9245 sprintf(constant, ((__runtimePlatform == 1) ? "%I64d" : "%lld"), value->data);
9246 else
9247 sprintf(constant, ((__runtimePlatform == 1) ? "0x%I64X" : "0x%llX"), value->data);
9248 exp->__anon1.__anon1.constant = __ecereNameSpace__ecere__sys__CopyString(constant);
9249 }
9250 exp->expType = MkClassType(baseClass->fullName);
9251 break;
9252 }
9253 }
9254 }
9255 if(value)
9256 return 1;
9257 }
9258 if((method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule)))
9259 {
9260 ProcessMethodType(method);
9261 exp->expType = __extension__ ({
9262 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
9263
9264 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 16, __ecereInstance1->__anon1.__anon3.method = method, __ecereInstance1->__anon1.__anon3.methodClass = (skipIDClassCheck || (id && id->_class)) ? _class : (((void *)0)), __ecereInstance1;
9265 });
9266 return 1;
9267 }
9268 else if((prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule)))
9269 {
9270 if(!prop->dataType)
9271 ProcessPropertyType(prop);
9272 exp->expType = prop->dataType;
9273 if(prop->dataType)
9274 prop->dataType->refCount++;
9275 return 1;
9276 }
9277 else if((member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)))))
9278 {
9279 if(!member->dataType)
9280 member->dataType = ProcessTypeString(member->dataTypeString, 0);
9281 exp->expType = member->dataType;
9282 if(member->dataType)
9283 member->dataType->refCount++;
9284 return 1;
9285 }
9286 else if((classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(_class, id->string)))
9287 {
9288 if(!classProp->dataType)
9289 classProp->dataType = ProcessTypeString(classProp->dataTypeString, 0);
9290 if(classProp->constant)
9291 {
9292 FreeExpContents(exp);
9293 exp->isConstant = 1;
9294 if(classProp->dataType->kind == 13 && classProp->dataType->__anon1.type->kind == 1)
9295 {
9296 exp->type = 3;
9297 exp->__anon1.__anon1.constant = QMkString((char *)(uintptr_t)classProp->Get(_class));
9298 }
9299 else
9300 {
9301 char constant[256];
9302
9303 exp->type = 2;
9304 sprintf(constant, "%d", (int)classProp->Get(_class));
9305 exp->__anon1.__anon1.constant = __ecereNameSpace__ecere__sys__CopyString(constant);
9306 }
9307 }
9308 else
9309 {
9310 }
9311 exp->expType = classProp->dataType;
9312 if(classProp->dataType)
9313 classProp->dataType->refCount++;
9314 return 1;
9315 }
9316 return 0;
9317 }
9318
9319 void DeclareProperty(struct External * neededBy, struct __ecereNameSpace__ecere__com__Property * prop, char * setName, char * getName)
9320 {
9321 struct Symbol * symbol = prop->symbol;
9322 unsigned int imported = 0;
9323 unsigned int dllImport = 0;
9324 struct External * structExternal = (((void *)0));
9325 struct External * instExternal = (((void *)0));
9326
9327 strcpy(setName, "__ecereProp_");
9328 FullClassNameCat(setName, prop->_class->fullName, 0);
9329 strcat(setName, "_Set_");
9330 FullClassNameCat(setName, prop->name, 1);
9331 strcpy(getName, "__ecereProp_");
9332 FullClassNameCat(getName, prop->_class->fullName, 0);
9333 strcat(getName, "_Get_");
9334 FullClassNameCat(getName, prop->name, 1);
9335 if(!symbol || symbol->_import)
9336 {
9337 if(!symbol)
9338 {
9339 struct Symbol * classSym;
9340
9341 if(!prop->_class->symbol)
9342 prop->_class->symbol = FindClass(prop->_class->fullName);
9343 classSym = prop->_class->symbol;
9344 if(classSym && !classSym->_import)
9345 {
9346 struct ModuleImport * module;
9347
9348 if(prop->_class->module)
9349 module = FindModule(prop->_class->module);
9350 else
9351 module = mainModule;
9352 classSym->_import = __extension__ ({
9353 struct ClassImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_ClassImport);
9354
9355 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(prop->_class->fullName), __ecereInstance1->isRemote = prop->_class->isRemote, __ecereInstance1;
9356 });
9357 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->classes, classSym->_import);
9358 }
9359 symbol = prop->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
9360 symbol->_import = (struct ClassImport *)__extension__ ({
9361 struct PropertyImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_PropertyImport);
9362
9363 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(prop->name), __ecereInstance1->isVirtual = 0, __ecereInstance1->hasSet = prop->Set ? 1 : 0, __ecereInstance1->hasGet = prop->Get ? 1 : 0, __ecereInstance1;
9364 });
9365 if(classSym)
9366 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&classSym->_import->properties, symbol->_import);
9367 }
9368 imported = 1;
9369 if((prop->_class->module != privateModule || !strcmp(prop->_class->name, "float") || !strcmp(prop->_class->name, "double")) && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)prop->_class->module + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->importType != 1)
9370 dllImport = 1;
9371 }
9372 if(!symbol->type)
9373 {
9374 struct Context * context = SetupTemplatesContext(prop->_class);
9375
9376 symbol->type = ProcessTypeString(prop->dataTypeString, 0);
9377 FinishTemplatesContext(context);
9378 }
9379 if((prop->Get && !symbol->__anon2.__anon2.externalGet) || (prop->Set && !symbol->__anon2.__anon2.externalSet))
9380 {
9381 if(prop->_class->type == 0 && prop->_class->structSize)
9382 instExternal = DeclareStruct((((void *)0)), "ecere::com::Instance", 0, 1);
9383 structExternal = DeclareStruct((((void *)0)), prop->_class->fullName, prop->_class->type != 1, 0);
9384 }
9385 if(prop->Get && !symbol->__anon2.__anon2.externalGet)
9386 {
9387 struct Declaration * decl;
9388 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
9389 struct Declarator * d;
9390 struct __ecereNameSpace__ecere__sys__OldList * params;
9391 struct Specifier * spec = (((void *)0));
9392 struct External * external;
9393 struct Declarator * typeDecl;
9394 unsigned int simple = 0;
9395 unsigned int needReference;
9396
9397 specifiers = MkList();
9398 declarators = MkList();
9399 params = MkList();
9400 ListAdd(params, MkTypeName(MkListOne(MkSpecifierName(prop->_class->fullName)), MkDeclaratorIdentifier(MkIdentifier("this"))));
9401 d = MkDeclaratorIdentifier(MkIdentifier(getName));
9402 if(dllImport)
9403 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
9404 {
9405 struct Context * context = SetupTemplatesContext(prop->_class);
9406
9407 typeDecl = SpecDeclFromString(prop->dataTypeString, specifiers, (((void *)0)));
9408 FinishTemplatesContext(context);
9409 }
9410 needReference = !typeDecl || typeDecl->type == 1;
9411 for(spec = (*specifiers).first; spec; spec = spec->next)
9412 {
9413 if(spec->type == 1)
9414 {
9415 struct Symbol * classSym = spec->__anon1.__anon1.symbol;
9416
9417 if(needReference)
9418 {
9419 symbol->_class = classSym->__anon1.registered;
9420 if(classSym->__anon1.registered && classSym->__anon1.registered->type == 1)
9421 simple = 1;
9422 }
9423 break;
9424 }
9425 }
9426 if(!simple)
9427 d = PlugDeclarator(typeDecl, d);
9428 else
9429 {
9430 ListAdd(params, MkTypeName(specifiers, PlugDeclarator(typeDecl, MkDeclaratorIdentifier(MkIdentifier("value")))));
9431 specifiers = MkList();
9432 }
9433 d = MkDeclaratorFunction(d, params);
9434 if(dllImport)
9435 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
9436 else if(prop->_class->symbol && ((struct Symbol *)prop->_class->symbol)->isStatic)
9437 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
9438 if(simple)
9439 ListAdd(specifiers, MkSpecifier(VOID));
9440 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
9441 decl = MkDeclaration(specifiers, declarators);
9442 external = MkExternalDeclaration(decl);
9443 if(structExternal)
9444 __ecereMethod_External_CreateEdge(external, structExternal, 0);
9445 if(instExternal)
9446 __ecereMethod_External_CreateEdge(external, instExternal, 0);
9447 if(spec)
9448 DeclareStruct(external, spec->__anon1.__anon1.name, 0, needReference);
9449 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*ast), external);
9450 external->symbol = symbol;
9451 symbol->__anon2.__anon2.externalGet = external;
9452 ReplaceThisClassSpecifiers(specifiers, prop->_class);
9453 if(typeDecl)
9454 FreeDeclarator(typeDecl);
9455 }
9456 if(prop->Set && !symbol->__anon2.__anon2.externalSet)
9457 {
9458 struct Declaration * decl;
9459 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
9460 struct Declarator * d;
9461 struct __ecereNameSpace__ecere__sys__OldList * params;
9462 struct Specifier * spec = (((void *)0));
9463 struct External * external;
9464 struct Declarator * typeDecl;
9465 unsigned int needReference;
9466
9467 declarators = MkList();
9468 params = MkList();
9469 if(!prop->conversion || prop->_class->type == 1)
9470 {
9471 ListAdd(params, MkTypeName(MkListOne(MkSpecifierName(prop->_class->fullName)), MkDeclaratorIdentifier(MkIdentifier("this"))));
9472 }
9473 specifiers = MkList();
9474 {
9475 struct Context * context = SetupTemplatesContext(prop->_class);
9476
9477 typeDecl = d = SpecDeclFromString(prop->dataTypeString, specifiers, MkDeclaratorIdentifier(MkIdentifier("value")));
9478 FinishTemplatesContext(context);
9479 }
9480 if(!strcmp(prop->_class->base->fullName, "eda::Row") || !strcmp(prop->_class->base->fullName, "eda::Id"))
9481 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(CONST));
9482 ListAdd(params, MkTypeName(specifiers, d));
9483 d = MkDeclaratorIdentifier(MkIdentifier(setName));
9484 if(dllImport)
9485 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
9486 d = MkDeclaratorFunction(d, params);
9487 needReference = !typeDecl || typeDecl->type == 1;
9488 for(spec = (*specifiers).first; spec; spec = spec->next)
9489 {
9490 if(spec->type == 1)
9491 {
9492 struct Symbol * classSym = spec->__anon1.__anon1.symbol;
9493
9494 if(needReference)
9495 symbol->_class = classSym->__anon1.registered;
9496 break;
9497 }
9498 }
9499 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
9500 specifiers = MkList();
9501 if(dllImport)
9502 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
9503 else if(prop->_class->symbol && ((struct Symbol *)prop->_class->symbol)->isStatic)
9504 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
9505 if(!prop->conversion || prop->_class->type == 1)
9506 ListAdd(specifiers, MkSpecifier(VOID));
9507 else
9508 ListAdd(specifiers, MkSpecifierName(prop->_class->fullName));
9509 decl = MkDeclaration(specifiers, declarators);
9510 external = MkExternalDeclaration(decl);
9511 if(structExternal)
9512 __ecereMethod_External_CreateEdge(external, structExternal, 0);
9513 if(instExternal)
9514 __ecereMethod_External_CreateEdge(external, instExternal, 0);
9515 if(spec)
9516 DeclareStruct(external, spec->__anon1.__anon1.name, 0, needReference);
9517 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*ast), external);
9518 external->symbol = symbol;
9519 symbol->__anon2.__anon2.externalSet = external;
9520 ReplaceThisClassSpecifiers(specifiers, prop->_class);
9521 }
9522 if(!symbol->__anon2.__anon2.externalPtr)
9523 {
9524 struct Declaration * decl;
9525 struct External * external;
9526 struct __ecereNameSpace__ecere__sys__OldList * specifiers = MkList();
9527 char propName[1024];
9528
9529 if(imported)
9530 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
9531 else
9532 {
9533 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
9534 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*specifiers), MkSpecifierExtended(MkExtDeclAttrib(MkAttrib(ATTRIB, MkListOne(MkAttribute(__ecereNameSpace__ecere__sys__CopyString("unused"), (((void *)0))))))));
9535 }
9536 ListAdd(specifiers, MkSpecifierName("Property"));
9537 strcpy(propName, "__ecereProp_");
9538 FullClassNameCat(propName, prop->_class->fullName, 0);
9539 strcat(propName, "_");
9540 FullClassNameCat(propName, prop->name, 1);
9541 {
9542 struct __ecereNameSpace__ecere__sys__OldList * list = MkList();
9543
9544 ListAdd(list, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(propName)), (((void *)0))));
9545 if(!imported)
9546 {
9547 strcpy(propName, "__ecerePropM_");
9548 FullClassNameCat(propName, prop->_class->fullName, 0);
9549 strcat(propName, "_");
9550 FullClassNameCat(propName, prop->name, 1);
9551 ListAdd(list, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(propName)), (((void *)0))));
9552 }
9553 decl = MkDeclaration(specifiers, list);
9554 }
9555 external = MkExternalDeclaration(decl);
9556 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
9557 external->symbol = symbol;
9558 symbol->__anon2.__anon2.externalPtr = external;
9559 }
9560 if(inCompiler && neededBy)
9561 {
9562 if(symbol->__anon2.__anon2.externalPtr)
9563 __ecereMethod_External_CreateUniqueEdge(neededBy, symbol->__anon2.__anon2.externalPtr, 0);
9564 if(symbol->__anon2.__anon2.externalGet)
9565 __ecereMethod_External_CreateUniqueEdge(neededBy, symbol->__anon2.__anon2.externalGet, symbol->__anon2.__anon2.externalGet->type == 0);
9566 if(symbol->__anon2.__anon2.externalSet)
9567 __ecereMethod_External_CreateUniqueEdge(neededBy, symbol->__anon2.__anon2.externalSet, symbol->__anon2.__anon2.externalSet->type == 0);
9568 }
9569 }
9570
9571 static void ProcessDeclarator(struct Declarator *  decl, unsigned int isFunction);
9572
9573 void DeclareMethod(struct External * neededFor, struct __ecereNameSpace__ecere__com__Method * method, const char * name)
9574 {
9575 struct Symbol * symbol = method->symbol;
9576
9577 if(!symbol || (!symbol->__anon2.__anon1.pointerExternal && (!symbol->__anon2.__anon3.methodCodeExternal || method->type == 1)))
9578 {
9579 unsigned int dllImport = 0;
9580
9581 if(!method->dataType)
9582 method->dataType = ProcessTypeString(method->dataTypeString, 0);
9583 {
9584 if(!symbol || method->type == 1)
9585 {
9586 struct Symbol * classSym;
9587
9588 if(!method->_class->symbol)
9589 method->_class->symbol = FindClass(method->_class->fullName);
9590 classSym = method->_class->symbol;
9591 if(!classSym->_import)
9592 {
9593 struct ModuleImport * module;
9594
9595 if(method->_class->module && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)method->_class->module + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->name)
9596 module = FindModule(method->_class->module);
9597 else
9598 module = mainModule;
9599 classSym->_import = __extension__ ({
9600 struct ClassImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_ClassImport);
9601
9602 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(method->_class->fullName), __ecereInstance1->isRemote = method->_class->isRemote, __ecereInstance1;
9603 });
9604 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->classes, classSym->_import);
9605 }
9606 if(!symbol)
9607 {
9608 symbol = method->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
9609 }
9610 if(!symbol->_import)
9611 {
9612 symbol->_import = (struct ClassImport *)__extension__ ({
9613 struct MethodImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_MethodImport);
9614
9615 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(method->name), __ecereInstance1->isVirtual = method->type == 1, __ecereInstance1;
9616 });
9617 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&classSym->_import->methods, symbol->_import);
9618 }
9619 if(!symbol)
9620 {
9621 symbol->type = method->dataType;
9622 if(symbol->type)
9623 symbol->type->refCount++;
9624 }
9625 }
9626 if(!method->dataType->dllExport)
9627 {
9628 if((method->_class->module != privateModule || !strcmp(method->_class->name, "float") || !strcmp(method->_class->name, "double")) && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)method->_class->module + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->importType != 1)
9629 dllImport = 1;
9630 }
9631 }
9632 if(inCompiler)
9633 {
9634 struct Declaration * decl;
9635 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
9636 struct Declarator * d;
9637 struct Declarator * funcDecl;
9638 struct External * external;
9639
9640 specifiers = MkList();
9641 declarators = MkList();
9642 if(dllImport)
9643 ListAdd(specifiers, MkSpecifier(EXTERN));
9644 else if(method->_class->symbol && ((struct Symbol *)method->_class->symbol)->isStatic)
9645 ListAdd(specifiers, MkSpecifier(STATIC));
9646 if(method->type == 1)
9647 {
9648 ListAdd(specifiers, MkSpecifier(INT));
9649 d = MkDeclaratorIdentifier(MkIdentifier(name));
9650 }
9651 else
9652 {
9653 d = MkDeclaratorIdentifier(MkIdentifier(name));
9654 if(dllImport)
9655 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
9656 {
9657 struct Context * context = SetupTemplatesContext(method->_class);
9658
9659 d = SpecDeclFromString(method->dataTypeString, specifiers, d);
9660 FinishTemplatesContext(context);
9661 }
9662 funcDecl = GetFuncDecl(d);
9663 if(dllImport)
9664 {
9665 struct Specifier * spec, * next;
9666
9667 for(spec = (*specifiers).first; spec; spec = next)
9668 {
9669 next = spec->next;
9670 if(spec->type == 5)
9671 {
9672 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*specifiers), spec);
9673 FreeSpecifier(spec);
9674 }
9675 }
9676 }
9677 if(method->dataType && !method->dataType->__anon1.__anon2.staticMethod)
9678 {
9679 if(funcDecl && funcDecl->__anon1.function.parameters && (*funcDecl->__anon1.function.parameters).count)
9680 {
9681 struct __ecereNameSpace__ecere__com__Class * _class = method->dataType->__anon1.__anon2.thisClass ? method->dataType->__anon1.__anon2.thisClass->__anon1.registered : method->_class;
9682 struct TypeName * thisParam = MkTypeName(MkListOne(MkSpecifierName(method->dataType->__anon1.__anon2.thisClass ? method->dataType->__anon1.__anon2.thisClass->string : method->_class->fullName)), (_class && _class->type == 1000) ? MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier("this"))) : MkDeclaratorIdentifier(MkIdentifier("this")));
9683 struct TypeName * firstParam = ((struct TypeName *)(*funcDecl->__anon1.function.parameters).first);
9684 struct Specifier * firstSpec = firstParam->qualifiers ? (*firstParam->qualifiers).first : (((void *)0));
9685
9686 if(firstSpec && firstSpec->type == 0 && firstSpec->__anon1.specifier == VOID && !firstParam->declarator)
9687 {
9688 struct TypeName * param = (*funcDecl->__anon1.function.parameters).first;
9689
9690 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->__anon1.function.parameters), param);
9691 FreeTypeName(param);
9692 }
9693 if(!funcDecl->__anon1.function.parameters)
9694 funcDecl->__anon1.function.parameters = MkList();
9695 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->__anon1.function.parameters), (((void *)0)), thisParam);
9696 }
9697 }
9698 }
9699 ProcessDeclarator(d, 1);
9700 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
9701 decl = MkDeclaration(specifiers, declarators);
9702 ReplaceThisClassSpecifiers(specifiers, method->_class);
9703 external = MkExternalDeclaration(decl);
9704 external->symbol = symbol;
9705 symbol->__anon2.__anon1.pointerExternal = external;
9706 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*ast), external);
9707 DeclareStruct(external, method->_class->fullName, 1, 1);
9708 if(method->dataType)
9709 DeclareType(external, method->dataType, 1, 1);
9710 }
9711 }
9712 if(inCompiler && neededFor)
9713 {
9714 struct External * external = symbol->__anon2.__anon1.pointerExternal ? symbol->__anon2.__anon1.pointerExternal : symbol->__anon2.__anon3.methodCodeExternal;
9715
9716 __ecereMethod_External_CreateUniqueEdge(neededFor, external, external->type == 0);
9717 }
9718 }
9719
9720 struct __ecereNameSpace__ecere__com__GlobalFunction;
9721
9722 struct __ecereNameSpace__ecere__com__GlobalFunction
9723 {
9724 struct __ecereNameSpace__ecere__com__GlobalFunction * prev;
9725 struct __ecereNameSpace__ecere__com__GlobalFunction * next;
9726 const char *  name;
9727 int (*  function)();
9728 struct __ecereNameSpace__ecere__com__Instance * module;
9729 struct __ecereNameSpace__ecere__com__NameSpace *  nameSpace;
9730 const char *  dataTypeString;
9731 struct Type * dataType;
9732 void *  symbol;
9733 } ecere_gcc_struct;
9734
9735 extern struct __ecereNameSpace__ecere__com__GlobalFunction * __ecereNameSpace__ecere__com__eSystem_FindFunction(struct __ecereNameSpace__ecere__com__Instance * module, const char *  name);
9736
9737 extern struct __ecereNameSpace__ecere__com__GlobalFunction * __ecereNameSpace__ecere__com__eSystem_RegisterFunction(const char *  name, const char *  type, void *  func, struct __ecereNameSpace__ecere__com__Instance * module, int declMode);
9738
9739 unsigned int DeclareFunction(struct External * neededFor, struct __ecereNameSpace__ecere__com__GlobalFunction * function, char * name)
9740 {
9741 struct Symbol * symbol = function->symbol;
9742
9743 if(!symbol || !symbol->__anon2.__anon1.pointerExternal)
9744 {
9745 unsigned int imported = 0;
9746 unsigned int dllImport = 0;
9747
9748 if(!function->dataType)
9749 {
9750 function->dataType = ProcessTypeString(function->dataTypeString, 0);
9751 if(!function->dataType->__anon1.__anon2.thisClass)
9752 function->dataType->__anon1.__anon2.staticMethod = 1;
9753 }
9754 if(inCompiler)
9755 {
9756 if(!symbol)
9757 {
9758 struct ModuleImport * module = FindModule(function->module);
9759
9760 symbol = function->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
9761 if(module->name)
9762 {
9763 if(!function->dataType->dllExport)
9764 {
9765 symbol->_import = (struct ClassImport *)__extension__ ({
9766 struct FunctionImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_FunctionImport);
9767
9768 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(function->name), __ecereInstance1;
9769 });
9770 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->functions, symbol->_import);
9771 }
9772 }
9773 {
9774 symbol->type = ProcessTypeString(function->dataTypeString, 0);
9775 if(!symbol->type->__anon1.__anon2.thisClass)
9776 symbol->type->__anon1.__anon2.staticMethod = 1;
9777 }
9778 }
9779 imported = symbol->_import ? 1 : 0;
9780 if(imported && function->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->importType != 1)
9781 dllImport = 1;
9782 }
9783 if(inCompiler)
9784 {
9785 {
9786 struct Declaration * decl;
9787 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
9788 struct Declarator * d;
9789 struct Declarator * funcDecl;
9790 struct External * external;
9791
9792 specifiers = MkList();
9793 declarators = MkList();
9794 ListAdd(specifiers, MkSpecifier(EXTERN));
9795 d = MkDeclaratorIdentifier(MkIdentifier(imported ? name : function->name));
9796 if(dllImport)
9797 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
9798 d = SpecDeclFromString(function->dataTypeString, specifiers, d);
9799 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->importType == 1)
9800 {
9801 struct Specifier * spec;
9802
9803 for(spec = (*specifiers).first; spec; spec = spec->next)
9804 if(spec->type == 5 && spec->__anon1.__anon1.extDecl && spec->__anon1.__anon1.extDecl->type == 0 && !strcmp(spec->__anon1.__anon1.extDecl->__anon1.s, "dllexport"))
9805 {
9806 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*specifiers), spec);
9807 FreeSpecifier(spec);
9808 break;
9809 }
9810 }
9811 funcDecl = GetFuncDecl(d);
9812 if(funcDecl && !funcDecl->__anon1.function.parameters)
9813 {
9814 funcDecl->__anon1.function.parameters = MkList();
9815 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->__anon1.function.parameters), (((void *)0)), MkTypeName(MkListOne(MkSpecifier(VOID)), (((void *)0))));
9816 }
9817 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
9818 {
9819 struct Context * oldCtx = curContext;
9820
9821 curContext = globalContext;
9822 decl = MkDeclaration(specifiers, declarators);
9823 curContext = oldCtx;
9824 }
9825 external = MkExternalDeclaration(decl);
9826 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*ast), external);
9827 external->symbol = symbol;
9828 symbol->__anon2.__anon1.pointerExternal = external;
9829 DeclareType(external, function->dataType, 1, 1);
9830 }
9831 }
9832 }
9833 if(inCompiler && neededFor && symbol && symbol->__anon2.__anon1.pointerExternal)
9834 __ecereMethod_External_CreateUniqueEdge(neededFor, symbol->__anon2.__anon1.pointerExternal, symbol->__anon2.__anon1.pointerExternal->type == 0);
9835 return (symbol && symbol->_import && function->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->importType != 1) ? 1 : 0;
9836 }
9837
9838 void DeclareFunctionUtil(struct External * neededBy, const char * s)
9839 {
9840 struct __ecereNameSpace__ecere__com__GlobalFunction * function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, s);
9841
9842 if(function)
9843 {
9844 char name[1024];
9845
9846 name[0] = 0;
9847 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->importType != 1 && (!function->dataType || !function->dataType->dllExport))
9848 strcpy(name, "__ecereFunction_");
9849 FullClassNameCat(name, s, 0);
9850 DeclareFunction(neededBy, function, name);
9851 }
9852 else if(neededBy)
9853 FindSymbol(s, globalContext, globalContext, 0, 0);
9854 }
9855
9856 static void CreateFireWatcher(struct __ecereNameSpace__ecere__com__Property * prop, struct Expression * object, struct Statement * stmt)
9857 {
9858 char propName[1024], propNameM[1024];
9859 char getName[1024], setName[1024];
9860 struct __ecereNameSpace__ecere__sys__OldList * args;
9861
9862 DeclareProperty(curExternal, prop, setName, getName);
9863 strcpy(propName, "__ecereProp_");
9864 FullClassNameCat(propName, prop->_class->fullName, 0);
9865 strcat(propName, "_");
9866 FullClassNameCat(propName, prop->name, 1);
9867 strcpy(propNameM, "__ecerePropM_");
9868 FullClassNameCat(propNameM, prop->_class->fullName, 0);
9869 strcat(propNameM, "_");
9870 FullClassNameCat(propNameM, prop->name, 1);
9871 if(prop->isWatchable)
9872 {
9873 args = MkList();
9874 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
9875 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
9876 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireWatchers")), args));
9877 args = MkList();
9878 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
9879 ListAdd(args, MkExpIdentifier(MkIdentifier(propNameM)));
9880 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireWatchers")), args));
9881 DeclareFunctionUtil(curExternal, "eInstance_FireWatchers");
9882 }
9883 {
9884 args = MkList();
9885 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
9886 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
9887 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireSelfWatchers")), args));
9888 args = MkList();
9889 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
9890 ListAdd(args, MkExpIdentifier(MkIdentifier(propNameM)));
9891 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireSelfWatchers")), args));
9892 DeclareFunctionUtil(curExternal, "eInstance_FireSelfWatchers");
9893 }
9894 if(curFunction->propSet && !strcmp(curFunction->propSet->string, prop->name) && (!object || (object->type == 0 && !strcmp(object->__anon1.__anon1.identifier->string, "this"))))
9895 curFunction->propSet->fireWatchersDone = 1;
9896 }
9897
9898 struct __ecereNameSpace__ecere__com__SubModule;
9899
9900 struct __ecereNameSpace__ecere__com__SubModule
9901 {
9902 struct __ecereNameSpace__ecere__com__SubModule * prev;
9903 struct __ecereNameSpace__ecere__com__SubModule * next;
9904 struct __ecereNameSpace__ecere__com__Instance * module;
9905 int importMode;
9906 } ecere_gcc_struct;
9907
9908 unsigned int ModuleVisibility(struct __ecereNameSpace__ecere__com__Instance * searchIn, struct __ecereNameSpace__ecere__com__Instance * searchFor)
9909 {
9910 struct __ecereNameSpace__ecere__com__SubModule * subModule;
9911
9912 if(searchFor == searchIn)
9913 return 1;
9914 for(subModule = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)searchIn + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->modules.first; subModule; subModule = subModule->next)
9915 {
9916 if(subModule->importMode == 1 || searchIn == ((struct __ecereNameSpace__ecere__com__Module *)(((char *)searchIn + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->application)
9917 {
9918 if(ModuleVisibility(subModule->module, searchFor))
9919 return 1;
9920 }
9921 }
9922 return 0;
9923 }
9924
9925 int ComputeTypeSize(struct Type *  type);
9926
9927 void ComputeClassMembers(struct __ecereNameSpace__ecere__com__Class * _class, unsigned int isMember)
9928 {
9929 struct __ecereNameSpace__ecere__com__DataMember * member = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
9930 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
9931
9932 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))
9933 {
9934 int unionMemberOffset = 0;
9935 int bitFields = 0;
9936
9937 if(member)
9938 {
9939 member->memberOffset = 0;
9940 if(targetBits < sizeof(void *) * 8)
9941 member->structAlignment = 0;
9942 }
9943 else if(targetBits < sizeof(void *) * 8)
9944 _class->structAlignment = 0;
9945 if(!member && ((_class->type == 0 || _class->type == 5) || (_class->type == 1 && _class->memberOffset && _class->memberOffset > _class->base->structSize)))
9946 _class->memberOffset = (_class->base && _class->type == 1) ? _class->base->structSize : 0;
9947 if(!member && _class->destructionWatchOffset)
9948 _class->memberOffset += sizeof(struct __ecereNameSpace__ecere__sys__OldList);
9949 {
9950 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
9951
9952 for(dataMember = member ? member->members.first : _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
9953 {
9954 if(!dataMember->isProperty)
9955 {
9956 if(dataMember->type == 0 && dataMember->dataTypeString && !dataMember->dataType)
9957 {
9958 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0);
9959 }
9960 }
9961 }
9962 }
9963 {
9964 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
9965
9966 for(dataMember = member ? member->members.first : _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
9967 {
9968 if(!dataMember->isProperty && (dataMember->type != 0 || dataMember->dataTypeString))
9969 {
9970 if(!isMember && _class->type == 2 && dataMember->dataType)
9971 {
9972 struct __ecereNameSpace__ecere__com__BitMember * bitMember = (struct __ecereNameSpace__ecere__com__BitMember *)dataMember;
9973 uint64 mask = 0;
9974 int d;
9975
9976 ComputeTypeSize(dataMember->dataType);
9977 if(bitMember->pos == -1)
9978 bitMember->pos = _class->memberOffset;
9979 if(!bitMember->size)
9980 bitMember->size = dataMember->dataType->size * 8;
9981 _class->memberOffset = bitMember->pos + bitMember->size;
9982 for(d = 0; d < bitMember->size; d++)
9983 {
9984 if(d)
9985 mask <<= 1;
9986 mask |= 1;
9987 }
9988 bitMember->mask = mask << bitMember->pos;
9989 }
9990 else if(dataMember->type == 0 && dataMember->dataType)
9991 {
9992 int size;
9993 int alignment = 0;
9994
9995 if(dataMember->dataType->kind != 8 || ((!dataMember->dataType->__anon1._class || !dataMember->dataType->__anon1._class->__anon1.registered || dataMember->dataType->__anon1._class->__anon1.registered != _class || _class->type != 1)))
9996 ComputeTypeSize(dataMember->dataType);
9997 if(dataMember->dataType->bitFieldCount)
9998 {
9999 bitFields += dataMember->dataType->bitFieldCount;
10000 size = 0;
10001 }
10002 else
10003 {
10004 if(bitFields)
10005 {
10006 int size = (bitFields + 7) / 8;
10007
10008 if(isMember)
10009 {
10010 int __simpleStruct0;
10011
10012 if(alignment)
10013 {
10014 short __simpleStruct0;
10015
10016 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
10017 if(member->memberOffset % alignment)
10018 member->memberOffset += alignment - (member->memberOffset % alignment);
10019 }
10020 dataMember->offset = member->memberOffset;
10021 if(member->type == 1)
10022 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
10023 else
10024 {
10025 member->memberOffset += size;
10026 }
10027 }
10028 else
10029 {
10030 if(alignment)
10031 {
10032 short __simpleStruct0;
10033
10034 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
10035 if(_class->memberOffset % alignment)
10036 _class->memberOffset += alignment - (_class->memberOffset % alignment);
10037 }
10038 dataMember->offset = _class->memberOffset;
10039 _class->memberOffset += size;
10040 }
10041 bitFields = 0;
10042 }
10043 size = dataMember->dataType->size;
10044 alignment = dataMember->dataType->alignment;
10045 }
10046 if(isMember)
10047 {
10048 int __simpleStruct0;
10049
10050 if(alignment)
10051 {
10052 short __simpleStruct0;
10053
10054 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
10055 if(member->memberOffset % alignment)
10056 member->memberOffset += alignment - (member->memberOffset % alignment);
10057 }
10058 dataMember->offset = member->memberOffset;
10059 if(member->type == 1)
10060 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
10061 else
10062 {
10063 member->memberOffset += size;
10064 }
10065 }
10066 else
10067 {
10068 if(alignment)
10069 {
10070 short __simpleStruct0;
10071
10072 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
10073 if(_class->memberOffset % alignment)
10074 _class->memberOffset += alignment - (_class->memberOffset % alignment);
10075 }
10076 dataMember->offset = _class->memberOffset;
10077 _class->memberOffset += size;
10078 }
10079 }
10080 else
10081 {
10082 int alignment;
10083
10084 ComputeClassMembers((struct __ecereNameSpace__ecere__com__Class *)dataMember, 1);
10085 alignment = dataMember->structAlignment;
10086 if(isMember)
10087 {
10088 int __simpleStruct0;
10089
10090 if(alignment)
10091 {
10092 short __simpleStruct0;
10093
10094 if(member->memberOffset % alignment)
10095 member->memberOffset += alignment - (member->memberOffset % alignment);
10096 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
10097 }
10098 dataMember->offset = member->memberOffset;
10099 if(member->type == 1)
10100 unionMemberOffset = (__simpleStruct0 = dataMember->memberOffset, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
10101 else
10102 member->memberOffset += dataMember->memberOffset;
10103 }
10104 else
10105 {
10106 if(alignment)
10107 {
10108 short __simpleStruct0;
10109
10110 if(_class->memberOffset % alignment)
10111 _class->memberOffset += alignment - (_class->memberOffset % alignment);
10112 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
10113 }
10114 dataMember->offset = _class->memberOffset;
10115 _class->memberOffset += dataMember->memberOffset;
10116 }
10117 }
10118 }
10119 }
10120 if(bitFields)
10121 {
10122 int alignment = 0;
10123 int size = (bitFields + 7) / 8;
10124
10125 if(isMember)
10126 {
10127 int __simpleStruct0;
10128
10129 if(alignment)
10130 {
10131 short __simpleStruct0;
10132
10133 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
10134 if(member->memberOffset % alignment)
10135 member->memberOffset += alignment - (member->memberOffset % alignment);
10136 }
10137 if(member->type == 1)
10138 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
10139 else
10140 {
10141 member->memberOffset += size;
10142 }
10143 }
10144 else
10145 {
10146 if(alignment)
10147 {
10148 short __simpleStruct0;
10149
10150 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
10151 if(_class->memberOffset % alignment)
10152 _class->memberOffset += alignment - (_class->memberOffset % alignment);
10153 }
10154 _class->memberOffset += size;
10155 }
10156 bitFields = 0;
10157 }
10158 }
10159 if(member && member->type == 1)
10160 {
10161 member->memberOffset = unionMemberOffset;
10162 }
10163 if(!isMember)
10164 {
10165 if(_class->type != 2)
10166 {
10167 int extra = 0;
10168
10169 if(_class->structAlignment)
10170 {
10171 if(_class->memberOffset % _class->structAlignment)
10172 extra += _class->structAlignment - (_class->memberOffset % _class->structAlignment);
10173 }
10174 _class->structSize = (_class->base ? (_class->base->templateClass ? (_class->base->type == 5 ? _class->base->templateClass->memberOffset : _class->base->templateClass->structSize) : (_class->base->type == 5 ? _class->base->memberOffset : _class->base->structSize)) : 0) + _class->memberOffset + extra;
10175 if(!member)
10176 {
10177 struct __ecereNameSpace__ecere__com__Property * prop;
10178
10179 for(prop = _class->membersAndProperties.first; prop; prop = prop->next)
10180 {
10181 if(prop->isProperty && prop->isWatchable)
10182 {
10183 prop->watcherOffset = _class->structSize;
10184 _class->structSize += sizeof(struct __ecereNameSpace__ecere__sys__OldList);
10185 }
10186 }
10187 }
10188 {
10189 struct __ecereNameSpace__ecere__sys__OldLink * derivative;
10190
10191 for(derivative = _class->derivatives.first; derivative; derivative = derivative->next)
10192 {
10193 struct __ecereNameSpace__ecere__com__Class * deriv = derivative->data;
10194
10195 if(deriv->computeSize)
10196 {
10197 deriv->offset = (_class->type == 5 ? _class->memberOffset : _class->structSize);
10198 deriv->memberOffset = 0;
10199 deriv->structSize = deriv->offset;
10200 ComputeClassMembers(deriv, 0);
10201 }
10202 }
10203 }
10204 }
10205 }
10206 }
10207 if(context)
10208 FinishTemplatesContext(context);
10209 }
10210
10211 int AddMembers(struct External * neededBy, 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)
10212 {
10213 struct __ecereNameSpace__ecere__com__DataMember * topMember = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
10214 unsigned int totalSize = 0;
10215 unsigned int maxSize = 0;
10216 int alignment;
10217 unsigned int size;
10218 struct __ecereNameSpace__ecere__com__DataMember * member;
10219 int anonID = 1;
10220 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
10221
10222 if(addedPadding)
10223 *addedPadding = 0;
10224 if(!isMember && _class->base)
10225 {
10226 maxSize = _class->structSize;
10227 {
10228 if(_class->type == 1 || _class->type == 5)
10229 AddMembers(neededBy, declarations, _class->base, 0, &totalSize, topClass, (((void *)0)));
10230 else
10231 {
10232 unsigned int baseSize = _class->base->templateClass ? _class->base->templateClass->structSize : _class->base->structSize;
10233
10234 if(maxSize > baseSize)
10235 maxSize -= baseSize;
10236 else
10237 maxSize = 0;
10238 }
10239 }
10240 }
10241 for(member = isMember ? topMember->members.first : _class->membersAndProperties.first; member; member = member->next)
10242 {
10243 if(!member->isProperty)
10244 {
10245 switch(member->type)
10246 {
10247 case 0:
10248 {
10249 if(member->dataTypeString)
10250 {
10251 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList(), * decls = MkList();
10252 struct Declarator * decl;
10253
10254 decl = SpecDeclFromString(member->dataTypeString, specs, MkDeclaratorIdentifier(MkIdentifier(member->name)));
10255 ListAdd(decls, MkStructDeclarator(decl, (((void *)0))));
10256 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(specs, decls, (((void *)0)))));
10257 if(!member->dataType)
10258 member->dataType = ProcessType(specs, decl);
10259 ReplaceThisClassSpecifiers(specs, topClass);
10260 {
10261 struct Type * type = ProcessType(specs, decl);
10262
10263 DeclareType(neededBy, member->dataType, 1, 0);
10264 FreeType(type);
10265 }
10266 ComputeTypeSize(member->dataType);
10267 size = member->dataType->size;
10268 alignment = member->dataType->alignment;
10269 if(alignment)
10270 {
10271 if(totalSize % alignment)
10272 totalSize += alignment - (totalSize % alignment);
10273 }
10274 totalSize += size;
10275 }
10276 break;
10277 }
10278 case 1:
10279 case 2:
10280 {
10281 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList(), * list = MkList();
10282 char id[100];
10283
10284 sprintf(id, "__anon%d", anonID++);
10285 size = 0;
10286 AddMembers(neededBy, list, (struct __ecereNameSpace__ecere__com__Class *)member, 1, &size, topClass, (((void *)0)));
10287 ListAdd(specs, MkStructOrUnion((member->type == 1) ? 4 : 3, (((void *)0)), list));
10288 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(specs, MkListOne(MkDeclaratorIdentifier(MkIdentifier(id))), (((void *)0)))));
10289 alignment = member->structAlignment;
10290 if(alignment)
10291 {
10292 if(totalSize % alignment)
10293 totalSize += alignment - (totalSize % alignment);
10294 }
10295 totalSize += size;
10296 break;
10297 }
10298 }
10299 }
10300 }
10301 if(retSize)
10302 {
10303 unsigned int __simpleStruct0;
10304
10305 if(topMember && topMember->type == 1)
10306 *retSize = (__simpleStruct0 = *retSize, (__simpleStruct0 > totalSize) ? __simpleStruct0 : totalSize);
10307 else
10308 *retSize += totalSize;
10309 }
10310 else if(totalSize < maxSize && _class->type != 1000)
10311 {
10312 int autoPadding = 0;
10313
10314 if(!isMember && _class->structAlignment && totalSize % _class->structAlignment)
10315 autoPadding = _class->structAlignment - (totalSize % _class->structAlignment);
10316 if(totalSize + autoPadding < maxSize)
10317 {
10318 char sizeString[50];
10319
10320 sprintf(sizeString, "%d", maxSize - totalSize);
10321 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(CHAR)), MkListOne(MkDeclaratorArray(MkDeclaratorIdentifier(MkIdentifier("__ecere_padding")), MkExpConstant(sizeString))), (((void *)0)))));
10322 if(addedPadding)
10323 *addedPadding = 1;
10324 }
10325 }
10326 if(context)
10327 FinishTemplatesContext(context);
10328 return topMember ? topMember->memberID : _class->memberID;
10329 }
10330
10331 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, unsigned int warnConst)
10332 {
10333 if(source && dest)
10334 {
10335 if(warnConst)
10336 CheckConstCompatibility(source, dest, 1);
10337 if(source->kind == 20 && dest->kind != 20)
10338 {
10339 struct Type * type = ProcessTemplateParameterType(source->__anon1.templateParameter);
10340
10341 if(type)
10342 source = type;
10343 }
10344 if(dest->kind == 20 && source->kind != 20)
10345 {
10346 struct Type * type = ProcessTemplateParameterType(dest->__anon1.templateParameter);
10347
10348 if(type)
10349 dest = type;
10350 }
10351 if(dest->classObjectType == 2 && dest->kind != 11)
10352 {
10353 if(source->classObjectType != 3)
10354 return 1;
10355 else
10356 {
10357 if((dest->__anon1._class && strcmp(dest->__anon1._class->string, "class")) || (source->__anon1._class && strcmp(source->__anon1._class->string, "class")))
10358 {
10359 return 1;
10360 }
10361 }
10362 }
10363 else
10364 {
10365 if(source->kind != 11 && source->classObjectType == 3)
10366 return 1;
10367 if(dest->kind != 11 && dest->classObjectType == 3 && source->classObjectType != 2)
10368 return 1;
10369 }
10370 if((dest->kind == 9 && source->kind == 9) || (dest->kind == 10 && source->kind == 10))
10371 {
10372 if((dest->__anon1.__anon1.enumName && source->__anon1.__anon1.enumName && !strcmp(dest->__anon1.__anon1.enumName, source->__anon1.__anon1.enumName)) || (source->__anon1.__anon1.members.first && source->__anon1.__anon1.members.first == dest->__anon1.__anon1.members.first))
10373 return 1;
10374 }
10375 if(dest->kind == 14 && source->kind != 0)
10376 return 1;
10377 if(dest->kind == 13 && dest->__anon1.type->kind == 0 && ((source->kind == 8 && (!source->__anon1._class || !source->__anon1._class->__anon1.registered || source->__anon1._class->__anon1.registered->type == 1 || source->__anon1._class->__anon1.registered->type == 0 || source->__anon1._class->__anon1.registered->type == 5 || source->__anon1._class->__anon1.registered->type == 1000)) || source->kind == 19 || source->kind == 13 || source->kind == 12 || source->kind == 11 || source->kind == 21))
10378 return 1;
10379 if(!isConversionExploration && source->kind == 13 && source->__anon1.type->kind == 0 && ((dest->kind == 8 && (!dest->__anon1._class || !dest->__anon1._class->__anon1.registered || dest->__anon1._class->__anon1.registered->type == 1 || dest->__anon1._class->__anon1.registered->type == 0 || dest->__anon1._class->__anon1.registered->type == 5 || dest->__anon1._class->__anon1.registered->type == 1000)) || dest->kind == 19 || dest->kind == 13 || dest->kind == 12 || dest->kind == 11 || dest->kind == 21))
10380 return 1;
10381 if(((source->kind == 8 && dest->kind == 8) || (source->kind == 19 && dest->kind == 19)) && source->__anon1._class)
10382 {
10383 if(source->__anon1._class->__anon1.registered && source->__anon1._class->__anon1.registered->type == 3)
10384 {
10385 if(conversions != (((void *)0)))
10386 {
10387 if(source->__anon1._class->__anon1.registered == dest->__anon1._class->__anon1.registered)
10388 return 1;
10389 }
10390 else
10391 {
10392 struct __ecereNameSpace__ecere__com__Class * sourceBase, * destBase;
10393
10394 for(sourceBase = source->__anon1._class->__anon1.registered; sourceBase && sourceBase->base->type != 1000; sourceBase = sourceBase->base)
10395 ;
10396 for(destBase = dest->__anon1._class->__anon1.registered; destBase && destBase->base->type != 1000; destBase = destBase->base)
10397 ;
10398 if(sourceBase == destBase)
10399 return 1;
10400 }
10401 }
10402 else if(source->__anon1._class && dest->__anon1._class && (dest->classObjectType == source->classObjectType || !dest->classObjectType) && (enumBaseType || (!source->__anon1._class->__anon1.registered || source->__anon1._class->__anon1.registered->type != 4) || (!dest->__anon1._class->__anon1.registered || dest->__anon1._class->__anon1.registered->type != 4)) && __ecereNameSpace__ecere__com__eClass_IsDerived(source->__anon1._class->__anon1.registered, dest->__anon1._class->__anon1.registered))
10403 return 1;
10404 else
10405 {
10406 if(dest->__anon1._class && dest->__anon1._class->__anon1.registered && source->__anon1._class && source->__anon1._class->__anon1.registered && (dest->casted || (enumBaseType && dest->__anon1._class->__anon1.registered->type == 4 && (source->kind == 8 || source->__anon1._class->__anon1.registered->type != 4))))
10407 {
10408 if(__ecereNameSpace__ecere__com__eClass_IsDerived(dest->__anon1._class->__anon1.registered, source->__anon1._class->__anon1.registered))
10409 {
10410 return 1;
10411 }
10412 }
10413 }
10414 }
10415 if(source->kind == 19 && dest->kind == 8 && dest->__anon1._class && !strcmp(dest->__anon1._class->string, "ecere::com::Class"))
10416 return 1;
10417 if(doConversion)
10418 {
10419 if(source->kind == 8)
10420 {
10421 struct __ecereNameSpace__ecere__com__Class * _class;
10422
10423 for(_class = source->__anon1._class ? source->__anon1._class->__anon1.registered : (((void *)0)); _class; _class = _class->base)
10424 {
10425 struct __ecereNameSpace__ecere__com__Property * convert;
10426
10427 for(convert = _class->conversions.first; convert; convert = convert->next)
10428 {
10429 if(convert->memberAccess == 1 || _class->module == privateModule)
10430 {
10431 struct Conversion * after = (conversions != (((void *)0))) ? conversions->last : (((void *)0));
10432
10433 if(!convert->dataType)
10434 convert->dataType = ProcessTypeString(convert->dataTypeString, 0);
10435 if((!isConversionExploration || convert->dataType->kind == 8 || !strcmp(_class->name, "String")) && MatchTypes(convert->dataType, dest, conversions, (((void *)0)), (((void *)0)), (convert->dataType->kind == 8 && !strcmp(convert->dataTypeString, "String")) ? 1 : 0, convert->dataType->kind == 8, 0, 1, warnConst))
10436 {
10437 if(!conversions && !convert->Get)
10438 return 1;
10439 else if(conversions != (((void *)0)))
10440 {
10441 if(_class->type == 3 && convert->dataType->kind == 8 && convert->dataType->__anon1._class && convert->dataType->__anon1._class->__anon1.registered && _class->base == convert->dataType->__anon1._class->__anon1.registered->base && (dest->kind != 8 || dest->__anon1._class->__anon1.registered != _class->base))
10442 return 1;
10443 else
10444 {
10445 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv->isGet = 1, conv);
10446
10447 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(conversions, after, conv);
10448 return 1;
10449 }
10450 }
10451 }
10452 }
10453 }
10454 }
10455 }
10456 if(dest->kind == 8)
10457 {
10458 struct __ecereNameSpace__ecere__com__Class * _class;
10459
10460 for(_class = dest->__anon1._class ? dest->__anon1._class->__anon1.registered : (((void *)0)); _class; _class = _class->base)
10461 {
10462 struct __ecereNameSpace__ecere__com__Property * convert;
10463
10464 for(convert = _class->conversions.first; convert; convert = convert->next)
10465 {
10466 if(convert->memberAccess == 1 || _class->module == privateModule)
10467 {
10468 struct Type * constType = (((void *)0));
10469 unsigned int success = 0;
10470
10471 if(!convert->dataType)
10472 convert->dataType = ProcessTypeString(convert->dataTypeString, 0);
10473 if(warnConst && convert->dataType->kind == 13 && convert->dataType->__anon1.type && dest->constant)
10474 {
10475 struct Type * ptrType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
10476
10477 constType = __extension__ ({
10478 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
10479
10480 __ecereInstance1->kind = 13, __ecereInstance1->refCount = 1, __ecereInstance1->__anon1.type = ptrType, __ecereInstance1;
10481 });
10482 CopyTypeInto(ptrType, convert->dataType->__anon1.type);
10483 ptrType->constant = 1;
10484 }
10485 if((constType || convert->dataType != dest) && MatchTypes(source, constType ? constType : convert->dataType, conversions, (((void *)0)), (((void *)0)), 1, 0, 0, 1, warnConst))
10486 {
10487 if(!conversions && !convert->Set)
10488 success = 1;
10489 else if(conversions != (((void *)0)))
10490 {
10491 if(_class->type == 3 && convert->dataType->kind == 8 && convert->dataType->__anon1._class && convert->dataType->__anon1._class->__anon1.registered && _class->base == convert->dataType->__anon1._class->__anon1.registered->base && (source->kind != 8 || source->__anon1._class->__anon1.registered != _class->base))
10492 success = 1;
10493 else
10494 {
10495 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv);
10496
10497 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(conversions, conv);
10498 success = 1;
10499 }
10500 }
10501 }
10502 if(constType)
10503 FreeType(constType);
10504 if(success)
10505 return 1;
10506 }
10507 }
10508 }
10509 if(enumBaseType && dest->__anon1._class && dest->__anon1._class->__anon1.registered && dest->__anon1._class->__anon1.registered->type == 4)
10510 {
10511 if(!dest->__anon1._class->__anon1.registered->dataType)
10512 dest->__anon1._class->__anon1.registered->dataType = ProcessTypeString(dest->__anon1._class->__anon1.registered->dataTypeString, 0);
10513 if(dest->__anon1._class->__anon1.registered->dataType->kind == 8 || source->truth || dest->truth)
10514 {
10515 if(MatchTypes(source, dest->__anon1._class->__anon1.registered->dataType, conversions, (((void *)0)), (((void *)0)), 1, dest->__anon1._class->__anon1.registered->dataType->kind == 8, 0, 0, warnConst))
10516 {
10517 return 1;
10518 }
10519 }
10520 }
10521 }
10522 if(source->kind == 8)
10523 {
10524 struct __ecereNameSpace__ecere__com__Class * _class;
10525
10526 for(_class = source->__anon1._class ? source->__anon1._class->__anon1.registered : (((void *)0)); _class; _class = _class->base)
10527 {
10528 struct __ecereNameSpace__ecere__com__Property * convert;
10529
10530 for(convert = _class->conversions.first; convert; convert = convert->next)
10531 {
10532 if(convert->memberAccess == 1 || _class->module == privateModule)
10533 {
10534 struct Conversion * after = (conversions != (((void *)0))) ? conversions->last : (((void *)0));
10535
10536 if(!convert->dataType)
10537 convert->dataType = ProcessTypeString(convert->dataTypeString, 0);
10538 if(convert->dataType != source && (!isConversionExploration || convert->dataType->kind == 8 || !strcmp(_class->name, "String")) && MatchTypes(convert->dataType, dest, conversions, (((void *)0)), (((void *)0)), convert->dataType->kind == 8, convert->dataType->kind == 8, 0, 1, warnConst))
10539 {
10540 if(!conversions && !convert->Get)
10541 return 1;
10542 else if(conversions != (((void *)0)))
10543 {
10544 if(_class->type == 3 && convert->dataType->kind == 8 && convert->dataType->__anon1._class && convert->dataType->__anon1._class->__anon1.registered && _class->base == convert->dataType->__anon1._class->__anon1.registered->base && (dest->kind != 8 || dest->__anon1._class->__anon1.registered != _class->base))
10545 return 1;
10546 else
10547 {
10548 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv->isGet = 1, conv);
10549
10550 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(conversions, after, conv);
10551 return 1;
10552 }
10553 }
10554 }
10555 }
10556 }
10557 }
10558 if(enumBaseType && source->__anon1._class && source->__anon1._class->__anon1.registered && source->__anon1._class->__anon1.registered->type == 4)
10559 {
10560 if(!source->__anon1._class->__anon1.registered->dataType)
10561 source->__anon1._class->__anon1.registered->dataType = ProcessTypeString(source->__anon1._class->__anon1.registered->dataTypeString, 0);
10562 if(!isConversionExploration || source->__anon1._class->__anon1.registered->dataType->kind == 8 || !strcmp(source->__anon1._class->__anon1.registered->name, "String"))
10563 {
10564 if(MatchTypes(source->__anon1._class->__anon1.registered->dataType, dest, conversions, (((void *)0)), (((void *)0)), source->__anon1._class->__anon1.registered->dataType->kind == 8, source->__anon1._class->__anon1.registered->dataType->kind == 8, 0, 0, warnConst))
10565 return 1;
10566 else if(MatchTypes(dest, source->__anon1._class->__anon1.registered->dataType, (((void *)0)), (((void *)0)), (((void *)0)), 0, 0, 0, 0, warnConst))
10567 return 1;
10568 }
10569 }
10570 }
10571 }
10572 if(source->kind == 8 || source->kind == 19)
10573 ;
10574 else if(dest->kind == source->kind && (dest->kind != 9 && dest->kind != 10 && dest->kind != 11 && dest->kind != 12 && dest->kind != 13 && dest->kind != 16))
10575 return 1;
10576 else if(dest->kind == 7 && source->kind == 6)
10577 return 1;
10578 else if(dest->kind == 2 && (source->kind == 1 || source->kind == 24))
10579 return 1;
10580 else if(dest->kind == 3 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 23))
10581 return 1;
10582 else if(dest->kind == 4 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 3 || source->kind == 22 || source->kind == 23))
10583 return 1;
10584 else if(dest->kind == 22 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 3 || source->kind == 23 || source->kind == 4))
10585 return 1;
10586 else if(dest->kind == 23 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 3 || source->kind == 4 || source->kind == 22))
10587 return 1;
10588 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))
10589 return 1;
10590 else if(dest->kind == 15 && !isConversionExploration && (source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 5 || source->kind == 4 || source->kind == 22 || source->kind == 23))
10591 return 1;
10592 else if((dest->kind == 11 || (dest->kind == 13 && dest->__anon1.type->kind == 11) || dest->kind == 16) && ((source->kind == 11 || (source->kind == 13 && source->__anon1.type->kind == 11) || source->kind == 16)))
10593 {
10594 struct Type * paramSource, * paramDest;
10595
10596 if(dest->kind == 16)
10597 owningClassDest = dest->__anon1.__anon3.methodClass ? dest->__anon1.__anon3.methodClass : dest->__anon1.__anon3.method->_class;
10598 if(source->kind == 16)
10599 owningClassSource = source->__anon1.__anon3.methodClass ? source->__anon1.__anon3.methodClass : source->__anon1.__anon3.method->_class;
10600 if(dest->kind == 13 && dest->__anon1.type->kind == 11)
10601 dest = dest->__anon1.type;
10602 if(source->kind == 13 && source->__anon1.type->kind == 11)
10603 source = source->__anon1.type;
10604 if(dest->kind == 16)
10605 dest = dest->__anon1.__anon3.method->dataType;
10606 if(source->kind == 16)
10607 source = source->__anon1.__anon3.method->dataType;
10608 paramSource = source->__anon1.__anon2.params.first;
10609 if(paramSource && paramSource->kind == 0)
10610 paramSource = (((void *)0));
10611 paramDest = dest->__anon1.__anon2.params.first;
10612 if(paramDest && paramDest->kind == 0)
10613 paramDest = (((void *)0));
10614 if((dest->__anon1.__anon2.staticMethod || (!dest->__anon1.__anon2.thisClass && !owningClassDest)) && !(source->__anon1.__anon2.staticMethod || (!source->__anon1.__anon2.thisClass && !owningClassSource)))
10615 {
10616 if(!paramDest || (!(paramDest->kind == 13 && paramDest->__anon1.type && paramDest->__anon1.type->kind == 0) && (paramDest->kind != 8 || !__ecereNameSpace__ecere__com__eClass_IsDerived(source->__anon1.__anon2.thisClass ? source->__anon1.__anon2.thisClass->__anon1.registered : owningClassSource, paramDest->__anon1._class->__anon1.registered))))
10617 {
10618 if(paramDest && paramDest->kind == 8)
10619 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "method class must be derived from %s\n", (((void *)0))), paramDest->__anon1._class->string);
10620 else
10621 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "method class should not take an object\n", (((void *)0))));
10622 return 0;
10623 }
10624 paramDest = paramDest->next;
10625 }
10626 else if(!dest->__anon1.__anon2.staticMethod && (dest->__anon1.__anon2.thisClass || owningClassDest))
10627 {
10628 if((source->__anon1.__anon2.staticMethod || (!source->__anon1.__anon2.thisClass && !owningClassSource)))
10629 {
10630 if(dest->__anon1.__anon2.thisClass)
10631 {
10632 if(!paramSource || paramSource->kind != 8 || !__ecereNameSpace__ecere__com__eClass_IsDerived(paramSource->__anon1._class->__anon1.registered, dest->__anon1.__anon2.thisClass->__anon1.registered))
10633 {
10634 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "method class must be derived from %s\n", (((void *)0))), dest->__anon1.__anon2.thisClass->string);
10635 return 0;
10636 }
10637 }
10638 else
10639 {
10640 if(!paramSource || paramSource->kind != 8 || (owningClassDest && !__ecereNameSpace__ecere__com__eClass_IsDerived(paramSource->__anon1._class->__anon1.registered, owningClassDest)))
10641 {
10642 if(owningClassDest)
10643 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "%s expected to be derived from method class\n", (((void *)0))), owningClassDest->fullName);
10644 else
10645 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "overriding class expected to be derived from method class\n", (((void *)0))));
10646 return 0;
10647 }
10648 }
10649 paramSource = paramSource->next;
10650 }
10651 else
10652 {
10653 if(dest->__anon1.__anon2.thisClass)
10654 {
10655 if(!__ecereNameSpace__ecere__com__eClass_IsDerived(source->__anon1.__anon2.thisClass ? source->__anon1.__anon2.thisClass->__anon1.registered : owningClassSource, dest->__anon1.__anon2.thisClass->__anon1.registered))
10656 {
10657 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "method class must be derived from %s\n", (((void *)0))), dest->__anon1.__anon2.thisClass->string);
10658 return 0;
10659 }
10660 }
10661 else
10662 {
10663 if(source->__anon1.__anon2.thisClass && source->__anon1.__anon2.thisClass->__anon1.registered && owningClassDest && !__ecereNameSpace__ecere__com__eClass_IsDerived(source->__anon1.__anon2.thisClass->__anon1.registered, owningClassDest))
10664 {
10665 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "%s expected to be derived from method class\n", (((void *)0))), source->__anon1.__anon2.thisClass->__anon1.registered->fullName);
10666 return 0;
10667 }
10668 }
10669 }
10670 }
10671 if(!MatchTypes(source->__anon1.__anon2.returnType, dest->__anon1.__anon2.returnType, (((void *)0)), (((void *)0)), (((void *)0)), 1, 1, 0, 0, warnConst))
10672 {
10673 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible return type for function\n", (((void *)0))));
10674 return 0;
10675 }
10676 else
10677 CheckConstCompatibility(dest->__anon1.__anon2.returnType, source->__anon1.__anon2.returnType, 1);
10678 for(; paramDest; paramDest = paramDest->next)
10679 {
10680 if(!paramSource)
10681 {
10682 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "not enough parameters\n", (((void *)0))));
10683 return 0;
10684 }
10685 {
10686 struct Type * paramDestType = paramDest;
10687 struct Type * paramSourceType = paramSource;
10688 struct Type * type = paramDestType;
10689
10690 if(paramDest->kind == 20 && paramDest->__anon1.templateParameter->type == 0 && owningClassSource && paramSource->kind != 20)
10691 {
10692 int id = 0;
10693 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
10694 struct __ecereNameSpace__ecere__com__Class * sClass;
10695
10696 for(sClass = owningClassSource; sClass; sClass = sClass->base)
10697 {
10698 id = 0;
10699 if(sClass->templateClass)
10700 sClass = sClass->templateClass;
10701 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
10702 {
10703 if(curParam->type == 0 && !strcmp(type->__anon1.templateParameter->identifier->string, curParam->name))
10704 {
10705 for(sClass = sClass->base; sClass; sClass = sClass->base)
10706 {
10707 if(sClass->templateClass)
10708 sClass = sClass->templateClass;
10709 id += sClass->templateParams.count;
10710 }
10711 break;
10712 }
10713 id++;
10714 }
10715 if(curParam)
10716 break;
10717 }
10718 if(curParam)
10719 {
10720 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = owningClassSource->templateArgs[id];
10721
10722 paramDestType = type = ProcessTypeString(arg.__anon1.__anon1.dataTypeString, 0);
10723 }
10724 }
10725 if(!MatchTypes(paramDestType, paramSourceType, (((void *)0)), (((void *)0)), (((void *)0)), 1, 1, 0, 0, warnConst) && (!acceptReversedParams || !MatchTypes(paramSourceType, paramDestType, (((void *)0)), (((void *)0)), (((void *)0)), 1, 1, 0, 0, warnConst)))
10726 {
10727 char type[1024];
10728
10729 type[0] = 0;
10730 PrintType(paramDest, type, 0, 1);
10731 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible parameter %s (expected %s)\n", (((void *)0))), paramSource->name, type);
10732 if(paramDestType != paramDest)
10733 FreeType(paramDestType);
10734 return 0;
10735 }
10736 if(paramDestType != paramDest)
10737 FreeType(paramDestType);
10738 }
10739 paramSource = paramSource->next;
10740 }
10741 if(paramSource)
10742 {
10743 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "too many parameters\n", (((void *)0))));
10744 return 0;
10745 }
10746 return 1;
10747 }
10748 else if((dest->kind == 11 || (dest->kind == 13 && dest->__anon1.type->kind == 11) || dest->kind == 16) && (source->kind == 13 && source->__anon1.type->kind == 0))
10749 {
10750 return 1;
10751 }
10752 else if((dest->kind == 13 || dest->kind == 12) && (source->kind == 12 || source->kind == 13))
10753 {
10754 if(!(dest->__anon1.type && dest->__anon1.type->kind == 13 && source->__anon1.type->kind == 8 && source->__anon1.type->__anon1._class && source->__anon1.type->__anon1._class->__anon1.registered && (source->__anon1.type->__anon1._class->__anon1.registered->type != 0 && source->__anon1.type->__anon1._class->__anon1.registered->type != 5) && !source->__anon1.type->byReference))
10755 {
10756 ComputeTypeSize(source->__anon1.type);
10757 ComputeTypeSize(dest->__anon1.type);
10758 if(source->__anon1.type->size == dest->__anon1.type->size && MatchTypes(source->__anon1.type, dest->__anon1.type, (((void *)0)), (((void *)0)), (((void *)0)), 1, 1, 0, 0, warnConst))
10759 return 1;
10760 }
10761 }
10762 }
10763 return 0;
10764 }
10765
10766 void CallOperator(struct Expression * exp, struct Expression * exp1, struct Expression * exp2, struct Operand * op1, struct Operand * op2)
10767 {
10768 if(exp->__anon1.op.op == SIZEOF)
10769 {
10770 FreeExpContents(exp);
10771 exp->type = 2;
10772 exp->__anon1.__anon1.constant = PrintUInt(ComputeTypeSize(op1->type));
10773 }
10774 else
10775 {
10776 if(!exp->__anon1.op.exp1)
10777 {
10778 switch(exp->__anon1.op.op)
10779 {
10780 case '+':
10781 {
10782 struct Expression * exp2 = exp->__anon1.op.exp2;
10783
10784 exp->__anon1.op.exp2 = (((void *)0));
10785 FreeExpContents(exp);
10786 FreeType(exp->expType);
10787 FreeType(exp->destType);
10788 *exp = *exp2;
10789 ((exp2 ? __extension__ ({
10790 void * __ecerePtrToDelete = (exp2);
10791
10792 __ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)__ecerePtrToDelete) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(__ecerePtrToDelete);
10793 }) : 0), exp2 = 0);
10794 break;
10795 }
10796 case '-':
10797 if(op1->ops.Neg)
10798 {
10799 FreeExpContents(exp);
10800 op1->ops.Neg(exp, op1);
10801 }
10802 break;
10803 case '~':
10804 if(op1->ops.BitNot)
10805 {
10806 FreeExpContents(exp);
10807 op1->ops.BitNot(exp, op1);
10808 }
10809 break;
10810 case '!':
10811 if(op1->ops.Not)
10812 {
10813 FreeExpContents(exp);
10814 op1->ops.Not(exp, op1);
10815 }
10816 break;
10817 }
10818 }
10819 else
10820 {
10821 if(op1 && op2 && op1->type && op2->type && op1->kind != op2->kind)
10822 {
10823 if(Promote(op2, op1->kind, op1->type->isSigned))
10824 op2->kind = op1->kind, op2->ops = op1->ops;
10825 else if(Promote(op1, op2->kind, op2->type->isSigned))
10826 op1->kind = op2->kind, op1->ops = op2->ops;
10827 }
10828 switch(exp->__anon1.op.op)
10829 {
10830 case '+':
10831 if(op1->ops.Add)
10832 {
10833 FreeExpContents(exp);
10834 op1->ops.Add(exp, op1, op2);
10835 }
10836 break;
10837 case '-':
10838 if(op1->ops.Sub)
10839 {
10840 FreeExpContents(exp);
10841 op1->ops.Sub(exp, op1, op2);
10842 }
10843 break;
10844 case '*':
10845 if(op1->ops.Mul)
10846 {
10847 FreeExpContents(exp);
10848 op1->ops.Mul(exp, op1, op2);
10849 }
10850 break;
10851 case '/':
10852 if(op1->ops.Div)
10853 {
10854 FreeExpContents(exp);
10855 op1->ops.Div(exp, op1, op2);
10856 }
10857 break;
10858 case '%':
10859 if(op1->ops.Mod)
10860 {
10861 FreeExpContents(exp);
10862 op1->ops.Mod(exp, op1, op2);
10863 }
10864 break;
10865 case '&':
10866 if(exp->__anon1.op.exp2)
10867 {
10868 if(op1->ops.BitAnd)
10869 {
10870 FreeExpContents(exp);
10871 op1->ops.BitAnd(exp, op1, op2);
10872 }
10873 }
10874 break;
10875 case '|':
10876 if(op1->ops.BitOr)
10877 {
10878 FreeExpContents(exp);
10879 op1->ops.BitOr(exp, op1, op2);
10880 }
10881 break;
10882 case '^':
10883 if(op1->ops.BitXor)
10884 {
10885 FreeExpContents(exp);
10886 op1->ops.BitXor(exp, op1, op2);
10887 }
10888 break;
10889 case LEFT_OP:
10890 if(op1->ops.LShift)
10891 {
10892 FreeExpContents(exp);
10893 op1->ops.LShift(exp, op1, op2);
10894 }
10895 break;
10896 case RIGHT_OP:
10897 if(op1->ops.RShift)
10898 {
10899 FreeExpContents(exp);
10900 op1->ops.RShift(exp, op1, op2);
10901 }
10902 break;
10903 case EQ_OP:
10904 if(op1->ops.Equ)
10905 {
10906 FreeExpContents(exp);
10907 op1->ops.Equ(exp, op1, op2);
10908 }
10909 break;
10910 case NE_OP:
10911 if(op1->ops.Nqu)
10912 {
10913 FreeExpContents(exp);
10914 op1->ops.Nqu(exp, op1, op2);
10915 }
10916 break;
10917 case AND_OP:
10918 if(op1->ops.And)
10919 {
10920 FreeExpContents(exp);
10921 op1->ops.And(exp, op1, op2);
10922 }
10923 break;
10924 case OR_OP:
10925 if(op1->ops.Or)
10926 {
10927 FreeExpContents(exp);
10928 op1->ops.Or(exp, op1, op2);
10929 }
10930 break;
10931 case '>':
10932 if(op1->ops.Grt)
10933 {
10934 FreeExpContents(exp);
10935 op1->ops.Grt(exp, op1, op2);
10936 }
10937 break;
10938 case '<':
10939 if(op1->ops.Sma)
10940 {
10941 FreeExpContents(exp);
10942 op1->ops.Sma(exp, op1, op2);
10943 }
10944 break;
10945 case GE_OP:
10946 if(op1->ops.GrtEqu)
10947 {
10948 FreeExpContents(exp);
10949 op1->ops.GrtEqu(exp, op1, op2);
10950 }
10951 break;
10952 case LE_OP:
10953 if(op1->ops.SmaEqu)
10954 {
10955 FreeExpContents(exp);
10956 op1->ops.SmaEqu(exp, op1, op2);
10957 }
10958 break;
10959 }
10960 }
10961 }
10962 }
10963
10964 void ApplyAnyObjectLogic(struct Expression * e)
10965 {
10966 struct Type * destType = e->destType;
10967
10968 if(destType && (destType->classObjectType == 3))
10969 {
10970 if(e && e->expType)
10971 {
10972 struct Type * type = e->expType;
10973 struct __ecereNameSpace__ecere__com__Class * _class = (((void *)0));
10974
10975 if(type->kind == 8 && type->__anon1._class && type->__anon1._class->__anon1.registered)
10976 {
10977 _class = type->__anon1._class->__anon1.registered;
10978 }
10979 else if(type->kind == 19)
10980 {
10981 _class = FindClass("ecere::com::Class")->__anon1.registered;
10982 }
10983 else
10984 {
10985 char string[1024] = "";
10986 struct Symbol * classSym;
10987
10988 PrintTypeNoConst(type, string, 0, 1);
10989 classSym = FindClass(string);
10990 if(classSym)
10991 _class = classSym->__anon1.registered;
10992 }
10993 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->__anon1._class || !type->__anon1._class->__anon1.registered || type->__anon1._class->__anon1.registered->type == 1))) || destType->byReference)))
10994 {
10995 if(!_class || strcmp(_class->fullName, "char *"))
10996 {
10997 struct Expression * checkedExp = e, * newExp;
10998
10999 while(((checkedExp->type == 5 || checkedExp->type == 32 || checkedExp->type == 23) && checkedExp->__anon1.list) || checkedExp->type == 11)
11000 {
11001 if(checkedExp->type == 5 || checkedExp->type == 32 || checkedExp->type == 23)
11002 {
11003 if(checkedExp->type == 23)
11004 {
11005 checkedExp = (*((struct Statement *)(*checkedExp->__anon1.compound->__anon1.compound.statements).last)->__anon1.expressions).last;
11006 }
11007 else
11008 checkedExp = (*checkedExp->__anon1.list).last;
11009 }
11010 else if(checkedExp->type == 11)
11011 checkedExp = checkedExp->__anon1.cast.exp;
11012 }
11013 if(checkedExp && checkedExp->type == 4 && checkedExp->__anon1.op.op == '*' && !checkedExp->__anon1.op.exp1)
11014 {
11015 newExp = checkedExp->__anon1.op.exp2;
11016 checkedExp->__anon1.op.exp2 = (((void *)0));
11017 FreeExpContents(checkedExp);
11018 if(e->expType && e->expType->passAsTemplate)
11019 {
11020 char size[100];
11021
11022 ComputeTypeSize(e->expType);
11023 sprintf(size, "%d", e->expType->size);
11024 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))))));
11025 }
11026 ReplaceExpContents(checkedExp, newExp);
11027 e->byReference = 1;
11028 }
11029 else if(!e->byReference || (_class && _class->type == 5))
11030 {
11031 struct Expression * checkedExp;
11032
11033 {
11034 unsigned int hasAddress = e->type == 0 || (e->type == 8 && e->__anon1.member.memberType == 3) || (e->type == 9 && e->__anon1.member.memberType == 3) || (e->type == 4 && !e->__anon1.op.exp1 && e->__anon1.op.op == '*') || e->type == 6;
11035
11036 if(_class && _class->type != 5 && _class->type != 0 && _class->type != 1 && !hasAddress)
11037 {
11038 struct Context * context = PushContext();
11039 struct Declarator * decl;
11040 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
11041 char typeString[1024];
11042 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
11043
11044 typeString[0] = '\0';
11045 *newExp = *e;
11046 newExp->prev = (((void *)0));
11047 newExp->next = (((void *)0));
11048 newExp->expType = (((void *)0));
11049 PrintTypeNoConst(e->expType, typeString, 0, 1);
11050 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
11051 newExp->destType = ProcessType(specs, decl);
11052 curContext = context;
11053 if(curCompound)
11054 {
11055 char name[100];
11056 struct __ecereNameSpace__ecere__sys__OldList * stmts = MkList();
11057
11058 e->type = 23;
11059 sprintf(name, "__internalValue%03X", internalValueCounter++);
11060 if(!curCompound->__anon1.compound.declarations)
11061 curCompound->__anon1.compound.declarations = MkList();
11062 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*curCompound->__anon1.compound.declarations), (((void *)0)), MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(name)), (((void *)0))))));
11063 ListAdd(stmts, MkExpressionStmt(MkListOne(MkExpOp(MkExpIdentifier(MkIdentifier(name)), '=', newExp))));
11064 ListAdd(stmts, MkExpressionStmt(MkListOne(MkExpIdentifier(MkIdentifier(name)))));
11065 e->__anon1.compound = MkCompoundStmt((((void *)0)), stmts);
11066 }
11067 else
11068 printf("libec: compiler error, curCompound is null in ApplyAnyObjectLogic\n");
11069 {
11070 struct Type * type = e->destType;
11071
11072 e->destType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
11073 CopyTypeInto(e->destType, type);
11074 e->destType->refCount = 1;
11075 e->destType->classObjectType = 0;
11076 FreeType(type);
11077 }
11078 e->__anon1.compound->__anon1.compound.context = context;
11079 PopContext(context);
11080 curContext = context->parent;
11081 }
11082 }
11083 checkedExp = e;
11084 while(((checkedExp->type == 5 || checkedExp->type == 32 || checkedExp->type == 23) && checkedExp->__anon1.list) || checkedExp->type == 11)
11085 {
11086 if(checkedExp->type == 5 || checkedExp->type == 32 || checkedExp->type == 23)
11087 {
11088 if(checkedExp->type == 23)
11089 {
11090 checkedExp = (*((struct Statement *)(*checkedExp->__anon1.compound->__anon1.compound.statements).last)->__anon1.expressions).last;
11091 }
11092 else
11093 checkedExp = (*checkedExp->__anon1.list).last;
11094 }
11095 else if(checkedExp->type == 11)
11096 checkedExp = checkedExp->__anon1.cast.exp;
11097 }
11098 {
11099 struct Expression * operand = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
11100
11101 *operand = *checkedExp;
11102 __ecereMethod_Expression_Clear(checkedExp);
11103 checkedExp->destType = ProcessTypeString("void *", 0);
11104 checkedExp->expType = checkedExp->destType;
11105 checkedExp->destType->refCount++;
11106 checkedExp->type = 4;
11107 checkedExp->__anon1.op.op = '&';
11108 checkedExp->__anon1.op.exp1 = (((void *)0));
11109 checkedExp->__anon1.op.exp2 = operand;
11110 }
11111 }
11112 }
11113 }
11114 }
11115 }
11116 {
11117 }
11118 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->__anon1._class && e->expType->__anon1._class->__anon1.registered && (e->expType->__anon1._class->__anon1.registered->type == 2 || e->expType->__anon1._class->__anon1.registered->type == 4 || e->expType->__anon1._class->__anon1.registered->type == 3))))
11119 {
11120 if(e->expType->classObjectType && destType && destType->classObjectType)
11121 {
11122 return ;
11123 }
11124 else
11125 {
11126 struct Expression * thisExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
11127
11128 *thisExp = *e;
11129 thisExp->prev = (((void *)0));
11130 thisExp->next = (((void *)0));
11131 __ecereMethod_Expression_Clear(e);
11132 e->type = 5;
11133 e->__anon1.list = MkListOne(MkExpOp((((void *)0)), '*', thisExp->type == 0 ? thisExp : MkExpBrackets(MkListOne(thisExp))));
11134 if(thisExp->expType->kind == 8 && thisExp->expType->__anon1._class && thisExp->expType->__anon1._class->__anon1.registered && thisExp->expType->__anon1._class->__anon1.registered->type == 5)
11135 ((struct Expression *)(*e->__anon1.list).first)->byReference = 1;
11136 {
11137 e->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
11138 CopyTypeInto(e->expType, thisExp->expType);
11139 e->expType->byReference = 0;
11140 e->expType->refCount = 1;
11141 if(e->expType->kind == 8 && e->expType->__anon1._class && e->expType->__anon1._class->__anon1.registered && (e->expType->__anon1._class->__anon1.registered->type == 2 || e->expType->__anon1._class->__anon1.registered->type == 4 || e->expType->__anon1._class->__anon1.registered->type == 3))
11142 {
11143 e->expType->classObjectType = 0;
11144 }
11145 }
11146 }
11147 }
11148 else if(destType && e->expType && (e->expType->classObjectType == 3 || e->expType->classObjectType == 2) && !destType->classObjectType && destType->kind != 0)
11149 {
11150 if(destType->kind == 14)
11151 {
11152 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Unspecified type\n", (((void *)0))));
11153 }
11154 else if(!(destType->truth && e->expType->kind == 8 && e->expType->__anon1._class && e->expType->__anon1._class->__anon1.registered && e->expType->__anon1._class->__anon1.registered->type == 1))
11155 {
11156 unsigned int byReference = e->expType->byReference;
11157 struct Expression * thisExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
11158 struct Declarator * decl;
11159 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
11160 char typeString[1024];
11161 struct Type * type;
11162 int backupClassObjectType;
11163 unsigned int backupByReference;
11164
11165 if(e->expType->kind == 8 && e->expType->__anon1._class && e->expType->__anon1._class->__anon1.registered && strcmp(e->expType->__anon1._class->__anon1.registered->name, "class"))
11166 type = e->expType;
11167 else
11168 type = destType;
11169 backupClassObjectType = type->classObjectType;
11170 backupByReference = type->byReference;
11171 type->classObjectType = 0;
11172 type->byReference = 0;
11173 typeString[0] = '\0';
11174 PrintType(type, typeString, 0, 1);
11175 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
11176 type->classObjectType = backupClassObjectType;
11177 type->byReference = backupByReference;
11178 *thisExp = *e;
11179 thisExp->prev = (((void *)0));
11180 thisExp->next = (((void *)0));
11181 __ecereMethod_Expression_Clear(e);
11182 if((type->kind == 8 && type->__anon1._class && type->__anon1._class->__anon1.registered && (type->__anon1._class->__anon1.registered->type == 1000 || type->__anon1._class->__anon1.registered->type == 2 || type->__anon1._class->__anon1.registered->type == 4 || type->__anon1._class->__anon1.registered->type == 3)) || (type->kind != 13 && type->kind != 22 && type->kind != 12 && type->kind != 8) || (!destType->byReference && byReference && (destType->kind != 13 || type->kind != 13)))
11183 {
11184 unsigned int passAsTemplate = thisExp->destType->passAsTemplate;
11185 struct Type * t;
11186
11187 destType->refCount++;
11188 e->type = 4;
11189 e->__anon1.op.op = '*';
11190 e->__anon1.op.exp1 = (((void *)0));
11191 e->__anon1.op.exp2 = MkExpCast(MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl)), thisExp);
11192 t = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
11193 CopyTypeInto(t, thisExp->destType);
11194 t->passAsTemplate = 0;
11195 FreeType(thisExp->destType);
11196 thisExp->destType = t;
11197 t = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
11198 CopyTypeInto(t, destType);
11199 t->passAsTemplate = passAsTemplate;
11200 FreeType(destType);
11201 destType = t;
11202 destType->refCount = 0;
11203 e->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
11204 CopyTypeInto(e->expType, type);
11205 if(type->passAsTemplate)
11206 {
11207 e->expType->classObjectType = 0;
11208 e->expType->passAsTemplate = 0;
11209 }
11210 e->expType->byReference = 0;
11211 e->expType->refCount = 1;
11212 }
11213 else
11214 {
11215 e->type = 11;
11216 e->__anon1.cast.typeName = MkTypeName(specs, decl);
11217 e->__anon1.cast.exp = thisExp;
11218 e->byReference = 1;
11219 e->expType = type;
11220 type->refCount++;
11221 }
11222 if(e->destType)
11223 FreeType(e->destType);
11224 e->destType = destType;
11225 destType->refCount++;
11226 }
11227 }
11228 }
11229
11230 void ComputeModuleClasses(struct __ecereNameSpace__ecere__com__Instance * module)
11231 {
11232 struct __ecereNameSpace__ecere__com__Class * _class;
11233 struct __ecereNameSpace__ecere__sys__OldLink * subModule;
11234
11235 for(subModule = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->modules.first; subModule; subModule = subModule->next)
11236 ComputeModuleClasses(subModule->data);
11237 for(_class = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->classes.first; _class; _class = _class->next)
11238 ComputeClassMembers(_class, 0);
11239 }
11240
11241 struct External * _DeclareStruct(struct External * neededBy, const char * name, unsigned int skipNoHead, unsigned int needDereference, unsigned int fwdDecl)
11242 {
11243 struct External * external = (((void *)0));
11244 struct Symbol * classSym = FindClass(name);
11245 struct __ecereNameSpace__ecere__sys__OldList * curDeclarations = (((void *)0));
11246
11247 if(!inCompiler || !classSym)
11248 return (((void *)0));
11249 if(classSym->__anon1.registered && (classSym->__anon1.registered->type == 2 || classSym->__anon1.registered->type == 3 || classSym->__anon1.registered->type == 4))
11250 return (((void *)0));
11251 if(!classSym->__anon1.registered || (classSym->__anon1.registered->type == 0 && classSym->__anon1.registered->structSize && classSym->__anon1.registered->base && classSym->__anon1.registered->base->base))
11252 _DeclareStruct(neededBy, "ecere::com::Instance", 0, 1, fwdDecl);
11253 external = classSym->__anon2.__anon1.structExternal;
11254 if(external && external->__anon1.declaration)
11255 {
11256 struct Specifier * spec;
11257
11258 for(spec = external->__anon1.declaration->__anon1.__anon1.specifiers ? (*external->__anon1.declaration->__anon1.__anon1.specifiers).first : (((void *)0)); spec; spec = spec->next)
11259 if(spec->type == 3 || spec->type == 4)
11260 {
11261 curDeclarations = spec->__anon1.__anon2.definitions;
11262 break;
11263 }
11264 }
11265 if(classSym->__anon1.registered && !classSym->declaring && classSym->imported && (!classSym->declaredStructSym || (classSym->__anon1.registered->type == 5 && !skipNoHead && external && !curDeclarations)))
11266 {
11267 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
11268 struct __ecereNameSpace__ecere__sys__OldList * declarations = (((void *)0));
11269 char structName[1024];
11270 unsigned int addedPadding = 0;
11271 struct Specifier * curSpec = (((void *)0));
11272
11273 classSym->declaring++;
11274 if(strchr(classSym->string, '<'))
11275 {
11276 if(classSym->__anon1.registered->templateClass)
11277 external = _DeclareStruct(neededBy, classSym->__anon1.registered->templateClass->fullName, skipNoHead, needDereference, fwdDecl);
11278 classSym->declaring--;
11279 return external;
11280 }
11281 structName[0] = 0;
11282 FullClassNameCat(structName, name, 0);
11283 classSym->declaredStructSym = 1;
11284 if(!external || (classSym->__anon1.registered->type == 5 && !skipNoHead && !curDeclarations))
11285 {
11286 unsigned int add = 0;
11287
11288 if(!external)
11289 {
11290 external = MkExternalDeclaration((((void *)0)));
11291 classSym->__anon2.__anon1.structExternal = external;
11292 external->symbol = classSym;
11293 add = 1;
11294 }
11295 if(!skipNoHead)
11296 {
11297 declarations = MkList();
11298 AddMembers(external, declarations, classSym->__anon1.registered, 0, (((void *)0)), classSym->__anon1.registered, &addedPadding);
11299 }
11300 if(external->__anon1.declaration)
11301 {
11302 struct Specifier * spec;
11303
11304 for(spec = external->__anon1.declaration->__anon1.__anon1.specifiers ? (*external->__anon1.declaration->__anon1.__anon1.specifiers).first : (((void *)0)); spec; spec = spec->next)
11305 if(spec->type == 3 || spec->type == 4)
11306 {
11307 curSpec = spec;
11308 curDeclarations = spec->__anon1.__anon2.definitions;
11309 break;
11310 }
11311 }
11312 if(declarations && (!(*declarations).count || ((*declarations).count == 1 && addedPadding)))
11313 {
11314 FreeList(declarations, (void *)(FreeClassDef));
11315 declarations = (((void *)0));
11316 }
11317 if(classSym->__anon1.registered->type != 5 && !declarations)
11318 {
11319 FreeExternal(external);
11320 external = (((void *)0));
11321 classSym->__anon2.__anon1.structExternal = (((void *)0));
11322 }
11323 else
11324 {
11325 if(curSpec)
11326 curSpec->__anon1.__anon2.definitions = declarations;
11327 else
11328 {
11329 specifiers = MkList();
11330 declarators = MkList();
11331 ListAdd(specifiers, MkStructOrUnion(3, MkIdentifier(structName), declarations));
11332 external->__anon1.declaration = MkDeclaration(specifiers, declarators);
11333 }
11334 if(add)
11335 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*ast), external);
11336 }
11337 }
11338 classSym->declaring--;
11339 }
11340 else if(!classSym->declaredStructSym && classSym->__anon2.__anon1.structExternal)
11341 {
11342 classSym->declaredStructSym = 1;
11343 if(classSym->__anon1.registered)
11344 DeclareMembers(classSym->__anon2.__anon1.structExternal, classSym->__anon1.registered, 0);
11345 if(classSym->__anon2.__anon1.structExternal->__anon1.declaration && classSym->__anon2.__anon1.structExternal->__anon1.declaration->__anon1.__anon1.specifiers)
11346 {
11347 struct Specifier * spec;
11348
11349 for(spec = (*classSym->__anon2.__anon1.structExternal->__anon1.declaration->__anon1.__anon1.specifiers).first; spec; spec = spec->next)
11350 {
11351 if(spec->__anon1.__anon2.definitions)
11352 IdentifyAnonStructs(spec->__anon1.__anon2.definitions);
11353 }
11354 }
11355 }
11356 if(inCompiler && neededBy && (external || !classSym->imported))
11357 {
11358 if(!external)
11359 {
11360 classSym->__anon2.__anon1.structExternal = external = MkExternalDeclaration((((void *)0)));
11361 external->symbol = classSym;
11362 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*ast), external);
11363 }
11364 if(reachedPass15 && !external->__anon1.declaration && classSym->__anon1.registered && classSym->__anon1.registered->type == 5)
11365 {
11366 char structName[1024];
11367 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
11368
11369 structName[0] = 0;
11370 FullClassNameCat(structName, name, 0);
11371 specifiers = MkList();
11372 declarators = MkList();
11373 ListAdd(specifiers, MkStructOrUnion(3, MkIdentifier(structName), (((void *)0))));
11374 external->__anon1.declaration = MkDeclaration(specifiers, declarators);
11375 }
11376 if(fwdDecl)
11377 {
11378 struct External * e = external->fwdDecl ? external->fwdDecl : external;
11379
11380 if(((struct __ecereNameSpace__ecere__com__LinkList *)(((char *)e->incoming + 0 + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->count)
11381 __ecereMethod_External_CreateUniqueEdge(neededBy, e, !needDereference && !external->fwdDecl);
11382 }
11383 else
11384 __ecereMethod_External_CreateUniqueEdge(neededBy, external, !needDereference);
11385 }
11386 return external;
11387 }
11388
11389 unsigned int MatchWithEnums_NameSpace(struct __ecereNameSpace__ecere__com__NameSpace * nameSpace, struct Expression * sourceExp, struct Type * dest, char * string, struct __ecereNameSpace__ecere__sys__OldList * conversions)
11390 {
11391 struct __ecereNameSpace__ecere__com__BTNamedLink * link;
11392
11393 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)))
11394 {
11395 struct __ecereNameSpace__ecere__com__Class * _class = link->data;
11396
11397 if(_class->type == 4)
11398 {
11399 struct __ecereNameSpace__ecere__sys__OldList converts =
11400 {
11401 0, 0, 0, 0, 0
11402 };
11403 struct Type * type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
11404
11405 type->kind = 8;
11406 if(!_class->symbol)
11407 _class->symbol = FindClass(_class->fullName);
11408 type->__anon1._class = _class->symbol;
11409 if(MatchTypes(type, dest, &converts, (((void *)0)), (((void *)0)), dest->kind != 8 || !dest->__anon1._class || strcmp(dest->__anon1._class->string, "bool"), 0, 0, 0, 0))
11410 {
11411 struct __ecereNameSpace__ecere__sys__NamedLink64 * value;
11412 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
11413
11414 if(enumClass)
11415 {
11416 struct __ecereNameSpace__ecere__com__Class * baseClass;
11417
11418 for(baseClass = _class; baseClass && baseClass->type == 4; baseClass = baseClass->base)
11419 {
11420 struct __ecereNameSpace__ecere__com__EnumClassData * e = (baseClass ? ((void *)(((char *)baseClass->data) + enumClass->offsetClass)) : (((void *)0)));
11421
11422 for(value = e->values.first; value; value = value->next)
11423 {
11424 if(!strcmp(value->name, string))
11425 break;
11426 }
11427 if(value)
11428 {
11429 FreeType(sourceExp->expType);
11430 sourceExp->isConstant = 1;
11431 sourceExp->expType = MkClassType(baseClass->fullName);
11432 if(inCompiler || inPreCompiler || inDebugger)
11433 {
11434 char constant[256];
11435
11436 FreeExpContents(sourceExp);
11437 sourceExp->type = 2;
11438 if(!strcmp(baseClass->dataTypeString, "int") || !strcmp(baseClass->dataTypeString, "int64") || !strcmp(baseClass->dataTypeString, "short") || !strcmp(baseClass->dataTypeString, "char"))
11439 sprintf(constant, ((__runtimePlatform == 1) ? "%I64d" : "%lld"), value->data);
11440 else
11441 sprintf(constant, ((__runtimePlatform == 1) ? "0x%I64XLL" : "0x%llXLL"), value->data);
11442 sourceExp->__anon1.__anon1.constant = __ecereNameSpace__ecere__sys__CopyString(constant);
11443 }
11444 while(converts.first)
11445 {
11446 struct Conversion * convert = converts.first;
11447
11448 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(&converts, convert);
11449 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(conversions, convert);
11450 }
11451 ((type ? __extension__ ({
11452 void * __ecerePtrToDelete = (type);
11453
11454 __ecereClass_Type->Destructor ? __ecereClass_Type->Destructor((void *)__ecerePtrToDelete) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(__ecerePtrToDelete);
11455 }) : 0), type = 0);
11456 return 1;
11457 }
11458 }
11459 }
11460 }
11461 if(converts.first)
11462 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(&converts, (void *)(FreeConvert));
11463 ((type ? __extension__ ({
11464 void * __ecerePtrToDelete = (type);
11465
11466 __ecereClass_Type->Destructor ? __ecereClass_Type->Destructor((void *)__ecerePtrToDelete) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(__ecerePtrToDelete);
11467 }) : 0), type = 0);
11468 }
11469 }
11470 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)))
11471 if(MatchWithEnums_NameSpace(nameSpace, sourceExp, dest, string, conversions))
11472 return 1;
11473 return 0;
11474 }
11475
11476 unsigned int MatchWithEnums_Module(struct __ecereNameSpace__ecere__com__Instance * mainModule, struct Expression * sourceExp, struct Type * dest, char * string, struct __ecereNameSpace__ecere__sys__OldList * conversions)
11477 {
11478 struct __ecereNameSpace__ecere__com__Instance * module;
11479
11480 if(MatchWithEnums_NameSpace(&((struct __ecereNameSpace__ecere__com__Application *)(((char *)((struct __ecereNameSpace__ecere__com__Module *)(((char *)mainModule + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->application + sizeof(struct __ecereNameSpace__ecere__com__Module) + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->systemNameSpace, sourceExp, dest, string, conversions))
11481 return 1;
11482 if(MatchWithEnums_NameSpace(&((struct __ecereNameSpace__ecere__com__Module *)(((char *)((struct __ecereNameSpace__ecere__com__Module *)(((char *)mainModule + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->application + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->privateNameSpace, sourceExp, dest, string, conversions))
11483 return 1;
11484 if(MatchWithEnums_NameSpace(&((struct __ecereNameSpace__ecere__com__Module *)(((char *)((struct __ecereNameSpace__ecere__com__Module *)(((char *)mainModule + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->application + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->publicNameSpace, sourceExp, dest, string, conversions))
11485 return 1;
11486 for(module = ((struct __ecereNameSpace__ecere__com__Application *)(((char *)((struct __ecereNameSpace__ecere__com__Module *)(((char *)mainModule + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->application + sizeof(struct __ecereNameSpace__ecere__com__Module) + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->allModules.first; module; module = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->next)
11487 {
11488 if(ModuleVisibility(mainModule, module) && MatchWithEnums_NameSpace(&((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->publicNameSpace, sourceExp, dest, string, conversions))
11489 return 1;
11490 }
11491 return 0;
11492 }
11493
11494 void ProcessExpressionType(struct Expression *  exp);
11495
11496 static void ReplaceClassMembers(struct Expression * exp, struct __ecereNameSpace__ecere__com__Class * _class)
11497 {
11498 if(exp->type == 0 && exp->__anon1.__anon1.identifier)
11499 {
11500 struct Identifier * id = exp->__anon1.__anon1.identifier;
11501 struct Context * ctx;
11502 struct Symbol * symbol = (((void *)0));
11503
11504 if(!id->_class || !id->_class->__anon1.__anon1.name || strcmp(id->_class->__anon1.__anon1.name, "property"))
11505 {
11506 for(ctx = curContext; ctx != topContext->parent && !symbol; ctx = ctx->parent)
11507 {
11508 if(!ctx)
11509 break;
11510 symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(&ctx->symbols, id->string);
11511 if(symbol)
11512 break;
11513 }
11514 }
11515 if(!symbol && ((!id->_class || (id->_class->__anon1.__anon1.name && !strcmp(id->_class->__anon1.__anon1.name, "property"))) || (id->classSym && __ecereNameSpace__ecere__com__eClass_IsDerived(_class, id->classSym->__anon1.registered))))
11516 {
11517 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
11518 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
11519 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
11520 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
11521
11522 if(!prop)
11523 {
11524 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule);
11525 }
11526 if(!prop && !method)
11527 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
11528 if(!prop && !method && !member)
11529 {
11530 classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(_class, id->string);
11531 }
11532 if(prop || method || member || classProp)
11533 {
11534 exp->type = 8;
11535 exp->__anon1.member.member = id;
11536 exp->__anon1.member.memberType = 0;
11537 exp->__anon1.member.exp = QMkExpId("this");
11538 exp->addedThis = 1;
11539 }
11540 else if(_class && _class->templateParams.first)
11541 {
11542 struct __ecereNameSpace__ecere__com__Class * sClass;
11543
11544 for(sClass = _class; sClass; sClass = sClass->base)
11545 {
11546 if(sClass->templateParams.first)
11547 {
11548 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
11549
11550 for(param = sClass->templateParams.first; param; param = param->next)
11551 {
11552 if(param->type == 2 && !strcmp(param->name, id->string))
11553 {
11554 struct Expression * argExp = GetTemplateArgExpByName(param->name, _class, 2);
11555
11556 if(argExp)
11557 {
11558 struct Declarator * decl;
11559 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
11560
11561 FreeIdentifier(exp->__anon1.member.member);
11562 ProcessExpressionType(argExp);
11563 decl = SpecDeclFromString(param->__anon1.dataTypeString, specs, (((void *)0)));
11564 exp->expType = ProcessType(specs, decl);
11565 exp->type = 5;
11566 exp->__anon1.list = MkListOne(MkExpOp((((void *)0)), '*', MkExpCast(MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl)), MkExpOp((((void *)0)), '&', argExp))));
11567 }
11568 }
11569 }
11570 }
11571 }
11572 }
11573 }
11574 }
11575 }
11576
11577 int ComputeTypeSize(struct Type * type)
11578 {
11579 unsigned int size = type ? type->size : 0;
11580
11581 if(!size && type && !type->computing)
11582 {
11583 type->computing = 1;
11584 switch(type->kind)
11585 {
11586 case 24:
11587 type->alignment = size = sizeof(char);
11588 break;
11589 case 1:
11590 type->alignment = size = sizeof(char);
11591 break;
11592 case 3:
11593 type->alignment = size = sizeof(int);
11594 break;
11595 case 4:
11596 type->alignment = size = sizeof(long long);
11597 break;
11598 case 22:
11599 type->alignment = size = targetBits / 8;
11600 type->pointerAlignment = 1;
11601 break;
11602 case 23:
11603 type->alignment = size = targetBits / 8;
11604 type->pointerAlignment = 1;
11605 break;
11606 case 5:
11607 type->alignment = size = sizeof(long);
11608 break;
11609 case 2:
11610 type->alignment = size = sizeof(short);
11611 break;
11612 case 6:
11613 type->alignment = size = sizeof(float);
11614 break;
11615 case 7:
11616 type->alignment = size = sizeof(double);
11617 break;
11618 case 8:
11619 {
11620 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class ? type->__anon1._class->__anon1.registered : (((void *)0));
11621
11622 if(_class && _class->type == 1)
11623 {
11624 ComputeClassMembers(_class, 0);
11625 type->alignment = _class->structAlignment;
11626 type->pointerAlignment = (unsigned int)_class->pointerAlignment;
11627 size = _class->structSize;
11628 if(type->alignment && size % type->alignment)
11629 size += type->alignment - (size % type->alignment);
11630 }
11631 else if(_class && (_class->type == 3 || _class->type == 4 || _class->type == 2))
11632 {
11633 if(!_class->dataType)
11634 _class->dataType = ProcessTypeString(_class->dataTypeString, 0);
11635 size = type->alignment = ComputeTypeSize(_class->dataType);
11636 }
11637 else
11638 {
11639 size = type->alignment = targetBits / 8;
11640 type->pointerAlignment = 1;
11641 }
11642 break;
11643 }
11644 case 13:
11645 case 19:
11646 size = type->alignment = targetBits / 8;
11647 type->pointerAlignment = 1;
11648 break;
11649 case 12:
11650 if(type->__anon1.__anon4.arraySizeExp)
11651 {
11652 ProcessExpressionType(type->__anon1.__anon4.arraySizeExp);
11653 ComputeExpression(type->__anon1.__anon4.arraySizeExp);
11654 if(!type->__anon1.__anon4.arraySizeExp->isConstant || (type->__anon1.__anon4.arraySizeExp->expType->kind != 3 && type->__anon1.__anon4.arraySizeExp->expType->kind != 2 && type->__anon1.__anon4.arraySizeExp->expType->kind != 1 && type->__anon1.__anon4.arraySizeExp->expType->kind != 5 && type->__anon1.__anon4.arraySizeExp->expType->kind != 4 && type->__anon1.__anon4.arraySizeExp->expType->kind != 23 && type->__anon1.__anon4.arraySizeExp->expType->kind != 22 && type->__anon1.__anon4.arraySizeExp->expType->kind != 15 && (type->__anon1.__anon4.arraySizeExp->expType->kind != 8 || !type->__anon1.__anon4.arraySizeExp->expType->__anon1._class->__anon1.registered || type->__anon1.__anon4.arraySizeExp->expType->__anon1._class->__anon1.registered->type != 4)))
11655 {
11656 struct Location oldLoc = yylloc;
11657 char expression[10240];
11658
11659 expression[0] = '\0';
11660 type->__anon1.__anon4.arraySizeExp->expType = (((void *)0));
11661 yylloc = type->__anon1.__anon4.arraySizeExp->loc;
11662 if(inCompiler)
11663 PrintExpression(type->__anon1.__anon4.arraySizeExp, expression);
11664 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Array size not constant int (%s)\n", (((void *)0))), expression);
11665 yylloc = oldLoc;
11666 }
11667 GetInt(type->__anon1.__anon4.arraySizeExp, &type->__anon1.__anon4.arraySize);
11668 }
11669 else if(type->__anon1.__anon4.enumClass)
11670 {
11671 if(type->__anon1.__anon4.enumClass && type->__anon1.__anon4.enumClass->__anon1.registered && type->__anon1.__anon4.enumClass->__anon1.registered->type == 4)
11672 {
11673 type->__anon1.__anon4.arraySize = (int)__ecereNameSpace__ecere__com__eClass_GetProperty(type->__anon1.__anon4.enumClass->__anon1.registered, "enumSize");
11674 }
11675 else
11676 type->__anon1.__anon4.arraySize = 0;
11677 }
11678 else
11679 {
11680 type->__anon1.__anon4.arraySize = 0;
11681 }
11682 size = ComputeTypeSize(type->__anon1.type) * type->__anon1.__anon4.arraySize;
11683 if(type->__anon1.type)
11684 {
11685 type->alignment = type->__anon1.type->alignment;
11686 type->pointerAlignment = type->__anon1.type->pointerAlignment;
11687 }
11688 break;
11689 case 9:
11690 {
11691 if(!type->__anon1.__anon1.members.first && type->__anon1.__anon1.enumName)
11692 {
11693 struct Symbol * symbol = FindStruct(curContext, type->__anon1.__anon1.enumName);
11694
11695 if(symbol && symbol->type)
11696 {
11697 ComputeTypeSize(symbol->type);
11698 size = symbol->type->size;
11699 }
11700 }
11701 else
11702 {
11703 struct Type * member;
11704
11705 for(member = type->__anon1.__anon1.members.first; member; member = member->next)
11706 {
11707 int __simpleStruct0, __simpleStruct1;
11708 unsigned int addSize = ComputeTypeSize(member);
11709
11710 member->offset = size;
11711 if(member->alignment && size % member->alignment)
11712 member->offset += member->alignment - (size % member->alignment);
11713 size = member->offset;
11714 if(member->pointerAlignment && type->size <= 4)
11715 type->pointerAlignment = 1;
11716 else if(!member->pointerAlignment && member->alignment >= 8)
11717 type->pointerAlignment = 0;
11718 type->alignment = (__simpleStruct0 = type->alignment, __simpleStruct1 = member->alignment, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
11719 size += addSize;
11720 }
11721 if(type->alignment && size % type->alignment)
11722 size += type->alignment - (size % type->alignment);
11723 }
11724 break;
11725 }
11726 case 10:
11727 {
11728 if(!type->__anon1.__anon1.members.first && type->__anon1.__anon1.enumName)
11729 {
11730 struct Symbol * symbol = FindStruct(curContext, type->__anon1.__anon1.enumName);
11731
11732 if(symbol && symbol->type)
11733 {
11734 ComputeTypeSize(symbol->type);
11735 size = symbol->type->size;
11736 type->alignment = symbol->type->alignment;
11737 }
11738 }
11739 else
11740 {
11741 struct Type * member;
11742
11743 for(member = type->__anon1.__anon1.members.first; member; member = member->next)
11744 {
11745 int __simpleStruct0, __simpleStruct1;
11746 unsigned int addSize = ComputeTypeSize(member);
11747
11748 member->offset = size;
11749 if(member->alignment && size % member->alignment)
11750 member->offset += member->alignment - (size % member->alignment);
11751 size = member->offset;
11752 if(member->pointerAlignment && type->size <= 4)
11753 type->pointerAlignment = 1;
11754 else if(!member->pointerAlignment && member->alignment >= 8)
11755 type->pointerAlignment = 0;
11756 type->alignment = (__simpleStruct0 = type->alignment, __simpleStruct1 = member->alignment, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
11757 size = ((size > addSize) ? size : addSize);
11758 }
11759 if(type->alignment && size % type->alignment)
11760 size += type->alignment - (size % type->alignment);
11761 }
11762 break;
11763 }
11764 case 20:
11765 {
11766 struct TemplateParameter * param = type->__anon1.templateParameter;
11767 struct Type * baseType = ProcessTemplateParameterType(param);
11768
11769 if(baseType)
11770 {
11771 size = ComputeTypeSize(baseType);
11772 type->alignment = baseType->alignment;
11773 type->pointerAlignment = baseType->pointerAlignment;
11774 }
11775 else
11776 type->alignment = size = sizeof(uint64);
11777 break;
11778 }
11779 case 15:
11780 {
11781 type->alignment = size = sizeof(enum
11782 {
11783 test
11784 });
11785 break;
11786 }
11787 case 21:
11788 {
11789 type->alignment = size = targetBits / 8;
11790 type->pointerAlignment = 1;
11791 break;
11792 }
11793 }
11794 type->size = size;
11795 type->computing = 0;
11796 }
11797 return size;
11798 }
11799
11800 unsigned int MatchTypeExpression(struct Expression * sourceExp, struct Type * dest, struct __ecereNameSpace__ecere__sys__OldList * conversions, unsigned int skipUnitBla, unsigned int warnConst)
11801 {
11802 struct Type * source;
11803 struct Type * realDest = dest;
11804 struct Type * backupSourceExpType = (((void *)0));
11805 struct Expression * nbExp = GetNonBracketsExp(sourceExp);
11806 struct Expression * computedExp = nbExp;
11807
11808 dest->refCount++;
11809 if(sourceExp->isConstant && sourceExp->type != 2 && sourceExp->type != 0 && sourceExp->type != 11 && dest->kind == 8 && dest->__anon1._class && dest->__anon1._class->__anon1.registered && dest->__anon1._class->__anon1.registered->type == 4)
11810 {
11811 computedExp = CopyExpression(nbExp);
11812 ComputeExpression(computedExp);
11813 }
11814 source = sourceExp->expType;
11815 if(dest->kind == 13 && sourceExp->type == 2 && !strtoul(sourceExp->__anon1.__anon1.constant, (((void *)0)), 0))
11816 {
11817 if(computedExp != nbExp)
11818 {
11819 FreeExpression(computedExp);
11820 computedExp = nbExp;
11821 }
11822 FreeType(dest);
11823 return 1;
11824 }
11825 if(!skipUnitBla && source && dest && source->kind == 8 && dest->kind == 8)
11826 {
11827 if(source->__anon1._class && source->__anon1._class->__anon1.registered && source->__anon1._class->__anon1.registered->type == 3)
11828 {
11829 struct __ecereNameSpace__ecere__com__Class * sourceBase, * destBase;
11830
11831 for(sourceBase = source->__anon1._class->__anon1.registered; sourceBase && sourceBase->base && sourceBase->base->type != 1000; sourceBase = sourceBase->base)
11832 ;
11833 for(destBase = dest->__anon1._class->__anon1.registered; destBase && destBase->base && destBase->base->type != 1000; destBase = destBase->base)
11834 ;
11835 if(sourceBase == destBase)
11836 {
11837 if(computedExp != nbExp)
11838 {
11839 FreeExpression(computedExp);
11840 computedExp = nbExp;
11841 }
11842 FreeType(dest);
11843 return 1;
11844 }
11845 }
11846 }
11847 if(source)
11848 {
11849 struct __ecereNameSpace__ecere__sys__OldList * specs;
11850 unsigned int flag = 0;
11851 long long value = (((int)0x7fffffff));
11852
11853 source->refCount++;
11854 if(computedExp->type == 2)
11855 {
11856 if(source->isSigned)
11857 value = strtoll(computedExp->__anon1.__anon1.constant, (((void *)0)), 0);
11858 else
11859 value = strtoull(computedExp->__anon1.__anon1.constant, (((void *)0)), 0);
11860 }
11861 else if(computedExp->type == 4 && computedExp->__anon1.op.op == '-' && !computedExp->__anon1.op.exp1 && computedExp->__anon1.op.exp2 && computedExp->__anon1.op.exp2->type == 2)
11862 {
11863 if(source->isSigned)
11864 value = -strtoll(computedExp->__anon1.op.exp2->__anon1.__anon1.constant, (((void *)0)), 0);
11865 else
11866 value = -strtoull(computedExp->__anon1.op.exp2->__anon1.__anon1.constant, (((void *)0)), 0);
11867 }
11868 if(computedExp != nbExp)
11869 {
11870 FreeExpression(computedExp);
11871 computedExp = nbExp;
11872 }
11873 if(dest->kind != 8 && source->kind == 8 && source->__anon1._class && source->__anon1._class->__anon1.registered && !strcmp(source->__anon1._class->__anon1.registered->fullName, "unichar"))
11874 {
11875 FreeType(source);
11876 source = __extension__ ({
11877 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
11878
11879 __ecereInstance1->kind = 3, __ecereInstance1->isSigned = 0, __ecereInstance1->refCount = 1, __ecereInstance1;
11880 });
11881 }
11882 if(dest->kind == 8)
11883 {
11884 struct __ecereNameSpace__ecere__com__Class * _class = dest->__anon1._class ? dest->__anon1._class->__anon1.registered : (((void *)0));
11885
11886 if(_class && _class->type == 3)
11887 {
11888 if(source->kind != 8)
11889 {
11890 struct Type * tempType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
11891 struct Type * tempDest, * tempSource;
11892
11893 for(; _class->base->type != 1000; _class = _class->base)
11894 ;
11895 tempSource = dest;
11896 tempDest = tempType;
11897 tempType->kind = 8;
11898 if(!_class->symbol)
11899 _class->symbol = FindClass(_class->fullName);
11900 tempType->__anon1._class = _class->symbol;
11901 tempType->truth = dest->truth;
11902 if(tempType->__anon1._class)
11903 MatchTypes(tempSource, tempDest, conversions, (((void *)0)), (((void *)0)), 1, 1, 0, 0, warnConst);
11904 backupSourceExpType = sourceExp->expType;
11905 if(dest->passAsTemplate)
11906 {
11907 sourceExp->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
11908 CopyTypeInto(sourceExp->expType, dest);
11909 sourceExp->expType->passAsTemplate = 0;
11910 }
11911 else
11912 {
11913 sourceExp->expType = dest;
11914 dest->refCount++;
11915 }
11916 flag = 1;
11917 ((tempType ? __extension__ ({
11918 void * __ecerePtrToDelete = (tempType);
11919
11920 __ecereClass_Type->Destructor ? __ecereClass_Type->Destructor((void *)__ecerePtrToDelete) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(__ecerePtrToDelete);
11921 }) : 0), tempType = 0);
11922 }
11923 }
11924 if(_class && _class->type == 2 && source->kind != 8)
11925 {
11926 if(!dest->__anon1._class->__anon1.registered->dataType)
11927 dest->__anon1._class->__anon1.registered->dataType = ProcessTypeString(dest->__anon1._class->__anon1.registered->dataTypeString, 0);
11928 if(MatchTypes(source, dest->__anon1._class->__anon1.registered->dataType, conversions, (((void *)0)), (((void *)0)), 1, 1, 0, 0, warnConst))
11929 {
11930 FreeType(source);
11931 FreeType(sourceExp->expType);
11932 source = sourceExp->expType = MkClassType(dest->__anon1._class->string);
11933 source->refCount++;
11934 }
11935 }
11936 if(_class && !strcmp(_class->fullName, "ecere::com::Class") && source->kind == 13 && source->__anon1.type && source->__anon1.type->kind == 1 && sourceExp->type == 3)
11937 {
11938 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
11939 struct Declarator * decl;
11940 char string[1024];
11941
11942 ReadString(string, sourceExp->__anon1.__anon2.string);
11943 decl = SpecDeclFromString(string, specs, (((void *)0)));
11944 FreeExpContents(sourceExp);
11945 FreeType(sourceExp->expType);
11946 sourceExp->type = 24;
11947 sourceExp->__anon1._classExp.specifiers = specs;
11948 sourceExp->__anon1._classExp.decl = decl;
11949 sourceExp->expType = dest;
11950 dest->refCount++;
11951 FreeType(source);
11952 FreeType(dest);
11953 if(backupSourceExpType)
11954 FreeType(backupSourceExpType);
11955 return 1;
11956 }
11957 }
11958 else if(source->kind == 8)
11959 {
11960 struct __ecereNameSpace__ecere__com__Class * _class = source->__anon1._class ? source->__anon1._class->__anon1.registered : (((void *)0));
11961
11962 if(_class && (_class->type == 3 || _class->type == 2))
11963 {
11964 if(dest->kind != 8)
11965 {
11966 struct Type * tempType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
11967 struct Type * tempDest, * tempSource;
11968
11969 if(!source->__anon1._class->__anon1.registered->dataType)
11970 source->__anon1._class->__anon1.registered->dataType = ProcessTypeString(source->__anon1._class->__anon1.registered->dataTypeString, 0);
11971 for(; _class->base->type != 1000; _class = _class->base)
11972 ;
11973 tempDest = source;
11974 tempSource = tempType;
11975 tempType->kind = 8;
11976 tempType->__anon1._class = FindClass(_class->fullName);
11977 tempType->truth = source->truth;
11978 tempType->classObjectType = source->classObjectType;
11979 if(tempType->__anon1._class)
11980 MatchTypes(tempSource, tempDest, conversions, (((void *)0)), (((void *)0)), 1, 1, 0, 0, warnConst);
11981 if(conversions && conversions->last)
11982 {
11983 ((struct Conversion *)conversions->last)->resultType = dest;
11984 dest->refCount++;
11985 modifyPassAsTemplate(&((struct Conversion *)conversions->last)->resultType, 0);
11986 }
11987 FreeType(sourceExp->expType);
11988 sourceExp->expType = MkClassType(_class->fullName);
11989 sourceExp->expType->truth = source->truth;
11990 sourceExp->expType->classObjectType = source->classObjectType;
11991 if(!sourceExp->destType)
11992 {
11993 FreeType(sourceExp->destType);
11994 sourceExp->destType = sourceExp->expType;
11995 if(sourceExp->expType)
11996 sourceExp->expType->refCount++;
11997 }
11998 if(!_class->dataType)
11999 _class->dataType = ProcessTypeString(_class->dataTypeString, 0);
12000 FreeType(dest);
12001 dest = MkClassType(source->__anon1._class->string);
12002 dest->truth = source->truth;
12003 dest->classObjectType = source->classObjectType;
12004 FreeType(source);
12005 source = _class->dataType;
12006 source->refCount++;
12007 ((tempType ? __extension__ ({
12008 void * __ecerePtrToDelete = (tempType);
12009
12010 __ecereClass_Type->Destructor ? __ecereClass_Type->Destructor((void *)__ecerePtrToDelete) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(__ecerePtrToDelete);
12011 }) : 0), tempType = 0);
12012 }
12013 }
12014 }
12015 if(!flag)
12016 {
12017 if(MatchTypes(source, dest, conversions, (((void *)0)), (((void *)0)), 1, 1, 0, 0, warnConst))
12018 {
12019 FreeType(source);
12020 FreeType(dest);
12021 return 1;
12022 }
12023 }
12024 if(dest->kind == 8)
12025 {
12026 struct __ecereNameSpace__ecere__com__Class * _class = dest->__anon1._class ? dest->__anon1._class->__anon1.registered : (((void *)0));
12027 unsigned int fittingValue = 0;
12028
12029 if(_class && _class->type == 4)
12030 {
12031 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
12032 struct __ecereNameSpace__ecere__com__EnumClassData * c = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
12033
12034 if(c && value >= 0 && value <= c->largest)
12035 fittingValue = 1;
12036 }
12037 if(_class && !dest->truth && (_class->type == 3 || fittingValue || (_class->type != 1 && !value && source->kind == 3) || _class->type == 2))
12038 {
12039 if(_class->type == 0 || _class->type == 5)
12040 {
12041 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12042
12043 *newExp = *sourceExp;
12044 if(sourceExp->destType)
12045 sourceExp->destType->refCount++;
12046 if(sourceExp->expType)
12047 sourceExp->expType->refCount++;
12048 sourceExp->type = 11;
12049 sourceExp->__anon1.cast.typeName = MkTypeName(MkListOne(MkSpecifier(VOID)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0))));
12050 sourceExp->__anon1.cast.exp = newExp;
12051 FreeType(sourceExp->expType);
12052 sourceExp->expType = (((void *)0));
12053 ProcessExpressionType(sourceExp);
12054 if(!inCompiler)
12055 {
12056 FreeType(sourceExp->expType);
12057 sourceExp->expType = dest;
12058 }
12059 FreeType(source);
12060 if(inCompiler)
12061 FreeType(dest);
12062 if(backupSourceExpType)
12063 FreeType(backupSourceExpType);
12064 return 1;
12065 }
12066 if(!_class->dataType)
12067 _class->dataType = ProcessTypeString(_class->dataTypeString, 0);
12068 FreeType(dest);
12069 dest = _class->dataType;
12070 dest->refCount++;
12071 }
12072 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))
12073 {
12074 specs = MkListOne(MkSpecifier(DOUBLE));
12075 }
12076 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))
12077 {
12078 specs = MkListOne(MkSpecifier(FLOAT));
12079 }
12080 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))
12081 {
12082 specs = MkList();
12083 if(!dest->isSigned)
12084 ListAdd(specs, MkSpecifier(UNSIGNED));
12085 ListAdd(specs, MkSpecifier(INT64));
12086 }
12087 else if(dest->kind == 3 && (source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 6 || source->kind == 7))
12088 {
12089 specs = MkList();
12090 if(!dest->isSigned)
12091 ListAdd(specs, MkSpecifier(UNSIGNED));
12092 ListAdd(specs, MkSpecifier(INT));
12093 }
12094 else if(dest->kind == 2 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 3 || source->kind == 6 || source->kind == 7))
12095 {
12096 specs = MkList();
12097 if(!dest->isSigned)
12098 ListAdd(specs, MkSpecifier(UNSIGNED));
12099 ListAdd(specs, MkSpecifier(SHORT));
12100 }
12101 else if(dest->kind == 1 && (source->kind == 1 || source->kind == 24 || source->kind == 2 || source->kind == 3 || source->kind == 6 || source->kind == 7))
12102 {
12103 specs = MkList();
12104 if(!dest->isSigned)
12105 ListAdd(specs, MkSpecifier(UNSIGNED));
12106 ListAdd(specs, MkSpecifier(CHAR));
12107 }
12108 else
12109 {
12110 FreeType(source);
12111 FreeType(dest);
12112 if(backupSourceExpType)
12113 {
12114 if(sourceExp->expType)
12115 FreeType(sourceExp->expType);
12116 sourceExp->expType = backupSourceExpType;
12117 }
12118 return 0;
12119 }
12120 }
12121 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))
12122 {
12123 specs = MkListOne(MkSpecifier(DOUBLE));
12124 }
12125 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))
12126 {
12127 specs = MkListOne(MkSpecifier(FLOAT));
12128 }
12129 else if(dest->kind == 24 && (source->kind == 24 || source->kind == 1 || source->kind == 15 || source->kind == 2 || source->kind == 3) && (value == 1 || value == 0))
12130 {
12131 specs = MkList();
12132 ListAdd(specs, MkSpecifier(BOOL));
12133 }
12134 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)))
12135 {
12136 if(source->kind == 3)
12137 {
12138 FreeType(dest);
12139 FreeType(source);
12140 if(backupSourceExpType)
12141 FreeType(backupSourceExpType);
12142 return 1;
12143 }
12144 else
12145 {
12146 specs = MkList();
12147 if(!dest->isSigned)
12148 ListAdd(specs, MkSpecifier(UNSIGNED));
12149 ListAdd(specs, MkSpecifier(CHAR));
12150 }
12151 }
12152 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)))))
12153 {
12154 if(source->kind == 3)
12155 {
12156 FreeType(dest);
12157 FreeType(source);
12158 if(backupSourceExpType)
12159 FreeType(backupSourceExpType);
12160 return 1;
12161 }
12162 else
12163 {
12164 specs = MkList();
12165 if(!dest->isSigned)
12166 ListAdd(specs, MkSpecifier(UNSIGNED));
12167 ListAdd(specs, MkSpecifier(SHORT));
12168 }
12169 }
12170 else if(dest->kind == 3 && (source->kind == 15 || source->kind == 2 || source->kind == 24 || source->kind == 1 || source->kind == 3))
12171 {
12172 specs = MkList();
12173 if(!dest->isSigned)
12174 ListAdd(specs, MkSpecifier(UNSIGNED));
12175 ListAdd(specs, MkSpecifier(INT));
12176 }
12177 else if(dest->kind == 4 && (source->kind == 15 || source->kind == 2 || source->kind == 24 || source->kind == 1 || source->kind == 3 || source->kind == 4))
12178 {
12179 specs = MkList();
12180 if(!dest->isSigned)
12181 ListAdd(specs, MkSpecifier(UNSIGNED));
12182 ListAdd(specs, MkSpecifier(INT64));
12183 }
12184 else if(dest->kind == 15 && (source->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 24 || source->kind == 1))
12185 {
12186 specs = MkListOne(MkEnum(MkIdentifier(dest->__anon1.__anon1.enumName), (((void *)0))));
12187 }
12188 else
12189 {
12190 FreeType(source);
12191 FreeType(dest);
12192 if(backupSourceExpType)
12193 {
12194 if(sourceExp->expType)
12195 FreeType(sourceExp->expType);
12196 sourceExp->expType = backupSourceExpType;
12197 }
12198 return 0;
12199 }
12200 if(!flag && !sourceExp->opDestType)
12201 {
12202 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12203
12204 *newExp = *sourceExp;
12205 newExp->prev = (((void *)0));
12206 newExp->next = (((void *)0));
12207 if(sourceExp->destType)
12208 sourceExp->destType->refCount++;
12209 if(sourceExp->expType)
12210 sourceExp->expType->refCount++;
12211 sourceExp->type = 11;
12212 if(realDest->kind == 8)
12213 {
12214 sourceExp->__anon1.cast.typeName = QMkClass(realDest->__anon1._class->string, (((void *)0)));
12215 FreeList(specs, (void *)(FreeSpecifier));
12216 }
12217 else
12218 sourceExp->__anon1.cast.typeName = MkTypeName(specs, (((void *)0)));
12219 if(newExp->type == 4)
12220 {
12221 sourceExp->__anon1.cast.exp = MkExpBrackets(MkListOne(newExp));
12222 }
12223 else
12224 sourceExp->__anon1.cast.exp = newExp;
12225 FreeType(sourceExp->expType);
12226 sourceExp->expType = (((void *)0));
12227 ProcessExpressionType(sourceExp);
12228 }
12229 else
12230 FreeList(specs, (void *)(FreeSpecifier));
12231 FreeType(dest);
12232 FreeType(source);
12233 if(backupSourceExpType)
12234 FreeType(backupSourceExpType);
12235 return 1;
12236 }
12237 else
12238 {
12239 if(computedExp != nbExp)
12240 {
12241 FreeExpression(computedExp);
12242 computedExp = nbExp;
12243 }
12244 while((sourceExp->type == 5 || sourceExp->type == 32) && sourceExp->__anon1.list)
12245 sourceExp = (*sourceExp->__anon1.list).last;
12246 if(sourceExp->type == 0)
12247 {
12248 struct Identifier * id = sourceExp->__anon1.__anon1.identifier;
12249
12250 if(dest->kind == 8)
12251 {
12252 if(dest->__anon1._class && dest->__anon1._class->__anon1.registered && dest->__anon1._class->__anon1.registered->type == 4)
12253 {
12254 struct __ecereNameSpace__ecere__com__Class * _class = dest->__anon1._class->__anon1.registered;
12255 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
12256
12257 if(enumClass)
12258 {
12259 for(; _class && _class->type == 4; _class = _class->base)
12260 {
12261 struct __ecereNameSpace__ecere__sys__NamedLink64 * value;
12262 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
12263
12264 for(value = e->values.first; value; value = value->next)
12265 {
12266 if(!strcmp(value->name, id->string))
12267 break;
12268 }
12269 if(value)
12270 {
12271 FreeType(sourceExp->expType);
12272 sourceExp->isConstant = 1;
12273 sourceExp->expType = MkClassType(_class->fullName);
12274 if(inCompiler || inPreCompiler || inDebugger)
12275 {
12276 FreeExpContents(sourceExp);
12277 sourceExp->type = 2;
12278 if(_class->dataTypeString && (!strcmp(_class->dataTypeString, "int") || !strcmp(_class->dataTypeString, "int64") || !strcmp(_class->dataTypeString, "short") || !strcmp(_class->dataTypeString, "char")))
12279 sourceExp->__anon1.__anon1.constant = PrintInt64(value->data);
12280 else
12281 sourceExp->__anon1.__anon1.constant = PrintUInt64(value->data);
12282 }
12283 FreeType(dest);
12284 return 1;
12285 }
12286 }
12287 }
12288 }
12289 }
12290 if(dest->classObjectType != 2 && dest->kind == 8 && MatchWithEnums_Module(privateModule, sourceExp, dest, id->string, conversions))
12291 {
12292 FreeType(dest);
12293 return 1;
12294 }
12295 }
12296 FreeType(dest);
12297 }
12298 return 0;
12299 }
12300
12301 static void PopulateInstanceProcessMember(struct Instantiation * inst, struct __ecereNameSpace__ecere__sys__OldList * memberList, struct __ecereNameSpace__ecere__com__DataMember * parentDataMember, unsigned int offset)
12302 {
12303 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
12304
12305 for(dataMember = parentDataMember->members.first; dataMember; dataMember = dataMember->next)
12306 {
12307 if(!dataMember->name && (dataMember->type == 2 || dataMember->type == 1))
12308 PopulateInstanceProcessMember(inst, memberList, dataMember, offset + dataMember->offset);
12309 else
12310 {
12311 struct Expression * exp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12312 struct MemberInit * member = MkMemberInit(MkListOne(MkIdentifier(dataMember->name)), MkInitializerAssignment(exp));
12313 struct Type * type;
12314 void * ptr = inst->data + dataMember->offset + offset;
12315 char * result = (((void *)0));
12316
12317 exp->loc = member->loc = inst->loc;
12318 ((struct Identifier *)(*member->identifiers).first)->loc = inst->loc;
12319 if(!dataMember->dataType)
12320 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0);
12321 type = dataMember->dataType;
12322 if(type->kind == 8)
12323 {
12324 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
12325
12326 if(_class->type == 4)
12327 {
12328 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
12329
12330 if(enumClass)
12331 {
12332 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
12333 struct __ecereNameSpace__ecere__sys__NamedLink64 * item;
12334
12335 for(item = e->values.first; item; item = item->next)
12336 {
12337 if(item->data == GetEnumValue(_class, ptr))
12338 {
12339 result = item->name;
12340 break;
12341 }
12342 }
12343 if(result)
12344 {
12345 exp->__anon1.__anon1.identifier = MkIdentifier(result);
12346 exp->type = 0;
12347 exp->destType = MkClassType(_class->fullName);
12348 ProcessExpressionType(exp);
12349 }
12350 }
12351 }
12352 if(_class->type == 4 || _class->type == 3 || _class->type == 2)
12353 {
12354 if(!_class->dataType)
12355 _class->dataType = ProcessTypeString(_class->dataTypeString, 0);
12356 type = _class->dataType;
12357 }
12358 }
12359 if(!result)
12360 {
12361 switch(type->kind)
12362 {
12363 case 6:
12364 {
12365 FreeExpContents(exp);
12366 exp->__anon1.__anon1.constant = PrintFloat(*(float *)ptr);
12367 exp->type = 2;
12368 break;
12369 }
12370 case 7:
12371 {
12372 FreeExpContents(exp);
12373 exp->__anon1.__anon1.constant = PrintDouble(*(double *)ptr);
12374 exp->type = 2;
12375 break;
12376 }
12377 case 3:
12378 {
12379 FreeExpContents(exp);
12380 exp->__anon1.__anon1.constant = PrintInt(*(int *)ptr);
12381 exp->type = 2;
12382 break;
12383 }
12384 case 4:
12385 {
12386 FreeExpContents(exp);
12387 exp->__anon1.__anon1.constant = PrintInt64(*(long long *)ptr);
12388 exp->type = 2;
12389 break;
12390 }
12391 case 22:
12392 {
12393 FreeExpContents(exp);
12394 exp->__anon1.__anon1.constant = PrintInt64((long long)*(intptr_t *)ptr);
12395 exp->type = 2;
12396 break;
12397 }
12398 case 23:
12399 {
12400 FreeExpContents(exp);
12401 exp->__anon1.__anon1.constant = PrintInt64((long long)*(ssize_t *)ptr);
12402 exp->type = 2;
12403 break;
12404 }
12405 default:
12406 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Unhandled type populating instance\n", (((void *)0))));
12407 }
12408 }
12409 ListAdd(memberList, member);
12410 }
12411 if(parentDataMember->type == 1)
12412 break;
12413 }
12414 }
12415
12416 void CheckTemplateTypes(struct Expression * exp)
12417 {
12418 struct Expression * nbExp = GetNonBracketsExp(exp);
12419
12420 if(exp->destType && exp->destType->passAsTemplate && exp->expType && exp->expType->kind != 20 && !exp->expType->passAsTemplate && (nbExp == exp || nbExp->type != 11))
12421 {
12422 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12423 struct Context * context;
12424 int kind = exp->expType->kind;
12425
12426 *newExp = *exp;
12427 if(exp->destType)
12428 exp->destType->refCount++;
12429 if(exp->expType)
12430 exp->expType->refCount++;
12431 newExp->prev = (((void *)0));
12432 newExp->next = (((void *)0));
12433 if(exp->expType->kind == 8 && exp->expType->__anon1._class && exp->expType->__anon1._class->__anon1.registered)
12434 {
12435 struct __ecereNameSpace__ecere__com__Class * c = exp->expType->__anon1._class->__anon1.registered;
12436
12437 if(c->type == 2 || c->type == 4 || c->type == 3)
12438 {
12439 if(!c->dataType)
12440 c->dataType = ProcessTypeString(c->dataTypeString, 0);
12441 kind = c->dataType->kind;
12442 }
12443 }
12444 switch(kind)
12445 {
12446 case 7:
12447 if(exp->destType->classObjectType)
12448 {
12449 if(exp->destType)
12450 exp->destType->refCount--;
12451 if(exp->expType)
12452 exp->expType->refCount--;
12453 ((newExp ? __extension__ ({
12454 void * __ecerePtrToDelete = (newExp);
12455
12456 __ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)__ecerePtrToDelete) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(__ecerePtrToDelete);
12457 }) : 0), newExp = 0);
12458 }
12459 else
12460 {
12461 struct __ecereNameSpace__ecere__sys__OldList * specs;
12462 struct __ecereNameSpace__ecere__sys__OldList * unionDefs = MkList();
12463 struct __ecereNameSpace__ecere__sys__OldList * statements = MkList();
12464
12465 context = PushContext();
12466 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(DOUBLE)), MkListOne(MkDeclaratorIdentifier(MkIdentifier("d"))), (((void *)0)))));
12467 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifierName("uint64")), MkListOne(MkDeclaratorIdentifier(MkIdentifier("i"))), (((void *)0)))));
12468 specs = MkListOne(MkStructOrUnion(4, (((void *)0)), unionDefs));
12469 exp->type = 23;
12470 modifyPassAsTemplate(&exp->expType, 1);
12471 modifyPassAsTemplate(&newExp->destType, 0);
12472 modifyPassAsTemplate(&newExp->expType, 0);
12473 exp->__anon1.compound = MkCompoundStmt(MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internal_union")), (((void *)0)))))), statements);
12474 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("d")), '=', newExp))));
12475 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("i")))));
12476 exp->__anon1.compound->__anon1.compound.context = context;
12477 PopContext(context);
12478 }
12479 break;
12480 case 6:
12481 if(exp->destType->classObjectType)
12482 {
12483 if(exp->destType)
12484 exp->destType->refCount--;
12485 if(exp->expType)
12486 exp->expType->refCount--;
12487 ((newExp ? __extension__ ({
12488 void * __ecerePtrToDelete = (newExp);
12489
12490 __ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)__ecerePtrToDelete) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(__ecerePtrToDelete);
12491 }) : 0), newExp = 0);
12492 }
12493 else
12494 {
12495 struct __ecereNameSpace__ecere__sys__OldList * specs;
12496 struct __ecereNameSpace__ecere__sys__OldList * unionDefs = MkList();
12497 struct __ecereNameSpace__ecere__sys__OldList * statements = MkList();
12498
12499 context = PushContext();
12500 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(FLOAT)), MkListOne(MkDeclaratorIdentifier(MkIdentifier("f"))), (((void *)0)))));
12501 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifierName("uint64")), MkListOne(MkDeclaratorIdentifier(MkIdentifier("i"))), (((void *)0)))));
12502 specs = MkListOne(MkStructOrUnion(4, (((void *)0)), unionDefs));
12503 exp->type = 23;
12504 exp->__anon1.compound = MkCompoundStmt(MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internal_union")), (((void *)0)))))), statements);
12505 modifyPassAsTemplate(&exp->expType, 1);
12506 modifyPassAsTemplate(&newExp->destType, 0);
12507 modifyPassAsTemplate(&newExp->expType, 0);
12508 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("f")), '=', newExp))));
12509 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("i")))));
12510 exp->__anon1.compound->__anon1.compound.context = context;
12511 PopContext(context);
12512 }
12513 break;
12514 case 0:
12515 break;
12516 default:
12517 exp->type = 11;
12518 exp->__anon1.cast.typeName = MkTypeName(MkListOne(MkSpecifierName("uint64")), (((void *)0)));
12519 if((exp->expType->kind == 8 && exp->expType->__anon1._class && exp->expType->__anon1._class->__anon1.registered && exp->expType->__anon1._class->__anon1.registered->type == 1) || __ecereProp_Type_Get_isPointerType(exp->expType))
12520 exp->__anon1.cast.exp = MkExpCast(MkTypeName(MkListOne(MkSpecifierName("uintptr")), (((void *)0))), MkExpBrackets(MkListOne(newExp)));
12521 else
12522 exp->__anon1.cast.exp = MkExpBrackets(MkListOne(newExp));
12523 exp->needCast = 1;
12524 break;
12525 }
12526 }
12527 else if(exp->expType && exp->expType->passAsTemplate && exp->destType && ((unsigned int)((exp->usage & 0x1) >> 0)) && exp->destType->kind != 20 && !exp->destType->passAsTemplate)
12528 {
12529 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12530 struct Context * context;
12531 int kind = exp->expType->kind;
12532
12533 *newExp = *exp;
12534 if(exp->destType)
12535 exp->destType->refCount++;
12536 if(exp->expType)
12537 exp->expType->refCount++;
12538 newExp->prev = (((void *)0));
12539 newExp->next = (((void *)0));
12540 if(exp->expType->kind == 8 && exp->expType->__anon1._class && exp->expType->__anon1._class->__anon1.registered)
12541 {
12542 struct __ecereNameSpace__ecere__com__Class * c = exp->expType->__anon1._class->__anon1.registered;
12543
12544 if(c->type == 2 || c->type == 4 || c->type == 3)
12545 {
12546 if(!c->dataType)
12547 c->dataType = ProcessTypeString(c->dataTypeString, 0);
12548 kind = c->dataType->kind;
12549 }
12550 }
12551 switch(kind)
12552 {
12553 case 7:
12554 if(exp->destType->classObjectType)
12555 {
12556 if(exp->destType)
12557 exp->destType->refCount--;
12558 if(exp->expType)
12559 exp->expType->refCount--;
12560 ((newExp ? __extension__ ({
12561 void * __ecerePtrToDelete = (newExp);
12562
12563 __ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)__ecerePtrToDelete) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(__ecerePtrToDelete);
12564 }) : 0), newExp = 0);
12565 }
12566 else
12567 {
12568 struct __ecereNameSpace__ecere__sys__OldList * specs;
12569 struct __ecereNameSpace__ecere__sys__OldList * unionDefs = MkList();
12570 struct __ecereNameSpace__ecere__sys__OldList * statements = MkList();
12571
12572 context = PushContext();
12573 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(DOUBLE)), MkListOne(MkDeclaratorIdentifier(MkIdentifier("d"))), (((void *)0)))));
12574 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifierName("uint64")), MkListOne(MkDeclaratorIdentifier(MkIdentifier("i"))), (((void *)0)))));
12575 specs = MkListOne(MkStructOrUnion(4, (((void *)0)), unionDefs));
12576 exp->type = 23;
12577 exp->__anon1.compound = MkCompoundStmt(MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internal_union")), (((void *)0)))))), statements);
12578 modifyPassAsTemplate(&exp->expType, 0);
12579 modifyPassAsTemplate(&newExp->destType, 1);
12580 modifyPassAsTemplate(&newExp->expType, 1);
12581 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("i")), '=', newExp))));
12582 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("d")))));
12583 exp->__anon1.compound->__anon1.compound.context = context;
12584 PopContext(context);
12585 }
12586 break;
12587 case 6:
12588 if(exp->destType->classObjectType)
12589 {
12590 if(exp->destType)
12591 exp->destType->refCount--;
12592 if(exp->expType)
12593 exp->expType->refCount--;
12594 ((newExp ? __extension__ ({
12595 void * __ecerePtrToDelete = (newExp);
12596
12597 __ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)__ecerePtrToDelete) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(__ecerePtrToDelete);
12598 }) : 0), newExp = 0);
12599 }
12600 else
12601 {
12602 struct __ecereNameSpace__ecere__sys__OldList * specs;
12603 struct __ecereNameSpace__ecere__sys__OldList * unionDefs = MkList();
12604 struct __ecereNameSpace__ecere__sys__OldList * statements = MkList();
12605
12606 context = PushContext();
12607 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(FLOAT)), MkListOne(MkDeclaratorIdentifier(MkIdentifier("f"))), (((void *)0)))));
12608 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifierName("uint64")), MkListOne(MkDeclaratorIdentifier(MkIdentifier("i"))), (((void *)0)))));
12609 specs = MkListOne(MkStructOrUnion(4, (((void *)0)), unionDefs));
12610 exp->type = 23;
12611 exp->__anon1.compound = MkCompoundStmt(MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internal_union")), (((void *)0)))))), statements);
12612 modifyPassAsTemplate(&exp->expType, 0);
12613 modifyPassAsTemplate(&newExp->destType, 1);
12614 modifyPassAsTemplate(&newExp->expType, 1);
12615 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("i")), '=', newExp))));
12616 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("f")))));
12617 exp->__anon1.compound->__anon1.compound.context = context;
12618 PopContext(context);
12619 }
12620 break;
12621 case 8:
12622 {
12623 if(exp->expType->__anon1._class && exp->expType->__anon1._class->__anon1.registered && exp->expType->__anon1._class->__anon1.registered->type == 1)
12624 {
12625 exp->type = 5;
12626 newExp = MkExpCast(MkTypeName(MkListOne(MkSpecifierName("uintptr")), (((void *)0))), newExp);
12627 exp->__anon1.list = MkListOne(MkExpOp((((void *)0)), '*', MkExpCast(MkTypeName(MkListOne(MkSpecifierName(exp->expType->__anon1._class->string)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), newExp)));
12628 ProcessExpressionType((*exp->__anon1.list).first);
12629 break;
12630 }
12631 else
12632 {
12633 exp->type = 5;
12634 if(__ecereProp_Type_Get_isPointerType(exp->expType))
12635 {
12636 exp->needTemplateCast = 2;
12637 newExp->needCast = 1;
12638 newExp->needTemplateCast = 2;
12639 newExp = MkExpCast(MkTypeName(MkListOne(MkSpecifierName("uintptr")), (((void *)0))), newExp);
12640 }
12641 exp->__anon1.list = MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName(exp->expType->__anon1._class->string)), (((void *)0))), newExp));
12642 exp->needTemplateCast = 2;
12643 newExp->needCast = 1;
12644 newExp->needTemplateCast = 2;
12645 ProcessExpressionType((*exp->__anon1.list).first);
12646 break;
12647 }
12648 }
12649 default:
12650 {
12651 if(exp->expType->kind == 20)
12652 {
12653 struct Type * type = ProcessTemplateParameterType(exp->expType->__anon1.templateParameter);
12654
12655 if(type)
12656 {
12657 FreeType(exp->destType);
12658 FreeType(exp->expType);
12659 ((newExp ? __extension__ ({
12660 void * __ecerePtrToDelete = (newExp);
12661
12662 __ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)__ecerePtrToDelete) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(__ecerePtrToDelete);
12663 }) : 0), newExp = 0);
12664 break;
12665 }
12666 }
12667 {
12668 char typeString[1024];
12669 struct Declarator * decl;
12670 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
12671
12672 typeString[0] = '\0';
12673 PrintType(exp->expType, typeString, 0, 0);
12674 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
12675 exp->type = 11;
12676 exp->__anon1.cast.typeName = MkTypeName(specs, decl);
12677 exp->__anon1.cast.exp = MkExpBrackets(MkListOne(newExp));
12678 exp->__anon1.cast.exp->needCast = 1;
12679 exp->needTemplateCast = 2;
12680 newExp->needTemplateCast = 2;
12681 }
12682 break;
12683 }
12684 }
12685 }
12686 }
12687
12688 static void ProcessInitializer(struct Initializer * init, struct Type * type)
12689 {
12690 switch(init->type)
12691 {
12692 case 0:
12693 if(!init->__anon1.exp || init->__anon1.exp->type != 1 || !init->__anon1.exp->__anon1.instance || init->__anon1.exp->__anon1.instance->_class || !type || type->kind == 8)
12694 {
12695 if(init->__anon1.exp && !init->__anon1.exp->destType)
12696 {
12697 FreeType(init->__anon1.exp->destType);
12698 init->__anon1.exp->destType = type;
12699 if(type)
12700 type->refCount++;
12701 }
12702 if(init->__anon1.exp)
12703 {
12704 ProcessExpressionType(init->__anon1.exp);
12705 init->isConstant = init->__anon1.exp->isConstant;
12706 }
12707 break;
12708 }
12709 else
12710 {
12711 struct Expression * exp = init->__anon1.exp;
12712 struct Instantiation * inst = exp->__anon1.instance;
12713 struct MembersInit * members;
12714
12715 init->type = 1;
12716 init->__anon1.list = MkList();
12717 if(inst->members)
12718 {
12719 for(members = (*inst->members).first; members; members = members->next)
12720 {
12721 if(members->type == 0)
12722 {
12723 struct MemberInit * member;
12724
12725 for(member = (*members->__anon1.dataMembers).first; member; member = member->next)
12726 {
12727 ListAdd(init->__anon1.list, member->initializer);
12728 member->initializer = (((void *)0));
12729 }
12730 }
12731 }
12732 }
12733 FreeExpression(exp);
12734 }
12735 case 1:
12736 {
12737 struct Initializer * i;
12738 struct Type * initializerType = (((void *)0));
12739 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
12740 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
12741 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
12742 int subMemberStackPos = 0;
12743
12744 if(type && type->kind == 12)
12745 initializerType = Dereference(type);
12746 else if(type && (type->kind == 9 || type->kind == 10))
12747 initializerType = type->__anon1.__anon1.members.first;
12748 for(i = (*init->__anon1.list).first; i; i = i->next)
12749 {
12750 if(type && type->kind == 8 && type->__anon1._class && type->__anon1._class->__anon1.registered)
12751 {
12752 FindNextDataMember(type->__anon1._class->__anon1.registered, &curClass, &curMember, subMemberStack, &subMemberStackPos);
12753 if(curMember)
12754 {
12755 if(!curMember->dataType)
12756 curMember->dataType = ProcessTypeString(curMember->dataTypeString, 0);
12757 initializerType = curMember->dataType;
12758 }
12759 }
12760 ProcessInitializer(i, initializerType);
12761 if(initializerType && type && (type->kind == 9 || type->kind == 10))
12762 initializerType = initializerType->next;
12763 if(!i->isConstant)
12764 init->isConstant = 0;
12765 }
12766 if(type && type->kind == 12)
12767 FreeType(initializerType);
12768 if(type && type->kind != 12 && type->kind != 9 && type->kind != 10 && (type->kind != 8 || !type->__anon1._class->__anon1.registered || type->__anon1._class->__anon1.registered->type != 1))
12769 {
12770 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Assigning list initializer to non list\n", (((void *)0))));
12771 }
12772 break;
12773 }
12774 }
12775 }
12776
12777 static unsigned int CheckExpressionType(struct Expression * exp, struct Type * destType, unsigned int skipUnitBla, unsigned int warnConst)
12778 {
12779 unsigned int result = 1;
12780
12781 if(destType)
12782 {
12783 struct __ecereNameSpace__ecere__sys__OldList converts =
12784 {
12785 0, 0, 0, 0, 0
12786 };
12787 struct Conversion * convert;
12788
12789 if(destType->kind == 0)
12790 return 0;
12791 if(!MatchTypeExpression(exp, destType, &converts, skipUnitBla, warnConst))
12792 result = 0;
12793 if(converts.count)
12794 {
12795 for(convert = converts.first; convert; convert = convert->next)
12796 {
12797 unsigned int empty = !(convert->isGet ? (void *)convert->convert->Get : (void *)convert->convert->Set);
12798
12799 if(!empty)
12800 {
12801 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12802 int objectType = exp->expType ? exp->expType->classObjectType : 0;
12803
12804 *newExp = *exp;
12805 newExp->prev = (((void *)0));
12806 newExp->next = (((void *)0));
12807 newExp->destType = (((void *)0));
12808 if(convert->isGet)
12809 {
12810 exp->type = 8;
12811 exp->addedThis = 1;
12812 exp->__anon1.member.exp = newExp;
12813 FreeType(exp->__anon1.member.exp->expType);
12814 exp->__anon1.member.exp->expType = MkClassType(convert->convert->_class->fullName);
12815 exp->__anon1.member.exp->expType->classObjectType = objectType;
12816 exp->__anon1.member.member = MkIdentifier(convert->convert->dataTypeString);
12817 exp->__anon1.member.memberType = 1;
12818 exp->expType = convert->resultType ? convert->resultType : convert->convert->dataType;
12819 exp->needCast = 1;
12820 if(exp->expType)
12821 exp->expType->refCount++;
12822 ApplyAnyObjectLogic(exp->__anon1.member.exp);
12823 }
12824 else
12825 {
12826 {
12827 exp->type = 8;
12828 exp->addedThis = 1;
12829 exp->__anon1.member.exp = newExp;
12830 if(newExp->expType && newExp->expType->kind == 8 && newExp->expType->__anon1._class && newExp->expType->__anon1._class->__anon1.registered && newExp->expType->__anon1._class->__anon1.registered->type == 5)
12831 {
12832 newExp->byReference = 1;
12833 }
12834 FreeType(exp->__anon1.member.exp->expType);
12835 exp->__anon1.member.exp->expType = (((void *)0));
12836 if(convert->convert->dataType)
12837 {
12838 exp->__anon1.member.exp->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
12839 CopyTypeInto(exp->__anon1.member.exp->expType, convert->convert->dataType);
12840 exp->__anon1.member.exp->expType->refCount = 1;
12841 exp->__anon1.member.exp->expType->classObjectType = objectType;
12842 ApplyAnyObjectLogic(exp->__anon1.member.exp);
12843 }
12844 exp->__anon1.member.member = MkIdentifier(convert->convert->_class->fullName);
12845 exp->__anon1.member.memberType = 4;
12846 exp->expType = convert->resultType ? convert->resultType : MkClassType(convert->convert->_class->fullName);
12847 exp->needCast = 1;
12848 if(convert->resultType)
12849 convert->resultType->refCount++;
12850 }
12851 }
12852 }
12853 else
12854 {
12855 FreeType(exp->expType);
12856 if(convert->isGet)
12857 {
12858 exp->expType = convert->resultType ? convert->resultType : convert->convert->dataType;
12859 if(exp->destType->casted)
12860 exp->needCast = 1;
12861 if(exp->expType)
12862 exp->expType->refCount++;
12863 }
12864 else
12865 {
12866 exp->expType = convert->resultType ? convert->resultType : MkClassType(convert->convert->_class->fullName);
12867 if(exp->destType->casted)
12868 exp->needCast = 1;
12869 if(convert->resultType)
12870 convert->resultType->refCount++;
12871 }
12872 }
12873 }
12874 if(exp->isConstant && inCompiler)
12875 ComputeExpression(exp);
12876 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(&converts, (void *)(FreeConvert));
12877 }
12878 if(!result && exp->expType && converts.count)
12879 {
12880 result = MatchTypes(exp->expType, exp->destType, (((void *)0)), (((void *)0)), (((void *)0)), 1, 1, 0, 0, warnConst);
12881 }
12882 if(!result && exp->expType && exp->destType)
12883 {
12884 if((exp->destType->kind == 8 && exp->expType->kind == 13 && exp->expType->__anon1.type->kind == 8 && exp->expType->__anon1.type->__anon1._class == exp->destType->__anon1._class && exp->destType->__anon1._class->__anon1.registered && exp->destType->__anon1._class->__anon1.registered->type == 1) || (exp->expType->kind == 8 && exp->destType->kind == 13 && exp->destType->__anon1.type->kind == 8 && exp->destType->__anon1.type->__anon1._class == exp->expType->__anon1._class && exp->expType->__anon1._class->__anon1.registered && exp->expType->__anon1._class->__anon1.registered->type == 1))
12885 result = 1;
12886 }
12887 }
12888 return result;
12889 }
12890
12891 void PopulateInstance(struct Instantiation * inst)
12892 {
12893 struct Symbol * classSym = inst->_class->__anon1.__anon1.symbol;
12894 struct __ecereNameSpace__ecere__com__Class * _class = classSym->__anon1.registered;
12895 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
12896 struct __ecereNameSpace__ecere__sys__OldList * memberList = MkList();
12897
12898 if(!inst->members)
12899 inst->members = MkListOne(MkMembersInitList(memberList));
12900 else
12901 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*inst->members), MkMembersInitList(memberList));
12902 for(dataMember = _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
12903 {
12904 if(!dataMember->isProperty)
12905 {
12906 if(!dataMember->name && (dataMember->type == 2 || dataMember->type == 1))
12907 PopulateInstanceProcessMember(inst, memberList, dataMember, dataMember->offset);
12908 else
12909 {
12910 struct Expression * exp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12911 struct MemberInit * member = MkMemberInit(MkListOne(MkIdentifier(dataMember->name)), MkInitializerAssignment(exp));
12912 struct Type * type;
12913 void * ptr = inst->data + dataMember->offset;
12914 char * result = (((void *)0));
12915
12916 exp->loc = member->loc = inst->loc;
12917 ((struct Identifier *)(*member->identifiers).first)->loc = inst->loc;
12918 if(!dataMember->dataType)
12919 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0);
12920 type = dataMember->dataType;
12921 if(type->kind == 8)
12922 {
12923 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
12924
12925 if(_class->type == 4)
12926 {
12927 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
12928
12929 if(enumClass)
12930 {
12931 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
12932 struct __ecereNameSpace__ecere__sys__NamedLink64 * item;
12933
12934 for(item = e->values.first; item; item = item->next)
12935 {
12936 if(item->data == GetEnumValue(_class, ptr))
12937 {
12938 result = item->name;
12939 break;
12940 }
12941 }
12942 }
12943 if(result)
12944 {
12945 exp->__anon1.__anon1.identifier = MkIdentifier(result);
12946 exp->type = 0;
12947 exp->destType = MkClassType(_class->fullName);
12948 ProcessExpressionType(exp);
12949 }
12950 }
12951 if(_class->type == 4 || _class->type == 3 || _class->type == 2)
12952 {
12953 if(!_class->dataType)
12954 _class->dataType = ProcessTypeString(_class->dataTypeString, 0);
12955 type = _class->dataType;
12956 }
12957 }
12958 if(!result)
12959 {
12960 switch(type->kind)
12961 {
12962 case 6:
12963 {
12964 exp->__anon1.__anon1.constant = PrintFloat(*(float *)ptr);
12965 exp->type = 2;
12966 break;
12967 }
12968 case 7:
12969 {
12970 exp->__anon1.__anon1.constant = PrintDouble(*(double *)ptr);
12971 exp->type = 2;
12972 break;
12973 }
12974 case 3:
12975 {
12976 exp->__anon1.__anon1.constant = PrintInt(*(int *)ptr);
12977 exp->type = 2;
12978 break;
12979 }
12980 case 4:
12981 {
12982 exp->__anon1.__anon1.constant = PrintInt64(*(long long *)ptr);
12983 exp->type = 2;
12984 break;
12985 }
12986 case 22:
12987 {
12988 exp->__anon1.__anon1.constant = PrintInt64((long long)*(intptr_t *)ptr);
12989 exp->type = 2;
12990 break;
12991 }
12992 default:
12993 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Unhandled type populating instance\n", (((void *)0))));
12994 }
12995 }
12996 ListAdd(memberList, member);
12997 }
12998 }
12999 }
13000 }
13001
13002 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)
13003 {
13004 struct Identifier * ident = member->identifiers ? (*member->identifiers).first : (((void *)0));
13005 unsigned int found = 0;
13006 struct __ecereNameSpace__ecere__com__DataMember * dataMember = (((void *)0));
13007 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
13008 unsigned int freeType = 0;
13009
13010 yylloc = member->loc;
13011 if(!ident)
13012 {
13013 if(curMember)
13014 {
13015 __ecereNameSpace__ecere__com__eClass_FindNextMember(_class, curClass, curMember, subMemberStack, subMemberStackPos);
13016 if(*curMember)
13017 {
13018 found = 1;
13019 dataMember = *curMember;
13020 }
13021 }
13022 }
13023 else
13024 {
13025 struct __ecereNameSpace__ecere__com__DataMember * thisMember = (struct __ecereNameSpace__ecere__com__DataMember *)__ecereNameSpace__ecere__com__eClass_FindProperty(_class, ident->string, privateModule);
13026 struct __ecereNameSpace__ecere__com__DataMember * _subMemberStack[256];
13027 int _subMemberStackPos = 0;
13028
13029 if(!thisMember)
13030 thisMember = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, ident->string, privateModule, _subMemberStack, &_subMemberStackPos);
13031 if(thisMember)
13032 {
13033 dataMember = thisMember;
13034 if(curMember && thisMember->memberAccess == 1)
13035 {
13036 *curMember = thisMember;
13037 *curClass = thisMember->_class;
13038 memcpy(subMemberStack, _subMemberStack, sizeof(struct __ecereNameSpace__ecere__com__DataMember *) * _subMemberStackPos);
13039 *subMemberStackPos = _subMemberStackPos;
13040 }
13041 found = 1;
13042 }
13043 else
13044 {
13045 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, ident->string, privateModule);
13046 if(method && method->type == 1)
13047 found = 1;
13048 else
13049 method = (((void *)0));
13050 }
13051 }
13052 if(found)
13053 {
13054 struct Type * type = (((void *)0));
13055
13056 if(dataMember)
13057 {
13058 if(!dataMember->dataType && dataMember->dataTypeString)
13059 {
13060 struct Context * context = SetupTemplatesContext(_class);
13061
13062 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0);
13063 FinishTemplatesContext(context);
13064 }
13065 type = dataMember->dataType;
13066 }
13067 else if(method)
13068 {
13069 if(!method->dataType)
13070 ProcessMethodType(method);
13071 type = method->dataType;
13072 }
13073 if(ident && ident->next)
13074 {
13075 for(ident = ident->next; ident && type; ident = ident->next)
13076 {
13077 if(type->kind == 8)
13078 {
13079 dataMember = (struct __ecereNameSpace__ecere__com__DataMember *)__ecereNameSpace__ecere__com__eClass_FindProperty(type->__anon1._class->__anon1.registered, ident->string, privateModule);
13080 if(!dataMember)
13081 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMember(type->__anon1._class->__anon1.registered, ident->string, privateModule, (((void *)0)), (((void *)0)));
13082 if(dataMember)
13083 type = dataMember->dataType;
13084 }
13085 else if(type->kind == 9 || type->kind == 10)
13086 {
13087 struct Type * memberType;
13088
13089 for(memberType = type->__anon1.__anon1.members.first; memberType; memberType = memberType->next)
13090 {
13091 if(!strcmp(memberType->name, ident->string))
13092 {
13093 type = memberType;
13094 break;
13095 }
13096 }
13097 }
13098 }
13099 }
13100 if(type && type->kind == 20 && type->__anon1.templateParameter->type == 0 && _class->templateArgs)
13101 {
13102 int id = 0;
13103 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
13104 struct __ecereNameSpace__ecere__com__Class * sClass;
13105
13106 for(sClass = _class; sClass; sClass = sClass->base)
13107 {
13108 id = 0;
13109 if(sClass->templateClass)
13110 sClass = sClass->templateClass;
13111 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
13112 {
13113 if(curParam->type == 0 && !strcmp(type->__anon1.templateParameter->identifier->string, curParam->name))
13114 {
13115 for(sClass = sClass->base; sClass; sClass = sClass->base)
13116 {
13117 if(sClass->templateClass)
13118 sClass = sClass->templateClass;
13119 id += sClass->templateParams.count;
13120 }
13121 break;
13122 }
13123 id++;
13124 }
13125 if(curParam)
13126 break;
13127 }
13128 if(curParam)
13129 {
13130 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = _class->templateArgs[id];
13131
13132 if(arg.__anon1.__anon1.dataTypeString)
13133 {
13134 unsigned int constant = type->constant;
13135
13136 type = ProcessTypeString(arg.__anon1.__anon1.dataTypeString, 0);
13137 if(type->kind == 8 && constant)
13138 type->constant = 1;
13139 else if(type->kind == 13)
13140 {
13141 struct Type * t = type->__anon1.type;
13142
13143 while(t->kind == 13)
13144 t = t->__anon1.type;
13145 if(constant)
13146 t->constant = constant;
13147 }
13148 freeType = 1;
13149 if(type && _class->templateClass)
13150 type->passAsTemplate = 1;
13151 if(type)
13152 {
13153 }
13154 }
13155 }
13156 }
13157 if(type && type->kind == 8 && type->__anon1._class && type->__anon1._class->__anon1.registered && strchr(type->__anon1._class->__anon1.registered->fullName, '<'))
13158 {
13159 struct __ecereNameSpace__ecere__com__Class * expClass = type->__anon1._class->__anon1.registered;
13160 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
13161 int paramCount = 0;
13162 int lastParam = -1;
13163 char templateString[1024];
13164 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
13165
13166 sprintf(templateString, "%s<", expClass->templateClass->fullName);
13167 for(cClass = expClass; cClass; cClass = cClass->base)
13168 {
13169 int p = 0;
13170
13171 if(cClass->templateClass)
13172 cClass = cClass->templateClass;
13173 for(param = cClass->templateParams.first; param; param = param->next)
13174 {
13175 int id = p;
13176 struct __ecereNameSpace__ecere__com__Class * sClass;
13177 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
13178
13179 for(sClass = cClass->base; sClass; sClass = sClass->base)
13180 {
13181 if(sClass->templateClass)
13182 sClass = sClass->templateClass;
13183 id += sClass->templateParams.count;
13184 }
13185 arg = expClass->templateArgs[id];
13186 for(sClass = _class; sClass; sClass = sClass->base)
13187 {
13188 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * cParam;
13189 int p = 0;
13190 struct __ecereNameSpace__ecere__com__Class * nextClass;
13191
13192 if(sClass->templateClass)
13193 sClass = sClass->templateClass;
13194 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
13195 {
13196 if(nextClass->templateClass)
13197 nextClass = nextClass->templateClass;
13198 p += nextClass->templateParams.count;
13199 }
13200 for(cParam = sClass->templateParams.first; cParam; cParam = cParam->next, p++)
13201 {
13202 if(cParam->type == 0 && arg.__anon1.__anon1.dataTypeString && !strcmp(cParam->name, arg.__anon1.__anon1.dataTypeString))
13203 {
13204 if(_class->templateArgs && arg.__anon1.__anon1.dataTypeString && (!param->defaultArg.__anon1.__anon1.dataTypeString || strcmp(arg.__anon1.__anon1.dataTypeString, param->defaultArg.__anon1.__anon1.dataTypeString)))
13205 {
13206 arg.__anon1.__anon1.dataTypeString = _class->templateArgs[p].__anon1.__anon1.dataTypeString;
13207 arg.__anon1.__anon1.dataTypeClass = _class->templateArgs[p].__anon1.__anon1.dataTypeClass;
13208 break;
13209 }
13210 }
13211 }
13212 }
13213 {
13214 char argument[256];
13215
13216 argument[0] = '\0';
13217 switch(param->type)
13218 {
13219 case 2:
13220 {
13221 char expString[1024];
13222 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13223 struct Declarator * decl = SpecDeclFromString(param->__anon1.dataTypeString, specs, (((void *)0)));
13224 struct Expression * exp;
13225 char * string = PrintHexUInt64(arg.__anon1.expression.__anon1.ui64);
13226
13227 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
13228 (__ecereNameSpace__ecere__com__eSystem_Delete(string), string = 0);
13229 ProcessExpressionType(exp);
13230 ComputeExpression(exp);
13231 expString[0] = '\0';
13232 PrintExpression(exp, expString);
13233 strcat(argument, expString);
13234 FreeExpression(exp);
13235 break;
13236 }
13237 case 1:
13238 {
13239 strcat(argument, arg.__anon1.__anon2.__anon1.member->name);
13240 break;
13241 }
13242 case 0:
13243 {
13244 if(arg.__anon1.__anon1.dataTypeString && (!param->defaultArg.__anon1.__anon1.dataTypeString || strcmp(arg.__anon1.__anon1.dataTypeString, param->defaultArg.__anon1.__anon1.dataTypeString)))
13245 strcat(argument, arg.__anon1.__anon1.dataTypeString);
13246 break;
13247 }
13248 }
13249 if(argument[0])
13250 {
13251 if(paramCount)
13252 strcat(templateString, ", ");
13253 if(lastParam != p - 1)
13254 {
13255 strcat(templateString, param->name);
13256 strcat(templateString, " = ");
13257 }
13258 strcat(templateString, argument);
13259 paramCount++;
13260 lastParam = p;
13261 }
13262 p++;
13263 }
13264 }
13265 }
13266 {
13267 int len = strlen(templateString);
13268
13269 if(templateString[len - 1] == '<')
13270 len--;
13271 else
13272 {
13273 if(templateString[len - 1] == '>')
13274 templateString[len++] = ' ';
13275 templateString[len++] = '>';
13276 }
13277 templateString[len++] = '\0';
13278 }
13279 {
13280 struct Context * context = SetupTemplatesContext(_class);
13281
13282 if(freeType)
13283 FreeType(type);
13284 type = ProcessTypeString(templateString, 0);
13285 freeType = 1;
13286 FinishTemplatesContext(context);
13287 }
13288 }
13289 if(method && member->initializer && member->initializer->type == 0 && member->initializer->__anon1.exp)
13290 {
13291 ProcessExpressionType(member->initializer->__anon1.exp);
13292 if(!member->initializer->__anon1.exp->expType)
13293 {
13294 if(inCompiler)
13295 {
13296 char expString[10240];
13297
13298 expString[0] = '\0';
13299 PrintExpression(member->initializer->__anon1.exp, expString);
13300 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
13301 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved symbol used as an instance method %s\n", (((void *)0))), expString);
13302 }
13303 }
13304 else if(!MatchTypes(member->initializer->__anon1.exp->expType, type, (((void *)0)), (((void *)0)), _class, 1, 1, 0, 0, 1))
13305 {
13306 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible instance method %s\n", (((void *)0))), ident->string);
13307 }
13308 }
13309 else if(member->initializer)
13310 {
13311 ProcessInitializer(member->initializer, type);
13312 }
13313 if(freeType)
13314 FreeType(type);
13315 }
13316 else
13317 {
13318 if(_class && _class->type == 3)
13319 {
13320 if(member->initializer)
13321 {
13322 struct Type * type = MkClassType(_class->fullName);
13323
13324 ProcessInitializer(member->initializer, type);
13325 FreeType(type);
13326 }
13327 }
13328 else
13329 {
13330 if(member->initializer)
13331 {
13332 ProcessInitializer(member->initializer, (((void *)0)));
13333 }
13334 if(ident)
13335 {
13336 if(method)
13337 {
13338 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't find virtual method %s in class %s\n", (((void *)0))), ident->string, _class->fullName);
13339 }
13340 else if(_class)
13341 {
13342 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't find member %s in class %s\n", (((void *)0))), ident->string, _class->fullName);
13343 if(inCompiler)
13344 __ecereNameSpace__ecere__com__eClass_AddDataMember(_class, ident->string, "int", 0, 0, 1);
13345 }
13346 }
13347 else if(_class)
13348 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "too many initializers for instantiation of class %s\n", (((void *)0))), _class->fullName);
13349 }
13350 }
13351 }
13352
13353 void ComputeInstantiation(struct Expression * exp)
13354 {
13355 struct Instantiation * inst = exp->__anon1.instance;
13356 struct MembersInit * members;
13357 struct Symbol * classSym = inst->_class ? inst->_class->__anon1.__anon1.symbol : (((void *)0));
13358 struct __ecereNameSpace__ecere__com__Class * _class = classSym ? classSym->__anon1.registered : (((void *)0));
13359 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
13360 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
13361 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
13362 int subMemberStackPos = 0;
13363 uint64 bits = 0;
13364
13365 if(_class && (_class->type == 1 || _class->type == 0 || _class->type == 5))
13366 {
13367 if(inst->data)
13368 return ;
13369 if(_class->type == 0 || _class->type == 5)
13370 {
13371 inst->data = (unsigned char *)__ecereNameSpace__ecere__com__eInstance_New(_class);
13372 if(_class->type == 0)
13373 ((struct __ecereNameSpace__ecere__com__Instance *)(char *)((struct __ecereNameSpace__ecere__com__Instance *)inst->data))->_refCount++;
13374 }
13375 else
13376 inst->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
13377 }
13378 if(inst->members)
13379 {
13380 for(members = (*inst->members).first; members; members = members->next)
13381 {
13382 switch(members->type)
13383 {
13384 case 0:
13385 {
13386 if(members->__anon1.dataMembers)
13387 {
13388 struct MemberInit * member;
13389
13390 for(member = (*members->__anon1.dataMembers).first; member; member = member->next)
13391 {
13392 struct Identifier * ident = member->identifiers ? (*member->identifiers).first : (((void *)0));
13393 unsigned int found = 0;
13394 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
13395 struct __ecereNameSpace__ecere__com__DataMember * dataMember = (((void *)0));
13396 unsigned int dataMemberOffset;
13397
13398 if(!ident)
13399 {
13400 __ecereNameSpace__ecere__com__eClass_FindNextMember(_class, &curClass, &curMember, subMemberStack, &subMemberStackPos);
13401 if(curMember)
13402 {
13403 if(curMember->isProperty)
13404 prop = (struct __ecereNameSpace__ecere__com__Property *)curMember;
13405 else
13406 {
13407 dataMember = curMember;
13408 __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(_class, dataMember->name, &dataMemberOffset, privateModule, (((void *)0)), (((void *)0)));
13409 if(_class->type == 0)
13410 dataMemberOffset += _class->base->structSize;
13411 }
13412 found = 1;
13413 }
13414 }
13415 else
13416 {
13417 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, ident->string, privateModule);
13418 if(prop)
13419 {
13420 found = 1;
13421 if(prop->memberAccess == 1)
13422 {
13423 curMember = (struct __ecereNameSpace__ecere__com__DataMember *)prop;
13424 curClass = prop->_class;
13425 }
13426 }
13427 else
13428 {
13429 struct __ecereNameSpace__ecere__com__DataMember * _subMemberStack[256];
13430 int _subMemberStackPos = 0;
13431
13432 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(_class, ident->string, &dataMemberOffset, privateModule, _subMemberStack, &_subMemberStackPos);
13433 if(dataMember)
13434 {
13435 found = 1;
13436 if(dataMember->memberAccess == 1)
13437 {
13438 curMember = dataMember;
13439 curClass = dataMember->_class;
13440 memcpy(subMemberStack, _subMemberStack, sizeof(struct __ecereNameSpace__ecere__com__DataMember *) * _subMemberStackPos);
13441 subMemberStackPos = _subMemberStackPos;
13442 }
13443 }
13444 }
13445 }
13446 if(found && member->initializer && member->initializer->type == 0)
13447 {
13448 struct Expression * value = member->initializer->__anon1.exp;
13449 struct Type * type = (((void *)0));
13450 unsigned int deepMember = 0;
13451
13452 if(prop)
13453 {
13454 type = prop->dataType;
13455 }
13456 else if(dataMember)
13457 {
13458 if(!dataMember->dataType)
13459 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0);
13460 type = dataMember->dataType;
13461 }
13462 if(ident && ident->next)
13463 {
13464 deepMember = 1;
13465 for(ident = ident->next; ident && type; ident = ident->next)
13466 {
13467 if(type->kind == 8)
13468 {
13469 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(type->__anon1._class->__anon1.registered, ident->string, privateModule);
13470 if(prop)
13471 type = prop->dataType;
13472 else
13473 {
13474 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(type->__anon1._class->__anon1.registered, ident->string, &dataMemberOffset, privateModule, (((void *)0)), (((void *)0)));
13475 if(dataMember)
13476 type = dataMember->dataType;
13477 }
13478 }
13479 else if(type->kind == 9 || type->kind == 10)
13480 {
13481 struct Type * memberType;
13482
13483 for(memberType = type->__anon1.__anon1.members.first; memberType; memberType = memberType->next)
13484 {
13485 if(!strcmp(memberType->name, ident->string))
13486 {
13487 type = memberType;
13488 break;
13489 }
13490 }
13491 }
13492 }
13493 }
13494 if(value)
13495 {
13496 FreeType(value->destType);
13497 value->destType = type;
13498 if(type)
13499 type->refCount++;
13500 ComputeExpression(value);
13501 }
13502 if(!deepMember && type && value && (_class->type == 1 || _class->type == 0 || _class->type == 5))
13503 {
13504 if(type->kind == 8)
13505 {
13506 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
13507
13508 if(_class && (_class->type == 2 || _class->type == 3 || _class->type == 4))
13509 {
13510 if(!_class->dataType)
13511 _class->dataType = ProcessTypeString(_class->dataTypeString, 0);
13512 type = _class->dataType;
13513 }
13514 }
13515 if(dataMember)
13516 {
13517 void * ptr = inst->data + dataMemberOffset;
13518
13519 if(value->type == 2)
13520 {
13521 switch(type->kind)
13522 {
13523 case 3:
13524 {
13525 GetInt(value, (int *)ptr);
13526 break;
13527 }
13528 case 4:
13529 {
13530 GetInt64(value, (long long *)ptr);
13531 break;
13532 }
13533 case 22:
13534 {
13535 GetIntPtr(value, (intptr_t *)ptr);
13536 break;
13537 }
13538 case 23:
13539 {
13540 GetIntSize(value, (ssize_t *)ptr);
13541 break;
13542 }
13543 case 6:
13544 {
13545 GetFloat(value, (float *)ptr);
13546 break;
13547 }
13548 case 7:
13549 {
13550 GetDouble(value, (double *)ptr);
13551 break;
13552 }
13553 }
13554 }
13555 else if(value->type == 1)
13556 {
13557 if(type->kind == 8)
13558 {
13559 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
13560
13561 if(_class->type == 1)
13562 {
13563 ComputeTypeSize(type);
13564 if(value->__anon1.instance->data)
13565 memcpy(ptr, value->__anon1.instance->data, type->size);
13566 }
13567 }
13568 }
13569 }
13570 else if(prop && prop->Set != (void *)(intptr_t)1)
13571 {
13572 if(value->type == 1 && value->__anon1.instance->data)
13573 {
13574 if(type->kind == 8)
13575 {
13576 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
13577
13578 if(_class && (_class->type != 0 || __ecereNameSpace__ecere__com__eClass_IsDerived(((struct __ecereNameSpace__ecere__com__Instance *)(char *)((struct __ecereNameSpace__ecere__com__Instance *)value->__anon1.instance->data))->_class, _class)))
13579 {
13580 void (* Set)(void *, void *) = (void *)prop->Set;
13581
13582 Set(inst->data, value->__anon1.instance->data);
13583 PopulateInstance(inst);
13584 }
13585 }
13586 }
13587 else if(value->type == 2)
13588 {
13589 switch(type->kind)
13590 {
13591 case 7:
13592 {
13593 void (* Set)(void *, double) = (void *)prop->Set;
13594
13595 Set(inst->data, strtod(value->__anon1.__anon1.constant, (((void *)0))));
13596 break;
13597 }
13598 case 6:
13599 {
13600 void (* Set)(void *, float) = (void *)prop->Set;
13601
13602 Set(inst->data, (float)(strtod(value->__anon1.__anon1.constant, (((void *)0)))));
13603 break;
13604 }
13605 case 3:
13606 {
13607 void (* Set)(void *, int) = (void *)prop->Set;
13608
13609 Set(inst->data, strtol(value->__anon1.__anon1.constant, (((void *)0)), 0));
13610 break;
13611 }
13612 case 4:
13613 {
13614 void (* Set)(void *, long long) = (void *)prop->Set;
13615
13616 Set(inst->data, __ecereNameSpace__ecere__com___strtoi64(value->__anon1.__anon1.constant, (((void *)0)), 0));
13617 break;
13618 }
13619 case 22:
13620 {
13621 void (* Set)(void *, intptr_t) = (void *)prop->Set;
13622
13623 Set(inst->data, (intptr_t)__ecereNameSpace__ecere__com___strtoi64(value->__anon1.__anon1.constant, (((void *)0)), 0));
13624 break;
13625 }
13626 case 23:
13627 {
13628 void (* Set)(void *, ssize_t) = (void *)prop->Set;
13629
13630 Set(inst->data, (ssize_t)__ecereNameSpace__ecere__com___strtoi64(value->__anon1.__anon1.constant, (((void *)0)), 0));
13631 break;
13632 }
13633 }
13634 }
13635 else if(value->type == 3)
13636 {
13637 char temp[1024];
13638
13639 ReadString(temp, value->__anon1.__anon2.string);
13640 ((void (*)(void *, void *))(void *)prop->Set)(inst->data, temp);
13641 }
13642 }
13643 }
13644 else if(!deepMember && type && _class->type == 3)
13645 {
13646 if(prop)
13647 {
13648 if(value->type == 2)
13649 {
13650 if(type->kind == 8)
13651 {
13652 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
13653
13654 if(_class->type == 3)
13655 {
13656 if(!_class->dataType)
13657 _class->dataType = ProcessTypeString(_class->dataTypeString, 0);
13658 type = _class->dataType;
13659 }
13660 }
13661 switch(type->kind)
13662 {
13663 case 6:
13664 {
13665 float fValue;
13666 float (* Set)(float) = (void *)prop->Set;
13667
13668 GetFloat(member->initializer->__anon1.exp, &fValue);
13669 exp->__anon1.__anon1.constant = PrintFloat(Set(fValue));
13670 exp->type = 2;
13671 break;
13672 }
13673 case 7:
13674 {
13675 double dValue;
13676 double (* Set)(double) = (void *)prop->Set;
13677
13678 GetDouble(member->initializer->__anon1.exp, &dValue);
13679 exp->__anon1.__anon1.constant = PrintDouble(Set(dValue));
13680 exp->type = 2;
13681 break;
13682 }
13683 }
13684 }
13685 }
13686 }
13687 else if(!deepMember && type && _class->type == 2)
13688 {
13689 if(prop)
13690 {
13691 if(value->type == 1 && value->__anon1.instance->data)
13692 {
13693 unsigned int (* Set)(void *) = (void *)prop->Set;
13694
13695 bits = Set(value->__anon1.instance->data);
13696 }
13697 else if(value->type == 2)
13698 {
13699 }
13700 }
13701 else if(dataMember)
13702 {
13703 struct __ecereNameSpace__ecere__com__BitMember * bitMember = (struct __ecereNameSpace__ecere__com__BitMember *)dataMember;
13704 struct Type * type;
13705 uint64 part = 0;
13706
13707 bits = (bits & ~bitMember->mask);
13708 if(!bitMember->dataType)
13709 bitMember->dataType = ProcessTypeString(bitMember->dataTypeString, 0);
13710 type = bitMember->dataType;
13711 if(type->kind == 8 && type->__anon1._class && type->__anon1._class->__anon1.registered)
13712 {
13713 if(!type->__anon1._class->__anon1.registered->dataType)
13714 type->__anon1._class->__anon1.registered->dataType = ProcessTypeString(type->__anon1._class->__anon1.registered->dataTypeString, 0);
13715 type = type->__anon1._class->__anon1.registered->dataType;
13716 }
13717 switch(type->kind)
13718 {
13719 case 24:
13720 case 1:
13721 {
13722 unsigned char v;
13723
13724 type->isSigned ? GetChar(value, (char *)&v) : GetUChar(value, &v);
13725 part = (uint64)v;
13726 break;
13727 }
13728 case 2:
13729 {
13730 unsigned short v;
13731
13732 type->isSigned ? GetShort(value, (short *)&v) : GetUShort(value, &v);
13733 part = (uint64)v;
13734 break;
13735 }
13736 case 3:
13737 case 5:
13738 {
13739 unsigned int v;
13740
13741 type->isSigned ? GetInt(value, (int *)&v) : GetUInt(value, &v);
13742 part = (uint64)v;
13743 break;
13744 }
13745 case 4:
13746 {
13747 uint64 v;
13748
13749 type->isSigned ? GetInt64(value, (long long *)&v) : GetUInt64(value, &v);
13750 part = v;
13751 break;
13752 }
13753 case 22:
13754 {
13755 uintptr_t v;
13756
13757 type->isSigned ? GetIntPtr(value, (intptr_t *)&v) : GetUIntPtr(value, &v);
13758 part = (uint64)v;
13759 break;
13760 }
13761 case 23:
13762 {
13763 size_t v;
13764
13765 type->isSigned ? GetIntSize(value, (ssize_t *)&v) : GetUIntSize(value, &v);
13766 part = (uint64)v;
13767 break;
13768 }
13769 }
13770 bits |= part << bitMember->pos;
13771 }
13772 }
13773 }
13774 else
13775 {
13776 if(_class && _class->type == 3)
13777 {
13778 ComputeExpression(member->initializer->__anon1.exp);
13779 exp->__anon1.__anon1.constant = member->initializer->__anon1.exp->__anon1.__anon1.constant;
13780 exp->type = 2;
13781 member->initializer->__anon1.exp->__anon1.__anon1.constant = (((void *)0));
13782 }
13783 }
13784 }
13785 }
13786 break;
13787 }
13788 }
13789 }
13790 }
13791 if(_class && _class->type == 2)
13792 {
13793 exp->__anon1.__anon1.constant = PrintHexUInt(bits);
13794 exp->type = 2;
13795 }
13796 if(exp->type != 1)
13797 {
13798 FreeInstance(inst);
13799 }
13800 }
13801
13802 void ComputeExpression(struct Expression * exp)
13803 {
13804 switch(exp->type)
13805 {
13806 case 0:
13807 {
13808 struct Identifier * id = exp->__anon1.__anon1.identifier;
13809
13810 if(id && exp->isConstant && !inCompiler && !inPreCompiler && !inDebugger)
13811 {
13812 struct __ecereNameSpace__ecere__com__Class * c = (exp->expType && exp->expType->kind == 8 && exp->expType->__anon1._class) ? exp->expType->__anon1._class->__anon1.registered : (((void *)0));
13813
13814 if(c && c->type == 4)
13815 {
13816 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
13817
13818 if(enumClass)
13819 {
13820 struct __ecereNameSpace__ecere__sys__NamedLink64 * value;
13821 struct __ecereNameSpace__ecere__com__EnumClassData * e = (c ? ((void *)(((char *)c->data) + enumClass->offsetClass)) : (((void *)0)));
13822
13823 for(value = e->values.first; value; value = value->next)
13824 {
13825 if(!strcmp(value->name, id->string))
13826 break;
13827 }
13828 if(value)
13829 {
13830 const char * dts = c->dataTypeString;
13831
13832 FreeExpContents(exp);
13833 exp->type = 2;
13834 exp->__anon1.__anon1.constant = (dts && (!strcmp(dts, "int") || !strcmp(dts, "int64") || !strcmp(dts, "short") || !strcmp(dts, "char"))) ? PrintInt64(value->data) : PrintUInt64(value->data);
13835 }
13836 }
13837 }
13838 }
13839 break;
13840 }
13841 case 1:
13842 {
13843 ComputeInstantiation(exp);
13844 break;
13845 }
13846 case 4:
13847 {
13848 struct Expression * exp1, * exp2 = (((void *)0));
13849 struct Operand op1 =
13850 {
13851 0, 0, 0,
13852 .__anon1 = {
13853 .c = 0
13854 },
13855 {
13856 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
13857 }
13858 };
13859 struct Operand op2 =
13860 {
13861 0, 0, 0,
13862 .__anon1 = {
13863 .c = 0
13864 },
13865 {
13866 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
13867 }
13868 };
13869
13870 if(exp->__anon1.op.exp2)
13871 {
13872 struct Expression * e = exp->__anon1.op.exp2;
13873
13874 while((e->type == 5 || e->type == 32 || e->type == 23) && e->__anon1.list)
13875 {
13876 if(e->type == 5 || e->type == 32 || e->type == 23)
13877 {
13878 if(e->type == 23)
13879 e = (*((struct Statement *)(*e->__anon1.compound->__anon1.compound.statements).last)->__anon1.expressions).last;
13880 else
13881 e = (*e->__anon1.list).last;
13882 }
13883 }
13884 if(exp->__anon1.op.op == 261 && e && e->expType)
13885 {
13886 if(e->type == 3 && e->__anon1.__anon2.string)
13887 {
13888 char * string = e->__anon1.__anon2.string;
13889 int len = strlen(string);
13890 char * tmp = __ecereNameSpace__ecere__com__eSystem_New(sizeof(char) * (len - 2 + 1));
13891
13892 len = UnescapeString(tmp, string + 1, len - 2);
13893 (__ecereNameSpace__ecere__com__eSystem_Delete(tmp), tmp = 0);
13894 FreeExpContents(exp);
13895 exp->type = 2;
13896 exp->__anon1.__anon1.constant = PrintUInt(len + 1);
13897 }
13898 else
13899 {
13900 struct Type * type = e->expType;
13901
13902 type->refCount++;
13903 FreeExpContents(exp);
13904 exp->type = 2;
13905 exp->__anon1.__anon1.constant = PrintUInt(ComputeTypeSize(type));
13906 FreeType(type);
13907 }
13908 break;
13909 }
13910 else
13911 ComputeExpression(exp->__anon1.op.exp2);
13912 }
13913 if(exp->__anon1.op.exp1)
13914 {
13915 ComputeExpression(exp->__anon1.op.exp1);
13916 exp1 = exp->__anon1.op.exp1;
13917 exp2 = exp->__anon1.op.exp2;
13918 op1 = GetOperand(exp1);
13919 if(op1.type)
13920 op1.type->refCount++;
13921 if(exp2)
13922 {
13923 op2 = GetOperand(exp2);
13924 if(op2.type)
13925 op2.type->refCount++;
13926 }
13927 }
13928 else
13929 {
13930 exp1 = exp->__anon1.op.exp2;
13931 op1 = GetOperand(exp1);
13932 if(op1.type)
13933 op1.type->refCount++;
13934 }
13935 CallOperator(exp, exp1, exp2, &op1, &op2);
13936 if(op1.type)
13937 FreeType(op1.type);
13938 if(op2.type)
13939 FreeType(op2.type);
13940 break;
13941 }
13942 case 5:
13943 case 32:
13944 {
13945 struct Expression * e, * n;
13946
13947 for(e = (*exp->__anon1.list).first; e; e = n)
13948 {
13949 n = e->next;
13950 if(!n)
13951 {
13952 struct __ecereNameSpace__ecere__sys__OldList * list = exp->__anon1.list;
13953 struct Expression * prev = exp->prev;
13954 struct Expression * next = exp->next;
13955
13956 if(exp->expType && exp->expType->kind == 8 && (!e->expType || e->expType->kind != 8))
13957 {
13958 FreeType(e->expType);
13959 e->expType = exp->expType;
13960 e->expType->refCount++;
13961 }
13962 ComputeExpression(e);
13963 FreeType(exp->expType);
13964 FreeType(exp->destType);
13965 *exp = *e;
13966 exp->prev = prev;
13967 exp->next = next;
13968 ((e ? __extension__ ({
13969 void * __ecerePtrToDelete = (e);
13970
13971 __ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)__ecerePtrToDelete) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(__ecerePtrToDelete);
13972 }) : 0), e = 0);
13973 (__ecereNameSpace__ecere__com__eSystem_Delete(list), list = 0);
13974 }
13975 else
13976 {
13977 FreeExpression(e);
13978 }
13979 }
13980 break;
13981 }
13982 case 8:
13983 {
13984 struct Expression * memberExp = exp->__anon1.member.exp;
13985 struct Identifier * memberID = exp->__anon1.member.member;
13986 struct Type * type;
13987
13988 ComputeExpression(exp->__anon1.member.exp);
13989 type = exp->__anon1.member.exp->expType;
13990 if(type)
13991 {
13992 struct __ecereNameSpace__ecere__com__Class * _class = (exp->__anon1.member.member && exp->__anon1.member.member->classSym) ? exp->__anon1.member.member->classSym->__anon1.registered : (((type->kind == 8 || type->kind == 19) && type->__anon1._class) ? type->__anon1._class->__anon1.registered : (((void *)0)));
13993 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
13994 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
13995 struct __ecereNameSpace__ecere__com__Class * convertTo = (((void *)0));
13996
13997 if(type->kind == 19 && exp->__anon1.member.exp->type == 24)
13998 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "ecere::com::Class");
13999 if(!_class)
14000 {
14001 char string[256];
14002 struct Symbol * classSym;
14003
14004 string[0] = '\0';
14005 PrintTypeNoConst(type, string, 0, 1);
14006 classSym = FindClass(string);
14007 _class = classSym ? classSym->__anon1.registered : (((void *)0));
14008 }
14009 if(exp->__anon1.member.member)
14010 {
14011 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, exp->__anon1.member.member->string, privateModule);
14012 if(!prop)
14013 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, exp->__anon1.member.member->string, privateModule, (((void *)0)), (((void *)0)));
14014 }
14015 if(!prop && !member && _class && exp->__anon1.member.member)
14016 {
14017 struct Symbol * classSym = FindClass(exp->__anon1.member.member->string);
14018
14019 convertTo = _class;
14020 _class = classSym ? classSym->__anon1.registered : (((void *)0));
14021 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, convertTo->fullName, privateModule);
14022 }
14023 if(prop)
14024 {
14025 if(prop->compiled)
14026 {
14027 struct Type * type = prop->dataType;
14028
14029 if(_class->type == 3)
14030 {
14031 if(type->kind == 8)
14032 {
14033 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
14034
14035 if(_class->type == 3)
14036 {
14037 if(!_class->dataType)
14038 _class->dataType = ProcessTypeString(_class->dataTypeString, 0);
14039 type = _class->dataType;
14040 }
14041 }
14042 switch(type->kind)
14043 {
14044 case 6:
14045 {
14046 float value;
14047 float (* Get)(float) = (void *)prop->Get;
14048
14049 GetFloat(exp->__anon1.member.exp, &value);
14050 exp->__anon1.__anon1.constant = PrintFloat(Get ? Get(value) : value);
14051 exp->type = 2;
14052 break;
14053 }
14054 case 7:
14055 {
14056 double value;
14057 double (* Get)(double);
14058
14059 GetDouble(exp->__anon1.member.exp, &value);
14060 if(convertTo)
14061 Get = (void *)prop->Set;
14062 else
14063 Get = (void *)prop->Get;
14064 exp->__anon1.__anon1.constant = PrintDouble(Get ? Get(value) : value);
14065 exp->type = 2;
14066 break;
14067 }
14068 }
14069 }
14070 else
14071 {
14072 if(convertTo)
14073 {
14074 struct Expression * value = exp->__anon1.member.exp;
14075 struct Type * type;
14076
14077 if(!prop->dataType)
14078 ProcessPropertyType(prop);
14079 type = prop->dataType;
14080 if(!type)
14081 {
14082 }
14083 else if(_class->type == 1)
14084 {
14085 switch(type->kind)
14086 {
14087 case 8:
14088 {
14089 struct __ecereNameSpace__ecere__com__Class * propertyClass = type->__anon1._class->__anon1.registered;
14090
14091 if(propertyClass->type == 1 && value->type == 1)
14092 {
14093 void (* Set)(void *, void *) = (void *)prop->Set;
14094
14095 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
14096 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
14097 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
14098 exp->__anon1.instance->loc = exp->loc;
14099 exp->type = 1;
14100 Set(exp->__anon1.instance->data, value->__anon1.instance->data);
14101 PopulateInstance(exp->__anon1.instance);
14102 }
14103 break;
14104 }
14105 case 3:
14106 {
14107 int intValue;
14108 void (* Set)(void *, int) = (void *)prop->Set;
14109
14110 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
14111 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
14112 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
14113 exp->__anon1.instance->loc = exp->loc;
14114 exp->type = 1;
14115 GetInt(value, &intValue);
14116 Set(exp->__anon1.instance->data, intValue);
14117 PopulateInstance(exp->__anon1.instance);
14118 break;
14119 }
14120 case 4:
14121 {
14122 long long intValue;
14123 void (* Set)(void *, long long) = (void *)prop->Set;
14124
14125 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
14126 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
14127 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
14128 exp->__anon1.instance->loc = exp->loc;
14129 exp->type = 1;
14130 GetInt64(value, &intValue);
14131 Set(exp->__anon1.instance->data, intValue);
14132 PopulateInstance(exp->__anon1.instance);
14133 break;
14134 }
14135 case 22:
14136 {
14137 intptr_t intValue;
14138 void (* Set)(void *, intptr_t) = (void *)prop->Set;
14139
14140 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
14141 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
14142 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
14143 exp->__anon1.instance->loc = exp->loc;
14144 exp->type = 1;
14145 GetIntPtr(value, &intValue);
14146 Set(exp->__anon1.instance->data, intValue);
14147 PopulateInstance(exp->__anon1.instance);
14148 break;
14149 }
14150 case 23:
14151 {
14152 ssize_t intValue;
14153 void (* Set)(void *, ssize_t) = (void *)prop->Set;
14154
14155 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
14156 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
14157 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
14158 exp->__anon1.instance->loc = exp->loc;
14159 exp->type = 1;
14160 GetIntSize(value, &intValue);
14161 Set(exp->__anon1.instance->data, intValue);
14162 PopulateInstance(exp->__anon1.instance);
14163 break;
14164 }
14165 case 6:
14166 {
14167 float floatValue;
14168 void (* Set)(void *, float) = (void *)prop->Set;
14169
14170 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
14171 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
14172 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
14173 exp->__anon1.instance->loc = exp->loc;
14174 exp->type = 1;
14175 GetFloat(value, &floatValue);
14176 Set(exp->__anon1.instance->data, floatValue);
14177 PopulateInstance(exp->__anon1.instance);
14178 break;
14179 }
14180 case 7:
14181 {
14182 double doubleValue;
14183 void (* Set)(void *, double) = (void *)prop->Set;
14184
14185 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
14186 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
14187 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
14188 exp->__anon1.instance->loc = exp->loc;
14189 exp->type = 1;
14190 GetDouble(value, &doubleValue);
14191 Set(exp->__anon1.instance->data, doubleValue);
14192 PopulateInstance(exp->__anon1.instance);
14193 break;
14194 }
14195 }
14196 }
14197 else if(_class->type == 2)
14198 {
14199 switch(type->kind)
14200 {
14201 case 8:
14202 {
14203 struct __ecereNameSpace__ecere__com__Class * propertyClass = type->__anon1._class->__anon1.registered;
14204
14205 if(propertyClass->type == 1 && value->__anon1.instance->data)
14206 {
14207 unsigned int (* Set)(void *) = (void *)prop->Set;
14208 unsigned int bits = Set(value->__anon1.instance->data);
14209
14210 exp->__anon1.__anon1.constant = PrintHexUInt(bits);
14211 exp->type = 2;
14212 break;
14213 }
14214 else if(_class->type == 2)
14215 {
14216 unsigned int value;
14217 unsigned int (* Set)(unsigned int) = (void *)prop->Set;
14218 unsigned int bits;
14219
14220 GetUInt(exp->__anon1.member.exp, &value);
14221 bits = Set(value);
14222 exp->__anon1.__anon1.constant = PrintHexUInt(bits);
14223 exp->type = 2;
14224 }
14225 }
14226 }
14227 }
14228 }
14229 else
14230 {
14231 if(_class->type == 2)
14232 {
14233 unsigned int value;
14234
14235 GetUInt(exp->__anon1.member.exp, &value);
14236 switch(type->kind)
14237 {
14238 case 8:
14239 {
14240 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
14241
14242 if(_class->type == 1)
14243 {
14244 void (* Get)(unsigned int, void *) = (void *)prop->Get;
14245
14246 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
14247 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
14248 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
14249 exp->__anon1.instance->loc = exp->loc;
14250 exp->type = 1;
14251 Get(value, exp->__anon1.instance->data);
14252 PopulateInstance(exp->__anon1.instance);
14253 }
14254 else if(_class->type == 2)
14255 {
14256 unsigned int (* Get)(unsigned int) = (void *)prop->Get;
14257 uint64 bits = Get(value);
14258
14259 exp->__anon1.__anon1.constant = PrintHexUInt64(bits);
14260 exp->type = 2;
14261 }
14262 break;
14263 }
14264 }
14265 }
14266 else if(_class->type == 1)
14267 {
14268 unsigned char * value = (exp->__anon1.member.exp->type == 1) ? exp->__anon1.member.exp->__anon1.instance->data : (((void *)0));
14269
14270 switch(type->kind)
14271 {
14272 case 8:
14273 {
14274 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
14275
14276 if(_class->type == 1 && value)
14277 {
14278 void (* Get)(void *, void *) = (void *)prop->Get;
14279
14280 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
14281 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
14282 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
14283 exp->__anon1.instance->loc = exp->loc;
14284 exp->type = 1;
14285 Get(value, exp->__anon1.instance->data);
14286 PopulateInstance(exp->__anon1.instance);
14287 }
14288 break;
14289 }
14290 }
14291 }
14292 }
14293 }
14294 }
14295 else
14296 {
14297 exp->isConstant = 0;
14298 }
14299 }
14300 else if(member)
14301 {
14302 }
14303 }
14304 if(exp->type != 8)
14305 {
14306 FreeExpression(memberExp);
14307 FreeIdentifier(memberID);
14308 }
14309 break;
14310 }
14311 case 10:
14312 {
14313 struct Type * type = ProcessType(exp->__anon1.typeName->qualifiers, exp->__anon1.typeName->declarator);
14314
14315 FreeExpContents(exp);
14316 exp->__anon1.__anon1.constant = PrintUInt(ComputeTypeSize(type));
14317 exp->type = 2;
14318 FreeType(type);
14319 break;
14320 }
14321 case 15:
14322 {
14323 struct Symbol * classSym = exp->__anon1._class->__anon1.__anon1.symbol;
14324
14325 if(classSym && classSym->__anon1.registered)
14326 {
14327 if(classSym->__anon1.registered->fixed)
14328 {
14329 FreeSpecifier(exp->__anon1._class);
14330 exp->__anon1.__anon1.constant = PrintUInt(classSym->__anon1.registered->templateClass ? classSym->__anon1.registered->templateClass->structSize : classSym->__anon1.registered->structSize);
14331 exp->type = 2;
14332 }
14333 else
14334 {
14335 char className[1024];
14336
14337 strcpy(className, "__ecereClass_");
14338 FullClassNameCat(className, classSym->string, 1);
14339 DeclareClass(curExternal, classSym, className);
14340 FreeExpContents(exp);
14341 exp->type = 9;
14342 exp->__anon1.member.exp = MkExpIdentifier(MkIdentifier(className));
14343 exp->__anon1.member.member = MkIdentifier("structSize");
14344 }
14345 }
14346 break;
14347 }
14348 case 11:
14349 {
14350 struct Type * type;
14351 struct Expression * e = exp;
14352
14353 if(exp->type == 11)
14354 {
14355 if(exp->__anon1.cast.exp)
14356 ComputeExpression(exp->__anon1.cast.exp);
14357 e = exp->__anon1.cast.exp;
14358 }
14359 if(e && exp->expType)
14360 {
14361 type = exp->expType;
14362 if(type->kind == 8)
14363 {
14364 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
14365
14366 if(_class && (_class->type == 3 || _class->type == 2))
14367 {
14368 if(!_class->dataType)
14369 _class->dataType = ProcessTypeString(_class->dataTypeString, 0);
14370 type = _class->dataType;
14371 }
14372 }
14373 switch(type->kind)
14374 {
14375 case 24:
14376 case 1:
14377 if(type->isSigned)
14378 {
14379 char value = 0;
14380
14381 if(GetChar(e, &value))
14382 {
14383 FreeExpContents(exp);
14384 exp->__anon1.__anon1.constant = PrintChar(value);
14385 exp->type = 2;
14386 }
14387 }
14388 else
14389 {
14390 unsigned char value = 0;
14391
14392 if(GetUChar(e, &value))
14393 {
14394 FreeExpContents(exp);
14395 exp->__anon1.__anon1.constant = PrintUChar(value);
14396 exp->type = 2;
14397 }
14398 }
14399 break;
14400 case 2:
14401 if(type->isSigned)
14402 {
14403 short value = 0;
14404
14405 if(GetShort(e, &value))
14406 {
14407 FreeExpContents(exp);
14408 exp->__anon1.__anon1.constant = PrintShort(value);
14409 exp->type = 2;
14410 }
14411 }
14412 else
14413 {
14414 unsigned short value = 0;
14415
14416 if(GetUShort(e, &value))
14417 {
14418 FreeExpContents(exp);
14419 exp->__anon1.__anon1.constant = PrintUShort(value);
14420 exp->type = 2;
14421 }
14422 }
14423 break;
14424 case 3:
14425 if(type->isSigned)
14426 {
14427 int value = 0;
14428
14429 if(GetInt(e, &value))
14430 {
14431 FreeExpContents(exp);
14432 exp->__anon1.__anon1.constant = PrintInt(value);
14433 exp->type = 2;
14434 }
14435 }
14436 else
14437 {
14438 unsigned int value = 0;
14439
14440 if(GetUInt(e, &value))
14441 {
14442 FreeExpContents(exp);
14443 exp->__anon1.__anon1.constant = PrintUInt(value);
14444 exp->type = 2;
14445 }
14446 }
14447 break;
14448 case 4:
14449 if(type->isSigned)
14450 {
14451 long long value = 0;
14452
14453 if(GetInt64(e, &value))
14454 {
14455 FreeExpContents(exp);
14456 exp->__anon1.__anon1.constant = PrintInt64(value);
14457 exp->type = 2;
14458 }
14459 }
14460 else
14461 {
14462 uint64 value = 0;
14463
14464 if(GetUInt64(e, &value))
14465 {
14466 FreeExpContents(exp);
14467 exp->__anon1.__anon1.constant = PrintUInt64(value);
14468 exp->type = 2;
14469 }
14470 }
14471 break;
14472 case 22:
14473 if(type->isSigned)
14474 {
14475 intptr_t value = 0;
14476
14477 if(GetIntPtr(e, &value))
14478 {
14479 FreeExpContents(exp);
14480 exp->__anon1.__anon1.constant = PrintInt64((long long)value);
14481 exp->type = 2;
14482 }
14483 }
14484 else
14485 {
14486 uintptr_t value = 0;
14487
14488 if(GetUIntPtr(e, &value))
14489 {
14490 FreeExpContents(exp);
14491 exp->__anon1.__anon1.constant = PrintUInt64((uint64)value);
14492 exp->type = 2;
14493 }
14494 }
14495 break;
14496 case 23:
14497 if(type->isSigned)
14498 {
14499 ssize_t value = 0;
14500
14501 if(GetIntSize(e, &value))
14502 {
14503 FreeExpContents(exp);
14504 exp->__anon1.__anon1.constant = PrintInt64((long long)value);
14505 exp->type = 2;
14506 }
14507 }
14508 else
14509 {
14510 size_t value = 0;
14511
14512 if(GetUIntSize(e, &value))
14513 {
14514 FreeExpContents(exp);
14515 exp->__anon1.__anon1.constant = PrintUInt64((uint64)value);
14516 exp->type = 2;
14517 }
14518 }
14519 break;
14520 case 6:
14521 {
14522 float value = 0;
14523
14524 if(GetFloat(e, &value))
14525 {
14526 FreeExpContents(exp);
14527 exp->__anon1.__anon1.constant = PrintFloat(value);
14528 exp->type = 2;
14529 }
14530 break;
14531 }
14532 case 7:
14533 {
14534 double value = 0;
14535
14536 if(GetDouble(e, &value))
14537 {
14538 FreeExpContents(exp);
14539 exp->__anon1.__anon1.constant = PrintDouble(value);
14540 exp->type = 2;
14541 }
14542 break;
14543 }
14544 }
14545 }
14546 break;
14547 }
14548 case 12:
14549 {
14550 struct Operand op1 =
14551 {
14552 0, 0, 0,
14553 .__anon1 = {
14554 .c = 0
14555 },
14556 {
14557 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
14558 }
14559 };
14560 struct Operand op2 =
14561 {
14562 0, 0, 0,
14563 .__anon1 = {
14564 .c = 0
14565 },
14566 {
14567 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
14568 }
14569 };
14570 struct Operand op3 =
14571 {
14572 0, 0, 0,
14573 .__anon1 = {
14574 .c = 0
14575 },
14576 {
14577 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
14578 }
14579 };
14580
14581 if(exp->__anon1.cond.exp)
14582 ComputeExpression((*exp->__anon1.cond.exp).last);
14583 if(exp->__anon1.cond.elseExp)
14584 ComputeExpression(exp->__anon1.cond.elseExp);
14585 if(exp->__anon1.cond.cond)
14586 ComputeExpression(exp->__anon1.cond.cond);
14587 op1 = GetOperand(exp->__anon1.cond.cond);
14588 if(op1.type)
14589 op1.type->refCount++;
14590 op2 = GetOperand((*exp->__anon1.cond.exp).last);
14591 if(op2.type)
14592 op2.type->refCount++;
14593 op3 = GetOperand(exp->__anon1.cond.elseExp);
14594 if(op3.type)
14595 op3.type->refCount++;
14596 if(op1.ops.Cond)
14597 {
14598 FreeExpContents(exp);
14599 op1.ops.Cond(exp, &op1, &op2, &op3);
14600 }
14601 if(op1.type)
14602 FreeType(op1.type);
14603 if(op2.type)
14604 FreeType(op2.type);
14605 if(op3.type)
14606 FreeType(op3.type);
14607 break;
14608 }
14609 }
14610 }
14611
14612 static void ProcessFunction(struct FunctionDefinition *  function);
14613
14614 void ProcessInstantiationType(struct Instantiation * inst)
14615 {
14616 yylloc = inst->loc;
14617 if(inst->_class)
14618 {
14619 struct MembersInit * members;
14620 struct Symbol * classSym;
14621 struct __ecereNameSpace__ecere__com__Class * _class;
14622
14623 classSym = inst->_class->__anon1.__anon1.symbol;
14624 _class = classSym ? classSym->__anon1.registered : (((void *)0));
14625 if(!_class || _class->type != 5)
14626 DeclareStruct(curExternal, inst->_class->__anon1.__anon1.name, 0, 1);
14627 afterExternal = afterExternal ? afterExternal : curExternal;
14628 if(inst->exp)
14629 ProcessExpressionType(inst->exp);
14630 inst->isConstant = 1;
14631 if(inst->members)
14632 {
14633 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
14634 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
14635 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
14636 int subMemberStackPos = 0;
14637
14638 for(members = (*inst->members).first; members; members = members->next)
14639 {
14640 switch(members->type)
14641 {
14642 case 1:
14643 {
14644 char name[1024];
14645 static unsigned int instMethodID = 0;
14646 struct External * external = curExternal;
14647 struct Context * context = curContext;
14648 struct Declarator * declarator = members->__anon1.function->declarator;
14649 struct Identifier * nameID = GetDeclId(declarator);
14650 char * unmangled = nameID ? nameID->string : (((void *)0));
14651 struct Expression * exp;
14652 struct External * createdExternal = (((void *)0));
14653
14654 if(inCompiler)
14655 {
14656 char number[16];
14657
14658 strcpy(name, "__ecereInstMeth_");
14659 FullClassNameCat(name, _class ? _class->fullName : "_UNKNOWNCLASS", 0);
14660 strcat(name, "_");
14661 strcat(name, nameID->string);
14662 strcat(name, "_");
14663 sprintf(number, "_%08d", instMethodID++);
14664 strcat(name, number);
14665 nameID->string = __ecereNameSpace__ecere__sys__CopyString(name);
14666 }
14667 if(declarator)
14668 {
14669 struct Symbol * symbol = declarator->symbol;
14670 struct __ecereNameSpace__ecere__com__Method * method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, unmangled, privateModule);
14671
14672 if(method && method->type == 1)
14673 {
14674 symbol->__anon1.method = method;
14675 ProcessMethodType(method);
14676 if(!symbol->type->__anon1.__anon2.thisClass)
14677 {
14678 if(method->dataType->__anon1.__anon2.thisClass && currentClass && __ecereNameSpace__ecere__com__eClass_IsDerived(currentClass, method->dataType->__anon1.__anon2.thisClass->__anon1.registered))
14679 {
14680 if(!currentClass->symbol)
14681 currentClass->symbol = FindClass(currentClass->fullName);
14682 symbol->type->__anon1.__anon2.thisClass = currentClass->symbol;
14683 }
14684 else
14685 {
14686 if(!_class->symbol)
14687 _class->symbol = FindClass(_class->fullName);
14688 symbol->type->__anon1.__anon2.thisClass = _class->symbol;
14689 }
14690 }
14691 DeclareType(curExternal, symbol->type, 1, 1);
14692 }
14693 else if(classSym)
14694 {
14695 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't find virtual method %s in class %s\n", (((void *)0))), unmangled, classSym->string);
14696 }
14697 }
14698 createdExternal = ProcessClassFunction(classSym ? classSym->__anon1.registered : (((void *)0)), members->__anon1.function, ast, afterExternal, 1);
14699 if(nameID)
14700 {
14701 FreeSpecifier(nameID->_class);
14702 nameID->_class = (((void *)0));
14703 }
14704 curExternal = createdExternal;
14705 if(inCompiler)
14706 {
14707 if(createdExternal->__anon1.function)
14708 ProcessFunction(createdExternal->__anon1.function);
14709 }
14710 else if(declarator)
14711 {
14712 curExternal = declarator->symbol->__anon2.__anon1.pointerExternal;
14713 ProcessFunction((struct FunctionDefinition *)members->__anon1.function);
14714 }
14715 curExternal = external;
14716 curContext = context;
14717 if(inCompiler)
14718 {
14719 FreeClassFunction(members->__anon1.function);
14720 exp = QMkExpId(name);
14721 members->type = 0;
14722 members->__anon1.dataMembers = MkListOne(MkMemberInit(MkListOne(MkIdentifier(unmangled)), MkInitializerAssignment(exp)));
14723 (__ecereNameSpace__ecere__com__eSystem_Delete(unmangled), unmangled = 0);
14724 }
14725 break;
14726 }
14727 case 0:
14728 {
14729 if(members->__anon1.dataMembers && classSym)
14730 {
14731 struct MemberInit * member;
14732 struct Location oldyyloc = yylloc;
14733
14734 for(member = (*members->__anon1.dataMembers).first; member; member = member->next)
14735 {
14736 ProcessMemberInitData(member, classSym->__anon1.registered, &curClass, &curMember, subMemberStack, &subMemberStackPos);
14737 if(member->initializer && !member->initializer->isConstant)
14738 inst->isConstant = 0;
14739 }
14740 yylloc = oldyyloc;
14741 }
14742 break;
14743 }
14744 }
14745 }
14746 }
14747 }
14748 }
14749
14750 static void ProcessClass(struct __ecereNameSpace__ecere__sys__OldList *  definitions, struct Symbol *  symbol);
14751
14752 static void ProcessSpecifier(struct Specifier * spec, unsigned int declareStruct, unsigned int warnClasses)
14753 {
14754 switch(spec->type)
14755 {
14756 case 0:
14757 {
14758 if(spec->__anon1.specifier == THISCLASS)
14759 {
14760 if(thisClass)
14761 {
14762 spec->type = 1;
14763 spec->__anon1.__anon1.name = ReplaceThisClass(thisClass);
14764 spec->__anon1.__anon1.symbol = FindClass(spec->__anon1.__anon1.name);
14765 ProcessSpecifier(spec, declareStruct, 0);
14766 }
14767 }
14768 break;
14769 }
14770 case 1:
14771 {
14772 struct Symbol * symbol = FindType(curContext, spec->__anon1.__anon1.name);
14773
14774 if(symbol)
14775 DeclareType(curExternal, symbol->type, 1, 1);
14776 else if(spec->__anon1.__anon1.symbol)
14777 {
14778 struct __ecereNameSpace__ecere__com__Class * c = spec->__anon1.__anon1.symbol->__anon1.registered;
14779
14780 if(warnClasses && !c)
14781 Compiler_Warning("Undeclared class %s\n", spec->__anon1.__anon1.name);
14782 DeclareStruct(curExternal, spec->__anon1.__anon1.name, c && c->type == 5, declareStruct && c && c->type == 1);
14783 }
14784 break;
14785 }
14786 case 2:
14787 {
14788 struct Enumerator * e;
14789
14790 if(spec->__anon1.__anon2.list)
14791 {
14792 for(e = (*spec->__anon1.__anon2.list).first; e; e = e->next)
14793 {
14794 if(e->exp)
14795 ProcessExpressionType(e->exp);
14796 }
14797 }
14798 if(inCompiler)
14799 break;
14800 }
14801 case 3:
14802 case 4:
14803 {
14804 if(spec->__anon1.__anon2.definitions)
14805 {
14806 struct Symbol * symbol = spec->__anon1.__anon2.id ? FindClass(spec->__anon1.__anon2.id->string) : (((void *)0));
14807
14808 ProcessClass(spec->__anon1.__anon2.definitions, symbol);
14809 }
14810 break;
14811 }
14812 }
14813 }
14814
14815 static void ProcessDeclarator(struct Declarator * decl, unsigned int isFunction)
14816 {
14817 switch(decl->type)
14818 {
14819 case 1:
14820 if(decl->__anon1.identifier->classSym)
14821 {
14822 FreeSpecifier(decl->__anon1.identifier->_class);
14823 decl->__anon1.identifier->_class = (((void *)0));
14824 }
14825 break;
14826 case 3:
14827 if(decl->__anon1.array.exp)
14828 ProcessExpressionType(decl->__anon1.array.exp);
14829 case 0:
14830 case 2:
14831 case 4:
14832 case 5:
14833 case 6:
14834 case 7:
14835 {
14836 struct Identifier * id = (((void *)0));
14837 struct Specifier * classSpec = (((void *)0));
14838
14839 if(decl->type == 4)
14840 {
14841 id = GetDeclId(decl);
14842 if(id && id->_class)
14843 {
14844 classSpec = id->_class;
14845 id->_class = (((void *)0));
14846 }
14847 }
14848 if(decl->declarator)
14849 ProcessDeclarator(decl->declarator, isFunction);
14850 if(decl->type == 4)
14851 {
14852 if(classSpec)
14853 {
14854 struct TypeName * param = (param = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TypeName), param->qualifiers = MkListOne(classSpec), param->declarator = (((void *)0)), param);
14855
14856 if(!decl->__anon1.function.parameters)
14857 decl->__anon1.function.parameters = MkList();
14858 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*decl->__anon1.function.parameters), (((void *)0)), param);
14859 }
14860 if(decl->__anon1.function.parameters)
14861 {
14862 struct TypeName * param;
14863
14864 for(param = (*decl->__anon1.function.parameters).first; param; param = param->next)
14865 {
14866 if(param->qualifiers)
14867 {
14868 struct Specifier * spec;
14869
14870 for(spec = (*param->qualifiers).first; spec; spec = spec->next)
14871 {
14872 if(spec->type == 0)
14873 {
14874 if(spec->__anon1.specifier == TYPED_OBJECT)
14875 {
14876 struct Declarator * d = param->declarator;
14877 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);
14878
14879 if(!d || d->type != 5)
14880 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*newParam->qualifiers), (((void *)0)), MkSpecifier(CONST));
14881 FreeList(param->qualifiers, (void *)(FreeSpecifier));
14882 param->qualifiers = MkListOne(MkStructOrUnion(3, MkIdentifier("__ecereNameSpace__ecere__com__Class"), (((void *)0))));
14883 param->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier("class")));
14884 DeclareStruct(curExternal, "ecere::com::Class", 0, 1);
14885 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*decl->__anon1.function.parameters), param, newParam);
14886 param = newParam;
14887 break;
14888 }
14889 else if(spec->__anon1.specifier == ANY_OBJECT)
14890 {
14891 struct Declarator * d = param->declarator;
14892
14893 FreeList(param->qualifiers, (void *)(FreeSpecifier));
14894 param->qualifiers = MkListOne(MkSpecifier(VOID));
14895 if(!d || d->type != 5)
14896 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*param->qualifiers), (((void *)0)), MkSpecifier(CONST));
14897 param->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d);
14898 break;
14899 }
14900 else if(spec->__anon1.specifier == THISCLASS)
14901 {
14902 if(thisClass)
14903 {
14904 spec->type = 1;
14905 spec->__anon1.__anon1.name = ReplaceThisClass(thisClass);
14906 spec->__anon1.__anon1.symbol = FindClass(spec->__anon1.__anon1.name);
14907 ProcessSpecifier(spec, 0, 0);
14908 }
14909 break;
14910 }
14911 }
14912 else if(spec->type == 1)
14913 {
14914 ProcessSpecifier(spec, isFunction, 1);
14915 }
14916 else if((spec->type == 3 || spec->type == 4) && !spec->__anon1.__anon2.definitions && spec->__anon1.__anon2.id && spec->__anon1.__anon2.id->string)
14917 {
14918 struct Declarator * d = param->declarator;
14919
14920 if(!d || d->type != 5)
14921 DeclareStruct(curExternal, spec->__anon1.__anon2.id->string, 0, 1);
14922 }
14923 }
14924 }
14925 if(param->declarator)
14926 ProcessDeclarator(param->declarator, 0);
14927 }
14928 }
14929 }
14930 break;
14931 }
14932 }
14933 }
14934
14935 static void ProcessDeclaration(struct Declaration * decl, unsigned int warnClasses)
14936 {
14937 yylloc = decl->loc;
14938 switch(decl->type)
14939 {
14940 case 1:
14941 {
14942 unsigned int declareStruct = 0;
14943
14944 if(decl->__anon1.__anon1.declarators)
14945 {
14946 struct InitDeclarator * d;
14947
14948 for(d = (*decl->__anon1.__anon1.declarators).first; d; d = d->next)
14949 {
14950 struct Type * type, * subType;
14951
14952 ProcessDeclarator(d->declarator, 0);
14953 type = ProcessType(decl->__anon1.__anon1.specifiers, d->declarator);
14954 if(d->initializer)
14955 {
14956 ProcessInitializer(d->initializer, type);
14957 if((*decl->__anon1.__anon1.declarators).count == 1 && d->initializer->type == 0 && d->initializer->__anon1.exp->type == 1)
14958 {
14959 if(type->kind == 8 && type->__anon1._class == d->initializer->__anon1.exp->expType->__anon1._class)
14960 {
14961 struct Instantiation * inst = d->initializer->__anon1.exp->__anon1.instance;
14962
14963 inst->exp = MkExpIdentifier(CopyIdentifier(GetDeclId(d->declarator)));
14964 d->initializer->__anon1.exp->__anon1.instance = (((void *)0));
14965 if(decl->__anon1.__anon1.specifiers)
14966 FreeList(decl->__anon1.__anon1.specifiers, (void *)(FreeSpecifier));
14967 FreeList(decl->__anon1.__anon1.declarators, (void *)(FreeInitDeclarator));
14968 d = (((void *)0));
14969 decl->type = 2;
14970 decl->__anon1.inst = inst;
14971 }
14972 }
14973 }
14974 for(subType = type; subType; )
14975 {
14976 if(subType->kind == 8)
14977 {
14978 declareStruct = 1;
14979 break;
14980 }
14981 else if(subType->kind == 13)
14982 break;
14983 else if(subType->kind == 12)
14984 subType = subType->__anon1.__anon4.arrayType;
14985 else
14986 break;
14987 }
14988 FreeType(type);
14989 if(!d)
14990 break;
14991 }
14992 }
14993 if(decl->__anon1.__anon1.specifiers)
14994 {
14995 struct Specifier * s;
14996
14997 for(s = (*decl->__anon1.__anon1.specifiers).first; s; s = s->next)
14998 {
14999 ProcessSpecifier(s, declareStruct, 1);
15000 }
15001 }
15002 break;
15003 }
15004 case 2:
15005 {
15006 ProcessInstantiationType(decl->__anon1.inst);
15007 break;
15008 }
15009 case 0:
15010 {
15011 struct Specifier * spec;
15012 struct Declarator * d;
15013 unsigned int declareStruct = 0;
15014
15015 if(decl->__anon1.__anon1.declarators)
15016 {
15017 for(d = (*decl->__anon1.__anon1.declarators).first; d; d = d->next)
15018 {
15019 struct Type * type = ProcessType(decl->__anon1.__anon1.specifiers, d->declarator);
15020 struct Type * subType;
15021
15022 ProcessDeclarator(d, 0);
15023 for(subType = type; subType; )
15024 {
15025 if(subType->kind == 8)
15026 {
15027 declareStruct = 1;
15028 break;
15029 }
15030 else if(subType->kind == 13)
15031 break;
15032 else if(subType->kind == 12)
15033 subType = subType->__anon1.__anon4.arrayType;
15034 else
15035 break;
15036 }
15037 FreeType(type);
15038 }
15039 }
15040 if(decl->__anon1.__anon1.specifiers)
15041 {
15042 for(spec = (*decl->__anon1.__anon1.specifiers).first; spec; spec = spec->next)
15043 ProcessSpecifier(spec, declareStruct, warnClasses);
15044 }
15045 break;
15046 }
15047 }
15048 }
15049
15050 static void ProcessStatement(struct Statement * stmt)
15051 {
15052 yylloc = stmt->loc;
15053 switch(stmt->type)
15054 {
15055 case 0:
15056 ProcessStatement(stmt->__anon1.labeled.stmt);
15057 break;
15058 case 1:
15059 if(stmt->__anon1.caseStmt.exp)
15060 {
15061 FreeType(stmt->__anon1.caseStmt.exp->destType);
15062 stmt->__anon1.caseStmt.exp->destType = curSwitchType;
15063 if(curSwitchType)
15064 curSwitchType->refCount++;
15065 ProcessExpressionType(stmt->__anon1.caseStmt.exp);
15066 ComputeExpression(stmt->__anon1.caseStmt.exp);
15067 }
15068 if(stmt->__anon1.caseStmt.stmt)
15069 ProcessStatement(stmt->__anon1.caseStmt.stmt);
15070 break;
15071 case 2:
15072 {
15073 if(stmt->__anon1.compound.context)
15074 {
15075 struct Declaration * decl;
15076 struct Statement * s;
15077 struct Statement * prevCompound = curCompound;
15078 struct Context * prevContext = curContext;
15079
15080 if(!stmt->__anon1.compound.isSwitch)
15081 curCompound = stmt;
15082 curContext = stmt->__anon1.compound.context;
15083 if(stmt->__anon1.compound.declarations)
15084 {
15085 for(decl = (*stmt->__anon1.compound.declarations).first; decl; decl = decl->next)
15086 ProcessDeclaration(decl, 1);
15087 }
15088 if(stmt->__anon1.compound.statements)
15089 {
15090 for(s = (*stmt->__anon1.compound.statements).first; s; s = s->next)
15091 ProcessStatement(s);
15092 }
15093 curContext = prevContext;
15094 curCompound = prevCompound;
15095 }
15096 break;
15097 }
15098 case 3:
15099 {
15100 struct Expression * exp;
15101
15102 if(stmt->__anon1.expressions)
15103 {
15104 for(exp = (*stmt->__anon1.expressions).first; exp; exp = exp->next)
15105 ProcessExpressionType(exp);
15106 }
15107 break;
15108 }
15109 case 4:
15110 {
15111 struct Expression * exp;
15112
15113 FreeType(((struct Expression *)(*stmt->__anon1.ifStmt.exp).last)->destType);
15114 ((struct Expression *)(*stmt->__anon1.ifStmt.exp).last)->destType = MkClassType("bool");
15115 ((struct Expression *)(*stmt->__anon1.ifStmt.exp).last)->destType->truth = 1;
15116 for(exp = (*stmt->__anon1.ifStmt.exp).first; exp; exp = exp->next)
15117 {
15118 ProcessExpressionType(exp);
15119 }
15120 if(stmt->__anon1.ifStmt.stmt)
15121 ProcessStatement(stmt->__anon1.ifStmt.stmt);
15122 if(stmt->__anon1.ifStmt.elseStmt)
15123 ProcessStatement(stmt->__anon1.ifStmt.elseStmt);
15124 break;
15125 }
15126 case 5:
15127 {
15128 struct Type * oldSwitchType = curSwitchType;
15129
15130 if(stmt->__anon1.switchStmt.exp)
15131 {
15132 struct Expression * exp;
15133
15134 for(exp = (*stmt->__anon1.switchStmt.exp).first; exp; exp = exp->next)
15135 {
15136 if(!exp->next)
15137 {
15138 ProcessExpressionType(exp);
15139 }
15140 if(!exp->next)
15141 curSwitchType = exp->expType;
15142 }
15143 }
15144 ProcessStatement(stmt->__anon1.switchStmt.stmt);
15145 curSwitchType = oldSwitchType;
15146 break;
15147 }
15148 case 6:
15149 {
15150 if(stmt->__anon1.whileStmt.exp)
15151 {
15152 struct Expression * exp;
15153
15154 FreeType(((struct Expression *)(*stmt->__anon1.whileStmt.exp).last)->destType);
15155 ((struct Expression *)(*stmt->__anon1.whileStmt.exp).last)->destType = MkClassType("bool");
15156 ((struct Expression *)(*stmt->__anon1.whileStmt.exp).last)->destType->truth = 1;
15157 for(exp = (*stmt->__anon1.whileStmt.exp).first; exp; exp = exp->next)
15158 {
15159 ProcessExpressionType(exp);
15160 }
15161 }
15162 if(stmt->__anon1.whileStmt.stmt)
15163 ProcessStatement(stmt->__anon1.whileStmt.stmt);
15164 break;
15165 }
15166 case 7:
15167 {
15168 if(stmt->__anon1.doWhile.exp)
15169 {
15170 struct Expression * exp;
15171
15172 if((*stmt->__anon1.doWhile.exp).last)
15173 {
15174 FreeType(((struct Expression *)(*stmt->__anon1.doWhile.exp).last)->destType);
15175 ((struct Expression *)(*stmt->__anon1.doWhile.exp).last)->destType = MkClassType("bool");
15176 ((struct Expression *)(*stmt->__anon1.doWhile.exp).last)->destType->truth = 1;
15177 }
15178 for(exp = (*stmt->__anon1.doWhile.exp).first; exp; exp = exp->next)
15179 {
15180 ProcessExpressionType(exp);
15181 }
15182 }
15183 if(stmt->__anon1.doWhile.stmt)
15184 ProcessStatement(stmt->__anon1.doWhile.stmt);
15185 break;
15186 }
15187 case 8:
15188 {
15189 struct Expression * exp;
15190
15191 if(stmt->__anon1.forStmt.init)
15192 ProcessStatement(stmt->__anon1.forStmt.init);
15193 if(stmt->__anon1.forStmt.check && stmt->__anon1.forStmt.check->__anon1.expressions)
15194 {
15195 FreeType(((struct Expression *)(*stmt->__anon1.forStmt.check->__anon1.expressions).last)->destType);
15196 ((struct Expression *)(*stmt->__anon1.forStmt.check->__anon1.expressions).last)->destType = MkClassType("bool");
15197 ((struct Expression *)(*stmt->__anon1.forStmt.check->__anon1.expressions).last)->destType->truth = 1;
15198 }
15199 if(stmt->__anon1.forStmt.check)
15200 ProcessStatement(stmt->__anon1.forStmt.check);
15201 if(stmt->__anon1.forStmt.increment)
15202 {
15203 for(exp = (*stmt->__anon1.forStmt.increment).first; exp; exp = exp->next)
15204 ProcessExpressionType(exp);
15205 }
15206 if(stmt->__anon1.forStmt.stmt)
15207 ProcessStatement(stmt->__anon1.forStmt.stmt);
15208 break;
15209 }
15210 case 18:
15211 {
15212 struct Identifier * id = stmt->__anon1.forEachStmt.id;
15213 struct __ecereNameSpace__ecere__sys__OldList * exp = stmt->__anon1.forEachStmt.exp;
15214 struct __ecereNameSpace__ecere__sys__OldList * filter = stmt->__anon1.forEachStmt.filter;
15215 struct Statement * block = stmt->__anon1.forEachStmt.stmt;
15216 char iteratorType[1024];
15217 struct Type * source;
15218 struct Expression * e;
15219 unsigned int isBuiltin = exp && (*exp).last && (((struct Expression *)(*exp).last)->type == 35 || (((struct Expression *)(*exp).last)->type == 11 && ((struct Expression *)(*exp).last)->__anon1.cast.exp->type == 35));
15220 struct Expression * arrayExp;
15221 const char * typeString = (((void *)0));
15222 int builtinCount = 0;
15223
15224 for(e = exp ? (*exp).first : (((void *)0)); e; e = e->next)
15225 {
15226 if(!e->next)
15227 {
15228 FreeType(e->destType);
15229 e->destType = ProcessTypeString("Container", 0);
15230 }
15231 if(!isBuiltin || e->next)
15232 ProcessExpressionType(e);
15233 }
15234 source = (exp && (*exp).last) ? ((struct Expression *)(*exp).last)->expType : (((void *)0));
15235 if(isBuiltin || (source && source->kind == 8 && source->__anon1._class && source->__anon1._class->__anon1.registered && source->__anon1._class->__anon1.registered != containerClass && __ecereNameSpace__ecere__com__eClass_IsDerived(source->__anon1._class->__anon1.registered, containerClass)))
15236 {
15237 struct __ecereNameSpace__ecere__com__Class * _class = source ? source->__anon1._class->__anon1.registered : (((void *)0));
15238 struct Symbol * symbol;
15239 struct Expression * expIt = (((void *)0));
15240 unsigned int isMap = 0, isArray = 0, isLinkList = 0, isList = 0, isCustomAVLTree = 0;
15241 struct __ecereNameSpace__ecere__com__Class * arrayClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "Array");
15242 struct __ecereNameSpace__ecere__com__Class * linkListClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "LinkList");
15243 struct __ecereNameSpace__ecere__com__Class * customAVLTreeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "CustomAVLTree");
15244
15245 if(inCompiler)
15246 {
15247 stmt->type = 2;
15248 stmt->__anon1.compound.context = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Context);
15249 stmt->__anon1.compound.context->parent = curContext;
15250 curContext = stmt->__anon1.compound.context;
15251 }
15252 if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->__anon1._class->__anon1.registered, customAVLTreeClass))
15253 {
15254 struct __ecereNameSpace__ecere__com__Class * mapClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "Map");
15255
15256 isCustomAVLTree = 1;
15257 if(__ecereNameSpace__ecere__com__eClass_IsDerived(source->__anon1._class->__anon1.registered, mapClass))
15258 isMap = 1;
15259 }
15260 else if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->__anon1._class->__anon1.registered, arrayClass))
15261 isArray = 1;
15262 else if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->__anon1._class->__anon1.registered, linkListClass))
15263 {
15264 struct __ecereNameSpace__ecere__com__Class * listClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "List");
15265
15266 isLinkList = 1;
15267 isList = __ecereNameSpace__ecere__com__eClass_IsDerived(source->__anon1._class->__anon1.registered, listClass);
15268 }
15269 if(inCompiler && isArray)
15270 {
15271 struct Declarator * decl;
15272 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15273
15274 decl = SpecDeclFromString(_class->templateArgs[2].__anon1.__anon1.dataTypeString, specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(id)));
15275 stmt->__anon1.compound.declarations = MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(decl, (((void *)0))))));
15276 ListAdd(stmt->__anon1.compound.declarations, MkDeclaration(MkListOne(MkSpecifierName(source->__anon1._class->__anon1.registered->fullName)), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internalArray")), MkInitializerAssignment(MkExpBrackets(exp))))));
15277 }
15278 else if(isBuiltin)
15279 {
15280 struct Type * type = (((void *)0));
15281 char typeStringBuf[1024];
15282
15283 arrayExp = (((struct Expression *)(*exp).last)->type == 35) ? (struct Expression *)(*exp).last : ((struct Expression *)(*exp).last)->__anon1.cast.exp;
15284 if(((struct Expression *)(*exp).last)->type == 11)
15285 {
15286 struct TypeName * typeName = ((struct Expression *)(*exp).last)->__anon1.cast.typeName;
15287
15288 if(typeName)
15289 arrayExp->destType = ProcessType(typeName->qualifiers, typeName->declarator);
15290 }
15291 if(arrayExp->destType && arrayExp->destType->kind == 8 && arrayExp->destType->__anon1._class && arrayExp->destType->__anon1._class->__anon1.registered && arrayExp->destType->__anon1._class->__anon1.registered != containerClass && __ecereNameSpace__ecere__com__eClass_IsDerived(arrayExp->destType->__anon1._class->__anon1.registered, containerClass) && arrayExp->destType->__anon1._class->__anon1.registered->templateArgs)
15292 {
15293 struct __ecereNameSpace__ecere__com__Class * templateClass = arrayExp->destType->__anon1._class->__anon1.registered;
15294
15295 typeString = templateClass->templateArgs[2].__anon1.__anon1.dataTypeString;
15296 }
15297 else if(arrayExp->__anon1.list)
15298 {
15299 struct Expression * e;
15300
15301 for(e = (*arrayExp->__anon1.list).first; e; e = e->next)
15302 {
15303 ProcessExpressionType(e);
15304 if(e->expType)
15305 {
15306 if(!type)
15307 {
15308 type = e->expType;
15309 type->refCount++;
15310 }
15311 else
15312 {
15313 if(!MatchTypeExpression(e, type, (((void *)0)), 0, 1))
15314 {
15315 FreeType(type);
15316 type = e->expType;
15317 e->expType = (((void *)0));
15318 e = (*arrayExp->__anon1.list).first;
15319 ProcessExpressionType(e);
15320 if(e->expType)
15321 {
15322 if(!MatchTypeExpression(e, type, (((void *)0)), 0, 1))
15323 {
15324 FreeType(e->expType);
15325 e->expType = (((void *)0));
15326 FreeType(type);
15327 type = (((void *)0));
15328 break;
15329 }
15330 }
15331 }
15332 }
15333 if(e->expType)
15334 {
15335 FreeType(e->expType);
15336 e->expType = (((void *)0));
15337 }
15338 }
15339 }
15340 if(type)
15341 {
15342 typeStringBuf[0] = '\0';
15343 PrintType(type, typeStringBuf, 0, 1);
15344 typeString = typeStringBuf;
15345 FreeType(type);
15346 }
15347 }
15348 if(typeString)
15349 {
15350 if(inCompiler)
15351 {
15352 struct __ecereNameSpace__ecere__sys__OldList * initializers = MkList();
15353 struct Declarator * decl;
15354 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15355
15356 if(arrayExp->__anon1.list)
15357 {
15358 struct Expression * e;
15359
15360 builtinCount = (*arrayExp->__anon1.list).count;
15361 type = ProcessTypeString(typeString, 0);
15362 while((e = (*arrayExp->__anon1.list).first))
15363 {
15364 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*arrayExp->__anon1.list), e);
15365 e->destType = type;
15366 type->refCount++;
15367 ProcessExpressionType(e);
15368 if(inCompiler)
15369 ListAdd(initializers, MkInitializerAssignment(e));
15370 }
15371 FreeType(type);
15372 (__ecereNameSpace__ecere__com__eSystem_Delete(arrayExp->__anon1.list), arrayExp->__anon1.list = 0);
15373 }
15374 decl = SpecDeclFromString(typeString, specs, MkDeclaratorIdentifier(id));
15375 stmt->__anon1.compound.declarations = MkListOne(MkDeclaration(CopyList(specs, (void *)(CopySpecifier)), MkListOne(MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl), (((void *)0))))));
15376 ListAdd(stmt->__anon1.compound.declarations, MkDeclaration(specs, MkListOne(MkInitDeclarator(PlugDeclarator(decl, MkDeclaratorArray(MkDeclaratorIdentifier(MkIdentifier("__internalArray")), (((void *)0)))), MkInitializerList(initializers)))));
15377 FreeList(exp, (void *)(FreeExpression));
15378 }
15379 else if(arrayExp->__anon1.list)
15380 {
15381 struct Expression * e;
15382
15383 type = ProcessTypeString(typeString, 0);
15384 for(e = (*arrayExp->__anon1.list).first; e; e = e->next)
15385 {
15386 e->destType = type;
15387 type->refCount++;
15388 ProcessExpressionType(e);
15389 }
15390 FreeType(type);
15391 }
15392 }
15393 else
15394 {
15395 arrayExp->expType = ProcessTypeString("Container", 0);
15396 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Couldn't determine type of array elements\n", (((void *)0))));
15397 }
15398 }
15399 else if(inCompiler && isLinkList && !isList)
15400 {
15401 struct Declarator * decl;
15402 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15403
15404 decl = SpecDeclFromString(_class->templateArgs[3].__anon1.__anon1.dataTypeString, specs, MkDeclaratorIdentifier(id));
15405 stmt->__anon1.compound.declarations = MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(decl, (((void *)0))))));
15406 ListAdd(stmt->__anon1.compound.declarations, MkDeclaration(MkListOne(MkSpecifierName(source->__anon1._class->__anon1.registered->fullName)), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internalLinkList")), MkInitializerAssignment(MkExpBrackets(exp))))));
15407 }
15408 else if(inCompiler && _class->templateArgs)
15409 {
15410 if(isMap)
15411 sprintf(iteratorType, "MapIterator<%s, %s >", _class->templateArgs[5].__anon1.__anon1.dataTypeString, _class->templateArgs[6].__anon1.__anon1.dataTypeString);
15412 else
15413 sprintf(iteratorType, "Iterator<%s, %s >", _class->templateArgs[2].__anon1.__anon1.dataTypeString, _class->templateArgs[1].__anon1.__anon1.dataTypeString);
15414 stmt->__anon1.compound.declarations = MkListOne(MkDeclarationInst(MkInstantiationNamed(MkListOne(MkSpecifierName(iteratorType)), MkExpIdentifier(id), MkListOne(MkMembersInitList(MkListOne(MkMemberInit(isMap ? MkListOne(MkIdentifier("map")) : (((void *)0)), MkInitializerAssignment(MkExpBrackets(exp)))))))));
15415 }
15416 if(inCompiler)
15417 {
15418 symbol = FindSymbol(id->string, curContext, curContext, 0, 0);
15419 if(block)
15420 {
15421 switch(block->type)
15422 {
15423 case 2:
15424 if(block->__anon1.compound.context)
15425 block->__anon1.compound.context->parent = stmt->__anon1.compound.context;
15426 break;
15427 case 4:
15428 if(block->__anon1.ifStmt.stmt && block->__anon1.ifStmt.stmt->type == 2 && block->__anon1.ifStmt.stmt->__anon1.compound.context)
15429 block->__anon1.ifStmt.stmt->__anon1.compound.context->parent = stmt->__anon1.compound.context;
15430 if(block->__anon1.ifStmt.elseStmt && block->__anon1.ifStmt.elseStmt->type == 2 && block->__anon1.ifStmt.elseStmt->__anon1.compound.context)
15431 block->__anon1.ifStmt.elseStmt->__anon1.compound.context->parent = stmt->__anon1.compound.context;
15432 break;
15433 case 5:
15434 if(block->__anon1.switchStmt.stmt && block->__anon1.switchStmt.stmt->type == 2 && block->__anon1.switchStmt.stmt->__anon1.compound.context)
15435 block->__anon1.switchStmt.stmt->__anon1.compound.context->parent = stmt->__anon1.compound.context;
15436 break;
15437 case 6:
15438 if(block->__anon1.whileStmt.stmt && block->__anon1.whileStmt.stmt->type == 2 && block->__anon1.whileStmt.stmt->__anon1.compound.context)
15439 block->__anon1.whileStmt.stmt->__anon1.compound.context->parent = stmt->__anon1.compound.context;
15440 break;
15441 case 7:
15442 if(block->__anon1.doWhile.stmt && block->__anon1.doWhile.stmt->type == 2 && block->__anon1.doWhile.stmt->__anon1.compound.context)
15443 block->__anon1.doWhile.stmt->__anon1.compound.context->parent = stmt->__anon1.compound.context;
15444 break;
15445 case 8:
15446 if(block->__anon1.forStmt.stmt && block->__anon1.forStmt.stmt->type == 2 && block->__anon1.forStmt.stmt->__anon1.compound.context)
15447 block->__anon1.forStmt.stmt->__anon1.compound.context->parent = stmt->__anon1.compound.context;
15448 break;
15449 case 18:
15450 if(block->__anon1.forEachStmt.stmt && block->__anon1.forEachStmt.stmt->type == 2 && block->__anon1.forEachStmt.stmt->__anon1.compound.context)
15451 block->__anon1.forEachStmt.stmt->__anon1.compound.context->parent = stmt->__anon1.compound.context;
15452 break;
15453 }
15454 }
15455 if(filter)
15456 {
15457 block = MkIfStmt(filter, block, (((void *)0)));
15458 }
15459 if(isArray)
15460 {
15461 stmt->__anon1.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));
15462 ProcessStatement(((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.init);
15463 ProcessStatement(((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.check);
15464 ProcessExpressionType((*((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.increment).first);
15465 }
15466 else if(isBuiltin)
15467 {
15468 char count[128];
15469
15470 sprintf(count, "%d", builtinCount);
15471 stmt->__anon1.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));
15472 ProcessStatement(((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.init);
15473 ProcessStatement(((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.check);
15474 ProcessExpressionType((*((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.increment).first);
15475 }
15476 else if(isLinkList && !isList)
15477 {
15478 struct __ecereNameSpace__ecere__com__Class * typeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, _class->templateArgs[3].__anon1.__anon1.dataTypeString);
15479 struct __ecereNameSpace__ecere__com__Class * listItemClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, "ListItem");
15480
15481 if(typeClass && __ecereNameSpace__ecere__com__eClass_IsDerived(typeClass, listItemClass) && _class->templateArgs[5].__anon1.__anon1.dataTypeString && !strcmp(_class->templateArgs[5].__anon1.__anon1.dataTypeString, "LT::link"))
15482 {
15483 stmt->__anon1.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));
15484 }
15485 else
15486 {
15487 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15488 struct Declarator * decl = SpecDeclFromString(_class->templateArgs[3].__anon1.__anon1.dataTypeString, specs, (((void *)0)));
15489
15490 stmt->__anon1.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));
15491 }
15492 ProcessStatement(((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.init);
15493 ProcessStatement(((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.check);
15494 ProcessExpressionType((*((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.increment).first);
15495 }
15496 else
15497 {
15498 stmt->__anon1.compound.statements = MkListOne(MkWhileStmt(MkListOne(MkExpCall(MkExpMember(expIt = MkExpIdentifier(CopyIdentifier(id)), MkIdentifier("Next")), (((void *)0)))), block));
15499 }
15500 ProcessExpressionType(expIt);
15501 if((*stmt->__anon1.compound.declarations).first)
15502 ProcessDeclaration((*stmt->__anon1.compound.declarations).first, 1);
15503 if(symbol)
15504 symbol->isIterator = isMap ? 2 : ((isArray || isBuiltin) ? 3 : (isLinkList ? (isList ? 5 : 4) : (isCustomAVLTree ? 6 : 1)));
15505 ProcessStatement(stmt);
15506 }
15507 else
15508 ProcessStatement(stmt->__anon1.forEachStmt.stmt);
15509 if(inCompiler)
15510 curContext = stmt->__anon1.compound.context->parent;
15511 break;
15512 }
15513 else
15514 {
15515 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Expression is not a container\n", (((void *)0))));
15516 }
15517 break;
15518 }
15519 case 9:
15520 break;
15521 case 10:
15522 break;
15523 case 11:
15524 break;
15525 case 12:
15526 {
15527 struct Expression * exp;
15528
15529 if(stmt->__anon1.expressions)
15530 {
15531 for(exp = (*stmt->__anon1.expressions).first; exp; exp = exp->next)
15532 {
15533 if(!exp->next)
15534 {
15535 if(curFunction && !curFunction->type)
15536 curFunction->type = ProcessType(curFunction->specifiers, curFunction->declarator);
15537 FreeType(exp->destType);
15538 exp->destType = (curFunction && curFunction->type && curFunction->type->kind == 11) ? curFunction->type->__anon1.__anon2.returnType : (((void *)0));
15539 if(exp->destType)
15540 exp->destType->refCount++;
15541 }
15542 ProcessExpressionType(exp);
15543 }
15544 }
15545 break;
15546 }
15547 case 14:
15548 {
15549 ProcessDeclaration(stmt->__anon1.decl, 1);
15550 break;
15551 }
15552 case 13:
15553 {
15554 struct AsmField * field;
15555
15556 if(stmt->__anon1.asmStmt.inputFields)
15557 {
15558 for(field = (*stmt->__anon1.asmStmt.inputFields).first; field; field = field->next)
15559 if(field->expression)
15560 ProcessExpressionType(field->expression);
15561 }
15562 if(stmt->__anon1.asmStmt.outputFields)
15563 {
15564 for(field = (*stmt->__anon1.asmStmt.outputFields).first; field; field = field->next)
15565 if(field->expression)
15566 ProcessExpressionType(field->expression);
15567 }
15568 if(stmt->__anon1.asmStmt.clobberedFields)
15569 {
15570 for(field = (*stmt->__anon1.asmStmt.clobberedFields).first; field; field = field->next)
15571 {
15572 if(field->expression)
15573 ProcessExpressionType(field->expression);
15574 }
15575 }
15576 break;
15577 }
15578 case 17:
15579 {
15580 struct PropertyWatch * propWatch;
15581 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->__anon1._watch.watches;
15582 struct Expression * object = stmt->__anon1._watch.object;
15583 struct Expression * watcher = stmt->__anon1._watch.watcher;
15584
15585 if(watcher)
15586 ProcessExpressionType(watcher);
15587 if(object)
15588 ProcessExpressionType(object);
15589 if(inCompiler)
15590 {
15591 if(watcher || thisClass)
15592 {
15593 struct External * external = curExternal;
15594 struct Context * context = curContext;
15595
15596 stmt->type = 3;
15597 stmt->__anon1.expressions = MkList();
15598 for(propWatch = (*watches).first; propWatch; propWatch = propWatch->next)
15599 {
15600 struct ClassFunction * func;
15601 char watcherName[1024];
15602 struct __ecereNameSpace__ecere__com__Class * watcherClass = watcher ? ((watcher->expType && watcher->expType->kind == 8 && watcher->expType->__anon1._class) ? watcher->expType->__anon1._class->__anon1.registered : (((void *)0))) : thisClass;
15603 struct External * createdExternal;
15604
15605 sprintf(watcherName, "__ecerePropertyWatcher_%d", propWatcherID++);
15606 if(propWatch->deleteWatch)
15607 strcat(watcherName, "_delete");
15608 else
15609 {
15610 struct Identifier * propID;
15611
15612 for(propID = (*propWatch->properties).first; propID; propID = propID->next)
15613 {
15614 strcat(watcherName, "_");
15615 strcat(watcherName, propID->string);
15616 }
15617 }
15618 if(object && object->expType && object->expType->kind == 8 && object->expType->__anon1._class && object->expType->__anon1._class->__anon1.registered)
15619 {
15620 func = MkClassFunction(MkListOne(MkSpecifier(VOID)), (((void *)0)), MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(watcherName)), MkListOne(MkTypeName(MkListOne(MkSpecifierName(object->expType->__anon1._class->string)), MkDeclaratorIdentifier(MkIdentifier("value"))))), (((void *)0)));
15621 ProcessClassFunctionBody(func, propWatch->compound);
15622 propWatch->compound = (((void *)0));
15623 createdExternal = ProcessClassFunction(watcherClass, func, ast, curExternal, 1);
15624 FreeClassFunction(func);
15625 curExternal = createdExternal;
15626 ProcessFunction(createdExternal->__anon1.function);
15627 if(propWatch->deleteWatch)
15628 {
15629 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
15630
15631 ListAdd(args, CopyExpression(object));
15632 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
15633 ListAdd(args, MkExpIdentifier(MkIdentifier(watcherName)));
15634 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_WatchDestruction")), args));
15635 }
15636 else
15637 {
15638 struct __ecereNameSpace__ecere__com__Class * _class = object->expType->__anon1._class->__anon1.registered;
15639 struct Identifier * propID;
15640
15641 for(propID = (*propWatch->properties).first; propID; propID = propID->next)
15642 {
15643 char propName[1024];
15644 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
15645
15646 if(prop)
15647 {
15648 char getName[1024], setName[1024];
15649 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
15650
15651 DeclareProperty(createdExternal, prop, setName, getName);
15652 strcpy(propName, "__ecereProp_");
15653 FullClassNameCat(propName, prop->_class->fullName, 0);
15654 strcat(propName, "_");
15655 FullClassNameCat(propName, prop->name, 1);
15656 ListAdd(args, CopyExpression(object));
15657 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
15658 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
15659 ListAdd(args, MkExpCast(MkTypeName(MkListOne(MkSpecifier(VOID)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), MkExpIdentifier(MkIdentifier(watcherName))));
15660 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_Watch")), args));
15661 __ecereMethod_External_CreateUniqueEdge(external, createdExternal, 1);
15662 }
15663 else
15664 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Property %s not found in class %s\n", (((void *)0))), propID->string, _class->fullName);
15665 }
15666 }
15667 }
15668 else
15669 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Invalid watched object\n", (((void *)0))));
15670 }
15671 curExternal = external;
15672 curContext = context;
15673 if(watcher)
15674 FreeExpression(watcher);
15675 if(object)
15676 FreeExpression(object);
15677 FreeList(watches, (void *)(FreePropertyWatch));
15678 }
15679 else
15680 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "No observer specified and not inside a class\n", (((void *)0))));
15681 }
15682 else
15683 {
15684 for(propWatch = (*watches).first; propWatch; propWatch = propWatch->next)
15685 {
15686 ProcessStatement(propWatch->compound);
15687 }
15688 }
15689 break;
15690 }
15691 case 15:
15692 {
15693 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->__anon1._watch.watches;
15694 struct Expression * object = stmt->__anon1._watch.object;
15695 struct __ecereNameSpace__ecere__com__Class * _class;
15696
15697 if(object)
15698 ProcessExpressionType(object);
15699 if(inCompiler)
15700 {
15701 _class = object ? ((object->expType && object->expType->kind == 8 && object->expType->__anon1._class) ? object->expType->__anon1._class->__anon1.registered : (((void *)0))) : thisClass;
15702 if(_class)
15703 {
15704 struct Identifier * propID;
15705
15706 stmt->type = 3;
15707 stmt->__anon1.expressions = MkList();
15708 if(!watches && curFunction->propSet && (!object || (object->type == 0 && !strcmp(object->__anon1.__anon1.identifier->string, "this"))))
15709 {
15710 watches = MkListOne(MkIdentifier(curFunction->propSet->string));
15711 }
15712 else if(!watches)
15713 {
15714 }
15715 if(watches)
15716 {
15717 for(propID = (*watches).first; propID; propID = propID->next)
15718 {
15719 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
15720
15721 if(prop)
15722 {
15723 CreateFireWatcher(prop, object, stmt);
15724 }
15725 else
15726 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Property %s not found in class %s\n", (((void *)0))), propID->string, _class->fullName);
15727 }
15728 }
15729 else
15730 {
15731 struct __ecereNameSpace__ecere__com__Property * prop;
15732 struct __ecereNameSpace__ecere__com__Class * base;
15733
15734 for(base = _class; base; base = base->base)
15735 {
15736 for(prop = base->membersAndProperties.first; prop; prop = prop->next)
15737 {
15738 if(prop->isProperty && prop->isWatchable)
15739 {
15740 CreateFireWatcher(prop, object, stmt);
15741 }
15742 }
15743 }
15744 }
15745 if(object)
15746 FreeExpression(object);
15747 FreeList(watches, (void *)(FreeIdentifier));
15748 }
15749 else
15750 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Invalid object specified and not inside a class\n", (((void *)0))));
15751 }
15752 break;
15753 }
15754 case 16:
15755 {
15756 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->__anon1._watch.watches;
15757 struct Expression * object = stmt->__anon1._watch.object;
15758 struct Expression * watcher = stmt->__anon1._watch.watcher;
15759 struct __ecereNameSpace__ecere__com__Class * _class;
15760
15761 if(object)
15762 ProcessExpressionType(object);
15763 if(watcher)
15764 ProcessExpressionType(watcher);
15765 if(inCompiler)
15766 {
15767 _class = (object && object->expType && object->expType->kind == 8 && object->expType->__anon1._class) ? object->expType->__anon1._class->__anon1.registered : (((void *)0));
15768 if(watcher || thisClass)
15769 {
15770 if(_class)
15771 {
15772 struct Identifier * propID;
15773
15774 stmt->type = 3;
15775 stmt->__anon1.expressions = MkList();
15776 if(!watches)
15777 {
15778 struct __ecereNameSpace__ecere__sys__OldList * args;
15779
15780 args = MkList();
15781 ListAdd(args, CopyExpression(object));
15782 ListAdd(args, MkExpConstant("0"));
15783 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
15784 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_StopWatching")), args));
15785 }
15786 else
15787 {
15788 for(propID = (*watches).first; propID; propID = propID->next)
15789 {
15790 char propName[1024];
15791 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
15792
15793 if(prop)
15794 {
15795 char getName[1024], setName[1024];
15796 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
15797
15798 DeclareProperty(curExternal, prop, setName, getName);
15799 strcpy(propName, "__ecereProp_");
15800 FullClassNameCat(propName, prop->_class->fullName, 0);
15801 strcat(propName, "_");
15802 FullClassNameCat(propName, prop->name, 1);
15803 ListAdd(args, CopyExpression(object));
15804 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
15805 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
15806 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_StopWatching")), args));
15807 }
15808 else
15809 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Property %s not found in class %s\n", (((void *)0))), propID->string, _class->fullName);
15810 }
15811 }
15812 if(object)
15813 FreeExpression(object);
15814 if(watcher)
15815 FreeExpression(watcher);
15816 FreeList(watches, (void *)(FreeIdentifier));
15817 }
15818 else
15819 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Invalid object specified and not inside a class\n", (((void *)0))));
15820 }
15821 else
15822 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "No observer specified and not inside a class\n", (((void *)0))));
15823 }
15824 break;
15825 }
15826 }
15827 }
15828
15829 void ComputeDataTypes()
15830 {
15831 struct External * external;
15832
15833 currentClass = (((void *)0));
15834 containerClass = __ecereNameSpace__ecere__com__eSystem_FindClass(GetPrivateModule(), "Container");
15835 DeclareStruct((((void *)0)), "ecere::com::Class", 0, 1);
15836 DeclareStruct((((void *)0)), "ecere::com::Instance", 0, 1);
15837 DeclareStruct((((void *)0)), "ecere::com::Property", 0, 1);
15838 DeclareStruct((((void *)0)), "ecere::com::DataMember", 0, 1);
15839 DeclareStruct((((void *)0)), "ecere::com::Method", 0, 1);
15840 DeclareStruct((((void *)0)), "ecere::com::SerialBuffer", 0, 1);
15841 DeclareStruct((((void *)0)), "ecere::com::ClassTemplateArgument", 0, 1);
15842 DeclareFunctionUtil((((void *)0)), "eSystem_New");
15843 DeclareFunctionUtil((((void *)0)), "eSystem_New0");
15844 DeclareFunctionUtil((((void *)0)), "eSystem_Renew");
15845 DeclareFunctionUtil((((void *)0)), "eSystem_Renew0");
15846 DeclareFunctionUtil((((void *)0)), "eSystem_Delete");
15847 DeclareFunctionUtil((((void *)0)), "eClass_GetProperty");
15848 DeclareFunctionUtil((((void *)0)), "eClass_SetProperty");
15849 DeclareFunctionUtil((((void *)0)), "eInstance_FireSelfWatchers");
15850 DeclareFunctionUtil((((void *)0)), "eInstance_SetMethod");
15851 DeclareFunctionUtil((((void *)0)), "eInstance_IncRef");
15852 DeclareFunctionUtil((((void *)0)), "eInstance_StopWatching");
15853 DeclareFunctionUtil((((void *)0)), "eInstance_Watch");
15854 DeclareFunctionUtil((((void *)0)), "eInstance_FireWatchers");
15855 reachedPass15 = 1;
15856 for(external = (*ast).first; external; external = external->next)
15857 {
15858 afterExternal = curExternal = external;
15859 if(external->type == 0)
15860 {
15861 if(memoryGuard)
15862 {
15863 DeclareFunctionUtil(external, "MemoryGuard_PushLoc");
15864 DeclareFunctionUtil(external, "MemoryGuard_PopLoc");
15865 }
15866 currentClass = external->__anon1.function->_class;
15867 ProcessFunction(external->__anon1.function);
15868 }
15869 else if(external->type == 1)
15870 {
15871 if(memoryGuard && external->__anon1.declaration && external->__anon1.declaration->type == 2)
15872 {
15873 DeclareFunctionUtil(external, "MemoryGuard_PushLoc");
15874 DeclareFunctionUtil(external, "MemoryGuard_PopLoc");
15875 }
15876 currentClass = (((void *)0));
15877 if(external->__anon1.declaration)
15878 ProcessDeclaration(external->__anon1.declaration, 1);
15879 }
15880 else if(external->type == 2)
15881 {
15882 struct ClassDefinition * _class = external->__anon1._class;
15883
15884 currentClass = external->symbol->__anon1.registered;
15885 if(memoryGuard)
15886 {
15887 DeclareFunctionUtil(external, "MemoryGuard_PushLoc");
15888 DeclareFunctionUtil(external, "MemoryGuard_PopLoc");
15889 }
15890 if(_class->definitions)
15891 {
15892 ProcessClass(_class->definitions, _class->symbol);
15893 }
15894 if(inCompiler)
15895 {
15896 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*ast), external);
15897 ((external ? __extension__ ({
15898 void * __ecerePtrToDelete = (external);
15899
15900 __ecereClass_External->Destructor ? __ecereClass_External->Destructor((void *)__ecerePtrToDelete) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(__ecerePtrToDelete);
15901 }) : 0), external = 0);
15902 }
15903 }
15904 else if(external->type == 4)
15905 {
15906 thisNameSpace = external->__anon1.id->string;
15907 }
15908 }
15909 currentClass = (((void *)0));
15910 thisNameSpace = (((void *)0));
15911 curExternal = (((void *)0));
15912 }
15913
15914 void ProcessExpressionType(struct Expression * exp)
15915 {
15916 unsigned int unresolved = 0;
15917 struct Location oldyylloc = yylloc;
15918 unsigned int notByReference = 0;
15919
15920 if(!exp || exp->expType)
15921 return ;
15922 yylloc = exp->loc;
15923 switch(exp->type)
15924 {
15925 case 0:
15926 {
15927 struct Identifier * id = exp->__anon1.__anon1.identifier;
15928
15929 if(!id || !topContext)
15930 return ;
15931 if(id->_class && id->_class->__anon1.__anon1.name)
15932 {
15933 id->classSym = id->_class->__anon1.__anon1.symbol;
15934 }
15935 if(!strcmp(id->string, "__runtimePlatform"))
15936 {
15937 exp->expType = ProcessTypeString("ecere::com::Platform", 1);
15938 break;
15939 }
15940 else if(strstr(id->string, "__ecereClass") == id->string)
15941 {
15942 exp->expType = ProcessTypeString("ecere::com::Class", 1);
15943 break;
15944 }
15945 else if(id->_class && (id->classSym || (id->_class->__anon1.__anon1.name && !strcmp(id->_class->__anon1.__anon1.name, "property"))))
15946 {
15947 ReplaceClassMembers(exp, thisClass);
15948 if(exp->type != 0)
15949 {
15950 ProcessExpressionType(exp);
15951 break;
15952 }
15953 if(id->classSym && ResolveIdWithClass(exp, id->classSym->__anon1.registered, 0))
15954 break;
15955 }
15956 else
15957 {
15958 struct Symbol * symbol = (((void *)0));
15959 unsigned int findInGlobal = 0;
15960
15961 if(!topContext->parent && exp->destType && exp->destType->kind == 8 && exp->destType->__anon1._class && exp->destType->__anon1._class->__anon1.registered && exp->destType->__anon1._class->__anon1.registered->type == 4)
15962 findInGlobal = 1;
15963 else
15964 symbol = FindSymbol(id->string, curContext, topContext, 0, id->_class && id->_class->__anon1.__anon1.name == (((void *)0)));
15965 if(!symbol)
15966 {
15967 if(exp->destType && CheckExpressionType(exp, exp->destType, 0, 0))
15968 break;
15969 else
15970 {
15971 if(thisClass)
15972 {
15973 ReplaceClassMembers(exp, thisClass ? thisClass : currentClass);
15974 if(exp->type != 0)
15975 {
15976 ProcessExpressionType(exp);
15977 break;
15978 }
15979 }
15980 else if(currentClass && !id->_class)
15981 {
15982 if(ResolveIdWithClass(exp, currentClass, 1))
15983 break;
15984 }
15985 symbol = FindSymbol(id->string, topContext->parent, globalContext, 0, id->_class && id->_class->__anon1.__anon1.name == (((void *)0)));
15986 }
15987 }
15988 if(findInGlobal)
15989 symbol = FindSymbol(id->string, curContext, topContext, 0, id->_class && id->_class->__anon1.__anon1.name == (((void *)0)));
15990 if(symbol)
15991 {
15992 struct Type * type = symbol->type;
15993 struct __ecereNameSpace__ecere__com__Class * _class = (type && type->kind == 8 && type->__anon1._class) ? type->__anon1._class->__anon1.registered : (((void *)0));
15994
15995 if(_class && !strcmp(id->string, "this") && !type->classObjectType)
15996 {
15997 struct Context * context = SetupTemplatesContext(_class);
15998
15999 type = ReplaceThisClassType(_class);
16000 FinishTemplatesContext(context);
16001 if(type)
16002 type->refCount = 0;
16003 }
16004 FreeSpecifier(id->_class);
16005 id->_class = (((void *)0));
16006 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
16007 id->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
16008 id->classSym = (((void *)0));
16009 exp->expType = type;
16010 if(type)
16011 type->refCount++;
16012 if(type && (type->kind == 15))
16013 exp->isConstant = 1;
16014 if(symbol->isParam || !strcmp(id->string, "this"))
16015 {
16016 if(_class && _class->type == 1 && !type->declaredWithStruct)
16017 exp->byReference = 1;
16018 }
16019 if(symbol->isIterator)
16020 {
16021 if(symbol->isIterator == 3)
16022 {
16023 exp->type = 5;
16024 exp->__anon1.list = MkListOne(MkExpOp((((void *)0)), '*', MkExpIdentifier(exp->__anon1.__anon1.identifier)));
16025 ((struct Expression *)(*exp->__anon1.list).first)->__anon1.op.exp2->expType = exp->expType;
16026 exp->expType = (((void *)0));
16027 ProcessExpressionType(exp);
16028 }
16029 else if(symbol->isIterator != 4)
16030 {
16031 exp->type = 8;
16032 exp->__anon1.member.exp = MkExpIdentifier(exp->__anon1.__anon1.identifier);
16033 exp->__anon1.member.exp->expType = exp->expType;
16034 exp->__anon1.member.member = MkIdentifier("data");
16035 exp->expType = (((void *)0));
16036 ProcessExpressionType(exp);
16037 }
16038 }
16039 break;
16040 }
16041 else
16042 {
16043 struct __ecereNameSpace__ecere__com__DefinedExpression * definedExp = (((void *)0));
16044
16045 if(thisNameSpace && !(id->_class && !id->_class->__anon1.__anon1.name))
16046 {
16047 char name[1024];
16048
16049 strcpy(name, thisNameSpace);
16050 strcat(name, "::");
16051 strcat(name, id->string);
16052 definedExp = __ecereNameSpace__ecere__com__eSystem_FindDefine(privateModule, name);
16053 }
16054 if(!definedExp)
16055 definedExp = __ecereNameSpace__ecere__com__eSystem_FindDefine(privateModule, id->string);
16056 if(definedExp)
16057 {
16058 int c;
16059
16060 for(c = 0; c < definedExpStackPos; c++)
16061 if(definedExpStack[c] == definedExp)
16062 break;
16063 if(c == definedExpStackPos && c < sizeof (definedExpStack) / sizeof(void *))
16064 {
16065 struct Location backupYylloc = yylloc;
16066 struct __ecereNameSpace__ecere__com__Instance * backInput = fileInput;
16067
16068 definedExpStack[definedExpStackPos++] = definedExp;
16069 fileInput = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
16070 (__extension__ ({
16071 int (*  __internal_VirtualMethod)(struct __ecereNameSpace__ecere__com__Instance *, const void *  buffer, unsigned int size, unsigned int count);
16072
16073 __internal_VirtualMethod = ((int (*)(struct __ecereNameSpace__ecere__com__Instance *, const void *  buffer, unsigned int size, unsigned int count))__extension__ ({
16074 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
16075
16076 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
16077 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Write]);
16078 __internal_VirtualMethod ? __internal_VirtualMethod(fileInput, definedExp->value, 1, strlen(definedExp->value)) : (int)1;
16079 }));
16080 (__extension__ ({
16081 unsigned int (*  __internal_VirtualMethod)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode);
16082
16083 __internal_VirtualMethod = ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))__extension__ ({
16084 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
16085
16086 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
16087 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek]);
16088 __internal_VirtualMethod ? __internal_VirtualMethod(fileInput, 0, 0) : (unsigned int)1;
16089 }));
16090 echoOn = 0;
16091 parsedExpression = (((void *)0));
16092 resetScanner();
16093 expression_yyparse();
16094 (__ecereNameSpace__ecere__com__eInstance_DecRef(fileInput), fileInput = 0);
16095 if(backInput)
16096 fileInput = backInput;
16097 yylloc = backupYylloc;
16098 if(parsedExpression)
16099 {
16100 FreeIdentifier(id);
16101 exp->type = 5;
16102 exp->__anon1.list = MkListOne(parsedExpression);
16103 ApplyLocation(parsedExpression, &yylloc);
16104 ProcessExpressionType(exp);
16105 definedExpStackPos--;
16106 return ;
16107 }
16108 definedExpStackPos--;
16109 }
16110 else
16111 {
16112 if(inCompiler)
16113 {
16114 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Recursion in defined expression %s\n", (((void *)0))), id->string);
16115 }
16116 }
16117 }
16118 else
16119 {
16120 struct GlobalData * data = (((void *)0));
16121
16122 if(thisNameSpace && !(id->_class && !id->_class->__anon1.__anon1.name))
16123 {
16124 char name[1024];
16125
16126 strcpy(name, thisNameSpace);
16127 strcat(name, "::");
16128 strcat(name, id->string);
16129 data = FindGlobalData(name);
16130 }
16131 if(!data)
16132 data = FindGlobalData(id->string);
16133 if(data)
16134 {
16135 DeclareGlobalData(curExternal, data);
16136 exp->expType = data->dataType;
16137 if(data->dataType)
16138 data->dataType->refCount++;
16139 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
16140 id->string = __ecereNameSpace__ecere__sys__CopyString(data->fullName);
16141 FreeSpecifier(id->_class);
16142 id->_class = (((void *)0));
16143 break;
16144 }
16145 else
16146 {
16147 struct __ecereNameSpace__ecere__com__GlobalFunction * function = (((void *)0));
16148
16149 if(thisNameSpace && !(id->_class && !id->_class->__anon1.__anon1.name))
16150 {
16151 char name[1024];
16152
16153 strcpy(name, thisNameSpace);
16154 strcat(name, "::");
16155 strcat(name, id->string);
16156 function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, name);
16157 }
16158 if(!function)
16159 function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, id->string);
16160 if(function)
16161 {
16162 char name[1024];
16163
16164 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
16165 id->string = __ecereNameSpace__ecere__sys__CopyString(function->name);
16166 name[0] = 0;
16167 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->importType != 1 && (!function->dataType || !function->dataType->dllExport))
16168 strcpy(name, "__ecereFunction_");
16169 FullClassNameCat(name, id->string, 0);
16170 if(DeclareFunction(curExternal, function, name))
16171 {
16172 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
16173 id->string = __ecereNameSpace__ecere__sys__CopyString(name);
16174 }
16175 exp->expType = function->dataType;
16176 if(function->dataType)
16177 function->dataType->refCount++;
16178 FreeSpecifier(id->_class);
16179 id->_class = (((void *)0));
16180 break;
16181 }
16182 }
16183 }
16184 }
16185 }
16186 unresolved = 1;
16187 break;
16188 }
16189 case 1:
16190 {
16191 if(!exp->__anon1.instance->_class)
16192 {
16193 if(exp->destType && exp->destType->kind == 8 && exp->destType->__anon1._class)
16194 {
16195 exp->__anon1.instance->_class = MkSpecifierName(exp->destType->__anon1._class->string);
16196 }
16197 }
16198 ProcessInstantiationType(exp->__anon1.instance);
16199 exp->isConstant = exp->__anon1.instance->isConstant;
16200 if(exp->__anon1.instance->_class)
16201 {
16202 exp->expType = MkClassType(exp->__anon1.instance->_class->__anon1.__anon1.name);
16203 }
16204 break;
16205 }
16206 case 2:
16207 {
16208 if(!exp->expType)
16209 {
16210 char * constant = exp->__anon1.__anon1.constant;
16211 struct Type * type = (type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), type->refCount = 1, type->constant = 1, type);
16212
16213 exp->expType = type;
16214 if(constant[0] == '\'')
16215 {
16216 if((int)((unsigned char *)constant)[1] > 127)
16217 {
16218 int nb;
16219 unsigned int ch = __ecereNameSpace__ecere__sys__UTF8GetChar(constant + 1, &nb);
16220
16221 if(nb < 2)
16222 ch = constant[1];
16223 (__ecereNameSpace__ecere__com__eSystem_Delete(constant), constant = 0);
16224 exp->__anon1.__anon1.constant = PrintUInt(ch);
16225 type->kind = 8;
16226 type->__anon1._class = FindClass("unichar");
16227 type->isSigned = 0;
16228 }
16229 else
16230 {
16231 type->kind = 1;
16232 type->isSigned = 1;
16233 }
16234 }
16235 else
16236 {
16237 char * dot = strchr(constant, '.');
16238 unsigned int isHex = (constant[0] == '0' && (constant[1] == 'x' || constant[1] == 'X'));
16239 char * exponent;
16240
16241 if(isHex)
16242 {
16243 exponent = strchr(constant, 'p');
16244 if(!exponent)
16245 exponent = strchr(constant, 'P');
16246 }
16247 else
16248 {
16249 exponent = strchr(constant, 'e');
16250 if(!exponent)
16251 exponent = strchr(constant, 'E');
16252 }
16253 if(dot || exponent)
16254 {
16255 if(strchr(constant, 'f') || strchr(constant, 'F'))
16256 type->kind = 6;
16257 else
16258 type->kind = 7;
16259 type->isSigned = 1;
16260 }
16261 else
16262 {
16263 unsigned int isSigned = constant[0] == '-';
16264 char * endP = (((void *)0));
16265 long long i64 = strtoll(constant, &endP, 0);
16266 uint64 ui64 = strtoull(constant, &endP, 0);
16267 unsigned int is64Bit = endP && (!strcmp(endP, "LL") || !strcmp(endP, "ll") || !strcmp(endP, "LLU") || !strcmp(endP, "llu") || !strcmp(endP, "ull") || !strcmp(endP, "ULL"));
16268 unsigned int forceUnsigned = endP && (!strcmp(endP, "U") || !strcmp(endP, "u") || !strcmp(endP, "LLU") || !strcmp(endP, "llu") || !strcmp(endP, "ull") || !strcmp(endP, "ULL"));
16269
16270 if(isSigned)
16271 {
16272 if(i64 < (((int)0x80000000)))
16273 is64Bit = 1;
16274 }
16275 else
16276 {
16277 if(ui64 > (((int)0x7fffffff)))
16278 {
16279 if(ui64 > (0xffffffff))
16280 {
16281 is64Bit = 1;
16282 if(ui64 <= (((long long)0x7fffffffffffffffLL)) && (constant[0] != '0' || !constant[1]))
16283 isSigned = 1;
16284 }
16285 }
16286 else if(constant[0] != '0' || !constant[1])
16287 isSigned = 1;
16288 }
16289 if(forceUnsigned)
16290 isSigned = 0;
16291 type->kind = is64Bit ? 4 : 3;
16292 type->isSigned = isSigned;
16293 }
16294 }
16295 exp->isConstant = 1;
16296 if(exp->destType && exp->destType->kind == 7)
16297 type->kind = 7;
16298 else if(exp->destType && exp->destType->kind == 6)
16299 type->kind = 6;
16300 else if(exp->destType && exp->destType->kind == 4)
16301 type->kind = 4;
16302 }
16303 break;
16304 }
16305 case 3:
16306 {
16307 exp->isConstant = 1;
16308 exp->expType = __extension__ ({
16309 struct Type * __ecereInstance2 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16310
16311 __ecereInstance2->refCount = 1, __ecereInstance2->kind = 13, __ecereInstance2->__anon1.type = __extension__ ({
16312 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16313
16314 __ecereInstance1->refCount = 1, __ecereInstance1->kind = exp->__anon1.__anon2.wideString ? 2 : 1, __ecereInstance1->constant = 1, __ecereInstance1->isSigned = exp->__anon1.__anon2.wideString ? 0 : 1, __ecereInstance1;
16315 }), __ecereInstance2;
16316 });
16317 break;
16318 }
16319 case 13:
16320 case 26:
16321 ProcessExpressionType(exp->__anon1._new.size);
16322 exp->expType = __extension__ ({
16323 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16324
16325 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 13, __ecereInstance1->__anon1.type = ProcessType(exp->__anon1._new.typeName->qualifiers, exp->__anon1._new.typeName->declarator), __ecereInstance1;
16326 });
16327 DeclareType(curExternal, exp->expType->__anon1.type, 1, 0);
16328 break;
16329 case 14:
16330 case 27:
16331 ProcessExpressionType(exp->__anon1._renew.size);
16332 ProcessExpressionType(exp->__anon1._renew.exp);
16333 exp->expType = __extension__ ({
16334 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16335
16336 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 13, __ecereInstance1->__anon1.type = ProcessType(exp->__anon1._renew.typeName->qualifiers, exp->__anon1._renew.typeName->declarator), __ecereInstance1;
16337 });
16338 DeclareType(curExternal, exp->expType->__anon1.type, 1, 0);
16339 break;
16340 case 4:
16341 {
16342 unsigned int assign = 0, boolResult = 0, boolOps = 0;
16343 struct Type * type1 = (((void *)0)), * type2 = (((void *)0));
16344 unsigned int useDestType = 0, useSideType = 0;
16345 struct Location oldyylloc = yylloc;
16346 unsigned int useSideUnit = 0;
16347 struct __ecereNameSpace__ecere__com__Class * destClass = (exp->destType && exp->destType->kind == 8 && exp->destType->__anon1._class) ? exp->destType->__anon1._class->__anon1.registered : (((void *)0));
16348 unsigned int powerOp = 0, relationOp = 0;
16349 struct __ecereNameSpace__ecere__com__Class * c1 = (((void *)0)), * c2 = (((void *)0));
16350 struct Type * dummy = (dummy = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), dummy->count = 1, dummy->refCount = 1, dummy);
16351
16352 switch(exp->__anon1.op.op)
16353 {
16354 case '=':
16355 case MUL_ASSIGN:
16356 case DIV_ASSIGN:
16357 case MOD_ASSIGN:
16358 case ADD_ASSIGN:
16359 case SUB_ASSIGN:
16360 case LEFT_ASSIGN:
16361 case RIGHT_ASSIGN:
16362 case AND_ASSIGN:
16363 case XOR_ASSIGN:
16364 case OR_ASSIGN:
16365 assign = 1;
16366 break;
16367 case '!':
16368 break;
16369 case AND_OP:
16370 case OR_OP:
16371 boolOps = 1;
16372 boolResult = 1;
16373 break;
16374 case EQ_OP:
16375 case '<':
16376 case '>':
16377 case LE_OP:
16378 case GE_OP:
16379 case NE_OP:
16380 boolResult = 1;
16381 useSideType = 1;
16382 relationOp = 1;
16383 break;
16384 case '+':
16385 case '-':
16386 useSideUnit = 1;
16387 useSideType = 1;
16388 useDestType = 1;
16389 break;
16390 case LEFT_OP:
16391 case RIGHT_OP:
16392 break;
16393 case '|':
16394 case '^':
16395 useSideType = 1;
16396 useDestType = 1;
16397 break;
16398 case '/':
16399 case '%':
16400 useSideType = 1;
16401 useDestType = 1;
16402 if(exp->__anon1.op.op == '/')
16403 powerOp = 1;
16404 break;
16405 case '&':
16406 case '*':
16407 if(exp->__anon1.op.exp1)
16408 {
16409 useSideType = 1;
16410 useDestType = 1;
16411 if(exp->__anon1.op.op == '*')
16412 powerOp = 1;
16413 }
16414 break;
16415 }
16416 if(exp->__anon1.op.op == '&')
16417 {
16418 if(!exp->__anon1.op.exp1 && exp->__anon1.op.exp2 && exp->__anon1.op.exp2->type == 0 && exp->__anon1.op.exp2->__anon1.__anon1.identifier)
16419 {
16420 struct Identifier * id = exp->__anon1.op.exp2->__anon1.__anon1.identifier;
16421 struct Symbol * symbol = FindSymbol(id->string, curContext, topContext, 0, id->_class && id->_class->__anon1.__anon1.name == (((void *)0)));
16422
16423 if(symbol && symbol->isIterator == 2)
16424 {
16425 exp->type = 8;
16426 exp->__anon1.member.exp = exp->__anon1.op.exp2;
16427 exp->__anon1.member.member = MkIdentifier("key");
16428 exp->expType = (((void *)0));
16429 exp->__anon1.op.exp2->expType = symbol->type;
16430 symbol->type->refCount++;
16431 ProcessExpressionType(exp);
16432 FreeType(dummy);
16433 break;
16434 }
16435 }
16436 }
16437 if(exp->__anon1.op.exp1)
16438 {
16439 if(exp->__anon1.op.exp2 && useSideUnit && useDestType && destClass && destClass->type == 3 && destClass->base->type != 3)
16440 useDestType = 0;
16441 if(destClass && useDestType && ((destClass->type == 3 && useSideUnit) || destClass->type == 4 || destClass->type == 2))
16442 {
16443 if(exp->__anon1.op.exp1->destType)
16444 FreeType(exp->__anon1.op.exp1->destType);
16445 exp->__anon1.op.exp1->destType = exp->destType;
16446 exp->__anon1.op.exp1->opDestType = 1;
16447 if(exp->destType)
16448 exp->destType->refCount++;
16449 }
16450 else if(!assign)
16451 {
16452 if(exp->__anon1.op.exp1->destType)
16453 FreeType(exp->__anon1.op.exp1->destType);
16454 exp->__anon1.op.exp1->destType = dummy;
16455 dummy->refCount++;
16456 if(powerOp)
16457 exp->__anon1.op.exp1->opDestType = 1;
16458 if(relationOp)
16459 exp->__anon1.op.exp1->usedInComparison = 1;
16460 }
16461 if(exp->__anon1.op.op == '+' || exp->__anon1.op.op == '-')
16462 {
16463 if(exp->opDestType)
16464 exp->__anon1.op.exp1->parentOpDestType = 1;
16465 if(exp->usedInComparison)
16466 exp->__anon1.op.exp1->usedInComparison = 1;
16467 }
16468 if(exp->__anon1.op.exp1->destType && exp->__anon1.op.op != '=')
16469 exp->__anon1.op.exp1->destType->count++;
16470 ProcessExpressionType(exp->__anon1.op.exp1);
16471 if(exp->__anon1.op.exp1->destType && exp->__anon1.op.op != '=')
16472 exp->__anon1.op.exp1->destType->count--;
16473 exp->__anon1.op.exp1->opDestType = 0;
16474 exp->__anon1.op.exp1->usedInComparison = 0;
16475 if(!exp->__anon1.op.exp2 && (exp->__anon1.op.op == INC_OP || exp->__anon1.op.op == DEC_OP) && exp->__anon1.op.exp1->expType && exp->__anon1.op.exp1->expType->kind == 8 && exp->__anon1.op.exp1->expType->__anon1._class && exp->__anon1.op.exp1->expType->__anon1._class->__anon1.registered && exp->__anon1.op.exp1->expType->__anon1._class->__anon1.registered->type == 3)
16476 {
16477 exp->__anon1.op.exp2 = MkExpConstant("1");
16478 exp->__anon1.op.op = exp->__anon1.op.op == INC_OP ? ADD_ASSIGN : SUB_ASSIGN;
16479 assign = 1;
16480 }
16481 if(exp->__anon1.op.exp1->destType == dummy)
16482 {
16483 FreeType(dummy);
16484 exp->__anon1.op.exp1->destType = (((void *)0));
16485 }
16486 if(exp->__anon1.op.exp2)
16487 {
16488 if(!assign && exp->__anon1.op.exp1->expType && (exp->__anon1.op.exp1->expType->kind == 1 || exp->__anon1.op.exp1->expType->kind == 2))
16489 {
16490 struct Type * type = (type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), type->kind = 3, type->isSigned = 1, type->refCount = 1, type->signedBeforePromotion = exp->__anon1.op.exp1->expType->isSigned, type->bitMemberSize = exp->__anon1.op.exp1->expType->bitMemberSize, type->promotedFrom = exp->__anon1.op.exp1->expType->kind, type);
16491
16492 FreeType(exp->__anon1.op.exp1->expType);
16493 exp->__anon1.op.exp1->expType = type;
16494 }
16495 }
16496 type1 = exp->__anon1.op.exp1->expType;
16497 }
16498 if(exp->__anon1.op.exp2)
16499 {
16500 char expString[10240];
16501
16502 expString[0] = '\0';
16503 if(exp->__anon1.op.exp2->type == 1 && !exp->__anon1.op.exp2->__anon1.instance->_class)
16504 {
16505 if(exp->__anon1.op.exp1)
16506 {
16507 exp->__anon1.op.exp2->destType = exp->__anon1.op.exp1->expType;
16508 if(exp->__anon1.op.exp1->expType)
16509 exp->__anon1.op.exp1->expType->refCount++;
16510 }
16511 else
16512 {
16513 exp->__anon1.op.exp2->destType = exp->destType;
16514 if(!exp->__anon1.op.exp1 || (exp->__anon1.op.op != '&' && exp->__anon1.op.op != '^'))
16515 exp->__anon1.op.exp2->opDestType = 1;
16516 if(exp->destType)
16517 exp->destType->refCount++;
16518 }
16519 if(type1)
16520 type1->refCount++;
16521 exp->expType = type1;
16522 }
16523 else if(assign)
16524 {
16525 if(inCompiler)
16526 PrintExpression(exp->__anon1.op.exp2, expString);
16527 if(type1 && type1->kind == 13)
16528 {
16529 if(exp->__anon1.op.op == MUL_ASSIGN || exp->__anon1.op.op == DIV_ASSIGN || exp->__anon1.op.op == MOD_ASSIGN || exp->__anon1.op.op == LEFT_ASSIGN || exp->__anon1.op.op == RIGHT_ASSIGN || exp->__anon1.op.op == AND_ASSIGN || exp->__anon1.op.op == OR_ASSIGN)
16530 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "operator %s illegal on pointer\n", (((void *)0))), exp->__anon1.op.op);
16531 else if(exp->__anon1.op.op == '=')
16532 {
16533 if(exp->__anon1.op.exp2->destType)
16534 FreeType(exp->__anon1.op.exp2->destType);
16535 exp->__anon1.op.exp2->destType = type1;
16536 if(type1)
16537 type1->refCount++;
16538 }
16539 }
16540 else
16541 {
16542 if(exp->__anon1.op.op == MUL_ASSIGN || exp->__anon1.op.op == DIV_ASSIGN || exp->__anon1.op.op == MOD_ASSIGN || exp->__anon1.op.op == LEFT_ASSIGN || exp->__anon1.op.op == RIGHT_ASSIGN)
16543 ;
16544 else
16545 {
16546 if(exp->__anon1.op.exp2->destType)
16547 FreeType(exp->__anon1.op.exp2->destType);
16548 exp->__anon1.op.exp2->destType = type1;
16549 if(type1)
16550 type1->refCount++;
16551 }
16552 }
16553 if(type1)
16554 type1->refCount++;
16555 exp->expType = type1;
16556 }
16557 else if(destClass && ((destClass->type == 3 && useDestType && useSideUnit) || (destClass->type == 4 && useDestType)))
16558 {
16559 if(exp->__anon1.op.exp2->destType)
16560 FreeType(exp->__anon1.op.exp2->destType);
16561 exp->__anon1.op.exp2->destType = exp->destType;
16562 if(exp->__anon1.op.op != '&' && exp->__anon1.op.op != '^')
16563 exp->__anon1.op.exp2->opDestType = 1;
16564 if(exp->destType)
16565 exp->destType->refCount++;
16566 }
16567 else
16568 {
16569 if(exp->__anon1.op.exp2->destType)
16570 FreeType(exp->__anon1.op.exp2->destType);
16571 exp->__anon1.op.exp2->destType = dummy;
16572 dummy->refCount++;
16573 if(powerOp)
16574 exp->__anon1.op.exp2->opDestType = 1;
16575 if(relationOp)
16576 exp->__anon1.op.exp2->usedInComparison = 1;
16577 }
16578 if(type1 && boolResult && useSideType && type1->kind == 8 && type1->__anon1._class && type1->__anon1._class->__anon1.registered && (type1->__anon1._class->__anon1.registered->type == 2 || type1->__anon1._class->__anon1.registered->type == 4))
16579 {
16580 FreeType(exp->__anon1.op.exp2->destType);
16581 exp->__anon1.op.exp2->destType = type1;
16582 type1->refCount++;
16583 }
16584 if(exp->__anon1.op.exp2->destType && exp->__anon1.op.op != '=')
16585 exp->__anon1.op.exp2->destType->count++;
16586 if(exp->__anon1.op.op == SIZEOF)
16587 {
16588 struct Expression * e = exp->__anon1.op.exp2;
16589
16590 while((e->type == 5 || e->type == 32 || e->type == 23) && e->__anon1.list)
16591 {
16592 if(e->type == 5 || e->type == 32 || e->type == 23)
16593 {
16594 if(e->type == 23)
16595 e = (*((struct Statement *)(*e->__anon1.compound->__anon1.compound.statements).last)->__anon1.expressions).last;
16596 else
16597 e = (*e->__anon1.list).last;
16598 }
16599 }
16600 if(e->type == 11 && e->__anon1.cast.exp)
16601 e->__anon1.cast.exp->needCast = 1;
16602 }
16603 if(exp->__anon1.op.op == '+' || exp->__anon1.op.op == '-')
16604 {
16605 if(exp->opDestType)
16606 exp->__anon1.op.exp2->parentOpDestType = 1;
16607 if(exp->usedInComparison)
16608 exp->__anon1.op.exp2->usedInComparison = 1;
16609 }
16610 ProcessExpressionType(exp->__anon1.op.exp2);
16611 exp->__anon1.op.exp2->opDestType = 0;
16612 exp->__anon1.op.exp2->usedInComparison = 0;
16613 if(exp->__anon1.op.exp2->destType && exp->__anon1.op.op != '=')
16614 exp->__anon1.op.exp2->destType->count--;
16615 if(!assign && (exp->__anon1.op.exp1 || exp->__anon1.op.op == '~'))
16616 {
16617 if(exp->__anon1.op.exp2->expType && (exp->__anon1.op.exp2->expType->kind == 1 || exp->__anon1.op.exp2->expType->kind == 2))
16618 {
16619 struct Type * type = (type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), type->kind = 3, type->isSigned = 1, type->refCount = 1, type->signedBeforePromotion = exp->__anon1.op.exp2->expType->isSigned, type->bitMemberSize = exp->__anon1.op.exp2->expType->bitMemberSize, type->promotedFrom = exp->__anon1.op.exp2->expType->kind, type);
16620
16621 FreeType(exp->__anon1.op.exp2->expType);
16622 exp->__anon1.op.exp2->expType = type;
16623 }
16624 }
16625 if(assign && type1 && type1->kind == 13 && exp->__anon1.op.exp2->expType)
16626 {
16627 if(exp->__anon1.op.exp2->expType->kind == 23 || exp->__anon1.op.exp2->expType->kind == 22 || exp->__anon1.op.exp2->expType->kind == 4 || exp->__anon1.op.exp2->expType->kind == 3 || exp->__anon1.op.exp2->expType->kind == 2 || exp->__anon1.op.exp2->expType->kind == 1)
16628 {
16629 if(exp->__anon1.op.op != '=' && type1->__anon1.type->kind == 0)
16630 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "void *: unknown size\n", (((void *)0))));
16631 }
16632 else if(exp->__anon1.op.exp2->expType->kind == 13 || exp->__anon1.op.exp2->expType->kind == 12 || exp->__anon1.op.exp2->expType->kind == 11 || exp->__anon1.op.exp2->expType->kind == 16 || (type1->__anon1.type->kind == 0 && exp->__anon1.op.exp2->expType->kind == 8 && exp->__anon1.op.exp2->expType->__anon1._class->__anon1.registered && (exp->__anon1.op.exp2->expType->__anon1._class->__anon1.registered->type == 0 || exp->__anon1.op.exp2->expType->__anon1._class->__anon1.registered->type == 1 || exp->__anon1.op.exp2->expType->__anon1._class->__anon1.registered->type == 5)))
16633 {
16634 if(exp->__anon1.op.op == ADD_ASSIGN)
16635 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "cannot add two pointers\n", (((void *)0))));
16636 }
16637 else if((exp->__anon1.op.exp2->expType->kind == 8 && type1->kind == 13 && type1->__anon1.type->kind == 8 && type1->__anon1.type->__anon1._class == exp->__anon1.op.exp2->expType->__anon1._class && exp->__anon1.op.exp2->expType->__anon1._class->__anon1.registered && exp->__anon1.op.exp2->expType->__anon1._class->__anon1.registered->type == 1))
16638 {
16639 if(exp->__anon1.op.op == ADD_ASSIGN)
16640 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "cannot add two pointers\n", (((void *)0))));
16641 }
16642 else if(inCompiler)
16643 {
16644 char type1String[1024];
16645 char type2String[1024];
16646
16647 type1String[0] = '\0';
16648 type2String[0] = '\0';
16649 PrintType(exp->__anon1.op.exp2->expType, type1String, 0, 1);
16650 PrintType(type1, type2String, 0, 1);
16651 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
16652 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expression %s (%s); expected %s\n", (((void *)0))), expString, type1String, type2String);
16653 }
16654 }
16655 if(exp->__anon1.op.exp2->destType == dummy)
16656 {
16657 FreeType(dummy);
16658 exp->__anon1.op.exp2->destType = (((void *)0));
16659 }
16660 if(exp->__anon1.op.op == '-' && !exp->__anon1.op.exp1 && exp->__anon1.op.exp2->expType && !exp->__anon1.op.exp2->expType->isSigned)
16661 {
16662 type2 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16663 type2->refCount = 1;
16664 CopyTypeInto(type2, exp->__anon1.op.exp2->expType);
16665 type2->isSigned = 1;
16666 }
16667 else if(exp->__anon1.op.op == '~' && !exp->__anon1.op.exp1 && exp->__anon1.op.exp2->expType && (!exp->__anon1.op.exp2->expType->isSigned || exp->__anon1.op.exp2->expType->kind != 3))
16668 {
16669 type2 = __extension__ ({
16670 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16671
16672 __ecereInstance1->kind = 3, __ecereInstance1;
16673 });
16674 type2->refCount = 1;
16675 type2->isSigned = 1;
16676 }
16677 else
16678 {
16679 type2 = exp->__anon1.op.exp2->expType;
16680 if(type2)
16681 type2->refCount++;
16682 }
16683 }
16684 c1 = type1 && type1->kind == 8 && type1->__anon1._class ? type1->__anon1._class->__anon1.registered : (((void *)0));
16685 c2 = type2 && type2->kind == 8 && type2->__anon1._class ? type2->__anon1._class->__anon1.registered : (((void *)0));
16686 if(relationOp && ((exp->__anon1.op.exp1 && exp->__anon1.op.exp1->ambiguousUnits && (!c2 || c2->type != 3)) || (exp->__anon1.op.exp2 && exp->__anon1.op.exp2->ambiguousUnits && (!c1 || c1->type != 3))))
16687 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "ambiguous units in relational operation\n", (((void *)0))));
16688 if(!relationOp && ((exp->__anon1.op.exp1 && exp->__anon1.op.exp1->ambiguousUnits) || (exp->__anon1.op.exp2 && exp->__anon1.op.exp2->ambiguousUnits)) && (!powerOp || !c1 || c1->type != 3 || !c2 || c2->type != 3 || !RelatedUnits(c1, c2)))
16689 {
16690 if(exp->opDestType || exp->usedInComparison)
16691 exp->ambiguousUnits = 1;
16692 else
16693 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "ambiguous units\n", (((void *)0))));
16694 }
16695 dummy->kind = 0;
16696 if(exp->__anon1.op.op == SIZEOF)
16697 {
16698 exp->expType = __extension__ ({
16699 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16700
16701 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 23, __ecereInstance1;
16702 });
16703 exp->isConstant = 1;
16704 }
16705 else if(exp->__anon1.op.op == '*' && !exp->__anon1.op.exp1)
16706 {
16707 exp->expType = Dereference(type2);
16708 if(type2 && type2->kind == 8)
16709 notByReference = 1;
16710 }
16711 else if(exp->__anon1.op.op == '&' && !exp->__anon1.op.exp1)
16712 exp->expType = Reference(type2);
16713 else if(exp->__anon1.op.op == LEFT_OP || exp->__anon1.op.op == RIGHT_OP)
16714 {
16715 if(exp->__anon1.op.exp1->expType)
16716 {
16717 exp->expType = exp->__anon1.op.exp1->expType;
16718 exp->expType->refCount++;
16719 }
16720 }
16721 else if(!assign)
16722 {
16723 if(c1 && !c1->dataType)
16724 c1->dataType = ProcessTypeString(c1->dataTypeString, 0);
16725 if(c2 && !c2->dataType)
16726 c2->dataType = ProcessTypeString(c2->dataTypeString, 0);
16727 if(boolOps)
16728 {
16729 if(exp->__anon1.op.exp1)
16730 {
16731 if(exp->__anon1.op.exp1->destType)
16732 FreeType(exp->__anon1.op.exp1->destType);
16733 exp->__anon1.op.exp1->destType = MkClassType("bool");
16734 exp->__anon1.op.exp1->destType->truth = 1;
16735 if(!exp->__anon1.op.exp1->expType)
16736 ProcessExpressionType(exp->__anon1.op.exp1);
16737 else
16738 CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0);
16739 FreeType(exp->__anon1.op.exp1->expType);
16740 exp->__anon1.op.exp1->expType = MkClassType("bool");
16741 exp->__anon1.op.exp1->expType->truth = 1;
16742 }
16743 if(exp->__anon1.op.exp2)
16744 {
16745 if(exp->__anon1.op.exp2->destType)
16746 FreeType(exp->__anon1.op.exp2->destType);
16747 exp->__anon1.op.exp2->destType = MkClassType("bool");
16748 exp->__anon1.op.exp2->destType->truth = 1;
16749 if(!exp->__anon1.op.exp2->expType)
16750 ProcessExpressionType(exp->__anon1.op.exp2);
16751 else
16752 CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp2->destType, 0, 0);
16753 FreeType(exp->__anon1.op.exp2->expType);
16754 exp->__anon1.op.exp2->expType = MkClassType("bool");
16755 exp->__anon1.op.exp2->expType->truth = 1;
16756 }
16757 }
16758 else if(powerOp && exp->__anon1.op.exp1 && exp->__anon1.op.exp2 && ((c1 && c1->type == 3) || (c2 && c2->type == 3)))
16759 {
16760 if(c1 && c1->type == 3 && c2 && c2->type == 3)
16761 {
16762 if(c1->dataType->kind == 7)
16763 exp->expType = c1->dataType;
16764 else if(c2->dataType->kind == 7)
16765 exp->expType = c2->dataType;
16766 else if(c1->dataType->kind == 6)
16767 exp->expType = c1->dataType;
16768 else if(c2->dataType->kind == 6)
16769 exp->expType = c2->dataType;
16770 else
16771 exp->expType = c1->dataType;
16772 }
16773 else if((c1 && c1->type == 3) || exp->__anon1.op.op == '/')
16774 exp->expType = type1;
16775 else
16776 exp->expType = type2;
16777 if(exp->expType)
16778 exp->expType->refCount++;
16779 }
16780 else if(exp->__anon1.op.exp1 && exp->__anon1.op.exp2 && ((useSideType) || ((!type1 || type1->kind != 8 || !strcmp(type1->__anon1._class->string, "String")) && (!type2 || type2->kind != 8 || !strcmp(type2->__anon1._class->string, "String")))))
16781 {
16782 if(type1 && type2 && ((type1->kind == 8 && type1->__anon1._class && strcmp(type1->__anon1._class->string, "String")) == (type2->kind == 8 && type2->__anon1._class && strcmp(type2->__anon1._class->string, "String"))))
16783 {
16784 if(exp->__anon1.op.op == '-' && ((c1 && c1->type == 4) || (c2 && c2->type == 4)))
16785 {
16786 struct Type * intType = ProcessTypeString((c1 && c1->dataType->kind == 4) || (c2 && c2->dataType->kind == 4) ? "int64" : "int", 0);
16787
16788 if(exp->__anon1.op.exp1->destType)
16789 FreeType(exp->__anon1.op.exp1->destType);
16790 if(exp->__anon1.op.exp2->destType)
16791 FreeType(exp->__anon1.op.exp2->destType);
16792 exp->__anon1.op.exp1->destType = intType;
16793 exp->__anon1.op.exp2->destType = intType;
16794 intType->refCount++;
16795 }
16796 else
16797 {
16798 if(exp->__anon1.op.exp2->destType)
16799 FreeType(exp->__anon1.op.exp2->destType);
16800 exp->__anon1.op.exp2->destType = type1;
16801 type1->refCount++;
16802 if(exp->__anon1.op.exp1->destType)
16803 FreeType(exp->__anon1.op.exp1->destType);
16804 exp->__anon1.op.exp1->destType = type2;
16805 type2->refCount++;
16806 }
16807 if(!boolResult && !exp->opDestType && (!exp->destType || exp->destType->kind != 8) && c1 && c1->type == 3 && c2 && c2->type == 3 && c1 != c2)
16808 {
16809 if(exp->usedInComparison || exp->parentOpDestType)
16810 exp->ambiguousUnits = 1;
16811 else
16812 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "operating on %s and %s with an untyped result, assuming %s\n", (((void *)0))), type1->__anon1._class->string, type2->__anon1._class->string, type1->__anon1._class->string);
16813 }
16814 if(type1->kind == 13 && type1->__anon1.type->kind == 20 && type2->kind != 13)
16815 {
16816 struct Expression * argExp = GetTemplateArgExp(type1->__anon1.type->__anon1.templateParameter, thisClass, 1);
16817
16818 if(argExp)
16819 {
16820 struct Expression * classExp = MkExpMember(argExp, MkIdentifier("dataTypeClass"));
16821
16822 exp->__anon1.op.exp1 = MkExpBrackets(MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName("byte")), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), exp->__anon1.op.exp1)));
16823 ProcessExpressionType(exp->__anon1.op.exp1);
16824 if(type2->kind != 13)
16825 {
16826 ProcessExpressionType(classExp);
16827 exp->__anon1.op.exp2 = MkExpBrackets(MkListOne(MkExpOp(exp->__anon1.op.exp2, '*', MkExpMember(classExp, MkIdentifier("typeSize")))));
16828 if(!exp->__anon1.op.exp2->expType)
16829 {
16830 if(type2)
16831 FreeType(type2);
16832 type2 = exp->__anon1.op.exp2->expType = ProcessTypeString("int", 0);
16833 c2 = (((void *)0));
16834 type2->refCount++;
16835 }
16836 ProcessExpressionType(exp->__anon1.op.exp2);
16837 }
16838 }
16839 }
16840 if(!boolResult && ((type1->kind == 13 || type1->kind == 12 || (type1->kind == 8 && !strcmp(type1->__anon1._class->string, "String"))) && (type2->kind == 23 || type2->kind == 22 || type2->kind == 4 || type2->kind == 3 || type2->kind == 2 || type2->kind == 1)))
16841 {
16842 if(type1->kind != 8 && type1->__anon1.type->kind == 0)
16843 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "void *: unknown size\n", (((void *)0))));
16844 exp->expType = type1;
16845 if(type1)
16846 type1->refCount++;
16847 }
16848 else if(!boolResult && ((type2->kind == 13 || type2->kind == 12 || (type2->kind == 8 && !strcmp(type2->__anon1._class->string, "String"))) && (type1->kind == 23 || type1->kind == 22 || type1->kind == 4 || type1->kind == 3 || type1->kind == 2 || type1->kind == 1)))
16849 {
16850 if(type2->kind != 8 && type2->__anon1.type->kind == 0)
16851 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "void *: unknown size\n", (((void *)0))));
16852 exp->expType = type2;
16853 if(type2)
16854 type2->refCount++;
16855 }
16856 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))
16857 {
16858 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "different levels of indirection\n", (((void *)0))));
16859 }
16860 else
16861 {
16862 unsigned int success = 0;
16863
16864 if(type1->kind == 13 && type2->kind == 13)
16865 {
16866 if(exp->__anon1.op.op == '+')
16867 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "cannot add two pointers\n", (((void *)0))));
16868 else if(exp->__anon1.op.op == '-')
16869 {
16870 if(MatchTypes(type1->__anon1.type, type2->__anon1.type, (((void *)0)), (((void *)0)), (((void *)0)), 0, 0, 0, 0, 0))
16871 {
16872 exp->expType = __extension__ ({
16873 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16874
16875 __ecereInstance1->kind = 3, __ecereInstance1->refCount = 1, __ecereInstance1;
16876 });
16877 success = 1;
16878 if(type1->__anon1.type->kind == 20)
16879 {
16880 struct Expression * argExp = GetTemplateArgExp(type1->__anon1.type->__anon1.templateParameter, thisClass, 1);
16881
16882 if(argExp)
16883 {
16884 struct Expression * classExp = MkExpMember(argExp, MkIdentifier("dataTypeClass"));
16885
16886 ProcessExpressionType(classExp);
16887 exp->type = 5;
16888 exp->__anon1.list = MkListOne(MkExpOp(MkExpBrackets(MkListOne(MkExpOp(MkExpCast(MkTypeName(MkListOne(MkSpecifierName("byte")), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), MkExpBrackets(MkListOne(exp->__anon1.op.exp1))), exp->__anon1.op.op, MkExpCast(MkTypeName(MkListOne(MkSpecifierName("byte")), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), MkExpBrackets(MkListOne(exp->__anon1.op.exp2)))))), '/', MkExpMember(classExp, MkIdentifier("typeSize"))));
16889 ProcessExpressionType(((struct Expression *)(*exp->__anon1.list).first)->__anon1.op.exp2);
16890 FreeType(dummy);
16891 return ;
16892 }
16893 }
16894 }
16895 }
16896 }
16897 if(!success && exp->__anon1.op.exp1->type == 2)
16898 {
16899 if(CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0))
16900 {
16901 if(exp->expType)
16902 FreeType(exp->expType);
16903 exp->expType = exp->__anon1.op.exp1->destType;
16904 if(exp->__anon1.op.exp1->destType)
16905 exp->__anon1.op.exp1->destType->refCount++;
16906 success = 1;
16907 }
16908 else if(CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp2->destType, 0, 0))
16909 {
16910 if(exp->expType)
16911 FreeType(exp->expType);
16912 exp->expType = exp->__anon1.op.exp2->destType;
16913 if(exp->__anon1.op.exp2->destType)
16914 exp->__anon1.op.exp2->destType->refCount++;
16915 success = 1;
16916 }
16917 }
16918 else if(!success)
16919 {
16920 if(CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp2->destType, 0, 0))
16921 {
16922 if(exp->expType)
16923 FreeType(exp->expType);
16924 exp->expType = exp->__anon1.op.exp2->destType;
16925 if(exp->__anon1.op.exp2->destType)
16926 exp->__anon1.op.exp2->destType->refCount++;
16927 success = 1;
16928 }
16929 else if(CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0))
16930 {
16931 if(exp->expType)
16932 FreeType(exp->expType);
16933 exp->expType = exp->__anon1.op.exp1->destType;
16934 if(exp->__anon1.op.exp1->destType)
16935 exp->__anon1.op.exp1->destType->refCount++;
16936 success = 1;
16937 }
16938 }
16939 if(!success)
16940 {
16941 char expString1[10240];
16942 char expString2[10240];
16943 char type1[1024];
16944 char type2[1024];
16945
16946 expString1[0] = '\0';
16947 expString2[0] = '\0';
16948 type1[0] = '\0';
16949 type2[0] = '\0';
16950 if(inCompiler)
16951 {
16952 PrintExpression(exp->__anon1.op.exp1, expString1);
16953 __ecereNameSpace__ecere__sys__ChangeCh(expString1, '\n', ' ');
16954 PrintExpression(exp->__anon1.op.exp2, expString2);
16955 __ecereNameSpace__ecere__sys__ChangeCh(expString2, '\n', ' ');
16956 PrintType(exp->__anon1.op.exp1->expType, type1, 0, 1);
16957 PrintType(exp->__anon1.op.exp2->expType, type2, 0, 1);
16958 }
16959 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expressions %s (%s) and %s (%s)\n", (((void *)0))), expString1, type1, expString2, type2);
16960 }
16961 }
16962 }
16963 else if(!boolResult && !useSideUnit && c2 && c2->type == 3 && type1 && type1->kind != 8)
16964 {
16965 if(exp->__anon1.op.exp1->destType)
16966 FreeType(exp->__anon1.op.exp1->destType);
16967 exp->__anon1.op.exp1->destType = type2->__anon1._class->__anon1.registered->dataType;
16968 if(type2->__anon1._class->__anon1.registered->dataType)
16969 type2->__anon1._class->__anon1.registered->dataType->refCount++;
16970 CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0);
16971 exp->expType = type2;
16972 if(type2)
16973 type2->refCount++;
16974 }
16975 else if(!boolResult && !useSideUnit && c1 && c1->type == 3 && type2 && type2->kind != 8)
16976 {
16977 if(exp->__anon1.op.exp2->destType)
16978 FreeType(exp->__anon1.op.exp2->destType);
16979 exp->__anon1.op.exp2->destType = type1->__anon1._class->__anon1.registered->dataType;
16980 if(type1->__anon1._class->__anon1.registered->dataType)
16981 type1->__anon1._class->__anon1.registered->dataType->refCount++;
16982 CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp2->destType, 0, 0);
16983 exp->expType = type1;
16984 if(type1)
16985 type1->refCount++;
16986 }
16987 else if(type1)
16988 {
16989 unsigned int valid = 0;
16990
16991 if(!boolResult && useSideUnit && c1 && c1->type == 3 && type2 && type2->kind != 8)
16992 {
16993 if(exp->__anon1.op.exp2->destType)
16994 FreeType(exp->__anon1.op.exp2->destType);
16995 exp->__anon1.op.exp2->destType = c1->dataType;
16996 exp->__anon1.op.exp2->destType->refCount++;
16997 CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp2->destType, 0, 0);
16998 if(type2)
16999 FreeType(type2);
17000 type2 = exp->__anon1.op.exp2->destType;
17001 c2 = type2 && type2->kind == 8 && type2->__anon1._class ? type2->__anon1._class->__anon1.registered : (((void *)0));
17002 if(type2)
17003 type2->refCount++;
17004 exp->expType = type2;
17005 type2->refCount++;
17006 }
17007 if(!boolResult && useSideUnit && c2 && c2->type == 3 && type1 && type1->kind != 8)
17008 {
17009 if(exp->__anon1.op.exp1->destType)
17010 FreeType(exp->__anon1.op.exp1->destType);
17011 exp->__anon1.op.exp1->destType = c2->dataType;
17012 exp->__anon1.op.exp1->destType->refCount++;
17013 CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0);
17014 type1 = exp->__anon1.op.exp1->destType;
17015 c1 = type1 && type1->kind == 8 && type1->__anon1._class ? type1->__anon1._class->__anon1.registered : (((void *)0));
17016 exp->expType = type1;
17017 type1->refCount++;
17018 }
17019 if(!boolResult || exp->__anon1.op.op == '>' || exp->__anon1.op.op == '<' || exp->__anon1.op.op == GE_OP || exp->__anon1.op.op == LE_OP)
17020 {
17021 unsigned int op1IsEnum = c1 && c1->type == 4;
17022 unsigned int op2IsEnum = c2 && c2->type == 4;
17023
17024 if(exp->__anon1.op.op == '*' || exp->__anon1.op.op == '/' || exp->__anon1.op.op == '-' || exp->__anon1.op.op == '|' || exp->__anon1.op.op == '^')
17025 {
17026 if(op1IsEnum && exp->__anon1.op.exp2->expType)
17027 {
17028 if(CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp2->expType, 0, 0))
17029 {
17030 if(exp->expType)
17031 FreeType(exp->expType);
17032 exp->expType = exp->__anon1.op.exp2->expType;
17033 if(exp->__anon1.op.exp2->expType)
17034 exp->__anon1.op.exp2->expType->refCount++;
17035 valid = 1;
17036 }
17037 }
17038 else if(op2IsEnum && exp->__anon1.op.exp1->expType)
17039 {
17040 if(CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp1->expType, 0, 0))
17041 {
17042 if(exp->expType)
17043 FreeType(exp->expType);
17044 exp->expType = exp->__anon1.op.exp1->expType;
17045 if(exp->__anon1.op.exp1->expType)
17046 exp->__anon1.op.exp1->expType->refCount++;
17047 valid = 1;
17048 }
17049 }
17050 }
17051 else
17052 {
17053 if(op1IsEnum && exp->__anon1.op.exp2->expType)
17054 {
17055 if(CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp2->expType, 0, 0))
17056 {
17057 if(exp->expType)
17058 FreeType(exp->expType);
17059 exp->expType = exp->__anon1.op.exp1->expType;
17060 if(exp->__anon1.op.exp1->expType)
17061 exp->__anon1.op.exp1->expType->refCount++;
17062 valid = 1;
17063 }
17064 }
17065 else if(op2IsEnum && exp->__anon1.op.exp1->expType)
17066 {
17067 if(CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp1->expType, 0, 0))
17068 {
17069 if(exp->expType)
17070 FreeType(exp->expType);
17071 exp->expType = exp->__anon1.op.exp2->expType;
17072 if(exp->__anon1.op.exp2->expType)
17073 exp->__anon1.op.exp2->expType->refCount++;
17074 valid = 1;
17075 }
17076 }
17077 }
17078 }
17079 if(!valid)
17080 {
17081 if(c2 && c2->type == 3 && (!c1 || c1->type != 3))
17082 {
17083 if(exp->__anon1.op.exp1->destType)
17084 FreeType(exp->__anon1.op.exp1->destType);
17085 exp->__anon1.op.exp1->destType = type2;
17086 type2->refCount++;
17087 if(CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0))
17088 {
17089 if(exp->expType)
17090 FreeType(exp->expType);
17091 exp->expType = exp->__anon1.op.exp1->destType;
17092 if(exp->__anon1.op.exp1->destType)
17093 exp->__anon1.op.exp1->destType->refCount++;
17094 }
17095 }
17096 else
17097 {
17098 if(exp->__anon1.op.exp2->destType)
17099 FreeType(exp->__anon1.op.exp2->destType);
17100 exp->__anon1.op.exp2->destType = type1;
17101 type1->refCount++;
17102 if(CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp2->destType, 0, 0))
17103 {
17104 if(exp->expType)
17105 FreeType(exp->expType);
17106 exp->expType = exp->__anon1.op.exp2->destType;
17107 if(exp->__anon1.op.exp2->destType)
17108 exp->__anon1.op.exp2->destType->refCount++;
17109 }
17110 else if(type1 && type2)
17111 {
17112 char expString1[10240];
17113 char expString2[10240];
17114 char type1String[1024];
17115 char type2String[1024];
17116
17117 expString1[0] = '\0';
17118 expString2[0] = '\0';
17119 type1String[0] = '\0';
17120 type2String[0] = '\0';
17121 if(inCompiler)
17122 {
17123 PrintExpression(exp->__anon1.op.exp1, expString1);
17124 __ecereNameSpace__ecere__sys__ChangeCh(expString1, '\n', ' ');
17125 PrintExpression(exp->__anon1.op.exp2, expString2);
17126 __ecereNameSpace__ecere__sys__ChangeCh(expString2, '\n', ' ');
17127 PrintType(exp->__anon1.op.exp1->expType, type1String, 0, 1);
17128 PrintType(exp->__anon1.op.exp2->expType, type2String, 0, 1);
17129 }
17130 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expressions %s (%s) and %s (%s)\n", (((void *)0))), expString1, type1String, expString2, type2String);
17131 if(c1 && c1->type == 4)
17132 {
17133 exp->expType = exp->__anon1.op.exp1->expType;
17134 if(exp->__anon1.op.exp1->expType)
17135 exp->__anon1.op.exp1->expType->refCount++;
17136 }
17137 else if(c2 && c2->type == 4)
17138 {
17139 exp->expType = exp->__anon1.op.exp2->expType;
17140 if(exp->__anon1.op.exp2->expType)
17141 exp->__anon1.op.exp2->expType->refCount++;
17142 }
17143 }
17144 }
17145 }
17146 }
17147 else if(type2)
17148 {
17149 if(c2 && c2->type == 4)
17150 {
17151 struct Type * oldType = exp->__anon1.op.exp1->expType;
17152
17153 exp->__anon1.op.exp1->expType = (((void *)0));
17154 if(CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0))
17155 FreeType(oldType);
17156 else
17157 exp->__anon1.op.exp1->expType = oldType;
17158 }
17159 if(exp->__anon1.op.exp1->destType)
17160 FreeType(exp->__anon1.op.exp1->destType);
17161 exp->__anon1.op.exp1->destType = type2;
17162 type2->refCount++;
17163 if(CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0))
17164 {
17165 if(exp->expType)
17166 FreeType(exp->expType);
17167 exp->expType = exp->__anon1.op.exp1->destType;
17168 if(exp->__anon1.op.exp1->destType)
17169 exp->__anon1.op.exp1->destType->refCount++;
17170 }
17171 }
17172 }
17173 else if(type2 && (!type1 || (type2->kind == 8 && type1->kind != 8)))
17174 {
17175 if(type1 && c2 && c2->type == 3)
17176 {
17177 if(exp->__anon1.op.exp1->destType)
17178 FreeType(exp->__anon1.op.exp1->destType);
17179 exp->__anon1.op.exp1->destType = type2->__anon1._class->__anon1.registered->dataType;
17180 if(type2->__anon1._class->__anon1.registered->dataType)
17181 type2->__anon1._class->__anon1.registered->dataType->refCount++;
17182 CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0);
17183 }
17184 if(exp->__anon1.op.op == '!')
17185 {
17186 exp->expType = MkClassType("bool");
17187 exp->expType->truth = 1;
17188 }
17189 else
17190 {
17191 exp->expType = type2;
17192 if(type2)
17193 type2->refCount++;
17194 }
17195 }
17196 else if(type1 && (!type2 || (type1->kind == 8 && type2->kind != 8)))
17197 {
17198 if(c2 && c2->type == 3)
17199 {
17200 if(exp->__anon1.op.exp2->destType)
17201 FreeType(exp->__anon1.op.exp2->destType);
17202 exp->__anon1.op.exp2->destType = type1->__anon1._class->__anon1.registered->dataType;
17203 if(type1->__anon1._class->__anon1.registered->dataType)
17204 type1->__anon1._class->__anon1.registered->dataType->refCount++;
17205 CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp2->destType, 0, 0);
17206 }
17207 exp->expType = type1;
17208 if(type1)
17209 type1->refCount++;
17210 }
17211 }
17212 yylloc = exp->loc;
17213 if(exp->__anon1.op.exp1 && !exp->__anon1.op.exp1->expType)
17214 {
17215 char expString[10000];
17216
17217 expString[0] = '\0';
17218 if(inCompiler)
17219 {
17220 PrintExpression(exp->__anon1.op.exp1, expString);
17221 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
17222 }
17223 if(expString[0])
17224 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s\n", (((void *)0))), expString);
17225 }
17226 if(exp->__anon1.op.exp2 && !exp->__anon1.op.exp2->expType)
17227 {
17228 char expString[10240];
17229
17230 expString[0] = '\0';
17231 if(inCompiler)
17232 {
17233 PrintExpression(exp->__anon1.op.exp2, expString);
17234 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
17235 }
17236 if(expString[0])
17237 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s\n", (((void *)0))), expString);
17238 }
17239 if(boolResult)
17240 {
17241 FreeType(exp->expType);
17242 exp->expType = MkClassType("bool");
17243 exp->expType->truth = 1;
17244 }
17245 if(exp->__anon1.op.op != SIZEOF)
17246 exp->isConstant = (!exp->__anon1.op.exp1 || exp->__anon1.op.exp1->isConstant) && (!exp->__anon1.op.exp2 || exp->__anon1.op.exp2->isConstant);
17247 if(exp->__anon1.op.op == SIZEOF && exp->__anon1.op.exp2->expType)
17248 {
17249 DeclareType(curExternal, exp->__anon1.op.exp2->expType, 1, 0);
17250 }
17251 if(exp->__anon1.op.op == DELETE && exp->__anon1.op.exp2 && exp->__anon1.op.exp2->expType && __ecereProp_Type_Get_specConst(exp->__anon1.op.exp2->expType))
17252 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "deleting const qualified object\n", (((void *)0))));
17253 yylloc = oldyylloc;
17254 FreeType(dummy);
17255 if(type2)
17256 FreeType(type2);
17257 break;
17258 }
17259 case 5:
17260 case 32:
17261 {
17262 struct Expression * e;
17263
17264 exp->isConstant = 1;
17265 for(e = (*exp->__anon1.list).first; e; e = e->next)
17266 {
17267 if(!e->next)
17268 {
17269 FreeType(e->destType);
17270 e->opDestType = exp->opDestType;
17271 e->usedInComparison = exp->usedInComparison;
17272 e->parentOpDestType = exp->parentOpDestType;
17273 e->destType = exp->destType;
17274 if(e->destType)
17275 {
17276 exp->destType->refCount++;
17277 }
17278 }
17279 ProcessExpressionType(e);
17280 if(e->ambiguousUnits)
17281 exp->ambiguousUnits = 1;
17282 if(!exp->expType && !e->next)
17283 {
17284 exp->expType = e->expType;
17285 if(e->expType)
17286 e->expType->refCount++;
17287 exp->needCast = e->needCast;
17288 }
17289 if(!e->isConstant)
17290 exp->isConstant = 0;
17291 }
17292 e = (*exp->__anon1.list).first;
17293 if(!e->next && e->type == 8)
17294 {
17295 struct Expression * next = exp->next, * prev = exp->prev;
17296
17297 FreeType(exp->expType);
17298 FreeType(exp->destType);
17299 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->__anon1.list), exp->__anon1.list = 0);
17300 *exp = *e;
17301 exp->prev = prev;
17302 exp->next = next;
17303 ((e ? __extension__ ({
17304 void * __ecerePtrToDelete = (e);
17305
17306 __ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)__ecerePtrToDelete) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(__ecerePtrToDelete);
17307 }) : 0), e = 0);
17308 ProcessExpressionType(exp);
17309 }
17310 break;
17311 }
17312 case 6:
17313 {
17314 struct Expression * e;
17315
17316 exp->isConstant = 1;
17317 ProcessExpressionType(exp->__anon1.index.exp);
17318 if(!exp->__anon1.index.exp->isConstant)
17319 exp->isConstant = 0;
17320 if(exp->__anon1.index.exp->expType)
17321 {
17322 struct Type * source = exp->__anon1.index.exp->expType;
17323
17324 if(source->kind == 8 && source->__anon1._class && source->__anon1._class->__anon1.registered)
17325 {
17326 struct __ecereNameSpace__ecere__com__Class * _class = source->__anon1._class->__anon1.registered;
17327 struct __ecereNameSpace__ecere__com__Class * c = _class->templateClass ? _class->templateClass : _class;
17328
17329 if(_class != containerClass && __ecereNameSpace__ecere__com__eClass_IsDerived(c, containerClass) && _class->templateArgs)
17330 {
17331 exp->expType = ProcessTypeString(_class->templateArgs[2].__anon1.__anon1.dataTypeString, 0);
17332 if(exp->__anon1.index.index && (*exp->__anon1.index.index).last)
17333 {
17334 struct Type * type = ProcessTypeString(_class->templateArgs[1].__anon1.__anon1.dataTypeString, 0);
17335
17336 if(type->kind == 8)
17337 type->constant = 1;
17338 else if(type->kind == 13)
17339 {
17340 struct Type * t = type;
17341
17342 while(t->kind == 13)
17343 t = t->__anon1.type;
17344 t->constant = 1;
17345 }
17346 ((struct Expression *)(*exp->__anon1.index.index).last)->destType = type;
17347 }
17348 }
17349 }
17350 }
17351 for(e = (*exp->__anon1.index.index).first; e; e = e->next)
17352 {
17353 if(!e->next && exp->__anon1.index.exp->expType && exp->__anon1.index.exp->expType->kind == 12 && exp->__anon1.index.exp->expType->__anon1.__anon4.enumClass)
17354 {
17355 if(e->destType)
17356 FreeType(e->destType);
17357 e->destType = MkClassType(exp->__anon1.index.exp->expType->__anon1.__anon4.enumClass->string);
17358 }
17359 ProcessExpressionType(e);
17360 if(!e->next)
17361 {
17362 }
17363 if(!e->isConstant)
17364 exp->isConstant = 0;
17365 }
17366 if(!exp->expType)
17367 exp->expType = Dereference(exp->__anon1.index.exp->expType);
17368 if(exp->expType)
17369 DeclareType(curExternal, exp->expType, 1, 0);
17370 break;
17371 }
17372 case 7:
17373 {
17374 struct Expression * e;
17375 struct Type * functionType;
17376 struct Type * methodType = (((void *)0));
17377 char name[1024];
17378
17379 name[0] = '\0';
17380 if(inCompiler)
17381 {
17382 PrintExpression(exp->__anon1.call.exp, name);
17383 if(exp->__anon1.call.exp->expType && !exp->__anon1.call.exp->expType->__anon1.__anon2.returnType)
17384 {
17385 PrintExpression(exp->__anon1.call.exp, name);
17386 }
17387 }
17388 if(exp->__anon1.call.exp->type == 0)
17389 {
17390 struct Expression * idExp = exp->__anon1.call.exp;
17391 struct Identifier * id = idExp->__anon1.__anon1.identifier;
17392
17393 if(!strcmp(id->string, "__builtin_frame_address"))
17394 {
17395 exp->expType = ProcessTypeString("void *", 1);
17396 if(exp->__anon1.call.arguments && (*exp->__anon1.call.arguments).first)
17397 ProcessExpressionType((*exp->__anon1.call.arguments).first);
17398 break;
17399 }
17400 else if(!strcmp(id->string, "__ENDIAN_PAD"))
17401 {
17402 exp->expType = ProcessTypeString("int", 1);
17403 if(exp->__anon1.call.arguments && (*exp->__anon1.call.arguments).first)
17404 ProcessExpressionType((*exp->__anon1.call.arguments).first);
17405 break;
17406 }
17407 else if(!strcmp(id->string, "Max") || !strcmp(id->string, "Min") || !strcmp(id->string, "Sgn") || !strcmp(id->string, "Abs"))
17408 {
17409 struct Expression * a = (((void *)0));
17410 struct Expression * b = (((void *)0));
17411 struct Expression * tempExp1 = (((void *)0)), * tempExp2 = (((void *)0));
17412
17413 if((!strcmp(id->string, "Max") || !strcmp(id->string, "Min")) && (*exp->__anon1.call.arguments).count == 2)
17414 {
17415 a = (*exp->__anon1.call.arguments).first;
17416 b = (*exp->__anon1.call.arguments).last;
17417 tempExp1 = a;
17418 tempExp2 = b;
17419 }
17420 else if((*exp->__anon1.call.arguments).count == 1)
17421 {
17422 a = (*exp->__anon1.call.arguments).first;
17423 tempExp1 = a;
17424 }
17425 if(a)
17426 {
17427 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear((&*exp->__anon1.call.arguments));
17428 idExp->__anon1.__anon1.identifier = (((void *)0));
17429 FreeExpContents(exp);
17430 ProcessExpressionType(a);
17431 if(b)
17432 ProcessExpressionType(b);
17433 exp->type = 5;
17434 exp->__anon1.list = MkList();
17435 if(a->expType && (!b || b->expType))
17436 {
17437 if((!a->isConstant && a->type != 0) || (b && !b->isConstant && b->type != 0))
17438 {
17439 if(inCompiler)
17440 {
17441 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
17442 struct __ecereNameSpace__ecere__sys__OldList * decls = MkList();
17443 struct Declaration * decl;
17444 char temp1[1024], temp2[1024];
17445
17446 GetTypeSpecs(a->expType, specs);
17447 if(a && !a->isConstant && a->type != 0)
17448 {
17449 sprintf(temp1, "__simpleStruct%d", curContext->simpleID++);
17450 ListAdd(decls, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(temp1)), (((void *)0))));
17451 tempExp1 = QMkExpId(temp1);
17452 tempExp1->expType = a->expType;
17453 if(a->expType)
17454 a->expType->refCount++;
17455 ListAdd(exp->__anon1.list, MkExpOp(CopyExpression(tempExp1), '=', a));
17456 }
17457 if(b && !b->isConstant && b->type != 0)
17458 {
17459 sprintf(temp2, "__simpleStruct%d", curContext->simpleID++);
17460 ListAdd(decls, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(temp2)), (((void *)0))));
17461 tempExp2 = QMkExpId(temp2);
17462 tempExp2->expType = b->expType;
17463 if(b->expType)
17464 b->expType->refCount++;
17465 ListAdd(exp->__anon1.list, MkExpOp(CopyExpression(tempExp2), '=', b));
17466 }
17467 decl = MkDeclaration(specs, decls);
17468 if(!curCompound->__anon1.compound.declarations)
17469 curCompound->__anon1.compound.declarations = MkList();
17470 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*curCompound->__anon1.compound.declarations), (((void *)0)), decl);
17471 }
17472 }
17473 }
17474 if(!strcmp(id->string, "Max") || !strcmp(id->string, "Min"))
17475 {
17476 int op = (!strcmp(id->string, "Max")) ? '>' : '<';
17477
17478 ListAdd(exp->__anon1.list, MkExpCondition(MkExpBrackets(MkListOne(MkExpOp(CopyExpression(tempExp1), op, CopyExpression(tempExp2)))), MkListOne(CopyExpression(tempExp1)), CopyExpression(tempExp2)));
17479 exp->expType = a->expType;
17480 if(a->expType)
17481 a->expType->refCount++;
17482 }
17483 else if(!strcmp(id->string, "Abs"))
17484 {
17485 ListAdd(exp->__anon1.list, MkExpCondition(MkExpBrackets(MkListOne(MkExpOp(CopyExpression(tempExp1), '<', MkExpConstant("0")))), MkListOne(MkExpOp((((void *)0)), '-', CopyExpression(tempExp1))), CopyExpression(tempExp1)));
17486 exp->expType = a->expType;
17487 if(a->expType)
17488 a->expType->refCount++;
17489 }
17490 else if(!strcmp(id->string, "Sgn"))
17491 {
17492 ListAdd(exp->__anon1.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"))))));
17493 exp->expType = ProcessTypeString("int", 0);
17494 }
17495 FreeExpression(tempExp1);
17496 if(tempExp2)
17497 FreeExpression(tempExp2);
17498 FreeIdentifier(id);
17499 break;
17500 }
17501 }
17502 }
17503 {
17504 struct Type * dummy = (dummy = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), dummy->count = 1, dummy->refCount = 1, dummy);
17505
17506 if(!exp->__anon1.call.exp->destType)
17507 {
17508 exp->__anon1.call.exp->destType = dummy;
17509 dummy->refCount++;
17510 }
17511 ProcessExpressionType(exp->__anon1.call.exp);
17512 if(exp->__anon1.call.exp->destType == dummy)
17513 {
17514 FreeType(dummy);
17515 exp->__anon1.call.exp->destType = (((void *)0));
17516 }
17517 FreeType(dummy);
17518 }
17519 functionType = exp->__anon1.call.exp->expType;
17520 if(functionType && functionType->kind == 16)
17521 {
17522 methodType = functionType;
17523 functionType = methodType->__anon1.__anon3.method->dataType;
17524 if(exp->__anon1.call.exp->expType->__anon1.__anon3.usedClass)
17525 {
17526 char typeString[1024];
17527
17528 typeString[0] = '\0';
17529 {
17530 struct Symbol * back = functionType->__anon1.__anon2.thisClass;
17531
17532 functionType->__anon1.__anon2.thisClass = (((void *)0));
17533 PrintType(functionType, typeString, 1, 1);
17534 functionType->__anon1.__anon2.thisClass = back;
17535 }
17536 if(strstr(typeString, "thisclass"))
17537 {
17538 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
17539 struct Declarator * decl;
17540
17541 {
17542 struct Context * context = SetupTemplatesContext(exp->__anon1.call.exp->expType->__anon1.__anon3.usedClass);
17543
17544 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
17545 if(thisClass != (exp->__anon1.call.exp->expType->__anon1.__anon3.usedClass->templateClass ? exp->__anon1.call.exp->expType->__anon1.__anon3.usedClass->templateClass : exp->__anon1.call.exp->expType->__anon1.__anon3.usedClass))
17546 thisClassParams = 0;
17547 ReplaceThisClassSpecifiers(specs, exp->__anon1.call.exp->expType->__anon1.__anon3.usedClass);
17548 {
17549 struct __ecereNameSpace__ecere__com__Class * backupThisClass = thisClass;
17550
17551 thisClass = exp->__anon1.call.exp->expType->__anon1.__anon3.usedClass;
17552 ProcessDeclarator(decl, 1);
17553 thisClass = backupThisClass;
17554 }
17555 thisClassParams = 1;
17556 functionType = ProcessType(specs, decl);
17557 functionType->refCount = 0;
17558 FinishTemplatesContext(context);
17559 {
17560 struct Type * p, * op;
17561
17562 for(p = functionType->__anon1.__anon2.params.first, op = methodType->__anon1.__anon3.method->dataType->__anon1.__anon2.params.first; p && op; p = p->next, op = op->next)
17563 {
17564 if(op->kind == 21)
17565 p->thisClassFrom = methodType->__anon1.__anon3.method->_class;
17566 }
17567 }
17568 if(methodType->__anon1.__anon3.method->dataType->__anon1.__anon2.returnType->kind == 21)
17569 {
17570 functionType->__anon1.__anon2.returnType->thisClassFrom = methodType->__anon1.__anon3.method->_class;
17571 }
17572 }
17573 FreeList(specs, (void *)(FreeSpecifier));
17574 FreeDeclarator(decl);
17575 }
17576 }
17577 }
17578 if(functionType && functionType->kind == 13 && functionType->__anon1.type && functionType->__anon1.type->kind == 11)
17579 {
17580 struct Type * type = functionType->__anon1.type;
17581
17582 if(!functionType->refCount)
17583 {
17584 functionType->__anon1.type = (((void *)0));
17585 FreeType(functionType);
17586 }
17587 functionType = type;
17588 }
17589 if(functionType && functionType->kind != 11)
17590 {
17591 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "called object %s is not a function\n", (((void *)0))), name);
17592 }
17593 else if(functionType)
17594 {
17595 unsigned int emptyParams = 0, noParams = 0;
17596 struct Expression * e = exp->__anon1.call.arguments ? (*exp->__anon1.call.arguments).first : (((void *)0));
17597 struct Type * type = functionType->__anon1.__anon2.params.first;
17598 struct Expression * memberExp = (exp->__anon1.call.exp->type == 8) ? exp->__anon1.call.exp : (((void *)0));
17599 int extra = 0;
17600 struct Location oldyylloc = yylloc;
17601
17602 if(!type)
17603 emptyParams = 1;
17604 if(functionType->extraParam && e && functionType->__anon1.__anon2.thisClass)
17605 {
17606 e->destType = MkClassType(functionType->__anon1.__anon2.thisClass->string);
17607 e = e->next;
17608 }
17609 if(!functionType->__anon1.__anon2.staticMethod && !functionType->extraParam)
17610 {
17611 if(memberExp && memberExp->__anon1.member.exp && memberExp->__anon1.member.exp->expType && memberExp->__anon1.member.exp->expType->kind == 19 && memberExp->__anon1.member.exp->expType->__anon1._class)
17612 {
17613 type = MkClassType(memberExp->__anon1.member.exp->expType->__anon1._class->string);
17614 if(e)
17615 {
17616 e->destType = type;
17617 e = e->next;
17618 type = functionType->__anon1.__anon2.params.first;
17619 }
17620 else
17621 type->refCount = 0;
17622 }
17623 else if(!memberExp && (functionType->__anon1.__anon2.thisClass || (methodType && methodType->__anon1.__anon3.methodClass)))
17624 {
17625 type = MkClassType(functionType->__anon1.__anon2.thisClass ? functionType->__anon1.__anon2.thisClass->string : (methodType ? methodType->__anon1.__anon3.methodClass->fullName : (((void *)0))));
17626 type->byReference = functionType->byReference;
17627 type->typedByReference = functionType->typedByReference;
17628 if(e)
17629 {
17630 if(e->next && type->kind == 8 && (functionType && functionType->__anon1.__anon2.thisClass) && functionType->classObjectType == 2)
17631 e = e->next;
17632 e->destType = type;
17633 e = e->next;
17634 type = functionType->__anon1.__anon2.params.first;
17635 }
17636 else
17637 type->refCount = 0;
17638 }
17639 }
17640 if(type && type->kind == 0)
17641 {
17642 noParams = 1;
17643 if(!type->refCount)
17644 FreeType(type);
17645 type = (((void *)0));
17646 }
17647 for(; e; e = e->next)
17648 {
17649 if(!type && !emptyParams)
17650 {
17651 yylloc = e->loc;
17652 if(methodType && methodType->__anon1.__anon3.methodClass)
17653 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "too many arguments for method %s::%s (%d given, expected %d)\n", (((void *)0))), methodType->__anon1.__anon3.methodClass->fullName, methodType->__anon1.__anon3.method->name, (*exp->__anon1.call.arguments).count, noParams ? 0 : functionType->__anon1.__anon2.params.count);
17654 else
17655 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "too many arguments for function %s (%d given, expected %d)\n", (((void *)0))), name, (*exp->__anon1.call.arguments).count, noParams ? 0 : functionType->__anon1.__anon2.params.count);
17656 break;
17657 }
17658 if(methodType && type && type->kind == 20 && type->__anon1.templateParameter->type == 0)
17659 {
17660 struct Type * templatedType = (((void *)0));
17661 struct __ecereNameSpace__ecere__com__Class * _class = methodType->__anon1.__anon3.usedClass;
17662 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
17663 int id = 0;
17664
17665 if(_class && _class->templateArgs)
17666 {
17667 struct __ecereNameSpace__ecere__com__Class * sClass;
17668
17669 for(sClass = _class; sClass; sClass = sClass->base)
17670 {
17671 if(sClass->templateClass)
17672 sClass = sClass->templateClass;
17673 id = 0;
17674 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
17675 {
17676 if(curParam->type == 0 && !strcmp(type->__anon1.templateParameter->identifier->string, curParam->name))
17677 {
17678 struct __ecereNameSpace__ecere__com__Class * nextClass;
17679
17680 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
17681 {
17682 if(nextClass->templateClass)
17683 nextClass = nextClass->templateClass;
17684 id += nextClass->templateParams.count;
17685 }
17686 break;
17687 }
17688 id++;
17689 }
17690 if(curParam)
17691 break;
17692 }
17693 }
17694 if(curParam && _class->templateArgs[id].__anon1.__anon1.dataTypeString)
17695 {
17696 unsigned int constant = type->constant;
17697 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = _class->templateArgs[id];
17698
17699 {
17700 struct Context * context = SetupTemplatesContext(_class);
17701
17702 templatedType = ProcessTypeString(arg.__anon1.__anon1.dataTypeString, 0);
17703 FinishTemplatesContext(context);
17704 }
17705 if(templatedType->kind == 8 && constant)
17706 templatedType->constant = 1;
17707 else if(templatedType->kind == 13)
17708 {
17709 struct Type * t = templatedType->__anon1.type;
17710
17711 while(t->kind == 13)
17712 t = t->__anon1.type;
17713 if(constant)
17714 t->constant = constant;
17715 }
17716 e->destType = templatedType;
17717 if(templatedType)
17718 {
17719 templatedType->passAsTemplate = 1;
17720 }
17721 }
17722 else
17723 {
17724 e->destType = type;
17725 if(type)
17726 type->refCount++;
17727 }
17728 }
17729 else
17730 {
17731 if(type && type->kind == 14 && type->prev && type->prev->kind == 8 && type->prev->classObjectType)
17732 {
17733 e->destType = type->prev;
17734 e->destType->refCount++;
17735 }
17736 else
17737 {
17738 e->destType = type;
17739 if(type)
17740 type->refCount++;
17741 }
17742 }
17743 if(type && type->kind != 14)
17744 {
17745 struct Type * next = type->next;
17746
17747 if(!type->refCount)
17748 FreeType(type);
17749 type = next;
17750 }
17751 }
17752 if(type && type->kind != 14)
17753 {
17754 if(methodType && methodType->__anon1.__anon3.methodClass)
17755 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "not enough arguments for method %s::%s (%d given, expected %d)\n", (((void *)0))), methodType->__anon1.__anon3.methodClass->fullName, methodType->__anon1.__anon3.method->name, exp->__anon1.call.arguments ? (*exp->__anon1.call.arguments).count : 0, functionType->__anon1.__anon2.params.count + extra);
17756 else
17757 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "not enough arguments for function %s (%d given, expected %d)\n", (((void *)0))), name, exp->__anon1.call.arguments ? (*exp->__anon1.call.arguments).count : 0, functionType->__anon1.__anon2.params.count + extra);
17758 }
17759 yylloc = oldyylloc;
17760 if(type && !type->refCount)
17761 FreeType(type);
17762 }
17763 else
17764 {
17765 functionType = __extension__ ({
17766 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
17767
17768 __ecereInstance1->refCount = 0, __ecereInstance1->kind = 11, __ecereInstance1;
17769 });
17770 if(exp->__anon1.call.exp->type == 0)
17771 {
17772 char * string = exp->__anon1.call.exp->__anon1.__anon1.identifier->string;
17773
17774 if(inCompiler)
17775 {
17776 struct Symbol * symbol;
17777 struct Location oldyylloc = yylloc;
17778
17779 yylloc = exp->__anon1.call.exp->__anon1.__anon1.identifier->loc;
17780 if(strstr(string, "__builtin_") == string)
17781 {
17782 if(exp->destType)
17783 {
17784 functionType->__anon1.__anon2.returnType = exp->destType;
17785 exp->destType->refCount++;
17786 }
17787 }
17788 else
17789 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "%s undefined; assuming extern returning int\n", (((void *)0))), string);
17790 symbol = __extension__ ({
17791 struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
17792
17793 __ecereInstance1->string = __ecereNameSpace__ecere__sys__CopyString(string), __ecereInstance1->type = ProcessTypeString("int()", 1), __ecereInstance1;
17794 });
17795 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)symbol);
17796 if(strstr(symbol->string, "::"))
17797 globalContext->hasNameSpace = 1;
17798 yylloc = oldyylloc;
17799 }
17800 }
17801 else if(exp->__anon1.call.exp->type == 8)
17802 {
17803 }
17804 else
17805 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "callable object undefined; extern assuming returning int\n", (((void *)0))));
17806 if(!functionType->__anon1.__anon2.returnType)
17807 {
17808 functionType->__anon1.__anon2.returnType = __extension__ ({
17809 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
17810
17811 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 3, __ecereInstance1;
17812 });
17813 }
17814 }
17815 if(functionType && functionType->kind == 11)
17816 {
17817 exp->expType = functionType->__anon1.__anon2.returnType;
17818 if(functionType->__anon1.__anon2.returnType)
17819 functionType->__anon1.__anon2.returnType->refCount++;
17820 if(!functionType->refCount)
17821 FreeType(functionType);
17822 }
17823 if(exp->__anon1.call.arguments)
17824 {
17825 for(e = (*exp->__anon1.call.arguments).first; e; e = e->next)
17826 ProcessExpressionType(e);
17827 }
17828 break;
17829 }
17830 case 8:
17831 {
17832 struct Type * type;
17833 struct Location oldyylloc = yylloc;
17834 unsigned int thisPtr;
17835 struct Expression * checkExp = exp->__anon1.member.exp;
17836
17837 while(checkExp)
17838 {
17839 if(checkExp->type == 11)
17840 checkExp = checkExp->__anon1.cast.exp;
17841 else if(checkExp->type == 5)
17842 checkExp = checkExp->__anon1.list ? (*checkExp->__anon1.list).first : (((void *)0));
17843 else
17844 break;
17845 }
17846 thisPtr = (checkExp && checkExp->type == 0 && !strcmp(checkExp->__anon1.__anon1.identifier->string, "this"));
17847 exp->thisPtr = thisPtr;
17848 if(exp->__anon1.member.member && exp->__anon1.member.member->_class && exp->__anon1.member.member->_class->__anon1.__anon1.name)
17849 {
17850 exp->__anon1.member.member->classSym = exp->__anon1.member.member->_class->__anon1.__anon1.symbol;
17851 }
17852 ProcessExpressionType(exp->__anon1.member.exp);
17853 if(exp->__anon1.member.exp->expType && exp->__anon1.member.exp->expType->kind == 8 && exp->__anon1.member.exp->expType->__anon1._class && exp->__anon1.member.exp->expType->__anon1._class->__anon1.registered && exp->__anon1.member.exp->expType->__anon1._class->__anon1.registered->type == 0)
17854 {
17855 exp->isConstant = 0;
17856 }
17857 else
17858 exp->isConstant = exp->__anon1.member.exp->isConstant;
17859 type = exp->__anon1.member.exp->expType;
17860 yylloc = exp->loc;
17861 if(type && (type->kind == 20))
17862 {
17863 struct __ecereNameSpace__ecere__com__Class * _class = thisClass ? thisClass : currentClass;
17864 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param = (((void *)0));
17865
17866 if(_class)
17867 {
17868 for(param = _class->templateParams.first; param; param = param->next)
17869 {
17870 if(param->type == 1 && exp->__anon1.member.member && exp->__anon1.member.member->string && !strcmp(param->name, exp->__anon1.member.member->string))
17871 break;
17872 }
17873 }
17874 if(param && param->defaultArg.__anon1.__anon2.__anon1.member)
17875 {
17876 struct Expression * argExp = GetTemplateArgExpByName(param->name, thisClass, 1);
17877
17878 if(argExp)
17879 {
17880 struct Expression * expMember = exp->__anon1.member.exp;
17881 struct Declarator * decl;
17882 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
17883 char thisClassTypeString[1024];
17884
17885 FreeIdentifier(exp->__anon1.member.member);
17886 ProcessExpressionType(argExp);
17887 {
17888 char * colon = strstr(param->defaultArg.__anon1.__anon2.memberString, "::");
17889
17890 if(colon)
17891 {
17892 memcpy(thisClassTypeString, param->defaultArg.__anon1.__anon2.memberString, colon - param->defaultArg.__anon1.__anon2.memberString);
17893 thisClassTypeString[colon - param->defaultArg.__anon1.__anon2.memberString] = '\0';
17894 }
17895 else
17896 strcpy(thisClassTypeString, _class->fullName);
17897 }
17898 decl = SpecDeclFromString(param->defaultArg.__anon1.__anon2.__anon1.member->dataTypeString, specs, (((void *)0)));
17899 exp->expType = ProcessType(specs, decl);
17900 if(exp->expType->kind == 8 && exp->expType->__anon1._class && exp->expType->__anon1._class->__anon1.registered && exp->expType->__anon1._class->__anon1.registered->templateClass)
17901 {
17902 struct __ecereNameSpace__ecere__com__Class * expClass = exp->expType->__anon1._class->__anon1.registered;
17903 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
17904 int paramCount = 0;
17905 int lastParam = -1;
17906 char templateString[1024];
17907 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
17908
17909 sprintf(templateString, "%s<", expClass->templateClass->fullName);
17910 for(cClass = expClass; cClass; cClass = cClass->base)
17911 {
17912 int p = 0;
17913
17914 for(param = cClass->templateParams.first; param; param = param->next)
17915 {
17916 int id = p;
17917 struct __ecereNameSpace__ecere__com__Class * sClass;
17918 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
17919
17920 for(sClass = cClass->base; sClass; sClass = sClass->base)
17921 id += sClass->templateParams.count;
17922 arg = expClass->templateArgs[id];
17923 for(sClass = _class; sClass; sClass = sClass->base)
17924 {
17925 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * cParam;
17926 int p = 0;
17927 struct __ecereNameSpace__ecere__com__Class * nextClass;
17928
17929 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
17930 p += nextClass->templateParams.count;
17931 for(cParam = sClass->templateParams.first; cParam; cParam = cParam->next, p++)
17932 {
17933 if(cParam->type == 0 && arg.__anon1.__anon1.dataTypeString && !strcmp(cParam->name, arg.__anon1.__anon1.dataTypeString))
17934 {
17935 if(_class->templateArgs && arg.__anon1.__anon1.dataTypeString && (!param->defaultArg.__anon1.__anon1.dataTypeString || strcmp(arg.__anon1.__anon1.dataTypeString, param->defaultArg.__anon1.__anon1.dataTypeString)))
17936 {
17937 arg.__anon1.__anon1.dataTypeString = _class->templateArgs[p].__anon1.__anon1.dataTypeString;
17938 arg.__anon1.__anon1.dataTypeClass = _class->templateArgs[p].__anon1.__anon1.dataTypeClass;
17939 break;
17940 }
17941 }
17942 }
17943 }
17944 {
17945 char argument[256];
17946
17947 argument[0] = '\0';
17948 switch(param->type)
17949 {
17950 case 2:
17951 {
17952 char expString[1024];
17953 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
17954 struct Declarator * decl = SpecDeclFromString(param->__anon1.dataTypeString, specs, (((void *)0)));
17955 struct Expression * exp;
17956 char * string = PrintHexUInt64(arg.__anon1.expression.__anon1.ui64);
17957
17958 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
17959 (__ecereNameSpace__ecere__com__eSystem_Delete(string), string = 0);
17960 ProcessExpressionType(exp);
17961 ComputeExpression(exp);
17962 expString[0] = '\0';
17963 PrintExpression(exp, expString);
17964 strcat(argument, expString);
17965 FreeExpression(exp);
17966 break;
17967 }
17968 case 1:
17969 {
17970 strcat(argument, arg.__anon1.__anon2.__anon1.member->name);
17971 break;
17972 }
17973 case 0:
17974 {
17975 if(arg.__anon1.__anon1.dataTypeString && (!param->defaultArg.__anon1.__anon1.dataTypeString || strcmp(arg.__anon1.__anon1.dataTypeString, param->defaultArg.__anon1.__anon1.dataTypeString)))
17976 {
17977 if(!strcmp(arg.__anon1.__anon1.dataTypeString, "thisclass"))
17978 strcat(argument, thisClassTypeString);
17979 else
17980 strcat(argument, arg.__anon1.__anon1.dataTypeString);
17981 }
17982 break;
17983 }
17984 }
17985 if(argument[0])
17986 {
17987 if(paramCount)
17988 strcat(templateString, ", ");
17989 if(lastParam != p - 1)
17990 {
17991 strcat(templateString, param->name);
17992 strcat(templateString, " = ");
17993 }
17994 strcat(templateString, argument);
17995 paramCount++;
17996 lastParam = p;
17997 }
17998 p++;
17999 }
18000 }
18001 }
18002 {
18003 int len = strlen(templateString);
18004
18005 if(templateString[len - 1] == '>')
18006 templateString[len++] = ' ';
18007 templateString[len++] = '>';
18008 templateString[len++] = '\0';
18009 }
18010 {
18011 struct Context * context = SetupTemplatesContext(_class);
18012
18013 FreeType(exp->expType);
18014 exp->expType = ProcessTypeString(templateString, 0);
18015 FinishTemplatesContext(context);
18016 }
18017 }
18018 if(!__ecereProp_Type_Get_isPointerType(expMember->expType))
18019 expMember = MkExpCast(MkTypeName(MkListOne(MkSpecifierName("uintptr")), (((void *)0))), expMember);
18020 exp->type = 5;
18021 exp->__anon1.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")))))))));
18022 }
18023 }
18024 else if(type->__anon1.templateParameter && type->__anon1.templateParameter->type == 0 && (type->__anon1.templateParameter->__anon1.dataType || type->__anon1.templateParameter->dataTypeString))
18025 {
18026 type = ProcessTemplateParameterType(type->__anon1.templateParameter);
18027 }
18028 }
18029 if(type && (type->kind == 20))
18030 ;
18031 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->__anon1.type->kind == 1)))
18032 {
18033 struct Identifier * id = exp->__anon1.member.member;
18034 int typeKind = type->kind;
18035 struct __ecereNameSpace__ecere__com__Class * _class = (id && (!id->_class || id->_class->__anon1.__anon1.name)) ? (id->classSym ? id->classSym->__anon1.registered : (type->__anon1._class ? type->__anon1._class->__anon1.registered : (((void *)0)))) : (((void *)0));
18036
18037 if(typeKind == 19 && exp->__anon1.member.exp->type == 24)
18038 {
18039 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "ecere::com::Class");
18040 typeKind = 8;
18041 }
18042 if(id)
18043 {
18044 if(typeKind == 3 || typeKind == 15)
18045 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "int");
18046 else if(!_class)
18047 {
18048 if(type->kind == 8 && type->__anon1._class && type->__anon1._class->__anon1.registered)
18049 {
18050 _class = type->__anon1._class->__anon1.registered;
18051 }
18052 else if((type->kind == 12 || type->kind == 13) && type->__anon1.type && type->__anon1.type->kind == 1)
18053 {
18054 _class = FindClass("char *")->__anon1.registered;
18055 }
18056 else if(type->kind == 13)
18057 {
18058 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "uintptr");
18059 FreeType(exp->expType);
18060 exp->expType = ProcessTypeString("uintptr", 0);
18061 exp->byReference = 1;
18062 }
18063 else
18064 {
18065 char string[1024] = "";
18066 struct Symbol * classSym;
18067
18068 PrintTypeNoConst(type, string, 0, 1);
18069 classSym = FindClass(string);
18070 if(classSym)
18071 _class = classSym->__anon1.registered;
18072 }
18073 }
18074 }
18075 if(_class && id)
18076 {
18077 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
18078 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
18079 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
18080 struct __ecereNameSpace__ecere__com__Property * revConvert = (((void *)0));
18081 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
18082
18083 if(id && id->_class && id->_class->__anon1.__anon1.name && !strcmp(id->_class->__anon1.__anon1.name, "property"))
18084 exp->__anon1.member.memberType = 1;
18085 if(id && id->_class && type->__anon1._class && !__ecereNameSpace__ecere__com__eClass_IsDerived(type->__anon1._class->__anon1.registered, _class))
18086 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "invalid class specifier %s for object of class %s\n", (((void *)0))), _class->fullName, type->__anon1._class->string);
18087 if(typeKind != 19)
18088 {
18089 if((exp->__anon1.member.memberType == 0 && thisPtr) || exp->__anon1.member.memberType == 3)
18090 {
18091 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
18092 if(member && member->_class != (_class->templateClass ? _class->templateClass : _class) && exp->__anon1.member.memberType != 3)
18093 {
18094 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
18095 if(prop)
18096 member = (((void *)0));
18097 }
18098 if(!member && !prop)
18099 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
18100 if((member && member->_class == (_class->templateClass ? _class->templateClass : _class)) || (prop && prop->_class == (_class->templateClass ? _class->templateClass : _class)))
18101 exp->__anon1.member.thisPtr = 1;
18102 }
18103 else
18104 {
18105 unsigned int useMemberForNonConst = 0;
18106
18107 if(!id->classSym)
18108 {
18109 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, (((void *)0)));
18110 useMemberForNonConst = prop && exp->destType && ((exp->destType->kind == 8 && !exp->destType->constant) || ((exp->destType->kind == 13 || exp->destType->kind == 12) && exp->destType->__anon1.type && !exp->destType->__anon1.type->constant)) && !strncmp(prop->dataTypeString, "const ", 6);
18111 if(useMemberForNonConst || !id->_class || !id->_class->__anon1.__anon1.name || strcmp(id->_class->__anon1.__anon1.name, "property"))
18112 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, (((void *)0)), (((void *)0)), (((void *)0)));
18113 }
18114 if((!prop || useMemberForNonConst) && !member)
18115 {
18116 method = useMemberForNonConst ? (((void *)0)) : __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, (((void *)0)));
18117 if(!method)
18118 {
18119 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
18120 useMemberForNonConst |= prop && exp->destType && ((exp->destType->kind == 8 && !exp->destType->constant) || ((exp->destType->kind == 13 || exp->destType->kind == 12) && exp->destType->__anon1.type && !exp->destType->__anon1.type->constant)) && !strncmp(prop->dataTypeString, "const ", 6);
18121 if(useMemberForNonConst || !id->_class || !id->_class->__anon1.__anon1.name || strcmp(id->_class->__anon1.__anon1.name, "property"))
18122 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
18123 }
18124 }
18125 if(member && prop)
18126 {
18127 if(useMemberForNonConst || (member->_class != prop->_class && !id->_class && __ecereNameSpace__ecere__com__eClass_IsDerived(member->_class, prop->_class)))
18128 prop = (((void *)0));
18129 else
18130 member = (((void *)0));
18131 }
18132 }
18133 }
18134 if(!prop && !member && !method)
18135 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule);
18136 if(!prop && !member && !method)
18137 {
18138 if(typeKind == 19)
18139 {
18140 classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(type->__anon1._class->__anon1.registered, exp->__anon1.member.member->string);
18141 if(classProp)
18142 {
18143 exp->__anon1.member.memberType = 5;
18144 exp->expType = ProcessTypeString(classProp->dataTypeString, 0);
18145 }
18146 else
18147 {
18148 char structName[1024];
18149 struct Identifier * id = exp->__anon1.member.member;
18150 struct Expression * classExp = exp->__anon1.member.exp;
18151
18152 type->refCount++;
18153 FreeType(classExp->expType);
18154 classExp->expType = ProcessTypeString("ecere::com::Class", 0);
18155 strcpy(structName, "__ecereClassData_");
18156 FullClassNameCat(structName, type->__anon1._class->string, 0);
18157 exp->type = 9;
18158 exp->__anon1.member.member = id;
18159 exp->__anon1.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->__anon1._class->string)), (((void *)0))), MkIdentifier("offsetClass"))))))));
18160 FreeType(type);
18161 ProcessExpressionType(exp);
18162 return ;
18163 }
18164 }
18165 else
18166 {
18167 struct Symbol * classSym = FindClass(id->string);
18168
18169 if(classSym)
18170 {
18171 struct __ecereNameSpace__ecere__com__Class * convertClass = classSym->__anon1.registered;
18172
18173 if(convertClass)
18174 revConvert = __ecereNameSpace__ecere__com__eClass_FindProperty(convertClass, _class->fullName, privateModule);
18175 }
18176 }
18177 }
18178 if(exp->__anon1.member.exp->destType)
18179 FreeType(exp->__anon1.member.exp->destType);
18180 {
18181 if(method && !method->_class->symbol)
18182 method->_class->symbol = FindClass(method->_class->fullName);
18183 if(prop && !prop->_class->symbol)
18184 prop->_class->symbol = FindClass(prop->_class->fullName);
18185 exp->__anon1.member.exp->destType = __extension__ ({
18186 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
18187
18188 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 8, __ecereInstance1->__anon1._class = prop ? prop->_class->symbol : method ? method->_class->symbol : _class->symbol, __ecereInstance1->thisClassFrom = type ? type->thisClassFrom : (((void *)0)), __ecereInstance1;
18189 });
18190 }
18191 if(prop)
18192 {
18193 exp->__anon1.member.memberType = 1;
18194 if(!prop->dataType)
18195 ProcessPropertyType(prop);
18196 exp->expType = prop->dataType;
18197 if(!strcmp(_class->base->fullName, "eda::Row") && !exp->expType->constant && !exp->destType)
18198 {
18199 struct Type * type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
18200
18201 CopyTypeInto(type, exp->expType);
18202 type->refCount = 1;
18203 type->constant = 1;
18204 exp->expType = type;
18205 }
18206 else if(prop->dataType)
18207 prop->dataType->refCount++;
18208 }
18209 else if(member)
18210 {
18211 if(exp->__anon1.member.exp->expType->classObjectType == 2 && !strcmp(exp->__anon1.member.member->string, "_class"))
18212 {
18213 FreeExpContents(exp);
18214 exp->type = 0;
18215 exp->__anon1.__anon1.identifier = MkIdentifier("class");
18216 ProcessExpressionType(exp);
18217 return ;
18218 }
18219 exp->__anon1.member.memberType = 3;
18220 DeclareStruct(curExternal, _class->fullName, 0, 1);
18221 if(member->_class != _class)
18222 DeclareStruct(curExternal, member->_class->fullName, 0, 1);
18223 if(!member->dataType)
18224 {
18225 struct Context * context = SetupTemplatesContext(_class);
18226
18227 member->dataType = ProcessTypeString(member->dataTypeString, 0);
18228 FinishTemplatesContext(context);
18229 }
18230 if(exp->__anon1.member.exp->expType->kind == 8 && exp->__anon1.member.exp->expType->__anon1._class && exp->__anon1.member.exp->expType->__anon1._class->__anon1.registered && exp->__anon1.member.exp->expType->__anon1._class->__anon1.registered->type == 2)
18231 member->dataType->bitMemberSize = ((struct __ecereNameSpace__ecere__com__BitMember *)member)->size;
18232 exp->expType = member->dataType;
18233 if(member->dataType)
18234 member->dataType->refCount++;
18235 }
18236 else if(revConvert)
18237 {
18238 exp->__anon1.member.memberType = 4;
18239 exp->expType = MkClassType(revConvert->_class->fullName);
18240 }
18241 else if(method)
18242 {
18243 {
18244 exp->__anon1.member.memberType = 2;
18245 }
18246 if(!method->dataType)
18247 ProcessMethodType(method);
18248 exp->expType = __extension__ ({
18249 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
18250
18251 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 16, __ecereInstance1->__anon1.__anon3.method = method, __ecereInstance1;
18252 });
18253 exp->expType->__anon1.__anon3.methodClass = (id && id->_class) ? _class : (((void *)0));
18254 exp->expType->__anon1.__anon3.usedClass = _class;
18255 }
18256 else if(!classProp)
18257 {
18258 if(exp->__anon1.member.exp->expType->classObjectType == 2 && !strcmp(exp->__anon1.member.member->string, "_class"))
18259 {
18260 FreeExpContents(exp);
18261 exp->type = 0;
18262 exp->__anon1.__anon1.identifier = MkIdentifier("class");
18263 FreeType(exp->expType);
18264 exp->expType = MkClassType("ecere::com::Class");
18265 return ;
18266 }
18267 yylloc = exp->__anon1.member.member->loc;
18268 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't find member %s in class %s\n", (((void *)0))), id->string, _class->fullName);
18269 if(inCompiler)
18270 __ecereNameSpace__ecere__com__eClass_AddDataMember(_class, id->string, "int", 0, 0, 1);
18271 }
18272 if(_class && exp->expType)
18273 {
18274 struct __ecereNameSpace__ecere__com__Class * tClass;
18275
18276 tClass = type->__anon1._class && type->__anon1._class->__anon1.registered ? type->__anon1._class->__anon1.registered : _class;
18277 while(tClass && !tClass->templateClass)
18278 tClass = tClass->base;
18279 if(tClass && exp->expType->kind == 20 && exp->expType->__anon1.templateParameter->type == 0)
18280 {
18281 int id = 0;
18282 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
18283 struct __ecereNameSpace__ecere__com__Class * sClass;
18284
18285 for(sClass = tClass; sClass; sClass = sClass->base)
18286 {
18287 id = 0;
18288 if(sClass->templateClass)
18289 sClass = sClass->templateClass;
18290 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
18291 {
18292 if(curParam->type == 0 && !strcmp(exp->expType->__anon1.templateParameter->identifier->string, curParam->name))
18293 {
18294 for(sClass = sClass->base; sClass; sClass = sClass->base)
18295 id += sClass->templateParams.count;
18296 break;
18297 }
18298 id++;
18299 }
18300 if(curParam)
18301 break;
18302 }
18303 if(curParam && tClass->templateArgs[id].__anon1.__anon1.dataTypeString)
18304 {
18305 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = tClass->templateArgs[id];
18306 struct Context * context = SetupTemplatesContext(tClass);
18307 unsigned int constant = exp->expType->constant;
18308 unsigned int passAsTemplate = 0;
18309 struct __ecereNameSpace__ecere__com__Class * thisClassFrom = (((void *)0));
18310 struct Type * t = ProcessTypeString(exp->expType->__anon1.templateParameter->dataTypeString, 0);
18311
18312 if(t && t->kind == 8 && t->__anon1._class)
18313 thisClassFrom = t->__anon1._class->__anon1.registered;
18314 else
18315 thisClassFrom = __ecereNameSpace__ecere__com__eSystem_FindClass(GetPrivateModule(), "class");
18316 FreeType(t);
18317 passAsTemplate = tClass->templateClass && (exp->expType->kind != 20 || (!exp->expType->__anon1.templateParameter || (!exp->expType->__anon1.templateParameter->dataTypeString && !exp->expType->__anon1.templateParameter->__anon1.dataType)));
18318 FreeType(exp->expType);
18319 exp->expType = ProcessTypeString(arg.__anon1.__anon1.dataTypeString, 0);
18320 exp->expType->thisClassFrom = thisClassFrom;
18321 if(exp->expType->kind == 8 && constant)
18322 exp->expType->constant = 1;
18323 else if(exp->expType->kind == 13)
18324 {
18325 struct Type * t = exp->expType->__anon1.type;
18326
18327 while(t->kind == 13)
18328 t = t->__anon1.type;
18329 if(constant)
18330 t->constant = constant;
18331 }
18332 if(exp->expType)
18333 {
18334 if(exp->expType->kind == 21)
18335 {
18336 FreeType(exp->expType);
18337 exp->expType = ReplaceThisClassType(_class);
18338 }
18339 if(passAsTemplate)
18340 exp->expType->passAsTemplate = 1;
18341 if(!exp->destType)
18342 {
18343 exp->destType = ProcessTypeString(arg.__anon1.__anon1.dataTypeString, 0);
18344 if(exp->destType->kind == 8 && constant)
18345 exp->destType->constant = 1;
18346 else if(exp->destType->kind == 13)
18347 {
18348 struct Type * t = exp->destType->__anon1.type;
18349
18350 while(t->kind == 13)
18351 t = t->__anon1.type;
18352 if(constant)
18353 t->constant = constant;
18354 }
18355 if(exp->destType->kind == 21)
18356 {
18357 FreeType(exp->destType);
18358 exp->destType = ReplaceThisClassType(_class);
18359 }
18360 }
18361 }
18362 FinishTemplatesContext(context);
18363 }
18364 }
18365 else if(tClass && exp->expType->kind == 13 && exp->expType->__anon1.type && exp->expType->__anon1.type->kind == 20 && exp->expType->__anon1.type->__anon1.templateParameter->type == 0)
18366 {
18367 int id = 0;
18368 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
18369 struct __ecereNameSpace__ecere__com__Class * sClass;
18370
18371 for(sClass = tClass; sClass; sClass = sClass->base)
18372 {
18373 id = 0;
18374 if(sClass->templateClass)
18375 sClass = sClass->templateClass;
18376 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
18377 {
18378 if(curParam->type == 0 && !strcmp(exp->expType->__anon1.type->__anon1.templateParameter->identifier->string, curParam->name))
18379 {
18380 for(sClass = sClass->base; sClass; sClass = sClass->base)
18381 id += sClass->templateParams.count;
18382 break;
18383 }
18384 id++;
18385 }
18386 if(curParam)
18387 break;
18388 }
18389 if(curParam)
18390 {
18391 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = tClass->templateArgs[id];
18392 struct Context * context = SetupTemplatesContext(tClass);
18393 struct Type * basicType;
18394
18395 basicType = ProcessTypeString(arg.__anon1.__anon1.dataTypeString, 0);
18396 if(basicType)
18397 {
18398 if(basicType->kind == 21)
18399 {
18400 FreeType(basicType);
18401 basicType = ReplaceThisClassType(_class);
18402 }
18403 FreeType(exp->expType);
18404 exp->expType = __extension__ ({
18405 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
18406
18407 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 13, __ecereInstance1->__anon1.type = basicType, __ecereInstance1;
18408 });
18409 if(!exp->destType)
18410 {
18411 exp->destType = exp->expType;
18412 exp->destType->refCount++;
18413 }
18414 {
18415 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
18416 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
18417 struct Declarator * decl;
18418
18419 decl = SpecDeclFromString(arg.__anon1.__anon1.dataTypeString, specs, (((void *)0)));
18420 *newExp = *exp;
18421 if(exp->destType)
18422 exp->destType->refCount++;
18423 if(exp->expType)
18424 exp->expType->refCount++;
18425 exp->type = 11;
18426 exp->__anon1.cast.typeName = MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl));
18427 exp->__anon1.cast.exp = newExp;
18428 }
18429 }
18430 FinishTemplatesContext(context);
18431 }
18432 }
18433 else if(tClass && exp->expType->kind == 8 && exp->expType->__anon1._class && strchr(exp->expType->__anon1._class->string, '<'))
18434 {
18435 struct __ecereNameSpace__ecere__com__Class * expClass = exp->expType->__anon1._class->__anon1.registered;
18436
18437 if(expClass)
18438 {
18439 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
18440 int p = 0;
18441 int paramCount = 0;
18442 int lastParam = -1;
18443 char templateString[1024];
18444 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
18445
18446 sprintf(templateString, "%s<", expClass->templateClass->fullName);
18447 while(cClass != expClass)
18448 {
18449 struct __ecereNameSpace__ecere__com__Class * sClass;
18450
18451 for(sClass = expClass; sClass && sClass->base != cClass; sClass = sClass->base)
18452 ;
18453 cClass = sClass;
18454 for(param = cClass->templateParams.first; param; param = param->next)
18455 {
18456 struct __ecereNameSpace__ecere__com__Class * cClassCur = (((void *)0));
18457 int cp = 0;
18458 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * paramCur = (((void *)0));
18459 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
18460
18461 while(cClassCur != tClass && !paramCur)
18462 {
18463 struct __ecereNameSpace__ecere__com__Class * sClassCur;
18464
18465 for(sClassCur = tClass; sClassCur && sClassCur->base != cClassCur; sClassCur = sClassCur->base)
18466 ;
18467 cClassCur = sClassCur;
18468 for(paramCur = cClassCur->templateParams.first; paramCur; paramCur = paramCur->next)
18469 {
18470 if(!strcmp(paramCur->name, param->name))
18471 {
18472 break;
18473 }
18474 cp++;
18475 }
18476 }
18477 if(paramCur && paramCur->type == 0)
18478 arg = tClass->templateArgs[cp];
18479 else
18480 arg = expClass->templateArgs[p];
18481 {
18482 char argument[256];
18483
18484 argument[0] = '\0';
18485 switch(param->type)
18486 {
18487 case 2:
18488 {
18489 char expString[1024];
18490 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
18491 struct Declarator * decl = SpecDeclFromString(param->__anon1.dataTypeString, specs, (((void *)0)));
18492 struct Expression * exp;
18493 char * string = PrintHexUInt64(arg.__anon1.expression.__anon1.ui64);
18494
18495 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
18496 (__ecereNameSpace__ecere__com__eSystem_Delete(string), string = 0);
18497 ProcessExpressionType(exp);
18498 ComputeExpression(exp);
18499 expString[0] = '\0';
18500 PrintExpression(exp, expString);
18501 strcat(argument, expString);
18502 FreeExpression(exp);
18503 break;
18504 }
18505 case 1:
18506 {
18507 strcat(argument, arg.__anon1.__anon2.__anon1.member->name);
18508 break;
18509 }
18510 case 0:
18511 {
18512 if(arg.__anon1.__anon1.dataTypeString && (!param->defaultArg.__anon1.__anon1.dataTypeString || strcmp(arg.__anon1.__anon1.dataTypeString, param->defaultArg.__anon1.__anon1.dataTypeString)))
18513 strcat(argument, arg.__anon1.__anon1.dataTypeString);
18514 break;
18515 }
18516 }
18517 if(argument[0])
18518 {
18519 if(paramCount)
18520 strcat(templateString, ", ");
18521 if(lastParam != p - 1)
18522 {
18523 strcat(templateString, param->name);
18524 strcat(templateString, " = ");
18525 }
18526 strcat(templateString, argument);
18527 paramCount++;
18528 lastParam = p;
18529 }
18530 }
18531 p++;
18532 }
18533 }
18534 {
18535 int len = strlen(templateString);
18536
18537 if(templateString[len - 1] == '>')
18538 templateString[len++] = ' ';
18539 templateString[len++] = '>';
18540 templateString[len++] = '\0';
18541 }
18542 FreeType(exp->expType);
18543 {
18544 struct Context * context = SetupTemplatesContext(tClass);
18545
18546 exp->expType = ProcessTypeString(templateString, 0);
18547 FinishTemplatesContext(context);
18548 }
18549 }
18550 }
18551 }
18552 }
18553 else
18554 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "undefined class %s\n", (((void *)0))), (id && (!id->_class || id->_class->__anon1.__anon1.name)) ? (id->classSym ? id->classSym->string : (type->__anon1._class ? type->__anon1._class->string : (((void *)0)))) : "(null)");
18555 }
18556 else if(type && (type->kind == 9 || type->kind == 10))
18557 {
18558 struct Type * memberType = exp->__anon1.member.member ? FindMember(type, exp->__anon1.member.member->string) : (((void *)0));
18559
18560 if(memberType)
18561 {
18562 exp->expType = memberType;
18563 if(memberType)
18564 memberType->refCount++;
18565 }
18566 }
18567 else
18568 {
18569 char expString[10240];
18570
18571 expString[0] = '\0';
18572 if(inCompiler)
18573 {
18574 PrintExpression(exp, expString);
18575 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
18576 }
18577 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "member operator on non-structure type expression %s\n", (((void *)0))), expString);
18578 }
18579 if(exp->expType && exp->expType->kind == 21 && (!exp->destType || exp->destType->kind != 21))
18580 {
18581 if(type && (type->kind == 8 || type->kind == 19 || type->kind == 3 || type->kind == 15))
18582 {
18583 struct Identifier * id = exp->__anon1.member.member;
18584 struct __ecereNameSpace__ecere__com__Class * _class = (id && (!id->_class || id->_class->__anon1.__anon1.name)) ? (id->classSym ? id->classSym->__anon1.registered : (type->__anon1._class ? type->__anon1._class->__anon1.registered : (((void *)0)))) : (((void *)0));
18585
18586 if(_class)
18587 {
18588 FreeType(exp->expType);
18589 exp->expType = ReplaceThisClassType(_class);
18590 }
18591 }
18592 }
18593 yylloc = oldyylloc;
18594 break;
18595 }
18596 case 9:
18597 {
18598 struct Type * destType = exp->destType;
18599
18600 if(exp->__anon1.member.member && exp->__anon1.member.member->_class && exp->__anon1.member.member->_class->__anon1.__anon1.name)
18601 {
18602 exp->__anon1.member.member->classSym = exp->__anon1.member.member->_class->__anon1.__anon1.symbol;
18603 }
18604 exp->__anon1.member.exp = MkExpBrackets(MkListOne(MkExpOp((((void *)0)), '*', exp->__anon1.member.exp)));
18605 exp->type = 8;
18606 if(destType)
18607 destType->count++;
18608 ProcessExpressionType(exp);
18609 if(destType)
18610 destType->count--;
18611 break;
18612 }
18613 case 15:
18614 {
18615 struct Symbol * classSym = exp->__anon1._class->__anon1.__anon1.symbol;
18616
18617 if(classSym && classSym->__anon1.registered)
18618 {
18619 if(classSym->__anon1.registered->type == 5 || (classSym->__anon1.registered->fixed && classSym->__anon1.registered->structSize))
18620 {
18621 char name[1024];
18622 struct __ecereNameSpace__ecere__com__Class * b = classSym->__anon1.registered;
18623
18624 name[0] = '\0';
18625 DeclareStruct(curExternal, classSym->string, 0, 1);
18626 FreeSpecifier(exp->__anon1._class);
18627 FullClassNameCat(name, classSym->string, 0);
18628 if(b->offset == 0)
18629 {
18630 exp->type = 10;
18631 exp->__anon1.typeName = MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(name), (((void *)0)))), (((void *)0)));
18632 }
18633 else
18634 {
18635 struct Expression * e;
18636
18637 exp->type = 4;
18638 if(b->structSize == b->offset)
18639 exp->__anon1.op.exp1 = MkExpConstant("0");
18640 else
18641 exp->__anon1.op.exp1 = MkExpTypeSize(MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(name), (((void *)0)))), (((void *)0))));
18642 exp->__anon1.op.op = '+';
18643 e = exp;
18644 while(b->offset != 0)
18645 {
18646 struct Symbol * sym;
18647 struct Expression * typeSize;
18648
18649 b = b->base;
18650 sym = FindClass(b->fullName);
18651 name[0] = '\0';
18652 DeclareStruct(curExternal, sym->string, 0, 1);
18653 FullClassNameCat(name, sym->string, 0);
18654 if(b->structSize == b->offset)
18655 typeSize = MkExpConstant("0");
18656 else
18657 typeSize = MkExpTypeSize(MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(name), (((void *)0)))), (((void *)0))));
18658 e->__anon1.op.exp2 = b->offset ? MkExpOp(typeSize, '+', (((void *)0))) : typeSize;
18659 e = e->__anon1.op.exp2;
18660 }
18661 }
18662 }
18663 else
18664 {
18665 if(classSym->__anon1.registered->fixed && !classSym->__anon1.registered->structSize)
18666 {
18667 FreeSpecifier(exp->__anon1._class);
18668 exp->__anon1.__anon1.constant = PrintUInt(classSym->__anon1.registered->templateClass ? classSym->__anon1.registered->templateClass->structSize : classSym->__anon1.registered->structSize);
18669 exp->type = 2;
18670 }
18671 else
18672 {
18673 char className[1024];
18674
18675 strcpy(className, "__ecereClass_");
18676 FullClassNameCat(className, classSym->string, 1);
18677 DeclareClass(curExternal, classSym, className);
18678 FreeExpContents(exp);
18679 exp->type = 9;
18680 exp->__anon1.member.exp = MkExpIdentifier(MkIdentifier(className));
18681 exp->__anon1.member.member = MkIdentifier("structSize");
18682 }
18683 }
18684 }
18685 exp->expType = __extension__ ({
18686 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
18687
18688 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 23, __ecereInstance1;
18689 });
18690 break;
18691 }
18692 case 10:
18693 {
18694 struct Type * type = ProcessType(exp->__anon1.typeName->qualifiers, exp->__anon1.typeName->declarator);
18695
18696 exp->expType = __extension__ ({
18697 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
18698
18699 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 23, __ecereInstance1;
18700 });
18701 exp->isConstant = 1;
18702 DeclareType(curExternal, type, 1, 0);
18703 FreeType(type);
18704 break;
18705 }
18706 case 11:
18707 {
18708 struct Type * type = ProcessType(exp->__anon1.cast.typeName->qualifiers, exp->__anon1.cast.typeName->declarator);
18709
18710 type->count = 1;
18711 FreeType(exp->__anon1.cast.exp->destType);
18712 exp->__anon1.cast.exp->destType = type;
18713 type->refCount++;
18714 type->casted = 1;
18715 ProcessExpressionType(exp->__anon1.cast.exp);
18716 type->casted = 0;
18717 type->count = 0;
18718 exp->expType = type;
18719 if(!exp->__anon1.cast.exp->needCast && !NeedCast(exp->__anon1.cast.exp->expType, type))
18720 {
18721 void * prev = exp->prev, * next = exp->next;
18722 struct Type * expType = exp->__anon1.cast.exp->destType;
18723 struct Expression * castExp = exp->__anon1.cast.exp;
18724 struct Type * destType = exp->destType;
18725
18726 if(expType)
18727 expType->refCount++;
18728 FreeType(exp->expType);
18729 FreeTypeName(exp->__anon1.cast.typeName);
18730 *exp = *castExp;
18731 FreeType(exp->expType);
18732 FreeType(exp->destType);
18733 exp->expType = expType;
18734 exp->destType = destType;
18735 ((castExp ? __extension__ ({
18736 void * __ecerePtrToDelete = (castExp);
18737
18738 __ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)__ecerePtrToDelete) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(__ecerePtrToDelete);
18739 }) : 0), castExp = 0);
18740 exp->prev = prev;
18741 exp->next = next;
18742 }
18743 else
18744 {
18745 exp->isConstant = exp->__anon1.cast.exp->isConstant;
18746 }
18747 break;
18748 }
18749 case 33:
18750 {
18751 struct Type * type = ProcessType(exp->__anon1.initializer.typeName->qualifiers, exp->__anon1.initializer.typeName->declarator);
18752
18753 exp->expType = type;
18754 break;
18755 }
18756 case 34:
18757 {
18758 struct Type * type = ProcessType(exp->__anon1.vaArg.typeName->qualifiers, exp->__anon1.vaArg.typeName->declarator);
18759
18760 ProcessExpressionType(exp->__anon1.vaArg.exp);
18761 exp->expType = type;
18762 break;
18763 }
18764 case 12:
18765 {
18766 struct Expression * e;
18767 struct Type * t = exp->destType;
18768
18769 if(t && !exp->destType->casted)
18770 {
18771 t = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
18772 CopyTypeInto(t, exp->destType);
18773 t->count = 0;
18774 }
18775 else if(t)
18776 t->refCount++;
18777 exp->isConstant = 1;
18778 FreeType(exp->__anon1.cond.cond->destType);
18779 exp->__anon1.cond.cond->destType = MkClassType("bool");
18780 exp->__anon1.cond.cond->destType->truth = 1;
18781 ProcessExpressionType(exp->__anon1.cond.cond);
18782 if(!exp->__anon1.cond.cond->isConstant)
18783 exp->isConstant = 0;
18784 for(e = (*exp->__anon1.cond.exp).first; e; e = e->next)
18785 {
18786 if(!e->next)
18787 {
18788 FreeType(e->destType);
18789 e->destType = t;
18790 if(e->destType)
18791 e->destType->refCount++;
18792 }
18793 ProcessExpressionType(e);
18794 if(!e->next)
18795 {
18796 exp->expType = e->expType;
18797 if(e->expType)
18798 e->expType->refCount++;
18799 }
18800 if(!e->isConstant)
18801 exp->isConstant = 0;
18802 }
18803 FreeType(exp->__anon1.cond.elseExp->destType);
18804 exp->__anon1.cond.elseExp->destType = t ? t : exp->expType;
18805 if(exp->__anon1.cond.elseExp->destType)
18806 exp->__anon1.cond.elseExp->destType->refCount++;
18807 ProcessExpressionType(exp->__anon1.cond.elseExp);
18808 if(!exp->__anon1.cond.elseExp->isConstant)
18809 exp->isConstant = 0;
18810 FreeType(t);
18811 break;
18812 }
18813 case 23:
18814 {
18815 if(exp->__anon1.compound && exp->__anon1.compound->__anon1.compound.statements && (*exp->__anon1.compound->__anon1.compound.statements).last)
18816 {
18817 struct Statement * last = (*exp->__anon1.compound->__anon1.compound.statements).last;
18818
18819 if(last->type == 3 && last->__anon1.expressions && (*last->__anon1.expressions).last)
18820 {
18821 ((struct Expression *)(*last->__anon1.expressions).last)->destType = exp->destType;
18822 if(exp->destType)
18823 exp->destType->refCount++;
18824 }
18825 ProcessStatement(exp->__anon1.compound);
18826 exp->expType = (last->__anon1.expressions && (*last->__anon1.expressions).last) ? ((struct Expression *)(*last->__anon1.expressions).last)->expType : (((void *)0));
18827 if(exp->expType)
18828 exp->expType->refCount++;
18829 }
18830 break;
18831 }
18832 case 24:
18833 {
18834 struct Specifier * spec = (*exp->__anon1._classExp.specifiers).first;
18835
18836 if(spec && spec->type == 1)
18837 {
18838 exp->expType = MkClassType(spec->__anon1.__anon1.name);
18839 exp->expType->kind = 19;
18840 exp->byReference = 1;
18841 }
18842 else
18843 {
18844 exp->expType = MkClassType("ecere::com::Class");
18845 exp->byReference = 1;
18846 }
18847 break;
18848 }
18849 case 25:
18850 {
18851 struct __ecereNameSpace__ecere__com__Class * _class = thisClass ? thisClass : currentClass;
18852
18853 if(_class)
18854 {
18855 struct Identifier * id = exp->__anon1.classData.id;
18856 char structName[1024];
18857 struct Expression * classExp;
18858
18859 strcpy(structName, "__ecereClassData_");
18860 FullClassNameCat(structName, _class->fullName, 0);
18861 exp->type = 9;
18862 exp->__anon1.member.member = id;
18863 if(curCompound && FindSymbol("this", curContext, curCompound->__anon1.compound.context, 0, 0))
18864 classExp = MkExpMember(MkExpIdentifier(MkIdentifier("this")), MkIdentifier("_class"));
18865 else
18866 classExp = MkExpIdentifier(MkIdentifier("class"));
18867 exp->__anon1.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"))))))));
18868 ProcessExpressionType(exp);
18869 return ;
18870 }
18871 break;
18872 }
18873 case 35:
18874 {
18875 struct Type * type = (((void *)0));
18876 const char * typeString = (((void *)0));
18877 char typeStringBuf[1024];
18878
18879 if(exp->destType && exp->destType->kind == 8 && exp->destType->__anon1._class && exp->destType->__anon1._class->__anon1.registered && exp->destType->__anon1._class->__anon1.registered != containerClass && __ecereNameSpace__ecere__com__eClass_IsDerived(exp->destType->__anon1._class->__anon1.registered, containerClass))
18880 {
18881 struct __ecereNameSpace__ecere__com__Class * templateClass = exp->destType->__anon1._class->__anon1.registered;
18882
18883 typeString = templateClass->templateArgs[2].__anon1.__anon1.dataTypeString;
18884 }
18885 else if(exp->__anon1.list)
18886 {
18887 struct Expression * e;
18888
18889 for(e = (*exp->__anon1.list).first; e; e = e->next)
18890 {
18891 ProcessExpressionType(e);
18892 if(e->expType)
18893 {
18894 if(!type)
18895 {
18896 type = e->expType;
18897 type->refCount++;
18898 }
18899 else
18900 {
18901 if(!MatchTypeExpression(e, type, (((void *)0)), 0, 1))
18902 {
18903 FreeType(type);
18904 type = e->expType;
18905 e->expType = (((void *)0));
18906 e = (*exp->__anon1.list).first;
18907 ProcessExpressionType(e);
18908 if(e->expType)
18909 {
18910 if(!MatchTypeExpression(e, type, (((void *)0)), 0, 1))
18911 {
18912 FreeType(e->expType);
18913 e->expType = (((void *)0));
18914 FreeType(type);
18915 type = (((void *)0));
18916 break;
18917 }
18918 }
18919 }
18920 }
18921 if(e->expType)
18922 {
18923 FreeType(e->expType);
18924 e->expType = (((void *)0));
18925 }
18926 }
18927 }
18928 if(type)
18929 {
18930 typeStringBuf[0] = '\0';
18931 PrintTypeNoConst(type, typeStringBuf, 0, 1);
18932 typeString = typeStringBuf;
18933 FreeType(type);
18934 type = (((void *)0));
18935 }
18936 }
18937 if(typeString)
18938 {
18939 char templateString[1024];
18940 struct __ecereNameSpace__ecere__sys__OldList * initializers = MkList();
18941 struct __ecereNameSpace__ecere__sys__OldList * structInitializers = MkList();
18942 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
18943 struct Expression * expExt;
18944 struct Declarator * decl = SpecDeclFromString(typeString, specs, (((void *)0)));
18945
18946 sprintf(templateString, "Container<%s>", typeString);
18947 if(exp->__anon1.list)
18948 {
18949 struct Expression * e;
18950
18951 type = ProcessTypeString(typeString, 0);
18952 while((e = (*exp->__anon1.list).first))
18953 {
18954 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*exp->__anon1.list), e);
18955 e->destType = type;
18956 type->refCount++;
18957 ProcessExpressionType(e);
18958 ListAdd(initializers, MkInitializerAssignment(e));
18959 }
18960 FreeType(type);
18961 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->__anon1.list), exp->__anon1.list = 0);
18962 }
18963 DeclareStruct(curExternal, "ecere::com::BuiltInContainer", 0, 1);
18964 ListAdd(structInitializers, MkInitializerAssignment(MkExpMember(MkExpClass(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0))), MkIdentifier("_vTbl"))));
18965 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->__anon1.exp);
18966 ListAdd(structInitializers, MkInitializerAssignment(MkExpClass(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0)))));
18967 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->__anon1.exp);
18968 ListAdd(structInitializers, MkInitializerAssignment(MkExpConstant("0")));
18969 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->__anon1.exp);
18970 ListAdd(structInitializers, MkInitializerAssignment(MkExpExtensionInitializer(MkTypeName(specs, MkDeclaratorArray(decl, (((void *)0)))), MkInitializerList(initializers))));
18971 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->__anon1.exp);
18972 ListAdd(structInitializers, MkInitializerAssignment(__extension__ ({
18973 struct Expression * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
18974
18975 __ecereInstance1->type = 2, __ecereInstance1->__anon1.__anon1.constant = __ecereNameSpace__ecere__com__PrintString(__ecereClass_int, (void *)&(*initializers).count, (void *)0), __ecereInstance1;
18976 })));
18977 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->__anon1.exp);
18978 ListAdd(structInitializers, MkInitializerAssignment(MkExpClass(CopyList(specs, (void *)(CopySpecifier)), CopyDeclarator(decl))));
18979 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->__anon1.exp);
18980 exp->expType = ProcessTypeString(templateString, 0);
18981 exp->type = 5;
18982 exp->__anon1.list = MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName(templateString)), (((void *)0))), MkExpOp((((void *)0)), '&', expExt = MkExpExtensionInitializer(MkTypeName(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0))), MkInitializerList(structInitializers)))));
18983 ProcessExpressionType(expExt);
18984 }
18985 else
18986 {
18987 exp->expType = ProcessTypeString("Container", 0);
18988 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Couldn't determine type of array elements\n", (((void *)0))));
18989 }
18990 break;
18991 }
18992 }
18993 if(exp->expType && exp->expType->kind == 21 && thisClass && (!exp->destType || exp->destType->kind != 21))
18994 {
18995 FreeType(exp->expType);
18996 exp->expType = ReplaceThisClassType(thisClass);
18997 }
18998 if(exp->expType && (exp->expType->kind == 9 || exp->expType->kind == 10 || exp->expType->kind == 15) && !exp->expType->__anon1.__anon1.members.first && exp->expType->__anon1.__anon1.enumName)
18999 {
19000 struct Symbol * symbol = FindSymbol(exp->expType->__anon1.__anon1.enumName, curContext, globalContext, 1, 0);
19001
19002 if(symbol)
19003 {
19004 if(exp->expType->kind != 15)
19005 {
19006 struct Type * member;
19007 char * enumName = __ecereNameSpace__ecere__sys__CopyString(exp->expType->__anon1.__anon1.enumName);
19008
19009 FreeType(exp->expType);
19010 exp->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
19011 exp->expType->kind = symbol->type->kind;
19012 exp->expType->refCount++;
19013 exp->expType->__anon1.__anon1.enumName = enumName;
19014 exp->expType->__anon1.__anon1.members = symbol->type->__anon1.__anon1.members;
19015 for(member = symbol->type->__anon1.__anon1.members.first; member; member = member->next)
19016 member->refCount++;
19017 }
19018 else
19019 {
19020 struct __ecereNameSpace__ecere__sys__NamedLink64 * member;
19021
19022 for(member = symbol->type->__anon1.__anon1.members.first; member; member = member->next)
19023 {
19024 struct __ecereNameSpace__ecere__sys__NamedLink64 * value = (value = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(struct __ecereNameSpace__ecere__sys__NamedLink64)), value->name = __ecereNameSpace__ecere__sys__CopyString(member->name), value);
19025
19026 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&exp->expType->__anon1.__anon1.members, value);
19027 }
19028 }
19029 }
19030 }
19031 if(!notByReference && exp->expType && exp->expType->kind == 8 && exp->expType->__anon1._class && exp->expType->__anon1._class->__anon1.registered && exp->expType->__anon1._class->__anon1.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)))
19032 {
19033 exp->byReference = 1;
19034 }
19035 yylloc = exp->loc;
19036 if(exp->destType && (exp->destType->kind == 18))
19037 ;
19038 else if(exp->destType && !exp->destType->keepCast)
19039 {
19040 if(!exp->needTemplateCast && exp->expType && (exp->expType->kind == 20 || exp->expType->passAsTemplate))
19041 exp->needTemplateCast = 1;
19042 if(exp->destType->kind == 0)
19043 ;
19044 else if(!CheckExpressionType(exp, exp->destType, 0, !exp->destType->casted))
19045 {
19046 unsigned int invalidCast = 0;
19047
19048 if(inCompiler && exp->destType->count && exp->expType)
19049 {
19050 struct __ecereNameSpace__ecere__com__Class * c1 = (exp->expType->kind == 8 && exp->expType->__anon1._class) ? exp->expType->__anon1._class->__anon1.registered : (((void *)0));
19051 struct __ecereNameSpace__ecere__com__Class * c2 = (exp->destType->kind == 8 && exp->destType->__anon1._class) ? exp->destType->__anon1._class->__anon1.registered : (((void *)0));
19052
19053 if(c1 && c1->type != 1)
19054 c1 = (((void *)0));
19055 if(c2 && c2->type != 1)
19056 c2 = (((void *)0));
19057 if((c1 && !exp->expType->byReference && !c2 && !__ecereProp_Type_Get_isPointerType(exp->destType)) || (c2 && !exp->destType->byReference && !c1 && !__ecereProp_Type_Get_isPointerType(exp->expType)))
19058 invalidCast = 1;
19059 }
19060 if(!exp->destType->count || unresolved || invalidCast)
19061 {
19062 if(!exp->expType)
19063 {
19064 yylloc = exp->loc;
19065 if(exp->destType->kind != 14)
19066 {
19067 char type2[1024];
19068
19069 type2[0] = '\0';
19070 if(inCompiler)
19071 {
19072 char expString[10240];
19073
19074 expString[0] = '\0';
19075 PrintType(exp->destType, type2, 0, 1);
19076 if(inCompiler)
19077 {
19078 PrintExpression(exp, expString);
19079 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
19080 }
19081 if(unresolved)
19082 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved identifier %s; expected %s\n", (((void *)0))), expString, type2);
19083 else if(exp->type != 16)
19084 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s; expected %s\n", (((void *)0))), expString, type2);
19085 }
19086 }
19087 else
19088 {
19089 char expString[10240];
19090
19091 expString[0] = '\0';
19092 if(inCompiler)
19093 {
19094 PrintExpression(exp, expString);
19095 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
19096 }
19097 if(unresolved)
19098 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved identifier %s\n", (((void *)0))), expString);
19099 else if(exp->type != 16)
19100 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s\n", (((void *)0))), expString);
19101 }
19102 }
19103 else
19104 {
19105 char type1[1024];
19106 char type2[1024];
19107
19108 type1[0] = '\0';
19109 type2[0] = '\0';
19110 if(inCompiler)
19111 {
19112 PrintType(exp->expType, type1, 0, 1);
19113 PrintType(exp->destType, type2, 0, 1);
19114 }
19115 if(exp->destType->truth && exp->destType->__anon1._class && exp->destType->__anon1._class->__anon1.registered && !strcmp(exp->destType->__anon1._class->__anon1.registered->name, "bool") && exp->expType->kind != 0 && exp->expType->kind != 9 && exp->expType->kind != 10 && (exp->expType->kind != 8 || exp->expType->classObjectType || (exp->expType->__anon1._class && exp->expType->__anon1._class->__anon1.registered && exp->expType->__anon1._class->__anon1.registered->type != 1)))
19116 ;
19117 else
19118 {
19119 struct Expression * nbExp = GetNonBracketsExp(exp);
19120 unsigned int skipWarning = 0;
19121 int kind = exp->destType->kind;
19122
19123 if(nbExp->type == 12 && nbExp->destType && !nbExp->destType->casted && nbExp->destType->kind == exp->destType->kind)
19124 skipWarning = 1;
19125 if((kind == 1 || kind == 2) && exp->destType->isSigned == exp->expType->signedBeforePromotion && nbExp->type == 4 && nbExp->__anon1.op.exp1 && nbExp->__anon1.op.exp2)
19126 {
19127 int op = nbExp->__anon1.op.op;
19128 struct Expression * nbExp1, * nbExp2;
19129 int from;
19130
19131 switch(op)
19132 {
19133 case '%':
19134 case '/':
19135 nbExp1 = GetNonBracketsExp(nbExp->__anon1.op.exp1);
19136 from = nbExp1->expType->promotedFrom;
19137 if(from == 1 || (kind == 2 && from == 2))
19138 skipWarning = 1;
19139 break;
19140 case LEFT_OP:
19141 case RIGHT_OP:
19142 nbExp1 = GetNonBracketsExp(nbExp->__anon1.op.exp1);
19143 nbExp2 = GetNonBracketsExp(nbExp->__anon1.op.exp2);
19144 from = nbExp1->expType->promotedFrom;
19145 if(op == RIGHT_OP && (from == 1 || (kind == 2 && from == 2)))
19146 skipWarning = 1;
19147 else if(nbExp2->isConstant && nbExp2->type == 2 && (nbExp->__anon1.op.op == RIGHT_OP || nbExp1->expType->bitMemberSize))
19148 {
19149 int n = strtol(nbExp2->__anon1.__anon1.constant, (((void *)0)), 0);
19150 int s = from == 1 ? 8 : 16;
19151
19152 if(nbExp1->expType->bitMemberSize && nbExp1->expType->bitMemberSize < s)
19153 s = nbExp1->expType->bitMemberSize;
19154 if(nbExp->__anon1.op.op == RIGHT_OP)
19155 s -= n;
19156 else
19157 s += n;
19158 if(s <= (kind == 1 ? 8 : 16))
19159 skipWarning = 1;
19160 }
19161 break;
19162 case '-':
19163 if(!exp->destType->isSigned)
19164 {
19165 nbExp1 = GetNonBracketsExp(nbExp->__anon1.op.exp1);
19166 nbExp2 = GetNonBracketsExp(nbExp->__anon1.op.exp2);
19167 from = nbExp2->expType->promotedFrom;
19168 if((from == 1 || from == 2) && nbExp1->isConstant && nbExp1->type == 2)
19169 {
19170 int n = strtol(nbExp1->__anon1.__anon1.constant, (((void *)0)), 0);
19171
19172 if(n == (from == 1 ? 255 : 65535))
19173 skipWarning = 1;
19174 }
19175 }
19176 break;
19177 case '|':
19178 {
19179 int kind1, kind2;
19180
19181 nbExp1 = GetNonBracketsExp(nbExp->__anon1.op.exp1);
19182 nbExp2 = GetNonBracketsExp(nbExp->__anon1.op.exp2);
19183 kind1 = nbExp1->expType->promotedFrom ? nbExp1->expType->promotedFrom : nbExp1->expType->kind;
19184 kind2 = nbExp2->expType->promotedFrom ? nbExp2->expType->promotedFrom : nbExp2->expType->kind;
19185 if(((kind1 == 1 || (kind1 == 2 && kind == 2)) || MatchTypeExpression(nbExp1, exp->destType, (((void *)0)), 0, 0)) && ((kind2 == 1 || (kind2 == 2 && kind == 2)) || MatchTypeExpression(nbExp2, exp->destType, (((void *)0)), 0, 0)))
19186 skipWarning = 1;
19187 break;
19188 }
19189 case '&':
19190 {
19191 int kind1, kind2;
19192
19193 nbExp1 = GetNonBracketsExp(nbExp->__anon1.op.exp1);
19194 nbExp2 = GetNonBracketsExp(nbExp->__anon1.op.exp2);
19195 kind1 = nbExp1->expType->promotedFrom ? nbExp1->expType->promotedFrom : nbExp1->expType->kind;
19196 kind2 = nbExp2->expType->promotedFrom ? nbExp2->expType->promotedFrom : nbExp2->expType->kind;
19197 if(((kind1 == 1 || (kind1 == 2 && kind == 2)) || MatchTypeExpression(nbExp1, exp->destType, (((void *)0)), 0, 0)) || ((kind2 == 1 || (kind2 == 2 && kind == 2)) || MatchTypeExpression(nbExp2, exp->destType, (((void *)0)), 0, 0)))
19198 skipWarning = 1;
19199 break;
19200 }
19201 }
19202 }
19203 if(!skipWarning)
19204 {
19205 char expString[10240];
19206
19207 expString[0] = '\0';
19208 if(inCompiler)
19209 {
19210 PrintExpression(exp, expString);
19211 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
19212 }
19213 if(!sourceFile || (!strstr(sourceFile, "src\\lexer.ec") && !strstr(sourceFile, "src/lexer.ec") && !strstr(sourceFile, "src\\grammar.ec") && !strstr(sourceFile, "src/grammar.ec") && !strstr(sourceFile, "src\\type.ec") && !strstr(sourceFile, "src/type.ec") && !strstr(sourceFile, "src\\expression.ec") && !strstr(sourceFile, "src/expression.ec")))
19214 {
19215 if(invalidCast)
19216 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expression %s (%s); expected %s\n", (((void *)0))), expString, type1, type2);
19217 else
19218 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expression %s (%s); expected %s\n", (((void *)0))), expString, type1, type2);
19219 }
19220 }
19221 if(!inCompiler)
19222 {
19223 FreeType(exp->expType);
19224 exp->destType->refCount++;
19225 exp->expType = exp->destType;
19226 }
19227 }
19228 }
19229 }
19230 }
19231 else if(exp->destType && exp->destType->kind == 13 && exp->destType->__anon1.type && exp->destType->__anon1.type->kind == 11 && exp->expType && (exp->expType->kind == 11 || exp->expType->kind == 16))
19232 {
19233 struct Expression * nbExp = GetNonBracketsExp(exp);
19234
19235 if(nbExp->type != 11 || !IsVoidPtrCast(nbExp->__anon1.cast.typeName))
19236 {
19237 struct Expression * e = MoveExpContents(exp);
19238
19239 exp->__anon1.cast.exp = MkExpBrackets(MkListOne(e));
19240 exp->type = 11;
19241 exp->__anon1.cast.exp->destType = exp->destType;
19242 if(exp->destType)
19243 exp->destType->refCount++;
19244 exp->__anon1.cast.typeName = MkTypeName(MkListOne(MkSpecifier(VOID)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0))));
19245 }
19246 }
19247 }
19248 else if(unresolved)
19249 {
19250 if(exp->__anon1.__anon1.identifier->_class && exp->__anon1.__anon1.identifier->_class->__anon1.__anon1.name)
19251 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved identifier %s::%s\n", (((void *)0))), exp->__anon1.__anon1.identifier->_class->__anon1.__anon1.name, exp->__anon1.__anon1.identifier->string);
19252 else if(exp->__anon1.__anon1.identifier->string && exp->__anon1.__anon1.identifier->string[0])
19253 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved identifier %s\n", (((void *)0))), exp->__anon1.__anon1.identifier->string);
19254 }
19255 else if(!exp->expType && exp->type != 16)
19256 {
19257 char expString[10240];
19258
19259 expString[0] = '\0';
19260 if(inCompiler)
19261 {
19262 PrintExpression(exp, expString);
19263 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
19264 }
19265 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s\n", (((void *)0))), expString);
19266 }
19267 if(inCompiler)
19268 ApplyAnyObjectLogic(exp);
19269 if(!notByReference && exp->expType && exp->expType->kind == 8 && exp->expType->__anon1._class && exp->expType->__anon1._class->__anon1.registered && exp->expType->__anon1._class->__anon1.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)))
19270 {
19271 exp->byReference = 1;
19272 }
19273 yylloc = oldyylloc;
19274 }
19275
19276 static void ProcessFunction(struct FunctionDefinition * function)
19277 {
19278 struct Identifier * id = GetDeclId(function->declarator);
19279 struct Symbol * symbol = function->declarator ? function->declarator->symbol : (((void *)0));
19280 struct Type * type = symbol ? symbol->type : (((void *)0));
19281 struct __ecereNameSpace__ecere__com__Class * oldThisClass = thisClass;
19282 struct Context * oldTopContext = topContext;
19283
19284 yylloc = function->loc;
19285 if(type && type->__anon1.__anon2.thisClass)
19286 {
19287 struct Symbol * classSym = type->__anon1.__anon2.thisClass;
19288 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1.__anon2.thisClass->__anon1.registered;
19289 char className[1024];
19290 char structName[1024];
19291 struct Declarator * funcDecl;
19292 struct Symbol * thisSymbol;
19293 unsigned int typedObject = 0;
19294
19295 if(_class && !_class->base)
19296 {
19297 _class = currentClass;
19298 if(_class && !_class->symbol)
19299 _class->symbol = FindClass(_class->fullName);
19300 classSym = _class ? _class->symbol : (((void *)0));
19301 typedObject = 1;
19302 }
19303 thisClass = _class;
19304 if(inCompiler && _class)
19305 {
19306 if(type->kind == 11)
19307 {
19308 if(symbol->type->__anon1.__anon2.params.count == 1 && ((struct Type *)symbol->type->__anon1.__anon2.params.first)->kind == 0)
19309 {
19310 struct Type * param = symbol->type->__anon1.__anon2.params.first;
19311
19312 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(&symbol->type->__anon1.__anon2.params, param);
19313 FreeType(param);
19314 }
19315 if(type->classObjectType != 1)
19316 {
19317 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(&symbol->type->__anon1.__anon2.params, (((void *)0)), MkClassType(_class->fullName));
19318 symbol->type->__anon1.__anon2.staticMethod = 1;
19319 symbol->type->__anon1.__anon2.thisClass = (((void *)0));
19320 symbol->type->extraParam = 0;
19321 }
19322 }
19323 strcpy(className, "__ecereClass_");
19324 FullClassNameCat(className, _class->fullName, 1);
19325 structName[0] = 0;
19326 FullClassNameCat(structName, _class->fullName, 0);
19327 funcDecl = GetFuncDecl(function->declarator);
19328 if(funcDecl)
19329 {
19330 if(funcDecl->__anon1.function.parameters && (*funcDecl->__anon1.function.parameters).count == 1)
19331 {
19332 struct TypeName * param = (*funcDecl->__anon1.function.parameters).first;
19333
19334 if(param->qualifiers && (*param->qualifiers).count == 1 && ((struct Specifier *)(*param->qualifiers).first)->__anon1.specifier == VOID && !param->declarator)
19335 {
19336 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->__anon1.function.parameters), param);
19337 FreeTypeName(param);
19338 }
19339 }
19340 if(!function->propertyNoThis)
19341 {
19342 struct TypeName * thisParam = (((void *)0));
19343
19344 if(type->classObjectType != 1)
19345 {
19346 thisParam = QMkClass(_class->fullName, MkDeclaratorIdentifier(MkIdentifier("this")));
19347 if(!funcDecl->__anon1.function.parameters)
19348 funcDecl->__anon1.function.parameters = MkList();
19349 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->__anon1.function.parameters), (((void *)0)), thisParam);
19350 }
19351 if(typedObject)
19352 {
19353 if(type->classObjectType != 1)
19354 {
19355 if(type->byReference || _class->type == 3 || _class->type == 1000 || _class->type == 4 || _class->type == 2)
19356 thisParam->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), thisParam->declarator);
19357 }
19358 thisParam = __extension__ ({
19359 struct TypeName * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TypeName);
19360
19361 __ecereInstance1->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier("class"))), __ecereInstance1->qualifiers = MkListOne(MkStructOrUnion(3, MkIdentifier("__ecereNameSpace__ecere__com__Class"), (((void *)0)))), __ecereInstance1;
19362 });
19363 DeclareStruct(curExternal, "ecere::com::Class", 0, 1);
19364 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->__anon1.function.parameters), (((void *)0)), thisParam);
19365 }
19366 }
19367 }
19368 if(symbol && symbol->__anon2.__anon1.pointerExternal && symbol->__anon2.__anon1.pointerExternal->type == 1)
19369 {
19370 struct InitDeclarator * initDecl = (*symbol->__anon2.__anon1.pointerExternal->__anon1.declaration->__anon1.__anon1.declarators).first;
19371
19372 funcDecl = GetFuncDecl(initDecl->declarator);
19373 if(funcDecl)
19374 {
19375 if(funcDecl->__anon1.function.parameters && (*funcDecl->__anon1.function.parameters).count == 1)
19376 {
19377 struct TypeName * param = (*funcDecl->__anon1.function.parameters).first;
19378
19379 if(param->qualifiers && (*param->qualifiers).count == 1 && ((struct Specifier *)(*param->qualifiers).first)->__anon1.specifier == VOID && !param->declarator)
19380 {
19381 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->__anon1.function.parameters), param);
19382 FreeTypeName(param);
19383 }
19384 }
19385 if(type->classObjectType != 1)
19386 {
19387 if((_class->type != 2 && _class->type != 3 && _class->type != 4) || function != (struct FunctionDefinition *)symbol->__anon2.__anon2.externalSet)
19388 {
19389 struct TypeName * thisParam = QMkClass(_class->fullName, MkDeclaratorIdentifier(MkIdentifier("this")));
19390
19391 if(!funcDecl->__anon1.function.parameters)
19392 funcDecl->__anon1.function.parameters = MkList();
19393 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->__anon1.function.parameters), (((void *)0)), thisParam);
19394 }
19395 }
19396 }
19397 }
19398 }
19399 if(function->body)
19400 {
19401 if(type->classObjectType != 1)
19402 {
19403 thisSymbol = __extension__ ({
19404 struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
19405
19406 __ecereInstance1->string = __ecereNameSpace__ecere__sys__CopyString("this"), __ecereInstance1->type = classSym ? MkClassType(classSym->string) : (((void *)0)), __ecereInstance1;
19407 });
19408 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&function->body->__anon1.compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
19409 if(typedObject && thisSymbol->type)
19410 {
19411 thisSymbol->type->classObjectType = 2;
19412 thisSymbol->type->byReference = type->byReference;
19413 thisSymbol->type->typedByReference = type->byReference;
19414 }
19415 }
19416 }
19417 if(inCompiler && _class && _class->type == 0 && type->classObjectType != 1)
19418 {
19419 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
19420
19421 {
19422 struct __ecereNameSpace__ecere__com__Class * base;
19423
19424 for(base = _class; base && base->type != 1000; base = base->next)
19425 {
19426 for(member = base->membersAndProperties.first; member; member = member->next)
19427 if(!member->isProperty)
19428 break;
19429 if(member)
19430 break;
19431 }
19432 }
19433 for(member = _class->membersAndProperties.first; member; member = member->next)
19434 if(!member->isProperty)
19435 break;
19436 if(member)
19437 {
19438 char pointerName[1024];
19439 struct Declaration * decl;
19440 struct Initializer * initializer;
19441 struct Expression * exp, * bytePtr;
19442
19443 strcpy(pointerName, "__ecerePointer_");
19444 FullClassNameCat(pointerName, _class->fullName, 0);
19445 {
19446 char className[1024];
19447
19448 strcpy(className, "__ecereClass_");
19449 FullClassNameCat(className, classSym->string, 1);
19450 DeclareClass(curExternal, classSym, className);
19451 }
19452 bytePtr = QBrackets(MkExpCast(QMkType("char", QMkPtrDecl((((void *)0)))), QMkExpId("this")));
19453 if(_class->fixed)
19454 {
19455 struct Expression * e;
19456
19457 if(_class->offset && _class->offset == (_class->base->type == 5 ? _class->base->memberOffset : _class->base->structSize))
19458 {
19459 e = MkExpClassSize(MkSpecifierName(_class->base->fullName));
19460 ProcessExpressionType(e);
19461 }
19462 else
19463 {
19464 char string[256];
19465
19466 sprintf(string, "%d", _class->offset);
19467 e = MkExpConstant(string);
19468 }
19469 exp = QBrackets(MkExpOp(bytePtr, '+', e));
19470 }
19471 else
19472 {
19473 exp = QBrackets(MkExpOp(bytePtr, '+', MkExpPointer(QMkExpId(className), MkIdentifier("offset"))));
19474 }
19475 exp = QBrackets(QMkExpCond(QMkExpId("this"), exp, MkExpConstant("0")));
19476 exp->expType = __extension__ ({
19477 struct Type * __ecereInstance2 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
19478
19479 __ecereInstance2->refCount = 1, __ecereInstance2->kind = 13, __ecereInstance2->__anon1.type = __extension__ ({
19480 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
19481
19482 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 0, __ecereInstance1;
19483 }), __ecereInstance2;
19484 });
19485 if(function->body)
19486 {
19487 yylloc = function->body->loc;
19488 initializer = MkInitializerAssignment(MkExpCast(MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(structName), (((void *)0)))), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), exp));
19489 {
19490 struct Context * prevContext = curContext;
19491 struct __ecereNameSpace__ecere__sys__OldList * list;
19492
19493 curContext = function->body->__anon1.compound.context;
19494 decl = MkDeclaration((list = MkListOne(MkStructOrUnion(3, MkIdentifier(structName), (((void *)0))))), MkListOne(MkInitDeclarator(QMkPtrDecl(pointerName), initializer)));
19495 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*list), (((void *)0)), MkSpecifierExtended(MkExtDeclAttrib(MkAttrib(ATTRIB, MkListOne(MkAttribute(__ecereNameSpace__ecere__sys__CopyString("unused"), (((void *)0))))))));
19496 curContext = prevContext;
19497 }
19498 decl->symbol = (((void *)0));
19499 if(!function->body->__anon1.compound.declarations)
19500 function->body->__anon1.compound.declarations = MkList();
19501 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*function->body->__anon1.compound.declarations), (((void *)0)), decl);
19502 }
19503 }
19504 }
19505 }
19506 else
19507 thisClass = (((void *)0));
19508 if(id)
19509 {
19510 FreeSpecifier(id->_class);
19511 id->_class = (((void *)0));
19512 if(symbol && symbol->__anon2.__anon1.pointerExternal && symbol->__anon2.__anon1.pointerExternal->type == 1)
19513 {
19514 struct InitDeclarator * initDecl = (*symbol->__anon2.__anon1.pointerExternal->__anon1.declaration->__anon1.__anon1.declarators).first;
19515
19516 id = GetDeclId(initDecl->declarator);
19517 FreeSpecifier(id->_class);
19518 id->_class = (((void *)0));
19519 }
19520 }
19521 if(function->body)
19522 topContext = function->body->__anon1.compound.context;
19523 {
19524 struct FunctionDefinition * oldFunction = curFunction;
19525
19526 curFunction = function;
19527 if(function->body)
19528 ProcessStatement(function->body);
19529 if(inCompiler && function->propSet && !function->propSet->fireWatchersDone)
19530 {
19531 struct Statement * prevCompound = curCompound;
19532 struct Context * prevContext = curContext;
19533 struct Statement * fireWatchers = MkFireWatchersStmt((((void *)0)), (((void *)0)));
19534
19535 if(!function->body->__anon1.compound.statements)
19536 function->body->__anon1.compound.statements = MkList();
19537 ListAdd(function->body->__anon1.compound.statements, fireWatchers);
19538 curCompound = function->body;
19539 curContext = function->body->__anon1.compound.context;
19540 ProcessStatement(fireWatchers);
19541 curContext = prevContext;
19542 curCompound = prevCompound;
19543 }
19544 curFunction = oldFunction;
19545 }
19546 if(function->declarator)
19547 {
19548 ProcessDeclarator(function->declarator, 1);
19549 }
19550 topContext = oldTopContext;
19551 thisClass = oldThisClass;
19552 }
19553
19554 static void ProcessClass(struct __ecereNameSpace__ecere__sys__OldList * definitions, struct Symbol * symbol)
19555 {
19556 struct ClassDef * def;
19557 struct External * external = curExternal;
19558 struct __ecereNameSpace__ecere__com__Class * regClass = symbol ? symbol->__anon1.registered : (((void *)0));
19559
19560 for(def = definitions->first; def; def = def->next)
19561 {
19562 if(def->type == 0)
19563 {
19564 if(def->__anon1.function->declarator)
19565 curExternal = def->__anon1.function->declarator->symbol->__anon2.__anon1.pointerExternal;
19566 else
19567 curExternal = external;
19568 ProcessFunction((struct FunctionDefinition *)def->__anon1.function);
19569 }
19570 else if(def->type == 2)
19571 {
19572 if(def->__anon1.decl->type == 2)
19573 {
19574 thisClass = regClass;
19575 ProcessInstantiationType(def->__anon1.decl->__anon1.inst);
19576 thisClass = (((void *)0));
19577 }
19578 else
19579 {
19580 struct __ecereNameSpace__ecere__com__Class * backThisClass = thisClass;
19581
19582 if(regClass)
19583 thisClass = regClass;
19584 ProcessDeclaration(def->__anon1.decl, symbol ? 1 : 0);
19585 thisClass = backThisClass;
19586 }
19587 }
19588 else if(def->type == 1 && def->__anon1.defProperties)
19589 {
19590 struct MemberInit * defProperty;
19591 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);
19592
19593 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
19594 for(defProperty = (*def->__anon1.defProperties).first; defProperty; defProperty = defProperty->next)
19595 {
19596 thisClass = regClass;
19597 ProcessMemberInitData(defProperty, regClass, (((void *)0)), (((void *)0)), (((void *)0)), (((void *)0)));
19598 thisClass = (((void *)0));
19599 }
19600 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Remove(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
19601 FreeSymbol(thisSymbol);
19602 }
19603 else if(def->type == 3 && def->__anon1.propertyDef)
19604 {
19605 struct PropertyDef * prop = def->__anon1.propertyDef;
19606
19607 thisClass = regClass;
19608 if(prop->setStmt)
19609 {
19610 if(regClass)
19611 {
19612 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
19613
19614 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->setStmt->__anon1.compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
19615 }
19616 curExternal = prop->symbol ? prop->symbol->__anon2.__anon2.externalSet : (((void *)0));
19617 ProcessStatement(prop->setStmt);
19618 }
19619 if(prop->getStmt)
19620 {
19621 if(regClass)
19622 {
19623 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
19624
19625 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->getStmt->__anon1.compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
19626 }
19627 curExternal = prop->symbol ? prop->symbol->__anon2.__anon2.externalGet : (((void *)0));
19628 ProcessStatement(prop->getStmt);
19629 }
19630 if(prop->issetStmt)
19631 {
19632 if(regClass)
19633 {
19634 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
19635
19636 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->issetStmt->__anon1.compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
19637 }
19638 curExternal = prop->symbol ? prop->symbol->__anon2.__anon2.externalIsSet : (((void *)0));
19639 ProcessStatement(prop->issetStmt);
19640 }
19641 thisClass = (((void *)0));
19642 }
19643 else if(def->type == 4 && def->__anon1.propertyWatch)
19644 {
19645 struct PropertyWatch * propertyWatch = def->__anon1.propertyWatch;
19646
19647 thisClass = regClass;
19648 if(propertyWatch->compound)
19649 {
19650 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);
19651
19652 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&propertyWatch->compound->__anon1.compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
19653 curExternal = (((void *)0));
19654 ProcessStatement(propertyWatch->compound);
19655 }
19656 thisClass = (((void *)0));
19657 }
19658 }
19659 }
19660
19661 void __ecereRegisterModule_pass15(struct __ecereNameSpace__ecere__com__Instance * module)
19662 {
19663 struct __ecereNameSpace__ecere__com__Class __attribute__((unused)) * class;
19664
19665 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetYydebug", "void SetYydebug(bool b)", SetYydebug, module, 1);
19666 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetThisClass", "void SetThisClass(ecere::com::Class c)", SetThisClass, module, 1);
19667 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetThisClass", "ecere::com::Class GetThisClass(void)", GetThisClass, module, 1);
19668 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintExpression", "void PrintExpression(Expression exp, char * string)", PrintExpression, module, 1);
19669 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessTemplateParameterType", "Type ProcessTemplateParameterType(TemplateParameter param)", ProcessTemplateParameterType, module, 2);
19670 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("NeedCast", "bool NeedCast(Type type1, Type type2)", NeedCast, module, 2);
19671 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintInt", "char * PrintInt(int64 result)", PrintInt, module, 1);
19672 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUInt", "char * PrintUInt(uint64 result)", PrintUInt, module, 1);
19673 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintInt64", "char * PrintInt64(int64 result)", PrintInt64, module, 1);
19674 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUInt64", "char * PrintUInt64(uint64 result)", PrintUInt64, module, 1);
19675 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintHexUInt", "char * PrintHexUInt(uint64 result)", PrintHexUInt, module, 1);
19676 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintHexUInt64", "char * PrintHexUInt64(uint64 result)", PrintHexUInt64, module, 1);
19677 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintShort", "char * PrintShort(short result)", PrintShort, module, 1);
19678 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUShort", "char * PrintUShort(uint16 result)", PrintUShort, module, 1);
19679 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintChar", "char * PrintChar(char result)", PrintChar, module, 1);
19680 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUChar", "char * PrintUChar(byte result)", PrintUChar, module, 1);
19681 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintFloat", "char * PrintFloat(float result)", PrintFloat, module, 1);
19682 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintDouble", "char * PrintDouble(double result)", PrintDouble, module, 1);
19683 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpInt", "bool GetOpInt(Operand op2, int * value2)", GetOpInt, module, 1);
19684 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetInt", "bool GetInt(Expression exp, int * value2)", GetInt, module, 1);
19685 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUInt", "bool GetOpUInt(Operand op2, uint * value2)", GetOpUInt, module, 1);
19686 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUInt", "bool GetUInt(Expression exp, uint * value2)", GetUInt, module, 1);
19687 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpInt64", "bool GetOpInt64(Operand op2, int64 * value2)", GetOpInt64, module, 1);
19688 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetInt64", "bool GetInt64(Expression exp, int64 * value2)", GetInt64, module, 1);
19689 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUInt64", "bool GetOpUInt64(Operand op2, uint64 * value2)", GetOpUInt64, module, 1);
19690 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUInt64", "bool GetUInt64(Expression exp, uint64 * value2)", GetUInt64, module, 1);
19691 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpIntPtr", "bool GetOpIntPtr(Operand op2, intptr * value2)", GetOpIntPtr, module, 1);
19692 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetIntPtr", "bool GetIntPtr(Expression exp, intptr * value2)", GetIntPtr, module, 1);
19693 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUIntPtr", "bool GetOpUIntPtr(Operand op2, uintptr * value2)", GetOpUIntPtr, module, 1);
19694 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUIntPtr", "bool GetUIntPtr(Expression exp, uintptr * value2)", GetUIntPtr, module, 1);
19695 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpIntSize", "bool GetOpIntSize(Operand op2, intsize * value2)", GetOpIntSize, module, 1);
19696 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetIntSize", "bool GetIntSize(Expression exp, intsize * value2)", GetIntSize, module, 1);
19697 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUIntSize", "bool GetOpUIntSize(Operand op2, uintsize * value2)", GetOpUIntSize, module, 1);
19698 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUIntSize", "bool GetUIntSize(Expression exp, uintsize * value2)", GetUIntSize, module, 1);
19699 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpShort", "bool GetOpShort(Operand op2, short * value2)", GetOpShort, module, 1);
19700 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetShort", "bool GetShort(Expression exp, short * value2)", GetShort, module, 1);
19701 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUShort", "bool GetOpUShort(Operand op2, uint16 * value2)", GetOpUShort, module, 1);
19702 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUShort", "bool GetUShort(Expression exp, uint16 * value2)", GetUShort, module, 1);
19703 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpChar", "bool GetOpChar(Operand op2, char * value2)", GetOpChar, module, 1);
19704 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetChar", "bool GetChar(Expression exp, char * value2)", GetChar, module, 1);
19705 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUChar", "bool GetOpUChar(Operand op2, byte * value2)", GetOpUChar, module, 1);
19706 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUChar", "bool GetUChar(Expression exp, byte * value2)", GetUChar, module, 1);
19707 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpFloat", "bool GetOpFloat(Operand op2, float * value2)", GetOpFloat, module, 1);
19708 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetFloat", "bool GetFloat(Expression exp, float * value2)", GetFloat, module, 1);
19709 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpDouble", "bool GetOpDouble(Operand op2, double * value2)", GetOpDouble, module, 1);
19710 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetDouble", "bool GetDouble(Expression exp, double * value2)", GetDouble, module, 1);
19711 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeClassMembers", "void ComputeClassMembers(ecere::com::Class _class, bool isMember)", ComputeClassMembers, module, 2);
19712 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeModuleClasses", "void ComputeModuleClasses(ecere::com::Module module)", ComputeModuleClasses, module, 1);
19713 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeTypeSize", "int ComputeTypeSize(Type type)", ComputeTypeSize, module, 1);
19714 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("AddMembers", "int AddMembers(External neededBy, ecere::sys::OldList * declarations, ecere::com::Class _class, bool isMember, uint * retSize, ecere::com::Class topClass, bool * addedPadding)", AddMembers, module, 2);
19715 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareStruct", "External DeclareStruct(External neededBy, const char * name, bool skipNoHead, bool needDereference)", DeclareStruct, module, 2);
19716 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("_DeclareStruct", "External _DeclareStruct(External neededBy, const char * name, bool skipNoHead, bool needDereference, bool fwdDecl)", _DeclareStruct, module, 2);
19717 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareProperty", "void DeclareProperty(External neededBy, ecere::com::Property prop, char * setName, char * getName)", DeclareProperty, module, 2);
19718 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("Dereference", "Type Dereference(Type source)", Dereference, module, 1);
19719 __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);
19720 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessInstantiationType", "void ProcessInstantiationType(Instantiation inst)", ProcessInstantiationType, module, 2);
19721 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareType", "void DeclareType(External neededFor, Type type, bool needDereference, bool forFunctionDef)", DeclareType, module, 2);
19722 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareTypeForwardDeclare", "void DeclareTypeForwardDeclare(External neededFor, Type type, bool needDereference, bool forFunctionDef)", DeclareTypeForwardDeclare, module, 2);
19723 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindTemplateArg", "ecere::com::ClassTemplateArgument * FindTemplateArg(ecere::com::Class _class, TemplateParameter param)", FindTemplateArg, module, 2);
19724 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetupTemplatesContext", "Context SetupTemplatesContext(ecere::com::Class _class)", SetupTemplatesContext, module, 1);
19725 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FinishTemplatesContext", "void FinishTemplatesContext(Context context)", FinishTemplatesContext, module, 1);
19726 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessMethodType", "void ProcessMethodType(ecere::com::Method method)", ProcessMethodType, module, 1);
19727 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessPropertyType", "void ProcessPropertyType(ecere::com::Property prop)", ProcessPropertyType, module, 1);
19728 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareMethod", "void DeclareMethod(External neededFor, ecere::com::Method method, const char * name)", DeclareMethod, module, 1);
19729 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClass", "char * ReplaceThisClass(ecere::com::Class _class)", ReplaceThisClass, module, 2);
19730 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClassType", "Type ReplaceThisClassType(ecere::com::Class _class)", ReplaceThisClassType, module, 2);
19731 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClassSpecifiers", "void ReplaceThisClassSpecifiers(ecere::sys::OldList specs, ecere::com::Class _class)", ReplaceThisClassSpecifiers, module, 2);
19732 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareFunction", "bool DeclareFunction(External neededFor, ecere::com::GlobalFunction function, char * name)", DeclareFunction, module, 2);
19733 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareGlobalData", "void DeclareGlobalData(External neededFor, GlobalData data)", DeclareGlobalData, module, 2);
19734 class = __ecereNameSpace__ecere__com__eSystem_RegisterClass(5, "Conversion", 0, sizeof(struct Conversion), 0, (void *)0, (void *)0, module, 2, 1);
19735 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->application == ((struct __ecereNameSpace__ecere__com__Module *)(((char *)__thisModule + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->application && class)
19736 __ecereClass_Conversion = class;
19737 __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, bool warnConst)", MatchTypes, module, 1);
19738 __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);
19739 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ModuleVisibility", "bool ModuleVisibility(ecere::com::Module searchIn, ecere::com::Module searchFor)", ModuleVisibility, module, 1);
19740 __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);
19741 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("MatchTypeExpression", "bool MatchTypeExpression(Expression sourceExp, Type dest, ecere::sys::OldList conversions, bool skipUnitBla, bool warnConst)", MatchTypeExpression, module, 2);
19742 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReadString", "void ReadString(char * output, char * string)", ReadString, module, 1);
19743 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("UnescapeString", "int UnescapeString(char * d, char * s, int len)", UnescapeString, module, 1);
19744 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("OffsetEscapedString", "char * OffsetEscapedString(char * s, int len, int offset)", OffsetEscapedString, module, 1);
19745 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOperand", "Operand GetOperand(Expression exp)", GetOperand, module, 1);
19746 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PopulateInstance", "void PopulateInstance(Instantiation inst)", PopulateInstance, module, 1);
19747 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeInstantiation", "void ComputeInstantiation(Expression exp)", ComputeInstantiation, module, 1);
19748 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CallOperator", "void CallOperator(Expression exp, Expression exp1, Expression exp2, Operand op1, Operand op2)", CallOperator, module, 1);
19749 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeExpression", "void ComputeExpression(Expression exp)", ComputeExpression, module, 1);
19750 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("modifyPassAsTemplate", "void modifyPassAsTemplate(Type * typePtr, bool value)", modifyPassAsTemplate, module, 1);
19751 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CheckTemplateTypes", "void CheckTemplateTypes(Expression exp)", CheckTemplateTypes, module, 1);
19752 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindSymbol", "Symbol FindSymbol(const char * name, Context startContext, Context endContext, bool isStruct, bool globalNameSpace)", FindSymbol, module, 1);
19753 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintType", "void PrintType(Type type, char * string, bool printName, bool fullName)", PrintType, module, 1);
19754 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintTypeNoConst", "void PrintTypeNoConst(Type type, char * string, bool printName, bool fullName)", PrintTypeNoConst, module, 1);
19755 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindMemberAndOffset", "Type FindMemberAndOffset(Type type, char * string, uint * offset)", FindMemberAndOffset, module, 1);
19756 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetParseError", "bool GetParseError(void)", GetParseError, module, 1);
19757 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ParseExpressionString", "Expression ParseExpressionString(char * expression)", ParseExpressionString, module, 1);
19758 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceExpContents", "void ReplaceExpContents(Expression checkedExp, Expression newExp)", ReplaceExpContents, module, 1);
19759 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ApplyAnyObjectLogic", "void ApplyAnyObjectLogic(Expression e)", ApplyAnyObjectLogic, module, 1);
19760 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ApplyLocation", "void ApplyLocation(Expression exp, Location loc)", ApplyLocation, module, 1);
19761 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("RelatedUnits", "bool RelatedUnits(ecere::com::Class c1, ecere::com::Class c2)", RelatedUnits, module, 1);
19762 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessExpressionType", "void ProcessExpressionType(Expression exp)", ProcessExpressionType, module, 1);
19763 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareFunctionUtil", "void DeclareFunctionUtil(External neededBy, const String s)", DeclareFunctionUtil, module, 1);
19764 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeDataTypes", "void ComputeDataTypes(void)", ComputeDataTypes, module, 1);
19765 }
19766