8ba6f197713b1e4207e55db4891e8400740083ca
[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, INT128 = 294, LONG = 295, SIGNED = 296, UNSIGNED = 297, FLOAT = 298, DOUBLE = 299, CONST = 300, VOLATILE = 301, VOID = 302, VALIST = 303, STRUCT = 304, UNION = 305, ENUM = 306, ELLIPSIS = 307, CASE = 308, DEFAULT = 309, IF = 310, SWITCH = 311, WHILE = 312, DO = 313, FOR = 314, GOTO = 315, CONTINUE = 316, BREAK = 317, RETURN = 318, IFX = 319, ELSE = 320, CLASS = 321, THISCLASS = 322, CLASS_NAME = 323, PROPERTY = 324, SETPROP = 325, GETPROP = 326, NEWOP = 327, RENEW = 328, DELETE = 329, EXT_DECL = 330, EXT_STORAGE = 331, IMPORT = 332, DEFINE = 333, VIRTUAL = 334, ATTRIB = 335, PUBLIC = 336, PRIVATE = 337, TYPED_OBJECT = 338, ANY_OBJECT = 339, _INCREF = 340, EXTENSION = 341, ASM = 342, TYPEOF = 343, WATCH = 344, STOPWATCHING = 345, FIREWATCHERS = 346, WATCHABLE = 347, CLASS_DESIGNER = 348, CLASS_NO_EXPANSION = 349, CLASS_FIXED = 350, ISPROPSET = 351, CLASS_DEFAULT_PROPERTY = 352, PROPERTY_CATEGORY = 353, CLASS_DATA = 354, CLASS_PROPERTY = 355, SUBCLASS = 356, NAMESPACE = 357, NEW0OP = 358, RENEW0 = 359, VAARG = 360, DBTABLE = 361, DBFIELD = 362, DBINDEX = 363, DATABASE_OPEN = 364, ALIGNOF = 365, ATTRIB_DEP = 366, __ATTRIB = 367, BOOL = 368, _BOOL = 369, _COMPLEX = 370, _IMAGINARY = 371, RESTRICT = 372, THREAD = 373, WIDE_STRING_LITERAL = 374, BUILTIN_OFFSETOF = 375
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 void CopyTypeInto(struct Type * type, struct Type * src);
695
696 extern struct Type * MkClassType(const char *  name);
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 unsigned int isVector : 1;
1863 } ecere_gcc_struct;
1864
1865 struct Specifier
1866 {
1867 struct Specifier * prev;
1868 struct Specifier * next;
1869 struct Location loc;
1870 int type;
1871 union
1872 {
1873 int specifier;
1874 struct
1875 {
1876 struct ExtDecl * extDecl;
1877 char *  name;
1878 struct Symbol * symbol;
1879 struct __ecereNameSpace__ecere__sys__OldList *  templateArgs;
1880 struct Specifier * nsSpec;
1881 } ecere_gcc_struct __anon1;
1882 struct
1883 {
1884 struct Identifier * id;
1885 struct __ecereNameSpace__ecere__sys__OldList *  list;
1886 struct __ecereNameSpace__ecere__sys__OldList *  baseSpecs;
1887 struct __ecereNameSpace__ecere__sys__OldList *  definitions;
1888 unsigned int addNameSpace;
1889 struct Context * ctx;
1890 struct ExtDecl * extDeclStruct;
1891 } ecere_gcc_struct __anon2;
1892 struct Expression * expression;
1893 struct Specifier * _class;
1894 struct TemplateParameter * templateParameter;
1895 } ecere_gcc_struct __anon1;
1896 } ecere_gcc_struct;
1897
1898 extern struct Expression * GetTemplateArgExp(struct TemplateParameter * param, struct __ecereNameSpace__ecere__com__Class * curClass, unsigned int pointer);
1899
1900 struct TemplatedType
1901 {
1902 uintptr_t key;
1903 struct __ecereNameSpace__ecere__sys__BTNode * parent;
1904 struct __ecereNameSpace__ecere__sys__BTNode * left;
1905 struct __ecereNameSpace__ecere__sys__BTNode * right;
1906 int depth;
1907 struct TemplateParameter * param;
1908 } ecere_gcc_struct;
1909
1910 struct Type * ProcessTemplateParameterType(struct TemplateParameter * param)
1911 {
1912 if(param && param->type == 0 && (param->__anon1.dataType || param->dataTypeString))
1913 {
1914 if(!param->baseType)
1915 {
1916 if(param->dataTypeString)
1917 param->baseType = ProcessTypeString(param->dataTypeString, 0);
1918 else
1919 param->baseType = ProcessType(param->__anon1.dataType->specifiers, param->__anon1.dataType->decl);
1920 }
1921 return param->baseType;
1922 }
1923 return (((void *)0));
1924 }
1925
1926 unsigned int NeedCast(struct Type * type1, struct Type * type2)
1927 {
1928 if(!type1 || !type2 || type1->keepCast || type2->keepCast)
1929 return 1;
1930 if(type1->kind == 20 && type2->kind == 4 && type2->passAsTemplate == 0)
1931 {
1932 return 0;
1933 }
1934 if(type1->kind == type2->kind && type1->isLong == type2->isLong)
1935 {
1936 switch(type1->kind)
1937 {
1938 case 24:
1939 case 1:
1940 case 2:
1941 case 3:
1942 case 4:
1943 case 22:
1944 case 23:
1945 if(type1->passAsTemplate && !type2->passAsTemplate)
1946 return 1;
1947 return type1->isSigned != type2->isSigned;
1948 case 8:
1949 return type1->__anon1._class != type2->__anon1._class;
1950 case 13:
1951 return (type1->__anon1.type && type2->__anon1.type && type1->__anon1.type->constant != type2->__anon1.type->constant) || NeedCast(type1->__anon1.type, type2->__anon1.type);
1952 default:
1953 return 1;
1954 }
1955 }
1956 return 1;
1957 }
1958
1959 unsigned int GetOpInt(struct Operand * op2, int * value2)
1960 {
1961 if(op2->kind == 3 && op2->type->isSigned)
1962 *value2 = op2->__anon1.i;
1963 else if(op2->kind == 3)
1964 *value2 = (int)op2->__anon1.ui;
1965 else if(op2->kind == 4 && op2->type->isSigned)
1966 *value2 = (int)op2->__anon1.i64;
1967 else if(op2->kind == 4)
1968 *value2 = (int)op2->__anon1.ui64;
1969 else if(op2->kind == 23 && op2->type->isSigned)
1970 *value2 = (int)op2->__anon1.i64;
1971 else if(op2->kind == 23)
1972 *value2 = (int)op2->__anon1.ui64;
1973 else if(op2->kind == 22 && op2->type->isSigned)
1974 *value2 = (int)op2->__anon1.i64;
1975 else if(op2->kind == 22)
1976 *value2 = (int)op2->__anon1.ui64;
1977 else if(op2->kind == 2 && op2->type->isSigned)
1978 *value2 = (int)op2->__anon1.s;
1979 else if(op2->kind == 2)
1980 *value2 = (int)op2->__anon1.us;
1981 else if(op2->kind == 1 && op2->type->isSigned)
1982 *value2 = (int)op2->__anon1.c;
1983 else if(op2->kind == 24 || op2->kind == 1)
1984 *value2 = (int)op2->__anon1.uc;
1985 else if(op2->kind == 6)
1986 *value2 = (int)op2->__anon1.f;
1987 else if(op2->kind == 7)
1988 *value2 = (int)op2->__anon1.d;
1989 else if(op2->kind == 13)
1990 *value2 = (int)op2->__anon1.ui64;
1991 else
1992 return 0;
1993 return 1;
1994 }
1995
1996 unsigned int GetOpUInt(struct Operand * op2, unsigned int * value2)
1997 {
1998 if(op2->kind == 3 && op2->type->isSigned)
1999 *value2 = (unsigned int)op2->__anon1.i;
2000 else if(op2->kind == 3)
2001 *value2 = op2->__anon1.ui;
2002 else if(op2->kind == 4 && op2->type->isSigned)
2003 *value2 = (unsigned int)op2->__anon1.i64;
2004 else if(op2->kind == 4)
2005 *value2 = (unsigned int)op2->__anon1.ui64;
2006 else if(op2->kind == 23 && op2->type->isSigned)
2007 *value2 = (unsigned int)op2->__anon1.i64;
2008 else if(op2->kind == 23)
2009 *value2 = (unsigned int)op2->__anon1.ui64;
2010 else if(op2->kind == 22 && op2->type->isSigned)
2011 *value2 = (unsigned int)op2->__anon1.i64;
2012 else if(op2->kind == 22)
2013 *value2 = (unsigned int)op2->__anon1.ui64;
2014 else if(op2->kind == 2 && op2->type->isSigned)
2015 *value2 = (unsigned int)op2->__anon1.s;
2016 else if(op2->kind == 2)
2017 *value2 = (unsigned int)op2->__anon1.us;
2018 else if(op2->kind == 1 && op2->type->isSigned)
2019 *value2 = (unsigned int)op2->__anon1.c;
2020 else if(op2->kind == 24 || op2->kind == 1)
2021 *value2 = (unsigned int)op2->__anon1.uc;
2022 else if(op2->kind == 6)
2023 *value2 = (unsigned int)op2->__anon1.f;
2024 else if(op2->kind == 7)
2025 *value2 = (unsigned int)op2->__anon1.d;
2026 else if(op2->kind == 13)
2027 *value2 = (unsigned int)op2->__anon1.ui64;
2028 else
2029 return 0;
2030 return 1;
2031 }
2032
2033 unsigned int GetOpInt64(struct Operand * op2, long long * value2)
2034 {
2035 if(op2->kind == 3 && op2->type->isSigned)
2036 *value2 = (long long)op2->__anon1.i;
2037 else if(op2->kind == 3)
2038 *value2 = (long long)op2->__anon1.ui;
2039 else if(op2->kind == 4 && op2->type->isSigned)
2040 *value2 = op2->__anon1.i64;
2041 else if(op2->kind == 4)
2042 *value2 = (long long)op2->__anon1.ui64;
2043 else if(op2->kind == 23 && op2->type->isSigned)
2044 *value2 = op2->__anon1.i64;
2045 else if(op2->kind == 23)
2046 *value2 = (long long)op2->__anon1.ui64;
2047 else if(op2->kind == 22 && op2->type->isSigned)
2048 *value2 = op2->__anon1.i64;
2049 else if(op2->kind == 22)
2050 *value2 = (long long)op2->__anon1.ui64;
2051 else if(op2->kind == 2 && op2->type->isSigned)
2052 *value2 = (long long)op2->__anon1.s;
2053 else if(op2->kind == 2)
2054 *value2 = (long long)op2->__anon1.us;
2055 else if(op2->kind == 1 && op2->type->isSigned)
2056 *value2 = (long long)op2->__anon1.c;
2057 else if(op2->kind == 24 || op2->kind == 1)
2058 *value2 = (long long)op2->__anon1.uc;
2059 else if(op2->kind == 6)
2060 *value2 = (long long)op2->__anon1.f;
2061 else if(op2->kind == 7)
2062 *value2 = (long long)op2->__anon1.d;
2063 else if(op2->kind == 13)
2064 *value2 = (long long)op2->__anon1.ui64;
2065 else
2066 return 0;
2067 return 1;
2068 }
2069
2070 unsigned int GetOpUInt64(struct Operand * op2, uint64 * value2)
2071 {
2072 if(op2->kind == 3 && op2->type->isSigned)
2073 *value2 = (uint64)op2->__anon1.i;
2074 else if(op2->kind == 3)
2075 *value2 = (uint64)op2->__anon1.ui;
2076 else if(op2->kind == 4 && op2->type->isSigned)
2077 *value2 = (uint64)op2->__anon1.i64;
2078 else if(op2->kind == 4)
2079 *value2 = op2->__anon1.ui64;
2080 else if(op2->kind == 23 && op2->type->isSigned)
2081 *value2 = (uint64)op2->__anon1.i64;
2082 else if(op2->kind == 23)
2083 *value2 = op2->__anon1.ui64;
2084 else if(op2->kind == 22 && op2->type->isSigned)
2085 *value2 = (uint64)op2->__anon1.i64;
2086 else if(op2->kind == 22)
2087 *value2 = op2->__anon1.ui64;
2088 else if(op2->kind == 2 && op2->type->isSigned)
2089 *value2 = (uint64)op2->__anon1.s;
2090 else if(op2->kind == 2)
2091 *value2 = (uint64)op2->__anon1.us;
2092 else if(op2->kind == 1 && op2->type->isSigned)
2093 *value2 = (uint64)op2->__anon1.c;
2094 else if(op2->kind == 24 || op2->kind == 1)
2095 *value2 = (uint64)op2->__anon1.uc;
2096 else if(op2->kind == 6)
2097 *value2 = (uint64)op2->__anon1.f;
2098 else if(op2->kind == 7)
2099 *value2 = (uint64)op2->__anon1.d;
2100 else if(op2->kind == 13)
2101 *value2 = op2->__anon1.ui64;
2102 else
2103 return 0;
2104 return 1;
2105 }
2106
2107 unsigned int GetOpIntPtr(struct Operand * op2, intptr_t * value2)
2108 {
2109 if(op2->kind == 3 && op2->type->isSigned)
2110 *value2 = (intptr_t)op2->__anon1.i;
2111 else if(op2->kind == 3)
2112 *value2 = (intptr_t)op2->__anon1.ui;
2113 else if(op2->kind == 4 && op2->type->isSigned)
2114 *value2 = (intptr_t)op2->__anon1.i64;
2115 else if(op2->kind == 4)
2116 *value2 = (intptr_t)op2->__anon1.ui64;
2117 else if(op2->kind == 23 && op2->type->isSigned)
2118 *value2 = (intptr_t)op2->__anon1.i64;
2119 else if(op2->kind == 23)
2120 *value2 = (intptr_t)op2->__anon1.ui64;
2121 else if(op2->kind == 22 && op2->type->isSigned)
2122 *value2 = (intptr_t)op2->__anon1.i64;
2123 else if(op2->kind == 22)
2124 *value2 = (intptr_t)op2->__anon1.ui64;
2125 else if(op2->kind == 2 && op2->type->isSigned)
2126 *value2 = (intptr_t)op2->__anon1.s;
2127 else if(op2->kind == 2)
2128 *value2 = (intptr_t)op2->__anon1.us;
2129 else if(op2->kind == 1 && op2->type->isSigned)
2130 *value2 = (intptr_t)op2->__anon1.c;
2131 else if(op2->kind == 24 || op2->kind == 1)
2132 *value2 = (intptr_t)op2->__anon1.uc;
2133 else if(op2->kind == 6)
2134 *value2 = (intptr_t)op2->__anon1.f;
2135 else if(op2->kind == 7)
2136 *value2 = (intptr_t)op2->__anon1.d;
2137 else if(op2->kind == 13)
2138 *value2 = (intptr_t)op2->__anon1.ui64;
2139 else
2140 return 0;
2141 return 1;
2142 }
2143
2144 unsigned int GetOpUIntPtr(struct Operand * op2, uintptr_t * value2)
2145 {
2146 if(op2->kind == 3 && op2->type->isSigned)
2147 *value2 = (uintptr_t)op2->__anon1.i;
2148 else if(op2->kind == 3)
2149 *value2 = (uintptr_t)op2->__anon1.ui;
2150 else if(op2->kind == 4 && op2->type->isSigned)
2151 *value2 = (uintptr_t)op2->__anon1.i64;
2152 else if(op2->kind == 4)
2153 *value2 = (uintptr_t)op2->__anon1.ui64;
2154 else if(op2->kind == 23 && op2->type->isSigned)
2155 *value2 = (uintptr_t)op2->__anon1.i64;
2156 else if(op2->kind == 23)
2157 *value2 = (uintptr_t)op2->__anon1.ui64;
2158 else if(op2->kind == 22 && op2->type->isSigned)
2159 *value2 = (uintptr_t)op2->__anon1.i64;
2160 else if(op2->kind == 22)
2161 *value2 = (uintptr_t)op2->__anon1.ui64;
2162 else if(op2->kind == 2 && op2->type->isSigned)
2163 *value2 = (uintptr_t)op2->__anon1.s;
2164 else if(op2->kind == 2)
2165 *value2 = (uintptr_t)op2->__anon1.us;
2166 else if(op2->kind == 1 && op2->type->isSigned)
2167 *value2 = (uintptr_t)op2->__anon1.c;
2168 else if(op2->kind == 24 || op2->kind == 1)
2169 *value2 = (uintptr_t)op2->__anon1.uc;
2170 else if(op2->kind == 6)
2171 *value2 = (uintptr_t)op2->__anon1.f;
2172 else if(op2->kind == 7)
2173 *value2 = (uintptr_t)op2->__anon1.d;
2174 else if(op2->kind == 13)
2175 *value2 = (uintptr_t)op2->__anon1.ui64;
2176 else
2177 return 0;
2178 return 1;
2179 }
2180
2181 unsigned int GetOpIntSize(struct Operand * op2, ssize_t * value2)
2182 {
2183 if(op2->kind == 3 && op2->type->isSigned)
2184 *value2 = (ssize_t)op2->__anon1.i;
2185 else if(op2->kind == 3)
2186 *value2 = (ssize_t)op2->__anon1.ui;
2187 else if(op2->kind == 4 && op2->type->isSigned)
2188 *value2 = (ssize_t)op2->__anon1.i64;
2189 else if(op2->kind == 4)
2190 *value2 = (ssize_t)op2->__anon1.ui64;
2191 else if(op2->kind == 23 && op2->type->isSigned)
2192 *value2 = (ssize_t)op2->__anon1.i64;
2193 else if(op2->kind == 23)
2194 *value2 = (ssize_t)op2->__anon1.ui64;
2195 else if(op2->kind == 22 && op2->type->isSigned)
2196 *value2 = (ssize_t)op2->__anon1.i64;
2197 else if(op2->kind == 22)
2198 *value2 = (ssize_t)op2->__anon1.ui64;
2199 else if(op2->kind == 2 && op2->type->isSigned)
2200 *value2 = (ssize_t)op2->__anon1.s;
2201 else if(op2->kind == 2)
2202 *value2 = (ssize_t)op2->__anon1.us;
2203 else if(op2->kind == 1 && op2->type->isSigned)
2204 *value2 = (ssize_t)op2->__anon1.c;
2205 else if(op2->kind == 24 || op2->kind == 1)
2206 *value2 = (ssize_t)op2->__anon1.uc;
2207 else if(op2->kind == 6)
2208 *value2 = (ssize_t)op2->__anon1.f;
2209 else if(op2->kind == 7)
2210 *value2 = (ssize_t)op2->__anon1.d;
2211 else if(op2->kind == 13)
2212 *value2 = (ssize_t)op2->__anon1.ui64;
2213 else
2214 return 0;
2215 return 1;
2216 }
2217
2218 unsigned int GetOpUIntSize(struct Operand * op2, size_t * value2)
2219 {
2220 if(op2->kind == 3 && op2->type->isSigned)
2221 *value2 = (size_t)op2->__anon1.i;
2222 else if(op2->kind == 3)
2223 *value2 = (size_t)op2->__anon1.ui;
2224 else if(op2->kind == 4 && op2->type->isSigned)
2225 *value2 = (size_t)op2->__anon1.i64;
2226 else if(op2->kind == 4)
2227 *value2 = (size_t)op2->__anon1.ui64;
2228 else if(op2->kind == 23 && op2->type->isSigned)
2229 *value2 = (size_t)op2->__anon1.i64;
2230 else if(op2->kind == 23)
2231 *value2 = (size_t)op2->__anon1.ui64;
2232 else if(op2->kind == 22 && op2->type->isSigned)
2233 *value2 = (size_t)op2->__anon1.i64;
2234 else if(op2->kind == 22)
2235 *value2 = (size_t)op2->__anon1.ui64;
2236 else if(op2->kind == 2 && op2->type->isSigned)
2237 *value2 = (size_t)op2->__anon1.s;
2238 else if(op2->kind == 2)
2239 *value2 = (size_t)op2->__anon1.us;
2240 else if(op2->kind == 1 && op2->type->isSigned)
2241 *value2 = (size_t)op2->__anon1.c;
2242 else if(op2->kind == 24 || op2->kind == 1)
2243 *value2 = (size_t)op2->__anon1.uc;
2244 else if(op2->kind == 6)
2245 *value2 = (size_t)op2->__anon1.f;
2246 else if(op2->kind == 7)
2247 *value2 = (size_t)op2->__anon1.d;
2248 else if(op2->kind == 13)
2249 *value2 = (size_t)op2->__anon1.ui64;
2250 else
2251 return 0;
2252 return 1;
2253 }
2254
2255 unsigned int GetOpShort(struct Operand * op2, short * value2)
2256 {
2257 if(op2->kind == 3 && op2->type->isSigned)
2258 *value2 = (short)op2->__anon1.i;
2259 else if(op2->kind == 3)
2260 *value2 = (short)op2->__anon1.ui;
2261 else if(op2->kind == 4 && op2->type->isSigned)
2262 *value2 = (short)op2->__anon1.i64;
2263 else if(op2->kind == 4)
2264 *value2 = (short)op2->__anon1.ui64;
2265 else if(op2->kind == 23 && op2->type->isSigned)
2266 *value2 = (short)op2->__anon1.i64;
2267 else if(op2->kind == 23)
2268 *value2 = (short)op2->__anon1.ui64;
2269 else if(op2->kind == 22 && op2->type->isSigned)
2270 *value2 = (short)op2->__anon1.i64;
2271 else if(op2->kind == 22)
2272 *value2 = (short)op2->__anon1.ui64;
2273 else if(op2->kind == 2 && op2->type->isSigned)
2274 *value2 = op2->__anon1.s;
2275 else if(op2->kind == 2)
2276 *value2 = (short)op2->__anon1.us;
2277 else if(op2->kind == 1 && op2->type->isSigned)
2278 *value2 = (short)op2->__anon1.c;
2279 else if(op2->kind == 24 || op2->kind == 1)
2280 *value2 = (short)op2->__anon1.uc;
2281 else if(op2->kind == 6)
2282 *value2 = (short)op2->__anon1.f;
2283 else if(op2->kind == 7)
2284 *value2 = (short)op2->__anon1.d;
2285 else if(op2->kind == 13)
2286 *value2 = (short)op2->__anon1.ui64;
2287 else
2288 return 0;
2289 return 1;
2290 }
2291
2292 unsigned int GetOpUShort(struct Operand * op2, unsigned short * value2)
2293 {
2294 if(op2->kind == 3 && op2->type->isSigned)
2295 *value2 = (unsigned short)op2->__anon1.i;
2296 else if(op2->kind == 3)
2297 *value2 = (unsigned short)op2->__anon1.ui;
2298 else if(op2->kind == 4 && op2->type->isSigned)
2299 *value2 = (unsigned short)op2->__anon1.i64;
2300 else if(op2->kind == 4)
2301 *value2 = (unsigned short)op2->__anon1.ui64;
2302 else if(op2->kind == 23 && op2->type->isSigned)
2303 *value2 = (unsigned short)op2->__anon1.i64;
2304 else if(op2->kind == 23)
2305 *value2 = (unsigned short)op2->__anon1.ui64;
2306 else if(op2->kind == 22 && op2->type->isSigned)
2307 *value2 = (unsigned short)op2->__anon1.i64;
2308 else if(op2->kind == 22)
2309 *value2 = (unsigned short)op2->__anon1.ui64;
2310 else if(op2->kind == 2 && op2->type->isSigned)
2311 *value2 = (unsigned short)op2->__anon1.s;
2312 else if(op2->kind == 2)
2313 *value2 = op2->__anon1.us;
2314 else if(op2->kind == 1 && op2->type->isSigned)
2315 *value2 = (unsigned short)op2->__anon1.c;
2316 else if(op2->kind == 24 || op2->kind == 1)
2317 *value2 = (unsigned short)op2->__anon1.uc;
2318 else if(op2->kind == 6)
2319 *value2 = (unsigned short)op2->__anon1.f;
2320 else if(op2->kind == 7)
2321 *value2 = (unsigned short)op2->__anon1.d;
2322 else if(op2->kind == 13)
2323 *value2 = (unsigned short)op2->__anon1.ui64;
2324 else
2325 return 0;
2326 return 1;
2327 }
2328
2329 unsigned int GetOpChar(struct Operand * op2, char * value2)
2330 {
2331 if(op2->kind == 3 && op2->type->isSigned)
2332 *value2 = (char)op2->__anon1.i;
2333 else if(op2->kind == 3)
2334 *value2 = (char)op2->__anon1.ui;
2335 else if(op2->kind == 4 && op2->type->isSigned)
2336 *value2 = (char)op2->__anon1.i64;
2337 else if(op2->kind == 4)
2338 *value2 = (char)op2->__anon1.ui64;
2339 else if(op2->kind == 23 && op2->type->isSigned)
2340 *value2 = (char)op2->__anon1.i64;
2341 else if(op2->kind == 23)
2342 *value2 = (char)op2->__anon1.ui64;
2343 else if(op2->kind == 22 && op2->type->isSigned)
2344 *value2 = (char)op2->__anon1.i64;
2345 else if(op2->kind == 22)
2346 *value2 = (char)op2->__anon1.ui64;
2347 else if(op2->kind == 2 && op2->type->isSigned)
2348 *value2 = (char)op2->__anon1.s;
2349 else if(op2->kind == 2)
2350 *value2 = (char)op2->__anon1.us;
2351 else if(op2->kind == 1 && op2->type->isSigned)
2352 *value2 = op2->__anon1.c;
2353 else if(op2->kind == 24 || op2->kind == 1)
2354 *value2 = (char)op2->__anon1.uc;
2355 else if(op2->kind == 6)
2356 *value2 = (char)op2->__anon1.f;
2357 else if(op2->kind == 7)
2358 *value2 = (char)op2->__anon1.d;
2359 else if(op2->kind == 13)
2360 *value2 = (char)op2->__anon1.ui64;
2361 else
2362 return 0;
2363 return 1;
2364 }
2365
2366 unsigned int GetOpUChar(struct Operand * op2, unsigned char * value2)
2367 {
2368 if(op2->kind == 3 && op2->type->isSigned)
2369 *value2 = (unsigned char)op2->__anon1.i;
2370 else if(op2->kind == 3)
2371 *value2 = (unsigned char)op2->__anon1.ui;
2372 else if(op2->kind == 4 && op2->type->isSigned)
2373 *value2 = (unsigned char)op2->__anon1.i64;
2374 else if(op2->kind == 4)
2375 *value2 = (unsigned char)op2->__anon1.ui64;
2376 else if(op2->kind == 23 && op2->type->isSigned)
2377 *value2 = (unsigned char)op2->__anon1.i64;
2378 else if(op2->kind == 23)
2379 *value2 = (unsigned char)op2->__anon1.ui64;
2380 else if(op2->kind == 22 && op2->type->isSigned)
2381 *value2 = (unsigned char)op2->__anon1.i64;
2382 else if(op2->kind == 22)
2383 *value2 = (unsigned char)op2->__anon1.ui64;
2384 else if(op2->kind == 2 && op2->type->isSigned)
2385 *value2 = (unsigned char)op2->__anon1.s;
2386 else if(op2->kind == 2)
2387 *value2 = (unsigned char)op2->__anon1.us;
2388 else if(op2->kind == 1 && op2->type->isSigned)
2389 *value2 = (unsigned char)op2->__anon1.c;
2390 else if(op2->kind == 24 || op2->kind == 1)
2391 *value2 = op2->__anon1.uc;
2392 else if(op2->kind == 6)
2393 *value2 = (unsigned char)op2->__anon1.f;
2394 else if(op2->kind == 7)
2395 *value2 = (unsigned char)op2->__anon1.d;
2396 else if(op2->kind == 13)
2397 *value2 = (unsigned char)op2->__anon1.ui64;
2398 else
2399 return 0;
2400 return 1;
2401 }
2402
2403 unsigned int GetOpFloat(struct Operand * op2, float * value2)
2404 {
2405 if(op2->kind == 3 && op2->type->isSigned)
2406 *value2 = (float)(float)op2->__anon1.i;
2407 else if(op2->kind == 3)
2408 *value2 = (float)(float)op2->__anon1.ui;
2409 else if(op2->kind == 4 && op2->type->isSigned)
2410 *value2 = (float)(float)op2->__anon1.i64;
2411 else if(op2->kind == 4)
2412 *value2 = (float)(float)op2->__anon1.ui64;
2413 else if(op2->kind == 23 && op2->type->isSigned)
2414 *value2 = (float)(float)op2->__anon1.i64;
2415 else if(op2->kind == 23)
2416 *value2 = (float)(float)op2->__anon1.ui64;
2417 else if(op2->kind == 22 && op2->type->isSigned)
2418 *value2 = (float)(float)op2->__anon1.i64;
2419 else if(op2->kind == 22)
2420 *value2 = (float)(float)op2->__anon1.ui64;
2421 else if(op2->kind == 2 && op2->type->isSigned)
2422 *value2 = (float)(float)op2->__anon1.s;
2423 else if(op2->kind == 2)
2424 *value2 = (float)(float)op2->__anon1.us;
2425 else if(op2->kind == 1 && op2->type->isSigned)
2426 *value2 = (float)(float)op2->__anon1.c;
2427 else if(op2->kind == 24 || op2->kind == 1)
2428 *value2 = (float)(float)op2->__anon1.uc;
2429 else if(op2->kind == 6)
2430 *value2 = (float)op2->__anon1.f;
2431 else if(op2->kind == 7)
2432 *value2 = (float)op2->__anon1.d;
2433 else if(op2->kind == 13)
2434 *value2 = (float)(float)op2->__anon1.ui64;
2435 else
2436 return 0;
2437 return 1;
2438 }
2439
2440 unsigned int GetOpDouble(struct Operand * op2, double * value2)
2441 {
2442 if(op2->kind == 3 && op2->type->isSigned)
2443 *value2 = (double)(double)op2->__anon1.i;
2444 else if(op2->kind == 3)
2445 *value2 = (double)(double)op2->__anon1.ui;
2446 else if(op2->kind == 4 && op2->type->isSigned)
2447 *value2 = (double)(double)op2->__anon1.i64;
2448 else if(op2->kind == 4)
2449 *value2 = (double)(double)op2->__anon1.ui64;
2450 else if(op2->kind == 23 && op2->type->isSigned)
2451 *value2 = (double)(double)op2->__anon1.i64;
2452 else if(op2->kind == 23)
2453 *value2 = (double)(double)op2->__anon1.ui64;
2454 else if(op2->kind == 22 && op2->type->isSigned)
2455 *value2 = (double)(double)op2->__anon1.i64;
2456 else if(op2->kind == 22)
2457 *value2 = (double)(double)op2->__anon1.ui64;
2458 else if(op2->kind == 2 && op2->type->isSigned)
2459 *value2 = (double)(double)op2->__anon1.s;
2460 else if(op2->kind == 2)
2461 *value2 = (double)(double)op2->__anon1.us;
2462 else if(op2->kind == 1 && op2->type->isSigned)
2463 *value2 = (double)(double)op2->__anon1.c;
2464 else if(op2->kind == 24 || op2->kind == 1)
2465 *value2 = (double)(double)op2->__anon1.uc;
2466 else if(op2->kind == 6)
2467 *value2 = (double)op2->__anon1.f;
2468 else if(op2->kind == 7)
2469 *value2 = (double)op2->__anon1.d;
2470 else if(op2->kind == 13)
2471 *value2 = (double)(double)op2->__anon1.ui64;
2472 else
2473 return 0;
2474 return 1;
2475 }
2476
2477 static unsigned int IntAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2478 {
2479 int value2 = op2->__anon1.i;
2480
2481 exp->type = 2;
2482 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i + value2));
2483 if(!exp->expType)
2484 {
2485 exp->expType = op1->type;
2486 if(op1->type)
2487 op1->type->refCount++;
2488 }
2489 return 1;
2490 }
2491
2492 static unsigned int UIntAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2493 {
2494 unsigned int value2 = op2->__anon1.ui;
2495
2496 exp->type = 2;
2497 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui + value2));
2498 if(!exp->expType)
2499 {
2500 exp->expType = op1->type;
2501 if(op1->type)
2502 op1->type->refCount++;
2503 }
2504 return 1;
2505 }
2506
2507 static unsigned int Int64Add(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2508 {
2509 long long value2 = op2->__anon1.i64;
2510
2511 exp->type = 2;
2512 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 + value2));
2513 if(!exp->expType)
2514 {
2515 exp->expType = op1->type;
2516 if(op1->type)
2517 op1->type->refCount++;
2518 }
2519 return 1;
2520 }
2521
2522 static unsigned int UInt64Add(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2523 {
2524 uint64 value2 = op2->__anon1.ui64;
2525
2526 exp->type = 2;
2527 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 + value2));
2528 if(!exp->expType)
2529 {
2530 exp->expType = op1->type;
2531 if(op1->type)
2532 op1->type->refCount++;
2533 }
2534 return 1;
2535 }
2536
2537 static unsigned int ShortAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2538 {
2539 short value2 = op2->__anon1.s;
2540
2541 exp->type = 2;
2542 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s + value2));
2543 if(!exp->expType)
2544 {
2545 exp->expType = op1->type;
2546 if(op1->type)
2547 op1->type->refCount++;
2548 }
2549 return 1;
2550 }
2551
2552 static unsigned int UShortAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2553 {
2554 unsigned short value2 = op2->__anon1.us;
2555
2556 exp->type = 2;
2557 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us + value2));
2558 if(!exp->expType)
2559 {
2560 exp->expType = op1->type;
2561 if(op1->type)
2562 op1->type->refCount++;
2563 }
2564 return 1;
2565 }
2566
2567 static unsigned int CharAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2568 {
2569 char value2 = op2->__anon1.c;
2570
2571 exp->type = 2;
2572 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c + value2));
2573 if(!exp->expType)
2574 {
2575 exp->expType = op1->type;
2576 if(op1->type)
2577 op1->type->refCount++;
2578 }
2579 return 1;
2580 }
2581
2582 static unsigned int UCharAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2583 {
2584 unsigned char value2 = op2->__anon1.uc;
2585
2586 exp->type = 2;
2587 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc + value2));
2588 if(!exp->expType)
2589 {
2590 exp->expType = op1->type;
2591 if(op1->type)
2592 op1->type->refCount++;
2593 }
2594 return 1;
2595 }
2596
2597 static unsigned int FloatAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2598 {
2599 float value2 = op2->__anon1.f;
2600
2601 exp->type = 2;
2602 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f + value2));
2603 if(!exp->expType)
2604 {
2605 exp->expType = op1->type;
2606 if(op1->type)
2607 op1->type->refCount++;
2608 }
2609 return 1;
2610 }
2611
2612 static unsigned int DoubleAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2613 {
2614 double value2 = op2->__anon1.d;
2615
2616 exp->type = 2;
2617 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d + value2));
2618 if(!exp->expType)
2619 {
2620 exp->expType = op1->type;
2621 if(op1->type)
2622 op1->type->refCount++;
2623 }
2624 return 1;
2625 }
2626
2627 static unsigned int IntSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2628 {
2629 int value2 = op2->__anon1.i;
2630
2631 exp->type = 2;
2632 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i - value2));
2633 if(!exp->expType)
2634 {
2635 exp->expType = op1->type;
2636 if(op1->type)
2637 op1->type->refCount++;
2638 }
2639 return 1;
2640 }
2641
2642 static unsigned int UIntSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2643 {
2644 unsigned int value2 = op2->__anon1.ui;
2645
2646 exp->type = 2;
2647 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui - value2));
2648 if(!exp->expType)
2649 {
2650 exp->expType = op1->type;
2651 if(op1->type)
2652 op1->type->refCount++;
2653 }
2654 return 1;
2655 }
2656
2657 static unsigned int Int64Sub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2658 {
2659 long long value2 = op2->__anon1.i64;
2660
2661 exp->type = 2;
2662 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 - value2));
2663 if(!exp->expType)
2664 {
2665 exp->expType = op1->type;
2666 if(op1->type)
2667 op1->type->refCount++;
2668 }
2669 return 1;
2670 }
2671
2672 static unsigned int UInt64Sub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2673 {
2674 uint64 value2 = op2->__anon1.ui64;
2675
2676 exp->type = 2;
2677 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 - value2));
2678 if(!exp->expType)
2679 {
2680 exp->expType = op1->type;
2681 if(op1->type)
2682 op1->type->refCount++;
2683 }
2684 return 1;
2685 }
2686
2687 static unsigned int ShortSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2688 {
2689 short value2 = op2->__anon1.s;
2690
2691 exp->type = 2;
2692 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s - value2));
2693 if(!exp->expType)
2694 {
2695 exp->expType = op1->type;
2696 if(op1->type)
2697 op1->type->refCount++;
2698 }
2699 return 1;
2700 }
2701
2702 static unsigned int UShortSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2703 {
2704 unsigned short value2 = op2->__anon1.us;
2705
2706 exp->type = 2;
2707 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us - value2));
2708 if(!exp->expType)
2709 {
2710 exp->expType = op1->type;
2711 if(op1->type)
2712 op1->type->refCount++;
2713 }
2714 return 1;
2715 }
2716
2717 static unsigned int CharSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2718 {
2719 char value2 = op2->__anon1.c;
2720
2721 exp->type = 2;
2722 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c - value2));
2723 if(!exp->expType)
2724 {
2725 exp->expType = op1->type;
2726 if(op1->type)
2727 op1->type->refCount++;
2728 }
2729 return 1;
2730 }
2731
2732 static unsigned int UCharSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2733 {
2734 unsigned char value2 = op2->__anon1.uc;
2735
2736 exp->type = 2;
2737 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc - value2));
2738 if(!exp->expType)
2739 {
2740 exp->expType = op1->type;
2741 if(op1->type)
2742 op1->type->refCount++;
2743 }
2744 return 1;
2745 }
2746
2747 static unsigned int FloatSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2748 {
2749 float value2 = op2->__anon1.f;
2750
2751 exp->type = 2;
2752 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f - value2));
2753 if(!exp->expType)
2754 {
2755 exp->expType = op1->type;
2756 if(op1->type)
2757 op1->type->refCount++;
2758 }
2759 return 1;
2760 }
2761
2762 static unsigned int DoubleSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2763 {
2764 double value2 = op2->__anon1.d;
2765
2766 exp->type = 2;
2767 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d - value2));
2768 if(!exp->expType)
2769 {
2770 exp->expType = op1->type;
2771 if(op1->type)
2772 op1->type->refCount++;
2773 }
2774 return 1;
2775 }
2776
2777 static unsigned int IntMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2778 {
2779 int value2 = op2->__anon1.i;
2780
2781 exp->type = 2;
2782 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i * value2));
2783 if(!exp->expType)
2784 {
2785 exp->expType = op1->type;
2786 if(op1->type)
2787 op1->type->refCount++;
2788 }
2789 return 1;
2790 }
2791
2792 static unsigned int UIntMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2793 {
2794 unsigned int value2 = op2->__anon1.ui;
2795
2796 exp->type = 2;
2797 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui * value2));
2798 if(!exp->expType)
2799 {
2800 exp->expType = op1->type;
2801 if(op1->type)
2802 op1->type->refCount++;
2803 }
2804 return 1;
2805 }
2806
2807 static unsigned int Int64Mul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2808 {
2809 long long value2 = op2->__anon1.i64;
2810
2811 exp->type = 2;
2812 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 * value2));
2813 if(!exp->expType)
2814 {
2815 exp->expType = op1->type;
2816 if(op1->type)
2817 op1->type->refCount++;
2818 }
2819 return 1;
2820 }
2821
2822 static unsigned int UInt64Mul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2823 {
2824 uint64 value2 = op2->__anon1.ui64;
2825
2826 exp->type = 2;
2827 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 * value2));
2828 if(!exp->expType)
2829 {
2830 exp->expType = op1->type;
2831 if(op1->type)
2832 op1->type->refCount++;
2833 }
2834 return 1;
2835 }
2836
2837 static unsigned int ShortMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2838 {
2839 short value2 = op2->__anon1.s;
2840
2841 exp->type = 2;
2842 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s * value2));
2843 if(!exp->expType)
2844 {
2845 exp->expType = op1->type;
2846 if(op1->type)
2847 op1->type->refCount++;
2848 }
2849 return 1;
2850 }
2851
2852 static unsigned int UShortMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2853 {
2854 unsigned short value2 = op2->__anon1.us;
2855
2856 exp->type = 2;
2857 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us * value2));
2858 if(!exp->expType)
2859 {
2860 exp->expType = op1->type;
2861 if(op1->type)
2862 op1->type->refCount++;
2863 }
2864 return 1;
2865 }
2866
2867 static unsigned int CharMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2868 {
2869 char value2 = op2->__anon1.c;
2870
2871 exp->type = 2;
2872 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c * value2));
2873 if(!exp->expType)
2874 {
2875 exp->expType = op1->type;
2876 if(op1->type)
2877 op1->type->refCount++;
2878 }
2879 return 1;
2880 }
2881
2882 static unsigned int UCharMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2883 {
2884 unsigned char value2 = op2->__anon1.uc;
2885
2886 exp->type = 2;
2887 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc * value2));
2888 if(!exp->expType)
2889 {
2890 exp->expType = op1->type;
2891 if(op1->type)
2892 op1->type->refCount++;
2893 }
2894 return 1;
2895 }
2896
2897 static unsigned int FloatMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2898 {
2899 float value2 = op2->__anon1.f;
2900
2901 exp->type = 2;
2902 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f * value2));
2903 if(!exp->expType)
2904 {
2905 exp->expType = op1->type;
2906 if(op1->type)
2907 op1->type->refCount++;
2908 }
2909 return 1;
2910 }
2911
2912 static unsigned int DoubleMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2913 {
2914 double value2 = op2->__anon1.d;
2915
2916 exp->type = 2;
2917 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d * value2));
2918 if(!exp->expType)
2919 {
2920 exp->expType = op1->type;
2921 if(op1->type)
2922 op1->type->refCount++;
2923 }
2924 return 1;
2925 }
2926
2927 static unsigned int IntDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2928 {
2929 int value2 = op2->__anon1.i;
2930
2931 exp->type = 2;
2932 exp->__anon1.__anon2.string = PrintInt(value2 ? ((op1->__anon1.i / value2)) : 0);
2933 if(!exp->expType)
2934 {
2935 exp->expType = op1->type;
2936 if(op1->type)
2937 op1->type->refCount++;
2938 }
2939 return 1;
2940 }
2941
2942 static unsigned int UIntDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2943 {
2944 unsigned int value2 = op2->__anon1.ui;
2945
2946 exp->type = 2;
2947 exp->__anon1.__anon2.string = PrintUInt(value2 ? ((op1->__anon1.ui / value2)) : 0);
2948 if(!exp->expType)
2949 {
2950 exp->expType = op1->type;
2951 if(op1->type)
2952 op1->type->refCount++;
2953 }
2954 return 1;
2955 }
2956
2957 static unsigned int Int64Div(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2958 {
2959 long long value2 = op2->__anon1.i64;
2960
2961 exp->type = 2;
2962 exp->__anon1.__anon2.string = PrintInt64(value2 ? ((op1->__anon1.i64 / value2)) : 0);
2963 if(!exp->expType)
2964 {
2965 exp->expType = op1->type;
2966 if(op1->type)
2967 op1->type->refCount++;
2968 }
2969 return 1;
2970 }
2971
2972 static unsigned int UInt64Div(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2973 {
2974 uint64 value2 = op2->__anon1.ui64;
2975
2976 exp->type = 2;
2977 exp->__anon1.__anon2.string = PrintUInt64(value2 ? ((op1->__anon1.ui64 / value2)) : 0);
2978 if(!exp->expType)
2979 {
2980 exp->expType = op1->type;
2981 if(op1->type)
2982 op1->type->refCount++;
2983 }
2984 return 1;
2985 }
2986
2987 static unsigned int ShortDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2988 {
2989 short value2 = op2->__anon1.s;
2990
2991 exp->type = 2;
2992 exp->__anon1.__anon2.string = PrintShort(value2 ? ((short)(op1->__anon1.s / value2)) : 0);
2993 if(!exp->expType)
2994 {
2995 exp->expType = op1->type;
2996 if(op1->type)
2997 op1->type->refCount++;
2998 }
2999 return 1;
3000 }
3001
3002 static unsigned int UShortDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3003 {
3004 unsigned short value2 = op2->__anon1.us;
3005
3006 exp->type = 2;
3007 exp->__anon1.__anon2.string = PrintUShort(value2 ? ((unsigned short)(op1->__anon1.us / value2)) : 0);
3008 if(!exp->expType)
3009 {
3010 exp->expType = op1->type;
3011 if(op1->type)
3012 op1->type->refCount++;
3013 }
3014 return 1;
3015 }
3016
3017 static unsigned int CharDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3018 {
3019 char value2 = op2->__anon1.c;
3020
3021 exp->type = 2;
3022 exp->__anon1.__anon2.string = PrintChar(value2 ? ((char)(op1->__anon1.c / value2)) : 0);
3023 if(!exp->expType)
3024 {
3025 exp->expType = op1->type;
3026 if(op1->type)
3027 op1->type->refCount++;
3028 }
3029 return 1;
3030 }
3031
3032 static unsigned int UCharDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3033 {
3034 unsigned char value2 = op2->__anon1.uc;
3035
3036 exp->type = 2;
3037 exp->__anon1.__anon2.string = PrintUChar(value2 ? ((unsigned char)(op1->__anon1.uc / value2)) : 0);
3038 if(!exp->expType)
3039 {
3040 exp->expType = op1->type;
3041 if(op1->type)
3042 op1->type->refCount++;
3043 }
3044 return 1;
3045 }
3046
3047 static unsigned int FloatDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3048 {
3049 float value2 = op2->__anon1.f;
3050
3051 exp->type = 2;
3052 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f / value2));
3053 if(!exp->expType)
3054 {
3055 exp->expType = op1->type;
3056 if(op1->type)
3057 op1->type->refCount++;
3058 }
3059 return 1;
3060 }
3061
3062 static unsigned int DoubleDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3063 {
3064 double value2 = op2->__anon1.d;
3065
3066 exp->type = 2;
3067 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d / value2));
3068 if(!exp->expType)
3069 {
3070 exp->expType = op1->type;
3071 if(op1->type)
3072 op1->type->refCount++;
3073 }
3074 return 1;
3075 }
3076
3077 static unsigned int IntMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3078 {
3079 int value2 = op2->__anon1.i;
3080
3081 exp->type = 2;
3082 exp->__anon1.__anon2.string = PrintInt(value2 ? ((op1->__anon1.i % value2)) : 0);
3083 if(!exp->expType)
3084 {
3085 exp->expType = op1->type;
3086 if(op1->type)
3087 op1->type->refCount++;
3088 }
3089 return 1;
3090 }
3091
3092 static unsigned int UIntMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3093 {
3094 unsigned int value2 = op2->__anon1.ui;
3095
3096 exp->type = 2;
3097 exp->__anon1.__anon2.string = PrintUInt(value2 ? ((op1->__anon1.ui % value2)) : 0);
3098 if(!exp->expType)
3099 {
3100 exp->expType = op1->type;
3101 if(op1->type)
3102 op1->type->refCount++;
3103 }
3104 return 1;
3105 }
3106
3107 static unsigned int Int64Mod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3108 {
3109 long long value2 = op2->__anon1.i64;
3110
3111 exp->type = 2;
3112 exp->__anon1.__anon2.string = PrintInt64(value2 ? ((op1->__anon1.i64 % value2)) : 0);
3113 if(!exp->expType)
3114 {
3115 exp->expType = op1->type;
3116 if(op1->type)
3117 op1->type->refCount++;
3118 }
3119 return 1;
3120 }
3121
3122 static unsigned int UInt64Mod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3123 {
3124 uint64 value2 = op2->__anon1.ui64;
3125
3126 exp->type = 2;
3127 exp->__anon1.__anon2.string = PrintUInt64(value2 ? ((op1->__anon1.ui64 % value2)) : 0);
3128 if(!exp->expType)
3129 {
3130 exp->expType = op1->type;
3131 if(op1->type)
3132 op1->type->refCount++;
3133 }
3134 return 1;
3135 }
3136
3137 static unsigned int ShortMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3138 {
3139 short value2 = op2->__anon1.s;
3140
3141 exp->type = 2;
3142 exp->__anon1.__anon2.string = PrintShort(value2 ? ((short)(op1->__anon1.s % value2)) : 0);
3143 if(!exp->expType)
3144 {
3145 exp->expType = op1->type;
3146 if(op1->type)
3147 op1->type->refCount++;
3148 }
3149 return 1;
3150 }
3151
3152 static unsigned int UShortMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3153 {
3154 unsigned short value2 = op2->__anon1.us;
3155
3156 exp->type = 2;
3157 exp->__anon1.__anon2.string = PrintUShort(value2 ? ((unsigned short)(op1->__anon1.us % value2)) : 0);
3158 if(!exp->expType)
3159 {
3160 exp->expType = op1->type;
3161 if(op1->type)
3162 op1->type->refCount++;
3163 }
3164 return 1;
3165 }
3166
3167 static unsigned int CharMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3168 {
3169 char value2 = op2->__anon1.c;
3170
3171 exp->type = 2;
3172 exp->__anon1.__anon2.string = PrintChar(value2 ? ((char)(op1->__anon1.c % value2)) : 0);
3173 if(!exp->expType)
3174 {
3175 exp->expType = op1->type;
3176 if(op1->type)
3177 op1->type->refCount++;
3178 }
3179 return 1;
3180 }
3181
3182 static unsigned int UCharMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3183 {
3184 unsigned char value2 = op2->__anon1.uc;
3185
3186 exp->type = 2;
3187 exp->__anon1.__anon2.string = PrintUChar(value2 ? ((unsigned char)(op1->__anon1.uc % value2)) : 0);
3188 if(!exp->expType)
3189 {
3190 exp->expType = op1->type;
3191 if(op1->type)
3192 op1->type->refCount++;
3193 }
3194 return 1;
3195 }
3196
3197 static unsigned int IntNeg(struct Expression * exp, struct Operand * op1)
3198 {
3199 exp->type = 2;
3200 exp->__anon1.__anon2.string = PrintInt((-op1->__anon1.i));
3201 if(!exp->expType)
3202 {
3203 exp->expType = op1->type;
3204 if(op1->type)
3205 op1->type->refCount++;
3206 }
3207 return 1;
3208 }
3209
3210 static unsigned int UIntNeg(struct Expression * exp, struct Operand * op1)
3211 {
3212 exp->type = 2;
3213 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(-op1->__anon1.ui));
3214 if(!exp->expType)
3215 {
3216 exp->expType = op1->type;
3217 if(op1->type)
3218 op1->type->refCount++;
3219 }
3220 return 1;
3221 }
3222
3223 static unsigned int Int64Neg(struct Expression * exp, struct Operand * op1)
3224 {
3225 exp->type = 2;
3226 exp->__anon1.__anon2.string = PrintInt64((-op1->__anon1.i64));
3227 if(!exp->expType)
3228 {
3229 exp->expType = op1->type;
3230 if(op1->type)
3231 op1->type->refCount++;
3232 }
3233 return 1;
3234 }
3235
3236 static unsigned int UInt64Neg(struct Expression * exp, struct Operand * op1)
3237 {
3238 exp->type = 2;
3239 exp->__anon1.__anon2.string = PrintUInt64((uint64)(-op1->__anon1.ui64));
3240 if(!exp->expType)
3241 {
3242 exp->expType = op1->type;
3243 if(op1->type)
3244 op1->type->refCount++;
3245 }
3246 return 1;
3247 }
3248
3249 static unsigned int ShortNeg(struct Expression * exp, struct Operand * op1)
3250 {
3251 exp->type = 2;
3252 exp->__anon1.__anon2.string = PrintShort((-op1->__anon1.s));
3253 if(!exp->expType)
3254 {
3255 exp->expType = op1->type;
3256 if(op1->type)
3257 op1->type->refCount++;
3258 }
3259 return 1;
3260 }
3261
3262 static unsigned int UShortNeg(struct Expression * exp, struct Operand * op1)
3263 {
3264 exp->type = 2;
3265 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(-op1->__anon1.us));
3266 if(!exp->expType)
3267 {
3268 exp->expType = op1->type;
3269 if(op1->type)
3270 op1->type->refCount++;
3271 }
3272 return 1;
3273 }
3274
3275 static unsigned int CharNeg(struct Expression * exp, struct Operand * op1)
3276 {
3277 exp->type = 2;
3278 exp->__anon1.__anon2.string = PrintChar((-op1->__anon1.c));
3279 if(!exp->expType)
3280 {
3281 exp->expType = op1->type;
3282 if(op1->type)
3283 op1->type->refCount++;
3284 }
3285 return 1;
3286 }
3287
3288 static unsigned int UCharNeg(struct Expression * exp, struct Operand * op1)
3289 {
3290 exp->type = 2;
3291 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(-op1->__anon1.uc));
3292 if(!exp->expType)
3293 {
3294 exp->expType = op1->type;
3295 if(op1->type)
3296 op1->type->refCount++;
3297 }
3298 return 1;
3299 }
3300
3301 static unsigned int FloatNeg(struct Expression * exp, struct Operand * op1)
3302 {
3303 exp->type = 2;
3304 exp->__anon1.__anon2.string = PrintFloat((float)(-op1->__anon1.f));
3305 if(!exp->expType)
3306 {
3307 exp->expType = op1->type;
3308 if(op1->type)
3309 op1->type->refCount++;
3310 }
3311 return 1;
3312 }
3313
3314 static unsigned int DoubleNeg(struct Expression * exp, struct Operand * op1)
3315 {
3316 exp->type = 2;
3317 exp->__anon1.__anon2.string = PrintDouble((double)(-op1->__anon1.d));
3318 if(!exp->expType)
3319 {
3320 exp->expType = op1->type;
3321 if(op1->type)
3322 op1->type->refCount++;
3323 }
3324 return 1;
3325 }
3326
3327 static unsigned int IntInc(struct Expression * exp, struct Operand * op1)
3328 {
3329 exp->type = 2;
3330 exp->__anon1.__anon2.string = PrintInt((++op1->__anon1.i));
3331 if(!exp->expType)
3332 {
3333 exp->expType = op1->type;
3334 if(op1->type)
3335 op1->type->refCount++;
3336 }
3337 return 1;
3338 }
3339
3340 static unsigned int UIntInc(struct Expression * exp, struct Operand * op1)
3341 {
3342 exp->type = 2;
3343 exp->__anon1.__anon2.string = PrintUInt((++op1->__anon1.ui));
3344 if(!exp->expType)
3345 {
3346 exp->expType = op1->type;
3347 if(op1->type)
3348 op1->type->refCount++;
3349 }
3350 return 1;
3351 }
3352
3353 static unsigned int Int64Inc(struct Expression * exp, struct Operand * op1)
3354 {
3355 exp->type = 2;
3356 exp->__anon1.__anon2.string = PrintInt64((++op1->__anon1.i64));
3357 if(!exp->expType)
3358 {
3359 exp->expType = op1->type;
3360 if(op1->type)
3361 op1->type->refCount++;
3362 }
3363 return 1;
3364 }
3365
3366 static unsigned int UInt64Inc(struct Expression * exp, struct Operand * op1)
3367 {
3368 exp->type = 2;
3369 exp->__anon1.__anon2.string = PrintUInt64((++op1->__anon1.ui64));
3370 if(!exp->expType)
3371 {
3372 exp->expType = op1->type;
3373 if(op1->type)
3374 op1->type->refCount++;
3375 }
3376 return 1;
3377 }
3378
3379 static unsigned int ShortInc(struct Expression * exp, struct Operand * op1)
3380 {
3381 exp->type = 2;
3382 exp->__anon1.__anon2.string = PrintShort((++op1->__anon1.s));
3383 if(!exp->expType)
3384 {
3385 exp->expType = op1->type;
3386 if(op1->type)
3387 op1->type->refCount++;
3388 }
3389 return 1;
3390 }
3391
3392 static unsigned int UShortInc(struct Expression * exp, struct Operand * op1)
3393 {
3394 exp->type = 2;
3395 exp->__anon1.__anon2.string = PrintUShort((++op1->__anon1.us));
3396 if(!exp->expType)
3397 {
3398 exp->expType = op1->type;
3399 if(op1->type)
3400 op1->type->refCount++;
3401 }
3402 return 1;
3403 }
3404
3405 static unsigned int CharInc(struct Expression * exp, struct Operand * op1)
3406 {
3407 exp->type = 2;
3408 exp->__anon1.__anon2.string = PrintChar((++op1->__anon1.c));
3409 if(!exp->expType)
3410 {
3411 exp->expType = op1->type;
3412 if(op1->type)
3413 op1->type->refCount++;
3414 }
3415 return 1;
3416 }
3417
3418 static unsigned int UCharInc(struct Expression * exp, struct Operand * op1)
3419 {
3420 exp->type = 2;
3421 exp->__anon1.__anon2.string = PrintUChar((++op1->__anon1.uc));
3422 if(!exp->expType)
3423 {
3424 exp->expType = op1->type;
3425 if(op1->type)
3426 op1->type->refCount++;
3427 }
3428 return 1;
3429 }
3430
3431 static unsigned int FloatInc(struct Expression * exp, struct Operand * op1)
3432 {
3433 exp->type = 2;
3434 exp->__anon1.__anon2.string = PrintFloat((float)(++op1->__anon1.f));
3435 if(!exp->expType)
3436 {
3437 exp->expType = op1->type;
3438 if(op1->type)
3439 op1->type->refCount++;
3440 }
3441 return 1;
3442 }
3443
3444 static unsigned int DoubleInc(struct Expression * exp, struct Operand * op1)
3445 {
3446 exp->type = 2;
3447 exp->__anon1.__anon2.string = PrintDouble((double)(++op1->__anon1.d));
3448 if(!exp->expType)
3449 {
3450 exp->expType = op1->type;
3451 if(op1->type)
3452 op1->type->refCount++;
3453 }
3454 return 1;
3455 }
3456
3457 static unsigned int IntDec(struct Expression * exp, struct Operand * op1)
3458 {
3459 exp->type = 2;
3460 exp->__anon1.__anon2.string = PrintInt((--op1->__anon1.i));
3461 if(!exp->expType)
3462 {
3463 exp->expType = op1->type;
3464 if(op1->type)
3465 op1->type->refCount++;
3466 }
3467 return 1;
3468 }
3469
3470 static unsigned int UIntDec(struct Expression * exp, struct Operand * op1)
3471 {
3472 exp->type = 2;
3473 exp->__anon1.__anon2.string = PrintUInt((--op1->__anon1.ui));
3474 if(!exp->expType)
3475 {
3476 exp->expType = op1->type;
3477 if(op1->type)
3478 op1->type->refCount++;
3479 }
3480 return 1;
3481 }
3482
3483 static unsigned int Int64Dec(struct Expression * exp, struct Operand * op1)
3484 {
3485 exp->type = 2;
3486 exp->__anon1.__anon2.string = PrintInt64((--op1->__anon1.i64));
3487 if(!exp->expType)
3488 {
3489 exp->expType = op1->type;
3490 if(op1->type)
3491 op1->type->refCount++;
3492 }
3493 return 1;
3494 }
3495
3496 static unsigned int UInt64Dec(struct Expression * exp, struct Operand * op1)
3497 {
3498 exp->type = 2;
3499 exp->__anon1.__anon2.string = PrintUInt64((--op1->__anon1.ui64));
3500 if(!exp->expType)
3501 {
3502 exp->expType = op1->type;
3503 if(op1->type)
3504 op1->type->refCount++;
3505 }
3506 return 1;
3507 }
3508
3509 static unsigned int ShortDec(struct Expression * exp, struct Operand * op1)
3510 {
3511 exp->type = 2;
3512 exp->__anon1.__anon2.string = PrintShort((--op1->__anon1.s));
3513 if(!exp->expType)
3514 {
3515 exp->expType = op1->type;
3516 if(op1->type)
3517 op1->type->refCount++;
3518 }
3519 return 1;
3520 }
3521
3522 static unsigned int UShortDec(struct Expression * exp, struct Operand * op1)
3523 {
3524 exp->type = 2;
3525 exp->__anon1.__anon2.string = PrintUShort((--op1->__anon1.us));
3526 if(!exp->expType)
3527 {
3528 exp->expType = op1->type;
3529 if(op1->type)
3530 op1->type->refCount++;
3531 }
3532 return 1;
3533 }
3534
3535 static unsigned int CharDec(struct Expression * exp, struct Operand * op1)
3536 {
3537 exp->type = 2;
3538 exp->__anon1.__anon2.string = PrintChar((--op1->__anon1.c));
3539 if(!exp->expType)
3540 {
3541 exp->expType = op1->type;
3542 if(op1->type)
3543 op1->type->refCount++;
3544 }
3545 return 1;
3546 }
3547
3548 static unsigned int UCharDec(struct Expression * exp, struct Operand * op1)
3549 {
3550 exp->type = 2;
3551 exp->__anon1.__anon2.string = PrintUChar((--op1->__anon1.uc));
3552 if(!exp->expType)
3553 {
3554 exp->expType = op1->type;
3555 if(op1->type)
3556 op1->type->refCount++;
3557 }
3558 return 1;
3559 }
3560
3561 static unsigned int FloatDec(struct Expression * exp, struct Operand * op1)
3562 {
3563 exp->type = 2;
3564 exp->__anon1.__anon2.string = PrintFloat((float)(--op1->__anon1.f));
3565 if(!exp->expType)
3566 {
3567 exp->expType = op1->type;
3568 if(op1->type)
3569 op1->type->refCount++;
3570 }
3571 return 1;
3572 }
3573
3574 static unsigned int DoubleDec(struct Expression * exp, struct Operand * op1)
3575 {
3576 exp->type = 2;
3577 exp->__anon1.__anon2.string = PrintDouble((double)(--op1->__anon1.d));
3578 if(!exp->expType)
3579 {
3580 exp->expType = op1->type;
3581 if(op1->type)
3582 op1->type->refCount++;
3583 }
3584 return 1;
3585 }
3586
3587 static unsigned int IntAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3588 {
3589 int value2 = op2->__anon1.i;
3590
3591 exp->type = 2;
3592 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i = value2));
3593 if(!exp->expType)
3594 {
3595 exp->expType = op1->type;
3596 if(op1->type)
3597 op1->type->refCount++;
3598 }
3599 return 1;
3600 }
3601
3602 static unsigned int UIntAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3603 {
3604 unsigned int value2 = op2->__anon1.ui;
3605
3606 exp->type = 2;
3607 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui = value2));
3608 if(!exp->expType)
3609 {
3610 exp->expType = op1->type;
3611 if(op1->type)
3612 op1->type->refCount++;
3613 }
3614 return 1;
3615 }
3616
3617 static unsigned int Int64Asign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3618 {
3619 long long value2 = op2->__anon1.i64;
3620
3621 exp->type = 2;
3622 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 = value2));
3623 if(!exp->expType)
3624 {
3625 exp->expType = op1->type;
3626 if(op1->type)
3627 op1->type->refCount++;
3628 }
3629 return 1;
3630 }
3631
3632 static unsigned int UInt64Asign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3633 {
3634 uint64 value2 = op2->__anon1.ui64;
3635
3636 exp->type = 2;
3637 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 = value2));
3638 if(!exp->expType)
3639 {
3640 exp->expType = op1->type;
3641 if(op1->type)
3642 op1->type->refCount++;
3643 }
3644 return 1;
3645 }
3646
3647 static unsigned int ShortAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3648 {
3649 short value2 = op2->__anon1.s;
3650
3651 exp->type = 2;
3652 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s = value2));
3653 if(!exp->expType)
3654 {
3655 exp->expType = op1->type;
3656 if(op1->type)
3657 op1->type->refCount++;
3658 }
3659 return 1;
3660 }
3661
3662 static unsigned int UShortAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3663 {
3664 unsigned short value2 = op2->__anon1.us;
3665
3666 exp->type = 2;
3667 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us = value2));
3668 if(!exp->expType)
3669 {
3670 exp->expType = op1->type;
3671 if(op1->type)
3672 op1->type->refCount++;
3673 }
3674 return 1;
3675 }
3676
3677 static unsigned int CharAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3678 {
3679 char value2 = op2->__anon1.c;
3680
3681 exp->type = 2;
3682 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c = value2));
3683 if(!exp->expType)
3684 {
3685 exp->expType = op1->type;
3686 if(op1->type)
3687 op1->type->refCount++;
3688 }
3689 return 1;
3690 }
3691
3692 static unsigned int UCharAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3693 {
3694 unsigned char value2 = op2->__anon1.uc;
3695
3696 exp->type = 2;
3697 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc = value2));
3698 if(!exp->expType)
3699 {
3700 exp->expType = op1->type;
3701 if(op1->type)
3702 op1->type->refCount++;
3703 }
3704 return 1;
3705 }
3706
3707 static unsigned int FloatAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3708 {
3709 float value2 = op2->__anon1.f;
3710
3711 exp->type = 2;
3712 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f = value2));
3713 if(!exp->expType)
3714 {
3715 exp->expType = op1->type;
3716 if(op1->type)
3717 op1->type->refCount++;
3718 }
3719 return 1;
3720 }
3721
3722 static unsigned int DoubleAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3723 {
3724 double value2 = op2->__anon1.d;
3725
3726 exp->type = 2;
3727 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d = value2));
3728 if(!exp->expType)
3729 {
3730 exp->expType = op1->type;
3731 if(op1->type)
3732 op1->type->refCount++;
3733 }
3734 return 1;
3735 }
3736
3737 static unsigned int IntAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3738 {
3739 int value2 = op2->__anon1.i;
3740
3741 exp->type = 2;
3742 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i += value2));
3743 if(!exp->expType)
3744 {
3745 exp->expType = op1->type;
3746 if(op1->type)
3747 op1->type->refCount++;
3748 }
3749 return 1;
3750 }
3751
3752 static unsigned int UIntAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3753 {
3754 unsigned int value2 = op2->__anon1.ui;
3755
3756 exp->type = 2;
3757 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui += value2));
3758 if(!exp->expType)
3759 {
3760 exp->expType = op1->type;
3761 if(op1->type)
3762 op1->type->refCount++;
3763 }
3764 return 1;
3765 }
3766
3767 static unsigned int Int64AddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3768 {
3769 long long value2 = op2->__anon1.i64;
3770
3771 exp->type = 2;
3772 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 += value2));
3773 if(!exp->expType)
3774 {
3775 exp->expType = op1->type;
3776 if(op1->type)
3777 op1->type->refCount++;
3778 }
3779 return 1;
3780 }
3781
3782 static unsigned int UInt64AddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3783 {
3784 uint64 value2 = op2->__anon1.ui64;
3785
3786 exp->type = 2;
3787 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 += value2));
3788 if(!exp->expType)
3789 {
3790 exp->expType = op1->type;
3791 if(op1->type)
3792 op1->type->refCount++;
3793 }
3794 return 1;
3795 }
3796
3797 static unsigned int ShortAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3798 {
3799 short value2 = op2->__anon1.s;
3800
3801 exp->type = 2;
3802 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s += value2));
3803 if(!exp->expType)
3804 {
3805 exp->expType = op1->type;
3806 if(op1->type)
3807 op1->type->refCount++;
3808 }
3809 return 1;
3810 }
3811
3812 static unsigned int UShortAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3813 {
3814 unsigned short value2 = op2->__anon1.us;
3815
3816 exp->type = 2;
3817 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us += value2));
3818 if(!exp->expType)
3819 {
3820 exp->expType = op1->type;
3821 if(op1->type)
3822 op1->type->refCount++;
3823 }
3824 return 1;
3825 }
3826
3827 static unsigned int CharAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3828 {
3829 char value2 = op2->__anon1.c;
3830
3831 exp->type = 2;
3832 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c += value2));
3833 if(!exp->expType)
3834 {
3835 exp->expType = op1->type;
3836 if(op1->type)
3837 op1->type->refCount++;
3838 }
3839 return 1;
3840 }
3841
3842 static unsigned int UCharAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3843 {
3844 unsigned char value2 = op2->__anon1.uc;
3845
3846 exp->type = 2;
3847 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc += value2));
3848 if(!exp->expType)
3849 {
3850 exp->expType = op1->type;
3851 if(op1->type)
3852 op1->type->refCount++;
3853 }
3854 return 1;
3855 }
3856
3857 static unsigned int FloatAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3858 {
3859 float value2 = op2->__anon1.f;
3860
3861 exp->type = 2;
3862 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f += value2));
3863 if(!exp->expType)
3864 {
3865 exp->expType = op1->type;
3866 if(op1->type)
3867 op1->type->refCount++;
3868 }
3869 return 1;
3870 }
3871
3872 static unsigned int DoubleAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3873 {
3874 double value2 = op2->__anon1.d;
3875
3876 exp->type = 2;
3877 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d += value2));
3878 if(!exp->expType)
3879 {
3880 exp->expType = op1->type;
3881 if(op1->type)
3882 op1->type->refCount++;
3883 }
3884 return 1;
3885 }
3886
3887 static unsigned int IntSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3888 {
3889 int value2 = op2->__anon1.i;
3890
3891 exp->type = 2;
3892 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i -= value2));
3893 if(!exp->expType)
3894 {
3895 exp->expType = op1->type;
3896 if(op1->type)
3897 op1->type->refCount++;
3898 }
3899 return 1;
3900 }
3901
3902 static unsigned int UIntSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3903 {
3904 unsigned int value2 = op2->__anon1.ui;
3905
3906 exp->type = 2;
3907 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui -= value2));
3908 if(!exp->expType)
3909 {
3910 exp->expType = op1->type;
3911 if(op1->type)
3912 op1->type->refCount++;
3913 }
3914 return 1;
3915 }
3916
3917 static unsigned int Int64SubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3918 {
3919 long long value2 = op2->__anon1.i64;
3920
3921 exp->type = 2;
3922 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 -= value2));
3923 if(!exp->expType)
3924 {
3925 exp->expType = op1->type;
3926 if(op1->type)
3927 op1->type->refCount++;
3928 }
3929 return 1;
3930 }
3931
3932 static unsigned int UInt64SubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3933 {
3934 uint64 value2 = op2->__anon1.ui64;
3935
3936 exp->type = 2;
3937 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 -= value2));
3938 if(!exp->expType)
3939 {
3940 exp->expType = op1->type;
3941 if(op1->type)
3942 op1->type->refCount++;
3943 }
3944 return 1;
3945 }
3946
3947 static unsigned int ShortSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3948 {
3949 short value2 = op2->__anon1.s;
3950
3951 exp->type = 2;
3952 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s -= value2));
3953 if(!exp->expType)
3954 {
3955 exp->expType = op1->type;
3956 if(op1->type)
3957 op1->type->refCount++;
3958 }
3959 return 1;
3960 }
3961
3962 static unsigned int UShortSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3963 {
3964 unsigned short value2 = op2->__anon1.us;
3965
3966 exp->type = 2;
3967 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us -= value2));
3968 if(!exp->expType)
3969 {
3970 exp->expType = op1->type;
3971 if(op1->type)
3972 op1->type->refCount++;
3973 }
3974 return 1;
3975 }
3976
3977 static unsigned int CharSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3978 {
3979 char value2 = op2->__anon1.c;
3980
3981 exp->type = 2;
3982 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c -= value2));
3983 if(!exp->expType)
3984 {
3985 exp->expType = op1->type;
3986 if(op1->type)
3987 op1->type->refCount++;
3988 }
3989 return 1;
3990 }
3991
3992 static unsigned int UCharSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3993 {
3994 unsigned char value2 = op2->__anon1.uc;
3995
3996 exp->type = 2;
3997 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc -= value2));
3998 if(!exp->expType)
3999 {
4000 exp->expType = op1->type;
4001 if(op1->type)
4002 op1->type->refCount++;
4003 }
4004 return 1;
4005 }
4006
4007 static unsigned int FloatSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4008 {
4009 float value2 = op2->__anon1.f;
4010
4011 exp->type = 2;
4012 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f -= value2));
4013 if(!exp->expType)
4014 {
4015 exp->expType = op1->type;
4016 if(op1->type)
4017 op1->type->refCount++;
4018 }
4019 return 1;
4020 }
4021
4022 static unsigned int DoubleSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4023 {
4024 double value2 = op2->__anon1.d;
4025
4026 exp->type = 2;
4027 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d -= value2));
4028 if(!exp->expType)
4029 {
4030 exp->expType = op1->type;
4031 if(op1->type)
4032 op1->type->refCount++;
4033 }
4034 return 1;
4035 }
4036
4037 static unsigned int IntMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4038 {
4039 int value2 = op2->__anon1.i;
4040
4041 exp->type = 2;
4042 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i *= value2));
4043 if(!exp->expType)
4044 {
4045 exp->expType = op1->type;
4046 if(op1->type)
4047 op1->type->refCount++;
4048 }
4049 return 1;
4050 }
4051
4052 static unsigned int UIntMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4053 {
4054 unsigned int value2 = op2->__anon1.ui;
4055
4056 exp->type = 2;
4057 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui *= value2));
4058 if(!exp->expType)
4059 {
4060 exp->expType = op1->type;
4061 if(op1->type)
4062 op1->type->refCount++;
4063 }
4064 return 1;
4065 }
4066
4067 static unsigned int Int64MulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4068 {
4069 long long value2 = op2->__anon1.i64;
4070
4071 exp->type = 2;
4072 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 *= value2));
4073 if(!exp->expType)
4074 {
4075 exp->expType = op1->type;
4076 if(op1->type)
4077 op1->type->refCount++;
4078 }
4079 return 1;
4080 }
4081
4082 static unsigned int UInt64MulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4083 {
4084 uint64 value2 = op2->__anon1.ui64;
4085
4086 exp->type = 2;
4087 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 *= value2));
4088 if(!exp->expType)
4089 {
4090 exp->expType = op1->type;
4091 if(op1->type)
4092 op1->type->refCount++;
4093 }
4094 return 1;
4095 }
4096
4097 static unsigned int ShortMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4098 {
4099 short value2 = op2->__anon1.s;
4100
4101 exp->type = 2;
4102 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s *= value2));
4103 if(!exp->expType)
4104 {
4105 exp->expType = op1->type;
4106 if(op1->type)
4107 op1->type->refCount++;
4108 }
4109 return 1;
4110 }
4111
4112 static unsigned int UShortMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4113 {
4114 unsigned short value2 = op2->__anon1.us;
4115
4116 exp->type = 2;
4117 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us *= value2));
4118 if(!exp->expType)
4119 {
4120 exp->expType = op1->type;
4121 if(op1->type)
4122 op1->type->refCount++;
4123 }
4124 return 1;
4125 }
4126
4127 static unsigned int CharMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4128 {
4129 char value2 = op2->__anon1.c;
4130
4131 exp->type = 2;
4132 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c *= value2));
4133 if(!exp->expType)
4134 {
4135 exp->expType = op1->type;
4136 if(op1->type)
4137 op1->type->refCount++;
4138 }
4139 return 1;
4140 }
4141
4142 static unsigned int UCharMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4143 {
4144 unsigned char value2 = op2->__anon1.uc;
4145
4146 exp->type = 2;
4147 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc *= value2));
4148 if(!exp->expType)
4149 {
4150 exp->expType = op1->type;
4151 if(op1->type)
4152 op1->type->refCount++;
4153 }
4154 return 1;
4155 }
4156
4157 static unsigned int FloatMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4158 {
4159 float value2 = op2->__anon1.f;
4160
4161 exp->type = 2;
4162 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f *= value2));
4163 if(!exp->expType)
4164 {
4165 exp->expType = op1->type;
4166 if(op1->type)
4167 op1->type->refCount++;
4168 }
4169 return 1;
4170 }
4171
4172 static unsigned int DoubleMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4173 {
4174 double value2 = op2->__anon1.d;
4175
4176 exp->type = 2;
4177 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d *= value2));
4178 if(!exp->expType)
4179 {
4180 exp->expType = op1->type;
4181 if(op1->type)
4182 op1->type->refCount++;
4183 }
4184 return 1;
4185 }
4186
4187 static unsigned int IntDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4188 {
4189 int value2 = op2->__anon1.i;
4190
4191 exp->type = 2;
4192 exp->__anon1.__anon2.string = PrintInt(value2 ? ((op1->__anon1.i /= value2)) : 0);
4193 if(!exp->expType)
4194 {
4195 exp->expType = op1->type;
4196 if(op1->type)
4197 op1->type->refCount++;
4198 }
4199 return 1;
4200 }
4201
4202 static unsigned int UIntDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4203 {
4204 unsigned int value2 = op2->__anon1.ui;
4205
4206 exp->type = 2;
4207 exp->__anon1.__anon2.string = PrintUInt(value2 ? ((op1->__anon1.ui /= value2)) : 0);
4208 if(!exp->expType)
4209 {
4210 exp->expType = op1->type;
4211 if(op1->type)
4212 op1->type->refCount++;
4213 }
4214 return 1;
4215 }
4216
4217 static unsigned int Int64DivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4218 {
4219 long long value2 = op2->__anon1.i64;
4220
4221 exp->type = 2;
4222 exp->__anon1.__anon2.string = PrintInt64(value2 ? ((op1->__anon1.i64 /= value2)) : 0);
4223 if(!exp->expType)
4224 {
4225 exp->expType = op1->type;
4226 if(op1->type)
4227 op1->type->refCount++;
4228 }
4229 return 1;
4230 }
4231
4232 static unsigned int UInt64DivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4233 {
4234 uint64 value2 = op2->__anon1.ui64;
4235
4236 exp->type = 2;
4237 exp->__anon1.__anon2.string = PrintUInt64(value2 ? ((op1->__anon1.ui64 /= value2)) : 0);
4238 if(!exp->expType)
4239 {
4240 exp->expType = op1->type;
4241 if(op1->type)
4242 op1->type->refCount++;
4243 }
4244 return 1;
4245 }
4246
4247 static unsigned int ShortDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4248 {
4249 short value2 = op2->__anon1.s;
4250
4251 exp->type = 2;
4252 exp->__anon1.__anon2.string = PrintShort(value2 ? ((op1->__anon1.s /= value2)) : 0);
4253 if(!exp->expType)
4254 {
4255 exp->expType = op1->type;
4256 if(op1->type)
4257 op1->type->refCount++;
4258 }
4259 return 1;
4260 }
4261
4262 static unsigned int UShortDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4263 {
4264 unsigned short value2 = op2->__anon1.us;
4265
4266 exp->type = 2;
4267 exp->__anon1.__anon2.string = PrintUShort(value2 ? ((op1->__anon1.us /= value2)) : 0);
4268 if(!exp->expType)
4269 {
4270 exp->expType = op1->type;
4271 if(op1->type)
4272 op1->type->refCount++;
4273 }
4274 return 1;
4275 }
4276
4277 static unsigned int CharDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4278 {
4279 char value2 = op2->__anon1.c;
4280
4281 exp->type = 2;
4282 exp->__anon1.__anon2.string = PrintChar(value2 ? ((op1->__anon1.c /= value2)) : 0);
4283 if(!exp->expType)
4284 {
4285 exp->expType = op1->type;
4286 if(op1->type)
4287 op1->type->refCount++;
4288 }
4289 return 1;
4290 }
4291
4292 static unsigned int UCharDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4293 {
4294 unsigned char value2 = op2->__anon1.uc;
4295
4296 exp->type = 2;
4297 exp->__anon1.__anon2.string = PrintUChar(value2 ? ((op1->__anon1.uc /= value2)) : 0);
4298 if(!exp->expType)
4299 {
4300 exp->expType = op1->type;
4301 if(op1->type)
4302 op1->type->refCount++;
4303 }
4304 return 1;
4305 }
4306
4307 static unsigned int FloatDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4308 {
4309 float value2 = op2->__anon1.f;
4310
4311 exp->type = 2;
4312 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f /= value2));
4313 if(!exp->expType)
4314 {
4315 exp->expType = op1->type;
4316 if(op1->type)
4317 op1->type->refCount++;
4318 }
4319 return 1;
4320 }
4321
4322 static unsigned int DoubleDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4323 {
4324 double value2 = op2->__anon1.d;
4325
4326 exp->type = 2;
4327 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d /= value2));
4328 if(!exp->expType)
4329 {
4330 exp->expType = op1->type;
4331 if(op1->type)
4332 op1->type->refCount++;
4333 }
4334 return 1;
4335 }
4336
4337 static unsigned int IntModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4338 {
4339 int value2 = op2->__anon1.i;
4340
4341 exp->type = 2;
4342 exp->__anon1.__anon2.string = PrintInt(value2 ? ((op1->__anon1.i %= value2)) : 0);
4343 if(!exp->expType)
4344 {
4345 exp->expType = op1->type;
4346 if(op1->type)
4347 op1->type->refCount++;
4348 }
4349 return 1;
4350 }
4351
4352 static unsigned int UIntModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4353 {
4354 unsigned int value2 = op2->__anon1.ui;
4355
4356 exp->type = 2;
4357 exp->__anon1.__anon2.string = PrintUInt(value2 ? ((op1->__anon1.ui %= value2)) : 0);
4358 if(!exp->expType)
4359 {
4360 exp->expType = op1->type;
4361 if(op1->type)
4362 op1->type->refCount++;
4363 }
4364 return 1;
4365 }
4366
4367 static unsigned int Int64ModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4368 {
4369 long long value2 = op2->__anon1.i64;
4370
4371 exp->type = 2;
4372 exp->__anon1.__anon2.string = PrintInt64(value2 ? ((op1->__anon1.i64 %= value2)) : 0);
4373 if(!exp->expType)
4374 {
4375 exp->expType = op1->type;
4376 if(op1->type)
4377 op1->type->refCount++;
4378 }
4379 return 1;
4380 }
4381
4382 static unsigned int UInt64ModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4383 {
4384 uint64 value2 = op2->__anon1.ui64;
4385
4386 exp->type = 2;
4387 exp->__anon1.__anon2.string = PrintUInt64(value2 ? ((op1->__anon1.ui64 %= value2)) : 0);
4388 if(!exp->expType)
4389 {
4390 exp->expType = op1->type;
4391 if(op1->type)
4392 op1->type->refCount++;
4393 }
4394 return 1;
4395 }
4396
4397 static unsigned int ShortModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4398 {
4399 short value2 = op2->__anon1.s;
4400
4401 exp->type = 2;
4402 exp->__anon1.__anon2.string = PrintShort(value2 ? ((op1->__anon1.s %= value2)) : 0);
4403 if(!exp->expType)
4404 {
4405 exp->expType = op1->type;
4406 if(op1->type)
4407 op1->type->refCount++;
4408 }
4409 return 1;
4410 }
4411
4412 static unsigned int UShortModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4413 {
4414 unsigned short value2 = op2->__anon1.us;
4415
4416 exp->type = 2;
4417 exp->__anon1.__anon2.string = PrintUShort(value2 ? ((op1->__anon1.us %= value2)) : 0);
4418 if(!exp->expType)
4419 {
4420 exp->expType = op1->type;
4421 if(op1->type)
4422 op1->type->refCount++;
4423 }
4424 return 1;
4425 }
4426
4427 static unsigned int CharModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4428 {
4429 char value2 = op2->__anon1.c;
4430
4431 exp->type = 2;
4432 exp->__anon1.__anon2.string = PrintChar(value2 ? ((op1->__anon1.c %= value2)) : 0);
4433 if(!exp->expType)
4434 {
4435 exp->expType = op1->type;
4436 if(op1->type)
4437 op1->type->refCount++;
4438 }
4439 return 1;
4440 }
4441
4442 static unsigned int UCharModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4443 {
4444 unsigned char value2 = op2->__anon1.uc;
4445
4446 exp->type = 2;
4447 exp->__anon1.__anon2.string = PrintUChar(value2 ? ((op1->__anon1.uc %= value2)) : 0);
4448 if(!exp->expType)
4449 {
4450 exp->expType = op1->type;
4451 if(op1->type)
4452 op1->type->refCount++;
4453 }
4454 return 1;
4455 }
4456
4457 static unsigned int IntBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4458 {
4459 int value2 = op2->__anon1.i;
4460
4461 exp->type = 2;
4462 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i & value2));
4463 if(!exp->expType)
4464 {
4465 exp->expType = op1->type;
4466 if(op1->type)
4467 op1->type->refCount++;
4468 }
4469 return 1;
4470 }
4471
4472 static unsigned int UIntBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4473 {
4474 unsigned int value2 = op2->__anon1.ui;
4475
4476 exp->type = 2;
4477 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui & value2));
4478 if(!exp->expType)
4479 {
4480 exp->expType = op1->type;
4481 if(op1->type)
4482 op1->type->refCount++;
4483 }
4484 return 1;
4485 }
4486
4487 static unsigned int Int64BitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4488 {
4489 long long value2 = op2->__anon1.i64;
4490
4491 exp->type = 2;
4492 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 & value2));
4493 if(!exp->expType)
4494 {
4495 exp->expType = op1->type;
4496 if(op1->type)
4497 op1->type->refCount++;
4498 }
4499 return 1;
4500 }
4501
4502 static unsigned int UInt64BitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4503 {
4504 uint64 value2 = op2->__anon1.ui64;
4505
4506 exp->type = 2;
4507 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 & value2));
4508 if(!exp->expType)
4509 {
4510 exp->expType = op1->type;
4511 if(op1->type)
4512 op1->type->refCount++;
4513 }
4514 return 1;
4515 }
4516
4517 static unsigned int ShortBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4518 {
4519 short value2 = op2->__anon1.s;
4520
4521 exp->type = 2;
4522 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s & value2));
4523 if(!exp->expType)
4524 {
4525 exp->expType = op1->type;
4526 if(op1->type)
4527 op1->type->refCount++;
4528 }
4529 return 1;
4530 }
4531
4532 static unsigned int UShortBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4533 {
4534 unsigned short value2 = op2->__anon1.us;
4535
4536 exp->type = 2;
4537 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us & value2));
4538 if(!exp->expType)
4539 {
4540 exp->expType = op1->type;
4541 if(op1->type)
4542 op1->type->refCount++;
4543 }
4544 return 1;
4545 }
4546
4547 static unsigned int CharBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4548 {
4549 char value2 = op2->__anon1.c;
4550
4551 exp->type = 2;
4552 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c & value2));
4553 if(!exp->expType)
4554 {
4555 exp->expType = op1->type;
4556 if(op1->type)
4557 op1->type->refCount++;
4558 }
4559 return 1;
4560 }
4561
4562 static unsigned int UCharBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4563 {
4564 unsigned char value2 = op2->__anon1.uc;
4565
4566 exp->type = 2;
4567 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc & value2));
4568 if(!exp->expType)
4569 {
4570 exp->expType = op1->type;
4571 if(op1->type)
4572 op1->type->refCount++;
4573 }
4574 return 1;
4575 }
4576
4577 static unsigned int IntBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4578 {
4579 int value2 = op2->__anon1.i;
4580
4581 exp->type = 2;
4582 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i | value2));
4583 if(!exp->expType)
4584 {
4585 exp->expType = op1->type;
4586 if(op1->type)
4587 op1->type->refCount++;
4588 }
4589 return 1;
4590 }
4591
4592 static unsigned int UIntBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4593 {
4594 unsigned int value2 = op2->__anon1.ui;
4595
4596 exp->type = 2;
4597 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui | value2));
4598 if(!exp->expType)
4599 {
4600 exp->expType = op1->type;
4601 if(op1->type)
4602 op1->type->refCount++;
4603 }
4604 return 1;
4605 }
4606
4607 static unsigned int Int64BitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4608 {
4609 long long value2 = op2->__anon1.i64;
4610
4611 exp->type = 2;
4612 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 | value2));
4613 if(!exp->expType)
4614 {
4615 exp->expType = op1->type;
4616 if(op1->type)
4617 op1->type->refCount++;
4618 }
4619 return 1;
4620 }
4621
4622 static unsigned int UInt64BitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4623 {
4624 uint64 value2 = op2->__anon1.ui64;
4625
4626 exp->type = 2;
4627 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 | value2));
4628 if(!exp->expType)
4629 {
4630 exp->expType = op1->type;
4631 if(op1->type)
4632 op1->type->refCount++;
4633 }
4634 return 1;
4635 }
4636
4637 static unsigned int ShortBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4638 {
4639 short value2 = op2->__anon1.s;
4640
4641 exp->type = 2;
4642 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s | value2));
4643 if(!exp->expType)
4644 {
4645 exp->expType = op1->type;
4646 if(op1->type)
4647 op1->type->refCount++;
4648 }
4649 return 1;
4650 }
4651
4652 static unsigned int UShortBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4653 {
4654 unsigned short value2 = op2->__anon1.us;
4655
4656 exp->type = 2;
4657 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us | value2));
4658 if(!exp->expType)
4659 {
4660 exp->expType = op1->type;
4661 if(op1->type)
4662 op1->type->refCount++;
4663 }
4664 return 1;
4665 }
4666
4667 static unsigned int CharBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4668 {
4669 char value2 = op2->__anon1.c;
4670
4671 exp->type = 2;
4672 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c | value2));
4673 if(!exp->expType)
4674 {
4675 exp->expType = op1->type;
4676 if(op1->type)
4677 op1->type->refCount++;
4678 }
4679 return 1;
4680 }
4681
4682 static unsigned int UCharBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4683 {
4684 unsigned char value2 = op2->__anon1.uc;
4685
4686 exp->type = 2;
4687 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc | value2));
4688 if(!exp->expType)
4689 {
4690 exp->expType = op1->type;
4691 if(op1->type)
4692 op1->type->refCount++;
4693 }
4694 return 1;
4695 }
4696
4697 static unsigned int IntBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4698 {
4699 int value2 = op2->__anon1.i;
4700
4701 exp->type = 2;
4702 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i ^ value2));
4703 if(!exp->expType)
4704 {
4705 exp->expType = op1->type;
4706 if(op1->type)
4707 op1->type->refCount++;
4708 }
4709 return 1;
4710 }
4711
4712 static unsigned int UIntBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4713 {
4714 unsigned int value2 = op2->__anon1.ui;
4715
4716 exp->type = 2;
4717 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui ^ value2));
4718 if(!exp->expType)
4719 {
4720 exp->expType = op1->type;
4721 if(op1->type)
4722 op1->type->refCount++;
4723 }
4724 return 1;
4725 }
4726
4727 static unsigned int Int64BitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4728 {
4729 long long value2 = op2->__anon1.i64;
4730
4731 exp->type = 2;
4732 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 ^ value2));
4733 if(!exp->expType)
4734 {
4735 exp->expType = op1->type;
4736 if(op1->type)
4737 op1->type->refCount++;
4738 }
4739 return 1;
4740 }
4741
4742 static unsigned int UInt64BitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4743 {
4744 uint64 value2 = op2->__anon1.ui64;
4745
4746 exp->type = 2;
4747 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 ^ value2));
4748 if(!exp->expType)
4749 {
4750 exp->expType = op1->type;
4751 if(op1->type)
4752 op1->type->refCount++;
4753 }
4754 return 1;
4755 }
4756
4757 static unsigned int ShortBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4758 {
4759 short value2 = op2->__anon1.s;
4760
4761 exp->type = 2;
4762 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s ^ value2));
4763 if(!exp->expType)
4764 {
4765 exp->expType = op1->type;
4766 if(op1->type)
4767 op1->type->refCount++;
4768 }
4769 return 1;
4770 }
4771
4772 static unsigned int UShortBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4773 {
4774 unsigned short value2 = op2->__anon1.us;
4775
4776 exp->type = 2;
4777 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us ^ value2));
4778 if(!exp->expType)
4779 {
4780 exp->expType = op1->type;
4781 if(op1->type)
4782 op1->type->refCount++;
4783 }
4784 return 1;
4785 }
4786
4787 static unsigned int CharBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4788 {
4789 char value2 = op2->__anon1.c;
4790
4791 exp->type = 2;
4792 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c ^ value2));
4793 if(!exp->expType)
4794 {
4795 exp->expType = op1->type;
4796 if(op1->type)
4797 op1->type->refCount++;
4798 }
4799 return 1;
4800 }
4801
4802 static unsigned int UCharBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4803 {
4804 unsigned char value2 = op2->__anon1.uc;
4805
4806 exp->type = 2;
4807 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc ^ value2));
4808 if(!exp->expType)
4809 {
4810 exp->expType = op1->type;
4811 if(op1->type)
4812 op1->type->refCount++;
4813 }
4814 return 1;
4815 }
4816
4817 static unsigned int IntLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4818 {
4819 int value2 = op2->__anon1.i;
4820
4821 exp->type = 2;
4822 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i << value2));
4823 if(!exp->expType)
4824 {
4825 exp->expType = op1->type;
4826 if(op1->type)
4827 op1->type->refCount++;
4828 }
4829 return 1;
4830 }
4831
4832 static unsigned int UIntLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4833 {
4834 unsigned int value2 = op2->__anon1.ui;
4835
4836 exp->type = 2;
4837 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui << value2));
4838 if(!exp->expType)
4839 {
4840 exp->expType = op1->type;
4841 if(op1->type)
4842 op1->type->refCount++;
4843 }
4844 return 1;
4845 }
4846
4847 static unsigned int Int64LShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4848 {
4849 long long value2 = op2->__anon1.i64;
4850
4851 exp->type = 2;
4852 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 << value2));
4853 if(!exp->expType)
4854 {
4855 exp->expType = op1->type;
4856 if(op1->type)
4857 op1->type->refCount++;
4858 }
4859 return 1;
4860 }
4861
4862 static unsigned int UInt64LShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4863 {
4864 uint64 value2 = op2->__anon1.ui64;
4865
4866 exp->type = 2;
4867 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 << value2));
4868 if(!exp->expType)
4869 {
4870 exp->expType = op1->type;
4871 if(op1->type)
4872 op1->type->refCount++;
4873 }
4874 return 1;
4875 }
4876
4877 static unsigned int ShortLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4878 {
4879 short value2 = op2->__anon1.s;
4880
4881 exp->type = 2;
4882 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s << value2));
4883 if(!exp->expType)
4884 {
4885 exp->expType = op1->type;
4886 if(op1->type)
4887 op1->type->refCount++;
4888 }
4889 return 1;
4890 }
4891
4892 static unsigned int UShortLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4893 {
4894 unsigned short value2 = op2->__anon1.us;
4895
4896 exp->type = 2;
4897 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us << value2));
4898 if(!exp->expType)
4899 {
4900 exp->expType = op1->type;
4901 if(op1->type)
4902 op1->type->refCount++;
4903 }
4904 return 1;
4905 }
4906
4907 static unsigned int CharLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4908 {
4909 char value2 = op2->__anon1.c;
4910
4911 exp->type = 2;
4912 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c << value2));
4913 if(!exp->expType)
4914 {
4915 exp->expType = op1->type;
4916 if(op1->type)
4917 op1->type->refCount++;
4918 }
4919 return 1;
4920 }
4921
4922 static unsigned int UCharLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4923 {
4924 unsigned char value2 = op2->__anon1.uc;
4925
4926 exp->type = 2;
4927 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc << value2));
4928 if(!exp->expType)
4929 {
4930 exp->expType = op1->type;
4931 if(op1->type)
4932 op1->type->refCount++;
4933 }
4934 return 1;
4935 }
4936
4937 static unsigned int IntRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4938 {
4939 int value2 = op2->__anon1.i;
4940
4941 exp->type = 2;
4942 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i >> value2));
4943 if(!exp->expType)
4944 {
4945 exp->expType = op1->type;
4946 if(op1->type)
4947 op1->type->refCount++;
4948 }
4949 return 1;
4950 }
4951
4952 static unsigned int UIntRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4953 {
4954 unsigned int value2 = op2->__anon1.ui;
4955
4956 exp->type = 2;
4957 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui >> value2));
4958 if(!exp->expType)
4959 {
4960 exp->expType = op1->type;
4961 if(op1->type)
4962 op1->type->refCount++;
4963 }
4964 return 1;
4965 }
4966
4967 static unsigned int Int64RShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4968 {
4969 long long value2 = op2->__anon1.i64;
4970
4971 exp->type = 2;
4972 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 >> value2));
4973 if(!exp->expType)
4974 {
4975 exp->expType = op1->type;
4976 if(op1->type)
4977 op1->type->refCount++;
4978 }
4979 return 1;
4980 }
4981
4982 static unsigned int UInt64RShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4983 {
4984 uint64 value2 = op2->__anon1.ui64;
4985
4986 exp->type = 2;
4987 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 >> value2));
4988 if(!exp->expType)
4989 {
4990 exp->expType = op1->type;
4991 if(op1->type)
4992 op1->type->refCount++;
4993 }
4994 return 1;
4995 }
4996
4997 static unsigned int ShortRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4998 {
4999 short value2 = op2->__anon1.s;
5000
5001 exp->type = 2;
5002 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s >> value2));
5003 if(!exp->expType)
5004 {
5005 exp->expType = op1->type;
5006 if(op1->type)
5007 op1->type->refCount++;
5008 }
5009 return 1;
5010 }
5011
5012 static unsigned int UShortRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5013 {
5014 unsigned short value2 = op2->__anon1.us;
5015
5016 exp->type = 2;
5017 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us >> value2));
5018 if(!exp->expType)
5019 {
5020 exp->expType = op1->type;
5021 if(op1->type)
5022 op1->type->refCount++;
5023 }
5024 return 1;
5025 }
5026
5027 static unsigned int CharRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5028 {
5029 char value2 = op2->__anon1.c;
5030
5031 exp->type = 2;
5032 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c >> value2));
5033 if(!exp->expType)
5034 {
5035 exp->expType = op1->type;
5036 if(op1->type)
5037 op1->type->refCount++;
5038 }
5039 return 1;
5040 }
5041
5042 static unsigned int UCharRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5043 {
5044 unsigned char value2 = op2->__anon1.uc;
5045
5046 exp->type = 2;
5047 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc >> value2));
5048 if(!exp->expType)
5049 {
5050 exp->expType = op1->type;
5051 if(op1->type)
5052 op1->type->refCount++;
5053 }
5054 return 1;
5055 }
5056
5057 static unsigned int IntBitNot(struct Expression * exp, struct Operand * op1)
5058 {
5059 exp->type = 2;
5060 exp->__anon1.__anon2.string = PrintInt((~op1->__anon1.i));
5061 if(!exp->expType)
5062 {
5063 exp->expType = op1->type;
5064 if(op1->type)
5065 op1->type->refCount++;
5066 }
5067 return 1;
5068 }
5069
5070 static unsigned int UIntBitNot(struct Expression * exp, struct Operand * op1)
5071 {
5072 exp->type = 2;
5073 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(~op1->__anon1.ui));
5074 if(!exp->expType)
5075 {
5076 exp->expType = op1->type;
5077 if(op1->type)
5078 op1->type->refCount++;
5079 }
5080 return 1;
5081 }
5082
5083 static unsigned int Int64BitNot(struct Expression * exp, struct Operand * op1)
5084 {
5085 exp->type = 2;
5086 exp->__anon1.__anon2.string = PrintInt64((long long)(~op1->__anon1.i64));
5087 if(!exp->expType)
5088 {
5089 exp->expType = op1->type;
5090 if(op1->type)
5091 op1->type->refCount++;
5092 }
5093 return 1;
5094 }
5095
5096 static unsigned int UInt64BitNot(struct Expression * exp, struct Operand * op1)
5097 {
5098 exp->type = 2;
5099 exp->__anon1.__anon2.string = PrintUInt64((uint64)(~op1->__anon1.ui64));
5100 if(!exp->expType)
5101 {
5102 exp->expType = op1->type;
5103 if(op1->type)
5104 op1->type->refCount++;
5105 }
5106 return 1;
5107 }
5108
5109 static unsigned int ShortBitNot(struct Expression * exp, struct Operand * op1)
5110 {
5111 exp->type = 2;
5112 exp->__anon1.__anon2.string = PrintShort((short)(~op1->__anon1.s));
5113 if(!exp->expType)
5114 {
5115 exp->expType = op1->type;
5116 if(op1->type)
5117 op1->type->refCount++;
5118 }
5119 return 1;
5120 }
5121
5122 static unsigned int UShortBitNot(struct Expression * exp, struct Operand * op1)
5123 {
5124 exp->type = 2;
5125 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(~op1->__anon1.us));
5126 if(!exp->expType)
5127 {
5128 exp->expType = op1->type;
5129 if(op1->type)
5130 op1->type->refCount++;
5131 }
5132 return 1;
5133 }
5134
5135 static unsigned int CharBitNot(struct Expression * exp, struct Operand * op1)
5136 {
5137 exp->type = 2;
5138 exp->__anon1.__anon2.string = PrintChar((char)(~op1->__anon1.c));
5139 if(!exp->expType)
5140 {
5141 exp->expType = op1->type;
5142 if(op1->type)
5143 op1->type->refCount++;
5144 }
5145 return 1;
5146 }
5147
5148 static unsigned int UCharBitNot(struct Expression * exp, struct Operand * op1)
5149 {
5150 exp->type = 2;
5151 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(~op1->__anon1.uc));
5152 if(!exp->expType)
5153 {
5154 exp->expType = op1->type;
5155 if(op1->type)
5156 op1->type->refCount++;
5157 }
5158 return 1;
5159 }
5160
5161 static unsigned int IntAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5162 {
5163 int value2 = op2->__anon1.i;
5164
5165 exp->type = 2;
5166 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i &= value2));
5167 if(!exp->expType)
5168 {
5169 exp->expType = op1->type;
5170 if(op1->type)
5171 op1->type->refCount++;
5172 }
5173 return 1;
5174 }
5175
5176 static unsigned int UIntAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5177 {
5178 unsigned int value2 = op2->__anon1.ui;
5179
5180 exp->type = 2;
5181 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui &= value2));
5182 if(!exp->expType)
5183 {
5184 exp->expType = op1->type;
5185 if(op1->type)
5186 op1->type->refCount++;
5187 }
5188 return 1;
5189 }
5190
5191 static unsigned int Int64AndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5192 {
5193 long long value2 = op2->__anon1.i64;
5194
5195 exp->type = 2;
5196 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 &= value2));
5197 if(!exp->expType)
5198 {
5199 exp->expType = op1->type;
5200 if(op1->type)
5201 op1->type->refCount++;
5202 }
5203 return 1;
5204 }
5205
5206 static unsigned int UInt64AndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5207 {
5208 uint64 value2 = op2->__anon1.ui64;
5209
5210 exp->type = 2;
5211 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 &= value2));
5212 if(!exp->expType)
5213 {
5214 exp->expType = op1->type;
5215 if(op1->type)
5216 op1->type->refCount++;
5217 }
5218 return 1;
5219 }
5220
5221 static unsigned int ShortAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5222 {
5223 short value2 = op2->__anon1.s;
5224
5225 exp->type = 2;
5226 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s &= value2));
5227 if(!exp->expType)
5228 {
5229 exp->expType = op1->type;
5230 if(op1->type)
5231 op1->type->refCount++;
5232 }
5233 return 1;
5234 }
5235
5236 static unsigned int UShortAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5237 {
5238 unsigned short value2 = op2->__anon1.us;
5239
5240 exp->type = 2;
5241 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us &= value2));
5242 if(!exp->expType)
5243 {
5244 exp->expType = op1->type;
5245 if(op1->type)
5246 op1->type->refCount++;
5247 }
5248 return 1;
5249 }
5250
5251 static unsigned int CharAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5252 {
5253 char value2 = op2->__anon1.c;
5254
5255 exp->type = 2;
5256 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c &= value2));
5257 if(!exp->expType)
5258 {
5259 exp->expType = op1->type;
5260 if(op1->type)
5261 op1->type->refCount++;
5262 }
5263 return 1;
5264 }
5265
5266 static unsigned int UCharAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5267 {
5268 unsigned char value2 = op2->__anon1.uc;
5269
5270 exp->type = 2;
5271 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc &= value2));
5272 if(!exp->expType)
5273 {
5274 exp->expType = op1->type;
5275 if(op1->type)
5276 op1->type->refCount++;
5277 }
5278 return 1;
5279 }
5280
5281 static unsigned int IntOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5282 {
5283 int value2 = op2->__anon1.i;
5284
5285 exp->type = 2;
5286 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i |= value2));
5287 if(!exp->expType)
5288 {
5289 exp->expType = op1->type;
5290 if(op1->type)
5291 op1->type->refCount++;
5292 }
5293 return 1;
5294 }
5295
5296 static unsigned int UIntOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5297 {
5298 unsigned int value2 = op2->__anon1.ui;
5299
5300 exp->type = 2;
5301 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui |= value2));
5302 if(!exp->expType)
5303 {
5304 exp->expType = op1->type;
5305 if(op1->type)
5306 op1->type->refCount++;
5307 }
5308 return 1;
5309 }
5310
5311 static unsigned int Int64OrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5312 {
5313 long long value2 = op2->__anon1.i64;
5314
5315 exp->type = 2;
5316 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 |= value2));
5317 if(!exp->expType)
5318 {
5319 exp->expType = op1->type;
5320 if(op1->type)
5321 op1->type->refCount++;
5322 }
5323 return 1;
5324 }
5325
5326 static unsigned int UInt64OrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5327 {
5328 uint64 value2 = op2->__anon1.ui64;
5329
5330 exp->type = 2;
5331 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 |= value2));
5332 if(!exp->expType)
5333 {
5334 exp->expType = op1->type;
5335 if(op1->type)
5336 op1->type->refCount++;
5337 }
5338 return 1;
5339 }
5340
5341 static unsigned int ShortOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5342 {
5343 short value2 = op2->__anon1.s;
5344
5345 exp->type = 2;
5346 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s |= value2));
5347 if(!exp->expType)
5348 {
5349 exp->expType = op1->type;
5350 if(op1->type)
5351 op1->type->refCount++;
5352 }
5353 return 1;
5354 }
5355
5356 static unsigned int UShortOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5357 {
5358 unsigned short value2 = op2->__anon1.us;
5359
5360 exp->type = 2;
5361 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us |= value2));
5362 if(!exp->expType)
5363 {
5364 exp->expType = op1->type;
5365 if(op1->type)
5366 op1->type->refCount++;
5367 }
5368 return 1;
5369 }
5370
5371 static unsigned int CharOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5372 {
5373 char value2 = op2->__anon1.c;
5374
5375 exp->type = 2;
5376 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c |= value2));
5377 if(!exp->expType)
5378 {
5379 exp->expType = op1->type;
5380 if(op1->type)
5381 op1->type->refCount++;
5382 }
5383 return 1;
5384 }
5385
5386 static unsigned int UCharOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5387 {
5388 unsigned char value2 = op2->__anon1.uc;
5389
5390 exp->type = 2;
5391 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc |= value2));
5392 if(!exp->expType)
5393 {
5394 exp->expType = op1->type;
5395 if(op1->type)
5396 op1->type->refCount++;
5397 }
5398 return 1;
5399 }
5400
5401 static unsigned int IntXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5402 {
5403 int value2 = op2->__anon1.i;
5404
5405 exp->type = 2;
5406 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i ^= value2));
5407 if(!exp->expType)
5408 {
5409 exp->expType = op1->type;
5410 if(op1->type)
5411 op1->type->refCount++;
5412 }
5413 return 1;
5414 }
5415
5416 static unsigned int UIntXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5417 {
5418 unsigned int value2 = op2->__anon1.ui;
5419
5420 exp->type = 2;
5421 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui ^= value2));
5422 if(!exp->expType)
5423 {
5424 exp->expType = op1->type;
5425 if(op1->type)
5426 op1->type->refCount++;
5427 }
5428 return 1;
5429 }
5430
5431 static unsigned int Int64XorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5432 {
5433 long long value2 = op2->__anon1.i64;
5434
5435 exp->type = 2;
5436 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 ^= value2));
5437 if(!exp->expType)
5438 {
5439 exp->expType = op1->type;
5440 if(op1->type)
5441 op1->type->refCount++;
5442 }
5443 return 1;
5444 }
5445
5446 static unsigned int UInt64XorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5447 {
5448 uint64 value2 = op2->__anon1.ui64;
5449
5450 exp->type = 2;
5451 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 ^= value2));
5452 if(!exp->expType)
5453 {
5454 exp->expType = op1->type;
5455 if(op1->type)
5456 op1->type->refCount++;
5457 }
5458 return 1;
5459 }
5460
5461 static unsigned int ShortXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5462 {
5463 short value2 = op2->__anon1.s;
5464
5465 exp->type = 2;
5466 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s ^= value2));
5467 if(!exp->expType)
5468 {
5469 exp->expType = op1->type;
5470 if(op1->type)
5471 op1->type->refCount++;
5472 }
5473 return 1;
5474 }
5475
5476 static unsigned int UShortXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5477 {
5478 unsigned short value2 = op2->__anon1.us;
5479
5480 exp->type = 2;
5481 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us ^= value2));
5482 if(!exp->expType)
5483 {
5484 exp->expType = op1->type;
5485 if(op1->type)
5486 op1->type->refCount++;
5487 }
5488 return 1;
5489 }
5490
5491 static unsigned int CharXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5492 {
5493 char value2 = op2->__anon1.c;
5494
5495 exp->type = 2;
5496 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c ^= value2));
5497 if(!exp->expType)
5498 {
5499 exp->expType = op1->type;
5500 if(op1->type)
5501 op1->type->refCount++;
5502 }
5503 return 1;
5504 }
5505
5506 static unsigned int UCharXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5507 {
5508 unsigned char value2 = op2->__anon1.uc;
5509
5510 exp->type = 2;
5511 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc ^= value2));
5512 if(!exp->expType)
5513 {
5514 exp->expType = op1->type;
5515 if(op1->type)
5516 op1->type->refCount++;
5517 }
5518 return 1;
5519 }
5520
5521 static unsigned int IntLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5522 {
5523 int value2 = op2->__anon1.i;
5524
5525 exp->type = 2;
5526 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i <<= value2));
5527 if(!exp->expType)
5528 {
5529 exp->expType = op1->type;
5530 if(op1->type)
5531 op1->type->refCount++;
5532 }
5533 return 1;
5534 }
5535
5536 static unsigned int UIntLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5537 {
5538 unsigned int value2 = op2->__anon1.ui;
5539
5540 exp->type = 2;
5541 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui <<= value2));
5542 if(!exp->expType)
5543 {
5544 exp->expType = op1->type;
5545 if(op1->type)
5546 op1->type->refCount++;
5547 }
5548 return 1;
5549 }
5550
5551 static unsigned int Int64LShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5552 {
5553 long long value2 = op2->__anon1.i64;
5554
5555 exp->type = 2;
5556 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 <<= value2));
5557 if(!exp->expType)
5558 {
5559 exp->expType = op1->type;
5560 if(op1->type)
5561 op1->type->refCount++;
5562 }
5563 return 1;
5564 }
5565
5566 static unsigned int UInt64LShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5567 {
5568 uint64 value2 = op2->__anon1.ui64;
5569
5570 exp->type = 2;
5571 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 <<= value2));
5572 if(!exp->expType)
5573 {
5574 exp->expType = op1->type;
5575 if(op1->type)
5576 op1->type->refCount++;
5577 }
5578 return 1;
5579 }
5580
5581 static unsigned int ShortLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5582 {
5583 short value2 = op2->__anon1.s;
5584
5585 exp->type = 2;
5586 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s <<= value2));
5587 if(!exp->expType)
5588 {
5589 exp->expType = op1->type;
5590 if(op1->type)
5591 op1->type->refCount++;
5592 }
5593 return 1;
5594 }
5595
5596 static unsigned int UShortLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5597 {
5598 unsigned short value2 = op2->__anon1.us;
5599
5600 exp->type = 2;
5601 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us <<= value2));
5602 if(!exp->expType)
5603 {
5604 exp->expType = op1->type;
5605 if(op1->type)
5606 op1->type->refCount++;
5607 }
5608 return 1;
5609 }
5610
5611 static unsigned int CharLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5612 {
5613 char value2 = op2->__anon1.c;
5614
5615 exp->type = 2;
5616 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c <<= value2));
5617 if(!exp->expType)
5618 {
5619 exp->expType = op1->type;
5620 if(op1->type)
5621 op1->type->refCount++;
5622 }
5623 return 1;
5624 }
5625
5626 static unsigned int UCharLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5627 {
5628 unsigned char value2 = op2->__anon1.uc;
5629
5630 exp->type = 2;
5631 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc <<= value2));
5632 if(!exp->expType)
5633 {
5634 exp->expType = op1->type;
5635 if(op1->type)
5636 op1->type->refCount++;
5637 }
5638 return 1;
5639 }
5640
5641 static unsigned int IntRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5642 {
5643 int value2 = op2->__anon1.i;
5644
5645 exp->type = 2;
5646 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i >>= value2));
5647 if(!exp->expType)
5648 {
5649 exp->expType = op1->type;
5650 if(op1->type)
5651 op1->type->refCount++;
5652 }
5653 return 1;
5654 }
5655
5656 static unsigned int UIntRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5657 {
5658 unsigned int value2 = op2->__anon1.ui;
5659
5660 exp->type = 2;
5661 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui >>= value2));
5662 if(!exp->expType)
5663 {
5664 exp->expType = op1->type;
5665 if(op1->type)
5666 op1->type->refCount++;
5667 }
5668 return 1;
5669 }
5670
5671 static unsigned int Int64RShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5672 {
5673 long long value2 = op2->__anon1.i64;
5674
5675 exp->type = 2;
5676 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 >>= value2));
5677 if(!exp->expType)
5678 {
5679 exp->expType = op1->type;
5680 if(op1->type)
5681 op1->type->refCount++;
5682 }
5683 return 1;
5684 }
5685
5686 static unsigned int UInt64RShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5687 {
5688 uint64 value2 = op2->__anon1.ui64;
5689
5690 exp->type = 2;
5691 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 >>= value2));
5692 if(!exp->expType)
5693 {
5694 exp->expType = op1->type;
5695 if(op1->type)
5696 op1->type->refCount++;
5697 }
5698 return 1;
5699 }
5700
5701 static unsigned int ShortRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5702 {
5703 short value2 = op2->__anon1.s;
5704
5705 exp->type = 2;
5706 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s >>= value2));
5707 if(!exp->expType)
5708 {
5709 exp->expType = op1->type;
5710 if(op1->type)
5711 op1->type->refCount++;
5712 }
5713 return 1;
5714 }
5715
5716 static unsigned int UShortRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5717 {
5718 unsigned short value2 = op2->__anon1.us;
5719
5720 exp->type = 2;
5721 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us >>= value2));
5722 if(!exp->expType)
5723 {
5724 exp->expType = op1->type;
5725 if(op1->type)
5726 op1->type->refCount++;
5727 }
5728 return 1;
5729 }
5730
5731 static unsigned int CharRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5732 {
5733 char value2 = op2->__anon1.c;
5734
5735 exp->type = 2;
5736 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c >>= value2));
5737 if(!exp->expType)
5738 {
5739 exp->expType = op1->type;
5740 if(op1->type)
5741 op1->type->refCount++;
5742 }
5743 return 1;
5744 }
5745
5746 static unsigned int UCharRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5747 {
5748 unsigned char value2 = op2->__anon1.uc;
5749
5750 exp->type = 2;
5751 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc >>= value2));
5752 if(!exp->expType)
5753 {
5754 exp->expType = op1->type;
5755 if(op1->type)
5756 op1->type->refCount++;
5757 }
5758 return 1;
5759 }
5760
5761 static unsigned int IntNot(struct Expression * exp, struct Operand * op1)
5762 {
5763 exp->type = 2;
5764 exp->__anon1.__anon2.string = PrintInt((int)(!op1->__anon1.i));
5765 if(!exp->expType)
5766 {
5767 exp->expType = op1->type;
5768 if(op1->type)
5769 op1->type->refCount++;
5770 }
5771 return 1;
5772 }
5773
5774 static unsigned int UIntNot(struct Expression * exp, struct Operand * op1)
5775 {
5776 exp->type = 2;
5777 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(!op1->__anon1.ui));
5778 if(!exp->expType)
5779 {
5780 exp->expType = op1->type;
5781 if(op1->type)
5782 op1->type->refCount++;
5783 }
5784 return 1;
5785 }
5786
5787 static unsigned int Int64Not(struct Expression * exp, struct Operand * op1)
5788 {
5789 exp->type = 2;
5790 exp->__anon1.__anon2.string = PrintInt64((long long)(!op1->__anon1.i64));
5791 if(!exp->expType)
5792 {
5793 exp->expType = op1->type;
5794 if(op1->type)
5795 op1->type->refCount++;
5796 }
5797 return 1;
5798 }
5799
5800 static unsigned int UInt64Not(struct Expression * exp, struct Operand * op1)
5801 {
5802 exp->type = 2;
5803 exp->__anon1.__anon2.string = PrintUInt64((uint64)(!op1->__anon1.ui64));
5804 if(!exp->expType)
5805 {
5806 exp->expType = op1->type;
5807 if(op1->type)
5808 op1->type->refCount++;
5809 }
5810 return 1;
5811 }
5812
5813 static unsigned int ShortNot(struct Expression * exp, struct Operand * op1)
5814 {
5815 exp->type = 2;
5816 exp->__anon1.__anon2.string = PrintShort((short)(!op1->__anon1.s));
5817 if(!exp->expType)
5818 {
5819 exp->expType = op1->type;
5820 if(op1->type)
5821 op1->type->refCount++;
5822 }
5823 return 1;
5824 }
5825
5826 static unsigned int UShortNot(struct Expression * exp, struct Operand * op1)
5827 {
5828 exp->type = 2;
5829 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(!op1->__anon1.us));
5830 if(!exp->expType)
5831 {
5832 exp->expType = op1->type;
5833 if(op1->type)
5834 op1->type->refCount++;
5835 }
5836 return 1;
5837 }
5838
5839 static unsigned int CharNot(struct Expression * exp, struct Operand * op1)
5840 {
5841 exp->type = 2;
5842 exp->__anon1.__anon2.string = PrintChar((char)(!op1->__anon1.c));
5843 if(!exp->expType)
5844 {
5845 exp->expType = op1->type;
5846 if(op1->type)
5847 op1->type->refCount++;
5848 }
5849 return 1;
5850 }
5851
5852 static unsigned int UCharNot(struct Expression * exp, struct Operand * op1)
5853 {
5854 exp->type = 2;
5855 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(!op1->__anon1.uc));
5856 if(!exp->expType)
5857 {
5858 exp->expType = op1->type;
5859 if(op1->type)
5860 op1->type->refCount++;
5861 }
5862 return 1;
5863 }
5864
5865 static unsigned int IntEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5866 {
5867 int value2 = op2->__anon1.i;
5868
5869 exp->type = 2;
5870 exp->__anon1.__anon2.string = PrintInt((int)(op1->__anon1.i == value2));
5871 if(!exp->expType)
5872 {
5873 exp->expType = op1->type;
5874 if(op1->type)
5875 op1->type->refCount++;
5876 }
5877 return 1;
5878 }
5879
5880 static unsigned int UIntEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5881 {
5882 unsigned int value2 = op2->__anon1.ui;
5883
5884 exp->type = 2;
5885 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(op1->__anon1.ui == value2));
5886 if(!exp->expType)
5887 {
5888 exp->expType = op1->type;
5889 if(op1->type)
5890 op1->type->refCount++;
5891 }
5892 return 1;
5893 }
5894
5895 static unsigned int Int64Equ(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5896 {
5897 long long value2 = op2->__anon1.i64;
5898
5899 exp->type = 2;
5900 exp->__anon1.__anon2.string = PrintInt64((long long)(op1->__anon1.i64 == value2));
5901 if(!exp->expType)
5902 {
5903 exp->expType = op1->type;
5904 if(op1->type)
5905 op1->type->refCount++;
5906 }
5907 return 1;
5908 }
5909
5910 static unsigned int UInt64Equ(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5911 {
5912 uint64 value2 = op2->__anon1.ui64;
5913
5914 exp->type = 2;
5915 exp->__anon1.__anon2.string = PrintUInt64((uint64)(op1->__anon1.ui64 == value2));
5916 if(!exp->expType)
5917 {
5918 exp->expType = op1->type;
5919 if(op1->type)
5920 op1->type->refCount++;
5921 }
5922 return 1;
5923 }
5924
5925 static unsigned int ShortEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5926 {
5927 short value2 = op2->__anon1.s;
5928
5929 exp->type = 2;
5930 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s == value2));
5931 if(!exp->expType)
5932 {
5933 exp->expType = op1->type;
5934 if(op1->type)
5935 op1->type->refCount++;
5936 }
5937 return 1;
5938 }
5939
5940 static unsigned int UShortEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5941 {
5942 unsigned short value2 = op2->__anon1.us;
5943
5944 exp->type = 2;
5945 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us == value2));
5946 if(!exp->expType)
5947 {
5948 exp->expType = op1->type;
5949 if(op1->type)
5950 op1->type->refCount++;
5951 }
5952 return 1;
5953 }
5954
5955 static unsigned int CharEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5956 {
5957 char value2 = op2->__anon1.c;
5958
5959 exp->type = 2;
5960 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c == value2));
5961 if(!exp->expType)
5962 {
5963 exp->expType = op1->type;
5964 if(op1->type)
5965 op1->type->refCount++;
5966 }
5967 return 1;
5968 }
5969
5970 static unsigned int UCharEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5971 {
5972 unsigned char value2 = op2->__anon1.uc;
5973
5974 exp->type = 2;
5975 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc == value2));
5976 if(!exp->expType)
5977 {
5978 exp->expType = op1->type;
5979 if(op1->type)
5980 op1->type->refCount++;
5981 }
5982 return 1;
5983 }
5984
5985 static unsigned int FloatEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5986 {
5987 float value2 = op2->__anon1.f;
5988
5989 exp->type = 2;
5990 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f == value2));
5991 if(!exp->expType)
5992 {
5993 exp->expType = op1->type;
5994 if(op1->type)
5995 op1->type->refCount++;
5996 }
5997 return 1;
5998 }
5999
6000 static unsigned int DoubleEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6001 {
6002 double value2 = op2->__anon1.d;
6003
6004 exp->type = 2;
6005 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d == value2));
6006 if(!exp->expType)
6007 {
6008 exp->expType = op1->type;
6009 if(op1->type)
6010 op1->type->refCount++;
6011 }
6012 return 1;
6013 }
6014
6015 static unsigned int IntNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6016 {
6017 int value2 = op2->__anon1.i;
6018
6019 exp->type = 2;
6020 exp->__anon1.__anon2.string = PrintInt((int)(op1->__anon1.i != value2));
6021 if(!exp->expType)
6022 {
6023 exp->expType = op1->type;
6024 if(op1->type)
6025 op1->type->refCount++;
6026 }
6027 return 1;
6028 }
6029
6030 static unsigned int UIntNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6031 {
6032 unsigned int value2 = op2->__anon1.ui;
6033
6034 exp->type = 2;
6035 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(op1->__anon1.ui != value2));
6036 if(!exp->expType)
6037 {
6038 exp->expType = op1->type;
6039 if(op1->type)
6040 op1->type->refCount++;
6041 }
6042 return 1;
6043 }
6044
6045 static unsigned int Int64Nqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6046 {
6047 long long value2 = op2->__anon1.i64;
6048
6049 exp->type = 2;
6050 exp->__anon1.__anon2.string = PrintInt64((long long)(op1->__anon1.i64 != value2));
6051 if(!exp->expType)
6052 {
6053 exp->expType = op1->type;
6054 if(op1->type)
6055 op1->type->refCount++;
6056 }
6057 return 1;
6058 }
6059
6060 static unsigned int UInt64Nqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6061 {
6062 uint64 value2 = op2->__anon1.ui64;
6063
6064 exp->type = 2;
6065 exp->__anon1.__anon2.string = PrintUInt64((uint64)(op1->__anon1.ui64 != value2));
6066 if(!exp->expType)
6067 {
6068 exp->expType = op1->type;
6069 if(op1->type)
6070 op1->type->refCount++;
6071 }
6072 return 1;
6073 }
6074
6075 static unsigned int ShortNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6076 {
6077 short value2 = op2->__anon1.s;
6078
6079 exp->type = 2;
6080 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s != value2));
6081 if(!exp->expType)
6082 {
6083 exp->expType = op1->type;
6084 if(op1->type)
6085 op1->type->refCount++;
6086 }
6087 return 1;
6088 }
6089
6090 static unsigned int UShortNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6091 {
6092 unsigned short value2 = op2->__anon1.us;
6093
6094 exp->type = 2;
6095 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us != value2));
6096 if(!exp->expType)
6097 {
6098 exp->expType = op1->type;
6099 if(op1->type)
6100 op1->type->refCount++;
6101 }
6102 return 1;
6103 }
6104
6105 static unsigned int CharNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6106 {
6107 char value2 = op2->__anon1.c;
6108
6109 exp->type = 2;
6110 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c != value2));
6111 if(!exp->expType)
6112 {
6113 exp->expType = op1->type;
6114 if(op1->type)
6115 op1->type->refCount++;
6116 }
6117 return 1;
6118 }
6119
6120 static unsigned int UCharNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6121 {
6122 unsigned char value2 = op2->__anon1.uc;
6123
6124 exp->type = 2;
6125 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc != value2));
6126 if(!exp->expType)
6127 {
6128 exp->expType = op1->type;
6129 if(op1->type)
6130 op1->type->refCount++;
6131 }
6132 return 1;
6133 }
6134
6135 static unsigned int FloatNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6136 {
6137 float value2 = op2->__anon1.f;
6138
6139 exp->type = 2;
6140 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f != value2));
6141 if(!exp->expType)
6142 {
6143 exp->expType = op1->type;
6144 if(op1->type)
6145 op1->type->refCount++;
6146 }
6147 return 1;
6148 }
6149
6150 static unsigned int DoubleNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6151 {
6152 double value2 = op2->__anon1.d;
6153
6154 exp->type = 2;
6155 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d != value2));
6156 if(!exp->expType)
6157 {
6158 exp->expType = op1->type;
6159 if(op1->type)
6160 op1->type->refCount++;
6161 }
6162 return 1;
6163 }
6164
6165 static unsigned int IntAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6166 {
6167 int value2 = op2->__anon1.i;
6168
6169 exp->type = 2;
6170 exp->__anon1.__anon2.string = PrintInt((int)(op1->__anon1.i && value2));
6171 if(!exp->expType)
6172 {
6173 exp->expType = op1->type;
6174 if(op1->type)
6175 op1->type->refCount++;
6176 }
6177 return 1;
6178 }
6179
6180 static unsigned int UIntAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6181 {
6182 unsigned int value2 = op2->__anon1.ui;
6183
6184 exp->type = 2;
6185 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(op1->__anon1.ui && value2));
6186 if(!exp->expType)
6187 {
6188 exp->expType = op1->type;
6189 if(op1->type)
6190 op1->type->refCount++;
6191 }
6192 return 1;
6193 }
6194
6195 static unsigned int Int64And(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6196 {
6197 long long value2 = op2->__anon1.i64;
6198
6199 exp->type = 2;
6200 exp->__anon1.__anon2.string = PrintInt64((long long)(op1->__anon1.i64 && value2));
6201 if(!exp->expType)
6202 {
6203 exp->expType = op1->type;
6204 if(op1->type)
6205 op1->type->refCount++;
6206 }
6207 return 1;
6208 }
6209
6210 static unsigned int UInt64And(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6211 {
6212 uint64 value2 = op2->__anon1.ui64;
6213
6214 exp->type = 2;
6215 exp->__anon1.__anon2.string = PrintUInt64((uint64)(op1->__anon1.ui64 && value2));
6216 if(!exp->expType)
6217 {
6218 exp->expType = op1->type;
6219 if(op1->type)
6220 op1->type->refCount++;
6221 }
6222 return 1;
6223 }
6224
6225 static unsigned int ShortAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6226 {
6227 short value2 = op2->__anon1.s;
6228
6229 exp->type = 2;
6230 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s && value2));
6231 if(!exp->expType)
6232 {
6233 exp->expType = op1->type;
6234 if(op1->type)
6235 op1->type->refCount++;
6236 }
6237 return 1;
6238 }
6239
6240 static unsigned int UShortAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6241 {
6242 unsigned short value2 = op2->__anon1.us;
6243
6244 exp->type = 2;
6245 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us && value2));
6246 if(!exp->expType)
6247 {
6248 exp->expType = op1->type;
6249 if(op1->type)
6250 op1->type->refCount++;
6251 }
6252 return 1;
6253 }
6254
6255 static unsigned int CharAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6256 {
6257 char value2 = op2->__anon1.c;
6258
6259 exp->type = 2;
6260 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c && value2));
6261 if(!exp->expType)
6262 {
6263 exp->expType = op1->type;
6264 if(op1->type)
6265 op1->type->refCount++;
6266 }
6267 return 1;
6268 }
6269
6270 static unsigned int UCharAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6271 {
6272 unsigned char value2 = op2->__anon1.uc;
6273
6274 exp->type = 2;
6275 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc && value2));
6276 if(!exp->expType)
6277 {
6278 exp->expType = op1->type;
6279 if(op1->type)
6280 op1->type->refCount++;
6281 }
6282 return 1;
6283 }
6284
6285 static unsigned int FloatAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6286 {
6287 float value2 = op2->__anon1.f;
6288
6289 exp->type = 2;
6290 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f && value2));
6291 if(!exp->expType)
6292 {
6293 exp->expType = op1->type;
6294 if(op1->type)
6295 op1->type->refCount++;
6296 }
6297 return 1;
6298 }
6299
6300 static unsigned int DoubleAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6301 {
6302 double value2 = op2->__anon1.d;
6303
6304 exp->type = 2;
6305 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d && value2));
6306 if(!exp->expType)
6307 {
6308 exp->expType = op1->type;
6309 if(op1->type)
6310 op1->type->refCount++;
6311 }
6312 return 1;
6313 }
6314
6315 static unsigned int IntOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6316 {
6317 int value2 = op2->__anon1.i;
6318
6319 exp->type = 2;
6320 exp->__anon1.__anon2.string = PrintInt((int)(op1->__anon1.i || value2));
6321 if(!exp->expType)
6322 {
6323 exp->expType = op1->type;
6324 if(op1->type)
6325 op1->type->refCount++;
6326 }
6327 return 1;
6328 }
6329
6330 static unsigned int UIntOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6331 {
6332 unsigned int value2 = op2->__anon1.ui;
6333
6334 exp->type = 2;
6335 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(op1->__anon1.ui || value2));
6336 if(!exp->expType)
6337 {
6338 exp->expType = op1->type;
6339 if(op1->type)
6340 op1->type->refCount++;
6341 }
6342 return 1;
6343 }
6344
6345 static unsigned int Int64Or(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6346 {
6347 long long value2 = op2->__anon1.i64;
6348
6349 exp->type = 2;
6350 exp->__anon1.__anon2.string = PrintInt64((long long)(op1->__anon1.i64 || value2));
6351 if(!exp->expType)
6352 {
6353 exp->expType = op1->type;
6354 if(op1->type)
6355 op1->type->refCount++;
6356 }
6357 return 1;
6358 }
6359
6360 static unsigned int UInt64Or(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6361 {
6362 uint64 value2 = op2->__anon1.ui64;
6363
6364 exp->type = 2;
6365 exp->__anon1.__anon2.string = PrintUInt64((uint64)(op1->__anon1.ui64 || value2));
6366 if(!exp->expType)
6367 {
6368 exp->expType = op1->type;
6369 if(op1->type)
6370 op1->type->refCount++;
6371 }
6372 return 1;
6373 }
6374
6375 static unsigned int ShortOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6376 {
6377 short value2 = op2->__anon1.s;
6378
6379 exp->type = 2;
6380 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s || value2));
6381 if(!exp->expType)
6382 {
6383 exp->expType = op1->type;
6384 if(op1->type)
6385 op1->type->refCount++;
6386 }
6387 return 1;
6388 }
6389
6390 static unsigned int UShortOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6391 {
6392 unsigned short value2 = op2->__anon1.us;
6393
6394 exp->type = 2;
6395 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us || value2));
6396 if(!exp->expType)
6397 {
6398 exp->expType = op1->type;
6399 if(op1->type)
6400 op1->type->refCount++;
6401 }
6402 return 1;
6403 }
6404
6405 static unsigned int CharOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6406 {
6407 char value2 = op2->__anon1.c;
6408
6409 exp->type = 2;
6410 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c || value2));
6411 if(!exp->expType)
6412 {
6413 exp->expType = op1->type;
6414 if(op1->type)
6415 op1->type->refCount++;
6416 }
6417 return 1;
6418 }
6419
6420 static unsigned int UCharOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6421 {
6422 unsigned char value2 = op2->__anon1.uc;
6423
6424 exp->type = 2;
6425 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc || value2));
6426 if(!exp->expType)
6427 {
6428 exp->expType = op1->type;
6429 if(op1->type)
6430 op1->type->refCount++;
6431 }
6432 return 1;
6433 }
6434
6435 static unsigned int FloatOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6436 {
6437 float value2 = op2->__anon1.f;
6438
6439 exp->type = 2;
6440 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f || value2));
6441 if(!exp->expType)
6442 {
6443 exp->expType = op1->type;
6444 if(op1->type)
6445 op1->type->refCount++;
6446 }
6447 return 1;
6448 }
6449
6450 static unsigned int DoubleOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6451 {
6452 double value2 = op2->__anon1.d;
6453
6454 exp->type = 2;
6455 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d || value2));
6456 if(!exp->expType)
6457 {
6458 exp->expType = op1->type;
6459 if(op1->type)
6460 op1->type->refCount++;
6461 }
6462 return 1;
6463 }
6464
6465 static unsigned int IntGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6466 {
6467 int value2 = op2->__anon1.i;
6468
6469 exp->type = 2;
6470 exp->__anon1.__anon2.string = PrintInt((int)(op1->__anon1.i > value2));
6471 if(!exp->expType)
6472 {
6473 exp->expType = op1->type;
6474 if(op1->type)
6475 op1->type->refCount++;
6476 }
6477 return 1;
6478 }
6479
6480 static unsigned int UIntGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6481 {
6482 unsigned int value2 = op2->__anon1.ui;
6483
6484 exp->type = 2;
6485 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(op1->__anon1.ui > value2));
6486 if(!exp->expType)
6487 {
6488 exp->expType = op1->type;
6489 if(op1->type)
6490 op1->type->refCount++;
6491 }
6492 return 1;
6493 }
6494
6495 static unsigned int Int64Grt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6496 {
6497 long long value2 = op2->__anon1.i64;
6498
6499 exp->type = 2;
6500 exp->__anon1.__anon2.string = PrintInt64((long long)(op1->__anon1.i64 > value2));
6501 if(!exp->expType)
6502 {
6503 exp->expType = op1->type;
6504 if(op1->type)
6505 op1->type->refCount++;
6506 }
6507 return 1;
6508 }
6509
6510 static unsigned int UInt64Grt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6511 {
6512 uint64 value2 = op2->__anon1.ui64;
6513
6514 exp->type = 2;
6515 exp->__anon1.__anon2.string = PrintUInt64((uint64)(op1->__anon1.ui64 > value2));
6516 if(!exp->expType)
6517 {
6518 exp->expType = op1->type;
6519 if(op1->type)
6520 op1->type->refCount++;
6521 }
6522 return 1;
6523 }
6524
6525 static unsigned int ShortGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6526 {
6527 short value2 = op2->__anon1.s;
6528
6529 exp->type = 2;
6530 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s > value2));
6531 if(!exp->expType)
6532 {
6533 exp->expType = op1->type;
6534 if(op1->type)
6535 op1->type->refCount++;
6536 }
6537 return 1;
6538 }
6539
6540 static unsigned int UShortGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6541 {
6542 unsigned short value2 = op2->__anon1.us;
6543
6544 exp->type = 2;
6545 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us > value2));
6546 if(!exp->expType)
6547 {
6548 exp->expType = op1->type;
6549 if(op1->type)
6550 op1->type->refCount++;
6551 }
6552 return 1;
6553 }
6554
6555 static unsigned int CharGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6556 {
6557 char value2 = op2->__anon1.c;
6558
6559 exp->type = 2;
6560 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c > value2));
6561 if(!exp->expType)
6562 {
6563 exp->expType = op1->type;
6564 if(op1->type)
6565 op1->type->refCount++;
6566 }
6567 return 1;
6568 }
6569
6570 static unsigned int UCharGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6571 {
6572 unsigned char value2 = op2->__anon1.uc;
6573
6574 exp->type = 2;
6575 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc > value2));
6576 if(!exp->expType)
6577 {
6578 exp->expType = op1->type;
6579 if(op1->type)
6580 op1->type->refCount++;
6581 }
6582 return 1;
6583 }
6584
6585 static unsigned int FloatGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6586 {
6587 float value2 = op2->__anon1.f;
6588
6589 exp->type = 2;
6590 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f > value2));
6591 if(!exp->expType)
6592 {
6593 exp->expType = op1->type;
6594 if(op1->type)
6595 op1->type->refCount++;
6596 }
6597 return 1;
6598 }
6599
6600 static unsigned int DoubleGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6601 {
6602 double value2 = op2->__anon1.d;
6603
6604 exp->type = 2;
6605 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d > value2));
6606 if(!exp->expType)
6607 {
6608 exp->expType = op1->type;
6609 if(op1->type)
6610 op1->type->refCount++;
6611 }
6612 return 1;
6613 }
6614
6615 static unsigned int IntSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6616 {
6617 int value2 = op2->__anon1.i;
6618
6619 exp->type = 2;
6620 exp->__anon1.__anon2.string = PrintInt((int)(op1->__anon1.i < value2));
6621 if(!exp->expType)
6622 {
6623 exp->expType = op1->type;
6624 if(op1->type)
6625 op1->type->refCount++;
6626 }
6627 return 1;
6628 }
6629
6630 static unsigned int UIntSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6631 {
6632 unsigned int value2 = op2->__anon1.ui;
6633
6634 exp->type = 2;
6635 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(op1->__anon1.ui < value2));
6636 if(!exp->expType)
6637 {
6638 exp->expType = op1->type;
6639 if(op1->type)
6640 op1->type->refCount++;
6641 }
6642 return 1;
6643 }
6644
6645 static unsigned int Int64Sma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6646 {
6647 long long value2 = op2->__anon1.i64;
6648
6649 exp->type = 2;
6650 exp->__anon1.__anon2.string = PrintInt64((long long)(op1->__anon1.i64 < value2));
6651 if(!exp->expType)
6652 {
6653 exp->expType = op1->type;
6654 if(op1->type)
6655 op1->type->refCount++;
6656 }
6657 return 1;
6658 }
6659
6660 static unsigned int UInt64Sma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6661 {
6662 uint64 value2 = op2->__anon1.ui64;
6663
6664 exp->type = 2;
6665 exp->__anon1.__anon2.string = PrintUInt64((uint64)(op1->__anon1.ui64 < value2));
6666 if(!exp->expType)
6667 {
6668 exp->expType = op1->type;
6669 if(op1->type)
6670 op1->type->refCount++;
6671 }
6672 return 1;
6673 }
6674
6675 static unsigned int ShortSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6676 {
6677 short value2 = op2->__anon1.s;
6678
6679 exp->type = 2;
6680 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s < value2));
6681 if(!exp->expType)
6682 {
6683 exp->expType = op1->type;
6684 if(op1->type)
6685 op1->type->refCount++;
6686 }
6687 return 1;
6688 }
6689
6690 static unsigned int UShortSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6691 {
6692 unsigned short value2 = op2->__anon1.us;
6693
6694 exp->type = 2;
6695 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us < value2));
6696 if(!exp->expType)
6697 {
6698 exp->expType = op1->type;
6699 if(op1->type)
6700 op1->type->refCount++;
6701 }
6702 return 1;
6703 }
6704
6705 static unsigned int CharSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6706 {
6707 char value2 = op2->__anon1.c;
6708
6709 exp->type = 2;
6710 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c < value2));
6711 if(!exp->expType)
6712 {
6713 exp->expType = op1->type;
6714 if(op1->type)
6715 op1->type->refCount++;
6716 }
6717 return 1;
6718 }
6719
6720 static unsigned int UCharSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6721 {
6722 unsigned char value2 = op2->__anon1.uc;
6723
6724 exp->type = 2;
6725 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc < value2));
6726 if(!exp->expType)
6727 {
6728 exp->expType = op1->type;
6729 if(op1->type)
6730 op1->type->refCount++;
6731 }
6732 return 1;
6733 }
6734
6735 static unsigned int FloatSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6736 {
6737 float value2 = op2->__anon1.f;
6738
6739 exp->type = 2;
6740 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f < value2));
6741 if(!exp->expType)
6742 {
6743 exp->expType = op1->type;
6744 if(op1->type)
6745 op1->type->refCount++;
6746 }
6747 return 1;
6748 }
6749
6750 static unsigned int DoubleSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6751 {
6752 double value2 = op2->__anon1.d;
6753
6754 exp->type = 2;
6755 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d < value2));
6756 if(!exp->expType)
6757 {
6758 exp->expType = op1->type;
6759 if(op1->type)
6760 op1->type->refCount++;
6761 }
6762 return 1;
6763 }
6764
6765 static unsigned int IntGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6766 {
6767 int value2 = op2->__anon1.i;
6768
6769 exp->type = 2;
6770 exp->__anon1.__anon2.string = PrintInt((int)(op1->__anon1.i >= value2));
6771 if(!exp->expType)
6772 {
6773 exp->expType = op1->type;
6774 if(op1->type)
6775 op1->type->refCount++;
6776 }
6777 return 1;
6778 }
6779
6780 static unsigned int UIntGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6781 {
6782 unsigned int value2 = op2->__anon1.ui;
6783
6784 exp->type = 2;
6785 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(op1->__anon1.ui >= value2));
6786 if(!exp->expType)
6787 {
6788 exp->expType = op1->type;
6789 if(op1->type)
6790 op1->type->refCount++;
6791 }
6792 return 1;
6793 }
6794
6795 static unsigned int Int64GrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6796 {
6797 long long value2 = op2->__anon1.i64;
6798
6799 exp->type = 2;
6800 exp->__anon1.__anon2.string = PrintInt64((long long)(op1->__anon1.i64 >= value2));
6801 if(!exp->expType)
6802 {
6803 exp->expType = op1->type;
6804 if(op1->type)
6805 op1->type->refCount++;
6806 }
6807 return 1;
6808 }
6809
6810 static unsigned int UInt64GrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6811 {
6812 uint64 value2 = op2->__anon1.ui64;
6813
6814 exp->type = 2;
6815 exp->__anon1.__anon2.string = PrintUInt64((uint64)(op1->__anon1.ui64 >= value2));
6816 if(!exp->expType)
6817 {
6818 exp->expType = op1->type;
6819 if(op1->type)
6820 op1->type->refCount++;
6821 }
6822 return 1;
6823 }
6824
6825 static unsigned int ShortGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6826 {
6827 short value2 = op2->__anon1.s;
6828
6829 exp->type = 2;
6830 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s >= value2));
6831 if(!exp->expType)
6832 {
6833 exp->expType = op1->type;
6834 if(op1->type)
6835 op1->type->refCount++;
6836 }
6837 return 1;
6838 }
6839
6840 static unsigned int UShortGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6841 {
6842 unsigned short value2 = op2->__anon1.us;
6843
6844 exp->type = 2;
6845 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us >= value2));
6846 if(!exp->expType)
6847 {
6848 exp->expType = op1->type;
6849 if(op1->type)
6850 op1->type->refCount++;
6851 }
6852 return 1;
6853 }
6854
6855 static unsigned int CharGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6856 {
6857 char value2 = op2->__anon1.c;
6858
6859 exp->type = 2;
6860 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c >= value2));
6861 if(!exp->expType)
6862 {
6863 exp->expType = op1->type;
6864 if(op1->type)
6865 op1->type->refCount++;
6866 }
6867 return 1;
6868 }
6869
6870 static unsigned int UCharGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6871 {
6872 unsigned char value2 = op2->__anon1.uc;
6873
6874 exp->type = 2;
6875 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc >= value2));
6876 if(!exp->expType)
6877 {
6878 exp->expType = op1->type;
6879 if(op1->type)
6880 op1->type->refCount++;
6881 }
6882 return 1;
6883 }
6884
6885 static unsigned int FloatGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6886 {
6887 float value2 = op2->__anon1.f;
6888
6889 exp->type = 2;
6890 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f >= value2));
6891 if(!exp->expType)
6892 {
6893 exp->expType = op1->type;
6894 if(op1->type)
6895 op1->type->refCount++;
6896 }
6897 return 1;
6898 }
6899
6900 static unsigned int DoubleGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6901 {
6902 double value2 = op2->__anon1.d;
6903
6904 exp->type = 2;
6905 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d >= value2));
6906 if(!exp->expType)
6907 {
6908 exp->expType = op1->type;
6909 if(op1->type)
6910 op1->type->refCount++;
6911 }
6912 return 1;
6913 }
6914
6915 static unsigned int IntSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6916 {
6917 int value2 = op2->__anon1.i;
6918
6919 exp->type = 2;
6920 exp->__anon1.__anon2.string = PrintInt((int)(op1->__anon1.i <= value2));
6921 if(!exp->expType)
6922 {
6923 exp->expType = op1->type;
6924 if(op1->type)
6925 op1->type->refCount++;
6926 }
6927 return 1;
6928 }
6929
6930 static unsigned int UIntSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6931 {
6932 unsigned int value2 = op2->__anon1.ui;
6933
6934 exp->type = 2;
6935 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(op1->__anon1.ui <= value2));
6936 if(!exp->expType)
6937 {
6938 exp->expType = op1->type;
6939 if(op1->type)
6940 op1->type->refCount++;
6941 }
6942 return 1;
6943 }
6944
6945 static unsigned int Int64SmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6946 {
6947 long long value2 = op2->__anon1.i64;
6948
6949 exp->type = 2;
6950 exp->__anon1.__anon2.string = PrintInt64((long long)(op1->__anon1.i64 <= value2));
6951 if(!exp->expType)
6952 {
6953 exp->expType = op1->type;
6954 if(op1->type)
6955 op1->type->refCount++;
6956 }
6957 return 1;
6958 }
6959
6960 static unsigned int UInt64SmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6961 {
6962 uint64 value2 = op2->__anon1.ui64;
6963
6964 exp->type = 2;
6965 exp->__anon1.__anon2.string = PrintUInt64((uint64)(op1->__anon1.ui64 <= value2));
6966 if(!exp->expType)
6967 {
6968 exp->expType = op1->type;
6969 if(op1->type)
6970 op1->type->refCount++;
6971 }
6972 return 1;
6973 }
6974
6975 static unsigned int ShortSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6976 {
6977 short value2 = op2->__anon1.s;
6978
6979 exp->type = 2;
6980 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s <= value2));
6981 if(!exp->expType)
6982 {
6983 exp->expType = op1->type;
6984 if(op1->type)
6985 op1->type->refCount++;
6986 }
6987 return 1;
6988 }
6989
6990 static unsigned int UShortSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6991 {
6992 unsigned short value2 = op2->__anon1.us;
6993
6994 exp->type = 2;
6995 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us <= value2));
6996 if(!exp->expType)
6997 {
6998 exp->expType = op1->type;
6999 if(op1->type)
7000 op1->type->refCount++;
7001 }
7002 return 1;
7003 }
7004
7005 static unsigned int CharSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7006 {
7007 char value2 = op2->__anon1.c;
7008
7009 exp->type = 2;
7010 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c <= value2));
7011 if(!exp->expType)
7012 {
7013 exp->expType = op1->type;
7014 if(op1->type)
7015 op1->type->refCount++;
7016 }
7017 return 1;
7018 }
7019
7020 static unsigned int UCharSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7021 {
7022 unsigned char value2 = op2->__anon1.uc;
7023
7024 exp->type = 2;
7025 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc <= value2));
7026 if(!exp->expType)
7027 {
7028 exp->expType = op1->type;
7029 if(op1->type)
7030 op1->type->refCount++;
7031 }
7032 return 1;
7033 }
7034
7035 static unsigned int FloatSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7036 {
7037 float value2 = op2->__anon1.f;
7038
7039 exp->type = 2;
7040 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f <= value2));
7041 if(!exp->expType)
7042 {
7043 exp->expType = op1->type;
7044 if(op1->type)
7045 op1->type->refCount++;
7046 }
7047 return 1;
7048 }
7049
7050 static unsigned int DoubleSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7051 {
7052 double value2 = op2->__anon1.d;
7053
7054 exp->type = 2;
7055 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d <= value2));
7056 if(!exp->expType)
7057 {
7058 exp->expType = op1->type;
7059 if(op1->type)
7060 op1->type->refCount++;
7061 }
7062 return 1;
7063 }
7064
7065 static unsigned int IntCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
7066 {
7067 exp->type = 2;
7068 exp->__anon1.__anon2.string = PrintInt(op1->__anon1.i ? op2->__anon1.i : op3->__anon1.i);
7069 if(!exp->expType)
7070 {
7071 exp->expType = op1->type;
7072 if(op1->type)
7073 op1->type->refCount++;
7074 }
7075 return 1;
7076 }
7077
7078 static unsigned int UIntCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
7079 {
7080 exp->type = 2;
7081 exp->__anon1.__anon2.string = PrintUInt(op1->__anon1.ui ? op2->__anon1.ui : op3->__anon1.ui);
7082 if(!exp->expType)
7083 {
7084 exp->expType = op1->type;
7085 if(op1->type)
7086 op1->type->refCount++;
7087 }
7088 return 1;
7089 }
7090
7091 static unsigned int Int64Cond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
7092 {
7093 exp->type = 2;
7094 exp->__anon1.__anon2.string = PrintInt64(op1->__anon1.i64 ? op2->__anon1.i64 : op3->__anon1.i64);
7095 if(!exp->expType)
7096 {
7097 exp->expType = op1->type;
7098 if(op1->type)
7099 op1->type->refCount++;
7100 }
7101 return 1;
7102 }
7103
7104 static unsigned int UInt64Cond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
7105 {
7106 exp->type = 2;
7107 exp->__anon1.__anon2.string = PrintUInt64(op1->__anon1.ui64 ? op2->__anon1.ui64 : op3->__anon1.ui64);
7108 if(!exp->expType)
7109 {
7110 exp->expType = op1->type;
7111 if(op1->type)
7112 op1->type->refCount++;
7113 }
7114 return 1;
7115 }
7116
7117 static unsigned int ShortCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
7118 {
7119 exp->type = 2;
7120 exp->__anon1.__anon2.string = PrintShort(op1->__anon1.s ? op2->__anon1.s : op3->__anon1.s);
7121 if(!exp->expType)
7122 {
7123 exp->expType = op1->type;
7124 if(op1->type)
7125 op1->type->refCount++;
7126 }
7127 return 1;
7128 }
7129
7130 static unsigned int UShortCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
7131 {
7132 exp->type = 2;
7133 exp->__anon1.__anon2.string = PrintUShort(op1->__anon1.us ? op2->__anon1.us : op3->__anon1.us);
7134 if(!exp->expType)
7135 {
7136 exp->expType = op1->type;
7137 if(op1->type)
7138 op1->type->refCount++;
7139 }
7140 return 1;
7141 }
7142
7143 static unsigned int CharCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
7144 {
7145 exp->type = 2;
7146 exp->__anon1.__anon2.string = PrintChar(op1->__anon1.c ? op2->__anon1.c : op3->__anon1.c);
7147 if(!exp->expType)
7148 {
7149 exp->expType = op1->type;
7150 if(op1->type)
7151 op1->type->refCount++;
7152 }
7153 return 1;
7154 }
7155
7156 static unsigned int UCharCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
7157 {
7158 exp->type = 2;
7159 exp->__anon1.__anon2.string = PrintUChar(op1->__anon1.uc ? op2->__anon1.uc : op3->__anon1.uc);
7160 if(!exp->expType)
7161 {
7162 exp->expType = op1->type;
7163 if(op1->type)
7164 op1->type->refCount++;
7165 }
7166 return 1;
7167 }
7168
7169 static void PrintName(struct Type * type, char * string, unsigned int fullName)
7170 {
7171 if(type->name && type->name[0])
7172 {
7173 if(fullName)
7174 strcat(string, type->name);
7175 else
7176 {
7177 char * name = __ecereNameSpace__ecere__sys__RSearchString(type->name, "::", strlen(type->name), 1, 0);
7178
7179 if(name)
7180 name += 2;
7181 else
7182 name = type->name;
7183 strcat(string, name);
7184 }
7185 }
7186 }
7187
7188 static void PrintAttribs(struct Type * type, char * string)
7189 {
7190 if(type)
7191 {
7192 if(type->dllExport)
7193 strcat(string, "dllexport ");
7194 if(type->attrStdcall)
7195 strcat(string, "stdcall ");
7196 }
7197 }
7198
7199 static struct Type * FindMember(struct Type * type, char * string)
7200 {
7201 struct Type * memberType;
7202
7203 for(memberType = type->__anon1.__anon1.members.first; memberType; memberType = memberType->next)
7204 {
7205 if(!memberType->name)
7206 {
7207 struct Type * subType = FindMember(memberType, string);
7208
7209 if(subType)
7210 return subType;
7211 }
7212 else if(!strcmp(memberType->name, string))
7213 return memberType;
7214 }
7215 return (((void *)0));
7216 }
7217
7218 unsigned int __ecereProp_Type_Get_isPointerType(struct Type * this);
7219
7220 unsigned int __ecereProp_Type_Get_specConst(struct Type * this);
7221
7222 static unsigned int Promote(struct Operand * op, int kind, unsigned int isSigned)
7223 {
7224 unsigned int result = 0;
7225
7226 switch(kind)
7227 {
7228 case 2:
7229 if(op->kind == 1 || op->kind == 15 || op->kind == 24)
7230 result = isSigned ? GetOpShort(op, &op->__anon1.s) : GetOpUShort(op, &op->__anon1.us);
7231 break;
7232 case 3:
7233 case 5:
7234 if(op->kind == 1 || op->kind == 2 || op->kind == 15 || op->kind == 24)
7235 result = isSigned ? GetOpInt(op, &op->__anon1.i) : GetOpUInt(op, &op->__anon1.ui);
7236 break;
7237 case 4:
7238 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)
7239 result = isSigned ? GetOpInt64(op, &op->__anon1.i64) : GetOpUInt64(op, &op->__anon1.ui64);
7240 break;
7241 case 6:
7242 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)
7243 result = GetOpFloat(op, &op->__anon1.f);
7244 break;
7245 case 7:
7246 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)
7247 result = GetOpDouble(op, &op->__anon1.d);
7248 break;
7249 case 13:
7250 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)
7251 result = GetOpUInt64(op, &op->__anon1.ui64);
7252 break;
7253 case 15:
7254 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)
7255 result = isSigned ? GetOpInt(op, &op->__anon1.i) : GetOpUInt(op, &op->__anon1.ui);
7256 break;
7257 case 22:
7258 if(op->kind == 1 || op->kind == 2 || op->kind == 3 || op->kind == 5 || op->kind == 15 || op->kind == 24)
7259 result = isSigned ? GetOpInt64(op, &op->__anon1.i64) : GetOpUInt64(op, &op->__anon1.ui64);
7260 break;
7261 case 23:
7262 if(op->kind == 1 || op->kind == 2 || op->kind == 3 || op->kind == 5 || op->kind == 15 || op->kind == 24)
7263 result = isSigned ? GetOpInt64(op, &op->__anon1.i64) : GetOpUInt64(op, &op->__anon1.ui64);
7264 break;
7265 }
7266 return result;
7267 }
7268
7269 struct OpTable floatOps =
7270 {
7271 (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)
7272 };
7273
7274 struct OpTable doubleOps =
7275 {
7276 (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)
7277 };
7278
7279 struct OpTable intOps =
7280 {
7281 (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)
7282 };
7283
7284 struct OpTable uintOps =
7285 {
7286 (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)
7287 };
7288
7289 struct OpTable int64Ops =
7290 {
7291 (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)
7292 };
7293
7294 struct OpTable uint64Ops =
7295 {
7296 (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)
7297 };
7298
7299 struct OpTable shortOps =
7300 {
7301 (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)
7302 };
7303
7304 struct OpTable ushortOps =
7305 {
7306 (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)
7307 };
7308
7309 struct OpTable charOps =
7310 {
7311 (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)
7312 };
7313
7314 struct OpTable ucharOps =
7315 {
7316 (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)
7317 };
7318
7319 struct Type * FindMemberAndOffset(struct Type * type, char * string, unsigned int * offset)
7320 {
7321 struct Type * memberType;
7322
7323 for(memberType = type->__anon1.__anon1.members.first; memberType; memberType = memberType->next)
7324 {
7325 if(!memberType->name)
7326 {
7327 struct Type * subType = FindMember(memberType, string);
7328
7329 if(subType)
7330 {
7331 *offset += memberType->offset;
7332 return subType;
7333 }
7334 }
7335 else if(!strcmp(memberType->name, string))
7336 {
7337 *offset += memberType->offset;
7338 return memberType;
7339 }
7340 }
7341 return (((void *)0));
7342 }
7343
7344 struct __ecereNameSpace__ecere__com__Module;
7345
7346 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);
7347
7348 extern struct __ecereNameSpace__ecere__com__Instance * privateModule;
7349
7350 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);
7351
7352 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);
7353
7354 extern struct ModuleImport * FindModule(struct __ecereNameSpace__ecere__com__Instance * moduleToFind);
7355
7356 extern struct __ecereNameSpace__ecere__com__Class * __ecereNameSpace__ecere__com__eSystem_FindClass(struct __ecereNameSpace__ecere__com__Instance * module, const char *  name);
7357
7358 struct GlobalData
7359 {
7360 uintptr_t key;
7361 struct __ecereNameSpace__ecere__sys__BTNode * parent;
7362 struct __ecereNameSpace__ecere__sys__BTNode * left;
7363 struct __ecereNameSpace__ecere__sys__BTNode * right;
7364 int depth;
7365 struct __ecereNameSpace__ecere__com__Instance * module;
7366 char *  dataTypeString;
7367 struct Type * dataType;
7368 void *  symbol;
7369 char *  fullName;
7370 } ecere_gcc_struct;
7371
7372 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);
7373
7374 extern struct __ecereNameSpace__ecere__com__Instance * GetPrivateModule(void);
7375
7376 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);
7377
7378 extern struct __ecereNameSpace__ecere__com__Instance * __thisModule;
7379
7380 struct __ecereNameSpace__ecere__com__DefinedExpression;
7381
7382 extern struct __ecereNameSpace__ecere__com__DefinedExpression * __ecereNameSpace__ecere__com__eSystem_FindDefine(struct __ecereNameSpace__ecere__com__Instance * module, const char *  name);
7383
7384 struct __ecereNameSpace__ecere__com__DefinedExpression
7385 {
7386 struct __ecereNameSpace__ecere__com__DefinedExpression * prev;
7387 struct __ecereNameSpace__ecere__com__DefinedExpression * next;
7388 const char *  name;
7389 const char *  value;
7390 struct __ecereNameSpace__ecere__com__NameSpace *  nameSpace;
7391 } ecere_gcc_struct;
7392
7393 struct __ecereNameSpace__ecere__sys__BinaryTree;
7394
7395 struct __ecereNameSpace__ecere__sys__BinaryTree
7396 {
7397 struct __ecereNameSpace__ecere__sys__BTNode * root;
7398 int count;
7399 int (*  CompareKey)(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, uintptr_t a, uintptr_t b);
7400 void (*  FreeKey)(void *  key);
7401 } ecere_gcc_struct;
7402
7403 struct __ecereNameSpace__ecere__com__Class
7404 {
7405 struct __ecereNameSpace__ecere__com__Class * prev;
7406 struct __ecereNameSpace__ecere__com__Class * next;
7407 const char *  name;
7408 int offset;
7409 int structSize;
7410 void * *  _vTbl;
7411 int vTblSize;
7412 unsigned int (*  Constructor)(void * );
7413 void (*  Destructor)(void * );
7414 int offsetClass;
7415 int sizeClass;
7416 struct __ecereNameSpace__ecere__com__Class * base;
7417 struct __ecereNameSpace__ecere__sys__BinaryTree methods;
7418 struct __ecereNameSpace__ecere__sys__BinaryTree members;
7419 struct __ecereNameSpace__ecere__sys__BinaryTree prop;
7420 struct __ecereNameSpace__ecere__sys__OldList membersAndProperties;
7421 struct __ecereNameSpace__ecere__sys__BinaryTree classProperties;
7422 struct __ecereNameSpace__ecere__sys__OldList derivatives;
7423 int memberID;
7424 int startMemberID;
7425 int type;
7426 struct __ecereNameSpace__ecere__com__Instance * module;
7427 struct __ecereNameSpace__ecere__com__NameSpace *  nameSpace;
7428 const char *  dataTypeString;
7429 struct Type * dataType;
7430 int typeSize;
7431 int defaultAlignment;
7432 void (*  Initialize)();
7433 int memberOffset;
7434 struct __ecereNameSpace__ecere__sys__OldList selfWatchers;
7435 const char *  designerClass;
7436 unsigned int noExpansion;
7437 const char *  defaultProperty;
7438 unsigned int comRedefinition;
7439 int count;
7440 int isRemote;
7441 unsigned int internalDecl;
7442 void *  data;
7443 unsigned int computeSize;
7444 short structAlignment;
7445 short pointerAlignment;
7446 int destructionWatchOffset;
7447 unsigned int fixed;
7448 struct __ecereNameSpace__ecere__sys__OldList delayedCPValues;
7449 int inheritanceAccess;
7450 const char *  fullName;
7451 void *  symbol;
7452 struct __ecereNameSpace__ecere__sys__OldList conversions;
7453 struct __ecereNameSpace__ecere__sys__OldList templateParams;
7454 struct __ecereNameSpace__ecere__com__ClassTemplateArgument *  templateArgs;
7455 struct __ecereNameSpace__ecere__com__Class * templateClass;
7456 struct __ecereNameSpace__ecere__sys__OldList templatized;
7457 int numParams;
7458 unsigned int isInstanceClass;
7459 unsigned int byValueSystemClass;
7460 } ecere_gcc_struct;
7461
7462 struct __ecereNameSpace__ecere__com__NameSpace
7463 {
7464 const char *  name;
7465 struct __ecereNameSpace__ecere__com__NameSpace *  btParent;
7466 struct __ecereNameSpace__ecere__com__NameSpace *  left;
7467 struct __ecereNameSpace__ecere__com__NameSpace *  right;
7468 int depth;
7469 struct __ecereNameSpace__ecere__com__NameSpace *  parent;
7470 struct __ecereNameSpace__ecere__sys__BinaryTree nameSpaces;
7471 struct __ecereNameSpace__ecere__sys__BinaryTree classes;
7472 struct __ecereNameSpace__ecere__sys__BinaryTree defines;
7473 struct __ecereNameSpace__ecere__sys__BinaryTree functions;
7474 } ecere_gcc_struct;
7475
7476 struct __ecereNameSpace__ecere__com__DataMember
7477 {
7478 struct __ecereNameSpace__ecere__com__DataMember * prev;
7479 struct __ecereNameSpace__ecere__com__DataMember * next;
7480 const char *  name;
7481 unsigned int isProperty;
7482 int memberAccess;
7483 int id;
7484 struct __ecereNameSpace__ecere__com__Class * _class;
7485 const char *  dataTypeString;
7486 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
7487 struct Type * dataType;
7488 int type;
7489 int offset;
7490 int memberID;
7491 struct __ecereNameSpace__ecere__sys__OldList members;
7492 struct __ecereNameSpace__ecere__sys__BinaryTree membersAlpha;
7493 int memberOffset;
7494 short structAlignment;
7495 short pointerAlignment;
7496 } ecere_gcc_struct;
7497
7498 struct __ecereNameSpace__ecere__sys__BTNode * __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(struct __ecereNameSpace__ecere__sys__BinaryTree * this, const char *  key);
7499
7500 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(struct __ecereNameSpace__ecere__sys__BinaryTree * this, struct __ecereNameSpace__ecere__sys__BTNode * node);
7501
7502 struct __ecereNameSpace__ecere__sys__BTNode * __ecereProp___ecereNameSpace__ecere__sys__BinaryTree_Get_first(struct __ecereNameSpace__ecere__sys__BinaryTree * this);
7503
7504 struct __ecereNameSpace__ecere__sys__BTNode * __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindPrefix(struct __ecereNameSpace__ecere__sys__BinaryTree * this, const char *  key);
7505
7506 void __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Remove(struct __ecereNameSpace__ecere__sys__BinaryTree * this, struct __ecereNameSpace__ecere__sys__BTNode * node);
7507
7508 static struct __ecereNameSpace__ecere__com__Class * __ecereClass_Conversion;
7509
7510 static void _DeclareType(struct External * neededFor, struct Type * type, unsigned int needDereference, unsigned int forFunctionDef, unsigned int fwdDecl)
7511 {
7512 if(inCompiler)
7513 {
7514 if(type->kind == 11)
7515 {
7516 struct Type * param;
7517
7518 for(param = type->__anon1.__anon2.params.first; param; param = param->next)
7519 _DeclareType(neededFor, param, forFunctionDef, 0, fwdDecl);
7520 _DeclareType(neededFor, type->__anon1.__anon2.returnType, forFunctionDef, 0, fwdDecl);
7521 }
7522 else if(type->kind == 13)
7523 _DeclareType(neededFor, type->__anon1.type, 0, 0, fwdDecl);
7524 else if(type->kind == 8)
7525 {
7526 struct __ecereNameSpace__ecere__com__Class * c = type->__anon1._class ? type->__anon1._class->__anon1.registered : (((void *)0));
7527
7528 _DeclareStruct(neededFor, c ? c->fullName : "ecere::com::Instance", c ? c->type == 5 : 0, needDereference && c && c->type == 1, fwdDecl);
7529 }
7530 else if(type->kind == 9 || type->kind == 10)
7531 {
7532 struct Type * member;
7533
7534 for(member = type->__anon1.__anon1.members.first; member; member = member->next)
7535 _DeclareType(neededFor, member, needDereference, forFunctionDef, fwdDecl);
7536 }
7537 else if(type->kind == 12)
7538 _DeclareType(neededFor, type->__anon1.__anon4.arrayType, 1, 0, fwdDecl);
7539 }
7540 }
7541
7542 static unsigned int CheckConstCompatibility(struct Type * source, struct Type * dest, unsigned int warn)
7543 {
7544 unsigned int status = 1;
7545
7546 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))
7547 {
7548 struct __ecereNameSpace__ecere__com__Class * sourceClass = source->kind == 8 ? source->__anon1._class->__anon1.registered : (((void *)0));
7549 struct __ecereNameSpace__ecere__com__Class * destClass = dest->kind == 8 ? dest->__anon1._class->__anon1.registered : (((void *)0));
7550
7551 if((!sourceClass || (sourceClass && sourceClass->type == 0 && !sourceClass->structSize)) && (!destClass || (destClass && destClass->type == 0 && !destClass->structSize)))
7552 {
7553 struct Type * sourceType = source, * destType = dest;
7554
7555 while((sourceType->kind == 13 || sourceType->kind == 12) && sourceType->__anon1.type)
7556 sourceType = sourceType->__anon1.type;
7557 while((destType->kind == 13 || destType->kind == 12) && destType->__anon1.type)
7558 destType = destType->__anon1.type;
7559 if(!destType->constant && sourceType->constant)
7560 {
7561 status = 0;
7562 if(warn)
7563 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "discarding const qualifier\n", (((void *)0))));
7564 }
7565 }
7566 }
7567 return status;
7568 }
7569
7570 struct Operand GetOperand(struct Expression * exp)
7571 {
7572 struct Operand op =
7573 {
7574 0, 0, 0,
7575 .__anon1 = {
7576 .c = 0
7577 },
7578 {
7579 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
7580 }
7581 };
7582 struct Type * type = exp->expType;
7583
7584 if(type)
7585 {
7586 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))
7587 {
7588 if(!type->__anon1._class->__anon1.registered->dataType)
7589 type->__anon1._class->__anon1.registered->dataType = ProcessTypeString(type->__anon1._class->__anon1.registered->dataTypeString, 0);
7590 type = type->__anon1._class->__anon1.registered->dataType;
7591 }
7592 if(exp->type == 3 && op.kind == 13)
7593 {
7594 op.__anon1.ui64 = (uint64)(uintptr_t)exp->__anon1.__anon2.string;
7595 op.kind = 13;
7596 op.ops = uint64Ops;
7597 }
7598 else if(exp->isConstant && exp->type == 2)
7599 {
7600 op.kind = type->kind;
7601 op.type = type;
7602 switch(op.kind)
7603 {
7604 case 24:
7605 case 1:
7606 {
7607 if(exp->__anon1.__anon1.constant[0] == '\'')
7608 {
7609 op.__anon1.c = exp->__anon1.__anon1.constant[1];
7610 op.ops = charOps;
7611 }
7612 else if(type->isSigned)
7613 {
7614 op.__anon1.c = (char)strtol(exp->__anon1.__anon1.constant, (((void *)0)), 0);
7615 op.ops = charOps;
7616 }
7617 else
7618 {
7619 op.__anon1.uc = (unsigned char)strtoul(exp->__anon1.__anon1.constant, (((void *)0)), 0);
7620 op.ops = ucharOps;
7621 }
7622 break;
7623 }
7624 case 2:
7625 if(exp->__anon1.__anon1.constant[0] == '\'')
7626 {
7627 op.__anon1.s = exp->__anon1.__anon1.constant[1];
7628 op.ops = shortOps;
7629 }
7630 else if(type->isSigned)
7631 {
7632 op.__anon1.s = (short)strtol(exp->__anon1.__anon1.constant, (((void *)0)), 0);
7633 op.ops = shortOps;
7634 }
7635 else
7636 {
7637 op.__anon1.us = (unsigned short)strtoul(exp->__anon1.__anon1.constant, (((void *)0)), 0);
7638 op.ops = ushortOps;
7639 }
7640 break;
7641 case 3:
7642 case 5:
7643 if(exp->__anon1.__anon1.constant[0] == '\'')
7644 {
7645 op.__anon1.i = exp->__anon1.__anon1.constant[1];
7646 op.ops = intOps;
7647 }
7648 else if(type->isSigned)
7649 {
7650 op.__anon1.i = strtol(exp->__anon1.__anon1.constant, (((void *)0)), 0);
7651 op.ops = intOps;
7652 }
7653 else
7654 {
7655 op.__anon1.ui = (unsigned int)strtoul(exp->__anon1.__anon1.constant, (((void *)0)), 0);
7656 op.ops = uintOps;
7657 }
7658 op.kind = 3;
7659 break;
7660 case 4:
7661 if(type->isSigned)
7662 {
7663 op.__anon1.i64 = __ecereNameSpace__ecere__com___strtoi64(exp->__anon1.__anon1.constant, (((void *)0)), 0);
7664 op.ops = int64Ops;
7665 }
7666 else
7667 {
7668 op.__anon1.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->__anon1.__anon1.constant, (((void *)0)), 0);
7669 op.ops = uint64Ops;
7670 }
7671 op.kind = 4;
7672 break;
7673 case 22:
7674 if(type->isSigned)
7675 {
7676 op.__anon1.i64 = __ecereNameSpace__ecere__com___strtoi64(exp->__anon1.__anon1.constant, (((void *)0)), 0);
7677 op.ops = int64Ops;
7678 }
7679 else
7680 {
7681 op.__anon1.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->__anon1.__anon1.constant, (((void *)0)), 0);
7682 op.ops = uint64Ops;
7683 }
7684 op.kind = 4;
7685 break;
7686 case 23:
7687 if(type->isSigned)
7688 {
7689 op.__anon1.i64 = __ecereNameSpace__ecere__com___strtoi64(exp->__anon1.__anon1.constant, (((void *)0)), 0);
7690 op.ops = int64Ops;
7691 }
7692 else
7693 {
7694 op.__anon1.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->__anon1.__anon1.constant, (((void *)0)), 0);
7695 op.ops = uint64Ops;
7696 }
7697 op.kind = 4;
7698 break;
7699 case 6:
7700 if(!strcmp(exp->__anon1.__anon1.constant, "inf"))
7701 op.__anon1.f = __ecereMethod_float_inf();
7702 else if(!strcmp(exp->__anon1.__anon1.constant, "-inf"))
7703 op.__anon1.f = -__ecereMethod_float_inf();
7704 else if(!strcmp(exp->__anon1.__anon1.constant, "nan"))
7705 op.__anon1.f = __ecereMethod_float_nan();
7706 else if(!strcmp(exp->__anon1.__anon1.constant, "-nan"))
7707 op.__anon1.f = -__ecereMethod_float_nan();
7708 else
7709 op.__anon1.f = (float)strtod(exp->__anon1.__anon1.constant, (((void *)0)));
7710 op.ops = floatOps;
7711 break;
7712 case 7:
7713 if(!strcmp(exp->__anon1.__anon1.constant, "inf"))
7714 op.__anon1.d = __ecereMethod_double_inf();
7715 else if(!strcmp(exp->__anon1.__anon1.constant, "-inf"))
7716 op.__anon1.d = -__ecereMethod_double_inf();
7717 else if(!strcmp(exp->__anon1.__anon1.constant, "nan"))
7718 op.__anon1.d = __ecereMethod_double_nan();
7719 else if(!strcmp(exp->__anon1.__anon1.constant, "-nan"))
7720 op.__anon1.d = -__ecereMethod_double_nan();
7721 else
7722 op.__anon1.d = (double)strtod(exp->__anon1.__anon1.constant, (((void *)0)));
7723 op.ops = doubleOps;
7724 break;
7725 case 12:
7726 case 13:
7727 case 8:
7728 op.__anon1.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->__anon1.__anon1.constant, (((void *)0)), 0);
7729 op.kind = 13;
7730 op.ops = uint64Ops;
7731 break;
7732 }
7733 }
7734 }
7735 return op;
7736 }
7737
7738 static long long GetEnumValue(struct __ecereNameSpace__ecere__com__Class * _class, void * ptr)
7739 {
7740 long long v = 0;
7741
7742 switch(_class->typeSize)
7743 {
7744 case 8:
7745 if(!strcmp(_class->dataTypeString, "uint64"))
7746 v = (long long)*(uint64 *)ptr;
7747 else
7748 v = *(long long *)ptr;
7749 break;
7750 case 4:
7751 if(!strcmp(_class->dataTypeString, "uint"))
7752 v = (long long)*(unsigned int *)ptr;
7753 else
7754 v = (long long)*(int *)ptr;
7755 break;
7756 case 2:
7757 if(!strcmp(_class->dataTypeString, "uint16"))
7758 v = (long long)*(unsigned short *)ptr;
7759 else
7760 v = (long long)*(short *)ptr;
7761 break;
7762 case 1:
7763 if(!strcmp(_class->dataTypeString, "byte"))
7764 v = (long long)*(unsigned char *)ptr;
7765 else
7766 v = (long long)*(char *)ptr;
7767 break;
7768 }
7769 return v;
7770 }
7771
7772 static void GetTypeSpecs(struct Type * type, struct __ecereNameSpace__ecere__sys__OldList * specs)
7773 {
7774 if(!type->isSigned && type->kind != 22 && type->kind != 23)
7775 ListAdd(specs, MkSpecifier(UNSIGNED));
7776 switch(type->kind)
7777 {
7778 case 8:
7779 {
7780 if(type->__anon1._class->__anon1.registered)
7781 {
7782 if(!type->__anon1._class->__anon1.registered->dataType)
7783 type->__anon1._class->__anon1.registered->dataType = ProcessTypeString(type->__anon1._class->__anon1.registered->dataTypeString, 0);
7784 GetTypeSpecs(type->__anon1._class->__anon1.registered->dataType, specs);
7785 }
7786 break;
7787 }
7788 case 7:
7789 ListAdd(specs, MkSpecifier(DOUBLE));
7790 break;
7791 case 6:
7792 ListAdd(specs, MkSpecifier(FLOAT));
7793 break;
7794 case 1:
7795 ListAdd(specs, MkSpecifier(CHAR));
7796 break;
7797 case 24:
7798 ListAdd(specs, MkSpecifier(_BOOL));
7799 break;
7800 case 2:
7801 ListAdd(specs, MkSpecifier(SHORT));
7802 break;
7803 case 4:
7804 ListAdd(specs, MkSpecifier(INT64));
7805 break;
7806 case 25:
7807 ListAdd(specs, MkSpecifier(INT128));
7808 break;
7809 case 22:
7810 ListAdd(specs, MkSpecifierName(type->isSigned ? "intptr" : "uintptr"));
7811 break;
7812 case 23:
7813 ListAdd(specs, MkSpecifierName(type->isSigned ? "intsize" : "uintsize"));
7814 break;
7815 case 3:
7816 default:
7817 ListAdd(specs, MkSpecifier(INT));
7818 break;
7819 }
7820 }
7821
7822 static void PrintTypeSpecs(struct Type * type, char * string, unsigned int fullName, unsigned int printConst)
7823 {
7824 if(type)
7825 {
7826 if(printConst && type->constant)
7827 strcat(string, "const ");
7828 switch(type->kind)
7829 {
7830 case 8:
7831 {
7832 struct Symbol * c = type->__anon1._class;
7833 unsigned int isObjectBaseClass = !c || !c->string || !strcmp(c->string, "class");
7834
7835 if(type->classObjectType == 2 && isObjectBaseClass)
7836 strcat(string, "typed_object");
7837 else if(type->classObjectType == 3 && isObjectBaseClass)
7838 strcat(string, "any_object");
7839 else
7840 {
7841 if(c && c->string)
7842 strcat(string, (fullName || !c->__anon1.registered) ? c->string : c->__anon1.registered->name);
7843 }
7844 if(type->byReference)
7845 strcat(string, " &");
7846 break;
7847 }
7848 case 0:
7849 strcat(string, "void");
7850 break;
7851 case 3:
7852 strcat(string, type->isSigned ? "int" : "uint");
7853 break;
7854 case 4:
7855 strcat(string, type->isSigned ? "int64" : "uint64");
7856 break;
7857 case 25:
7858 strcat(string, type->isSigned ? "__int128" : "unsigned __int128");
7859 break;
7860 case 22:
7861 strcat(string, type->isSigned ? "intptr" : "uintptr");
7862 break;
7863 case 23:
7864 strcat(string, type->isSigned ? "intsize" : "uintsize");
7865 break;
7866 case 1:
7867 strcat(string, type->isSigned ? "char" : "byte");
7868 break;
7869 case 24:
7870 strcat(string, "_Bool");
7871 break;
7872 case 2:
7873 strcat(string, type->isSigned ? "short" : "uint16");
7874 break;
7875 case 6:
7876 strcat(string, "float");
7877 break;
7878 case 7:
7879 strcat(string, "double");
7880 break;
7881 case 9:
7882 if(type->__anon1.__anon1.enumName)
7883 {
7884 strcat(string, "struct ");
7885 strcat(string, type->__anon1.__anon1.enumName);
7886 }
7887 else if(type->typeName)
7888 strcat(string, type->typeName);
7889 else
7890 {
7891 struct Type * member;
7892
7893 strcat(string, "struct { ");
7894 for(member = type->__anon1.__anon1.members.first; member; member = member->next)
7895 {
7896 PrintType(member, string, 1, fullName);
7897 strcat(string, "; ");
7898 }
7899 strcat(string, "}");
7900 }
7901 break;
7902 case 10:
7903 if(type->__anon1.__anon1.enumName)
7904 {
7905 strcat(string, "union ");
7906 strcat(string, type->__anon1.__anon1.enumName);
7907 }
7908 else if(type->typeName)
7909 strcat(string, type->typeName);
7910 else
7911 {
7912 strcat(string, "union ");
7913 strcat(string, "(unnamed)");
7914 }
7915 break;
7916 case 15:
7917 if(type->__anon1.__anon1.enumName)
7918 {
7919 strcat(string, "enum ");
7920 strcat(string, type->__anon1.__anon1.enumName);
7921 }
7922 else if(type->typeName)
7923 strcat(string, type->typeName);
7924 else
7925 strcat(string, "int");
7926 break;
7927 case 14:
7928 strcat(string, "...");
7929 break;
7930 case 19:
7931 strcat(string, "subclass(");
7932 strcat(string, type->__anon1._class ? type->__anon1._class->string : "int");
7933 strcat(string, ")");
7934 break;
7935 case 20:
7936 strcat(string, type->__anon1.templateParameter->identifier->string);
7937 break;
7938 case 21:
7939 strcat(string, "thisclass");
7940 break;
7941 case 17:
7942 strcat(string, "__builtin_va_list");
7943 break;
7944 }
7945 }
7946 }
7947
7948 unsigned int RelatedUnits(struct __ecereNameSpace__ecere__com__Class * c1, struct __ecereNameSpace__ecere__com__Class * c2)
7949 {
7950 if(c1->base->type == 3)
7951 c1 = c1->base;
7952 if(c2->base->type == 3)
7953 c2 = c2->base;
7954 return c1 == c2;
7955 }
7956
7957 extern char *  __ecereNameSpace__ecere__com__PrintString(struct __ecereNameSpace__ecere__com__Class * class, const void * object, ...);
7958
7959 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__TempFile;
7960
7961 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassImport;
7962
7963 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Symbol;
7964
7965 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_PropertyImport;
7966
7967 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Type;
7968
7969 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplatedType;
7970
7971 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplateParameter;
7972
7973 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_MethodImport;
7974
7975 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_FunctionImport;
7976
7977 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Expression;
7978
7979 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Instantiation;
7980
7981 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__NamedLink64;
7982
7983 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TypeName;
7984
7985 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Context;
7986
7987 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Module;
7988
7989 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__LinkList;
7990
7991 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Application;
7992
7993 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_int;
7994
7995 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Instance;
7996
7997 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__File;
7998
7999 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_External;
8000
8001 struct __ecereNameSpace__ecere__com__Application
8002 {
8003 int argc;
8004 const char * *  argv;
8005 int exitCode;
8006 unsigned int isGUIApp;
8007 struct __ecereNameSpace__ecere__sys__OldList allModules;
8008 char *  parsedCommand;
8009 struct __ecereNameSpace__ecere__com__NameSpace systemNameSpace;
8010 } ecere_gcc_struct;
8011
8012 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)
8013 {
8014 if(*curMember)
8015 {
8016 *curMember = (*curMember)->next;
8017 if(subMemberStackPos && *subMemberStackPos > 0 && subMemberStack[*subMemberStackPos - 1]->type == 1)
8018 {
8019 *curMember = subMemberStack[--(*subMemberStackPos)];
8020 *curMember = (*curMember)->next;
8021 }
8022 while((*curMember) && (*curMember)->isProperty)
8023 *curMember = (*curMember)->next;
8024 if(subMemberStackPos)
8025 {
8026 while((*curMember) && !(*curMember)->isProperty && !(*curMember)->name && ((*curMember)->type == 2 || (*curMember)->type == 1))
8027 {
8028 subMemberStack[(*subMemberStackPos)++] = *curMember;
8029 *curMember = (*curMember)->members.first;
8030 while(*curMember && (*curMember)->isProperty)
8031 *curMember = (*curMember)->next;
8032 }
8033 }
8034 }
8035 while(!*curMember)
8036 {
8037 if(!*curMember)
8038 {
8039 if(subMemberStackPos && *subMemberStackPos)
8040 {
8041 *curMember = subMemberStack[--(*subMemberStackPos)];
8042 *curMember = (*curMember)->next;
8043 }
8044 else
8045 {
8046 struct __ecereNameSpace__ecere__com__Class * lastCurClass = *curClass;
8047
8048 if(*curClass == _class)
8049 break;
8050 for(*curClass = _class; (*curClass)->base != lastCurClass && (*curClass)->base->type != 1000; *curClass = (*curClass)->base)
8051 ;
8052 *curMember = (*curClass)->membersAndProperties.first;
8053 }
8054 while((*curMember) && (*curMember)->isProperty)
8055 *curMember = (*curMember)->next;
8056 if(subMemberStackPos)
8057 {
8058 while((*curMember) && !(*curMember)->isProperty && !(*curMember)->name && ((*curMember)->type == 2 || (*curMember)->type == 1))
8059 {
8060 subMemberStack[(*subMemberStackPos)++] = *curMember;
8061 *curMember = (*curMember)->members.first;
8062 while(*curMember && (*curMember)->isProperty)
8063 *curMember = (*curMember)->next;
8064 }
8065 }
8066 }
8067 }
8068 }
8069
8070 static struct GlobalData * ScanGlobalData(struct __ecereNameSpace__ecere__com__NameSpace * nameSpace, char * name)
8071 {
8072 struct __ecereNameSpace__ecere__sys__BinaryTree * tree = &nameSpace->functions;
8073 struct GlobalData * data = (struct GlobalData *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString((&*tree), name);
8074 struct __ecereNameSpace__ecere__com__NameSpace * child;
8075
8076 if(!data)
8077 {
8078 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)))
8079 {
8080 data = ScanGlobalData(child, name);
8081 if(data)
8082 break;
8083 }
8084 }
8085 return data;
8086 }
8087
8088 static struct Symbol * ScanWithNameSpace(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, const char * nameSpace, const char * name)
8089 {
8090 int nsLen = strlen(nameSpace);
8091 struct Symbol * symbol;
8092
8093 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)))
8094 {
8095 char * s = symbol->string;
8096
8097 if(!strncmp(s, nameSpace, nsLen))
8098 {
8099 int c;
8100 char * namePart;
8101
8102 for(c = strlen(s) - 1; c >= 0; c--)
8103 if(s[c] == ':')
8104 break;
8105 namePart = s + c + 1;
8106 if(!strcmp(namePart, name))
8107 {
8108 return symbol;
8109 }
8110 }
8111 else
8112 break;
8113 }
8114 return (((void *)0));
8115 }
8116
8117 unsigned int GetInt(struct Expression * exp, int * value2)
8118 {
8119 struct Operand op2 = GetOperand(exp);
8120
8121 return GetOpInt(&op2, value2);
8122 }
8123
8124 unsigned int GetUInt(struct Expression * exp, unsigned int * value2)
8125 {
8126 struct Operand op2 = GetOperand(exp);
8127
8128 return GetOpUInt(&op2, value2);
8129 }
8130
8131 unsigned int GetInt64(struct Expression * exp, long long * value2)
8132 {
8133 struct Operand op2 = GetOperand(exp);
8134
8135 return GetOpInt64(&op2, value2);
8136 }
8137
8138 unsigned int GetUInt64(struct Expression * exp, uint64 * value2)
8139 {
8140 struct Operand op2 = GetOperand(exp);
8141
8142 return GetOpUInt64(&op2, value2);
8143 }
8144
8145 unsigned int GetIntPtr(struct Expression * exp, intptr_t * value2)
8146 {
8147 struct Operand op2 = GetOperand(exp);
8148
8149 return GetOpIntPtr(&op2, value2);
8150 }
8151
8152 unsigned int GetUIntPtr(struct Expression * exp, uintptr_t * value2)
8153 {
8154 struct Operand op2 = GetOperand(exp);
8155
8156 return GetOpUIntPtr(&op2, value2);
8157 }
8158
8159 unsigned int GetIntSize(struct Expression * exp, ssize_t * value2)
8160 {
8161 struct Operand op2 = GetOperand(exp);
8162
8163 return GetOpIntSize(&op2, value2);
8164 }
8165
8166 unsigned int GetUIntSize(struct Expression * exp, size_t * value2)
8167 {
8168 struct Operand op2 = GetOperand(exp);
8169
8170 return GetOpUIntSize(&op2, value2);
8171 }
8172
8173 unsigned int GetShort(struct Expression * exp, short * value2)
8174 {
8175 struct Operand op2 = GetOperand(exp);
8176
8177 return GetOpShort(&op2, value2);
8178 }
8179
8180 unsigned int GetUShort(struct Expression * exp, unsigned short * value2)
8181 {
8182 struct Operand op2 = GetOperand(exp);
8183
8184 return GetOpUShort(&op2, value2);
8185 }
8186
8187 unsigned int GetChar(struct Expression * exp, char * value2)
8188 {
8189 struct Operand op2 = GetOperand(exp);
8190
8191 return GetOpChar(&op2, value2);
8192 }
8193
8194 unsigned int GetUChar(struct Expression * exp, unsigned char * value2)
8195 {
8196 struct Operand op2 = GetOperand(exp);
8197
8198 return GetOpUChar(&op2, value2);
8199 }
8200
8201 unsigned int GetFloat(struct Expression * exp, float * value2)
8202 {
8203 struct Operand op2 = GetOperand(exp);
8204
8205 return GetOpFloat(&op2, value2);
8206 }
8207
8208 unsigned int GetDouble(struct Expression * exp, double * value2)
8209 {
8210 struct Operand op2 = GetOperand(exp);
8211
8212 return GetOpDouble(&op2, value2);
8213 }
8214
8215 static void PrePrintType(struct Type * type, char * string, unsigned int fullName, struct Type * parentType, unsigned int printConst)
8216 {
8217 if(type->kind == 12 || type->kind == 13 || type->kind == 11 || type->kind == 16)
8218 {
8219 if((type->kind == 11 || type->kind == 16) && (!parentType || parentType->kind != 13))
8220 PrintAttribs(type, string);
8221 if(printConst && type->constant && (type->kind == 11 || type->kind == 16))
8222 strcat(string, " const");
8223 PrePrintType(type->kind == 16 ? type->__anon1.__anon3.method->dataType : type->__anon1.type, string, fullName, type, printConst);
8224 if(type->kind == 13 && (type->__anon1.type->kind == 12 || type->__anon1.type->kind == 11 || type->__anon1.type->kind == 16))
8225 strcat(string, " (");
8226 if(type->kind == 13)
8227 {
8228 if(type->__anon1.type->kind == 11 || type->__anon1.type->kind == 16)
8229 PrintAttribs(type->__anon1.type, string);
8230 }
8231 if(type->kind == 13)
8232 {
8233 if(type->__anon1.type->kind == 11 || type->__anon1.type->kind == 16 || type->__anon1.type->kind == 12)
8234 strcat(string, "*");
8235 else
8236 strcat(string, " *");
8237 }
8238 if(printConst && type->constant && type->kind == 13)
8239 strcat(string, " const");
8240 }
8241 else
8242 PrintTypeSpecs(type, string, fullName, printConst);
8243 }
8244
8245 void PrintExpression(struct Expression * exp, char * string)
8246 {
8247 {
8248 struct __ecereNameSpace__ecere__com__Instance * f = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
8249 int count;
8250 unsigned int backOutputLineNumbers = outputLineNumbers;
8251
8252 outputLineNumbers = 0;
8253 if(exp)
8254 OutputExpression(exp, f);
8255 (__extension__ ({
8256 unsigned int (*  __internal_VirtualMethod)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode);
8257
8258 __internal_VirtualMethod = ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))__extension__ ({
8259 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = f;
8260
8261 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__TempFile->_vTbl;
8262 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek]);
8263 __internal_VirtualMethod ? __internal_VirtualMethod(f, 0, 0) : (unsigned int)1;
8264 }));
8265 count = strlen(string);
8266 count += (__extension__ ({
8267 int (*  __internal_VirtualMethod)(struct __ecereNameSpace__ecere__com__Instance *, void *  buffer, unsigned int size, unsigned int count);
8268
8269 __internal_VirtualMethod = ((int (*)(struct __ecereNameSpace__ecere__com__Instance *, void *  buffer, unsigned int size, unsigned int count))__extension__ ({
8270 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = f;
8271
8272 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__TempFile->_vTbl;
8273 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Read]);
8274 __internal_VirtualMethod ? __internal_VirtualMethod(f, string + count, 1, 1023) : (int)1;
8275 }));
8276 string[count] = '\0';
8277 (__ecereNameSpace__ecere__com__eInstance_DecRef(f), f = 0);
8278 outputLineNumbers = backOutputLineNumbers;
8279 }
8280 }
8281
8282 struct Type * Dereference(struct Type * source)
8283 {
8284 struct Type * type = (((void *)0));
8285
8286 if(source)
8287 {
8288 if(source->isVector)
8289 {
8290 type = __extension__ ({
8291 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
8292
8293 __ecereInstance1->refCount = 1, __ecereInstance1;
8294 });
8295 CopyTypeInto(type, source);
8296 type->isVector = 0;
8297 }
8298 else if(source->kind == 13 || source->kind == 12)
8299 {
8300 type = source->__anon1.type;
8301 source->__anon1.type->refCount++;
8302 }
8303 else if(source->kind == 8 && !strcmp(source->__anon1._class->string, "String"))
8304 {
8305 type = __extension__ ({
8306 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
8307
8308 __ecereInstance1->kind = 1, __ecereInstance1->refCount = 1, __ecereInstance1;
8309 });
8310 }
8311 else if(source->kind == 8 && source->__anon1._class && source->__anon1._class->__anon1.registered && source->__anon1._class->__anon1.registered->type == 5)
8312 {
8313 type = source;
8314 source->refCount++;
8315 }
8316 else
8317 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "cannot dereference type\n", (((void *)0))));
8318 }
8319 return type;
8320 }
8321
8322 static struct Type * Reference(struct Type * source)
8323 {
8324 struct Type * type = (((void *)0));
8325
8326 if(source)
8327 {
8328 type = __extension__ ({
8329 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
8330
8331 __ecereInstance1->kind = 13, __ecereInstance1->__anon1.type = source, __ecereInstance1->refCount = 1, __ecereInstance1;
8332 });
8333 source->refCount++;
8334 }
8335 return type;
8336 }
8337
8338 void modifyPassAsTemplate(struct Type ** typePtr, unsigned int value)
8339 {
8340 if(*typePtr && (*typePtr)->passAsTemplate != value)
8341 {
8342 struct Type * type = (type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), type->refCount = 1, type);
8343
8344 CopyTypeInto(type, *typePtr);
8345 type->passAsTemplate = value;
8346 FreeType(*typePtr);
8347 *typePtr = type;
8348 }
8349 }
8350
8351 void ReplaceExpContents(struct Expression * checkedExp, struct Expression * newExp)
8352 {
8353 struct Expression * prev = checkedExp->prev, * next = checkedExp->next;
8354
8355 FreeExpContents(checkedExp);
8356 FreeType(checkedExp->expType);
8357 FreeType(checkedExp->destType);
8358 *checkedExp = *newExp;
8359 ((newExp ? __extension__ ({
8360 void * __ecerePtrToDelete = (newExp);
8361
8362 __ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)__ecerePtrToDelete) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(__ecerePtrToDelete);
8363 }) : 0), newExp = 0);
8364 checkedExp->prev = prev;
8365 checkedExp->next = next;
8366 }
8367
8368 void FinishTemplatesContext(struct Context * context)
8369 {
8370 PopContext(context);
8371 FreeContext(context);
8372 ((context ? __extension__ ({
8373 void * __ecerePtrToDelete = (context);
8374
8375 __ecereClass_Context->Destructor ? __ecereClass_Context->Destructor((void *)__ecerePtrToDelete) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(__ecerePtrToDelete);
8376 }) : 0), context = 0);
8377 }
8378
8379 static __attribute__((unused)) void UnusedFunction()
8380 {
8381 int a;
8382
8383 (__extension__ ({
8384 const char *  (*  __internal_VirtualMethod)(struct __ecereNameSpace__ecere__com__Class * , const void * , char *  tempString, void *  fieldData, unsigned int *  needClass);
8385
8386 __internal_VirtualMethod = ((const char *  (*)(struct __ecereNameSpace__ecere__com__Class *, const void *, char *  tempString, void *  fieldData, unsigned int *  needClass))__ecereClass_int->_vTbl[__ecereVMethodID_class_OnGetString]);
8387 __internal_VirtualMethod ? __internal_VirtualMethod(__ecereClass_int, (void *)&a, 0, 0, 0) : (const char * )1;
8388 }));
8389 }
8390
8391 struct Expression * ParseExpressionString(char * expression)
8392 {
8393 parseError = 0;
8394 fileInput = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
8395 (__extension__ ({
8396 int (*  __internal_VirtualMethod)(struct __ecereNameSpace__ecere__com__Instance *, const void *  buffer, unsigned int size, unsigned int count);
8397
8398 __internal_VirtualMethod = ((int (*)(struct __ecereNameSpace__ecere__com__Instance *, const void *  buffer, unsigned int size, unsigned int count))__extension__ ({
8399 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
8400
8401 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
8402 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Write]);
8403 __internal_VirtualMethod ? __internal_VirtualMethod(fileInput, expression, 1, strlen(expression)) : (int)1;
8404 }));
8405 (__extension__ ({
8406 unsigned int (*  __internal_VirtualMethod)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode);
8407
8408 __internal_VirtualMethod = ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))__extension__ ({
8409 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
8410
8411 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
8412 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek]);
8413 __internal_VirtualMethod ? __internal_VirtualMethod(fileInput, 0, 0) : (unsigned int)1;
8414 }));
8415 echoOn = 0;
8416 parsedExpression = (((void *)0));
8417 resetScanner();
8418 expression_yyparse();
8419 (__ecereNameSpace__ecere__com__eInstance_DecRef(fileInput), fileInput = 0);
8420 return parsedExpression;
8421 }
8422
8423 struct __ecereNameSpace__ecere__com__Module
8424 {
8425 struct __ecereNameSpace__ecere__com__Instance * application;
8426 struct __ecereNameSpace__ecere__sys__OldList classes;
8427 struct __ecereNameSpace__ecere__sys__OldList defines;
8428 struct __ecereNameSpace__ecere__sys__OldList functions;
8429 struct __ecereNameSpace__ecere__sys__OldList modules;
8430 struct __ecereNameSpace__ecere__com__Instance * prev;
8431 struct __ecereNameSpace__ecere__com__Instance * next;
8432 const char *  name;
8433 void *  library;
8434 void *  Unload;
8435 int importType;
8436 int origImportType;
8437 struct __ecereNameSpace__ecere__com__NameSpace privateNameSpace;
8438 struct __ecereNameSpace__ecere__com__NameSpace publicNameSpace;
8439 } ecere_gcc_struct;
8440
8441 static struct GlobalData * FindGlobalData(char * name)
8442 {
8443 int start = 0, c;
8444 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
8445
8446 nameSpace = globalData;
8447 for(c = 0; name[c]; c++)
8448 {
8449 if(name[c] == '.' || (name[c] == ':' && name[c + 1] == ':'))
8450 {
8451 struct __ecereNameSpace__ecere__com__NameSpace * newSpace;
8452 char * spaceName = __ecereNameSpace__ecere__com__eSystem_New(sizeof(char) * (c - start + 1));
8453
8454 strncpy(spaceName, name + start, c - start);
8455 spaceName[c - start] = '\0';
8456 newSpace = (struct __ecereNameSpace__ecere__com__NameSpace *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(&(*nameSpace).nameSpaces, spaceName);
8457 (__ecereNameSpace__ecere__com__eSystem_Delete(spaceName), spaceName = 0);
8458 if(!newSpace)
8459 return (((void *)0));
8460 nameSpace = newSpace;
8461 if(name[c] == ':')
8462 c++;
8463 start = c + 1;
8464 }
8465 }
8466 if(c - start)
8467 {
8468 return ScanGlobalData(nameSpace, name + start);
8469 }
8470 return (((void *)0));
8471 }
8472
8473 static struct Symbol * FindWithNameSpace(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, const char * name)
8474 {
8475 int c;
8476 char nameSpace[1024];
8477 const char * namePart;
8478 unsigned int gotColon = 0;
8479
8480 nameSpace[0] = '\0';
8481 for(c = strlen(name) - 1; c >= 0; c--)
8482 if(name[c] == ':')
8483 {
8484 gotColon = 1;
8485 break;
8486 }
8487 namePart = name + c + 1;
8488 while(c >= 0 && name[c] == ':')
8489 c--;
8490 if(c >= 0)
8491 {
8492 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, name);
8493
8494 if(symbol)
8495 return symbol;
8496 memcpy(nameSpace, name, c + 1);
8497 nameSpace[c + 1] = 0;
8498 return ScanWithNameSpace(tree, nameSpace, namePart);
8499 }
8500 else if(gotColon)
8501 {
8502 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, namePart);
8503
8504 return symbol;
8505 }
8506 else
8507 {
8508 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, namePart);
8509
8510 if(symbol)
8511 return symbol;
8512 return ScanWithNameSpace(tree, "", namePart);
8513 }
8514 return (((void *)0));
8515 }
8516
8517 static void PrintArraySize(struct Type * arrayType, char * string)
8518 {
8519 char size[256];
8520
8521 size[0] = '\0';
8522 strcat(size, "[");
8523 if(arrayType->__anon1.__anon4.enumClass)
8524 strcat(size, arrayType->__anon1.__anon4.enumClass->string);
8525 else if(arrayType->__anon1.__anon4.arraySizeExp)
8526 PrintExpression(arrayType->__anon1.__anon4.arraySizeExp, size);
8527 strcat(size, "]");
8528 strcat(string, size);
8529 }
8530
8531 void __ecereUnregisterModule_pass15(struct __ecereNameSpace__ecere__com__Instance * module)
8532 {
8533
8534 }
8535
8536 static void PostPrintType(struct Type * type, char * string, unsigned int fullName)
8537 {
8538 if(type->kind == 13 && (type->__anon1.type->kind == 12 || type->__anon1.type->kind == 11 || type->__anon1.type->kind == 16))
8539 strcat(string, ")");
8540 if(type->kind == 12)
8541 PrintArraySize(type, string);
8542 else if(type->kind == 11)
8543 {
8544 struct Type * param;
8545
8546 strcat(string, "(");
8547 for(param = type->__anon1.__anon2.params.first; param; param = param->next)
8548 {
8549 PrintType(param, string, 1, fullName);
8550 if(param->next)
8551 strcat(string, ", ");
8552 }
8553 strcat(string, ")");
8554 }
8555 if(type->kind == 12 || type->kind == 13 || type->kind == 11 || type->kind == 16)
8556 PostPrintType(type->kind == 16 ? type->__anon1.__anon3.method->dataType : type->__anon1.type, string, fullName);
8557 }
8558
8559 static void _PrintType(struct Type * type, char * string, unsigned int printName, unsigned int fullName, unsigned int printConst)
8560 {
8561 PrePrintType(type, string, fullName, (((void *)0)), printConst);
8562 if(type->__anon1.__anon2.thisClass || (printName && type->name && type->name[0]))
8563 strcat(string, " ");
8564 if((type->__anon1.__anon2.thisClass || type->__anon1.__anon2.staticMethod))
8565 {
8566 struct Symbol * _class = type->__anon1.__anon2.thisClass;
8567
8568 if((type->classObjectType == 2 || type->classObjectType == 1) || (_class && !strcmp(_class->string, "class")))
8569 {
8570 if(type->classObjectType == 1)
8571 strcat(string, "class");
8572 else
8573 strcat(string, type->byReference ? "typed_object&" : "typed_object");
8574 }
8575 else if(_class && _class->string)
8576 {
8577 char * s = _class->string;
8578
8579 if(fullName)
8580 strcat(string, s);
8581 else
8582 {
8583 char * name = __ecereNameSpace__ecere__sys__RSearchString(s, "::", strlen(s), 1, 0);
8584
8585 if(name)
8586 name += 2;
8587 else
8588 name = s;
8589 strcat(string, name);
8590 }
8591 }
8592 strcat(string, "::");
8593 }
8594 if(printName && type->name)
8595 PrintName(type, string, fullName);
8596 PostPrintType(type, string, fullName);
8597 if(type->bitFieldCount)
8598 {
8599 char count[100];
8600
8601 sprintf(count, ":%d", type->bitFieldCount);
8602 strcat(string, count);
8603 }
8604 }
8605
8606 struct Conversion;
8607
8608 struct Conversion
8609 {
8610 struct Conversion * prev, * next;
8611 struct __ecereNameSpace__ecere__com__Property * convert;
8612 unsigned int isGet;
8613 struct Type * resultType;
8614 } ecere_gcc_struct;
8615
8616 static void FreeConvert(struct Conversion * convert)
8617 {
8618 if(convert->resultType)
8619 FreeType(convert->resultType);
8620 }
8621
8622 struct Enumerator;
8623
8624 struct Enumerator
8625 {
8626 struct Enumerator * prev;
8627 struct Enumerator * next;
8628 struct Location loc;
8629 struct Identifier * id;
8630 struct Expression * exp;
8631 } ecere_gcc_struct;
8632
8633 struct AsmField;
8634
8635 struct AsmField
8636 {
8637 struct AsmField * prev;
8638 struct AsmField * next;
8639 struct Location loc;
8640 char *  command;
8641 struct Expression * expression;
8642 struct Identifier * symbolic;
8643 } ecere_gcc_struct;
8644
8645 struct ClassDefinition;
8646
8647 struct Context
8648 {
8649 struct Context * parent;
8650 struct __ecereNameSpace__ecere__sys__BinaryTree types;
8651 struct __ecereNameSpace__ecere__sys__BinaryTree classes;
8652 struct __ecereNameSpace__ecere__sys__BinaryTree symbols;
8653 struct __ecereNameSpace__ecere__sys__BinaryTree structSymbols;
8654 int nextID;
8655 int simpleID;
8656 struct __ecereNameSpace__ecere__sys__BinaryTree templateTypes;
8657 struct ClassDefinition * classDef;
8658 unsigned int templateTypesOnly;
8659 unsigned int hasNameSpace;
8660 } ecere_gcc_struct;
8661
8662 struct External
8663 {
8664 struct External * prev;
8665 struct External * next;
8666 struct Location loc;
8667 int type;
8668 struct Symbol * symbol;
8669 union
8670 {
8671 struct FunctionDefinition * function;
8672 struct ClassDefinition * _class;
8673 struct Declaration * declaration;
8674 char *  importString;
8675 struct Identifier * id;
8676 struct DBTableDef * table;
8677 } ecere_gcc_struct __anon1;
8678 int importType;
8679 struct External * fwdDecl;
8680 struct __ecereNameSpace__ecere__com__Instance * outgoing;
8681 struct __ecereNameSpace__ecere__com__Instance * incoming;
8682 int nonBreakableIncoming;
8683 } ecere_gcc_struct;
8684
8685 struct ClassDefinition
8686 {
8687 struct ClassDefinition * prev;
8688 struct ClassDefinition * next;
8689 struct Location loc;
8690 struct Specifier * _class;
8691 struct __ecereNameSpace__ecere__sys__OldList *  baseSpecs;
8692 struct __ecereNameSpace__ecere__sys__OldList *  definitions;
8693 struct Symbol * symbol;
8694 struct Location blockStart;
8695 struct Location nameLoc;
8696 int declMode;
8697 unsigned int deleteWatchable;
8698 } ecere_gcc_struct;
8699
8700 void __ecereMethod_External_CreateUniqueEdge(struct External * this, struct External * from, unsigned int soft);
8701
8702 void __ecereMethod_External_CreateEdge(struct External * this, struct External * from, unsigned int soft);
8703
8704 void DeclareGlobalData(struct External * neededFor, struct GlobalData * data)
8705 {
8706 struct Symbol * symbol = data->symbol;
8707
8708 if(!symbol || !symbol->__anon2.__anon1.pointerExternal)
8709 {
8710 if(inCompiler)
8711 {
8712 if(!symbol)
8713 symbol = data->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
8714 }
8715 if(!data->dataType)
8716 data->dataType = ProcessTypeString(data->dataTypeString, 0);
8717 if(inCompiler)
8718 {
8719 struct Declaration * decl;
8720 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
8721 struct Declarator * d;
8722 struct External * external;
8723
8724 specifiers = MkList();
8725 declarators = MkList();
8726 ListAdd(specifiers, MkSpecifier(EXTERN));
8727 d = MkDeclaratorIdentifier(MkIdentifier(data->fullName));
8728 d = SpecDeclFromString(data->dataTypeString, specifiers, d);
8729 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
8730 decl = MkDeclaration(specifiers, declarators);
8731 external = MkExternalDeclaration(decl);
8732 if(curExternal)
8733 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
8734 external->symbol = symbol;
8735 symbol->__anon2.__anon1.pointerExternal = external;
8736 DeclareType(external, data->dataType, 1, 1);
8737 }
8738 }
8739 if(inCompiler && neededFor && symbol && symbol->__anon2.__anon1.pointerExternal)
8740 __ecereMethod_External_CreateUniqueEdge(neededFor, symbol->__anon2.__anon1.pointerExternal, 0);
8741 }
8742
8743 struct Symbol * FindSymbol(const char * name, struct Context * startContext, struct Context * endContext, unsigned int isStruct, unsigned int globalNameSpace)
8744 {
8745 struct Context * ctx;
8746 struct Symbol * symbol = (((void *)0));
8747
8748 for(ctx = startContext; ctx && !symbol; ctx = ctx->parent)
8749 {
8750 if(ctx == globalContext && !globalNameSpace && ctx->hasNameSpace)
8751 {
8752 symbol = (((void *)0));
8753 if(thisNameSpace)
8754 {
8755 char curName[1024];
8756
8757 strcpy(curName, thisNameSpace);
8758 strcat(curName, "::");
8759 strcat(curName, name);
8760 symbol = FindWithNameSpace(isStruct ? &ctx->structSymbols : &ctx->symbols, curName);
8761 }
8762 if(!symbol)
8763 symbol = FindWithNameSpace(isStruct ? &ctx->structSymbols : &ctx->symbols, name);
8764 }
8765 else
8766 symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString((isStruct ? &ctx->structSymbols : &ctx->symbols), name);
8767 if(symbol || ctx == endContext)
8768 break;
8769 }
8770 if(inCompiler && symbol && ctx == globalContext && symbol->__anon2.__anon1.pointerExternal && curExternal && symbol->__anon2.__anon1.pointerExternal != curExternal)
8771 __ecereMethod_External_CreateUniqueEdge(curExternal, symbol->__anon2.__anon1.pointerExternal, symbol->__anon2.__anon1.pointerExternal->type == 0);
8772 return symbol;
8773 }
8774
8775 struct PropertyDef;
8776
8777 struct ClassDef
8778 {
8779 struct ClassDef * prev;
8780 struct ClassDef * next;
8781 struct Location loc;
8782 int type;
8783 union
8784 {
8785 struct Declaration * decl;
8786 struct ClassFunction * function;
8787 struct __ecereNameSpace__ecere__sys__OldList *  defProperties;
8788 struct PropertyDef * propertyDef;
8789 struct PropertyWatch * propertyWatch;
8790 char *  designer;
8791 struct Identifier * defaultProperty;
8792 struct
8793 {
8794 struct Identifier * id;
8795 struct Initializer * initializer;
8796 } ecere_gcc_struct __anon1;
8797 } ecere_gcc_struct __anon1;
8798 int memberAccess;
8799 void *  object;
8800 } ecere_gcc_struct;
8801
8802 struct PropertyDef
8803 {
8804 struct PropertyDef * prev;
8805 struct PropertyDef * next;
8806 struct Location loc;
8807 struct __ecereNameSpace__ecere__sys__OldList *  specifiers;
8808 struct Declarator * declarator;
8809 struct Identifier * id;
8810 struct Statement * getStmt;
8811 struct Statement * setStmt;
8812 struct Statement * issetStmt;
8813 struct Symbol * symbol;
8814 struct Expression * category;
8815 struct
8816 {
8817 unsigned int conversion : 1;
8818 unsigned int isWatchable : 1;
8819 unsigned int isDBProp : 1;
8820 } ecere_gcc_struct __anon1;
8821 } ecere_gcc_struct;
8822
8823 static void IdentifyAnonStructs(struct __ecereNameSpace__ecere__sys__OldList * definitions)
8824 {
8825 struct ClassDef * def;
8826 int anonID = 1;
8827
8828 for(def = (*definitions).first; def; def = def->next)
8829 {
8830 if(def->type == 2)
8831 {
8832 struct Declaration * decl = def->__anon1.decl;
8833
8834 if(decl && decl->__anon1.__anon1.specifiers)
8835 {
8836 struct Specifier * spec;
8837 unsigned int isStruct = 0;
8838
8839 for(spec = (*decl->__anon1.__anon1.specifiers).first; spec; spec = spec->next)
8840 {
8841 if(spec->type == 3 || spec->type == 4)
8842 {
8843 if(spec->__anon1.__anon2.definitions)
8844 IdentifyAnonStructs(spec->__anon1.__anon2.definitions);
8845 isStruct = 1;
8846 }
8847 }
8848 if(isStruct)
8849 {
8850 struct Declarator * d = (((void *)0));
8851
8852 if(decl->__anon1.__anon1.declarators)
8853 {
8854 for(d = (*decl->__anon1.__anon1.declarators).first; d; d = d->next)
8855 {
8856 struct Identifier * idDecl = GetDeclId(d);
8857
8858 if(idDecl)
8859 break;
8860 }
8861 }
8862 if(!d)
8863 {
8864 char id[100];
8865
8866 sprintf(id, "__anon%d", anonID++);
8867 if(!decl->__anon1.__anon1.declarators)
8868 decl->__anon1.__anon1.declarators = MkList();
8869 ListAdd(decl->__anon1.__anon1.declarators, MkDeclaratorIdentifier(MkIdentifier(id)));
8870 }
8871 }
8872 }
8873 }
8874 }
8875 }
8876
8877 struct MemberInit;
8878
8879 typedef union YYSTYPE
8880 {
8881 int specifierType;
8882 int i;
8883 int declMode;
8884 struct Identifier * id;
8885 struct Expression * exp;
8886 struct Specifier * specifier;
8887 struct __ecereNameSpace__ecere__sys__OldList * list;
8888 struct Enumerator * enumerator;
8889 struct Declarator * declarator;
8890 struct Pointer * pointer;
8891 struct Initializer * initializer;
8892 struct InitDeclarator * initDeclarator;
8893 struct TypeName * typeName;
8894 struct Declaration * declaration;
8895 struct Statement * stmt;
8896 struct FunctionDefinition * function;
8897 struct External * external;
8898 struct Context * context;
8899 struct AsmField * asmField;
8900 struct Attrib * attrib;
8901 struct ExtDecl * extDecl;
8902 struct Attribute * attribute;
8903 struct Instantiation * instance;
8904 struct MembersInit * membersInit;
8905 struct MemberInit * memberInit;
8906 struct ClassFunction * classFunction;
8907 struct ClassDefinition * _class;
8908 struct ClassDef * classDef;
8909 struct PropertyDef * prop;
8910 char * string;
8911 struct Symbol * symbol;
8912 struct PropertyWatch * propertyWatch;
8913 struct TemplateParameter * templateParameter;
8914 struct TemplateArgument * templateArgument;
8915 struct TemplateDatatype * templateDatatype;
8916 struct DBTableEntry * dbtableEntry;
8917 struct DBIndexItem * dbindexItem;
8918 struct DBTableDef * dbtableDef;
8919 } ecere_gcc_struct YYSTYPE;
8920
8921 extern YYSTYPE yylval;
8922
8923 struct MemberInit
8924 {
8925 struct MemberInit * prev;
8926 struct MemberInit * next;
8927 struct Location loc;
8928 struct Location realLoc;
8929 struct __ecereNameSpace__ecere__sys__OldList *  identifiers;
8930 struct Initializer * initializer;
8931 unsigned int used;
8932 unsigned int variable;
8933 unsigned int takeOutExp;
8934 } ecere_gcc_struct;
8935
8936 extern struct MemberInit * MkMemberInit(struct __ecereNameSpace__ecere__sys__OldList * ids, struct Initializer * initializer);
8937
8938 struct __ecereNameSpace__ecere__com__ClassTemplateParameter;
8939
8940 struct __ecereNameSpace__ecere__com__ClassTemplateParameter
8941 {
8942 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * prev;
8943 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * next;
8944 const char *  name;
8945 int type;
8946 union
8947 {
8948 const char *  dataTypeString;
8949 int memberType;
8950 } ecere_gcc_struct __anon1;
8951 struct __ecereNameSpace__ecere__com__ClassTemplateArgument defaultArg;
8952 void *  param;
8953 } ecere_gcc_struct;
8954
8955 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * FindTemplateArg(struct __ecereNameSpace__ecere__com__Class * _class, struct TemplateParameter * param)
8956 {
8957 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * arg = (((void *)0));
8958 int id = 0;
8959 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
8960 struct __ecereNameSpace__ecere__com__Class * sClass;
8961
8962 for(sClass = _class; sClass; sClass = sClass->base)
8963 {
8964 id = 0;
8965 if(sClass->templateClass)
8966 sClass = sClass->templateClass;
8967 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
8968 {
8969 if(curParam->type == 0 && !strcmp(param->identifier->string, curParam->name))
8970 {
8971 for(sClass = sClass->base; sClass; sClass = sClass->base)
8972 {
8973 if(sClass->templateClass)
8974 sClass = sClass->templateClass;
8975 id += sClass->templateParams.count;
8976 }
8977 break;
8978 }
8979 id++;
8980 }
8981 if(curParam)
8982 break;
8983 }
8984 if(curParam)
8985 {
8986 arg = &_class->templateArgs[id];
8987 if(arg && param->type == 0)
8988 (*arg).__anon1.__anon1.dataTypeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, (*arg).__anon1.__anon1.dataTypeString);
8989 }
8990 return arg;
8991 }
8992
8993 struct Context * SetupTemplatesContext(struct __ecereNameSpace__ecere__com__Class * _class)
8994 {
8995 struct Context * context = PushContext();
8996
8997 context->templateTypesOnly = 1;
8998 if(_class->symbol && ((struct Symbol *)_class->symbol)->templateParams)
8999 {
9000 struct TemplateParameter * param = (*((struct Symbol *)_class->symbol)->templateParams).first;
9001
9002 for(; param; param = param->next)
9003 {
9004 if(param->type == 0 && param->identifier)
9005 {
9006 struct TemplatedType * type = (type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TemplatedType), type->key = (uintptr_t)param->identifier->string, type->param = param, type);
9007
9008 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&curContext->templateTypes, (struct __ecereNameSpace__ecere__sys__BTNode *)type);
9009 }
9010 }
9011 }
9012 else if(_class)
9013 {
9014 struct __ecereNameSpace__ecere__com__Class * sClass;
9015
9016 for(sClass = _class; sClass; sClass = sClass->base)
9017 {
9018 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * p;
9019
9020 for(p = sClass->templateParams.first; p; p = p->next)
9021 {
9022 if(p->type == 0)
9023 {
9024 struct TemplateParameter * param = p->param;
9025 struct TemplatedType * type;
9026
9027 if(!param)
9028 {
9029 p->param = param = __extension__ ({
9030 struct TemplateParameter * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TemplateParameter);
9031
9032 __ecereInstance1->identifier = MkIdentifier(p->name), __ecereInstance1->type = p->type, __ecereInstance1->dataTypeString = p->__anon1.dataTypeString, __ecereInstance1;
9033 });
9034 }
9035 type = __extension__ ({
9036 struct TemplatedType * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TemplatedType);
9037
9038 __ecereInstance1->key = (uintptr_t)p->name, __ecereInstance1->param = param, __ecereInstance1;
9039 });
9040 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&curContext->templateTypes, (struct __ecereNameSpace__ecere__sys__BTNode *)type);
9041 }
9042 }
9043 }
9044 }
9045 return context;
9046 }
9047
9048 char * ReplaceThisClass(struct __ecereNameSpace__ecere__com__Class * _class)
9049 {
9050 if(thisClassParams && _class->templateParams.count && !_class->templateClass)
9051 {
9052 unsigned int first = 1;
9053 int p = 0;
9054 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
9055 int lastParam = -1;
9056 char className[1024];
9057
9058 strcpy(className, _class->fullName);
9059 for(param = _class->templateParams.first; param; param = param->next)
9060 {
9061 {
9062 if(first)
9063 strcat(className, "<");
9064 if(!first)
9065 strcat(className, ", ");
9066 if(lastParam + 1 != p)
9067 {
9068 strcat(className, param->name);
9069 strcat(className, " = ");
9070 }
9071 strcat(className, param->name);
9072 first = 0;
9073 lastParam = p;
9074 }
9075 p++;
9076 }
9077 if(!first)
9078 {
9079 int len = strlen(className);
9080
9081 if(className[len - 1] == '>')
9082 className[len++] = ' ';
9083 className[len++] = '>';
9084 className[len++] = '\0';
9085 }
9086 return __ecereNameSpace__ecere__sys__CopyString(className);
9087 }
9088 else
9089 return __ecereNameSpace__ecere__sys__CopyString(_class->fullName);
9090 }
9091
9092 struct Type * ReplaceThisClassType(struct __ecereNameSpace__ecere__com__Class * _class)
9093 {
9094 struct Type * type;
9095
9096 if(thisClassParams && _class->templateParams.count && !_class->templateClass)
9097 {
9098 unsigned int first = 1;
9099 int p = 0;
9100 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
9101 int lastParam = -1;
9102 char className[1024];
9103
9104 strcpy(className, _class->fullName);
9105 for(param = _class->templateParams.first; param; param = param->next)
9106 {
9107 {
9108 if(first)
9109 strcat(className, "<");
9110 if(!first)
9111 strcat(className, ", ");
9112 if(lastParam + 1 != p)
9113 {
9114 strcat(className, param->name);
9115 strcat(className, " = ");
9116 }
9117 strcat(className, param->name);
9118 first = 0;
9119 lastParam = p;
9120 }
9121 p++;
9122 }
9123 if(!first)
9124 {
9125 int len = strlen(className);
9126
9127 if(className[len - 1] == '>')
9128 className[len++] = ' ';
9129 className[len++] = '>';
9130 className[len++] = '\0';
9131 }
9132 type = MkClassType(className);
9133 }
9134 else
9135 {
9136 type = MkClassType(_class->fullName);
9137 }
9138 return type;
9139 }
9140
9141 static int DeclareMembers(struct External * neededBy, struct __ecereNameSpace__ecere__com__Class * _class, unsigned int isMember)
9142 {
9143 struct __ecereNameSpace__ecere__com__DataMember * topMember = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
9144 struct __ecereNameSpace__ecere__com__DataMember * member;
9145 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
9146
9147 if(!isMember && (_class->type == 1 || _class->type == 5) && _class->base->type != 1000)
9148 DeclareMembers(neededBy, _class->base, 0);
9149 for(member = isMember ? topMember->members.first : _class->membersAndProperties.first; member; member = member->next)
9150 {
9151 if(!member->isProperty)
9152 {
9153 switch(member->type)
9154 {
9155 case 0:
9156 {
9157 if(!member->dataType && member->dataTypeString)
9158 member->dataType = ProcessTypeString(member->dataTypeString, 0);
9159 if(member->dataType)
9160 DeclareType(neededBy, member->dataType, 1, 0);
9161 break;
9162 }
9163 case 1:
9164 case 2:
9165 {
9166 DeclareMembers(neededBy, (struct __ecereNameSpace__ecere__com__Class *)member, 1);
9167 break;
9168 }
9169 }
9170 }
9171 }
9172 if(context)
9173 FinishTemplatesContext(context);
9174 return topMember ? topMember->memberID : _class->memberID;
9175 }
9176
9177 void ProcessMethodType(struct __ecereNameSpace__ecere__com__Method * method)
9178 {
9179 if(!method->dataType)
9180 {
9181 struct Context * context = SetupTemplatesContext(method->_class);
9182
9183 method->dataType = ProcessTypeString(method->dataTypeString, 0);
9184 FinishTemplatesContext(context);
9185 if(method->type != 1 && method->dataType)
9186 {
9187 if(!method->dataType->__anon1.__anon2.thisClass && !method->dataType->__anon1.__anon2.staticMethod)
9188 {
9189 if(!method->_class->symbol)
9190 method->_class->symbol = FindClass(method->_class->fullName);
9191 method->dataType->__anon1.__anon2.thisClass = method->_class->symbol;
9192 }
9193 }
9194 }
9195 }
9196
9197 void ProcessPropertyType(struct __ecereNameSpace__ecere__com__Property * prop)
9198 {
9199 if(!prop->dataType)
9200 {
9201 struct Context * context = SetupTemplatesContext(prop->_class);
9202
9203 prop->dataType = ProcessTypeString(prop->dataTypeString, 0);
9204 FinishTemplatesContext(context);
9205 }
9206 }
9207
9208 void ReplaceThisClassSpecifiers(struct __ecereNameSpace__ecere__sys__OldList * specs, struct __ecereNameSpace__ecere__com__Class * _class)
9209 {
9210 if(specs != (((void *)0)) && _class)
9211 {
9212 struct Specifier * spec;
9213
9214 for(spec = specs->first; spec; spec = spec->next)
9215 {
9216 if(spec->type == 0 && spec->__anon1.specifier == THISCLASS)
9217 {
9218 spec->type = 1;
9219 spec->__anon1.__anon1.name = ReplaceThisClass(_class);
9220 spec->__anon1.__anon1.symbol = FindClass(spec->__anon1.__anon1.name);
9221 }
9222 }
9223 }
9224 }
9225
9226 static unsigned int ResolveIdWithClass(struct Expression * exp, struct __ecereNameSpace__ecere__com__Class * _class, unsigned int skipIDClassCheck)
9227 {
9228 struct Identifier * id = exp->__anon1.__anon1.identifier;
9229 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
9230 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
9231 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
9232 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
9233
9234 if(_class && _class->type == 4)
9235 {
9236 struct __ecereNameSpace__ecere__sys__NamedLink64 * value = (((void *)0));
9237 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
9238
9239 if(enumClass)
9240 {
9241 struct __ecereNameSpace__ecere__com__Class * baseClass;
9242
9243 for(baseClass = _class; baseClass && baseClass->type == 4; baseClass = baseClass->base)
9244 {
9245 struct __ecereNameSpace__ecere__com__EnumClassData * e = (baseClass ? ((void *)(((char *)baseClass->data) + enumClass->offsetClass)) : (((void *)0)));
9246
9247 for(value = e->values.first; value; value = value->next)
9248 {
9249 if(!strcmp(value->name, id->string))
9250 break;
9251 }
9252 if(value)
9253 {
9254 exp->isConstant = 1;
9255 if(inCompiler || inPreCompiler || inDebugger)
9256 {
9257 char constant[256];
9258
9259 FreeExpContents(exp);
9260 exp->type = 2;
9261 if(!strcmp(baseClass->dataTypeString, "int") || !strcmp(baseClass->dataTypeString, "int64") || !strcmp(baseClass->dataTypeString, "char") || !strcmp(baseClass->dataTypeString, "short"))
9262 sprintf(constant, ((__runtimePlatform == 1) ? "%I64d" : "%lld"), value->data);
9263 else
9264 sprintf(constant, ((__runtimePlatform == 1) ? "0x%I64X" : "0x%llX"), value->data);
9265 exp->__anon1.__anon1.constant = __ecereNameSpace__ecere__sys__CopyString(constant);
9266 }
9267 exp->expType = MkClassType(baseClass->fullName);
9268 break;
9269 }
9270 }
9271 }
9272 if(value)
9273 return 1;
9274 }
9275 if((method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule)))
9276 {
9277 ProcessMethodType(method);
9278 exp->expType = __extension__ ({
9279 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
9280
9281 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 16, __ecereInstance1->__anon1.__anon3.method = method, __ecereInstance1->__anon1.__anon3.methodClass = (skipIDClassCheck || (id && id->_class)) ? _class : (((void *)0)), __ecereInstance1;
9282 });
9283 return 1;
9284 }
9285 else if((prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule)))
9286 {
9287 if(!prop->dataType)
9288 ProcessPropertyType(prop);
9289 exp->expType = prop->dataType;
9290 if(prop->dataType)
9291 prop->dataType->refCount++;
9292 return 1;
9293 }
9294 else if((member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)))))
9295 {
9296 if(!member->dataType)
9297 member->dataType = ProcessTypeString(member->dataTypeString, 0);
9298 exp->expType = member->dataType;
9299 if(member->dataType)
9300 member->dataType->refCount++;
9301 return 1;
9302 }
9303 else if((classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(_class, id->string)))
9304 {
9305 if(!classProp->dataType)
9306 classProp->dataType = ProcessTypeString(classProp->dataTypeString, 0);
9307 if(classProp->constant)
9308 {
9309 FreeExpContents(exp);
9310 exp->isConstant = 1;
9311 if(classProp->dataType->kind == 13 && classProp->dataType->__anon1.type->kind == 1)
9312 {
9313 exp->type = 3;
9314 exp->__anon1.__anon1.constant = QMkString((char *)(uintptr_t)classProp->Get(_class));
9315 }
9316 else
9317 {
9318 char constant[256];
9319
9320 exp->type = 2;
9321 sprintf(constant, "%d", (int)classProp->Get(_class));
9322 exp->__anon1.__anon1.constant = __ecereNameSpace__ecere__sys__CopyString(constant);
9323 }
9324 }
9325 else
9326 {
9327 }
9328 exp->expType = classProp->dataType;
9329 if(classProp->dataType)
9330 classProp->dataType->refCount++;
9331 return 1;
9332 }
9333 return 0;
9334 }
9335
9336 void DeclareProperty(struct External * neededBy, struct __ecereNameSpace__ecere__com__Property * prop, char * setName, char * getName)
9337 {
9338 struct Symbol * symbol = prop->symbol;
9339 unsigned int imported = 0;
9340 unsigned int dllImport = 0;
9341 struct External * structExternal = (((void *)0));
9342 struct External * instExternal = (((void *)0));
9343
9344 strcpy(setName, "__ecereProp_");
9345 FullClassNameCat(setName, prop->_class->fullName, 0);
9346 strcat(setName, "_Set_");
9347 FullClassNameCat(setName, prop->name, 1);
9348 strcpy(getName, "__ecereProp_");
9349 FullClassNameCat(getName, prop->_class->fullName, 0);
9350 strcat(getName, "_Get_");
9351 FullClassNameCat(getName, prop->name, 1);
9352 if(!symbol || symbol->_import)
9353 {
9354 if(!symbol)
9355 {
9356 struct Symbol * classSym;
9357
9358 if(!prop->_class->symbol)
9359 prop->_class->symbol = FindClass(prop->_class->fullName);
9360 classSym = prop->_class->symbol;
9361 if(classSym && !classSym->_import)
9362 {
9363 struct ModuleImport * module;
9364
9365 if(prop->_class->module)
9366 module = FindModule(prop->_class->module);
9367 else
9368 module = mainModule;
9369 classSym->_import = __extension__ ({
9370 struct ClassImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_ClassImport);
9371
9372 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(prop->_class->fullName), __ecereInstance1->isRemote = prop->_class->isRemote, __ecereInstance1;
9373 });
9374 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->classes, classSym->_import);
9375 }
9376 symbol = prop->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
9377 symbol->_import = (struct ClassImport *)__extension__ ({
9378 struct PropertyImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_PropertyImport);
9379
9380 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(prop->name), __ecereInstance1->isVirtual = 0, __ecereInstance1->hasSet = prop->Set ? 1 : 0, __ecereInstance1->hasGet = prop->Get ? 1 : 0, __ecereInstance1;
9381 });
9382 if(classSym)
9383 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&classSym->_import->properties, symbol->_import);
9384 }
9385 imported = 1;
9386 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)
9387 dllImport = 1;
9388 }
9389 if(!symbol->type)
9390 {
9391 struct Context * context = SetupTemplatesContext(prop->_class);
9392
9393 symbol->type = ProcessTypeString(prop->dataTypeString, 0);
9394 FinishTemplatesContext(context);
9395 }
9396 if((prop->Get && !symbol->__anon2.__anon2.externalGet) || (prop->Set && !symbol->__anon2.__anon2.externalSet))
9397 {
9398 if(prop->_class->type == 0 && prop->_class->structSize)
9399 instExternal = DeclareStruct((((void *)0)), "ecere::com::Instance", 0, 1);
9400 structExternal = DeclareStruct((((void *)0)), prop->_class->fullName, prop->_class->type != 1, 0);
9401 }
9402 if(prop->Get && !symbol->__anon2.__anon2.externalGet)
9403 {
9404 struct Declaration * decl;
9405 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
9406 struct Declarator * d;
9407 struct __ecereNameSpace__ecere__sys__OldList * params;
9408 struct Specifier * spec = (((void *)0));
9409 struct External * external;
9410 struct Declarator * typeDecl;
9411 unsigned int simple = 0;
9412 unsigned int needReference;
9413
9414 specifiers = MkList();
9415 declarators = MkList();
9416 params = MkList();
9417 ListAdd(params, MkTypeName(MkListOne(MkSpecifierName(prop->_class->fullName)), MkDeclaratorIdentifier(MkIdentifier("this"))));
9418 d = MkDeclaratorIdentifier(MkIdentifier(getName));
9419 if(dllImport)
9420 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
9421 {
9422 struct Context * context = SetupTemplatesContext(prop->_class);
9423
9424 typeDecl = SpecDeclFromString(prop->dataTypeString, specifiers, (((void *)0)));
9425 FinishTemplatesContext(context);
9426 }
9427 needReference = !typeDecl || typeDecl->type == 1;
9428 for(spec = (*specifiers).first; spec; spec = spec->next)
9429 {
9430 if(spec->type == 1)
9431 {
9432 struct Symbol * classSym = spec->__anon1.__anon1.symbol;
9433
9434 if(needReference)
9435 {
9436 symbol->_class = classSym->__anon1.registered;
9437 if(classSym->__anon1.registered && classSym->__anon1.registered->type == 1)
9438 simple = 1;
9439 }
9440 break;
9441 }
9442 }
9443 if(!simple)
9444 d = PlugDeclarator(typeDecl, d);
9445 else
9446 {
9447 ListAdd(params, MkTypeName(specifiers, PlugDeclarator(typeDecl, MkDeclaratorIdentifier(MkIdentifier("value")))));
9448 specifiers = MkList();
9449 }
9450 d = MkDeclaratorFunction(d, params);
9451 if(dllImport)
9452 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
9453 else if(prop->_class->symbol && ((struct Symbol *)prop->_class->symbol)->isStatic)
9454 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
9455 if(simple)
9456 ListAdd(specifiers, MkSpecifier(VOID));
9457 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
9458 decl = MkDeclaration(specifiers, declarators);
9459 external = MkExternalDeclaration(decl);
9460 if(structExternal)
9461 __ecereMethod_External_CreateEdge(external, structExternal, 0);
9462 if(instExternal)
9463 __ecereMethod_External_CreateEdge(external, instExternal, 0);
9464 if(spec)
9465 DeclareStruct(external, spec->__anon1.__anon1.name, 0, needReference);
9466 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*ast), external);
9467 external->symbol = symbol;
9468 symbol->__anon2.__anon2.externalGet = external;
9469 ReplaceThisClassSpecifiers(specifiers, prop->_class);
9470 if(typeDecl)
9471 FreeDeclarator(typeDecl);
9472 }
9473 if(prop->Set && !symbol->__anon2.__anon2.externalSet)
9474 {
9475 struct Declaration * decl;
9476 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
9477 struct Declarator * d;
9478 struct __ecereNameSpace__ecere__sys__OldList * params;
9479 struct Specifier * spec = (((void *)0));
9480 struct External * external;
9481 struct Declarator * typeDecl;
9482 unsigned int needReference;
9483
9484 declarators = MkList();
9485 params = MkList();
9486 if(!prop->conversion || prop->_class->type == 1)
9487 {
9488 ListAdd(params, MkTypeName(MkListOne(MkSpecifierName(prop->_class->fullName)), MkDeclaratorIdentifier(MkIdentifier("this"))));
9489 }
9490 specifiers = MkList();
9491 {
9492 struct Context * context = SetupTemplatesContext(prop->_class);
9493
9494 typeDecl = d = SpecDeclFromString(prop->dataTypeString, specifiers, MkDeclaratorIdentifier(MkIdentifier("value")));
9495 FinishTemplatesContext(context);
9496 }
9497 if(!strcmp(prop->_class->base->fullName, "eda::Row") || !strcmp(prop->_class->base->fullName, "eda::Id"))
9498 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(CONST));
9499 ListAdd(params, MkTypeName(specifiers, d));
9500 d = MkDeclaratorIdentifier(MkIdentifier(setName));
9501 if(dllImport)
9502 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
9503 d = MkDeclaratorFunction(d, params);
9504 needReference = !typeDecl || typeDecl->type == 1;
9505 for(spec = (*specifiers).first; spec; spec = spec->next)
9506 {
9507 if(spec->type == 1)
9508 {
9509 struct Symbol * classSym = spec->__anon1.__anon1.symbol;
9510
9511 if(needReference)
9512 symbol->_class = classSym->__anon1.registered;
9513 break;
9514 }
9515 }
9516 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
9517 specifiers = MkList();
9518 if(dllImport)
9519 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
9520 else if(prop->_class->symbol && ((struct Symbol *)prop->_class->symbol)->isStatic)
9521 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
9522 if(!prop->conversion || prop->_class->type == 1)
9523 ListAdd(specifiers, MkSpecifier(VOID));
9524 else
9525 ListAdd(specifiers, MkSpecifierName(prop->_class->fullName));
9526 decl = MkDeclaration(specifiers, declarators);
9527 external = MkExternalDeclaration(decl);
9528 if(structExternal)
9529 __ecereMethod_External_CreateEdge(external, structExternal, 0);
9530 if(instExternal)
9531 __ecereMethod_External_CreateEdge(external, instExternal, 0);
9532 if(spec)
9533 DeclareStruct(external, spec->__anon1.__anon1.name, 0, needReference);
9534 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*ast), external);
9535 external->symbol = symbol;
9536 symbol->__anon2.__anon2.externalSet = external;
9537 ReplaceThisClassSpecifiers(specifiers, prop->_class);
9538 }
9539 if(!symbol->__anon2.__anon2.externalPtr)
9540 {
9541 struct Declaration * decl;
9542 struct External * external;
9543 struct __ecereNameSpace__ecere__sys__OldList * specifiers = MkList();
9544 char propName[1024];
9545
9546 if(imported)
9547 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
9548 else
9549 {
9550 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
9551 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*specifiers), MkSpecifierExtended(MkExtDeclAttrib(MkAttrib(ATTRIB, MkListOne(MkAttribute(__ecereNameSpace__ecere__sys__CopyString("unused"), (((void *)0))))))));
9552 }
9553 ListAdd(specifiers, MkSpecifierName("Property"));
9554 strcpy(propName, "__ecereProp_");
9555 FullClassNameCat(propName, prop->_class->fullName, 0);
9556 strcat(propName, "_");
9557 FullClassNameCat(propName, prop->name, 1);
9558 {
9559 struct __ecereNameSpace__ecere__sys__OldList * list = MkList();
9560
9561 ListAdd(list, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(propName)), (((void *)0))));
9562 if(!imported)
9563 {
9564 strcpy(propName, "__ecerePropM_");
9565 FullClassNameCat(propName, prop->_class->fullName, 0);
9566 strcat(propName, "_");
9567 FullClassNameCat(propName, prop->name, 1);
9568 ListAdd(list, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(propName)), (((void *)0))));
9569 }
9570 decl = MkDeclaration(specifiers, list);
9571 }
9572 external = MkExternalDeclaration(decl);
9573 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
9574 external->symbol = symbol;
9575 symbol->__anon2.__anon2.externalPtr = external;
9576 }
9577 if(inCompiler && neededBy)
9578 {
9579 if(symbol->__anon2.__anon2.externalPtr)
9580 __ecereMethod_External_CreateUniqueEdge(neededBy, symbol->__anon2.__anon2.externalPtr, 0);
9581 if(symbol->__anon2.__anon2.externalGet)
9582 __ecereMethod_External_CreateUniqueEdge(neededBy, symbol->__anon2.__anon2.externalGet, symbol->__anon2.__anon2.externalGet->type == 0);
9583 if(symbol->__anon2.__anon2.externalSet)
9584 __ecereMethod_External_CreateUniqueEdge(neededBy, symbol->__anon2.__anon2.externalSet, symbol->__anon2.__anon2.externalSet->type == 0);
9585 }
9586 }
9587
9588 static void ProcessDeclarator(struct Declarator *  decl, unsigned int isFunction);
9589
9590 void DeclareMethod(struct External * neededFor, struct __ecereNameSpace__ecere__com__Method * method, const char * name)
9591 {
9592 struct Symbol * symbol = method->symbol;
9593
9594 if(!symbol || (!symbol->__anon2.__anon1.pointerExternal && (!symbol->__anon2.__anon3.methodCodeExternal || method->type == 1)))
9595 {
9596 unsigned int dllImport = 0;
9597
9598 if(!method->dataType)
9599 method->dataType = ProcessTypeString(method->dataTypeString, 0);
9600 {
9601 if(!symbol || method->type == 1)
9602 {
9603 struct Symbol * classSym;
9604
9605 if(!method->_class->symbol)
9606 method->_class->symbol = FindClass(method->_class->fullName);
9607 classSym = method->_class->symbol;
9608 if(!classSym->_import)
9609 {
9610 struct ModuleImport * module;
9611
9612 if(method->_class->module && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)method->_class->module + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->name)
9613 module = FindModule(method->_class->module);
9614 else
9615 module = mainModule;
9616 classSym->_import = __extension__ ({
9617 struct ClassImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_ClassImport);
9618
9619 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(method->_class->fullName), __ecereInstance1->isRemote = method->_class->isRemote, __ecereInstance1;
9620 });
9621 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->classes, classSym->_import);
9622 }
9623 if(!symbol)
9624 {
9625 symbol = method->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
9626 }
9627 if(!symbol->_import)
9628 {
9629 symbol->_import = (struct ClassImport *)__extension__ ({
9630 struct MethodImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_MethodImport);
9631
9632 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(method->name), __ecereInstance1->isVirtual = method->type == 1, __ecereInstance1;
9633 });
9634 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&classSym->_import->methods, symbol->_import);
9635 }
9636 if(!symbol)
9637 {
9638 symbol->type = method->dataType;
9639 if(symbol->type)
9640 symbol->type->refCount++;
9641 }
9642 }
9643 if(!method->dataType->dllExport)
9644 {
9645 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)
9646 dllImport = 1;
9647 }
9648 }
9649 if(inCompiler)
9650 {
9651 struct Declaration * decl;
9652 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
9653 struct Declarator * d;
9654 struct Declarator * funcDecl;
9655 struct External * external;
9656
9657 specifiers = MkList();
9658 declarators = MkList();
9659 if(dllImport)
9660 ListAdd(specifiers, MkSpecifier(EXTERN));
9661 else if(method->_class->symbol && ((struct Symbol *)method->_class->symbol)->isStatic)
9662 ListAdd(specifiers, MkSpecifier(STATIC));
9663 if(method->type == 1)
9664 {
9665 ListAdd(specifiers, MkSpecifier(INT));
9666 d = MkDeclaratorIdentifier(MkIdentifier(name));
9667 }
9668 else
9669 {
9670 d = MkDeclaratorIdentifier(MkIdentifier(name));
9671 if(dllImport)
9672 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
9673 {
9674 struct Context * context = SetupTemplatesContext(method->_class);
9675
9676 d = SpecDeclFromString(method->dataTypeString, specifiers, d);
9677 FinishTemplatesContext(context);
9678 }
9679 funcDecl = GetFuncDecl(d);
9680 if(dllImport)
9681 {
9682 struct Specifier * spec, * next;
9683
9684 for(spec = (*specifiers).first; spec; spec = next)
9685 {
9686 next = spec->next;
9687 if(spec->type == 5)
9688 {
9689 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*specifiers), spec);
9690 FreeSpecifier(spec);
9691 }
9692 }
9693 }
9694 if(method->dataType && !method->dataType->__anon1.__anon2.staticMethod)
9695 {
9696 if(funcDecl && funcDecl->__anon1.function.parameters && (*funcDecl->__anon1.function.parameters).count)
9697 {
9698 struct __ecereNameSpace__ecere__com__Class * _class = method->dataType->__anon1.__anon2.thisClass ? method->dataType->__anon1.__anon2.thisClass->__anon1.registered : method->_class;
9699 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")));
9700 struct TypeName * firstParam = ((struct TypeName *)(*funcDecl->__anon1.function.parameters).first);
9701 struct Specifier * firstSpec = firstParam->qualifiers ? (*firstParam->qualifiers).first : (((void *)0));
9702
9703 if(firstSpec && firstSpec->type == 0 && firstSpec->__anon1.specifier == VOID && !firstParam->declarator)
9704 {
9705 struct TypeName * param = (*funcDecl->__anon1.function.parameters).first;
9706
9707 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->__anon1.function.parameters), param);
9708 FreeTypeName(param);
9709 }
9710 if(!funcDecl->__anon1.function.parameters)
9711 funcDecl->__anon1.function.parameters = MkList();
9712 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->__anon1.function.parameters), (((void *)0)), thisParam);
9713 }
9714 }
9715 }
9716 ProcessDeclarator(d, 1);
9717 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
9718 decl = MkDeclaration(specifiers, declarators);
9719 ReplaceThisClassSpecifiers(specifiers, method->_class);
9720 external = MkExternalDeclaration(decl);
9721 external->symbol = symbol;
9722 symbol->__anon2.__anon1.pointerExternal = external;
9723 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*ast), external);
9724 DeclareStruct(external, method->_class->fullName, 1, 1);
9725 if(method->dataType)
9726 DeclareType(external, method->dataType, 1, 1);
9727 }
9728 }
9729 if(inCompiler && neededFor)
9730 {
9731 struct External * external = symbol->__anon2.__anon1.pointerExternal ? symbol->__anon2.__anon1.pointerExternal : symbol->__anon2.__anon3.methodCodeExternal;
9732
9733 __ecereMethod_External_CreateUniqueEdge(neededFor, external, external->type == 0);
9734 }
9735 }
9736
9737 struct __ecereNameSpace__ecere__com__GlobalFunction;
9738
9739 struct __ecereNameSpace__ecere__com__GlobalFunction
9740 {
9741 struct __ecereNameSpace__ecere__com__GlobalFunction * prev;
9742 struct __ecereNameSpace__ecere__com__GlobalFunction * next;
9743 const char *  name;
9744 int (*  function)();
9745 struct __ecereNameSpace__ecere__com__Instance * module;
9746 struct __ecereNameSpace__ecere__com__NameSpace *  nameSpace;
9747 const char *  dataTypeString;
9748 struct Type * dataType;
9749 void *  symbol;
9750 } ecere_gcc_struct;
9751
9752 extern struct __ecereNameSpace__ecere__com__GlobalFunction * __ecereNameSpace__ecere__com__eSystem_FindFunction(struct __ecereNameSpace__ecere__com__Instance * module, const char *  name);
9753
9754 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);
9755
9756 unsigned int DeclareFunction(struct External * neededFor, struct __ecereNameSpace__ecere__com__GlobalFunction * function, char * name)
9757 {
9758 struct Symbol * symbol = function->symbol;
9759
9760 if(!symbol || !symbol->__anon2.__anon1.pointerExternal)
9761 {
9762 unsigned int imported = 0;
9763 unsigned int dllImport = 0;
9764
9765 if(!function->dataType)
9766 {
9767 function->dataType = ProcessTypeString(function->dataTypeString, 0);
9768 if(!function->dataType->__anon1.__anon2.thisClass)
9769 function->dataType->__anon1.__anon2.staticMethod = 1;
9770 }
9771 if(inCompiler)
9772 {
9773 if(!symbol)
9774 {
9775 struct ModuleImport * module = FindModule(function->module);
9776
9777 symbol = function->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
9778 if(module->name)
9779 {
9780 if(!function->dataType->dllExport)
9781 {
9782 symbol->_import = (struct ClassImport *)__extension__ ({
9783 struct FunctionImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_FunctionImport);
9784
9785 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(function->name), __ecereInstance1;
9786 });
9787 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->functions, symbol->_import);
9788 }
9789 }
9790 {
9791 symbol->type = ProcessTypeString(function->dataTypeString, 0);
9792 if(!symbol->type->__anon1.__anon2.thisClass)
9793 symbol->type->__anon1.__anon2.staticMethod = 1;
9794 }
9795 }
9796 imported = symbol->_import ? 1 : 0;
9797 if(imported && function->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->importType != 1)
9798 dllImport = 1;
9799 }
9800 if(inCompiler)
9801 {
9802 {
9803 struct Declaration * decl;
9804 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
9805 struct Declarator * d;
9806 struct Declarator * funcDecl;
9807 struct External * external;
9808
9809 specifiers = MkList();
9810 declarators = MkList();
9811 ListAdd(specifiers, MkSpecifier(EXTERN));
9812 d = MkDeclaratorIdentifier(MkIdentifier(imported ? name : function->name));
9813 if(dllImport)
9814 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
9815 d = SpecDeclFromString(function->dataTypeString, specifiers, d);
9816 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->importType == 1)
9817 {
9818 struct Specifier * spec;
9819
9820 for(spec = (*specifiers).first; spec; spec = spec->next)
9821 if(spec->type == 5 && spec->__anon1.__anon1.extDecl && spec->__anon1.__anon1.extDecl->type == 0 && !strcmp(spec->__anon1.__anon1.extDecl->__anon1.s, "dllexport"))
9822 {
9823 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*specifiers), spec);
9824 FreeSpecifier(spec);
9825 break;
9826 }
9827 }
9828 funcDecl = GetFuncDecl(d);
9829 if(funcDecl && !funcDecl->__anon1.function.parameters)
9830 {
9831 funcDecl->__anon1.function.parameters = MkList();
9832 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->__anon1.function.parameters), (((void *)0)), MkTypeName(MkListOne(MkSpecifier(VOID)), (((void *)0))));
9833 }
9834 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
9835 {
9836 struct Context * oldCtx = curContext;
9837
9838 curContext = globalContext;
9839 decl = MkDeclaration(specifiers, declarators);
9840 curContext = oldCtx;
9841 }
9842 external = MkExternalDeclaration(decl);
9843 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*ast), external);
9844 external->symbol = symbol;
9845 symbol->__anon2.__anon1.pointerExternal = external;
9846 DeclareType(external, function->dataType, 1, 1);
9847 }
9848 }
9849 }
9850 if(inCompiler && neededFor && symbol && symbol->__anon2.__anon1.pointerExternal)
9851 __ecereMethod_External_CreateUniqueEdge(neededFor, symbol->__anon2.__anon1.pointerExternal, symbol->__anon2.__anon1.pointerExternal->type == 0);
9852 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;
9853 }
9854
9855 void DeclareFunctionUtil(struct External * neededBy, const char * s)
9856 {
9857 struct __ecereNameSpace__ecere__com__GlobalFunction * function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, s);
9858
9859 if(function)
9860 {
9861 char name[1024];
9862
9863 name[0] = 0;
9864 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->importType != 1 && (!function->dataType || !function->dataType->dllExport))
9865 strcpy(name, "__ecereFunction_");
9866 FullClassNameCat(name, s, 0);
9867 DeclareFunction(neededBy, function, name);
9868 }
9869 else if(neededBy)
9870 FindSymbol(s, globalContext, globalContext, 0, 0);
9871 }
9872
9873 static void CreateFireWatcher(struct __ecereNameSpace__ecere__com__Property * prop, struct Expression * object, struct Statement * stmt)
9874 {
9875 char propName[1024], propNameM[1024];
9876 char getName[1024], setName[1024];
9877 struct __ecereNameSpace__ecere__sys__OldList * args;
9878
9879 DeclareProperty(curExternal, prop, setName, getName);
9880 strcpy(propName, "__ecereProp_");
9881 FullClassNameCat(propName, prop->_class->fullName, 0);
9882 strcat(propName, "_");
9883 FullClassNameCat(propName, prop->name, 1);
9884 strcpy(propNameM, "__ecerePropM_");
9885 FullClassNameCat(propNameM, prop->_class->fullName, 0);
9886 strcat(propNameM, "_");
9887 FullClassNameCat(propNameM, prop->name, 1);
9888 if(prop->isWatchable)
9889 {
9890 args = MkList();
9891 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
9892 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
9893 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireWatchers")), args));
9894 args = MkList();
9895 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
9896 ListAdd(args, MkExpIdentifier(MkIdentifier(propNameM)));
9897 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireWatchers")), args));
9898 DeclareFunctionUtil(curExternal, "eInstance_FireWatchers");
9899 }
9900 {
9901 args = MkList();
9902 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
9903 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
9904 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireSelfWatchers")), args));
9905 args = MkList();
9906 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
9907 ListAdd(args, MkExpIdentifier(MkIdentifier(propNameM)));
9908 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireSelfWatchers")), args));
9909 DeclareFunctionUtil(curExternal, "eInstance_FireSelfWatchers");
9910 }
9911 if(curFunction->propSet && !strcmp(curFunction->propSet->string, prop->name) && (!object || (object->type == 0 && !strcmp(object->__anon1.__anon1.identifier->string, "this"))))
9912 curFunction->propSet->fireWatchersDone = 1;
9913 }
9914
9915 struct __ecereNameSpace__ecere__com__SubModule;
9916
9917 struct __ecereNameSpace__ecere__com__SubModule
9918 {
9919 struct __ecereNameSpace__ecere__com__SubModule * prev;
9920 struct __ecereNameSpace__ecere__com__SubModule * next;
9921 struct __ecereNameSpace__ecere__com__Instance * module;
9922 int importMode;
9923 } ecere_gcc_struct;
9924
9925 unsigned int ModuleVisibility(struct __ecereNameSpace__ecere__com__Instance * searchIn, struct __ecereNameSpace__ecere__com__Instance * searchFor)
9926 {
9927 struct __ecereNameSpace__ecere__com__SubModule * subModule;
9928
9929 if(searchFor == searchIn)
9930 return 1;
9931 for(subModule = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)searchIn + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->modules.first; subModule; subModule = subModule->next)
9932 {
9933 if(subModule->importMode == 1 || searchIn == ((struct __ecereNameSpace__ecere__com__Module *)(((char *)searchIn + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->application)
9934 {
9935 if(ModuleVisibility(subModule->module, searchFor))
9936 return 1;
9937 }
9938 }
9939 return 0;
9940 }
9941
9942 int ComputeTypeSize(struct Type *  type);
9943
9944 void ComputeClassMembers(struct __ecereNameSpace__ecere__com__Class * _class, unsigned int isMember)
9945 {
9946 struct __ecereNameSpace__ecere__com__DataMember * member = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
9947 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
9948
9949 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))
9950 {
9951 int unionMemberOffset = 0;
9952 int bitFields = 0;
9953
9954 if(member)
9955 {
9956 member->memberOffset = 0;
9957 if(targetBits < sizeof(void *) * 8)
9958 member->structAlignment = 0;
9959 }
9960 else if(targetBits < sizeof(void *) * 8)
9961 _class->structAlignment = 0;
9962 if(!member && ((_class->type == 0 || _class->type == 5) || (_class->type == 1 && _class->memberOffset && _class->memberOffset > _class->base->structSize)))
9963 _class->memberOffset = (_class->base && _class->type == 1) ? _class->base->structSize : 0;
9964 if(!member && _class->destructionWatchOffset)
9965 _class->memberOffset += sizeof(struct __ecereNameSpace__ecere__sys__OldList);
9966 {
9967 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
9968
9969 for(dataMember = member ? member->members.first : _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
9970 {
9971 if(!dataMember->isProperty)
9972 {
9973 if(dataMember->type == 0 && dataMember->dataTypeString && !dataMember->dataType)
9974 {
9975 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0);
9976 }
9977 }
9978 }
9979 }
9980 {
9981 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
9982
9983 for(dataMember = member ? member->members.first : _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
9984 {
9985 if(!dataMember->isProperty && (dataMember->type != 0 || dataMember->dataTypeString))
9986 {
9987 if(!isMember && _class->type == 2 && dataMember->dataType)
9988 {
9989 struct __ecereNameSpace__ecere__com__BitMember * bitMember = (struct __ecereNameSpace__ecere__com__BitMember *)dataMember;
9990 uint64 mask = 0;
9991 int d;
9992
9993 ComputeTypeSize(dataMember->dataType);
9994 if(bitMember->pos == -1)
9995 bitMember->pos = _class->memberOffset;
9996 if(!bitMember->size)
9997 bitMember->size = dataMember->dataType->size * 8;
9998 _class->memberOffset = bitMember->pos + bitMember->size;
9999 for(d = 0; d < bitMember->size; d++)
10000 {
10001 if(d)
10002 mask <<= 1;
10003 mask |= 1;
10004 }
10005 bitMember->mask = mask << bitMember->pos;
10006 }
10007 else if(dataMember->type == 0 && dataMember->dataType)
10008 {
10009 int size;
10010 int alignment = 0;
10011
10012 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)))
10013 ComputeTypeSize(dataMember->dataType);
10014 if(dataMember->dataType->bitFieldCount)
10015 {
10016 bitFields += dataMember->dataType->bitFieldCount;
10017 size = 0;
10018 }
10019 else
10020 {
10021 if(bitFields)
10022 {
10023 int size = (bitFields + 7) / 8;
10024
10025 if(isMember)
10026 {
10027 int __simpleStruct0;
10028
10029 if(alignment)
10030 {
10031 short __simpleStruct0;
10032
10033 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
10034 if(member->memberOffset % alignment)
10035 member->memberOffset += alignment - (member->memberOffset % alignment);
10036 }
10037 dataMember->offset = member->memberOffset;
10038 if(member->type == 1)
10039 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
10040 else
10041 {
10042 member->memberOffset += size;
10043 }
10044 }
10045 else
10046 {
10047 if(alignment)
10048 {
10049 short __simpleStruct0;
10050
10051 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
10052 if(_class->memberOffset % alignment)
10053 _class->memberOffset += alignment - (_class->memberOffset % alignment);
10054 }
10055 dataMember->offset = _class->memberOffset;
10056 _class->memberOffset += size;
10057 }
10058 bitFields = 0;
10059 }
10060 size = dataMember->dataType->size;
10061 alignment = dataMember->dataType->alignment;
10062 }
10063 if(isMember)
10064 {
10065 int __simpleStruct0;
10066
10067 if(alignment)
10068 {
10069 short __simpleStruct0;
10070
10071 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
10072 if(member->memberOffset % alignment)
10073 member->memberOffset += alignment - (member->memberOffset % alignment);
10074 }
10075 dataMember->offset = member->memberOffset;
10076 if(member->type == 1)
10077 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
10078 else
10079 {
10080 member->memberOffset += size;
10081 }
10082 }
10083 else
10084 {
10085 if(alignment)
10086 {
10087 short __simpleStruct0;
10088
10089 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
10090 if(_class->memberOffset % alignment)
10091 _class->memberOffset += alignment - (_class->memberOffset % alignment);
10092 }
10093 dataMember->offset = _class->memberOffset;
10094 _class->memberOffset += size;
10095 }
10096 }
10097 else
10098 {
10099 int alignment;
10100
10101 ComputeClassMembers((struct __ecereNameSpace__ecere__com__Class *)dataMember, 1);
10102 alignment = dataMember->structAlignment;
10103 if(isMember)
10104 {
10105 int __simpleStruct0;
10106
10107 if(alignment)
10108 {
10109 short __simpleStruct0;
10110
10111 if(member->memberOffset % alignment)
10112 member->memberOffset += alignment - (member->memberOffset % alignment);
10113 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
10114 }
10115 dataMember->offset = member->memberOffset;
10116 if(member->type == 1)
10117 unionMemberOffset = (__simpleStruct0 = dataMember->memberOffset, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
10118 else
10119 member->memberOffset += dataMember->memberOffset;
10120 }
10121 else
10122 {
10123 if(alignment)
10124 {
10125 short __simpleStruct0;
10126
10127 if(_class->memberOffset % alignment)
10128 _class->memberOffset += alignment - (_class->memberOffset % alignment);
10129 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
10130 }
10131 dataMember->offset = _class->memberOffset;
10132 _class->memberOffset += dataMember->memberOffset;
10133 }
10134 }
10135 }
10136 }
10137 if(bitFields)
10138 {
10139 int alignment = 0;
10140 int size = (bitFields + 7) / 8;
10141
10142 if(isMember)
10143 {
10144 int __simpleStruct0;
10145
10146 if(alignment)
10147 {
10148 short __simpleStruct0;
10149
10150 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
10151 if(member->memberOffset % alignment)
10152 member->memberOffset += alignment - (member->memberOffset % alignment);
10153 }
10154 if(member->type == 1)
10155 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
10156 else
10157 {
10158 member->memberOffset += size;
10159 }
10160 }
10161 else
10162 {
10163 if(alignment)
10164 {
10165 short __simpleStruct0;
10166
10167 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
10168 if(_class->memberOffset % alignment)
10169 _class->memberOffset += alignment - (_class->memberOffset % alignment);
10170 }
10171 _class->memberOffset += size;
10172 }
10173 bitFields = 0;
10174 }
10175 }
10176 if(member && member->type == 1)
10177 {
10178 member->memberOffset = unionMemberOffset;
10179 }
10180 if(!isMember)
10181 {
10182 if(_class->type != 2)
10183 {
10184 int extra = 0;
10185
10186 if(_class->structAlignment)
10187 {
10188 if(_class->memberOffset % _class->structAlignment)
10189 extra += _class->structAlignment - (_class->memberOffset % _class->structAlignment);
10190 }
10191 _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;
10192 if(!member)
10193 {
10194 struct __ecereNameSpace__ecere__com__Property * prop;
10195
10196 for(prop = _class->membersAndProperties.first; prop; prop = prop->next)
10197 {
10198 if(prop->isProperty && prop->isWatchable)
10199 {
10200 prop->watcherOffset = _class->structSize;
10201 _class->structSize += sizeof(struct __ecereNameSpace__ecere__sys__OldList);
10202 }
10203 }
10204 }
10205 {
10206 struct __ecereNameSpace__ecere__sys__OldLink * derivative;
10207
10208 for(derivative = _class->derivatives.first; derivative; derivative = derivative->next)
10209 {
10210 struct __ecereNameSpace__ecere__com__Class * deriv = derivative->data;
10211
10212 if(deriv->computeSize)
10213 {
10214 deriv->offset = (_class->type == 5 ? _class->memberOffset : _class->structSize);
10215 deriv->memberOffset = 0;
10216 deriv->structSize = deriv->offset;
10217 ComputeClassMembers(deriv, 0);
10218 }
10219 }
10220 }
10221 }
10222 }
10223 }
10224 if(context)
10225 FinishTemplatesContext(context);
10226 }
10227
10228 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)
10229 {
10230 struct __ecereNameSpace__ecere__com__DataMember * topMember = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
10231 unsigned int totalSize = 0;
10232 unsigned int maxSize = 0;
10233 int alignment;
10234 unsigned int size;
10235 struct __ecereNameSpace__ecere__com__DataMember * member;
10236 int anonID = 1;
10237 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
10238
10239 if(addedPadding)
10240 *addedPadding = 0;
10241 if(!isMember && _class->base)
10242 {
10243 maxSize = _class->structSize;
10244 {
10245 if(_class->type == 1 || _class->type == 5)
10246 AddMembers(neededBy, declarations, _class->base, 0, &totalSize, topClass, (((void *)0)));
10247 else
10248 {
10249 unsigned int baseSize = _class->base->templateClass ? _class->base->templateClass->structSize : _class->base->structSize;
10250
10251 if(maxSize > baseSize)
10252 maxSize -= baseSize;
10253 else
10254 maxSize = 0;
10255 }
10256 }
10257 }
10258 for(member = isMember ? topMember->members.first : _class->membersAndProperties.first; member; member = member->next)
10259 {
10260 if(!member->isProperty)
10261 {
10262 switch(member->type)
10263 {
10264 case 0:
10265 {
10266 if(member->dataTypeString)
10267 {
10268 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList(), * decls = MkList();
10269 struct Declarator * decl;
10270
10271 decl = SpecDeclFromString(member->dataTypeString, specs, MkDeclaratorIdentifier(MkIdentifier(member->name)));
10272 ListAdd(decls, MkStructDeclarator(decl, (((void *)0))));
10273 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(specs, decls, (((void *)0)))));
10274 if(!member->dataType)
10275 member->dataType = ProcessType(specs, decl);
10276 ReplaceThisClassSpecifiers(specs, topClass);
10277 {
10278 struct Type * type = ProcessType(specs, decl);
10279
10280 DeclareType(neededBy, member->dataType, 1, 0);
10281 FreeType(type);
10282 }
10283 ComputeTypeSize(member->dataType);
10284 size = member->dataType->size;
10285 alignment = member->dataType->alignment;
10286 if(alignment)
10287 {
10288 if(totalSize % alignment)
10289 totalSize += alignment - (totalSize % alignment);
10290 }
10291 totalSize += size;
10292 }
10293 break;
10294 }
10295 case 1:
10296 case 2:
10297 {
10298 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList(), * list = MkList();
10299 char id[100];
10300
10301 sprintf(id, "__anon%d", anonID++);
10302 size = 0;
10303 AddMembers(neededBy, list, (struct __ecereNameSpace__ecere__com__Class *)member, 1, &size, topClass, (((void *)0)));
10304 ListAdd(specs, MkStructOrUnion((member->type == 1) ? 4 : 3, (((void *)0)), list));
10305 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(specs, MkListOne(MkDeclaratorIdentifier(MkIdentifier(id))), (((void *)0)))));
10306 alignment = member->structAlignment;
10307 if(alignment)
10308 {
10309 if(totalSize % alignment)
10310 totalSize += alignment - (totalSize % alignment);
10311 }
10312 totalSize += size;
10313 break;
10314 }
10315 }
10316 }
10317 }
10318 if(retSize)
10319 {
10320 unsigned int __simpleStruct0;
10321
10322 if(topMember && topMember->type == 1)
10323 *retSize = (__simpleStruct0 = *retSize, (__simpleStruct0 > totalSize) ? __simpleStruct0 : totalSize);
10324 else
10325 *retSize += totalSize;
10326 }
10327 else if(totalSize < maxSize && _class->type != 1000)
10328 {
10329 int autoPadding = 0;
10330
10331 if(!isMember && _class->structAlignment && totalSize % _class->structAlignment)
10332 autoPadding = _class->structAlignment - (totalSize % _class->structAlignment);
10333 if(totalSize + autoPadding < maxSize)
10334 {
10335 char sizeString[50];
10336
10337 sprintf(sizeString, "%d", maxSize - totalSize);
10338 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(CHAR)), MkListOne(MkDeclaratorArray(MkDeclaratorIdentifier(MkIdentifier("__ecere_padding")), MkExpConstant(sizeString))), (((void *)0)))));
10339 if(addedPadding)
10340 *addedPadding = 1;
10341 }
10342 }
10343 if(context)
10344 FinishTemplatesContext(context);
10345 return topMember ? topMember->memberID : _class->memberID;
10346 }
10347
10348 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)
10349 {
10350 if(source && dest)
10351 {
10352 if(warnConst)
10353 CheckConstCompatibility(source, dest, 1);
10354 if(source->kind == 20 && dest->kind != 20)
10355 {
10356 struct Type * type = ProcessTemplateParameterType(source->__anon1.templateParameter);
10357
10358 if(type)
10359 source = type;
10360 }
10361 if(dest->kind == 20 && source->kind != 20)
10362 {
10363 struct Type * type = ProcessTemplateParameterType(dest->__anon1.templateParameter);
10364
10365 if(type)
10366 dest = type;
10367 }
10368 if(dest->classObjectType == 2 && dest->kind != 11)
10369 {
10370 if(source->classObjectType != 3)
10371 return 1;
10372 else
10373 {
10374 if((dest->__anon1._class && strcmp(dest->__anon1._class->string, "class")) || (source->__anon1._class && strcmp(source->__anon1._class->string, "class")))
10375 {
10376 return 1;
10377 }
10378 }
10379 }
10380 else
10381 {
10382 if(source->kind != 11 && source->classObjectType == 3)
10383 return 1;
10384 if(dest->kind != 11 && dest->classObjectType == 3 && source->classObjectType != 2)
10385 return 1;
10386 }
10387 if((dest->kind == 9 && source->kind == 9) || (dest->kind == 10 && source->kind == 10))
10388 {
10389 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))
10390 return 1;
10391 }
10392 if(dest->kind == 14 && source->kind != 0)
10393 return 1;
10394 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))
10395 return 1;
10396 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))
10397 return 1;
10398 if(((source->kind == 8 && dest->kind == 8) || (source->kind == 19 && dest->kind == 19)) && source->__anon1._class)
10399 {
10400 if(source->__anon1._class->__anon1.registered && source->__anon1._class->__anon1.registered->type == 3)
10401 {
10402 if(conversions != (((void *)0)))
10403 {
10404 if(source->__anon1._class->__anon1.registered == dest->__anon1._class->__anon1.registered)
10405 return 1;
10406 }
10407 else
10408 {
10409 struct __ecereNameSpace__ecere__com__Class * sourceBase, * destBase;
10410
10411 for(sourceBase = source->__anon1._class->__anon1.registered; sourceBase && sourceBase->base->type != 1000; sourceBase = sourceBase->base)
10412 ;
10413 for(destBase = dest->__anon1._class->__anon1.registered; destBase && destBase->base->type != 1000; destBase = destBase->base)
10414 ;
10415 if(sourceBase == destBase)
10416 return 1;
10417 }
10418 }
10419 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))
10420 return 1;
10421 else
10422 {
10423 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))))
10424 {
10425 if(__ecereNameSpace__ecere__com__eClass_IsDerived(dest->__anon1._class->__anon1.registered, source->__anon1._class->__anon1.registered))
10426 {
10427 return 1;
10428 }
10429 }
10430 }
10431 }
10432 if(source->kind == 19 && dest->kind == 8 && dest->__anon1._class && !strcmp(dest->__anon1._class->string, "ecere::com::Class"))
10433 return 1;
10434 if(doConversion)
10435 {
10436 if(source->kind == 8)
10437 {
10438 struct __ecereNameSpace__ecere__com__Class * _class;
10439
10440 for(_class = source->__anon1._class ? source->__anon1._class->__anon1.registered : (((void *)0)); _class; _class = _class->base)
10441 {
10442 struct __ecereNameSpace__ecere__com__Property * convert;
10443
10444 for(convert = _class->conversions.first; convert; convert = convert->next)
10445 {
10446 if(convert->memberAccess == 1 || _class->module == privateModule)
10447 {
10448 struct Conversion * after = (conversions != (((void *)0))) ? conversions->last : (((void *)0));
10449
10450 if(!convert->dataType)
10451 convert->dataType = ProcessTypeString(convert->dataTypeString, 0);
10452 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))
10453 {
10454 if(!conversions && !convert->Get)
10455 return 1;
10456 else if(conversions != (((void *)0)))
10457 {
10458 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))
10459 return 1;
10460 else
10461 {
10462 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv->isGet = 1, conv);
10463
10464 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(conversions, after, conv);
10465 return 1;
10466 }
10467 }
10468 }
10469 }
10470 }
10471 }
10472 }
10473 if(dest->kind == 8)
10474 {
10475 struct __ecereNameSpace__ecere__com__Class * _class;
10476
10477 for(_class = dest->__anon1._class ? dest->__anon1._class->__anon1.registered : (((void *)0)); _class; _class = _class->base)
10478 {
10479 struct __ecereNameSpace__ecere__com__Property * convert;
10480
10481 for(convert = _class->conversions.first; convert; convert = convert->next)
10482 {
10483 if(convert->memberAccess == 1 || _class->module == privateModule)
10484 {
10485 struct Type * constType = (((void *)0));
10486 unsigned int success = 0;
10487
10488 if(!convert->dataType)
10489 convert->dataType = ProcessTypeString(convert->dataTypeString, 0);
10490 if(warnConst && convert->dataType->kind == 13 && convert->dataType->__anon1.type && dest->constant)
10491 {
10492 struct Type * ptrType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
10493
10494 constType = __extension__ ({
10495 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
10496
10497 __ecereInstance1->kind = 13, __ecereInstance1->refCount = 1, __ecereInstance1->__anon1.type = ptrType, __ecereInstance1;
10498 });
10499 CopyTypeInto(ptrType, convert->dataType->__anon1.type);
10500 ptrType->constant = 1;
10501 }
10502 if((constType || convert->dataType != dest) && MatchTypes(source, constType ? constType : convert->dataType, conversions, (((void *)0)), (((void *)0)), 1, 0, 0, 1, warnConst))
10503 {
10504 if(!conversions && !convert->Set)
10505 success = 1;
10506 else if(conversions != (((void *)0)))
10507 {
10508 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))
10509 success = 1;
10510 else
10511 {
10512 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv);
10513
10514 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(conversions, conv);
10515 success = 1;
10516 }
10517 }
10518 }
10519 if(constType)
10520 FreeType(constType);
10521 if(success)
10522 return 1;
10523 }
10524 }
10525 }
10526 if(enumBaseType && dest->__anon1._class && dest->__anon1._class->__anon1.registered && dest->__anon1._class->__anon1.registered->type == 4)
10527 {
10528 if(!dest->__anon1._class->__anon1.registered->dataType)
10529 dest->__anon1._class->__anon1.registered->dataType = ProcessTypeString(dest->__anon1._class->__anon1.registered->dataTypeString, 0);
10530 if(dest->__anon1._class->__anon1.registered->dataType->kind == 8 || source->truth || dest->truth)
10531 {
10532 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))
10533 {
10534 return 1;
10535 }
10536 }
10537 }
10538 }
10539 if(source->kind == 8)
10540 {
10541 struct __ecereNameSpace__ecere__com__Class * _class;
10542
10543 for(_class = source->__anon1._class ? source->__anon1._class->__anon1.registered : (((void *)0)); _class; _class = _class->base)
10544 {
10545 struct __ecereNameSpace__ecere__com__Property * convert;
10546
10547 for(convert = _class->conversions.first; convert; convert = convert->next)
10548 {
10549 if(convert->memberAccess == 1 || _class->module == privateModule)
10550 {
10551 struct Conversion * after = (conversions != (((void *)0))) ? conversions->last : (((void *)0));
10552
10553 if(!convert->dataType)
10554 convert->dataType = ProcessTypeString(convert->dataTypeString, 0);
10555 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))
10556 {
10557 if(!conversions && !convert->Get)
10558 return 1;
10559 else if(conversions != (((void *)0)))
10560 {
10561 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))
10562 return 1;
10563 else
10564 {
10565 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv->isGet = 1, conv);
10566
10567 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(conversions, after, conv);
10568 return 1;
10569 }
10570 }
10571 }
10572 }
10573 }
10574 }
10575 if(enumBaseType && source->__anon1._class && source->__anon1._class->__anon1.registered && source->__anon1._class->__anon1.registered->type == 4)
10576 {
10577 if(!source->__anon1._class->__anon1.registered->dataType)
10578 source->__anon1._class->__anon1.registered->dataType = ProcessTypeString(source->__anon1._class->__anon1.registered->dataTypeString, 0);
10579 if(!isConversionExploration || source->__anon1._class->__anon1.registered->dataType->kind == 8 || !strcmp(source->__anon1._class->__anon1.registered->name, "String"))
10580 {
10581 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))
10582 return 1;
10583 else if(MatchTypes(dest, source->__anon1._class->__anon1.registered->dataType, (((void *)0)), (((void *)0)), (((void *)0)), 0, 0, 0, 0, warnConst))
10584 return 1;
10585 }
10586 }
10587 }
10588 }
10589 if(source->kind == 8 || source->kind == 19)
10590 ;
10591 else if(dest->kind == source->kind && (dest->kind != 9 && dest->kind != 10 && dest->kind != 11 && dest->kind != 12 && dest->kind != 13 && dest->kind != 16))
10592 return 1;
10593 else if(dest->kind == 7 && source->kind == 6)
10594 return 1;
10595 else if(dest->kind == 2 && (source->kind == 1 || source->kind == 24))
10596 return 1;
10597 else if(dest->kind == 3 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 23))
10598 return 1;
10599 else if(dest->kind == 4 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 3 || source->kind == 22 || source->kind == 23))
10600 return 1;
10601 else if(dest->kind == 25 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 3 || source->kind == 22 || source->kind == 4 || source->kind == 23))
10602 return 1;
10603 else if(dest->kind == 22 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 3 || source->kind == 23 || source->kind == 4))
10604 return 1;
10605 else if(dest->kind == 23 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 3 || source->kind == 4 || source->kind == 22))
10606 return 1;
10607 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))
10608 return 1;
10609 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))
10610 return 1;
10611 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)))
10612 {
10613 struct Type * paramSource, * paramDest;
10614
10615 if(dest->kind == 16)
10616 owningClassDest = dest->__anon1.__anon3.methodClass ? dest->__anon1.__anon3.methodClass : dest->__anon1.__anon3.method->_class;
10617 if(source->kind == 16)
10618 owningClassSource = source->__anon1.__anon3.methodClass ? source->__anon1.__anon3.methodClass : source->__anon1.__anon3.method->_class;
10619 if(dest->kind == 13 && dest->__anon1.type->kind == 11)
10620 dest = dest->__anon1.type;
10621 if(source->kind == 13 && source->__anon1.type->kind == 11)
10622 source = source->__anon1.type;
10623 if(dest->kind == 16)
10624 dest = dest->__anon1.__anon3.method->dataType;
10625 if(source->kind == 16)
10626 source = source->__anon1.__anon3.method->dataType;
10627 paramSource = source->__anon1.__anon2.params.first;
10628 if(paramSource && paramSource->kind == 0)
10629 paramSource = (((void *)0));
10630 paramDest = dest->__anon1.__anon2.params.first;
10631 if(paramDest && paramDest->kind == 0)
10632 paramDest = (((void *)0));
10633 if((dest->__anon1.__anon2.staticMethod || (!dest->__anon1.__anon2.thisClass && !owningClassDest)) && !(source->__anon1.__anon2.staticMethod || (!source->__anon1.__anon2.thisClass && !owningClassSource)))
10634 {
10635 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))))
10636 {
10637 if(paramDest && paramDest->kind == 8)
10638 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "method class must be derived from %s\n", (((void *)0))), paramDest->__anon1._class->string);
10639 else
10640 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "method class should not take an object\n", (((void *)0))));
10641 return 0;
10642 }
10643 paramDest = paramDest->next;
10644 }
10645 else if(!dest->__anon1.__anon2.staticMethod && (dest->__anon1.__anon2.thisClass || owningClassDest))
10646 {
10647 if((source->__anon1.__anon2.staticMethod || (!source->__anon1.__anon2.thisClass && !owningClassSource)))
10648 {
10649 if(dest->__anon1.__anon2.thisClass)
10650 {
10651 if(!paramSource || paramSource->kind != 8 || !__ecereNameSpace__ecere__com__eClass_IsDerived(paramSource->__anon1._class->__anon1.registered, dest->__anon1.__anon2.thisClass->__anon1.registered))
10652 {
10653 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "method class must be derived from %s\n", (((void *)0))), dest->__anon1.__anon2.thisClass->string);
10654 return 0;
10655 }
10656 }
10657 else
10658 {
10659 if(!paramSource || paramSource->kind != 8 || (owningClassDest && !__ecereNameSpace__ecere__com__eClass_IsDerived(paramSource->__anon1._class->__anon1.registered, owningClassDest)))
10660 {
10661 if(owningClassDest)
10662 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "%s expected to be derived from method class\n", (((void *)0))), owningClassDest->fullName);
10663 else
10664 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "overriding class expected to be derived from method class\n", (((void *)0))));
10665 return 0;
10666 }
10667 }
10668 paramSource = paramSource->next;
10669 }
10670 else
10671 {
10672 if(dest->__anon1.__anon2.thisClass)
10673 {
10674 if(!__ecereNameSpace__ecere__com__eClass_IsDerived(source->__anon1.__anon2.thisClass ? source->__anon1.__anon2.thisClass->__anon1.registered : owningClassSource, dest->__anon1.__anon2.thisClass->__anon1.registered))
10675 {
10676 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "method class must be derived from %s\n", (((void *)0))), dest->__anon1.__anon2.thisClass->string);
10677 return 0;
10678 }
10679 }
10680 else
10681 {
10682 if(source->__anon1.__anon2.thisClass && source->__anon1.__anon2.thisClass->__anon1.registered && owningClassDest && !__ecereNameSpace__ecere__com__eClass_IsDerived(source->__anon1.__anon2.thisClass->__anon1.registered, owningClassDest))
10683 {
10684 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "%s expected to be derived from method class\n", (((void *)0))), source->__anon1.__anon2.thisClass->__anon1.registered->fullName);
10685 return 0;
10686 }
10687 }
10688 }
10689 }
10690 if(!MatchTypes(source->__anon1.__anon2.returnType, dest->__anon1.__anon2.returnType, (((void *)0)), (((void *)0)), (((void *)0)), 1, 1, 0, 0, warnConst))
10691 {
10692 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible return type for function\n", (((void *)0))));
10693 return 0;
10694 }
10695 else
10696 CheckConstCompatibility(dest->__anon1.__anon2.returnType, source->__anon1.__anon2.returnType, 1);
10697 for(; paramDest; paramDest = paramDest->next)
10698 {
10699 if(!paramSource)
10700 {
10701 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "not enough parameters\n", (((void *)0))));
10702 return 0;
10703 }
10704 {
10705 struct Type * paramDestType = paramDest;
10706 struct Type * paramSourceType = paramSource;
10707 struct Type * type = paramDestType;
10708
10709 if(paramDest->kind == 20 && paramDest->__anon1.templateParameter->type == 0 && owningClassSource && paramSource->kind != 20)
10710 {
10711 int id = 0;
10712 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
10713 struct __ecereNameSpace__ecere__com__Class * sClass;
10714
10715 for(sClass = owningClassSource; sClass; sClass = sClass->base)
10716 {
10717 id = 0;
10718 if(sClass->templateClass)
10719 sClass = sClass->templateClass;
10720 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
10721 {
10722 if(curParam->type == 0 && !strcmp(type->__anon1.templateParameter->identifier->string, curParam->name))
10723 {
10724 for(sClass = sClass->base; sClass; sClass = sClass->base)
10725 {
10726 if(sClass->templateClass)
10727 sClass = sClass->templateClass;
10728 id += sClass->templateParams.count;
10729 }
10730 break;
10731 }
10732 id++;
10733 }
10734 if(curParam)
10735 break;
10736 }
10737 if(curParam)
10738 {
10739 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = owningClassSource->templateArgs[id];
10740
10741 paramDestType = type = ProcessTypeString(arg.__anon1.__anon1.dataTypeString, 0);
10742 }
10743 }
10744 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)))
10745 {
10746 char type[1024];
10747
10748 type[0] = 0;
10749 PrintType(paramDest, type, 0, 1);
10750 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible parameter %s (expected %s)\n", (((void *)0))), paramSource->name, type);
10751 if(paramDestType != paramDest)
10752 FreeType(paramDestType);
10753 return 0;
10754 }
10755 if(paramDestType != paramDest)
10756 FreeType(paramDestType);
10757 }
10758 paramSource = paramSource->next;
10759 }
10760 if(paramSource)
10761 {
10762 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "too many parameters\n", (((void *)0))));
10763 return 0;
10764 }
10765 return 1;
10766 }
10767 else if((dest->kind == 11 || (dest->kind == 13 && dest->__anon1.type->kind == 11) || dest->kind == 16) && (source->kind == 13 && source->__anon1.type->kind == 0))
10768 {
10769 return 1;
10770 }
10771 else if((dest->kind == 13 || dest->kind == 12) && (source->kind == 12 || source->kind == 13))
10772 {
10773 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))
10774 {
10775 ComputeTypeSize(source->__anon1.type);
10776 ComputeTypeSize(dest->__anon1.type);
10777 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))
10778 return 1;
10779 }
10780 }
10781 }
10782 return 0;
10783 }
10784
10785 void CallOperator(struct Expression * exp, struct Expression * exp1, struct Expression * exp2, struct Operand * op1, struct Operand * op2)
10786 {
10787 if(exp->__anon1.op.op == SIZEOF)
10788 {
10789 FreeExpContents(exp);
10790 exp->type = 2;
10791 exp->__anon1.__anon1.constant = PrintUInt(ComputeTypeSize(op1->type));
10792 }
10793 else
10794 {
10795 if(!exp->__anon1.op.exp1)
10796 {
10797 switch(exp->__anon1.op.op)
10798 {
10799 case '+':
10800 {
10801 struct Expression * exp2 = exp->__anon1.op.exp2;
10802
10803 exp->__anon1.op.exp2 = (((void *)0));
10804 FreeExpContents(exp);
10805 FreeType(exp->expType);
10806 FreeType(exp->destType);
10807 *exp = *exp2;
10808 ((exp2 ? __extension__ ({
10809 void * __ecerePtrToDelete = (exp2);
10810
10811 __ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)__ecerePtrToDelete) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(__ecerePtrToDelete);
10812 }) : 0), exp2 = 0);
10813 break;
10814 }
10815 case '-':
10816 if(op1->ops.Neg)
10817 {
10818 FreeExpContents(exp);
10819 op1->ops.Neg(exp, op1);
10820 }
10821 break;
10822 case '~':
10823 if(op1->ops.BitNot)
10824 {
10825 FreeExpContents(exp);
10826 op1->ops.BitNot(exp, op1);
10827 }
10828 break;
10829 case '!':
10830 if(op1->ops.Not)
10831 {
10832 FreeExpContents(exp);
10833 op1->ops.Not(exp, op1);
10834 }
10835 break;
10836 }
10837 }
10838 else
10839 {
10840 if(op1 && op2 && op1->type && op2->type && op1->kind != op2->kind)
10841 {
10842 if(Promote(op2, op1->kind, op1->type->isSigned))
10843 op2->kind = op1->kind, op2->ops = op1->ops;
10844 else if(Promote(op1, op2->kind, op2->type->isSigned))
10845 op1->kind = op2->kind, op1->ops = op2->ops;
10846 }
10847 switch(exp->__anon1.op.op)
10848 {
10849 case '+':
10850 if(op1->ops.Add)
10851 {
10852 FreeExpContents(exp);
10853 op1->ops.Add(exp, op1, op2);
10854 }
10855 break;
10856 case '-':
10857 if(op1->ops.Sub)
10858 {
10859 FreeExpContents(exp);
10860 op1->ops.Sub(exp, op1, op2);
10861 }
10862 break;
10863 case '*':
10864 if(op1->ops.Mul)
10865 {
10866 FreeExpContents(exp);
10867 op1->ops.Mul(exp, op1, op2);
10868 }
10869 break;
10870 case '/':
10871 if(op1->ops.Div)
10872 {
10873 FreeExpContents(exp);
10874 op1->ops.Div(exp, op1, op2);
10875 }
10876 break;
10877 case '%':
10878 if(op1->ops.Mod)
10879 {
10880 FreeExpContents(exp);
10881 op1->ops.Mod(exp, op1, op2);
10882 }
10883 break;
10884 case '&':
10885 if(exp->__anon1.op.exp2)
10886 {
10887 if(op1->ops.BitAnd)
10888 {
10889 FreeExpContents(exp);
10890 op1->ops.BitAnd(exp, op1, op2);
10891 }
10892 }
10893 break;
10894 case '|':
10895 if(op1->ops.BitOr)
10896 {
10897 FreeExpContents(exp);
10898 op1->ops.BitOr(exp, op1, op2);
10899 }
10900 break;
10901 case '^':
10902 if(op1->ops.BitXor)
10903 {
10904 FreeExpContents(exp);
10905 op1->ops.BitXor(exp, op1, op2);
10906 }
10907 break;
10908 case LEFT_OP:
10909 if(op1->ops.LShift)
10910 {
10911 FreeExpContents(exp);
10912 op1->ops.LShift(exp, op1, op2);
10913 }
10914 break;
10915 case RIGHT_OP:
10916 if(op1->ops.RShift)
10917 {
10918 FreeExpContents(exp);
10919 op1->ops.RShift(exp, op1, op2);
10920 }
10921 break;
10922 case EQ_OP:
10923 if(op1->ops.Equ)
10924 {
10925 FreeExpContents(exp);
10926 op1->ops.Equ(exp, op1, op2);
10927 }
10928 break;
10929 case NE_OP:
10930 if(op1->ops.Nqu)
10931 {
10932 FreeExpContents(exp);
10933 op1->ops.Nqu(exp, op1, op2);
10934 }
10935 break;
10936 case AND_OP:
10937 if(op1->ops.And)
10938 {
10939 FreeExpContents(exp);
10940 op1->ops.And(exp, op1, op2);
10941 }
10942 break;
10943 case OR_OP:
10944 if(op1->ops.Or)
10945 {
10946 FreeExpContents(exp);
10947 op1->ops.Or(exp, op1, op2);
10948 }
10949 break;
10950 case '>':
10951 if(op1->ops.Grt)
10952 {
10953 FreeExpContents(exp);
10954 op1->ops.Grt(exp, op1, op2);
10955 }
10956 break;
10957 case '<':
10958 if(op1->ops.Sma)
10959 {
10960 FreeExpContents(exp);
10961 op1->ops.Sma(exp, op1, op2);
10962 }
10963 break;
10964 case GE_OP:
10965 if(op1->ops.GrtEqu)
10966 {
10967 FreeExpContents(exp);
10968 op1->ops.GrtEqu(exp, op1, op2);
10969 }
10970 break;
10971 case LE_OP:
10972 if(op1->ops.SmaEqu)
10973 {
10974 FreeExpContents(exp);
10975 op1->ops.SmaEqu(exp, op1, op2);
10976 }
10977 break;
10978 }
10979 }
10980 }
10981 }
10982
10983 void ApplyAnyObjectLogic(struct Expression * e)
10984 {
10985 struct Type * destType = e->destType;
10986
10987 if(destType && (destType->classObjectType == 3))
10988 {
10989 if(e && e->expType)
10990 {
10991 struct Type * type = e->expType;
10992 struct __ecereNameSpace__ecere__com__Class * _class = (((void *)0));
10993
10994 if(type->kind == 8 && type->__anon1._class && type->__anon1._class->__anon1.registered)
10995 {
10996 _class = type->__anon1._class->__anon1.registered;
10997 }
10998 else if(type->kind == 19)
10999 {
11000 _class = FindClass("ecere::com::Class")->__anon1.registered;
11001 }
11002 else
11003 {
11004 char string[1024] = "";
11005 struct Symbol * classSym;
11006
11007 PrintTypeNoConst(type, string, 0, 1);
11008 classSym = FindClass(string);
11009 if(classSym)
11010 _class = classSym->__anon1.registered;
11011 }
11012 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)))
11013 {
11014 if(!_class || strcmp(_class->fullName, "char *"))
11015 {
11016 struct Expression * checkedExp = e, * newExp;
11017
11018 while(((checkedExp->type == 5 || checkedExp->type == 32 || checkedExp->type == 23) && checkedExp->__anon1.list) || checkedExp->type == 11)
11019 {
11020 if(checkedExp->type == 5 || checkedExp->type == 32 || checkedExp->type == 23)
11021 {
11022 if(checkedExp->type == 23)
11023 {
11024 checkedExp = (*((struct Statement *)(*checkedExp->__anon1.compound->__anon1.compound.statements).last)->__anon1.expressions).last;
11025 }
11026 else
11027 checkedExp = (*checkedExp->__anon1.list).last;
11028 }
11029 else if(checkedExp->type == 11)
11030 checkedExp = checkedExp->__anon1.cast.exp;
11031 }
11032 if(checkedExp && checkedExp->type == 4 && checkedExp->__anon1.op.op == '*' && !checkedExp->__anon1.op.exp1)
11033 {
11034 newExp = checkedExp->__anon1.op.exp2;
11035 checkedExp->__anon1.op.exp2 = (((void *)0));
11036 FreeExpContents(checkedExp);
11037 if(e->expType && e->expType->passAsTemplate)
11038 {
11039 char size[100];
11040
11041 ComputeTypeSize(e->expType);
11042 sprintf(size, "%d", e->expType->size);
11043 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))))));
11044 }
11045 ReplaceExpContents(checkedExp, newExp);
11046 e->byReference = 1;
11047 }
11048 else if(!e->byReference || (_class && _class->type == 5))
11049 {
11050 struct Expression * checkedExp;
11051
11052 {
11053 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;
11054
11055 if(_class && _class->type != 5 && _class->type != 0 && _class->type != 1 && !hasAddress)
11056 {
11057 struct Context * context = PushContext();
11058 struct Declarator * decl;
11059 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
11060 char typeString[1024];
11061 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
11062
11063 typeString[0] = '\0';
11064 *newExp = *e;
11065 newExp->prev = (((void *)0));
11066 newExp->next = (((void *)0));
11067 newExp->expType = (((void *)0));
11068 PrintTypeNoConst(e->expType, typeString, 0, 1);
11069 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
11070 newExp->destType = ProcessType(specs, decl);
11071 curContext = context;
11072 if(curCompound)
11073 {
11074 char name[100];
11075 struct __ecereNameSpace__ecere__sys__OldList * stmts = MkList();
11076
11077 e->type = 23;
11078 sprintf(name, "__internalValue%03X", internalValueCounter++);
11079 if(!curCompound->__anon1.compound.declarations)
11080 curCompound->__anon1.compound.declarations = MkList();
11081 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*curCompound->__anon1.compound.declarations), (((void *)0)), MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(name)), (((void *)0))))));
11082 ListAdd(stmts, MkExpressionStmt(MkListOne(MkExpOp(MkExpIdentifier(MkIdentifier(name)), '=', newExp))));
11083 ListAdd(stmts, MkExpressionStmt(MkListOne(MkExpIdentifier(MkIdentifier(name)))));
11084 e->__anon1.compound = MkCompoundStmt((((void *)0)), stmts);
11085 }
11086 else
11087 printf("libec: compiler error, curCompound is null in ApplyAnyObjectLogic\n");
11088 {
11089 struct Type * type = e->destType;
11090
11091 e->destType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
11092 CopyTypeInto(e->destType, type);
11093 e->destType->refCount = 1;
11094 e->destType->classObjectType = 0;
11095 FreeType(type);
11096 }
11097 e->__anon1.compound->__anon1.compound.context = context;
11098 PopContext(context);
11099 curContext = context->parent;
11100 }
11101 }
11102 checkedExp = e;
11103 while(((checkedExp->type == 5 || checkedExp->type == 32 || checkedExp->type == 23) && checkedExp->__anon1.list) || checkedExp->type == 11)
11104 {
11105 if(checkedExp->type == 5 || checkedExp->type == 32 || checkedExp->type == 23)
11106 {
11107 if(checkedExp->type == 23)
11108 {
11109 checkedExp = (*((struct Statement *)(*checkedExp->__anon1.compound->__anon1.compound.statements).last)->__anon1.expressions).last;
11110 }
11111 else
11112 checkedExp = (*checkedExp->__anon1.list).last;
11113 }
11114 else if(checkedExp->type == 11)
11115 checkedExp = checkedExp->__anon1.cast.exp;
11116 }
11117 {
11118 struct Expression * operand = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
11119
11120 *operand = *checkedExp;
11121 __ecereMethod_Expression_Clear(checkedExp);
11122 checkedExp->destType = ProcessTypeString("void *", 0);
11123 checkedExp->expType = checkedExp->destType;
11124 checkedExp->destType->refCount++;
11125 checkedExp->type = 4;
11126 checkedExp->__anon1.op.op = '&';
11127 checkedExp->__anon1.op.exp1 = (((void *)0));
11128 checkedExp->__anon1.op.exp2 = operand;
11129 }
11130 }
11131 }
11132 }
11133 }
11134 }
11135 {
11136 }
11137 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))))
11138 {
11139 if(e->expType->classObjectType && destType && destType->classObjectType)
11140 {
11141 return ;
11142 }
11143 else
11144 {
11145 struct Expression * thisExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
11146
11147 *thisExp = *e;
11148 thisExp->prev = (((void *)0));
11149 thisExp->next = (((void *)0));
11150 __ecereMethod_Expression_Clear(e);
11151 e->type = 5;
11152 e->__anon1.list = MkListOne(MkExpOp((((void *)0)), '*', thisExp->type == 0 ? thisExp : MkExpBrackets(MkListOne(thisExp))));
11153 if(thisExp->expType->kind == 8 && thisExp->expType->__anon1._class && thisExp->expType->__anon1._class->__anon1.registered && thisExp->expType->__anon1._class->__anon1.registered->type == 5)
11154 ((struct Expression *)(*e->__anon1.list).first)->byReference = 1;
11155 {
11156 e->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
11157 CopyTypeInto(e->expType, thisExp->expType);
11158 e->expType->byReference = 0;
11159 e->expType->refCount = 1;
11160 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))
11161 {
11162 e->expType->classObjectType = 0;
11163 }
11164 }
11165 }
11166 }
11167 else if(destType && e->expType && (e->expType->classObjectType == 3 || e->expType->classObjectType == 2) && !destType->classObjectType && destType->kind != 0)
11168 {
11169 if(destType->kind == 14)
11170 {
11171 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Unspecified type\n", (((void *)0))));
11172 }
11173 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))
11174 {
11175 unsigned int byReference = e->expType->byReference;
11176 struct Expression * thisExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
11177 struct Declarator * decl;
11178 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
11179 char typeString[1024];
11180 struct Type * type;
11181 int backupClassObjectType;
11182 unsigned int backupByReference;
11183
11184 if(e->expType->kind == 8 && e->expType->__anon1._class && e->expType->__anon1._class->__anon1.registered && strcmp(e->expType->__anon1._class->__anon1.registered->name, "class"))
11185 type = e->expType;
11186 else
11187 type = destType;
11188 backupClassObjectType = type->classObjectType;
11189 backupByReference = type->byReference;
11190 type->classObjectType = 0;
11191 type->byReference = 0;
11192 typeString[0] = '\0';
11193 PrintType(type, typeString, 0, 1);
11194 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
11195 type->classObjectType = backupClassObjectType;
11196 type->byReference = backupByReference;
11197 *thisExp = *e;
11198 thisExp->prev = (((void *)0));
11199 thisExp->next = (((void *)0));
11200 __ecereMethod_Expression_Clear(e);
11201 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)))
11202 {
11203 unsigned int passAsTemplate = thisExp->destType->passAsTemplate;
11204 struct Type * t;
11205
11206 destType->refCount++;
11207 e->type = 4;
11208 e->__anon1.op.op = '*';
11209 e->__anon1.op.exp1 = (((void *)0));
11210 e->__anon1.op.exp2 = MkExpCast(MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl)), thisExp);
11211 t = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
11212 CopyTypeInto(t, thisExp->destType);
11213 t->passAsTemplate = 0;
11214 FreeType(thisExp->destType);
11215 thisExp->destType = t;
11216 t = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
11217 CopyTypeInto(t, destType);
11218 t->passAsTemplate = passAsTemplate;
11219 FreeType(destType);
11220 destType = t;
11221 destType->refCount = 0;
11222 e->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
11223 CopyTypeInto(e->expType, type);
11224 if(type->passAsTemplate)
11225 {
11226 e->expType->classObjectType = 0;
11227 e->expType->passAsTemplate = 0;
11228 }
11229 e->expType->byReference = 0;
11230 e->expType->refCount = 1;
11231 }
11232 else
11233 {
11234 e->type = 11;
11235 e->__anon1.cast.typeName = MkTypeName(specs, decl);
11236 e->__anon1.cast.exp = thisExp;
11237 e->byReference = 1;
11238 e->expType = type;
11239 type->refCount++;
11240 }
11241 if(e->destType)
11242 FreeType(e->destType);
11243 e->destType = destType;
11244 destType->refCount++;
11245 }
11246 }
11247 }
11248
11249 void ComputeModuleClasses(struct __ecereNameSpace__ecere__com__Instance * module)
11250 {
11251 struct __ecereNameSpace__ecere__com__Class * _class;
11252 struct __ecereNameSpace__ecere__sys__OldLink * subModule;
11253
11254 for(subModule = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->modules.first; subModule; subModule = subModule->next)
11255 ComputeModuleClasses(subModule->data);
11256 for(_class = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->classes.first; _class; _class = _class->next)
11257 ComputeClassMembers(_class, 0);
11258 }
11259
11260 struct External * _DeclareStruct(struct External * neededBy, const char * name, unsigned int skipNoHead, unsigned int needDereference, unsigned int fwdDecl)
11261 {
11262 struct External * external = (((void *)0));
11263 struct Symbol * classSym = FindClass(name);
11264 struct __ecereNameSpace__ecere__sys__OldList * curDeclarations = (((void *)0));
11265
11266 if(!inCompiler || !classSym)
11267 return (((void *)0));
11268 if(classSym->__anon1.registered && (classSym->__anon1.registered->type == 2 || classSym->__anon1.registered->type == 3 || classSym->__anon1.registered->type == 4))
11269 return (((void *)0));
11270 if(!classSym->__anon1.registered || (classSym->__anon1.registered->type == 0 && classSym->__anon1.registered->structSize && classSym->__anon1.registered->base && classSym->__anon1.registered->base->base))
11271 _DeclareStruct(neededBy, "ecere::com::Instance", 0, 1, fwdDecl);
11272 external = classSym->__anon2.__anon1.structExternal;
11273 if(external && external->__anon1.declaration)
11274 {
11275 struct Specifier * spec;
11276
11277 for(spec = external->__anon1.declaration->__anon1.__anon1.specifiers ? (*external->__anon1.declaration->__anon1.__anon1.specifiers).first : (((void *)0)); spec; spec = spec->next)
11278 if(spec->type == 3 || spec->type == 4)
11279 {
11280 curDeclarations = spec->__anon1.__anon2.definitions;
11281 break;
11282 }
11283 }
11284 if(classSym->__anon1.registered && !classSym->declaring && classSym->imported && (!classSym->declaredStructSym || (classSym->__anon1.registered->type == 5 && !skipNoHead && external && !curDeclarations)))
11285 {
11286 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
11287 struct __ecereNameSpace__ecere__sys__OldList * declarations = (((void *)0));
11288 char structName[1024];
11289 unsigned int addedPadding = 0;
11290 struct Specifier * curSpec = (((void *)0));
11291
11292 classSym->declaring++;
11293 if(strchr(classSym->string, '<'))
11294 {
11295 if(classSym->__anon1.registered->templateClass)
11296 external = _DeclareStruct(neededBy, classSym->__anon1.registered->templateClass->fullName, skipNoHead, needDereference, fwdDecl);
11297 classSym->declaring--;
11298 return external;
11299 }
11300 structName[0] = 0;
11301 FullClassNameCat(structName, name, 0);
11302 classSym->declaredStructSym = 1;
11303 if(!external || (classSym->__anon1.registered->type == 5 && !skipNoHead && !curDeclarations))
11304 {
11305 unsigned int add = 0;
11306
11307 if(!external)
11308 {
11309 external = MkExternalDeclaration((((void *)0)));
11310 classSym->__anon2.__anon1.structExternal = external;
11311 external->symbol = classSym;
11312 add = 1;
11313 }
11314 if(!skipNoHead)
11315 {
11316 declarations = MkList();
11317 AddMembers(external, declarations, classSym->__anon1.registered, 0, (((void *)0)), classSym->__anon1.registered, &addedPadding);
11318 }
11319 if(external->__anon1.declaration)
11320 {
11321 struct Specifier * spec;
11322
11323 for(spec = external->__anon1.declaration->__anon1.__anon1.specifiers ? (*external->__anon1.declaration->__anon1.__anon1.specifiers).first : (((void *)0)); spec; spec = spec->next)
11324 if(spec->type == 3 || spec->type == 4)
11325 {
11326 curSpec = spec;
11327 curDeclarations = spec->__anon1.__anon2.definitions;
11328 break;
11329 }
11330 }
11331 if(declarations && (!(*declarations).count || ((*declarations).count == 1 && addedPadding)))
11332 {
11333 FreeList(declarations, (void *)(FreeClassDef));
11334 declarations = (((void *)0));
11335 }
11336 if(classSym->__anon1.registered->type != 5 && !declarations)
11337 {
11338 FreeExternal(external);
11339 external = (((void *)0));
11340 classSym->__anon2.__anon1.structExternal = (((void *)0));
11341 }
11342 else
11343 {
11344 if(curSpec)
11345 curSpec->__anon1.__anon2.definitions = declarations;
11346 else
11347 {
11348 specifiers = MkList();
11349 declarators = MkList();
11350 ListAdd(specifiers, MkStructOrUnion(3, MkIdentifier(structName), declarations));
11351 external->__anon1.declaration = MkDeclaration(specifiers, declarators);
11352 }
11353 if(add)
11354 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*ast), external);
11355 }
11356 }
11357 classSym->declaring--;
11358 }
11359 else if(!classSym->declaredStructSym && classSym->__anon2.__anon1.structExternal)
11360 {
11361 classSym->declaredStructSym = 1;
11362 if(classSym->__anon1.registered)
11363 DeclareMembers(classSym->__anon2.__anon1.structExternal, classSym->__anon1.registered, 0);
11364 if(classSym->__anon2.__anon1.structExternal->__anon1.declaration && classSym->__anon2.__anon1.structExternal->__anon1.declaration->__anon1.__anon1.specifiers)
11365 {
11366 struct Specifier * spec;
11367
11368 for(spec = (*classSym->__anon2.__anon1.structExternal->__anon1.declaration->__anon1.__anon1.specifiers).first; spec; spec = spec->next)
11369 {
11370 if(spec->__anon1.__anon2.definitions)
11371 IdentifyAnonStructs(spec->__anon1.__anon2.definitions);
11372 }
11373 }
11374 }
11375 if(inCompiler && neededBy && (external || !classSym->imported))
11376 {
11377 if(!external)
11378 {
11379 classSym->__anon2.__anon1.structExternal = external = MkExternalDeclaration((((void *)0)));
11380 external->symbol = classSym;
11381 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*ast), external);
11382 }
11383 if(reachedPass15 && !external->__anon1.declaration && classSym->__anon1.registered && classSym->__anon1.registered->type == 5)
11384 {
11385 char structName[1024];
11386 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
11387
11388 structName[0] = 0;
11389 FullClassNameCat(structName, name, 0);
11390 specifiers = MkList();
11391 declarators = MkList();
11392 ListAdd(specifiers, MkStructOrUnion(3, MkIdentifier(structName), (((void *)0))));
11393 external->__anon1.declaration = MkDeclaration(specifiers, declarators);
11394 }
11395 if(fwdDecl)
11396 {
11397 struct External * e = external->fwdDecl ? external->fwdDecl : external;
11398
11399 if(((struct __ecereNameSpace__ecere__com__LinkList *)(((char *)e->incoming + 0 + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->count)
11400 __ecereMethod_External_CreateUniqueEdge(neededBy, e, !needDereference && !external->fwdDecl);
11401 }
11402 else
11403 __ecereMethod_External_CreateUniqueEdge(neededBy, external, !needDereference);
11404 }
11405 return external;
11406 }
11407
11408 unsigned int MatchWithEnums_NameSpace(struct __ecereNameSpace__ecere__com__NameSpace * nameSpace, struct Expression * sourceExp, struct Type * dest, char * string, struct __ecereNameSpace__ecere__sys__OldList * conversions)
11409 {
11410 struct __ecereNameSpace__ecere__com__BTNamedLink * link;
11411
11412 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)))
11413 {
11414 struct __ecereNameSpace__ecere__com__Class * _class = link->data;
11415
11416 if(_class->type == 4)
11417 {
11418 struct __ecereNameSpace__ecere__sys__OldList converts =
11419 {
11420 0, 0, 0, 0, 0
11421 };
11422 struct Type * type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
11423
11424 type->kind = 8;
11425 if(!_class->symbol)
11426 _class->symbol = FindClass(_class->fullName);
11427 type->__anon1._class = _class->symbol;
11428 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))
11429 {
11430 struct __ecereNameSpace__ecere__sys__NamedLink64 * value;
11431 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
11432
11433 if(enumClass)
11434 {
11435 struct __ecereNameSpace__ecere__com__Class * baseClass;
11436
11437 for(baseClass = _class; baseClass && baseClass->type == 4; baseClass = baseClass->base)
11438 {
11439 struct __ecereNameSpace__ecere__com__EnumClassData * e = (baseClass ? ((void *)(((char *)baseClass->data) + enumClass->offsetClass)) : (((void *)0)));
11440
11441 for(value = e->values.first; value; value = value->next)
11442 {
11443 if(!strcmp(value->name, string))
11444 break;
11445 }
11446 if(value)
11447 {
11448 FreeType(sourceExp->expType);
11449 sourceExp->isConstant = 1;
11450 sourceExp->expType = MkClassType(baseClass->fullName);
11451 if(inCompiler || inPreCompiler || inDebugger)
11452 {
11453 char constant[256];
11454
11455 FreeExpContents(sourceExp);
11456 sourceExp->type = 2;
11457 if(!strcmp(baseClass->dataTypeString, "int") || !strcmp(baseClass->dataTypeString, "int64") || !strcmp(baseClass->dataTypeString, "short") || !strcmp(baseClass->dataTypeString, "char"))
11458 sprintf(constant, ((__runtimePlatform == 1) ? "%I64d" : "%lld"), value->data);
11459 else
11460 sprintf(constant, ((__runtimePlatform == 1) ? "0x%I64XLL" : "0x%llXLL"), value->data);
11461 sourceExp->__anon1.__anon1.constant = __ecereNameSpace__ecere__sys__CopyString(constant);
11462 }
11463 while(converts.first)
11464 {
11465 struct Conversion * convert = converts.first;
11466
11467 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(&converts, convert);
11468 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(conversions, convert);
11469 }
11470 ((type ? __extension__ ({
11471 void * __ecerePtrToDelete = (type);
11472
11473 __ecereClass_Type->Destructor ? __ecereClass_Type->Destructor((void *)__ecerePtrToDelete) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(__ecerePtrToDelete);
11474 }) : 0), type = 0);
11475 return 1;
11476 }
11477 }
11478 }
11479 }
11480 if(converts.first)
11481 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(&converts, (void *)(FreeConvert));
11482 ((type ? __extension__ ({
11483 void * __ecerePtrToDelete = (type);
11484
11485 __ecereClass_Type->Destructor ? __ecereClass_Type->Destructor((void *)__ecerePtrToDelete) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(__ecerePtrToDelete);
11486 }) : 0), type = 0);
11487 }
11488 }
11489 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)))
11490 if(MatchWithEnums_NameSpace(nameSpace, sourceExp, dest, string, conversions))
11491 return 1;
11492 return 0;
11493 }
11494
11495 unsigned int MatchWithEnums_Module(struct __ecereNameSpace__ecere__com__Instance * mainModule, struct Expression * sourceExp, struct Type * dest, char * string, struct __ecereNameSpace__ecere__sys__OldList * conversions)
11496 {
11497 struct __ecereNameSpace__ecere__com__Instance * module;
11498
11499 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))
11500 return 1;
11501 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))
11502 return 1;
11503 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))
11504 return 1;
11505 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)
11506 {
11507 if(ModuleVisibility(mainModule, module) && MatchWithEnums_NameSpace(&((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->publicNameSpace, sourceExp, dest, string, conversions))
11508 return 1;
11509 }
11510 return 0;
11511 }
11512
11513 void ProcessExpressionType(struct Expression *  exp);
11514
11515 static void ReplaceClassMembers(struct Expression * exp, struct __ecereNameSpace__ecere__com__Class * _class)
11516 {
11517 if(exp->type == 0 && exp->__anon1.__anon1.identifier)
11518 {
11519 struct Identifier * id = exp->__anon1.__anon1.identifier;
11520 struct Context * ctx;
11521 struct Symbol * symbol = (((void *)0));
11522
11523 if(!id->_class || !id->_class->__anon1.__anon1.name || strcmp(id->_class->__anon1.__anon1.name, "property"))
11524 {
11525 for(ctx = curContext; ctx != topContext->parent && !symbol; ctx = ctx->parent)
11526 {
11527 if(!ctx)
11528 break;
11529 symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(&ctx->symbols, id->string);
11530 if(symbol)
11531 break;
11532 }
11533 }
11534 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))))
11535 {
11536 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
11537 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
11538 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
11539 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
11540
11541 if(!prop)
11542 {
11543 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule);
11544 }
11545 if(!prop && !method)
11546 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
11547 if(!prop && !method && !member)
11548 {
11549 classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(_class, id->string);
11550 }
11551 if(prop || method || member || classProp)
11552 {
11553 exp->type = 8;
11554 exp->__anon1.member.member = id;
11555 exp->__anon1.member.memberType = 0;
11556 exp->__anon1.member.exp = QMkExpId("this");
11557 exp->addedThis = 1;
11558 }
11559 else if(_class && _class->templateParams.first)
11560 {
11561 struct __ecereNameSpace__ecere__com__Class * sClass;
11562
11563 for(sClass = _class; sClass; sClass = sClass->base)
11564 {
11565 if(sClass->templateParams.first)
11566 {
11567 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
11568
11569 for(param = sClass->templateParams.first; param; param = param->next)
11570 {
11571 if(param->type == 2 && !strcmp(param->name, id->string))
11572 {
11573 struct Expression * argExp = GetTemplateArgExpByName(param->name, _class, 2);
11574
11575 if(argExp)
11576 {
11577 struct Declarator * decl;
11578 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
11579
11580 FreeIdentifier(exp->__anon1.member.member);
11581 ProcessExpressionType(argExp);
11582 decl = SpecDeclFromString(param->__anon1.dataTypeString, specs, (((void *)0)));
11583 exp->expType = ProcessType(specs, decl);
11584 exp->type = 5;
11585 exp->__anon1.list = MkListOne(MkExpOp((((void *)0)), '*', MkExpCast(MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl)), MkExpOp((((void *)0)), '&', argExp))));
11586 }
11587 }
11588 }
11589 }
11590 }
11591 }
11592 }
11593 }
11594 }
11595
11596 int ComputeTypeSize(struct Type * type)
11597 {
11598 unsigned int size = type ? type->size : 0;
11599
11600 if(!size && type && !type->computing)
11601 {
11602 type->computing = 1;
11603 switch(type->kind)
11604 {
11605 case 24:
11606 type->alignment = size = sizeof(char);
11607 break;
11608 case 1:
11609 type->alignment = size = sizeof(char);
11610 break;
11611 case 3:
11612 type->alignment = size = sizeof(int);
11613 break;
11614 case 4:
11615 type->alignment = size = sizeof(long long);
11616 break;
11617 case 22:
11618 type->alignment = size = targetBits / 8;
11619 type->pointerAlignment = 1;
11620 break;
11621 case 23:
11622 type->alignment = size = targetBits / 8;
11623 type->pointerAlignment = 1;
11624 break;
11625 case 5:
11626 type->alignment = size = sizeof(long);
11627 break;
11628 case 2:
11629 type->alignment = size = sizeof(short);
11630 break;
11631 case 6:
11632 type->alignment = size = sizeof(float);
11633 break;
11634 case 7:
11635 type->alignment = size = sizeof(double);
11636 break;
11637 case 8:
11638 {
11639 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class ? type->__anon1._class->__anon1.registered : (((void *)0));
11640
11641 if(_class && _class->type == 1)
11642 {
11643 ComputeClassMembers(_class, 0);
11644 type->alignment = _class->structAlignment;
11645 type->pointerAlignment = (unsigned int)_class->pointerAlignment;
11646 size = _class->structSize;
11647 if(type->alignment && size % type->alignment)
11648 size += type->alignment - (size % type->alignment);
11649 }
11650 else if(_class && (_class->type == 3 || _class->type == 4 || _class->type == 2))
11651 {
11652 if(!_class->dataType)
11653 _class->dataType = ProcessTypeString(_class->dataTypeString, 0);
11654 size = type->alignment = ComputeTypeSize(_class->dataType);
11655 }
11656 else
11657 {
11658 size = type->alignment = targetBits / 8;
11659 type->pointerAlignment = 1;
11660 }
11661 break;
11662 }
11663 case 13:
11664 case 19:
11665 size = type->alignment = targetBits / 8;
11666 type->pointerAlignment = 1;
11667 break;
11668 case 12:
11669 if(type->__anon1.__anon4.arraySizeExp)
11670 {
11671 ProcessExpressionType(type->__anon1.__anon4.arraySizeExp);
11672 ComputeExpression(type->__anon1.__anon4.arraySizeExp);
11673 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)))
11674 {
11675 struct Location oldLoc = yylloc;
11676 char expression[10240];
11677
11678 expression[0] = '\0';
11679 type->__anon1.__anon4.arraySizeExp->expType = (((void *)0));
11680 yylloc = type->__anon1.__anon4.arraySizeExp->loc;
11681 if(inCompiler)
11682 PrintExpression(type->__anon1.__anon4.arraySizeExp, expression);
11683 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Array size not constant int (%s)\n", (((void *)0))), expression);
11684 yylloc = oldLoc;
11685 }
11686 GetInt(type->__anon1.__anon4.arraySizeExp, &type->__anon1.__anon4.arraySize);
11687 }
11688 else if(type->__anon1.__anon4.enumClass)
11689 {
11690 if(type->__anon1.__anon4.enumClass && type->__anon1.__anon4.enumClass->__anon1.registered && type->__anon1.__anon4.enumClass->__anon1.registered->type == 4)
11691 {
11692 type->__anon1.__anon4.arraySize = (int)__ecereNameSpace__ecere__com__eClass_GetProperty(type->__anon1.__anon4.enumClass->__anon1.registered, "enumSize");
11693 }
11694 else
11695 type->__anon1.__anon4.arraySize = 0;
11696 }
11697 else
11698 {
11699 type->__anon1.__anon4.arraySize = 0;
11700 }
11701 size = ComputeTypeSize(type->__anon1.type) * type->__anon1.__anon4.arraySize;
11702 if(type->__anon1.type)
11703 {
11704 type->alignment = type->__anon1.type->alignment;
11705 type->pointerAlignment = type->__anon1.type->pointerAlignment;
11706 }
11707 break;
11708 case 9:
11709 {
11710 if(!type->__anon1.__anon1.members.first && type->__anon1.__anon1.enumName)
11711 {
11712 struct Symbol * symbol = FindStruct(curContext, type->__anon1.__anon1.enumName);
11713
11714 if(symbol && symbol->type)
11715 {
11716 ComputeTypeSize(symbol->type);
11717 size = symbol->type->size;
11718 }
11719 }
11720 else
11721 {
11722 struct Type * member;
11723
11724 for(member = type->__anon1.__anon1.members.first; member; member = member->next)
11725 {
11726 int __simpleStruct0, __simpleStruct1;
11727 unsigned int addSize = ComputeTypeSize(member);
11728
11729 member->offset = size;
11730 if(member->alignment && size % member->alignment)
11731 member->offset += member->alignment - (size % member->alignment);
11732 size = member->offset;
11733 if(member->pointerAlignment && type->size <= 4)
11734 type->pointerAlignment = 1;
11735 else if(!member->pointerAlignment && member->alignment >= 8)
11736 type->pointerAlignment = 0;
11737 type->alignment = (__simpleStruct0 = type->alignment, __simpleStruct1 = member->alignment, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
11738 size += addSize;
11739 }
11740 if(type->alignment && size % type->alignment)
11741 size += type->alignment - (size % type->alignment);
11742 }
11743 break;
11744 }
11745 case 10:
11746 {
11747 if(!type->__anon1.__anon1.members.first && type->__anon1.__anon1.enumName)
11748 {
11749 struct Symbol * symbol = FindStruct(curContext, type->__anon1.__anon1.enumName);
11750
11751 if(symbol && symbol->type)
11752 {
11753 ComputeTypeSize(symbol->type);
11754 size = symbol->type->size;
11755 type->alignment = symbol->type->alignment;
11756 }
11757 }
11758 else
11759 {
11760 struct Type * member;
11761
11762 for(member = type->__anon1.__anon1.members.first; member; member = member->next)
11763 {
11764 int __simpleStruct0, __simpleStruct1;
11765 unsigned int addSize = ComputeTypeSize(member);
11766
11767 member->offset = size;
11768 if(member->alignment && size % member->alignment)
11769 member->offset += member->alignment - (size % member->alignment);
11770 size = member->offset;
11771 if(member->pointerAlignment && type->size <= 4)
11772 type->pointerAlignment = 1;
11773 else if(!member->pointerAlignment && member->alignment >= 8)
11774 type->pointerAlignment = 0;
11775 type->alignment = (__simpleStruct0 = type->alignment, __simpleStruct1 = member->alignment, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
11776 size = ((size > addSize) ? size : addSize);
11777 }
11778 if(type->alignment && size % type->alignment)
11779 size += type->alignment - (size % type->alignment);
11780 }
11781 break;
11782 }
11783 case 20:
11784 {
11785 struct TemplateParameter * param = type->__anon1.templateParameter;
11786 struct Type * baseType = ProcessTemplateParameterType(param);
11787
11788 if(baseType)
11789 {
11790 size = ComputeTypeSize(baseType);
11791 type->alignment = baseType->alignment;
11792 type->pointerAlignment = baseType->pointerAlignment;
11793 }
11794 else
11795 type->alignment = size = sizeof(uint64);
11796 break;
11797 }
11798 case 15:
11799 {
11800 type->alignment = size = sizeof(enum
11801 {
11802 test
11803 });
11804 break;
11805 }
11806 case 21:
11807 {
11808 type->alignment = size = targetBits / 8;
11809 type->pointerAlignment = 1;
11810 break;
11811 }
11812 }
11813 type->size = size;
11814 type->computing = 0;
11815 }
11816 return size;
11817 }
11818
11819 unsigned int MatchTypeExpression(struct Expression * sourceExp, struct Type * dest, struct __ecereNameSpace__ecere__sys__OldList * conversions, unsigned int skipUnitBla, unsigned int warnConst)
11820 {
11821 struct Type * source;
11822 struct Type * realDest = dest;
11823 struct Type * backupSourceExpType = (((void *)0));
11824 struct Expression * nbExp = GetNonBracketsExp(sourceExp);
11825 struct Expression * computedExp = nbExp;
11826
11827 dest->refCount++;
11828 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)
11829 {
11830 computedExp = CopyExpression(nbExp);
11831 ComputeExpression(computedExp);
11832 }
11833 source = sourceExp->expType;
11834 if(dest->kind == 13 && sourceExp->type == 2 && !strtoul(sourceExp->__anon1.__anon1.constant, (((void *)0)), 0))
11835 {
11836 if(computedExp != nbExp)
11837 {
11838 FreeExpression(computedExp);
11839 computedExp = nbExp;
11840 }
11841 FreeType(dest);
11842 return 1;
11843 }
11844 if(!skipUnitBla && source && dest && source->kind == 8 && dest->kind == 8)
11845 {
11846 if(source->__anon1._class && source->__anon1._class->__anon1.registered && source->__anon1._class->__anon1.registered->type == 3)
11847 {
11848 struct __ecereNameSpace__ecere__com__Class * sourceBase, * destBase;
11849
11850 for(sourceBase = source->__anon1._class->__anon1.registered; sourceBase && sourceBase->base && sourceBase->base->type != 1000; sourceBase = sourceBase->base)
11851 ;
11852 for(destBase = dest->__anon1._class->__anon1.registered; destBase && destBase->base && destBase->base->type != 1000; destBase = destBase->base)
11853 ;
11854 if(sourceBase == destBase)
11855 {
11856 if(computedExp != nbExp)
11857 {
11858 FreeExpression(computedExp);
11859 computedExp = nbExp;
11860 }
11861 FreeType(dest);
11862 return 1;
11863 }
11864 }
11865 }
11866 if(source)
11867 {
11868 struct __ecereNameSpace__ecere__sys__OldList * specs;
11869 unsigned int flag = 0;
11870 long long value = (((int)0x7fffffff));
11871
11872 source->refCount++;
11873 if(computedExp->type == 2)
11874 {
11875 if(source->isSigned)
11876 value = strtoll(computedExp->__anon1.__anon1.constant, (((void *)0)), 0);
11877 else
11878 value = strtoull(computedExp->__anon1.__anon1.constant, (((void *)0)), 0);
11879 }
11880 else if(computedExp->type == 4 && computedExp->__anon1.op.op == '-' && !computedExp->__anon1.op.exp1 && computedExp->__anon1.op.exp2 && computedExp->__anon1.op.exp2->type == 2)
11881 {
11882 if(source->isSigned)
11883 value = -strtoll(computedExp->__anon1.op.exp2->__anon1.__anon1.constant, (((void *)0)), 0);
11884 else
11885 value = -strtoull(computedExp->__anon1.op.exp2->__anon1.__anon1.constant, (((void *)0)), 0);
11886 }
11887 if(computedExp != nbExp)
11888 {
11889 FreeExpression(computedExp);
11890 computedExp = nbExp;
11891 }
11892 if(dest->kind != 8 && source->kind == 8 && source->__anon1._class && source->__anon1._class->__anon1.registered && !strcmp(source->__anon1._class->__anon1.registered->fullName, "unichar"))
11893 {
11894 FreeType(source);
11895 source = __extension__ ({
11896 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
11897
11898 __ecereInstance1->kind = 3, __ecereInstance1->isSigned = 0, __ecereInstance1->refCount = 1, __ecereInstance1;
11899 });
11900 }
11901 if(dest->kind == 8)
11902 {
11903 struct __ecereNameSpace__ecere__com__Class * _class = dest->__anon1._class ? dest->__anon1._class->__anon1.registered : (((void *)0));
11904
11905 if(_class && _class->type == 3)
11906 {
11907 if(source->kind != 8)
11908 {
11909 struct Type * tempType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
11910 struct Type * tempDest, * tempSource;
11911
11912 for(; _class->base->type != 1000; _class = _class->base)
11913 ;
11914 tempSource = dest;
11915 tempDest = tempType;
11916 tempType->kind = 8;
11917 if(!_class->symbol)
11918 _class->symbol = FindClass(_class->fullName);
11919 tempType->__anon1._class = _class->symbol;
11920 tempType->truth = dest->truth;
11921 if(tempType->__anon1._class)
11922 MatchTypes(tempSource, tempDest, conversions, (((void *)0)), (((void *)0)), 1, 1, 0, 0, warnConst);
11923 backupSourceExpType = sourceExp->expType;
11924 if(dest->passAsTemplate)
11925 {
11926 sourceExp->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
11927 CopyTypeInto(sourceExp->expType, dest);
11928 sourceExp->expType->passAsTemplate = 0;
11929 }
11930 else
11931 {
11932 sourceExp->expType = dest;
11933 dest->refCount++;
11934 }
11935 flag = 1;
11936 ((tempType ? __extension__ ({
11937 void * __ecerePtrToDelete = (tempType);
11938
11939 __ecereClass_Type->Destructor ? __ecereClass_Type->Destructor((void *)__ecerePtrToDelete) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(__ecerePtrToDelete);
11940 }) : 0), tempType = 0);
11941 }
11942 }
11943 if(_class && _class->type == 2 && source->kind != 8)
11944 {
11945 if(!dest->__anon1._class->__anon1.registered->dataType)
11946 dest->__anon1._class->__anon1.registered->dataType = ProcessTypeString(dest->__anon1._class->__anon1.registered->dataTypeString, 0);
11947 if(MatchTypes(source, dest->__anon1._class->__anon1.registered->dataType, conversions, (((void *)0)), (((void *)0)), 1, 1, 0, 0, warnConst))
11948 {
11949 FreeType(source);
11950 FreeType(sourceExp->expType);
11951 source = sourceExp->expType = MkClassType(dest->__anon1._class->string);
11952 source->refCount++;
11953 }
11954 }
11955 if(_class && !strcmp(_class->fullName, "ecere::com::Class") && source->kind == 13 && source->__anon1.type && source->__anon1.type->kind == 1 && sourceExp->type == 3)
11956 {
11957 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
11958 struct Declarator * decl;
11959 char string[1024];
11960
11961 ReadString(string, sourceExp->__anon1.__anon2.string);
11962 decl = SpecDeclFromString(string, specs, (((void *)0)));
11963 FreeExpContents(sourceExp);
11964 FreeType(sourceExp->expType);
11965 sourceExp->type = 24;
11966 sourceExp->__anon1._classExp.specifiers = specs;
11967 sourceExp->__anon1._classExp.decl = decl;
11968 sourceExp->expType = dest;
11969 dest->refCount++;
11970 FreeType(source);
11971 FreeType(dest);
11972 if(backupSourceExpType)
11973 FreeType(backupSourceExpType);
11974 return 1;
11975 }
11976 }
11977 else if(source->kind == 8)
11978 {
11979 struct __ecereNameSpace__ecere__com__Class * _class = source->__anon1._class ? source->__anon1._class->__anon1.registered : (((void *)0));
11980
11981 if(_class && (_class->type == 3 || _class->type == 2))
11982 {
11983 if(dest->kind != 8)
11984 {
11985 struct Type * tempType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
11986 struct Type * tempDest, * tempSource;
11987
11988 if(!source->__anon1._class->__anon1.registered->dataType)
11989 source->__anon1._class->__anon1.registered->dataType = ProcessTypeString(source->__anon1._class->__anon1.registered->dataTypeString, 0);
11990 for(; _class->base->type != 1000; _class = _class->base)
11991 ;
11992 tempDest = source;
11993 tempSource = tempType;
11994 tempType->kind = 8;
11995 tempType->__anon1._class = FindClass(_class->fullName);
11996 tempType->truth = source->truth;
11997 tempType->classObjectType = source->classObjectType;
11998 if(tempType->__anon1._class)
11999 MatchTypes(tempSource, tempDest, conversions, (((void *)0)), (((void *)0)), 1, 1, 0, 0, warnConst);
12000 if(conversions && conversions->last)
12001 {
12002 ((struct Conversion *)conversions->last)->resultType = dest;
12003 dest->refCount++;
12004 modifyPassAsTemplate(&((struct Conversion *)conversions->last)->resultType, 0);
12005 }
12006 FreeType(sourceExp->expType);
12007 sourceExp->expType = MkClassType(_class->fullName);
12008 sourceExp->expType->truth = source->truth;
12009 sourceExp->expType->classObjectType = source->classObjectType;
12010 if(!sourceExp->destType)
12011 {
12012 FreeType(sourceExp->destType);
12013 sourceExp->destType = sourceExp->expType;
12014 if(sourceExp->expType)
12015 sourceExp->expType->refCount++;
12016 }
12017 if(!_class->dataType)
12018 _class->dataType = ProcessTypeString(_class->dataTypeString, 0);
12019 FreeType(dest);
12020 dest = MkClassType(source->__anon1._class->string);
12021 dest->truth = source->truth;
12022 dest->classObjectType = source->classObjectType;
12023 FreeType(source);
12024 source = _class->dataType;
12025 source->refCount++;
12026 ((tempType ? __extension__ ({
12027 void * __ecerePtrToDelete = (tempType);
12028
12029 __ecereClass_Type->Destructor ? __ecereClass_Type->Destructor((void *)__ecerePtrToDelete) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(__ecerePtrToDelete);
12030 }) : 0), tempType = 0);
12031 }
12032 }
12033 }
12034 if(!flag)
12035 {
12036 if(MatchTypes(source, dest, conversions, (((void *)0)), (((void *)0)), 1, 1, 0, 0, warnConst))
12037 {
12038 FreeType(source);
12039 FreeType(dest);
12040 return 1;
12041 }
12042 }
12043 if(dest->kind == 8)
12044 {
12045 struct __ecereNameSpace__ecere__com__Class * _class = dest->__anon1._class ? dest->__anon1._class->__anon1.registered : (((void *)0));
12046 unsigned int fittingValue = 0;
12047
12048 if(_class && _class->type == 4)
12049 {
12050 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
12051 struct __ecereNameSpace__ecere__com__EnumClassData * c = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
12052
12053 if(c && value >= 0 && value <= c->largest)
12054 fittingValue = 1;
12055 }
12056 if(_class && !dest->truth && (_class->type == 3 || fittingValue || (_class->type != 1 && !value && source->kind == 3) || _class->type == 2))
12057 {
12058 if(_class->type == 0 || _class->type == 5)
12059 {
12060 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12061
12062 *newExp = *sourceExp;
12063 if(sourceExp->destType)
12064 sourceExp->destType->refCount++;
12065 if(sourceExp->expType)
12066 sourceExp->expType->refCount++;
12067 sourceExp->type = 11;
12068 sourceExp->__anon1.cast.typeName = MkTypeName(MkListOne(MkSpecifier(VOID)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0))));
12069 sourceExp->__anon1.cast.exp = newExp;
12070 FreeType(sourceExp->expType);
12071 sourceExp->expType = (((void *)0));
12072 ProcessExpressionType(sourceExp);
12073 if(!inCompiler)
12074 {
12075 FreeType(sourceExp->expType);
12076 sourceExp->expType = dest;
12077 }
12078 FreeType(source);
12079 if(inCompiler)
12080 FreeType(dest);
12081 if(backupSourceExpType)
12082 FreeType(backupSourceExpType);
12083 return 1;
12084 }
12085 if(!_class->dataType)
12086 _class->dataType = ProcessTypeString(_class->dataTypeString, 0);
12087 FreeType(dest);
12088 dest = _class->dataType;
12089 dest->refCount++;
12090 }
12091 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))
12092 {
12093 specs = MkListOne(MkSpecifier(DOUBLE));
12094 }
12095 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))
12096 {
12097 specs = MkListOne(MkSpecifier(FLOAT));
12098 }
12099 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))
12100 {
12101 specs = MkList();
12102 if(!dest->isSigned)
12103 ListAdd(specs, MkSpecifier(UNSIGNED));
12104 ListAdd(specs, MkSpecifier(INT64));
12105 }
12106 else if(dest->kind == 3 && (source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 6 || source->kind == 7))
12107 {
12108 specs = MkList();
12109 if(!dest->isSigned)
12110 ListAdd(specs, MkSpecifier(UNSIGNED));
12111 ListAdd(specs, MkSpecifier(INT));
12112 }
12113 else if(dest->kind == 2 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 3 || source->kind == 6 || source->kind == 7))
12114 {
12115 specs = MkList();
12116 if(!dest->isSigned)
12117 ListAdd(specs, MkSpecifier(UNSIGNED));
12118 ListAdd(specs, MkSpecifier(SHORT));
12119 }
12120 else if(dest->kind == 1 && (source->kind == 1 || source->kind == 24 || source->kind == 2 || source->kind == 3 || source->kind == 6 || source->kind == 7))
12121 {
12122 specs = MkList();
12123 if(!dest->isSigned)
12124 ListAdd(specs, MkSpecifier(UNSIGNED));
12125 ListAdd(specs, MkSpecifier(CHAR));
12126 }
12127 else
12128 {
12129 FreeType(source);
12130 FreeType(dest);
12131 if(backupSourceExpType)
12132 {
12133 if(sourceExp->expType)
12134 FreeType(sourceExp->expType);
12135 sourceExp->expType = backupSourceExpType;
12136 }
12137 return 0;
12138 }
12139 }
12140 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))
12141 {
12142 specs = MkListOne(MkSpecifier(DOUBLE));
12143 }
12144 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))
12145 {
12146 specs = MkListOne(MkSpecifier(FLOAT));
12147 }
12148 else if(dest->kind == 24 && (source->kind == 24 || source->kind == 1 || source->kind == 15 || source->kind == 2 || source->kind == 3) && (value == 1 || value == 0))
12149 {
12150 specs = MkList();
12151 ListAdd(specs, MkSpecifier(BOOL));
12152 }
12153 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)))
12154 {
12155 if(source->kind == 3)
12156 {
12157 FreeType(dest);
12158 FreeType(source);
12159 if(backupSourceExpType)
12160 FreeType(backupSourceExpType);
12161 return 1;
12162 }
12163 else
12164 {
12165 specs = MkList();
12166 if(!dest->isSigned)
12167 ListAdd(specs, MkSpecifier(UNSIGNED));
12168 ListAdd(specs, MkSpecifier(CHAR));
12169 }
12170 }
12171 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)))))
12172 {
12173 if(source->kind == 3)
12174 {
12175 FreeType(dest);
12176 FreeType(source);
12177 if(backupSourceExpType)
12178 FreeType(backupSourceExpType);
12179 return 1;
12180 }
12181 else
12182 {
12183 specs = MkList();
12184 if(!dest->isSigned)
12185 ListAdd(specs, MkSpecifier(UNSIGNED));
12186 ListAdd(specs, MkSpecifier(SHORT));
12187 }
12188 }
12189 else if(dest->kind == 3 && (source->kind == 15 || source->kind == 2 || source->kind == 24 || source->kind == 1 || source->kind == 3))
12190 {
12191 specs = MkList();
12192 if(!dest->isSigned)
12193 ListAdd(specs, MkSpecifier(UNSIGNED));
12194 ListAdd(specs, MkSpecifier(INT));
12195 }
12196 else if(dest->kind == 4 && (source->kind == 15 || source->kind == 2 || source->kind == 24 || source->kind == 1 || source->kind == 3 || source->kind == 4))
12197 {
12198 specs = MkList();
12199 if(!dest->isSigned)
12200 ListAdd(specs, MkSpecifier(UNSIGNED));
12201 ListAdd(specs, MkSpecifier(INT64));
12202 }
12203 else if(dest->kind == 15 && (source->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 24 || source->kind == 1))
12204 {
12205 specs = MkListOne(MkEnum(MkIdentifier(dest->__anon1.__anon1.enumName), (((void *)0))));
12206 }
12207 else
12208 {
12209 FreeType(source);
12210 FreeType(dest);
12211 if(backupSourceExpType)
12212 {
12213 if(sourceExp->expType)
12214 FreeType(sourceExp->expType);
12215 sourceExp->expType = backupSourceExpType;
12216 }
12217 return 0;
12218 }
12219 if(!flag && !sourceExp->opDestType)
12220 {
12221 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12222
12223 *newExp = *sourceExp;
12224 newExp->prev = (((void *)0));
12225 newExp->next = (((void *)0));
12226 if(sourceExp->destType)
12227 sourceExp->destType->refCount++;
12228 if(sourceExp->expType)
12229 sourceExp->expType->refCount++;
12230 sourceExp->type = 11;
12231 if(realDest->kind == 8)
12232 {
12233 sourceExp->__anon1.cast.typeName = QMkClass(realDest->__anon1._class->string, (((void *)0)));
12234 FreeList(specs, (void *)(FreeSpecifier));
12235 }
12236 else
12237 sourceExp->__anon1.cast.typeName = MkTypeName(specs, (((void *)0)));
12238 if(newExp->type == 4)
12239 {
12240 sourceExp->__anon1.cast.exp = MkExpBrackets(MkListOne(newExp));
12241 }
12242 else
12243 sourceExp->__anon1.cast.exp = newExp;
12244 FreeType(sourceExp->expType);
12245 sourceExp->expType = (((void *)0));
12246 ProcessExpressionType(sourceExp);
12247 }
12248 else
12249 FreeList(specs, (void *)(FreeSpecifier));
12250 FreeType(dest);
12251 FreeType(source);
12252 if(backupSourceExpType)
12253 FreeType(backupSourceExpType);
12254 return 1;
12255 }
12256 else
12257 {
12258 if(computedExp != nbExp)
12259 {
12260 FreeExpression(computedExp);
12261 computedExp = nbExp;
12262 }
12263 while((sourceExp->type == 5 || sourceExp->type == 32) && sourceExp->__anon1.list)
12264 sourceExp = (*sourceExp->__anon1.list).last;
12265 if(sourceExp->type == 0)
12266 {
12267 struct Identifier * id = sourceExp->__anon1.__anon1.identifier;
12268
12269 if(dest->kind == 8)
12270 {
12271 if(dest->__anon1._class && dest->__anon1._class->__anon1.registered && dest->__anon1._class->__anon1.registered->type == 4)
12272 {
12273 struct __ecereNameSpace__ecere__com__Class * _class = dest->__anon1._class->__anon1.registered;
12274 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
12275
12276 if(enumClass)
12277 {
12278 for(; _class && _class->type == 4; _class = _class->base)
12279 {
12280 struct __ecereNameSpace__ecere__sys__NamedLink64 * value;
12281 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
12282
12283 for(value = e->values.first; value; value = value->next)
12284 {
12285 if(!strcmp(value->name, id->string))
12286 break;
12287 }
12288 if(value)
12289 {
12290 FreeType(sourceExp->expType);
12291 sourceExp->isConstant = 1;
12292 sourceExp->expType = MkClassType(_class->fullName);
12293 if(inCompiler || inPreCompiler || inDebugger)
12294 {
12295 FreeExpContents(sourceExp);
12296 sourceExp->type = 2;
12297 if(_class->dataTypeString && (!strcmp(_class->dataTypeString, "int") || !strcmp(_class->dataTypeString, "int64") || !strcmp(_class->dataTypeString, "short") || !strcmp(_class->dataTypeString, "char")))
12298 sourceExp->__anon1.__anon1.constant = PrintInt64(value->data);
12299 else
12300 sourceExp->__anon1.__anon1.constant = PrintUInt64(value->data);
12301 }
12302 FreeType(dest);
12303 return 1;
12304 }
12305 }
12306 }
12307 }
12308 }
12309 if(dest->classObjectType != 2 && dest->kind == 8 && MatchWithEnums_Module(privateModule, sourceExp, dest, id->string, conversions))
12310 {
12311 FreeType(dest);
12312 return 1;
12313 }
12314 }
12315 FreeType(dest);
12316 }
12317 return 0;
12318 }
12319
12320 static void PopulateInstanceProcessMember(struct Instantiation * inst, struct __ecereNameSpace__ecere__sys__OldList * memberList, struct __ecereNameSpace__ecere__com__DataMember * parentDataMember, unsigned int offset)
12321 {
12322 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
12323
12324 for(dataMember = parentDataMember->members.first; dataMember; dataMember = dataMember->next)
12325 {
12326 if(!dataMember->name && (dataMember->type == 2 || dataMember->type == 1))
12327 PopulateInstanceProcessMember(inst, memberList, dataMember, offset + dataMember->offset);
12328 else
12329 {
12330 struct Expression * exp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12331 struct MemberInit * member = MkMemberInit(MkListOne(MkIdentifier(dataMember->name)), MkInitializerAssignment(exp));
12332 struct Type * type;
12333 void * ptr = inst->data + dataMember->offset + offset;
12334 char * result = (((void *)0));
12335
12336 exp->loc = member->loc = inst->loc;
12337 ((struct Identifier *)(*member->identifiers).first)->loc = inst->loc;
12338 if(!dataMember->dataType)
12339 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0);
12340 type = dataMember->dataType;
12341 if(type->kind == 8)
12342 {
12343 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
12344
12345 if(_class->type == 4)
12346 {
12347 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
12348
12349 if(enumClass)
12350 {
12351 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
12352 struct __ecereNameSpace__ecere__sys__NamedLink64 * item;
12353
12354 for(item = e->values.first; item; item = item->next)
12355 {
12356 if(item->data == GetEnumValue(_class, ptr))
12357 {
12358 result = item->name;
12359 break;
12360 }
12361 }
12362 if(result)
12363 {
12364 exp->__anon1.__anon1.identifier = MkIdentifier(result);
12365 exp->type = 0;
12366 exp->destType = MkClassType(_class->fullName);
12367 ProcessExpressionType(exp);
12368 }
12369 }
12370 }
12371 if(_class->type == 4 || _class->type == 3 || _class->type == 2)
12372 {
12373 if(!_class->dataType)
12374 _class->dataType = ProcessTypeString(_class->dataTypeString, 0);
12375 type = _class->dataType;
12376 }
12377 }
12378 if(!result)
12379 {
12380 switch(type->kind)
12381 {
12382 case 6:
12383 {
12384 FreeExpContents(exp);
12385 exp->__anon1.__anon1.constant = PrintFloat(*(float *)ptr);
12386 exp->type = 2;
12387 break;
12388 }
12389 case 7:
12390 {
12391 FreeExpContents(exp);
12392 exp->__anon1.__anon1.constant = PrintDouble(*(double *)ptr);
12393 exp->type = 2;
12394 break;
12395 }
12396 case 3:
12397 {
12398 FreeExpContents(exp);
12399 exp->__anon1.__anon1.constant = PrintInt(*(int *)ptr);
12400 exp->type = 2;
12401 break;
12402 }
12403 case 4:
12404 {
12405 FreeExpContents(exp);
12406 exp->__anon1.__anon1.constant = PrintInt64(*(long long *)ptr);
12407 exp->type = 2;
12408 break;
12409 }
12410 case 22:
12411 {
12412 FreeExpContents(exp);
12413 exp->__anon1.__anon1.constant = PrintInt64((long long)*(intptr_t *)ptr);
12414 exp->type = 2;
12415 break;
12416 }
12417 case 23:
12418 {
12419 FreeExpContents(exp);
12420 exp->__anon1.__anon1.constant = PrintInt64((long long)*(ssize_t *)ptr);
12421 exp->type = 2;
12422 break;
12423 }
12424 default:
12425 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Unhandled type populating instance\n", (((void *)0))));
12426 }
12427 }
12428 ListAdd(memberList, member);
12429 }
12430 if(parentDataMember->type == 1)
12431 break;
12432 }
12433 }
12434
12435 void CheckTemplateTypes(struct Expression * exp)
12436 {
12437 struct Expression * nbExp = GetNonBracketsExp(exp);
12438
12439 if(exp->destType && exp->destType->passAsTemplate && exp->expType && exp->expType->kind != 20 && !exp->expType->passAsTemplate && (nbExp == exp || nbExp->type != 11))
12440 {
12441 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12442 struct Context * context;
12443 int kind = exp->expType->kind;
12444
12445 *newExp = *exp;
12446 if(exp->destType)
12447 exp->destType->refCount++;
12448 if(exp->expType)
12449 exp->expType->refCount++;
12450 newExp->prev = (((void *)0));
12451 newExp->next = (((void *)0));
12452 if(exp->expType->kind == 8 && exp->expType->__anon1._class && exp->expType->__anon1._class->__anon1.registered)
12453 {
12454 struct __ecereNameSpace__ecere__com__Class * c = exp->expType->__anon1._class->__anon1.registered;
12455
12456 if(c->type == 2 || c->type == 4 || c->type == 3)
12457 {
12458 if(!c->dataType)
12459 c->dataType = ProcessTypeString(c->dataTypeString, 0);
12460 kind = c->dataType->kind;
12461 }
12462 }
12463 switch(kind)
12464 {
12465 case 7:
12466 if(exp->destType->classObjectType)
12467 {
12468 if(exp->destType)
12469 exp->destType->refCount--;
12470 if(exp->expType)
12471 exp->expType->refCount--;
12472 ((newExp ? __extension__ ({
12473 void * __ecerePtrToDelete = (newExp);
12474
12475 __ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)__ecerePtrToDelete) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(__ecerePtrToDelete);
12476 }) : 0), newExp = 0);
12477 }
12478 else
12479 {
12480 struct __ecereNameSpace__ecere__sys__OldList * specs;
12481 struct __ecereNameSpace__ecere__sys__OldList * unionDefs = MkList();
12482 struct __ecereNameSpace__ecere__sys__OldList * statements = MkList();
12483
12484 context = PushContext();
12485 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(DOUBLE)), MkListOne(MkDeclaratorIdentifier(MkIdentifier("d"))), (((void *)0)))));
12486 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifierName("uint64")), MkListOne(MkDeclaratorIdentifier(MkIdentifier("i"))), (((void *)0)))));
12487 specs = MkListOne(MkStructOrUnion(4, (((void *)0)), unionDefs));
12488 exp->type = 23;
12489 modifyPassAsTemplate(&exp->expType, 1);
12490 modifyPassAsTemplate(&newExp->destType, 0);
12491 modifyPassAsTemplate(&newExp->expType, 0);
12492 exp->__anon1.compound = MkCompoundStmt(MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internal_union")), (((void *)0)))))), statements);
12493 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("d")), '=', newExp))));
12494 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("i")))));
12495 exp->__anon1.compound->__anon1.compound.context = context;
12496 PopContext(context);
12497 }
12498 break;
12499 case 6:
12500 if(exp->destType->classObjectType)
12501 {
12502 if(exp->destType)
12503 exp->destType->refCount--;
12504 if(exp->expType)
12505 exp->expType->refCount--;
12506 ((newExp ? __extension__ ({
12507 void * __ecerePtrToDelete = (newExp);
12508
12509 __ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)__ecerePtrToDelete) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(__ecerePtrToDelete);
12510 }) : 0), newExp = 0);
12511 }
12512 else
12513 {
12514 struct __ecereNameSpace__ecere__sys__OldList * specs;
12515 struct __ecereNameSpace__ecere__sys__OldList * unionDefs = MkList();
12516 struct __ecereNameSpace__ecere__sys__OldList * statements = MkList();
12517
12518 context = PushContext();
12519 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(FLOAT)), MkListOne(MkDeclaratorIdentifier(MkIdentifier("f"))), (((void *)0)))));
12520 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifierName("uint64")), MkListOne(MkDeclaratorIdentifier(MkIdentifier("i"))), (((void *)0)))));
12521 specs = MkListOne(MkStructOrUnion(4, (((void *)0)), unionDefs));
12522 exp->type = 23;
12523 exp->__anon1.compound = MkCompoundStmt(MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internal_union")), (((void *)0)))))), statements);
12524 modifyPassAsTemplate(&exp->expType, 1);
12525 modifyPassAsTemplate(&newExp->destType, 0);
12526 modifyPassAsTemplate(&newExp->expType, 0);
12527 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("f")), '=', newExp))));
12528 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("i")))));
12529 exp->__anon1.compound->__anon1.compound.context = context;
12530 PopContext(context);
12531 }
12532 break;
12533 case 0:
12534 break;
12535 default:
12536 exp->type = 11;
12537 exp->__anon1.cast.typeName = MkTypeName(MkListOne(MkSpecifierName("uint64")), (((void *)0)));
12538 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))
12539 exp->__anon1.cast.exp = MkExpCast(MkTypeName(MkListOne(MkSpecifierName("uintptr")), (((void *)0))), MkExpBrackets(MkListOne(newExp)));
12540 else
12541 exp->__anon1.cast.exp = MkExpBrackets(MkListOne(newExp));
12542 exp->needCast = 1;
12543 break;
12544 }
12545 }
12546 else if(exp->expType && exp->expType->passAsTemplate && exp->destType && ((unsigned int)((exp->usage & 0x1) >> 0)) && exp->destType->kind != 20 && !exp->destType->passAsTemplate)
12547 {
12548 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12549 struct Context * context;
12550 int kind = exp->expType->kind;
12551
12552 *newExp = *exp;
12553 if(exp->destType)
12554 exp->destType->refCount++;
12555 if(exp->expType)
12556 exp->expType->refCount++;
12557 newExp->prev = (((void *)0));
12558 newExp->next = (((void *)0));
12559 if(exp->expType->kind == 8 && exp->expType->__anon1._class && exp->expType->__anon1._class->__anon1.registered)
12560 {
12561 struct __ecereNameSpace__ecere__com__Class * c = exp->expType->__anon1._class->__anon1.registered;
12562
12563 if(c->type == 2 || c->type == 4 || c->type == 3)
12564 {
12565 if(!c->dataType)
12566 c->dataType = ProcessTypeString(c->dataTypeString, 0);
12567 kind = c->dataType->kind;
12568 }
12569 }
12570 switch(kind)
12571 {
12572 case 7:
12573 if(exp->destType->classObjectType)
12574 {
12575 if(exp->destType)
12576 exp->destType->refCount--;
12577 if(exp->expType)
12578 exp->expType->refCount--;
12579 ((newExp ? __extension__ ({
12580 void * __ecerePtrToDelete = (newExp);
12581
12582 __ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)__ecerePtrToDelete) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(__ecerePtrToDelete);
12583 }) : 0), newExp = 0);
12584 }
12585 else
12586 {
12587 struct __ecereNameSpace__ecere__sys__OldList * specs;
12588 struct __ecereNameSpace__ecere__sys__OldList * unionDefs = MkList();
12589 struct __ecereNameSpace__ecere__sys__OldList * statements = MkList();
12590
12591 context = PushContext();
12592 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(DOUBLE)), MkListOne(MkDeclaratorIdentifier(MkIdentifier("d"))), (((void *)0)))));
12593 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifierName("uint64")), MkListOne(MkDeclaratorIdentifier(MkIdentifier("i"))), (((void *)0)))));
12594 specs = MkListOne(MkStructOrUnion(4, (((void *)0)), unionDefs));
12595 exp->type = 23;
12596 exp->__anon1.compound = MkCompoundStmt(MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internal_union")), (((void *)0)))))), statements);
12597 modifyPassAsTemplate(&exp->expType, 0);
12598 modifyPassAsTemplate(&newExp->destType, 1);
12599 modifyPassAsTemplate(&newExp->expType, 1);
12600 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("i")), '=', newExp))));
12601 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("d")))));
12602 exp->__anon1.compound->__anon1.compound.context = context;
12603 PopContext(context);
12604 }
12605 break;
12606 case 6:
12607 if(exp->destType->classObjectType)
12608 {
12609 if(exp->destType)
12610 exp->destType->refCount--;
12611 if(exp->expType)
12612 exp->expType->refCount--;
12613 ((newExp ? __extension__ ({
12614 void * __ecerePtrToDelete = (newExp);
12615
12616 __ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)__ecerePtrToDelete) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(__ecerePtrToDelete);
12617 }) : 0), newExp = 0);
12618 }
12619 else
12620 {
12621 struct __ecereNameSpace__ecere__sys__OldList * specs;
12622 struct __ecereNameSpace__ecere__sys__OldList * unionDefs = MkList();
12623 struct __ecereNameSpace__ecere__sys__OldList * statements = MkList();
12624
12625 context = PushContext();
12626 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(FLOAT)), MkListOne(MkDeclaratorIdentifier(MkIdentifier("f"))), (((void *)0)))));
12627 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifierName("uint64")), MkListOne(MkDeclaratorIdentifier(MkIdentifier("i"))), (((void *)0)))));
12628 specs = MkListOne(MkStructOrUnion(4, (((void *)0)), unionDefs));
12629 exp->type = 23;
12630 exp->__anon1.compound = MkCompoundStmt(MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internal_union")), (((void *)0)))))), statements);
12631 modifyPassAsTemplate(&exp->expType, 0);
12632 modifyPassAsTemplate(&newExp->destType, 1);
12633 modifyPassAsTemplate(&newExp->expType, 1);
12634 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("i")), '=', newExp))));
12635 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("f")))));
12636 exp->__anon1.compound->__anon1.compound.context = context;
12637 PopContext(context);
12638 }
12639 break;
12640 case 8:
12641 {
12642 if(exp->expType->__anon1._class && exp->expType->__anon1._class->__anon1.registered && exp->expType->__anon1._class->__anon1.registered->type == 1)
12643 {
12644 exp->type = 5;
12645 newExp = MkExpCast(MkTypeName(MkListOne(MkSpecifierName("uintptr")), (((void *)0))), newExp);
12646 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)));
12647 ProcessExpressionType((*exp->__anon1.list).first);
12648 break;
12649 }
12650 else
12651 {
12652 exp->type = 5;
12653 if(__ecereProp_Type_Get_isPointerType(exp->expType))
12654 {
12655 exp->needTemplateCast = 2;
12656 newExp->needCast = 1;
12657 newExp->needTemplateCast = 2;
12658 newExp = MkExpCast(MkTypeName(MkListOne(MkSpecifierName("uintptr")), (((void *)0))), newExp);
12659 }
12660 exp->__anon1.list = MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName(exp->expType->__anon1._class->string)), (((void *)0))), newExp));
12661 exp->needTemplateCast = 2;
12662 newExp->needCast = 1;
12663 newExp->needTemplateCast = 2;
12664 ProcessExpressionType((*exp->__anon1.list).first);
12665 break;
12666 }
12667 }
12668 default:
12669 {
12670 if(exp->expType->kind == 20)
12671 {
12672 struct Type * type = ProcessTemplateParameterType(exp->expType->__anon1.templateParameter);
12673
12674 if(type)
12675 {
12676 FreeType(exp->destType);
12677 FreeType(exp->expType);
12678 ((newExp ? __extension__ ({
12679 void * __ecerePtrToDelete = (newExp);
12680
12681 __ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)__ecerePtrToDelete) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(__ecerePtrToDelete);
12682 }) : 0), newExp = 0);
12683 break;
12684 }
12685 }
12686 {
12687 char typeString[1024];
12688 struct Declarator * decl;
12689 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
12690
12691 typeString[0] = '\0';
12692 PrintType(exp->expType, typeString, 0, 0);
12693 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
12694 exp->type = 11;
12695 exp->__anon1.cast.typeName = MkTypeName(specs, decl);
12696 exp->__anon1.cast.exp = MkExpBrackets(MkListOne(newExp));
12697 exp->__anon1.cast.exp->needCast = 1;
12698 exp->needTemplateCast = 2;
12699 newExp->needTemplateCast = 2;
12700 }
12701 break;
12702 }
12703 }
12704 }
12705 }
12706
12707 static void ProcessInitializer(struct Initializer * init, struct Type * type)
12708 {
12709 switch(init->type)
12710 {
12711 case 0:
12712 if(!init->__anon1.exp || init->__anon1.exp->type != 1 || !init->__anon1.exp->__anon1.instance || init->__anon1.exp->__anon1.instance->_class || !type || type->kind == 8)
12713 {
12714 if(init->__anon1.exp && !init->__anon1.exp->destType)
12715 {
12716 FreeType(init->__anon1.exp->destType);
12717 init->__anon1.exp->destType = type;
12718 if(type)
12719 type->refCount++;
12720 }
12721 if(init->__anon1.exp)
12722 {
12723 ProcessExpressionType(init->__anon1.exp);
12724 init->isConstant = init->__anon1.exp->isConstant;
12725 }
12726 break;
12727 }
12728 else
12729 {
12730 struct Expression * exp = init->__anon1.exp;
12731 struct Instantiation * inst = exp->__anon1.instance;
12732 struct MembersInit * members;
12733
12734 init->type = 1;
12735 init->__anon1.list = MkList();
12736 if(inst->members)
12737 {
12738 for(members = (*inst->members).first; members; members = members->next)
12739 {
12740 if(members->type == 0)
12741 {
12742 struct MemberInit * member;
12743
12744 for(member = (*members->__anon1.dataMembers).first; member; member = member->next)
12745 {
12746 ListAdd(init->__anon1.list, member->initializer);
12747 member->initializer = (((void *)0));
12748 }
12749 }
12750 }
12751 }
12752 FreeExpression(exp);
12753 }
12754 case 1:
12755 {
12756 struct Initializer * i;
12757 struct Type * initializerType = (((void *)0));
12758 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
12759 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
12760 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
12761 int subMemberStackPos = 0;
12762
12763 if(type && type->kind == 12)
12764 initializerType = Dereference(type);
12765 else if(type && (type->kind == 9 || type->kind == 10))
12766 initializerType = type->__anon1.__anon1.members.first;
12767 for(i = (*init->__anon1.list).first; i; i = i->next)
12768 {
12769 if(type && type->kind == 8 && type->__anon1._class && type->__anon1._class->__anon1.registered)
12770 {
12771 FindNextDataMember(type->__anon1._class->__anon1.registered, &curClass, &curMember, subMemberStack, &subMemberStackPos);
12772 if(curMember)
12773 {
12774 if(!curMember->dataType)
12775 curMember->dataType = ProcessTypeString(curMember->dataTypeString, 0);
12776 initializerType = curMember->dataType;
12777 }
12778 }
12779 ProcessInitializer(i, initializerType);
12780 if(initializerType && type && (type->kind == 9 || type->kind == 10))
12781 initializerType = initializerType->next;
12782 if(!i->isConstant)
12783 init->isConstant = 0;
12784 }
12785 if(type && type->kind == 12)
12786 FreeType(initializerType);
12787 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))
12788 {
12789 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Assigning list initializer to non list\n", (((void *)0))));
12790 }
12791 break;
12792 }
12793 }
12794 }
12795
12796 static unsigned int CheckExpressionType(struct Expression * exp, struct Type * destType, unsigned int skipUnitBla, unsigned int warnConst)
12797 {
12798 unsigned int result = 1;
12799
12800 if(destType)
12801 {
12802 struct __ecereNameSpace__ecere__sys__OldList converts =
12803 {
12804 0, 0, 0, 0, 0
12805 };
12806 struct Conversion * convert;
12807
12808 if(destType->kind == 0)
12809 return 0;
12810 if(!MatchTypeExpression(exp, destType, &converts, skipUnitBla, warnConst))
12811 result = 0;
12812 if(converts.count)
12813 {
12814 for(convert = converts.first; convert; convert = convert->next)
12815 {
12816 unsigned int empty = !(convert->isGet ? (void *)convert->convert->Get : (void *)convert->convert->Set);
12817
12818 if(!empty)
12819 {
12820 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12821 int objectType = exp->expType ? exp->expType->classObjectType : 0;
12822
12823 *newExp = *exp;
12824 newExp->prev = (((void *)0));
12825 newExp->next = (((void *)0));
12826 newExp->destType = (((void *)0));
12827 if(convert->isGet)
12828 {
12829 exp->type = 8;
12830 exp->addedThis = 1;
12831 exp->__anon1.member.exp = newExp;
12832 FreeType(exp->__anon1.member.exp->expType);
12833 exp->__anon1.member.exp->expType = MkClassType(convert->convert->_class->fullName);
12834 exp->__anon1.member.exp->expType->classObjectType = objectType;
12835 exp->__anon1.member.member = MkIdentifier(convert->convert->dataTypeString);
12836 exp->__anon1.member.memberType = 1;
12837 exp->expType = convert->resultType ? convert->resultType : convert->convert->dataType;
12838 exp->needCast = 1;
12839 if(exp->expType)
12840 exp->expType->refCount++;
12841 ApplyAnyObjectLogic(exp->__anon1.member.exp);
12842 }
12843 else
12844 {
12845 {
12846 exp->type = 8;
12847 exp->addedThis = 1;
12848 exp->__anon1.member.exp = newExp;
12849 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)
12850 {
12851 newExp->byReference = 1;
12852 }
12853 FreeType(exp->__anon1.member.exp->expType);
12854 exp->__anon1.member.exp->expType = (((void *)0));
12855 if(convert->convert->dataType)
12856 {
12857 exp->__anon1.member.exp->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
12858 CopyTypeInto(exp->__anon1.member.exp->expType, convert->convert->dataType);
12859 exp->__anon1.member.exp->expType->refCount = 1;
12860 exp->__anon1.member.exp->expType->classObjectType = objectType;
12861 ApplyAnyObjectLogic(exp->__anon1.member.exp);
12862 }
12863 exp->__anon1.member.member = MkIdentifier(convert->convert->_class->fullName);
12864 exp->__anon1.member.memberType = 4;
12865 exp->expType = convert->resultType ? convert->resultType : MkClassType(convert->convert->_class->fullName);
12866 exp->needCast = 1;
12867 if(convert->resultType)
12868 convert->resultType->refCount++;
12869 }
12870 }
12871 }
12872 else
12873 {
12874 FreeType(exp->expType);
12875 if(convert->isGet)
12876 {
12877 exp->expType = convert->resultType ? convert->resultType : convert->convert->dataType;
12878 if(exp->destType->casted)
12879 exp->needCast = 1;
12880 if(exp->expType)
12881 exp->expType->refCount++;
12882 }
12883 else
12884 {
12885 exp->expType = convert->resultType ? convert->resultType : MkClassType(convert->convert->_class->fullName);
12886 if(exp->destType->casted)
12887 exp->needCast = 1;
12888 if(convert->resultType)
12889 convert->resultType->refCount++;
12890 }
12891 }
12892 }
12893 if(exp->isConstant && inCompiler)
12894 ComputeExpression(exp);
12895 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(&converts, (void *)(FreeConvert));
12896 }
12897 if(!result && exp->expType && converts.count)
12898 {
12899 result = MatchTypes(exp->expType, exp->destType, (((void *)0)), (((void *)0)), (((void *)0)), 1, 1, 0, 0, warnConst);
12900 }
12901 if(!result && exp->expType && exp->destType)
12902 {
12903 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))
12904 result = 1;
12905 }
12906 }
12907 return result;
12908 }
12909
12910 void PopulateInstance(struct Instantiation * inst)
12911 {
12912 struct Symbol * classSym = inst->_class->__anon1.__anon1.symbol;
12913 struct __ecereNameSpace__ecere__com__Class * _class = classSym->__anon1.registered;
12914 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
12915 struct __ecereNameSpace__ecere__sys__OldList * memberList = MkList();
12916
12917 if(!inst->members)
12918 inst->members = MkListOne(MkMembersInitList(memberList));
12919 else
12920 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*inst->members), MkMembersInitList(memberList));
12921 for(dataMember = _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
12922 {
12923 if(!dataMember->isProperty)
12924 {
12925 if(!dataMember->name && (dataMember->type == 2 || dataMember->type == 1))
12926 PopulateInstanceProcessMember(inst, memberList, dataMember, dataMember->offset);
12927 else
12928 {
12929 struct Expression * exp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12930 struct MemberInit * member = MkMemberInit(MkListOne(MkIdentifier(dataMember->name)), MkInitializerAssignment(exp));
12931 struct Type * type;
12932 void * ptr = inst->data + dataMember->offset;
12933 char * result = (((void *)0));
12934
12935 exp->loc = member->loc = inst->loc;
12936 ((struct Identifier *)(*member->identifiers).first)->loc = inst->loc;
12937 if(!dataMember->dataType)
12938 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0);
12939 type = dataMember->dataType;
12940 if(type->kind == 8)
12941 {
12942 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
12943
12944 if(_class->type == 4)
12945 {
12946 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
12947
12948 if(enumClass)
12949 {
12950 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
12951 struct __ecereNameSpace__ecere__sys__NamedLink64 * item;
12952
12953 for(item = e->values.first; item; item = item->next)
12954 {
12955 if(item->data == GetEnumValue(_class, ptr))
12956 {
12957 result = item->name;
12958 break;
12959 }
12960 }
12961 }
12962 if(result)
12963 {
12964 exp->__anon1.__anon1.identifier = MkIdentifier(result);
12965 exp->type = 0;
12966 exp->destType = MkClassType(_class->fullName);
12967 ProcessExpressionType(exp);
12968 }
12969 }
12970 if(_class->type == 4 || _class->type == 3 || _class->type == 2)
12971 {
12972 if(!_class->dataType)
12973 _class->dataType = ProcessTypeString(_class->dataTypeString, 0);
12974 type = _class->dataType;
12975 }
12976 }
12977 if(!result)
12978 {
12979 switch(type->kind)
12980 {
12981 case 6:
12982 {
12983 exp->__anon1.__anon1.constant = PrintFloat(*(float *)ptr);
12984 exp->type = 2;
12985 break;
12986 }
12987 case 7:
12988 {
12989 exp->__anon1.__anon1.constant = PrintDouble(*(double *)ptr);
12990 exp->type = 2;
12991 break;
12992 }
12993 case 3:
12994 {
12995 exp->__anon1.__anon1.constant = PrintInt(*(int *)ptr);
12996 exp->type = 2;
12997 break;
12998 }
12999 case 4:
13000 {
13001 exp->__anon1.__anon1.constant = PrintInt64(*(long long *)ptr);
13002 exp->type = 2;
13003 break;
13004 }
13005 case 22:
13006 {
13007 exp->__anon1.__anon1.constant = PrintInt64((long long)*(intptr_t *)ptr);
13008 exp->type = 2;
13009 break;
13010 }
13011 default:
13012 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Unhandled type populating instance\n", (((void *)0))));
13013 }
13014 }
13015 ListAdd(memberList, member);
13016 }
13017 }
13018 }
13019 }
13020
13021 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)
13022 {
13023 struct Identifier * ident = member->identifiers ? (*member->identifiers).first : (((void *)0));
13024 unsigned int found = 0;
13025 struct __ecereNameSpace__ecere__com__DataMember * dataMember = (((void *)0));
13026 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
13027 unsigned int freeType = 0;
13028
13029 yylloc = member->loc;
13030 if(!ident)
13031 {
13032 if(curMember)
13033 {
13034 __ecereNameSpace__ecere__com__eClass_FindNextMember(_class, curClass, curMember, subMemberStack, subMemberStackPos);
13035 if(*curMember)
13036 {
13037 found = 1;
13038 dataMember = *curMember;
13039 }
13040 }
13041 }
13042 else
13043 {
13044 struct __ecereNameSpace__ecere__com__DataMember * thisMember = (struct __ecereNameSpace__ecere__com__DataMember *)__ecereNameSpace__ecere__com__eClass_FindProperty(_class, ident->string, privateModule);
13045 struct __ecereNameSpace__ecere__com__DataMember * _subMemberStack[256];
13046 int _subMemberStackPos = 0;
13047
13048 if(!thisMember)
13049 thisMember = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, ident->string, privateModule, _subMemberStack, &_subMemberStackPos);
13050 if(thisMember)
13051 {
13052 dataMember = thisMember;
13053 if(curMember && thisMember->memberAccess == 1)
13054 {
13055 *curMember = thisMember;
13056 *curClass = thisMember->_class;
13057 memcpy(subMemberStack, _subMemberStack, sizeof(struct __ecereNameSpace__ecere__com__DataMember *) * _subMemberStackPos);
13058 *subMemberStackPos = _subMemberStackPos;
13059 }
13060 found = 1;
13061 }
13062 else
13063 {
13064 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, ident->string, privateModule);
13065 if(method && method->type == 1)
13066 found = 1;
13067 else
13068 method = (((void *)0));
13069 }
13070 }
13071 if(found)
13072 {
13073 struct Type * type = (((void *)0));
13074
13075 if(dataMember)
13076 {
13077 if(!dataMember->dataType && dataMember->dataTypeString)
13078 {
13079 struct Context * context = SetupTemplatesContext(_class);
13080
13081 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0);
13082 FinishTemplatesContext(context);
13083 }
13084 type = dataMember->dataType;
13085 }
13086 else if(method)
13087 {
13088 if(!method->dataType)
13089 ProcessMethodType(method);
13090 type = method->dataType;
13091 }
13092 if(ident && ident->next)
13093 {
13094 for(ident = ident->next; ident && type; ident = ident->next)
13095 {
13096 if(type->kind == 8)
13097 {
13098 dataMember = (struct __ecereNameSpace__ecere__com__DataMember *)__ecereNameSpace__ecere__com__eClass_FindProperty(type->__anon1._class->__anon1.registered, ident->string, privateModule);
13099 if(!dataMember)
13100 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMember(type->__anon1._class->__anon1.registered, ident->string, privateModule, (((void *)0)), (((void *)0)));
13101 if(dataMember)
13102 type = dataMember->dataType;
13103 }
13104 else if(type->kind == 9 || type->kind == 10)
13105 {
13106 struct Type * memberType;
13107
13108 for(memberType = type->__anon1.__anon1.members.first; memberType; memberType = memberType->next)
13109 {
13110 if(!strcmp(memberType->name, ident->string))
13111 {
13112 type = memberType;
13113 break;
13114 }
13115 }
13116 }
13117 }
13118 }
13119 if(type && type->kind == 20 && type->__anon1.templateParameter->type == 0 && _class->templateArgs)
13120 {
13121 int id = 0;
13122 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
13123 struct __ecereNameSpace__ecere__com__Class * sClass;
13124
13125 for(sClass = _class; sClass; sClass = sClass->base)
13126 {
13127 id = 0;
13128 if(sClass->templateClass)
13129 sClass = sClass->templateClass;
13130 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
13131 {
13132 if(curParam->type == 0 && !strcmp(type->__anon1.templateParameter->identifier->string, curParam->name))
13133 {
13134 for(sClass = sClass->base; sClass; sClass = sClass->base)
13135 {
13136 if(sClass->templateClass)
13137 sClass = sClass->templateClass;
13138 id += sClass->templateParams.count;
13139 }
13140 break;
13141 }
13142 id++;
13143 }
13144 if(curParam)
13145 break;
13146 }
13147 if(curParam)
13148 {
13149 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = _class->templateArgs[id];
13150
13151 if(arg.__anon1.__anon1.dataTypeString)
13152 {
13153 unsigned int constant = type->constant;
13154
13155 type = ProcessTypeString(arg.__anon1.__anon1.dataTypeString, 0);
13156 if(type->kind == 8 && constant)
13157 type->constant = 1;
13158 else if(type->kind == 13)
13159 {
13160 struct Type * t = type->__anon1.type;
13161
13162 while(t->kind == 13)
13163 t = t->__anon1.type;
13164 if(constant)
13165 t->constant = constant;
13166 }
13167 freeType = 1;
13168 if(type && _class->templateClass)
13169 type->passAsTemplate = 1;
13170 if(type)
13171 {
13172 }
13173 }
13174 }
13175 }
13176 if(type && type->kind == 8 && type->__anon1._class && type->__anon1._class->__anon1.registered && strchr(type->__anon1._class->__anon1.registered->fullName, '<'))
13177 {
13178 struct __ecereNameSpace__ecere__com__Class * expClass = type->__anon1._class->__anon1.registered;
13179 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
13180 int paramCount = 0;
13181 int lastParam = -1;
13182 char templateString[1024];
13183 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
13184
13185 sprintf(templateString, "%s<", expClass->templateClass->fullName);
13186 for(cClass = expClass; cClass; cClass = cClass->base)
13187 {
13188 int p = 0;
13189
13190 if(cClass->templateClass)
13191 cClass = cClass->templateClass;
13192 for(param = cClass->templateParams.first; param; param = param->next)
13193 {
13194 int id = p;
13195 struct __ecereNameSpace__ecere__com__Class * sClass;
13196 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
13197
13198 for(sClass = cClass->base; sClass; sClass = sClass->base)
13199 {
13200 if(sClass->templateClass)
13201 sClass = sClass->templateClass;
13202 id += sClass->templateParams.count;
13203 }
13204 arg = expClass->templateArgs[id];
13205 for(sClass = _class; sClass; sClass = sClass->base)
13206 {
13207 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * cParam;
13208 int p = 0;
13209 struct __ecereNameSpace__ecere__com__Class * nextClass;
13210
13211 if(sClass->templateClass)
13212 sClass = sClass->templateClass;
13213 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
13214 {
13215 if(nextClass->templateClass)
13216 nextClass = nextClass->templateClass;
13217 p += nextClass->templateParams.count;
13218 }
13219 for(cParam = sClass->templateParams.first; cParam; cParam = cParam->next, p++)
13220 {
13221 if(cParam->type == 0 && arg.__anon1.__anon1.dataTypeString && !strcmp(cParam->name, arg.__anon1.__anon1.dataTypeString))
13222 {
13223 if(_class->templateArgs && arg.__anon1.__anon1.dataTypeString && (!param->defaultArg.__anon1.__anon1.dataTypeString || strcmp(arg.__anon1.__anon1.dataTypeString, param->defaultArg.__anon1.__anon1.dataTypeString)))
13224 {
13225 arg.__anon1.__anon1.dataTypeString = _class->templateArgs[p].__anon1.__anon1.dataTypeString;
13226 arg.__anon1.__anon1.dataTypeClass = _class->templateArgs[p].__anon1.__anon1.dataTypeClass;
13227 break;
13228 }
13229 }
13230 }
13231 }
13232 {
13233 char argument[256];
13234
13235 argument[0] = '\0';
13236 switch(param->type)
13237 {
13238 case 2:
13239 {
13240 char expString[1024];
13241 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13242 struct Declarator * decl = SpecDeclFromString(param->__anon1.dataTypeString, specs, (((void *)0)));
13243 struct Expression * exp;
13244 char * string = PrintHexUInt64(arg.__anon1.expression.__anon1.ui64);
13245
13246 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
13247 (__ecereNameSpace__ecere__com__eSystem_Delete(string), string = 0);
13248 ProcessExpressionType(exp);
13249 ComputeExpression(exp);
13250 expString[0] = '\0';
13251 PrintExpression(exp, expString);
13252 strcat(argument, expString);
13253 FreeExpression(exp);
13254 break;
13255 }
13256 case 1:
13257 {
13258 strcat(argument, arg.__anon1.__anon2.__anon1.member->name);
13259 break;
13260 }
13261 case 0:
13262 {
13263 if(arg.__anon1.__anon1.dataTypeString && (!param->defaultArg.__anon1.__anon1.dataTypeString || strcmp(arg.__anon1.__anon1.dataTypeString, param->defaultArg.__anon1.__anon1.dataTypeString)))
13264 strcat(argument, arg.__anon1.__anon1.dataTypeString);
13265 break;
13266 }
13267 }
13268 if(argument[0])
13269 {
13270 if(paramCount)
13271 strcat(templateString, ", ");
13272 if(lastParam != p - 1)
13273 {
13274 strcat(templateString, param->name);
13275 strcat(templateString, " = ");
13276 }
13277 strcat(templateString, argument);
13278 paramCount++;
13279 lastParam = p;
13280 }
13281 p++;
13282 }
13283 }
13284 }
13285 {
13286 int len = strlen(templateString);
13287
13288 if(templateString[len - 1] == '<')
13289 len--;
13290 else
13291 {
13292 if(templateString[len - 1] == '>')
13293 templateString[len++] = ' ';
13294 templateString[len++] = '>';
13295 }
13296 templateString[len++] = '\0';
13297 }
13298 {
13299 struct Context * context = SetupTemplatesContext(_class);
13300
13301 if(freeType)
13302 FreeType(type);
13303 type = ProcessTypeString(templateString, 0);
13304 freeType = 1;
13305 FinishTemplatesContext(context);
13306 }
13307 }
13308 if(method && member->initializer && member->initializer->type == 0 && member->initializer->__anon1.exp)
13309 {
13310 ProcessExpressionType(member->initializer->__anon1.exp);
13311 if(!member->initializer->__anon1.exp->expType)
13312 {
13313 if(inCompiler)
13314 {
13315 char expString[10240];
13316
13317 expString[0] = '\0';
13318 PrintExpression(member->initializer->__anon1.exp, expString);
13319 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
13320 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved symbol used as an instance method %s\n", (((void *)0))), expString);
13321 }
13322 }
13323 else if(!MatchTypes(member->initializer->__anon1.exp->expType, type, (((void *)0)), (((void *)0)), _class, 1, 1, 0, 0, 1))
13324 {
13325 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible instance method %s\n", (((void *)0))), ident->string);
13326 }
13327 }
13328 else if(member->initializer)
13329 {
13330 ProcessInitializer(member->initializer, type);
13331 }
13332 if(freeType)
13333 FreeType(type);
13334 }
13335 else
13336 {
13337 if(_class && _class->type == 3)
13338 {
13339 if(member->initializer)
13340 {
13341 struct Type * type = MkClassType(_class->fullName);
13342
13343 ProcessInitializer(member->initializer, type);
13344 FreeType(type);
13345 }
13346 }
13347 else
13348 {
13349 if(member->initializer)
13350 {
13351 ProcessInitializer(member->initializer, (((void *)0)));
13352 }
13353 if(ident)
13354 {
13355 if(method)
13356 {
13357 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't find virtual method %s in class %s\n", (((void *)0))), ident->string, _class->fullName);
13358 }
13359 else if(_class)
13360 {
13361 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't find member %s in class %s\n", (((void *)0))), ident->string, _class->fullName);
13362 if(inCompiler)
13363 __ecereNameSpace__ecere__com__eClass_AddDataMember(_class, ident->string, "int", 0, 0, 1);
13364 }
13365 }
13366 else if(_class)
13367 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "too many initializers for instantiation of class %s\n", (((void *)0))), _class->fullName);
13368 }
13369 }
13370 }
13371
13372 void ComputeInstantiation(struct Expression * exp)
13373 {
13374 struct Instantiation * inst = exp->__anon1.instance;
13375 struct MembersInit * members;
13376 struct Symbol * classSym = inst->_class ? inst->_class->__anon1.__anon1.symbol : (((void *)0));
13377 struct __ecereNameSpace__ecere__com__Class * _class = classSym ? classSym->__anon1.registered : (((void *)0));
13378 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
13379 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
13380 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
13381 int subMemberStackPos = 0;
13382 uint64 bits = 0;
13383
13384 if(_class && (_class->type == 1 || _class->type == 0 || _class->type == 5))
13385 {
13386 if(inst->data)
13387 return ;
13388 if(_class->type == 0 || _class->type == 5)
13389 {
13390 inst->data = (unsigned char *)__ecereNameSpace__ecere__com__eInstance_New(_class);
13391 if(_class->type == 0)
13392 ((struct __ecereNameSpace__ecere__com__Instance *)(char *)((struct __ecereNameSpace__ecere__com__Instance *)inst->data))->_refCount++;
13393 }
13394 else
13395 inst->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
13396 }
13397 if(inst->members)
13398 {
13399 for(members = (*inst->members).first; members; members = members->next)
13400 {
13401 switch(members->type)
13402 {
13403 case 0:
13404 {
13405 if(members->__anon1.dataMembers)
13406 {
13407 struct MemberInit * member;
13408
13409 for(member = (*members->__anon1.dataMembers).first; member; member = member->next)
13410 {
13411 struct Identifier * ident = member->identifiers ? (*member->identifiers).first : (((void *)0));
13412 unsigned int found = 0;
13413 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
13414 struct __ecereNameSpace__ecere__com__DataMember * dataMember = (((void *)0));
13415 unsigned int dataMemberOffset;
13416
13417 if(!ident)
13418 {
13419 __ecereNameSpace__ecere__com__eClass_FindNextMember(_class, &curClass, &curMember, subMemberStack, &subMemberStackPos);
13420 if(curMember)
13421 {
13422 if(curMember->isProperty)
13423 prop = (struct __ecereNameSpace__ecere__com__Property *)curMember;
13424 else
13425 {
13426 dataMember = curMember;
13427 __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(_class, dataMember->name, &dataMemberOffset, privateModule, (((void *)0)), (((void *)0)));
13428 if(_class->type == 0)
13429 dataMemberOffset += _class->base->structSize;
13430 }
13431 found = 1;
13432 }
13433 }
13434 else
13435 {
13436 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, ident->string, privateModule);
13437 if(prop)
13438 {
13439 found = 1;
13440 if(prop->memberAccess == 1)
13441 {
13442 curMember = (struct __ecereNameSpace__ecere__com__DataMember *)prop;
13443 curClass = prop->_class;
13444 }
13445 }
13446 else
13447 {
13448 struct __ecereNameSpace__ecere__com__DataMember * _subMemberStack[256];
13449 int _subMemberStackPos = 0;
13450
13451 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(_class, ident->string, &dataMemberOffset, privateModule, _subMemberStack, &_subMemberStackPos);
13452 if(dataMember)
13453 {
13454 found = 1;
13455 if(dataMember->memberAccess == 1)
13456 {
13457 curMember = dataMember;
13458 curClass = dataMember->_class;
13459 memcpy(subMemberStack, _subMemberStack, sizeof(struct __ecereNameSpace__ecere__com__DataMember *) * _subMemberStackPos);
13460 subMemberStackPos = _subMemberStackPos;
13461 }
13462 }
13463 }
13464 }
13465 if(found && member->initializer && member->initializer->type == 0)
13466 {
13467 struct Expression * value = member->initializer->__anon1.exp;
13468 struct Type * type = (((void *)0));
13469 unsigned int deepMember = 0;
13470
13471 if(prop)
13472 {
13473 type = prop->dataType;
13474 }
13475 else if(dataMember)
13476 {
13477 if(!dataMember->dataType)
13478 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0);
13479 type = dataMember->dataType;
13480 }
13481 if(ident && ident->next)
13482 {
13483 deepMember = 1;
13484 for(ident = ident->next; ident && type; ident = ident->next)
13485 {
13486 if(type->kind == 8)
13487 {
13488 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(type->__anon1._class->__anon1.registered, ident->string, privateModule);
13489 if(prop)
13490 type = prop->dataType;
13491 else
13492 {
13493 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(type->__anon1._class->__anon1.registered, ident->string, &dataMemberOffset, privateModule, (((void *)0)), (((void *)0)));
13494 if(dataMember)
13495 type = dataMember->dataType;
13496 }
13497 }
13498 else if(type->kind == 9 || type->kind == 10)
13499 {
13500 struct Type * memberType;
13501
13502 for(memberType = type->__anon1.__anon1.members.first; memberType; memberType = memberType->next)
13503 {
13504 if(!strcmp(memberType->name, ident->string))
13505 {
13506 type = memberType;
13507 break;
13508 }
13509 }
13510 }
13511 }
13512 }
13513 if(value)
13514 {
13515 FreeType(value->destType);
13516 value->destType = type;
13517 if(type)
13518 type->refCount++;
13519 ComputeExpression(value);
13520 }
13521 if(!deepMember && type && value && (_class->type == 1 || _class->type == 0 || _class->type == 5))
13522 {
13523 if(type->kind == 8)
13524 {
13525 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
13526
13527 if(_class && (_class->type == 2 || _class->type == 3 || _class->type == 4))
13528 {
13529 if(!_class->dataType)
13530 _class->dataType = ProcessTypeString(_class->dataTypeString, 0);
13531 type = _class->dataType;
13532 }
13533 }
13534 if(dataMember)
13535 {
13536 void * ptr = inst->data + dataMemberOffset;
13537
13538 if(value->type == 2)
13539 {
13540 switch(type->kind)
13541 {
13542 case 3:
13543 {
13544 GetInt(value, (int *)ptr);
13545 break;
13546 }
13547 case 4:
13548 {
13549 GetInt64(value, (long long *)ptr);
13550 break;
13551 }
13552 case 22:
13553 {
13554 GetIntPtr(value, (intptr_t *)ptr);
13555 break;
13556 }
13557 case 23:
13558 {
13559 GetIntSize(value, (ssize_t *)ptr);
13560 break;
13561 }
13562 case 6:
13563 {
13564 GetFloat(value, (float *)ptr);
13565 break;
13566 }
13567 case 7:
13568 {
13569 GetDouble(value, (double *)ptr);
13570 break;
13571 }
13572 }
13573 }
13574 else if(value->type == 1)
13575 {
13576 if(type->kind == 8)
13577 {
13578 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
13579
13580 if(_class->type == 1)
13581 {
13582 ComputeTypeSize(type);
13583 if(value->__anon1.instance->data)
13584 memcpy(ptr, value->__anon1.instance->data, type->size);
13585 }
13586 }
13587 }
13588 }
13589 else if(prop && prop->Set != (void *)(intptr_t)1)
13590 {
13591 if(value->type == 1 && value->__anon1.instance->data)
13592 {
13593 if(type->kind == 8)
13594 {
13595 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
13596
13597 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)))
13598 {
13599 void (* Set)(void *, void *) = (void *)prop->Set;
13600
13601 Set(inst->data, value->__anon1.instance->data);
13602 PopulateInstance(inst);
13603 }
13604 }
13605 }
13606 else if(value->type == 2)
13607 {
13608 switch(type->kind)
13609 {
13610 case 7:
13611 {
13612 void (* Set)(void *, double) = (void *)prop->Set;
13613
13614 Set(inst->data, strtod(value->__anon1.__anon1.constant, (((void *)0))));
13615 break;
13616 }
13617 case 6:
13618 {
13619 void (* Set)(void *, float) = (void *)prop->Set;
13620
13621 Set(inst->data, (float)(strtod(value->__anon1.__anon1.constant, (((void *)0)))));
13622 break;
13623 }
13624 case 3:
13625 {
13626 void (* Set)(void *, int) = (void *)prop->Set;
13627
13628 Set(inst->data, strtol(value->__anon1.__anon1.constant, (((void *)0)), 0));
13629 break;
13630 }
13631 case 4:
13632 {
13633 void (* Set)(void *, long long) = (void *)prop->Set;
13634
13635 Set(inst->data, __ecereNameSpace__ecere__com___strtoi64(value->__anon1.__anon1.constant, (((void *)0)), 0));
13636 break;
13637 }
13638 case 22:
13639 {
13640 void (* Set)(void *, intptr_t) = (void *)prop->Set;
13641
13642 Set(inst->data, (intptr_t)__ecereNameSpace__ecere__com___strtoi64(value->__anon1.__anon1.constant, (((void *)0)), 0));
13643 break;
13644 }
13645 case 23:
13646 {
13647 void (* Set)(void *, ssize_t) = (void *)prop->Set;
13648
13649 Set(inst->data, (ssize_t)__ecereNameSpace__ecere__com___strtoi64(value->__anon1.__anon1.constant, (((void *)0)), 0));
13650 break;
13651 }
13652 }
13653 }
13654 else if(value->type == 3)
13655 {
13656 char temp[1024];
13657
13658 ReadString(temp, value->__anon1.__anon2.string);
13659 ((void (*)(void *, void *))(void *)prop->Set)(inst->data, temp);
13660 }
13661 }
13662 }
13663 else if(!deepMember && type && _class->type == 3)
13664 {
13665 if(prop)
13666 {
13667 if(value->type == 2)
13668 {
13669 if(type->kind == 8)
13670 {
13671 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
13672
13673 if(_class->type == 3)
13674 {
13675 if(!_class->dataType)
13676 _class->dataType = ProcessTypeString(_class->dataTypeString, 0);
13677 type = _class->dataType;
13678 }
13679 }
13680 switch(type->kind)
13681 {
13682 case 6:
13683 {
13684 float fValue;
13685 float (* Set)(float) = (void *)prop->Set;
13686
13687 GetFloat(member->initializer->__anon1.exp, &fValue);
13688 exp->__anon1.__anon1.constant = PrintFloat(Set(fValue));
13689 exp->type = 2;
13690 break;
13691 }
13692 case 7:
13693 {
13694 double dValue;
13695 double (* Set)(double) = (void *)prop->Set;
13696
13697 GetDouble(member->initializer->__anon1.exp, &dValue);
13698 exp->__anon1.__anon1.constant = PrintDouble(Set(dValue));
13699 exp->type = 2;
13700 break;
13701 }
13702 }
13703 }
13704 }
13705 }
13706 else if(!deepMember && type && _class->type == 2)
13707 {
13708 if(prop)
13709 {
13710 if(value->type == 1 && value->__anon1.instance->data)
13711 {
13712 unsigned int (* Set)(void *) = (void *)prop->Set;
13713
13714 bits = Set(value->__anon1.instance->data);
13715 }
13716 else if(value->type == 2)
13717 {
13718 }
13719 }
13720 else if(dataMember)
13721 {
13722 struct __ecereNameSpace__ecere__com__BitMember * bitMember = (struct __ecereNameSpace__ecere__com__BitMember *)dataMember;
13723 struct Type * type;
13724 uint64 part = 0;
13725
13726 bits = (bits & ~bitMember->mask);
13727 if(!bitMember->dataType)
13728 bitMember->dataType = ProcessTypeString(bitMember->dataTypeString, 0);
13729 type = bitMember->dataType;
13730 if(type->kind == 8 && type->__anon1._class && type->__anon1._class->__anon1.registered)
13731 {
13732 if(!type->__anon1._class->__anon1.registered->dataType)
13733 type->__anon1._class->__anon1.registered->dataType = ProcessTypeString(type->__anon1._class->__anon1.registered->dataTypeString, 0);
13734 type = type->__anon1._class->__anon1.registered->dataType;
13735 }
13736 switch(type->kind)
13737 {
13738 case 24:
13739 case 1:
13740 {
13741 unsigned char v;
13742
13743 type->isSigned ? GetChar(value, (char *)&v) : GetUChar(value, &v);
13744 part = (uint64)v;
13745 break;
13746 }
13747 case 2:
13748 {
13749 unsigned short v;
13750
13751 type->isSigned ? GetShort(value, (short *)&v) : GetUShort(value, &v);
13752 part = (uint64)v;
13753 break;
13754 }
13755 case 3:
13756 case 5:
13757 {
13758 unsigned int v;
13759
13760 type->isSigned ? GetInt(value, (int *)&v) : GetUInt(value, &v);
13761 part = (uint64)v;
13762 break;
13763 }
13764 case 4:
13765 {
13766 uint64 v;
13767
13768 type->isSigned ? GetInt64(value, (long long *)&v) : GetUInt64(value, &v);
13769 part = v;
13770 break;
13771 }
13772 case 22:
13773 {
13774 uintptr_t v;
13775
13776 type->isSigned ? GetIntPtr(value, (intptr_t *)&v) : GetUIntPtr(value, &v);
13777 part = (uint64)v;
13778 break;
13779 }
13780 case 23:
13781 {
13782 size_t v;
13783
13784 type->isSigned ? GetIntSize(value, (ssize_t *)&v) : GetUIntSize(value, &v);
13785 part = (uint64)v;
13786 break;
13787 }
13788 }
13789 bits |= part << bitMember->pos;
13790 }
13791 }
13792 }
13793 else
13794 {
13795 if(_class && _class->type == 3)
13796 {
13797 ComputeExpression(member->initializer->__anon1.exp);
13798 exp->__anon1.__anon1.constant = member->initializer->__anon1.exp->__anon1.__anon1.constant;
13799 exp->type = 2;
13800 member->initializer->__anon1.exp->__anon1.__anon1.constant = (((void *)0));
13801 }
13802 }
13803 }
13804 }
13805 break;
13806 }
13807 }
13808 }
13809 }
13810 if(_class && _class->type == 2)
13811 {
13812 exp->__anon1.__anon1.constant = PrintHexUInt(bits);
13813 exp->type = 2;
13814 }
13815 if(exp->type != 1)
13816 {
13817 FreeInstance(inst);
13818 }
13819 }
13820
13821 void ComputeExpression(struct Expression * exp)
13822 {
13823 switch(exp->type)
13824 {
13825 case 0:
13826 {
13827 struct Identifier * id = exp->__anon1.__anon1.identifier;
13828
13829 if(id && exp->isConstant && !inCompiler && !inPreCompiler && !inDebugger)
13830 {
13831 struct __ecereNameSpace__ecere__com__Class * c = (exp->expType && exp->expType->kind == 8 && exp->expType->__anon1._class) ? exp->expType->__anon1._class->__anon1.registered : (((void *)0));
13832
13833 if(c && c->type == 4)
13834 {
13835 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
13836
13837 if(enumClass)
13838 {
13839 struct __ecereNameSpace__ecere__sys__NamedLink64 * value;
13840 struct __ecereNameSpace__ecere__com__EnumClassData * e = (c ? ((void *)(((char *)c->data) + enumClass->offsetClass)) : (((void *)0)));
13841
13842 for(value = e->values.first; value; value = value->next)
13843 {
13844 if(!strcmp(value->name, id->string))
13845 break;
13846 }
13847 if(value)
13848 {
13849 const char * dts = c->dataTypeString;
13850
13851 FreeExpContents(exp);
13852 exp->type = 2;
13853 exp->__anon1.__anon1.constant = (dts && (!strcmp(dts, "int") || !strcmp(dts, "int64") || !strcmp(dts, "short") || !strcmp(dts, "char"))) ? PrintInt64(value->data) : PrintUInt64(value->data);
13854 }
13855 }
13856 }
13857 }
13858 break;
13859 }
13860 case 1:
13861 {
13862 ComputeInstantiation(exp);
13863 break;
13864 }
13865 case 4:
13866 {
13867 struct Expression * exp1, * exp2 = (((void *)0));
13868 struct Operand op1 =
13869 {
13870 0, 0, 0,
13871 .__anon1 = {
13872 .c = 0
13873 },
13874 {
13875 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
13876 }
13877 };
13878 struct Operand op2 =
13879 {
13880 0, 0, 0,
13881 .__anon1 = {
13882 .c = 0
13883 },
13884 {
13885 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
13886 }
13887 };
13888
13889 if(exp->__anon1.op.exp2)
13890 {
13891 struct Expression * e = exp->__anon1.op.exp2;
13892
13893 while((e->type == 5 || e->type == 32 || e->type == 23) && e->__anon1.list)
13894 {
13895 if(e->type == 5 || e->type == 32 || e->type == 23)
13896 {
13897 if(e->type == 23)
13898 e = (*((struct Statement *)(*e->__anon1.compound->__anon1.compound.statements).last)->__anon1.expressions).last;
13899 else
13900 e = (*e->__anon1.list).last;
13901 }
13902 }
13903 if(exp->__anon1.op.op == 261 && e && e->expType)
13904 {
13905 if(e->type == 3 && e->__anon1.__anon2.string)
13906 {
13907 char * string = e->__anon1.__anon2.string;
13908 int len = strlen(string);
13909 char * tmp = __ecereNameSpace__ecere__com__eSystem_New(sizeof(char) * (len - 2 + 1));
13910
13911 len = UnescapeString(tmp, string + 1, len - 2);
13912 (__ecereNameSpace__ecere__com__eSystem_Delete(tmp), tmp = 0);
13913 FreeExpContents(exp);
13914 exp->type = 2;
13915 exp->__anon1.__anon1.constant = PrintUInt(len + 1);
13916 }
13917 else
13918 {
13919 struct Type * type = e->expType;
13920
13921 type->refCount++;
13922 FreeExpContents(exp);
13923 exp->type = 2;
13924 exp->__anon1.__anon1.constant = PrintUInt(ComputeTypeSize(type));
13925 FreeType(type);
13926 }
13927 break;
13928 }
13929 else
13930 ComputeExpression(exp->__anon1.op.exp2);
13931 }
13932 if(exp->__anon1.op.exp1)
13933 {
13934 ComputeExpression(exp->__anon1.op.exp1);
13935 exp1 = exp->__anon1.op.exp1;
13936 exp2 = exp->__anon1.op.exp2;
13937 op1 = GetOperand(exp1);
13938 if(op1.type)
13939 op1.type->refCount++;
13940 if(exp2)
13941 {
13942 op2 = GetOperand(exp2);
13943 if(op2.type)
13944 op2.type->refCount++;
13945 }
13946 }
13947 else
13948 {
13949 exp1 = exp->__anon1.op.exp2;
13950 op1 = GetOperand(exp1);
13951 if(op1.type)
13952 op1.type->refCount++;
13953 }
13954 CallOperator(exp, exp1, exp2, &op1, &op2);
13955 if(op1.type)
13956 FreeType(op1.type);
13957 if(op2.type)
13958 FreeType(op2.type);
13959 break;
13960 }
13961 case 5:
13962 case 32:
13963 {
13964 struct Expression * e, * n;
13965
13966 for(e = (*exp->__anon1.list).first; e; e = n)
13967 {
13968 n = e->next;
13969 if(!n)
13970 {
13971 struct __ecereNameSpace__ecere__sys__OldList * list = exp->__anon1.list;
13972 struct Expression * prev = exp->prev;
13973 struct Expression * next = exp->next;
13974
13975 if(exp->expType && exp->expType->kind == 8 && (!e->expType || e->expType->kind != 8))
13976 {
13977 FreeType(e->expType);
13978 e->expType = exp->expType;
13979 e->expType->refCount++;
13980 }
13981 ComputeExpression(e);
13982 FreeType(exp->expType);
13983 FreeType(exp->destType);
13984 *exp = *e;
13985 exp->prev = prev;
13986 exp->next = next;
13987 ((e ? __extension__ ({
13988 void * __ecerePtrToDelete = (e);
13989
13990 __ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)__ecerePtrToDelete) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(__ecerePtrToDelete);
13991 }) : 0), e = 0);
13992 (__ecereNameSpace__ecere__com__eSystem_Delete(list), list = 0);
13993 }
13994 else
13995 {
13996 FreeExpression(e);
13997 }
13998 }
13999 break;
14000 }
14001 case 8:
14002 {
14003 struct Expression * memberExp = exp->__anon1.member.exp;
14004 struct Identifier * memberID = exp->__anon1.member.member;
14005 struct Type * type;
14006
14007 ComputeExpression(exp->__anon1.member.exp);
14008 type = exp->__anon1.member.exp->expType;
14009 if(type)
14010 {
14011 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)));
14012 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
14013 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
14014 struct __ecereNameSpace__ecere__com__Class * convertTo = (((void *)0));
14015
14016 if(type->kind == 19 && exp->__anon1.member.exp->type == 24)
14017 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "ecere::com::Class");
14018 if(!_class)
14019 {
14020 char string[256];
14021 struct Symbol * classSym;
14022
14023 string[0] = '\0';
14024 PrintTypeNoConst(type, string, 0, 1);
14025 classSym = FindClass(string);
14026 _class = classSym ? classSym->__anon1.registered : (((void *)0));
14027 }
14028 if(exp->__anon1.member.member)
14029 {
14030 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, exp->__anon1.member.member->string, privateModule);
14031 if(!prop)
14032 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, exp->__anon1.member.member->string, privateModule, (((void *)0)), (((void *)0)));
14033 }
14034 if(!prop && !member && _class && exp->__anon1.member.member)
14035 {
14036 struct Symbol * classSym = FindClass(exp->__anon1.member.member->string);
14037
14038 convertTo = _class;
14039 _class = classSym ? classSym->__anon1.registered : (((void *)0));
14040 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, convertTo->fullName, privateModule);
14041 }
14042 if(prop)
14043 {
14044 if(prop->compiled)
14045 {
14046 struct Type * type = prop->dataType;
14047
14048 if(_class->type == 3)
14049 {
14050 if(type->kind == 8)
14051 {
14052 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
14053
14054 if(_class->type == 3)
14055 {
14056 if(!_class->dataType)
14057 _class->dataType = ProcessTypeString(_class->dataTypeString, 0);
14058 type = _class->dataType;
14059 }
14060 }
14061 switch(type->kind)
14062 {
14063 case 6:
14064 {
14065 float value;
14066 float (* Get)(float) = (void *)prop->Get;
14067
14068 GetFloat(exp->__anon1.member.exp, &value);
14069 exp->__anon1.__anon1.constant = PrintFloat(Get ? Get(value) : value);
14070 exp->type = 2;
14071 break;
14072 }
14073 case 7:
14074 {
14075 double value;
14076 double (* Get)(double);
14077
14078 GetDouble(exp->__anon1.member.exp, &value);
14079 if(convertTo)
14080 Get = (void *)prop->Set;
14081 else
14082 Get = (void *)prop->Get;
14083 exp->__anon1.__anon1.constant = PrintDouble(Get ? Get(value) : value);
14084 exp->type = 2;
14085 break;
14086 }
14087 }
14088 }
14089 else
14090 {
14091 if(convertTo)
14092 {
14093 struct Expression * value = exp->__anon1.member.exp;
14094 struct Type * type;
14095
14096 if(!prop->dataType)
14097 ProcessPropertyType(prop);
14098 type = prop->dataType;
14099 if(!type)
14100 {
14101 }
14102 else if(_class->type == 1)
14103 {
14104 switch(type->kind)
14105 {
14106 case 8:
14107 {
14108 struct __ecereNameSpace__ecere__com__Class * propertyClass = type->__anon1._class->__anon1.registered;
14109
14110 if(propertyClass->type == 1 && value->type == 1)
14111 {
14112 void (* Set)(void *, void *) = (void *)prop->Set;
14113
14114 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
14115 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
14116 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
14117 exp->__anon1.instance->loc = exp->loc;
14118 exp->type = 1;
14119 Set(exp->__anon1.instance->data, value->__anon1.instance->data);
14120 PopulateInstance(exp->__anon1.instance);
14121 }
14122 break;
14123 }
14124 case 3:
14125 {
14126 int intValue;
14127 void (* Set)(void *, int) = (void *)prop->Set;
14128
14129 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
14130 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
14131 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
14132 exp->__anon1.instance->loc = exp->loc;
14133 exp->type = 1;
14134 GetInt(value, &intValue);
14135 Set(exp->__anon1.instance->data, intValue);
14136 PopulateInstance(exp->__anon1.instance);
14137 break;
14138 }
14139 case 4:
14140 {
14141 long long intValue;
14142 void (* Set)(void *, long long) = (void *)prop->Set;
14143
14144 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
14145 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
14146 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
14147 exp->__anon1.instance->loc = exp->loc;
14148 exp->type = 1;
14149 GetInt64(value, &intValue);
14150 Set(exp->__anon1.instance->data, intValue);
14151 PopulateInstance(exp->__anon1.instance);
14152 break;
14153 }
14154 case 22:
14155 {
14156 intptr_t intValue;
14157 void (* Set)(void *, intptr_t) = (void *)prop->Set;
14158
14159 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
14160 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
14161 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
14162 exp->__anon1.instance->loc = exp->loc;
14163 exp->type = 1;
14164 GetIntPtr(value, &intValue);
14165 Set(exp->__anon1.instance->data, intValue);
14166 PopulateInstance(exp->__anon1.instance);
14167 break;
14168 }
14169 case 23:
14170 {
14171 ssize_t intValue;
14172 void (* Set)(void *, ssize_t) = (void *)prop->Set;
14173
14174 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
14175 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
14176 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
14177 exp->__anon1.instance->loc = exp->loc;
14178 exp->type = 1;
14179 GetIntSize(value, &intValue);
14180 Set(exp->__anon1.instance->data, intValue);
14181 PopulateInstance(exp->__anon1.instance);
14182 break;
14183 }
14184 case 6:
14185 {
14186 float floatValue;
14187 void (* Set)(void *, float) = (void *)prop->Set;
14188
14189 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
14190 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
14191 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
14192 exp->__anon1.instance->loc = exp->loc;
14193 exp->type = 1;
14194 GetFloat(value, &floatValue);
14195 Set(exp->__anon1.instance->data, floatValue);
14196 PopulateInstance(exp->__anon1.instance);
14197 break;
14198 }
14199 case 7:
14200 {
14201 double doubleValue;
14202 void (* Set)(void *, double) = (void *)prop->Set;
14203
14204 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
14205 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
14206 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
14207 exp->__anon1.instance->loc = exp->loc;
14208 exp->type = 1;
14209 GetDouble(value, &doubleValue);
14210 Set(exp->__anon1.instance->data, doubleValue);
14211 PopulateInstance(exp->__anon1.instance);
14212 break;
14213 }
14214 }
14215 }
14216 else if(_class->type == 2)
14217 {
14218 switch(type->kind)
14219 {
14220 case 8:
14221 {
14222 struct __ecereNameSpace__ecere__com__Class * propertyClass = type->__anon1._class->__anon1.registered;
14223
14224 if(propertyClass->type == 1 && value->__anon1.instance->data)
14225 {
14226 unsigned int (* Set)(void *) = (void *)prop->Set;
14227 unsigned int bits = Set(value->__anon1.instance->data);
14228
14229 exp->__anon1.__anon1.constant = PrintHexUInt(bits);
14230 exp->type = 2;
14231 break;
14232 }
14233 else if(_class->type == 2)
14234 {
14235 unsigned int value;
14236 unsigned int (* Set)(unsigned int) = (void *)prop->Set;
14237 unsigned int bits;
14238
14239 GetUInt(exp->__anon1.member.exp, &value);
14240 bits = Set(value);
14241 exp->__anon1.__anon1.constant = PrintHexUInt(bits);
14242 exp->type = 2;
14243 }
14244 }
14245 }
14246 }
14247 }
14248 else
14249 {
14250 if(_class->type == 2)
14251 {
14252 unsigned int value;
14253
14254 GetUInt(exp->__anon1.member.exp, &value);
14255 switch(type->kind)
14256 {
14257 case 8:
14258 {
14259 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
14260
14261 if(_class->type == 1)
14262 {
14263 void (* Get)(unsigned int, void *) = (void *)prop->Get;
14264
14265 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
14266 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
14267 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
14268 exp->__anon1.instance->loc = exp->loc;
14269 exp->type = 1;
14270 Get(value, exp->__anon1.instance->data);
14271 PopulateInstance(exp->__anon1.instance);
14272 }
14273 else if(_class->type == 2)
14274 {
14275 unsigned int (* Get)(unsigned int) = (void *)prop->Get;
14276 uint64 bits = Get(value);
14277
14278 exp->__anon1.__anon1.constant = PrintHexUInt64(bits);
14279 exp->type = 2;
14280 }
14281 break;
14282 }
14283 }
14284 }
14285 else if(_class->type == 1)
14286 {
14287 unsigned char * value = (exp->__anon1.member.exp->type == 1) ? exp->__anon1.member.exp->__anon1.instance->data : (((void *)0));
14288
14289 switch(type->kind)
14290 {
14291 case 8:
14292 {
14293 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
14294
14295 if(_class->type == 1 && value)
14296 {
14297 void (* Get)(void *, void *) = (void *)prop->Get;
14298
14299 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
14300 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
14301 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
14302 exp->__anon1.instance->loc = exp->loc;
14303 exp->type = 1;
14304 Get(value, exp->__anon1.instance->data);
14305 PopulateInstance(exp->__anon1.instance);
14306 }
14307 break;
14308 }
14309 }
14310 }
14311 }
14312 }
14313 }
14314 else
14315 {
14316 exp->isConstant = 0;
14317 }
14318 }
14319 else if(member)
14320 {
14321 }
14322 }
14323 if(exp->type != 8)
14324 {
14325 FreeExpression(memberExp);
14326 FreeIdentifier(memberID);
14327 }
14328 break;
14329 }
14330 case 10:
14331 {
14332 struct Type * type = ProcessType(exp->__anon1.typeName->qualifiers, exp->__anon1.typeName->declarator);
14333
14334 FreeExpContents(exp);
14335 exp->__anon1.__anon1.constant = PrintUInt(ComputeTypeSize(type));
14336 exp->type = 2;
14337 FreeType(type);
14338 break;
14339 }
14340 case 15:
14341 {
14342 struct Symbol * classSym = exp->__anon1._class->__anon1.__anon1.symbol;
14343
14344 if(classSym && classSym->__anon1.registered)
14345 {
14346 if(classSym->__anon1.registered->fixed)
14347 {
14348 FreeSpecifier(exp->__anon1._class);
14349 exp->__anon1.__anon1.constant = PrintUInt(classSym->__anon1.registered->templateClass ? classSym->__anon1.registered->templateClass->structSize : classSym->__anon1.registered->structSize);
14350 exp->type = 2;
14351 }
14352 else
14353 {
14354 char className[1024];
14355
14356 strcpy(className, "__ecereClass_");
14357 FullClassNameCat(className, classSym->string, 1);
14358 DeclareClass(curExternal, classSym, className);
14359 FreeExpContents(exp);
14360 exp->type = 9;
14361 exp->__anon1.member.exp = MkExpIdentifier(MkIdentifier(className));
14362 exp->__anon1.member.member = MkIdentifier("structSize");
14363 }
14364 }
14365 break;
14366 }
14367 case 11:
14368 {
14369 struct Type * type;
14370 struct Expression * e = exp;
14371
14372 if(exp->type == 11)
14373 {
14374 if(exp->__anon1.cast.exp)
14375 ComputeExpression(exp->__anon1.cast.exp);
14376 e = exp->__anon1.cast.exp;
14377 }
14378 if(e && exp->expType)
14379 {
14380 type = exp->expType;
14381 if(type->kind == 8)
14382 {
14383 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
14384
14385 if(_class && (_class->type == 3 || _class->type == 2))
14386 {
14387 if(!_class->dataType)
14388 _class->dataType = ProcessTypeString(_class->dataTypeString, 0);
14389 type = _class->dataType;
14390 }
14391 }
14392 switch(type->kind)
14393 {
14394 case 24:
14395 case 1:
14396 if(type->isSigned)
14397 {
14398 char value = 0;
14399
14400 if(GetChar(e, &value))
14401 {
14402 FreeExpContents(exp);
14403 exp->__anon1.__anon1.constant = PrintChar(value);
14404 exp->type = 2;
14405 }
14406 }
14407 else
14408 {
14409 unsigned char value = 0;
14410
14411 if(GetUChar(e, &value))
14412 {
14413 FreeExpContents(exp);
14414 exp->__anon1.__anon1.constant = PrintUChar(value);
14415 exp->type = 2;
14416 }
14417 }
14418 break;
14419 case 2:
14420 if(type->isSigned)
14421 {
14422 short value = 0;
14423
14424 if(GetShort(e, &value))
14425 {
14426 FreeExpContents(exp);
14427 exp->__anon1.__anon1.constant = PrintShort(value);
14428 exp->type = 2;
14429 }
14430 }
14431 else
14432 {
14433 unsigned short value = 0;
14434
14435 if(GetUShort(e, &value))
14436 {
14437 FreeExpContents(exp);
14438 exp->__anon1.__anon1.constant = PrintUShort(value);
14439 exp->type = 2;
14440 }
14441 }
14442 break;
14443 case 3:
14444 if(type->isSigned)
14445 {
14446 int value = 0;
14447
14448 if(GetInt(e, &value))
14449 {
14450 FreeExpContents(exp);
14451 exp->__anon1.__anon1.constant = PrintInt(value);
14452 exp->type = 2;
14453 }
14454 }
14455 else
14456 {
14457 unsigned int value = 0;
14458
14459 if(GetUInt(e, &value))
14460 {
14461 FreeExpContents(exp);
14462 exp->__anon1.__anon1.constant = PrintUInt(value);
14463 exp->type = 2;
14464 }
14465 }
14466 break;
14467 case 4:
14468 if(type->isSigned)
14469 {
14470 long long value = 0;
14471
14472 if(GetInt64(e, &value))
14473 {
14474 FreeExpContents(exp);
14475 exp->__anon1.__anon1.constant = PrintInt64(value);
14476 exp->type = 2;
14477 }
14478 }
14479 else
14480 {
14481 uint64 value = 0;
14482
14483 if(GetUInt64(e, &value))
14484 {
14485 FreeExpContents(exp);
14486 exp->__anon1.__anon1.constant = PrintUInt64(value);
14487 exp->type = 2;
14488 }
14489 }
14490 break;
14491 case 22:
14492 if(type->isSigned)
14493 {
14494 intptr_t value = 0;
14495
14496 if(GetIntPtr(e, &value))
14497 {
14498 FreeExpContents(exp);
14499 exp->__anon1.__anon1.constant = PrintInt64((long long)value);
14500 exp->type = 2;
14501 }
14502 }
14503 else
14504 {
14505 uintptr_t value = 0;
14506
14507 if(GetUIntPtr(e, &value))
14508 {
14509 FreeExpContents(exp);
14510 exp->__anon1.__anon1.constant = PrintUInt64((uint64)value);
14511 exp->type = 2;
14512 }
14513 }
14514 break;
14515 case 23:
14516 if(type->isSigned)
14517 {
14518 ssize_t value = 0;
14519
14520 if(GetIntSize(e, &value))
14521 {
14522 FreeExpContents(exp);
14523 exp->__anon1.__anon1.constant = PrintInt64((long long)value);
14524 exp->type = 2;
14525 }
14526 }
14527 else
14528 {
14529 size_t value = 0;
14530
14531 if(GetUIntSize(e, &value))
14532 {
14533 FreeExpContents(exp);
14534 exp->__anon1.__anon1.constant = PrintUInt64((uint64)value);
14535 exp->type = 2;
14536 }
14537 }
14538 break;
14539 case 6:
14540 {
14541 float value = 0;
14542
14543 if(GetFloat(e, &value))
14544 {
14545 FreeExpContents(exp);
14546 exp->__anon1.__anon1.constant = PrintFloat(value);
14547 exp->type = 2;
14548 }
14549 break;
14550 }
14551 case 7:
14552 {
14553 double value = 0;
14554
14555 if(GetDouble(e, &value))
14556 {
14557 FreeExpContents(exp);
14558 exp->__anon1.__anon1.constant = PrintDouble(value);
14559 exp->type = 2;
14560 }
14561 break;
14562 }
14563 }
14564 }
14565 break;
14566 }
14567 case 12:
14568 {
14569 struct Operand op1 =
14570 {
14571 0, 0, 0,
14572 .__anon1 = {
14573 .c = 0
14574 },
14575 {
14576 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
14577 }
14578 };
14579 struct Operand op2 =
14580 {
14581 0, 0, 0,
14582 .__anon1 = {
14583 .c = 0
14584 },
14585 {
14586 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
14587 }
14588 };
14589 struct Operand op3 =
14590 {
14591 0, 0, 0,
14592 .__anon1 = {
14593 .c = 0
14594 },
14595 {
14596 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
14597 }
14598 };
14599
14600 if(exp->__anon1.cond.exp)
14601 ComputeExpression((*exp->__anon1.cond.exp).last);
14602 if(exp->__anon1.cond.elseExp)
14603 ComputeExpression(exp->__anon1.cond.elseExp);
14604 if(exp->__anon1.cond.cond)
14605 ComputeExpression(exp->__anon1.cond.cond);
14606 op1 = GetOperand(exp->__anon1.cond.cond);
14607 if(op1.type)
14608 op1.type->refCount++;
14609 op2 = GetOperand((*exp->__anon1.cond.exp).last);
14610 if(op2.type)
14611 op2.type->refCount++;
14612 op3 = GetOperand(exp->__anon1.cond.elseExp);
14613 if(op3.type)
14614 op3.type->refCount++;
14615 if(op1.ops.Cond)
14616 {
14617 FreeExpContents(exp);
14618 op1.ops.Cond(exp, &op1, &op2, &op3);
14619 }
14620 if(op1.type)
14621 FreeType(op1.type);
14622 if(op2.type)
14623 FreeType(op2.type);
14624 if(op3.type)
14625 FreeType(op3.type);
14626 break;
14627 }
14628 }
14629 }
14630
14631 static void ProcessFunction(struct FunctionDefinition *  function);
14632
14633 void ProcessInstantiationType(struct Instantiation * inst)
14634 {
14635 yylloc = inst->loc;
14636 if(inst->_class)
14637 {
14638 struct MembersInit * members;
14639 struct Symbol * classSym;
14640 struct __ecereNameSpace__ecere__com__Class * _class;
14641
14642 classSym = inst->_class->__anon1.__anon1.symbol;
14643 _class = classSym ? classSym->__anon1.registered : (((void *)0));
14644 if(!_class || _class->type != 5)
14645 DeclareStruct(curExternal, inst->_class->__anon1.__anon1.name, 0, 1);
14646 afterExternal = afterExternal ? afterExternal : curExternal;
14647 if(inst->exp)
14648 ProcessExpressionType(inst->exp);
14649 inst->isConstant = 1;
14650 if(inst->members)
14651 {
14652 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
14653 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
14654 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
14655 int subMemberStackPos = 0;
14656
14657 for(members = (*inst->members).first; members; members = members->next)
14658 {
14659 switch(members->type)
14660 {
14661 case 1:
14662 {
14663 char name[1024];
14664 static unsigned int instMethodID = 0;
14665 struct External * external = curExternal;
14666 struct Context * context = curContext;
14667 struct Declarator * declarator = members->__anon1.function->declarator;
14668 struct Identifier * nameID = GetDeclId(declarator);
14669 char * unmangled = nameID ? nameID->string : (((void *)0));
14670 struct Expression * exp;
14671 struct External * createdExternal = (((void *)0));
14672
14673 if(inCompiler)
14674 {
14675 char number[16];
14676
14677 strcpy(name, "__ecereInstMeth_");
14678 FullClassNameCat(name, _class ? _class->fullName : "_UNKNOWNCLASS", 0);
14679 strcat(name, "_");
14680 strcat(name, nameID->string);
14681 strcat(name, "_");
14682 sprintf(number, "_%08d", instMethodID++);
14683 strcat(name, number);
14684 nameID->string = __ecereNameSpace__ecere__sys__CopyString(name);
14685 }
14686 if(declarator)
14687 {
14688 struct Symbol * symbol = declarator->symbol;
14689 struct __ecereNameSpace__ecere__com__Method * method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, unmangled, privateModule);
14690
14691 if(method && method->type == 1)
14692 {
14693 symbol->__anon1.method = method;
14694 ProcessMethodType(method);
14695 if(!symbol->type->__anon1.__anon2.thisClass)
14696 {
14697 if(method->dataType->__anon1.__anon2.thisClass && currentClass && __ecereNameSpace__ecere__com__eClass_IsDerived(currentClass, method->dataType->__anon1.__anon2.thisClass->__anon1.registered))
14698 {
14699 if(!currentClass->symbol)
14700 currentClass->symbol = FindClass(currentClass->fullName);
14701 symbol->type->__anon1.__anon2.thisClass = currentClass->symbol;
14702 }
14703 else
14704 {
14705 if(!_class->symbol)
14706 _class->symbol = FindClass(_class->fullName);
14707 symbol->type->__anon1.__anon2.thisClass = _class->symbol;
14708 }
14709 }
14710 DeclareType(curExternal, symbol->type, 1, 1);
14711 }
14712 else if(classSym)
14713 {
14714 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't find virtual method %s in class %s\n", (((void *)0))), unmangled, classSym->string);
14715 }
14716 }
14717 createdExternal = ProcessClassFunction(classSym ? classSym->__anon1.registered : (((void *)0)), members->__anon1.function, ast, afterExternal, 1);
14718 if(nameID)
14719 {
14720 FreeSpecifier(nameID->_class);
14721 nameID->_class = (((void *)0));
14722 }
14723 curExternal = createdExternal;
14724 if(inCompiler)
14725 {
14726 if(createdExternal->__anon1.function)
14727 ProcessFunction(createdExternal->__anon1.function);
14728 }
14729 else if(declarator)
14730 {
14731 curExternal = declarator->symbol->__anon2.__anon1.pointerExternal;
14732 ProcessFunction((struct FunctionDefinition *)members->__anon1.function);
14733 }
14734 curExternal = external;
14735 curContext = context;
14736 if(inCompiler)
14737 {
14738 FreeClassFunction(members->__anon1.function);
14739 exp = QMkExpId(name);
14740 members->type = 0;
14741 members->__anon1.dataMembers = MkListOne(MkMemberInit(MkListOne(MkIdentifier(unmangled)), MkInitializerAssignment(exp)));
14742 (__ecereNameSpace__ecere__com__eSystem_Delete(unmangled), unmangled = 0);
14743 }
14744 break;
14745 }
14746 case 0:
14747 {
14748 if(members->__anon1.dataMembers && classSym)
14749 {
14750 struct MemberInit * member;
14751 struct Location oldyyloc = yylloc;
14752
14753 for(member = (*members->__anon1.dataMembers).first; member; member = member->next)
14754 {
14755 ProcessMemberInitData(member, classSym->__anon1.registered, &curClass, &curMember, subMemberStack, &subMemberStackPos);
14756 if(member->initializer && !member->initializer->isConstant)
14757 inst->isConstant = 0;
14758 }
14759 yylloc = oldyyloc;
14760 }
14761 break;
14762 }
14763 }
14764 }
14765 }
14766 }
14767 }
14768
14769 static void ProcessClass(struct __ecereNameSpace__ecere__sys__OldList *  definitions, struct Symbol *  symbol);
14770
14771 static void ProcessSpecifier(struct Specifier * spec, unsigned int declareStruct, unsigned int warnClasses)
14772 {
14773 switch(spec->type)
14774 {
14775 case 0:
14776 {
14777 if(spec->__anon1.specifier == THISCLASS)
14778 {
14779 if(thisClass)
14780 {
14781 spec->type = 1;
14782 spec->__anon1.__anon1.name = ReplaceThisClass(thisClass);
14783 spec->__anon1.__anon1.symbol = FindClass(spec->__anon1.__anon1.name);
14784 ProcessSpecifier(spec, declareStruct, 0);
14785 }
14786 }
14787 break;
14788 }
14789 case 1:
14790 {
14791 struct Symbol * symbol = FindType(curContext, spec->__anon1.__anon1.name);
14792
14793 if(symbol)
14794 DeclareType(curExternal, symbol->type, 1, 1);
14795 else if(spec->__anon1.__anon1.symbol)
14796 {
14797 struct __ecereNameSpace__ecere__com__Class * c = spec->__anon1.__anon1.symbol->__anon1.registered;
14798
14799 if(warnClasses && !c)
14800 Compiler_Warning("Undeclared class %s\n", spec->__anon1.__anon1.name);
14801 DeclareStruct(curExternal, spec->__anon1.__anon1.name, c && c->type == 5, declareStruct && c && c->type == 1);
14802 }
14803 break;
14804 }
14805 case 2:
14806 {
14807 struct Enumerator * e;
14808
14809 if(spec->__anon1.__anon2.list)
14810 {
14811 for(e = (*spec->__anon1.__anon2.list).first; e; e = e->next)
14812 {
14813 if(e->exp)
14814 ProcessExpressionType(e->exp);
14815 }
14816 }
14817 if(inCompiler)
14818 break;
14819 }
14820 case 3:
14821 case 4:
14822 {
14823 if(spec->__anon1.__anon2.definitions)
14824 {
14825 struct Symbol * symbol = spec->__anon1.__anon2.id ? FindClass(spec->__anon1.__anon2.id->string) : (((void *)0));
14826
14827 ProcessClass(spec->__anon1.__anon2.definitions, symbol);
14828 }
14829 break;
14830 }
14831 }
14832 }
14833
14834 static void ProcessDeclarator(struct Declarator * decl, unsigned int isFunction)
14835 {
14836 switch(decl->type)
14837 {
14838 case 1:
14839 if(decl->__anon1.identifier->classSym)
14840 {
14841 FreeSpecifier(decl->__anon1.identifier->_class);
14842 decl->__anon1.identifier->_class = (((void *)0));
14843 }
14844 break;
14845 case 3:
14846 if(decl->__anon1.array.exp)
14847 ProcessExpressionType(decl->__anon1.array.exp);
14848 case 0:
14849 case 2:
14850 case 4:
14851 case 5:
14852 case 6:
14853 case 7:
14854 {
14855 struct Identifier * id = (((void *)0));
14856 struct Specifier * classSpec = (((void *)0));
14857
14858 if(decl->type == 4)
14859 {
14860 id = GetDeclId(decl);
14861 if(id && id->_class)
14862 {
14863 classSpec = id->_class;
14864 id->_class = (((void *)0));
14865 }
14866 }
14867 if(decl->declarator)
14868 ProcessDeclarator(decl->declarator, isFunction);
14869 if(decl->type == 4)
14870 {
14871 if(classSpec)
14872 {
14873 struct TypeName * param = (param = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TypeName), param->qualifiers = MkListOne(classSpec), param->declarator = (((void *)0)), param);
14874
14875 if(!decl->__anon1.function.parameters)
14876 decl->__anon1.function.parameters = MkList();
14877 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*decl->__anon1.function.parameters), (((void *)0)), param);
14878 }
14879 if(decl->__anon1.function.parameters)
14880 {
14881 struct TypeName * param;
14882
14883 for(param = (*decl->__anon1.function.parameters).first; param; param = param->next)
14884 {
14885 if(param->qualifiers)
14886 {
14887 struct Specifier * spec;
14888
14889 for(spec = (*param->qualifiers).first; spec; spec = spec->next)
14890 {
14891 if(spec->type == 0)
14892 {
14893 if(spec->__anon1.specifier == TYPED_OBJECT)
14894 {
14895 struct Declarator * d = param->declarator;
14896 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);
14897
14898 if(!d || d->type != 5)
14899 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*newParam->qualifiers), (((void *)0)), MkSpecifier(CONST));
14900 FreeList(param->qualifiers, (void *)(FreeSpecifier));
14901 param->qualifiers = MkListOne(MkStructOrUnion(3, MkIdentifier("__ecereNameSpace__ecere__com__Class"), (((void *)0))));
14902 param->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier("class")));
14903 DeclareStruct(curExternal, "ecere::com::Class", 0, 1);
14904 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*decl->__anon1.function.parameters), param, newParam);
14905 param = newParam;
14906 break;
14907 }
14908 else if(spec->__anon1.specifier == ANY_OBJECT)
14909 {
14910 struct Declarator * d = param->declarator;
14911
14912 FreeList(param->qualifiers, (void *)(FreeSpecifier));
14913 param->qualifiers = MkListOne(MkSpecifier(VOID));
14914 if(!d || d->type != 5)
14915 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*param->qualifiers), (((void *)0)), MkSpecifier(CONST));
14916 param->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d);
14917 break;
14918 }
14919 else if(spec->__anon1.specifier == THISCLASS)
14920 {
14921 if(thisClass)
14922 {
14923 spec->type = 1;
14924 spec->__anon1.__anon1.name = ReplaceThisClass(thisClass);
14925 spec->__anon1.__anon1.symbol = FindClass(spec->__anon1.__anon1.name);
14926 ProcessSpecifier(spec, 0, 0);
14927 }
14928 break;
14929 }
14930 }
14931 else if(spec->type == 1)
14932 {
14933 ProcessSpecifier(spec, isFunction, 1);
14934 }
14935 else if((spec->type == 3 || spec->type == 4) && !spec->__anon1.__anon2.definitions && spec->__anon1.__anon2.id && spec->__anon1.__anon2.id->string)
14936 {
14937 struct Declarator * d = param->declarator;
14938
14939 if(!d || d->type != 5)
14940 DeclareStruct(curExternal, spec->__anon1.__anon2.id->string, 0, 1);
14941 }
14942 }
14943 }
14944 if(param->declarator)
14945 ProcessDeclarator(param->declarator, 0);
14946 }
14947 }
14948 }
14949 break;
14950 }
14951 }
14952 }
14953
14954 static void ProcessDeclaration(struct Declaration * decl, unsigned int warnClasses)
14955 {
14956 yylloc = decl->loc;
14957 switch(decl->type)
14958 {
14959 case 1:
14960 {
14961 unsigned int declareStruct = 0;
14962
14963 if(decl->__anon1.__anon1.declarators)
14964 {
14965 struct InitDeclarator * d;
14966
14967 for(d = (*decl->__anon1.__anon1.declarators).first; d; d = d->next)
14968 {
14969 struct Type * type, * subType;
14970
14971 ProcessDeclarator(d->declarator, 0);
14972 type = ProcessType(decl->__anon1.__anon1.specifiers, d->declarator);
14973 if(d->initializer)
14974 {
14975 ProcessInitializer(d->initializer, type);
14976 if((*decl->__anon1.__anon1.declarators).count == 1 && d->initializer->type == 0 && d->initializer->__anon1.exp->type == 1)
14977 {
14978 if(type->kind == 8 && type->__anon1._class == d->initializer->__anon1.exp->expType->__anon1._class)
14979 {
14980 struct Instantiation * inst = d->initializer->__anon1.exp->__anon1.instance;
14981
14982 inst->exp = MkExpIdentifier(CopyIdentifier(GetDeclId(d->declarator)));
14983 d->initializer->__anon1.exp->__anon1.instance = (((void *)0));
14984 if(decl->__anon1.__anon1.specifiers)
14985 FreeList(decl->__anon1.__anon1.specifiers, (void *)(FreeSpecifier));
14986 FreeList(decl->__anon1.__anon1.declarators, (void *)(FreeInitDeclarator));
14987 d = (((void *)0));
14988 decl->type = 2;
14989 decl->__anon1.inst = inst;
14990 }
14991 }
14992 }
14993 for(subType = type; subType; )
14994 {
14995 if(subType->kind == 8)
14996 {
14997 declareStruct = 1;
14998 break;
14999 }
15000 else if(subType->kind == 13)
15001 break;
15002 else if(subType->kind == 12)
15003 subType = subType->__anon1.__anon4.arrayType;
15004 else
15005 break;
15006 }
15007 FreeType(type);
15008 if(!d)
15009 break;
15010 }
15011 }
15012 if(decl->__anon1.__anon1.specifiers)
15013 {
15014 struct Specifier * s;
15015
15016 for(s = (*decl->__anon1.__anon1.specifiers).first; s; s = s->next)
15017 {
15018 ProcessSpecifier(s, declareStruct, 1);
15019 }
15020 }
15021 break;
15022 }
15023 case 2:
15024 {
15025 ProcessInstantiationType(decl->__anon1.inst);
15026 break;
15027 }
15028 case 0:
15029 {
15030 struct Specifier * spec;
15031 struct Declarator * d;
15032 unsigned int declareStruct = 0;
15033
15034 if(decl->__anon1.__anon1.declarators)
15035 {
15036 for(d = (*decl->__anon1.__anon1.declarators).first; d; d = d->next)
15037 {
15038 struct Type * type = ProcessType(decl->__anon1.__anon1.specifiers, d->declarator);
15039 struct Type * subType;
15040
15041 ProcessDeclarator(d, 0);
15042 for(subType = type; subType; )
15043 {
15044 if(subType->kind == 8)
15045 {
15046 declareStruct = 1;
15047 break;
15048 }
15049 else if(subType->kind == 13)
15050 break;
15051 else if(subType->kind == 12)
15052 subType = subType->__anon1.__anon4.arrayType;
15053 else
15054 break;
15055 }
15056 FreeType(type);
15057 }
15058 }
15059 if(decl->__anon1.__anon1.specifiers)
15060 {
15061 for(spec = (*decl->__anon1.__anon1.specifiers).first; spec; spec = spec->next)
15062 ProcessSpecifier(spec, declareStruct, warnClasses);
15063 }
15064 break;
15065 }
15066 }
15067 }
15068
15069 static void ProcessStatement(struct Statement * stmt)
15070 {
15071 yylloc = stmt->loc;
15072 switch(stmt->type)
15073 {
15074 case 0:
15075 ProcessStatement(stmt->__anon1.labeled.stmt);
15076 break;
15077 case 1:
15078 if(stmt->__anon1.caseStmt.exp)
15079 {
15080 FreeType(stmt->__anon1.caseStmt.exp->destType);
15081 stmt->__anon1.caseStmt.exp->destType = curSwitchType;
15082 if(curSwitchType)
15083 curSwitchType->refCount++;
15084 ProcessExpressionType(stmt->__anon1.caseStmt.exp);
15085 ComputeExpression(stmt->__anon1.caseStmt.exp);
15086 }
15087 if(stmt->__anon1.caseStmt.stmt)
15088 ProcessStatement(stmt->__anon1.caseStmt.stmt);
15089 break;
15090 case 2:
15091 {
15092 if(stmt->__anon1.compound.context)
15093 {
15094 struct Declaration * decl;
15095 struct Statement * s;
15096 struct Statement * prevCompound = curCompound;
15097 struct Context * prevContext = curContext;
15098
15099 if(!stmt->__anon1.compound.isSwitch)
15100 curCompound = stmt;
15101 curContext = stmt->__anon1.compound.context;
15102 if(stmt->__anon1.compound.declarations)
15103 {
15104 for(decl = (*stmt->__anon1.compound.declarations).first; decl; decl = decl->next)
15105 ProcessDeclaration(decl, 1);
15106 }
15107 if(stmt->__anon1.compound.statements)
15108 {
15109 for(s = (*stmt->__anon1.compound.statements).first; s; s = s->next)
15110 ProcessStatement(s);
15111 }
15112 curContext = prevContext;
15113 curCompound = prevCompound;
15114 }
15115 break;
15116 }
15117 case 3:
15118 {
15119 struct Expression * exp;
15120
15121 if(stmt->__anon1.expressions)
15122 {
15123 for(exp = (*stmt->__anon1.expressions).first; exp; exp = exp->next)
15124 ProcessExpressionType(exp);
15125 }
15126 break;
15127 }
15128 case 4:
15129 {
15130 struct Expression * exp;
15131
15132 FreeType(((struct Expression *)(*stmt->__anon1.ifStmt.exp).last)->destType);
15133 ((struct Expression *)(*stmt->__anon1.ifStmt.exp).last)->destType = MkClassType("bool");
15134 ((struct Expression *)(*stmt->__anon1.ifStmt.exp).last)->destType->truth = 1;
15135 for(exp = (*stmt->__anon1.ifStmt.exp).first; exp; exp = exp->next)
15136 {
15137 ProcessExpressionType(exp);
15138 }
15139 if(stmt->__anon1.ifStmt.stmt)
15140 ProcessStatement(stmt->__anon1.ifStmt.stmt);
15141 if(stmt->__anon1.ifStmt.elseStmt)
15142 ProcessStatement(stmt->__anon1.ifStmt.elseStmt);
15143 break;
15144 }
15145 case 5:
15146 {
15147 struct Type * oldSwitchType = curSwitchType;
15148
15149 if(stmt->__anon1.switchStmt.exp)
15150 {
15151 struct Expression * exp;
15152
15153 for(exp = (*stmt->__anon1.switchStmt.exp).first; exp; exp = exp->next)
15154 {
15155 if(!exp->next)
15156 {
15157 ProcessExpressionType(exp);
15158 }
15159 if(!exp->next)
15160 curSwitchType = exp->expType;
15161 }
15162 }
15163 ProcessStatement(stmt->__anon1.switchStmt.stmt);
15164 curSwitchType = oldSwitchType;
15165 break;
15166 }
15167 case 6:
15168 {
15169 if(stmt->__anon1.whileStmt.exp)
15170 {
15171 struct Expression * exp;
15172
15173 FreeType(((struct Expression *)(*stmt->__anon1.whileStmt.exp).last)->destType);
15174 ((struct Expression *)(*stmt->__anon1.whileStmt.exp).last)->destType = MkClassType("bool");
15175 ((struct Expression *)(*stmt->__anon1.whileStmt.exp).last)->destType->truth = 1;
15176 for(exp = (*stmt->__anon1.whileStmt.exp).first; exp; exp = exp->next)
15177 {
15178 ProcessExpressionType(exp);
15179 }
15180 }
15181 if(stmt->__anon1.whileStmt.stmt)
15182 ProcessStatement(stmt->__anon1.whileStmt.stmt);
15183 break;
15184 }
15185 case 7:
15186 {
15187 if(stmt->__anon1.doWhile.exp)
15188 {
15189 struct Expression * exp;
15190
15191 if((*stmt->__anon1.doWhile.exp).last)
15192 {
15193 FreeType(((struct Expression *)(*stmt->__anon1.doWhile.exp).last)->destType);
15194 ((struct Expression *)(*stmt->__anon1.doWhile.exp).last)->destType = MkClassType("bool");
15195 ((struct Expression *)(*stmt->__anon1.doWhile.exp).last)->destType->truth = 1;
15196 }
15197 for(exp = (*stmt->__anon1.doWhile.exp).first; exp; exp = exp->next)
15198 {
15199 ProcessExpressionType(exp);
15200 }
15201 }
15202 if(stmt->__anon1.doWhile.stmt)
15203 ProcessStatement(stmt->__anon1.doWhile.stmt);
15204 break;
15205 }
15206 case 8:
15207 {
15208 struct Expression * exp;
15209
15210 if(stmt->__anon1.forStmt.init)
15211 ProcessStatement(stmt->__anon1.forStmt.init);
15212 if(stmt->__anon1.forStmt.check && stmt->__anon1.forStmt.check->__anon1.expressions)
15213 {
15214 FreeType(((struct Expression *)(*stmt->__anon1.forStmt.check->__anon1.expressions).last)->destType);
15215 ((struct Expression *)(*stmt->__anon1.forStmt.check->__anon1.expressions).last)->destType = MkClassType("bool");
15216 ((struct Expression *)(*stmt->__anon1.forStmt.check->__anon1.expressions).last)->destType->truth = 1;
15217 }
15218 if(stmt->__anon1.forStmt.check)
15219 ProcessStatement(stmt->__anon1.forStmt.check);
15220 if(stmt->__anon1.forStmt.increment)
15221 {
15222 for(exp = (*stmt->__anon1.forStmt.increment).first; exp; exp = exp->next)
15223 ProcessExpressionType(exp);
15224 }
15225 if(stmt->__anon1.forStmt.stmt)
15226 ProcessStatement(stmt->__anon1.forStmt.stmt);
15227 break;
15228 }
15229 case 18:
15230 {
15231 struct Identifier * id = stmt->__anon1.forEachStmt.id;
15232 struct __ecereNameSpace__ecere__sys__OldList * exp = stmt->__anon1.forEachStmt.exp;
15233 struct __ecereNameSpace__ecere__sys__OldList * filter = stmt->__anon1.forEachStmt.filter;
15234 struct Statement * block = stmt->__anon1.forEachStmt.stmt;
15235 char iteratorType[1024];
15236 struct Type * source;
15237 struct Expression * e;
15238 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));
15239 struct Expression * arrayExp;
15240 const char * typeString = (((void *)0));
15241 int builtinCount = 0;
15242
15243 for(e = exp ? (*exp).first : (((void *)0)); e; e = e->next)
15244 {
15245 if(!e->next)
15246 {
15247 FreeType(e->destType);
15248 e->destType = ProcessTypeString("Container", 0);
15249 }
15250 if(!isBuiltin || e->next)
15251 ProcessExpressionType(e);
15252 }
15253 source = (exp && (*exp).last) ? ((struct Expression *)(*exp).last)->expType : (((void *)0));
15254 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)))
15255 {
15256 struct __ecereNameSpace__ecere__com__Class * _class = source ? source->__anon1._class->__anon1.registered : (((void *)0));
15257 struct Symbol * symbol;
15258 struct Expression * expIt = (((void *)0));
15259 unsigned int isMap = 0, isArray = 0, isLinkList = 0, isList = 0, isCustomAVLTree = 0;
15260 struct __ecereNameSpace__ecere__com__Class * arrayClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "Array");
15261 struct __ecereNameSpace__ecere__com__Class * linkListClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "LinkList");
15262 struct __ecereNameSpace__ecere__com__Class * customAVLTreeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "CustomAVLTree");
15263
15264 if(inCompiler)
15265 {
15266 stmt->type = 2;
15267 stmt->__anon1.compound.context = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Context);
15268 stmt->__anon1.compound.context->parent = curContext;
15269 curContext = stmt->__anon1.compound.context;
15270 }
15271 if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->__anon1._class->__anon1.registered, customAVLTreeClass))
15272 {
15273 struct __ecereNameSpace__ecere__com__Class * mapClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "Map");
15274
15275 isCustomAVLTree = 1;
15276 if(__ecereNameSpace__ecere__com__eClass_IsDerived(source->__anon1._class->__anon1.registered, mapClass))
15277 isMap = 1;
15278 }
15279 else if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->__anon1._class->__anon1.registered, arrayClass))
15280 isArray = 1;
15281 else if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->__anon1._class->__anon1.registered, linkListClass))
15282 {
15283 struct __ecereNameSpace__ecere__com__Class * listClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "List");
15284
15285 isLinkList = 1;
15286 isList = __ecereNameSpace__ecere__com__eClass_IsDerived(source->__anon1._class->__anon1.registered, listClass);
15287 }
15288 if(inCompiler && isArray)
15289 {
15290 struct Declarator * decl;
15291 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15292
15293 decl = SpecDeclFromString(_class->templateArgs[2].__anon1.__anon1.dataTypeString, specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(id)));
15294 stmt->__anon1.compound.declarations = MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(decl, (((void *)0))))));
15295 ListAdd(stmt->__anon1.compound.declarations, MkDeclaration(MkListOne(MkSpecifierName(source->__anon1._class->__anon1.registered->fullName)), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internalArray")), MkInitializerAssignment(MkExpBrackets(exp))))));
15296 }
15297 else if(isBuiltin)
15298 {
15299 struct Type * type = (((void *)0));
15300 char typeStringBuf[1024];
15301
15302 arrayExp = (((struct Expression *)(*exp).last)->type == 35) ? (struct Expression *)(*exp).last : ((struct Expression *)(*exp).last)->__anon1.cast.exp;
15303 if(((struct Expression *)(*exp).last)->type == 11)
15304 {
15305 struct TypeName * typeName = ((struct Expression *)(*exp).last)->__anon1.cast.typeName;
15306
15307 if(typeName)
15308 arrayExp->destType = ProcessType(typeName->qualifiers, typeName->declarator);
15309 }
15310 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)
15311 {
15312 struct __ecereNameSpace__ecere__com__Class * templateClass = arrayExp->destType->__anon1._class->__anon1.registered;
15313
15314 typeString = templateClass->templateArgs[2].__anon1.__anon1.dataTypeString;
15315 }
15316 else if(arrayExp->__anon1.list)
15317 {
15318 struct Expression * e;
15319
15320 for(e = (*arrayExp->__anon1.list).first; e; e = e->next)
15321 {
15322 ProcessExpressionType(e);
15323 if(e->expType)
15324 {
15325 if(!type)
15326 {
15327 type = e->expType;
15328 type->refCount++;
15329 }
15330 else
15331 {
15332 if(!MatchTypeExpression(e, type, (((void *)0)), 0, 1))
15333 {
15334 FreeType(type);
15335 type = e->expType;
15336 e->expType = (((void *)0));
15337 e = (*arrayExp->__anon1.list).first;
15338 ProcessExpressionType(e);
15339 if(e->expType)
15340 {
15341 if(!MatchTypeExpression(e, type, (((void *)0)), 0, 1))
15342 {
15343 FreeType(e->expType);
15344 e->expType = (((void *)0));
15345 FreeType(type);
15346 type = (((void *)0));
15347 break;
15348 }
15349 }
15350 }
15351 }
15352 if(e->expType)
15353 {
15354 FreeType(e->expType);
15355 e->expType = (((void *)0));
15356 }
15357 }
15358 }
15359 if(type)
15360 {
15361 typeStringBuf[0] = '\0';
15362 PrintType(type, typeStringBuf, 0, 1);
15363 typeString = typeStringBuf;
15364 FreeType(type);
15365 }
15366 }
15367 if(typeString)
15368 {
15369 if(inCompiler)
15370 {
15371 struct __ecereNameSpace__ecere__sys__OldList * initializers = MkList();
15372 struct Declarator * decl;
15373 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15374
15375 if(arrayExp->__anon1.list)
15376 {
15377 struct Expression * e;
15378
15379 builtinCount = (*arrayExp->__anon1.list).count;
15380 type = ProcessTypeString(typeString, 0);
15381 while((e = (*arrayExp->__anon1.list).first))
15382 {
15383 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*arrayExp->__anon1.list), e);
15384 e->destType = type;
15385 type->refCount++;
15386 ProcessExpressionType(e);
15387 if(inCompiler)
15388 ListAdd(initializers, MkInitializerAssignment(e));
15389 }
15390 FreeType(type);
15391 (__ecereNameSpace__ecere__com__eSystem_Delete(arrayExp->__anon1.list), arrayExp->__anon1.list = 0);
15392 }
15393 decl = SpecDeclFromString(typeString, specs, MkDeclaratorIdentifier(id));
15394 stmt->__anon1.compound.declarations = MkListOne(MkDeclaration(CopyList(specs, (void *)(CopySpecifier)), MkListOne(MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl), (((void *)0))))));
15395 ListAdd(stmt->__anon1.compound.declarations, MkDeclaration(specs, MkListOne(MkInitDeclarator(PlugDeclarator(decl, MkDeclaratorArray(MkDeclaratorIdentifier(MkIdentifier("__internalArray")), (((void *)0)))), MkInitializerList(initializers)))));
15396 FreeList(exp, (void *)(FreeExpression));
15397 }
15398 else if(arrayExp->__anon1.list)
15399 {
15400 struct Expression * e;
15401
15402 type = ProcessTypeString(typeString, 0);
15403 for(e = (*arrayExp->__anon1.list).first; e; e = e->next)
15404 {
15405 e->destType = type;
15406 type->refCount++;
15407 ProcessExpressionType(e);
15408 }
15409 FreeType(type);
15410 }
15411 }
15412 else
15413 {
15414 arrayExp->expType = ProcessTypeString("Container", 0);
15415 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Couldn't determine type of array elements\n", (((void *)0))));
15416 }
15417 }
15418 else if(inCompiler && isLinkList && !isList)
15419 {
15420 struct Declarator * decl;
15421 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15422
15423 decl = SpecDeclFromString(_class->templateArgs[3].__anon1.__anon1.dataTypeString, specs, MkDeclaratorIdentifier(id));
15424 stmt->__anon1.compound.declarations = MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(decl, (((void *)0))))));
15425 ListAdd(stmt->__anon1.compound.declarations, MkDeclaration(MkListOne(MkSpecifierName(source->__anon1._class->__anon1.registered->fullName)), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internalLinkList")), MkInitializerAssignment(MkExpBrackets(exp))))));
15426 }
15427 else if(inCompiler && _class->templateArgs)
15428 {
15429 if(isMap)
15430 sprintf(iteratorType, "MapIterator<%s, %s >", _class->templateArgs[5].__anon1.__anon1.dataTypeString, _class->templateArgs[6].__anon1.__anon1.dataTypeString);
15431 else
15432 sprintf(iteratorType, "Iterator<%s, %s >", _class->templateArgs[2].__anon1.__anon1.dataTypeString, _class->templateArgs[1].__anon1.__anon1.dataTypeString);
15433 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)))))))));
15434 }
15435 if(inCompiler)
15436 {
15437 symbol = FindSymbol(id->string, curContext, curContext, 0, 0);
15438 if(block)
15439 {
15440 switch(block->type)
15441 {
15442 case 2:
15443 if(block->__anon1.compound.context)
15444 block->__anon1.compound.context->parent = stmt->__anon1.compound.context;
15445 break;
15446 case 4:
15447 if(block->__anon1.ifStmt.stmt && block->__anon1.ifStmt.stmt->type == 2 && block->__anon1.ifStmt.stmt->__anon1.compound.context)
15448 block->__anon1.ifStmt.stmt->__anon1.compound.context->parent = stmt->__anon1.compound.context;
15449 if(block->__anon1.ifStmt.elseStmt && block->__anon1.ifStmt.elseStmt->type == 2 && block->__anon1.ifStmt.elseStmt->__anon1.compound.context)
15450 block->__anon1.ifStmt.elseStmt->__anon1.compound.context->parent = stmt->__anon1.compound.context;
15451 break;
15452 case 5:
15453 if(block->__anon1.switchStmt.stmt && block->__anon1.switchStmt.stmt->type == 2 && block->__anon1.switchStmt.stmt->__anon1.compound.context)
15454 block->__anon1.switchStmt.stmt->__anon1.compound.context->parent = stmt->__anon1.compound.context;
15455 break;
15456 case 6:
15457 if(block->__anon1.whileStmt.stmt && block->__anon1.whileStmt.stmt->type == 2 && block->__anon1.whileStmt.stmt->__anon1.compound.context)
15458 block->__anon1.whileStmt.stmt->__anon1.compound.context->parent = stmt->__anon1.compound.context;
15459 break;
15460 case 7:
15461 if(block->__anon1.doWhile.stmt && block->__anon1.doWhile.stmt->type == 2 && block->__anon1.doWhile.stmt->__anon1.compound.context)
15462 block->__anon1.doWhile.stmt->__anon1.compound.context->parent = stmt->__anon1.compound.context;
15463 break;
15464 case 8:
15465 if(block->__anon1.forStmt.stmt && block->__anon1.forStmt.stmt->type == 2 && block->__anon1.forStmt.stmt->__anon1.compound.context)
15466 block->__anon1.forStmt.stmt->__anon1.compound.context->parent = stmt->__anon1.compound.context;
15467 break;
15468 case 18:
15469 if(block->__anon1.forEachStmt.stmt && block->__anon1.forEachStmt.stmt->type == 2 && block->__anon1.forEachStmt.stmt->__anon1.compound.context)
15470 block->__anon1.forEachStmt.stmt->__anon1.compound.context->parent = stmt->__anon1.compound.context;
15471 break;
15472 }
15473 }
15474 if(filter)
15475 {
15476 block = MkIfStmt(filter, block, (((void *)0)));
15477 }
15478 if(isArray)
15479 {
15480 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));
15481 ProcessStatement(((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.init);
15482 ProcessStatement(((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.check);
15483 ProcessExpressionType((*((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.increment).first);
15484 }
15485 else if(isBuiltin)
15486 {
15487 char count[128];
15488
15489 sprintf(count, "%d", builtinCount);
15490 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));
15491 ProcessStatement(((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.init);
15492 ProcessStatement(((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.check);
15493 ProcessExpressionType((*((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.increment).first);
15494 }
15495 else if(isLinkList && !isList)
15496 {
15497 struct __ecereNameSpace__ecere__com__Class * typeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, _class->templateArgs[3].__anon1.__anon1.dataTypeString);
15498 struct __ecereNameSpace__ecere__com__Class * listItemClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, "ListItem");
15499
15500 if(typeClass && __ecereNameSpace__ecere__com__eClass_IsDerived(typeClass, listItemClass) && _class->templateArgs[5].__anon1.__anon1.dataTypeString && !strcmp(_class->templateArgs[5].__anon1.__anon1.dataTypeString, "LT::link"))
15501 {
15502 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));
15503 }
15504 else
15505 {
15506 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15507 struct Declarator * decl = SpecDeclFromString(_class->templateArgs[3].__anon1.__anon1.dataTypeString, specs, (((void *)0)));
15508
15509 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));
15510 }
15511 ProcessStatement(((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.init);
15512 ProcessStatement(((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.check);
15513 ProcessExpressionType((*((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.increment).first);
15514 }
15515 else
15516 {
15517 stmt->__anon1.compound.statements = MkListOne(MkWhileStmt(MkListOne(MkExpCall(MkExpMember(expIt = MkExpIdentifier(CopyIdentifier(id)), MkIdentifier("Next")), (((void *)0)))), block));
15518 }
15519 ProcessExpressionType(expIt);
15520 if((*stmt->__anon1.compound.declarations).first)
15521 ProcessDeclaration((*stmt->__anon1.compound.declarations).first, 1);
15522 if(symbol)
15523 symbol->isIterator = isMap ? 2 : ((isArray || isBuiltin) ? 3 : (isLinkList ? (isList ? 5 : 4) : (isCustomAVLTree ? 6 : 1)));
15524 ProcessStatement(stmt);
15525 }
15526 else
15527 ProcessStatement(stmt->__anon1.forEachStmt.stmt);
15528 if(inCompiler)
15529 curContext = stmt->__anon1.compound.context->parent;
15530 break;
15531 }
15532 else
15533 {
15534 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Expression is not a container\n", (((void *)0))));
15535 }
15536 break;
15537 }
15538 case 9:
15539 break;
15540 case 10:
15541 break;
15542 case 11:
15543 break;
15544 case 12:
15545 {
15546 struct Expression * exp;
15547
15548 if(stmt->__anon1.expressions)
15549 {
15550 for(exp = (*stmt->__anon1.expressions).first; exp; exp = exp->next)
15551 {
15552 if(!exp->next)
15553 {
15554 if(curFunction && !curFunction->type)
15555 curFunction->type = ProcessType(curFunction->specifiers, curFunction->declarator);
15556 FreeType(exp->destType);
15557 exp->destType = (curFunction && curFunction->type && curFunction->type->kind == 11) ? curFunction->type->__anon1.__anon2.returnType : (((void *)0));
15558 if(exp->destType)
15559 exp->destType->refCount++;
15560 }
15561 ProcessExpressionType(exp);
15562 }
15563 }
15564 break;
15565 }
15566 case 14:
15567 {
15568 ProcessDeclaration(stmt->__anon1.decl, 1);
15569 break;
15570 }
15571 case 13:
15572 {
15573 struct AsmField * field;
15574
15575 if(stmt->__anon1.asmStmt.inputFields)
15576 {
15577 for(field = (*stmt->__anon1.asmStmt.inputFields).first; field; field = field->next)
15578 if(field->expression)
15579 ProcessExpressionType(field->expression);
15580 }
15581 if(stmt->__anon1.asmStmt.outputFields)
15582 {
15583 for(field = (*stmt->__anon1.asmStmt.outputFields).first; field; field = field->next)
15584 if(field->expression)
15585 ProcessExpressionType(field->expression);
15586 }
15587 if(stmt->__anon1.asmStmt.clobberedFields)
15588 {
15589 for(field = (*stmt->__anon1.asmStmt.clobberedFields).first; field; field = field->next)
15590 {
15591 if(field->expression)
15592 ProcessExpressionType(field->expression);
15593 }
15594 }
15595 break;
15596 }
15597 case 17:
15598 {
15599 struct PropertyWatch * propWatch;
15600 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->__anon1._watch.watches;
15601 struct Expression * object = stmt->__anon1._watch.object;
15602 struct Expression * watcher = stmt->__anon1._watch.watcher;
15603
15604 if(watcher)
15605 ProcessExpressionType(watcher);
15606 if(object)
15607 ProcessExpressionType(object);
15608 if(inCompiler)
15609 {
15610 if(watcher || thisClass)
15611 {
15612 struct External * external = curExternal;
15613 struct Context * context = curContext;
15614
15615 stmt->type = 3;
15616 stmt->__anon1.expressions = MkList();
15617 for(propWatch = (*watches).first; propWatch; propWatch = propWatch->next)
15618 {
15619 struct ClassFunction * func;
15620 char watcherName[1024];
15621 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;
15622 struct External * createdExternal;
15623
15624 sprintf(watcherName, "__ecerePropertyWatcher_%d", propWatcherID++);
15625 if(propWatch->deleteWatch)
15626 strcat(watcherName, "_delete");
15627 else
15628 {
15629 struct Identifier * propID;
15630
15631 for(propID = (*propWatch->properties).first; propID; propID = propID->next)
15632 {
15633 strcat(watcherName, "_");
15634 strcat(watcherName, propID->string);
15635 }
15636 }
15637 if(object && object->expType && object->expType->kind == 8 && object->expType->__anon1._class && object->expType->__anon1._class->__anon1.registered)
15638 {
15639 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)));
15640 ProcessClassFunctionBody(func, propWatch->compound);
15641 propWatch->compound = (((void *)0));
15642 createdExternal = ProcessClassFunction(watcherClass, func, ast, curExternal, 1);
15643 FreeClassFunction(func);
15644 curExternal = createdExternal;
15645 ProcessFunction(createdExternal->__anon1.function);
15646 if(propWatch->deleteWatch)
15647 {
15648 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
15649
15650 ListAdd(args, CopyExpression(object));
15651 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
15652 ListAdd(args, MkExpIdentifier(MkIdentifier(watcherName)));
15653 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_WatchDestruction")), args));
15654 }
15655 else
15656 {
15657 struct __ecereNameSpace__ecere__com__Class * _class = object->expType->__anon1._class->__anon1.registered;
15658 struct Identifier * propID;
15659
15660 for(propID = (*propWatch->properties).first; propID; propID = propID->next)
15661 {
15662 char propName[1024];
15663 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
15664
15665 if(prop)
15666 {
15667 char getName[1024], setName[1024];
15668 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
15669
15670 DeclareProperty(createdExternal, prop, setName, getName);
15671 strcpy(propName, "__ecereProp_");
15672 FullClassNameCat(propName, prop->_class->fullName, 0);
15673 strcat(propName, "_");
15674 FullClassNameCat(propName, prop->name, 1);
15675 ListAdd(args, CopyExpression(object));
15676 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
15677 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
15678 ListAdd(args, MkExpCast(MkTypeName(MkListOne(MkSpecifier(VOID)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), MkExpIdentifier(MkIdentifier(watcherName))));
15679 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_Watch")), args));
15680 __ecereMethod_External_CreateUniqueEdge(external, createdExternal, 1);
15681 }
15682 else
15683 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Property %s not found in class %s\n", (((void *)0))), propID->string, _class->fullName);
15684 }
15685 }
15686 }
15687 else
15688 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Invalid watched object\n", (((void *)0))));
15689 }
15690 curExternal = external;
15691 curContext = context;
15692 if(watcher)
15693 FreeExpression(watcher);
15694 if(object)
15695 FreeExpression(object);
15696 FreeList(watches, (void *)(FreePropertyWatch));
15697 }
15698 else
15699 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "No observer specified and not inside a class\n", (((void *)0))));
15700 }
15701 else
15702 {
15703 for(propWatch = (*watches).first; propWatch; propWatch = propWatch->next)
15704 {
15705 ProcessStatement(propWatch->compound);
15706 }
15707 }
15708 break;
15709 }
15710 case 15:
15711 {
15712 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->__anon1._watch.watches;
15713 struct Expression * object = stmt->__anon1._watch.object;
15714 struct __ecereNameSpace__ecere__com__Class * _class;
15715
15716 if(object)
15717 ProcessExpressionType(object);
15718 if(inCompiler)
15719 {
15720 _class = object ? ((object->expType && object->expType->kind == 8 && object->expType->__anon1._class) ? object->expType->__anon1._class->__anon1.registered : (((void *)0))) : thisClass;
15721 if(_class)
15722 {
15723 struct Identifier * propID;
15724
15725 stmt->type = 3;
15726 stmt->__anon1.expressions = MkList();
15727 if(!watches && curFunction->propSet && (!object || (object->type == 0 && !strcmp(object->__anon1.__anon1.identifier->string, "this"))))
15728 {
15729 watches = MkListOne(MkIdentifier(curFunction->propSet->string));
15730 }
15731 else if(!watches)
15732 {
15733 }
15734 if(watches)
15735 {
15736 for(propID = (*watches).first; propID; propID = propID->next)
15737 {
15738 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
15739
15740 if(prop)
15741 {
15742 CreateFireWatcher(prop, object, stmt);
15743 }
15744 else
15745 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Property %s not found in class %s\n", (((void *)0))), propID->string, _class->fullName);
15746 }
15747 }
15748 else
15749 {
15750 struct __ecereNameSpace__ecere__com__Property * prop;
15751 struct __ecereNameSpace__ecere__com__Class * base;
15752
15753 for(base = _class; base; base = base->base)
15754 {
15755 for(prop = base->membersAndProperties.first; prop; prop = prop->next)
15756 {
15757 if(prop->isProperty && prop->isWatchable)
15758 {
15759 CreateFireWatcher(prop, object, stmt);
15760 }
15761 }
15762 }
15763 }
15764 if(object)
15765 FreeExpression(object);
15766 FreeList(watches, (void *)(FreeIdentifier));
15767 }
15768 else
15769 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Invalid object specified and not inside a class\n", (((void *)0))));
15770 }
15771 break;
15772 }
15773 case 16:
15774 {
15775 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->__anon1._watch.watches;
15776 struct Expression * object = stmt->__anon1._watch.object;
15777 struct Expression * watcher = stmt->__anon1._watch.watcher;
15778 struct __ecereNameSpace__ecere__com__Class * _class;
15779
15780 if(object)
15781 ProcessExpressionType(object);
15782 if(watcher)
15783 ProcessExpressionType(watcher);
15784 if(inCompiler)
15785 {
15786 _class = (object && object->expType && object->expType->kind == 8 && object->expType->__anon1._class) ? object->expType->__anon1._class->__anon1.registered : (((void *)0));
15787 if(watcher || thisClass)
15788 {
15789 if(_class)
15790 {
15791 struct Identifier * propID;
15792
15793 stmt->type = 3;
15794 stmt->__anon1.expressions = MkList();
15795 if(!watches)
15796 {
15797 struct __ecereNameSpace__ecere__sys__OldList * args;
15798
15799 args = MkList();
15800 ListAdd(args, CopyExpression(object));
15801 ListAdd(args, MkExpConstant("0"));
15802 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
15803 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_StopWatching")), args));
15804 }
15805 else
15806 {
15807 for(propID = (*watches).first; propID; propID = propID->next)
15808 {
15809 char propName[1024];
15810 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
15811
15812 if(prop)
15813 {
15814 char getName[1024], setName[1024];
15815 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
15816
15817 DeclareProperty(curExternal, prop, setName, getName);
15818 strcpy(propName, "__ecereProp_");
15819 FullClassNameCat(propName, prop->_class->fullName, 0);
15820 strcat(propName, "_");
15821 FullClassNameCat(propName, prop->name, 1);
15822 ListAdd(args, CopyExpression(object));
15823 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
15824 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
15825 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_StopWatching")), args));
15826 }
15827 else
15828 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Property %s not found in class %s\n", (((void *)0))), propID->string, _class->fullName);
15829 }
15830 }
15831 if(object)
15832 FreeExpression(object);
15833 if(watcher)
15834 FreeExpression(watcher);
15835 FreeList(watches, (void *)(FreeIdentifier));
15836 }
15837 else
15838 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Invalid object specified and not inside a class\n", (((void *)0))));
15839 }
15840 else
15841 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "No observer specified and not inside a class\n", (((void *)0))));
15842 }
15843 break;
15844 }
15845 }
15846 }
15847
15848 void ComputeDataTypes()
15849 {
15850 struct External * external;
15851
15852 currentClass = (((void *)0));
15853 containerClass = __ecereNameSpace__ecere__com__eSystem_FindClass(GetPrivateModule(), "Container");
15854 DeclareStruct((((void *)0)), "ecere::com::Class", 0, 1);
15855 DeclareStruct((((void *)0)), "ecere::com::Instance", 0, 1);
15856 DeclareStruct((((void *)0)), "ecere::com::Property", 0, 1);
15857 DeclareStruct((((void *)0)), "ecere::com::DataMember", 0, 1);
15858 DeclareStruct((((void *)0)), "ecere::com::Method", 0, 1);
15859 DeclareStruct((((void *)0)), "ecere::com::SerialBuffer", 0, 1);
15860 DeclareStruct((((void *)0)), "ecere::com::ClassTemplateArgument", 0, 1);
15861 DeclareFunctionUtil((((void *)0)), "eSystem_New");
15862 DeclareFunctionUtil((((void *)0)), "eSystem_New0");
15863 DeclareFunctionUtil((((void *)0)), "eSystem_Renew");
15864 DeclareFunctionUtil((((void *)0)), "eSystem_Renew0");
15865 DeclareFunctionUtil((((void *)0)), "eSystem_Delete");
15866 DeclareFunctionUtil((((void *)0)), "eClass_GetProperty");
15867 DeclareFunctionUtil((((void *)0)), "eClass_SetProperty");
15868 DeclareFunctionUtil((((void *)0)), "eInstance_FireSelfWatchers");
15869 DeclareFunctionUtil((((void *)0)), "eInstance_SetMethod");
15870 DeclareFunctionUtil((((void *)0)), "eInstance_IncRef");
15871 DeclareFunctionUtil((((void *)0)), "eInstance_StopWatching");
15872 DeclareFunctionUtil((((void *)0)), "eInstance_Watch");
15873 DeclareFunctionUtil((((void *)0)), "eInstance_FireWatchers");
15874 reachedPass15 = 1;
15875 for(external = (*ast).first; external; external = external->next)
15876 {
15877 afterExternal = curExternal = external;
15878 if(external->type == 0)
15879 {
15880 if(memoryGuard)
15881 {
15882 DeclareFunctionUtil(external, "MemoryGuard_PushLoc");
15883 DeclareFunctionUtil(external, "MemoryGuard_PopLoc");
15884 }
15885 currentClass = external->__anon1.function->_class;
15886 ProcessFunction(external->__anon1.function);
15887 }
15888 else if(external->type == 1)
15889 {
15890 if(memoryGuard && external->__anon1.declaration && external->__anon1.declaration->type == 2)
15891 {
15892 DeclareFunctionUtil(external, "MemoryGuard_PushLoc");
15893 DeclareFunctionUtil(external, "MemoryGuard_PopLoc");
15894 }
15895 currentClass = (((void *)0));
15896 if(external->__anon1.declaration)
15897 ProcessDeclaration(external->__anon1.declaration, 1);
15898 }
15899 else if(external->type == 2)
15900 {
15901 struct ClassDefinition * _class = external->__anon1._class;
15902
15903 currentClass = external->symbol->__anon1.registered;
15904 if(memoryGuard)
15905 {
15906 DeclareFunctionUtil(external, "MemoryGuard_PushLoc");
15907 DeclareFunctionUtil(external, "MemoryGuard_PopLoc");
15908 }
15909 if(_class->definitions)
15910 {
15911 ProcessClass(_class->definitions, _class->symbol);
15912 }
15913 if(inCompiler)
15914 {
15915 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*ast), external);
15916 ((external ? __extension__ ({
15917 void * __ecerePtrToDelete = (external);
15918
15919 __ecereClass_External->Destructor ? __ecereClass_External->Destructor((void *)__ecerePtrToDelete) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(__ecerePtrToDelete);
15920 }) : 0), external = 0);
15921 }
15922 }
15923 else if(external->type == 4)
15924 {
15925 thisNameSpace = external->__anon1.id->string;
15926 }
15927 }
15928 currentClass = (((void *)0));
15929 thisNameSpace = (((void *)0));
15930 curExternal = (((void *)0));
15931 }
15932
15933 void ProcessExpressionType(struct Expression * exp)
15934 {
15935 unsigned int unresolved = 0;
15936 struct Location oldyylloc = yylloc;
15937 unsigned int notByReference = 0;
15938
15939 if(!exp || exp->expType)
15940 return ;
15941 yylloc = exp->loc;
15942 switch(exp->type)
15943 {
15944 case 0:
15945 {
15946 struct Identifier * id = exp->__anon1.__anon1.identifier;
15947
15948 if(!id || !topContext)
15949 return ;
15950 if(id->_class && id->_class->__anon1.__anon1.name)
15951 {
15952 id->classSym = id->_class->__anon1.__anon1.symbol;
15953 }
15954 if(!strcmp(id->string, "__runtimePlatform"))
15955 {
15956 exp->expType = ProcessTypeString("ecere::com::Platform", 1);
15957 break;
15958 }
15959 else if(strstr(id->string, "__ecereClass") == id->string)
15960 {
15961 exp->expType = ProcessTypeString("ecere::com::Class", 1);
15962 break;
15963 }
15964 else if(id->_class && (id->classSym || (id->_class->__anon1.__anon1.name && !strcmp(id->_class->__anon1.__anon1.name, "property"))))
15965 {
15966 ReplaceClassMembers(exp, thisClass);
15967 if(exp->type != 0)
15968 {
15969 ProcessExpressionType(exp);
15970 break;
15971 }
15972 if(id->classSym && ResolveIdWithClass(exp, id->classSym->__anon1.registered, 0))
15973 break;
15974 }
15975 else
15976 {
15977 struct Symbol * symbol = (((void *)0));
15978 unsigned int findInGlobal = 0;
15979
15980 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)
15981 findInGlobal = 1;
15982 else
15983 symbol = FindSymbol(id->string, curContext, topContext, 0, id->_class && id->_class->__anon1.__anon1.name == (((void *)0)));
15984 if(!symbol)
15985 {
15986 if(exp->destType && CheckExpressionType(exp, exp->destType, 0, 0))
15987 break;
15988 else
15989 {
15990 if(thisClass && strcmp(id->string, "this"))
15991 {
15992 ReplaceClassMembers(exp, thisClass ? thisClass : currentClass);
15993 if(exp->type != 0)
15994 {
15995 ProcessExpressionType(exp);
15996 break;
15997 }
15998 }
15999 else if(currentClass && !id->_class)
16000 {
16001 if(ResolveIdWithClass(exp, currentClass, 1))
16002 break;
16003 }
16004 symbol = FindSymbol(id->string, topContext->parent, globalContext, 0, id->_class && id->_class->__anon1.__anon1.name == (((void *)0)));
16005 }
16006 }
16007 if(findInGlobal)
16008 symbol = FindSymbol(id->string, curContext, topContext, 0, id->_class && id->_class->__anon1.__anon1.name == (((void *)0)));
16009 if(symbol)
16010 {
16011 struct Type * type = symbol->type;
16012 struct __ecereNameSpace__ecere__com__Class * _class = (type && type->kind == 8 && type->__anon1._class) ? type->__anon1._class->__anon1.registered : (((void *)0));
16013
16014 if(_class && !strcmp(id->string, "this") && !type->classObjectType)
16015 {
16016 struct Context * context = SetupTemplatesContext(_class);
16017
16018 type = ReplaceThisClassType(_class);
16019 FinishTemplatesContext(context);
16020 if(type)
16021 type->refCount = 0;
16022 }
16023 FreeSpecifier(id->_class);
16024 id->_class = (((void *)0));
16025 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
16026 id->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
16027 id->classSym = (((void *)0));
16028 exp->expType = type;
16029 if(type)
16030 type->refCount++;
16031 if(type && (type->kind == 15))
16032 exp->isConstant = 1;
16033 if(symbol->isParam || !strcmp(id->string, "this"))
16034 {
16035 if(_class && _class->type == 1 && !type->declaredWithStruct)
16036 exp->byReference = 1;
16037 }
16038 if(symbol->isIterator)
16039 {
16040 if(symbol->isIterator == 3)
16041 {
16042 exp->type = 5;
16043 exp->__anon1.list = MkListOne(MkExpOp((((void *)0)), '*', MkExpIdentifier(exp->__anon1.__anon1.identifier)));
16044 ((struct Expression *)(*exp->__anon1.list).first)->__anon1.op.exp2->expType = exp->expType;
16045 exp->expType = (((void *)0));
16046 ProcessExpressionType(exp);
16047 }
16048 else if(symbol->isIterator != 4)
16049 {
16050 exp->type = 8;
16051 exp->__anon1.member.exp = MkExpIdentifier(exp->__anon1.__anon1.identifier);
16052 exp->__anon1.member.exp->expType = exp->expType;
16053 exp->__anon1.member.member = MkIdentifier("data");
16054 exp->expType = (((void *)0));
16055 ProcessExpressionType(exp);
16056 }
16057 }
16058 break;
16059 }
16060 else
16061 {
16062 struct __ecereNameSpace__ecere__com__DefinedExpression * definedExp = (((void *)0));
16063
16064 if(thisNameSpace && !(id->_class && !id->_class->__anon1.__anon1.name))
16065 {
16066 char name[1024];
16067
16068 strcpy(name, thisNameSpace);
16069 strcat(name, "::");
16070 strcat(name, id->string);
16071 definedExp = __ecereNameSpace__ecere__com__eSystem_FindDefine(privateModule, name);
16072 }
16073 if(!definedExp)
16074 definedExp = __ecereNameSpace__ecere__com__eSystem_FindDefine(privateModule, id->string);
16075 if(definedExp)
16076 {
16077 int c;
16078
16079 for(c = 0; c < definedExpStackPos; c++)
16080 if(definedExpStack[c] == definedExp)
16081 break;
16082 if(c == definedExpStackPos && c < sizeof (definedExpStack) / sizeof(void *))
16083 {
16084 struct Location backupYylloc = yylloc;
16085 struct __ecereNameSpace__ecere__com__Instance * backInput = fileInput;
16086
16087 definedExpStack[definedExpStackPos++] = definedExp;
16088 fileInput = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
16089 (__extension__ ({
16090 int (*  __internal_VirtualMethod)(struct __ecereNameSpace__ecere__com__Instance *, const void *  buffer, unsigned int size, unsigned int count);
16091
16092 __internal_VirtualMethod = ((int (*)(struct __ecereNameSpace__ecere__com__Instance *, const void *  buffer, unsigned int size, unsigned int count))__extension__ ({
16093 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
16094
16095 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
16096 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Write]);
16097 __internal_VirtualMethod ? __internal_VirtualMethod(fileInput, definedExp->value, 1, strlen(definedExp->value)) : (int)1;
16098 }));
16099 (__extension__ ({
16100 unsigned int (*  __internal_VirtualMethod)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode);
16101
16102 __internal_VirtualMethod = ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))__extension__ ({
16103 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
16104
16105 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
16106 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek]);
16107 __internal_VirtualMethod ? __internal_VirtualMethod(fileInput, 0, 0) : (unsigned int)1;
16108 }));
16109 echoOn = 0;
16110 parsedExpression = (((void *)0));
16111 resetScanner();
16112 expression_yyparse();
16113 (__ecereNameSpace__ecere__com__eInstance_DecRef(fileInput), fileInput = 0);
16114 if(backInput)
16115 fileInput = backInput;
16116 yylloc = backupYylloc;
16117 if(parsedExpression)
16118 {
16119 FreeIdentifier(id);
16120 exp->type = 5;
16121 exp->__anon1.list = MkListOne(parsedExpression);
16122 ApplyLocation(parsedExpression, &yylloc);
16123 ProcessExpressionType(exp);
16124 definedExpStackPos--;
16125 return ;
16126 }
16127 definedExpStackPos--;
16128 }
16129 else
16130 {
16131 if(inCompiler)
16132 {
16133 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Recursion in defined expression %s\n", (((void *)0))), id->string);
16134 }
16135 }
16136 }
16137 else
16138 {
16139 struct GlobalData * data = (((void *)0));
16140
16141 if(thisNameSpace && !(id->_class && !id->_class->__anon1.__anon1.name))
16142 {
16143 char name[1024];
16144
16145 strcpy(name, thisNameSpace);
16146 strcat(name, "::");
16147 strcat(name, id->string);
16148 data = FindGlobalData(name);
16149 }
16150 if(!data)
16151 data = FindGlobalData(id->string);
16152 if(data)
16153 {
16154 DeclareGlobalData(curExternal, data);
16155 exp->expType = data->dataType;
16156 if(data->dataType)
16157 data->dataType->refCount++;
16158 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
16159 id->string = __ecereNameSpace__ecere__sys__CopyString(data->fullName);
16160 FreeSpecifier(id->_class);
16161 id->_class = (((void *)0));
16162 break;
16163 }
16164 else
16165 {
16166 struct __ecereNameSpace__ecere__com__GlobalFunction * function = (((void *)0));
16167
16168 if(thisNameSpace && !(id->_class && !id->_class->__anon1.__anon1.name))
16169 {
16170 char name[1024];
16171
16172 strcpy(name, thisNameSpace);
16173 strcat(name, "::");
16174 strcat(name, id->string);
16175 function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, name);
16176 }
16177 if(!function)
16178 function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, id->string);
16179 if(function)
16180 {
16181 char name[1024];
16182
16183 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
16184 id->string = __ecereNameSpace__ecere__sys__CopyString(function->name);
16185 name[0] = 0;
16186 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->importType != 1 && (!function->dataType || !function->dataType->dllExport))
16187 strcpy(name, "__ecereFunction_");
16188 FullClassNameCat(name, id->string, 0);
16189 if(DeclareFunction(curExternal, function, name))
16190 {
16191 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
16192 id->string = __ecereNameSpace__ecere__sys__CopyString(name);
16193 }
16194 exp->expType = function->dataType;
16195 if(function->dataType)
16196 function->dataType->refCount++;
16197 FreeSpecifier(id->_class);
16198 id->_class = (((void *)0));
16199 break;
16200 }
16201 }
16202 }
16203 }
16204 }
16205 unresolved = 1;
16206 break;
16207 }
16208 case 1:
16209 {
16210 if(!exp->__anon1.instance->_class)
16211 {
16212 if(exp->destType && exp->destType->kind == 8 && exp->destType->__anon1._class)
16213 {
16214 exp->__anon1.instance->_class = MkSpecifierName(exp->destType->__anon1._class->string);
16215 }
16216 }
16217 ProcessInstantiationType(exp->__anon1.instance);
16218 exp->isConstant = exp->__anon1.instance->isConstant;
16219 if(exp->__anon1.instance->_class)
16220 {
16221 exp->expType = MkClassType(exp->__anon1.instance->_class->__anon1.__anon1.name);
16222 }
16223 break;
16224 }
16225 case 2:
16226 {
16227 if(!exp->expType)
16228 {
16229 char * constant = exp->__anon1.__anon1.constant;
16230 struct Type * type = (type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), type->refCount = 1, type->constant = 1, type);
16231
16232 exp->expType = type;
16233 if(constant[0] == '\'')
16234 {
16235 if((int)((unsigned char *)constant)[1] > 127)
16236 {
16237 int nb;
16238 unsigned int ch = __ecereNameSpace__ecere__sys__UTF8GetChar(constant + 1, &nb);
16239
16240 if(nb < 2)
16241 ch = constant[1];
16242 (__ecereNameSpace__ecere__com__eSystem_Delete(constant), constant = 0);
16243 exp->__anon1.__anon1.constant = PrintUInt(ch);
16244 type->kind = 8;
16245 type->__anon1._class = FindClass("unichar");
16246 type->isSigned = 0;
16247 }
16248 else
16249 {
16250 type->kind = 1;
16251 type->isSigned = 1;
16252 }
16253 }
16254 else
16255 {
16256 char * dot = strchr(constant, '.');
16257 unsigned int isHex = (constant[0] == '0' && (constant[1] == 'x' || constant[1] == 'X'));
16258 char * exponent;
16259
16260 if(isHex)
16261 {
16262 exponent = strchr(constant, 'p');
16263 if(!exponent)
16264 exponent = strchr(constant, 'P');
16265 }
16266 else
16267 {
16268 exponent = strchr(constant, 'e');
16269 if(!exponent)
16270 exponent = strchr(constant, 'E');
16271 }
16272 if(dot || exponent)
16273 {
16274 if(strchr(constant, 'f') || strchr(constant, 'F'))
16275 type->kind = 6;
16276 else
16277 type->kind = 7;
16278 type->isSigned = 1;
16279 }
16280 else
16281 {
16282 unsigned int isSigned = constant[0] == '-';
16283 char * endP = (((void *)0));
16284 long long i64 = strtoll(constant, &endP, 0);
16285 uint64 ui64 = strtoull(constant, &endP, 0);
16286 unsigned int is64Bit = endP && (!strcmp(endP, "LL") || !strcmp(endP, "ll") || !strcmp(endP, "LLU") || !strcmp(endP, "llu") || !strcmp(endP, "ull") || !strcmp(endP, "ULL"));
16287 unsigned int forceUnsigned = endP && (!strcmp(endP, "U") || !strcmp(endP, "u") || !strcmp(endP, "LLU") || !strcmp(endP, "llu") || !strcmp(endP, "ull") || !strcmp(endP, "ULL"));
16288
16289 if(isSigned)
16290 {
16291 if(i64 < (((int)0x80000000)))
16292 is64Bit = 1;
16293 }
16294 else
16295 {
16296 if(ui64 > (((int)0x7fffffff)))
16297 {
16298 if(ui64 > (0xffffffff))
16299 {
16300 is64Bit = 1;
16301 if(ui64 <= (((long long)0x7fffffffffffffffLL)) && (constant[0] != '0' || !constant[1]))
16302 isSigned = 1;
16303 }
16304 }
16305 else if(constant[0] != '0' || !constant[1])
16306 isSigned = 1;
16307 }
16308 if(forceUnsigned)
16309 isSigned = 0;
16310 type->kind = is64Bit ? 4 : 3;
16311 type->isSigned = isSigned;
16312 }
16313 }
16314 exp->isConstant = 1;
16315 if(exp->destType && exp->destType->kind == 7)
16316 type->kind = 7;
16317 else if(exp->destType && exp->destType->kind == 6)
16318 type->kind = 6;
16319 else if(exp->destType && exp->destType->kind == 4)
16320 type->kind = 4;
16321 }
16322 break;
16323 }
16324 case 3:
16325 {
16326 exp->isConstant = 1;
16327 exp->expType = __extension__ ({
16328 struct Type * __ecereInstance2 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16329
16330 __ecereInstance2->refCount = 1, __ecereInstance2->kind = 13, __ecereInstance2->__anon1.type = __extension__ ({
16331 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16332
16333 __ecereInstance1->refCount = 1, __ecereInstance1->kind = exp->__anon1.__anon2.wideString ? 2 : 1, __ecereInstance1->constant = 1, __ecereInstance1->isSigned = exp->__anon1.__anon2.wideString ? 0 : 1, __ecereInstance1;
16334 }), __ecereInstance2;
16335 });
16336 break;
16337 }
16338 case 13:
16339 case 26:
16340 ProcessExpressionType(exp->__anon1._new.size);
16341 exp->expType = __extension__ ({
16342 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16343
16344 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 13, __ecereInstance1->__anon1.type = ProcessType(exp->__anon1._new.typeName->qualifiers, exp->__anon1._new.typeName->declarator), __ecereInstance1;
16345 });
16346 DeclareType(curExternal, exp->expType->__anon1.type, 1, 0);
16347 break;
16348 case 14:
16349 case 27:
16350 ProcessExpressionType(exp->__anon1._renew.size);
16351 ProcessExpressionType(exp->__anon1._renew.exp);
16352 exp->expType = __extension__ ({
16353 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16354
16355 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 13, __ecereInstance1->__anon1.type = ProcessType(exp->__anon1._renew.typeName->qualifiers, exp->__anon1._renew.typeName->declarator), __ecereInstance1;
16356 });
16357 DeclareType(curExternal, exp->expType->__anon1.type, 1, 0);
16358 break;
16359 case 4:
16360 {
16361 unsigned int assign = 0, boolResult = 0, boolOps = 0;
16362 struct Type * type1 = (((void *)0)), * type2 = (((void *)0));
16363 unsigned int useDestType = 0, useSideType = 0;
16364 struct Location oldyylloc = yylloc;
16365 unsigned int useSideUnit = 0;
16366 struct __ecereNameSpace__ecere__com__Class * destClass = (exp->destType && exp->destType->kind == 8 && exp->destType->__anon1._class) ? exp->destType->__anon1._class->__anon1.registered : (((void *)0));
16367 unsigned int powerOp = 0, relationOp = 0;
16368 struct __ecereNameSpace__ecere__com__Class * c1 = (((void *)0)), * c2 = (((void *)0));
16369 struct Type * dummy = (dummy = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), dummy->count = 1, dummy->refCount = 1, dummy);
16370
16371 switch(exp->__anon1.op.op)
16372 {
16373 case '=':
16374 case MUL_ASSIGN:
16375 case DIV_ASSIGN:
16376 case MOD_ASSIGN:
16377 case ADD_ASSIGN:
16378 case SUB_ASSIGN:
16379 case LEFT_ASSIGN:
16380 case RIGHT_ASSIGN:
16381 case AND_ASSIGN:
16382 case XOR_ASSIGN:
16383 case OR_ASSIGN:
16384 assign = 1;
16385 break;
16386 case '!':
16387 break;
16388 case AND_OP:
16389 case OR_OP:
16390 boolOps = 1;
16391 boolResult = 1;
16392 break;
16393 case EQ_OP:
16394 case '<':
16395 case '>':
16396 case LE_OP:
16397 case GE_OP:
16398 case NE_OP:
16399 boolResult = 1;
16400 useSideType = 1;
16401 relationOp = 1;
16402 break;
16403 case '+':
16404 case '-':
16405 useSideUnit = 1;
16406 useSideType = 1;
16407 useDestType = 1;
16408 break;
16409 case LEFT_OP:
16410 case RIGHT_OP:
16411 break;
16412 case '|':
16413 case '^':
16414 useSideType = 1;
16415 useDestType = 1;
16416 break;
16417 case '/':
16418 case '%':
16419 useSideType = 1;
16420 useDestType = 1;
16421 if(exp->__anon1.op.op == '/')
16422 powerOp = 1;
16423 break;
16424 case '&':
16425 case '*':
16426 if(exp->__anon1.op.exp1)
16427 {
16428 useSideType = 1;
16429 useDestType = 1;
16430 if(exp->__anon1.op.op == '*')
16431 powerOp = 1;
16432 }
16433 break;
16434 }
16435 if(exp->__anon1.op.op == '&')
16436 {
16437 if(!exp->__anon1.op.exp1 && exp->__anon1.op.exp2 && exp->__anon1.op.exp2->type == 0 && exp->__anon1.op.exp2->__anon1.__anon1.identifier)
16438 {
16439 struct Identifier * id = exp->__anon1.op.exp2->__anon1.__anon1.identifier;
16440 struct Symbol * symbol = FindSymbol(id->string, curContext, topContext, 0, id->_class && id->_class->__anon1.__anon1.name == (((void *)0)));
16441
16442 if(symbol && symbol->isIterator == 2)
16443 {
16444 exp->type = 8;
16445 exp->__anon1.member.exp = exp->__anon1.op.exp2;
16446 exp->__anon1.member.member = MkIdentifier("key");
16447 exp->expType = (((void *)0));
16448 exp->__anon1.op.exp2->expType = symbol->type;
16449 symbol->type->refCount++;
16450 ProcessExpressionType(exp);
16451 FreeType(dummy);
16452 break;
16453 }
16454 }
16455 }
16456 if(exp->__anon1.op.exp1)
16457 {
16458 if(exp->__anon1.op.exp2 && useSideUnit && useDestType && destClass && destClass->type == 3 && destClass->base->type != 3)
16459 useDestType = 0;
16460 if(destClass && useDestType && ((destClass->type == 3 && useSideUnit) || destClass->type == 4 || destClass->type == 2))
16461 {
16462 if(exp->__anon1.op.exp1->destType)
16463 FreeType(exp->__anon1.op.exp1->destType);
16464 exp->__anon1.op.exp1->destType = exp->destType;
16465 exp->__anon1.op.exp1->opDestType = 1;
16466 if(exp->destType)
16467 exp->destType->refCount++;
16468 }
16469 else if(!assign)
16470 {
16471 if(exp->__anon1.op.exp1->destType)
16472 FreeType(exp->__anon1.op.exp1->destType);
16473 exp->__anon1.op.exp1->destType = dummy;
16474 dummy->refCount++;
16475 if(powerOp)
16476 exp->__anon1.op.exp1->opDestType = 1;
16477 if(relationOp)
16478 exp->__anon1.op.exp1->usedInComparison = 1;
16479 }
16480 if(exp->__anon1.op.op == '+' || exp->__anon1.op.op == '-')
16481 {
16482 if(exp->opDestType)
16483 exp->__anon1.op.exp1->parentOpDestType = 1;
16484 if(exp->usedInComparison)
16485 exp->__anon1.op.exp1->usedInComparison = 1;
16486 }
16487 if(exp->__anon1.op.exp1->destType && exp->__anon1.op.op != '=')
16488 exp->__anon1.op.exp1->destType->count++;
16489 ProcessExpressionType(exp->__anon1.op.exp1);
16490 if(exp->__anon1.op.exp1->destType && exp->__anon1.op.op != '=')
16491 exp->__anon1.op.exp1->destType->count--;
16492 exp->__anon1.op.exp1->opDestType = 0;
16493 exp->__anon1.op.exp1->usedInComparison = 0;
16494 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)
16495 {
16496 exp->__anon1.op.exp2 = MkExpConstant("1");
16497 exp->__anon1.op.op = exp->__anon1.op.op == INC_OP ? ADD_ASSIGN : SUB_ASSIGN;
16498 assign = 1;
16499 }
16500 if(exp->__anon1.op.exp1->destType == dummy)
16501 {
16502 FreeType(dummy);
16503 exp->__anon1.op.exp1->destType = (((void *)0));
16504 }
16505 if(exp->__anon1.op.exp2)
16506 {
16507 if(!assign && exp->__anon1.op.exp1->expType && (exp->__anon1.op.exp1->expType->kind == 1 || exp->__anon1.op.exp1->expType->kind == 2))
16508 {
16509 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);
16510
16511 FreeType(exp->__anon1.op.exp1->expType);
16512 exp->__anon1.op.exp1->expType = type;
16513 }
16514 }
16515 type1 = exp->__anon1.op.exp1->expType;
16516 }
16517 if(exp->__anon1.op.exp2)
16518 {
16519 char expString[10240];
16520
16521 expString[0] = '\0';
16522 if(exp->__anon1.op.exp2->type == 1 && !exp->__anon1.op.exp2->__anon1.instance->_class)
16523 {
16524 if(exp->__anon1.op.exp1)
16525 {
16526 exp->__anon1.op.exp2->destType = exp->__anon1.op.exp1->expType;
16527 if(exp->__anon1.op.exp1->expType)
16528 exp->__anon1.op.exp1->expType->refCount++;
16529 }
16530 else
16531 {
16532 exp->__anon1.op.exp2->destType = exp->destType;
16533 if(!exp->__anon1.op.exp1 || (exp->__anon1.op.op != '&' && exp->__anon1.op.op != '^'))
16534 exp->__anon1.op.exp2->opDestType = 1;
16535 if(exp->destType)
16536 exp->destType->refCount++;
16537 }
16538 if(type1)
16539 type1->refCount++;
16540 exp->expType = type1;
16541 }
16542 else if(assign)
16543 {
16544 if(inCompiler)
16545 PrintExpression(exp->__anon1.op.exp2, expString);
16546 if(type1 && type1->kind == 13)
16547 {
16548 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)
16549 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "operator %s illegal on pointer\n", (((void *)0))), exp->__anon1.op.op);
16550 else if(exp->__anon1.op.op == '=')
16551 {
16552 if(exp->__anon1.op.exp2->destType)
16553 FreeType(exp->__anon1.op.exp2->destType);
16554 exp->__anon1.op.exp2->destType = type1;
16555 if(type1)
16556 type1->refCount++;
16557 }
16558 }
16559 else
16560 {
16561 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)
16562 ;
16563 else
16564 {
16565 if(exp->__anon1.op.exp2->destType)
16566 FreeType(exp->__anon1.op.exp2->destType);
16567 exp->__anon1.op.exp2->destType = type1;
16568 if(type1)
16569 type1->refCount++;
16570 }
16571 }
16572 if(type1)
16573 type1->refCount++;
16574 exp->expType = type1;
16575 }
16576 else if(destClass && ((destClass->type == 3 && useDestType && useSideUnit) || (destClass->type == 4 && useDestType)))
16577 {
16578 if(exp->__anon1.op.exp2->destType)
16579 FreeType(exp->__anon1.op.exp2->destType);
16580 exp->__anon1.op.exp2->destType = exp->destType;
16581 if(exp->__anon1.op.op != '&' && exp->__anon1.op.op != '^')
16582 exp->__anon1.op.exp2->opDestType = 1;
16583 if(exp->destType)
16584 exp->destType->refCount++;
16585 }
16586 else
16587 {
16588 if(exp->__anon1.op.exp2->destType)
16589 FreeType(exp->__anon1.op.exp2->destType);
16590 exp->__anon1.op.exp2->destType = dummy;
16591 dummy->refCount++;
16592 if(powerOp)
16593 exp->__anon1.op.exp2->opDestType = 1;
16594 if(relationOp)
16595 exp->__anon1.op.exp2->usedInComparison = 1;
16596 }
16597 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))
16598 {
16599 FreeType(exp->__anon1.op.exp2->destType);
16600 exp->__anon1.op.exp2->destType = type1;
16601 type1->refCount++;
16602 }
16603 if(exp->__anon1.op.exp2->destType && exp->__anon1.op.op != '=')
16604 exp->__anon1.op.exp2->destType->count++;
16605 if(exp->__anon1.op.op == SIZEOF)
16606 {
16607 struct Expression * e = exp->__anon1.op.exp2;
16608
16609 while((e->type == 5 || e->type == 32 || e->type == 23) && e->__anon1.list)
16610 {
16611 if(e->type == 5 || e->type == 32 || e->type == 23)
16612 {
16613 if(e->type == 23)
16614 e = (*((struct Statement *)(*e->__anon1.compound->__anon1.compound.statements).last)->__anon1.expressions).last;
16615 else
16616 e = (*e->__anon1.list).last;
16617 }
16618 }
16619 if(e->type == 11 && e->__anon1.cast.exp)
16620 e->__anon1.cast.exp->needCast = 1;
16621 }
16622 if(exp->__anon1.op.op == '+' || exp->__anon1.op.op == '-')
16623 {
16624 if(exp->opDestType)
16625 exp->__anon1.op.exp2->parentOpDestType = 1;
16626 if(exp->usedInComparison)
16627 exp->__anon1.op.exp2->usedInComparison = 1;
16628 }
16629 ProcessExpressionType(exp->__anon1.op.exp2);
16630 exp->__anon1.op.exp2->opDestType = 0;
16631 exp->__anon1.op.exp2->usedInComparison = 0;
16632 if(exp->__anon1.op.exp2->destType && exp->__anon1.op.op != '=')
16633 exp->__anon1.op.exp2->destType->count--;
16634 if(!assign && (exp->__anon1.op.exp1 || exp->__anon1.op.op == '~'))
16635 {
16636 if(exp->__anon1.op.exp2->expType && (exp->__anon1.op.exp2->expType->kind == 1 || exp->__anon1.op.exp2->expType->kind == 2))
16637 {
16638 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);
16639
16640 FreeType(exp->__anon1.op.exp2->expType);
16641 exp->__anon1.op.exp2->expType = type;
16642 }
16643 }
16644 if(assign && type1 && type1->kind == 13 && exp->__anon1.op.exp2->expType)
16645 {
16646 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)
16647 {
16648 if(exp->__anon1.op.op != '=' && type1->__anon1.type->kind == 0)
16649 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "void *: unknown size\n", (((void *)0))));
16650 }
16651 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)))
16652 {
16653 if(exp->__anon1.op.op == ADD_ASSIGN)
16654 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "cannot add two pointers\n", (((void *)0))));
16655 }
16656 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))
16657 {
16658 if(exp->__anon1.op.op == ADD_ASSIGN)
16659 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "cannot add two pointers\n", (((void *)0))));
16660 }
16661 else if(inCompiler)
16662 {
16663 char type1String[1024];
16664 char type2String[1024];
16665
16666 type1String[0] = '\0';
16667 type2String[0] = '\0';
16668 PrintType(exp->__anon1.op.exp2->expType, type1String, 0, 1);
16669 PrintType(type1, type2String, 0, 1);
16670 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
16671 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expression %s (%s); expected %s\n", (((void *)0))), expString, type1String, type2String);
16672 }
16673 }
16674 if(exp->__anon1.op.exp2->destType == dummy)
16675 {
16676 FreeType(dummy);
16677 exp->__anon1.op.exp2->destType = (((void *)0));
16678 }
16679 if(exp->__anon1.op.op == '-' && !exp->__anon1.op.exp1 && exp->__anon1.op.exp2->expType && !exp->__anon1.op.exp2->expType->isSigned)
16680 {
16681 type2 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16682 type2->refCount = 1;
16683 CopyTypeInto(type2, exp->__anon1.op.exp2->expType);
16684 type2->isSigned = 1;
16685 }
16686 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))
16687 {
16688 type2 = __extension__ ({
16689 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16690
16691 __ecereInstance1->kind = 3, __ecereInstance1;
16692 });
16693 type2->refCount = 1;
16694 type2->isSigned = 1;
16695 }
16696 else
16697 {
16698 type2 = exp->__anon1.op.exp2->expType;
16699 if(type2)
16700 type2->refCount++;
16701 }
16702 }
16703 c1 = type1 && type1->kind == 8 && type1->__anon1._class ? type1->__anon1._class->__anon1.registered : (((void *)0));
16704 c2 = type2 && type2->kind == 8 && type2->__anon1._class ? type2->__anon1._class->__anon1.registered : (((void *)0));
16705 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))))
16706 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "ambiguous units in relational operation\n", (((void *)0))));
16707 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)))
16708 {
16709 if(exp->opDestType || exp->usedInComparison)
16710 exp->ambiguousUnits = 1;
16711 else
16712 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "ambiguous units\n", (((void *)0))));
16713 }
16714 dummy->kind = 0;
16715 if(exp->__anon1.op.op == SIZEOF)
16716 {
16717 exp->expType = __extension__ ({
16718 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16719
16720 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 23, __ecereInstance1;
16721 });
16722 exp->isConstant = 1;
16723 }
16724 else if(exp->__anon1.op.op == '*' && !exp->__anon1.op.exp1)
16725 {
16726 exp->expType = Dereference(type2);
16727 if(type2 && type2->kind == 8)
16728 notByReference = 1;
16729 }
16730 else if(exp->__anon1.op.op == '&' && !exp->__anon1.op.exp1)
16731 exp->expType = Reference(type2);
16732 else if(exp->__anon1.op.op == LEFT_OP || exp->__anon1.op.op == RIGHT_OP)
16733 {
16734 if(exp->__anon1.op.exp1->expType)
16735 {
16736 exp->expType = exp->__anon1.op.exp1->expType;
16737 exp->expType->refCount++;
16738 }
16739 }
16740 else if(!assign)
16741 {
16742 if(c1 && !c1->dataType)
16743 c1->dataType = ProcessTypeString(c1->dataTypeString, 0);
16744 if(c2 && !c2->dataType)
16745 c2->dataType = ProcessTypeString(c2->dataTypeString, 0);
16746 if(boolOps)
16747 {
16748 if(exp->__anon1.op.exp1)
16749 {
16750 if(exp->__anon1.op.exp1->destType)
16751 FreeType(exp->__anon1.op.exp1->destType);
16752 exp->__anon1.op.exp1->destType = MkClassType("bool");
16753 exp->__anon1.op.exp1->destType->truth = 1;
16754 if(!exp->__anon1.op.exp1->expType)
16755 ProcessExpressionType(exp->__anon1.op.exp1);
16756 else
16757 CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0);
16758 FreeType(exp->__anon1.op.exp1->expType);
16759 exp->__anon1.op.exp1->expType = MkClassType("bool");
16760 exp->__anon1.op.exp1->expType->truth = 1;
16761 }
16762 if(exp->__anon1.op.exp2)
16763 {
16764 if(exp->__anon1.op.exp2->destType)
16765 FreeType(exp->__anon1.op.exp2->destType);
16766 exp->__anon1.op.exp2->destType = MkClassType("bool");
16767 exp->__anon1.op.exp2->destType->truth = 1;
16768 if(!exp->__anon1.op.exp2->expType)
16769 ProcessExpressionType(exp->__anon1.op.exp2);
16770 else
16771 CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp2->destType, 0, 0);
16772 FreeType(exp->__anon1.op.exp2->expType);
16773 exp->__anon1.op.exp2->expType = MkClassType("bool");
16774 exp->__anon1.op.exp2->expType->truth = 1;
16775 }
16776 }
16777 else if(powerOp && exp->__anon1.op.exp1 && exp->__anon1.op.exp2 && ((c1 && c1->type == 3) || (c2 && c2->type == 3)))
16778 {
16779 if(c1 && c1->type == 3 && c2 && c2->type == 3)
16780 {
16781 if(c1->dataType->kind == 7)
16782 exp->expType = c1->dataType;
16783 else if(c2->dataType->kind == 7)
16784 exp->expType = c2->dataType;
16785 else if(c1->dataType->kind == 6)
16786 exp->expType = c1->dataType;
16787 else if(c2->dataType->kind == 6)
16788 exp->expType = c2->dataType;
16789 else
16790 exp->expType = c1->dataType;
16791 }
16792 else if((c1 && c1->type == 3) || exp->__anon1.op.op == '/')
16793 exp->expType = type1;
16794 else
16795 exp->expType = type2;
16796 if(exp->expType)
16797 exp->expType->refCount++;
16798 }
16799 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")))))
16800 {
16801 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"))))
16802 {
16803 if(exp->__anon1.op.op == '-' && ((c1 && c1->type == 4) || (c2 && c2->type == 4)))
16804 {
16805 struct Type * intType = ProcessTypeString((c1 && c1->dataType->kind == 4) || (c2 && c2->dataType->kind == 4) ? "int64" : "int", 0);
16806
16807 if(exp->__anon1.op.exp1->destType)
16808 FreeType(exp->__anon1.op.exp1->destType);
16809 if(exp->__anon1.op.exp2->destType)
16810 FreeType(exp->__anon1.op.exp2->destType);
16811 exp->__anon1.op.exp1->destType = intType;
16812 exp->__anon1.op.exp2->destType = intType;
16813 intType->refCount++;
16814 }
16815 else
16816 {
16817 if(exp->__anon1.op.exp2->destType)
16818 FreeType(exp->__anon1.op.exp2->destType);
16819 exp->__anon1.op.exp2->destType = type1;
16820 type1->refCount++;
16821 if(exp->__anon1.op.exp1->destType)
16822 FreeType(exp->__anon1.op.exp1->destType);
16823 exp->__anon1.op.exp1->destType = type2;
16824 type2->refCount++;
16825 }
16826 if(!boolResult && !exp->opDestType && (!exp->destType || exp->destType->kind != 8) && c1 && c1->type == 3 && c2 && c2->type == 3 && c1 != c2)
16827 {
16828 if(exp->usedInComparison || exp->parentOpDestType)
16829 exp->ambiguousUnits = 1;
16830 else
16831 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);
16832 }
16833 if(type1->kind == 13 && type1->__anon1.type->kind == 20 && type2->kind != 13)
16834 {
16835 struct Expression * argExp = GetTemplateArgExp(type1->__anon1.type->__anon1.templateParameter, thisClass, 1);
16836
16837 if(argExp)
16838 {
16839 struct Expression * classExp = MkExpMember(argExp, MkIdentifier("dataTypeClass"));
16840
16841 exp->__anon1.op.exp1 = MkExpBrackets(MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName("byte")), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), exp->__anon1.op.exp1)));
16842 ProcessExpressionType(exp->__anon1.op.exp1);
16843 if(type2->kind != 13)
16844 {
16845 ProcessExpressionType(classExp);
16846 exp->__anon1.op.exp2 = MkExpBrackets(MkListOne(MkExpOp(exp->__anon1.op.exp2, '*', MkExpMember(classExp, MkIdentifier("typeSize")))));
16847 if(!exp->__anon1.op.exp2->expType)
16848 {
16849 if(type2)
16850 FreeType(type2);
16851 type2 = exp->__anon1.op.exp2->expType = ProcessTypeString("int", 0);
16852 c2 = (((void *)0));
16853 type2->refCount++;
16854 }
16855 ProcessExpressionType(exp->__anon1.op.exp2);
16856 }
16857 }
16858 }
16859 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)))
16860 {
16861 if(type1->kind != 8 && type1->__anon1.type->kind == 0)
16862 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "void *: unknown size\n", (((void *)0))));
16863 exp->expType = type1;
16864 if(type1)
16865 type1->refCount++;
16866 }
16867 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)))
16868 {
16869 if(type2->kind != 8 && type2->__anon1.type->kind == 0)
16870 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "void *: unknown size\n", (((void *)0))));
16871 exp->expType = type2;
16872 if(type2)
16873 type2->refCount++;
16874 }
16875 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))
16876 {
16877 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "different levels of indirection\n", (((void *)0))));
16878 }
16879 else
16880 {
16881 unsigned int success = 0;
16882
16883 if(type1->kind == 13 && type2->kind == 13)
16884 {
16885 if(exp->__anon1.op.op == '+')
16886 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "cannot add two pointers\n", (((void *)0))));
16887 else if(exp->__anon1.op.op == '-')
16888 {
16889 if(MatchTypes(type1->__anon1.type, type2->__anon1.type, (((void *)0)), (((void *)0)), (((void *)0)), 0, 0, 0, 0, 0))
16890 {
16891 exp->expType = __extension__ ({
16892 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16893
16894 __ecereInstance1->kind = 3, __ecereInstance1->refCount = 1, __ecereInstance1;
16895 });
16896 success = 1;
16897 if(type1->__anon1.type->kind == 20)
16898 {
16899 struct Expression * argExp = GetTemplateArgExp(type1->__anon1.type->__anon1.templateParameter, thisClass, 1);
16900
16901 if(argExp)
16902 {
16903 struct Expression * classExp = MkExpMember(argExp, MkIdentifier("dataTypeClass"));
16904
16905 ProcessExpressionType(classExp);
16906 exp->type = 5;
16907 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"))));
16908 ProcessExpressionType(((struct Expression *)(*exp->__anon1.list).first)->__anon1.op.exp2);
16909 FreeType(dummy);
16910 return ;
16911 }
16912 }
16913 }
16914 }
16915 }
16916 if(!success && exp->__anon1.op.exp1->type == 2)
16917 {
16918 if(CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0))
16919 {
16920 if(exp->expType)
16921 FreeType(exp->expType);
16922 exp->expType = exp->__anon1.op.exp1->destType;
16923 if(exp->__anon1.op.exp1->destType)
16924 exp->__anon1.op.exp1->destType->refCount++;
16925 success = 1;
16926 }
16927 else if(CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp2->destType, 0, 0))
16928 {
16929 if(exp->expType)
16930 FreeType(exp->expType);
16931 exp->expType = exp->__anon1.op.exp2->destType;
16932 if(exp->__anon1.op.exp2->destType)
16933 exp->__anon1.op.exp2->destType->refCount++;
16934 success = 1;
16935 }
16936 }
16937 else if(!success)
16938 {
16939 if(CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp2->destType, 0, 0))
16940 {
16941 if(exp->expType)
16942 FreeType(exp->expType);
16943 exp->expType = exp->__anon1.op.exp2->destType;
16944 if(exp->__anon1.op.exp2->destType)
16945 exp->__anon1.op.exp2->destType->refCount++;
16946 success = 1;
16947 }
16948 else if(CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0))
16949 {
16950 if(exp->expType)
16951 FreeType(exp->expType);
16952 exp->expType = exp->__anon1.op.exp1->destType;
16953 if(exp->__anon1.op.exp1->destType)
16954 exp->__anon1.op.exp1->destType->refCount++;
16955 success = 1;
16956 }
16957 }
16958 if(!success)
16959 {
16960 char expString1[10240];
16961 char expString2[10240];
16962 char type1[1024];
16963 char type2[1024];
16964
16965 expString1[0] = '\0';
16966 expString2[0] = '\0';
16967 type1[0] = '\0';
16968 type2[0] = '\0';
16969 if(inCompiler)
16970 {
16971 PrintExpression(exp->__anon1.op.exp1, expString1);
16972 __ecereNameSpace__ecere__sys__ChangeCh(expString1, '\n', ' ');
16973 PrintExpression(exp->__anon1.op.exp2, expString2);
16974 __ecereNameSpace__ecere__sys__ChangeCh(expString2, '\n', ' ');
16975 PrintType(exp->__anon1.op.exp1->expType, type1, 0, 1);
16976 PrintType(exp->__anon1.op.exp2->expType, type2, 0, 1);
16977 }
16978 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expressions %s (%s) and %s (%s)\n", (((void *)0))), expString1, type1, expString2, type2);
16979 }
16980 }
16981 }
16982 else if(!boolResult && !useSideUnit && c2 && c2->type == 3 && type1 && type1->kind != 8)
16983 {
16984 if(exp->__anon1.op.exp1->destType)
16985 FreeType(exp->__anon1.op.exp1->destType);
16986 exp->__anon1.op.exp1->destType = type2->__anon1._class->__anon1.registered->dataType;
16987 if(type2->__anon1._class->__anon1.registered->dataType)
16988 type2->__anon1._class->__anon1.registered->dataType->refCount++;
16989 CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0);
16990 exp->expType = type2;
16991 if(type2)
16992 type2->refCount++;
16993 }
16994 else if(!boolResult && !useSideUnit && c1 && c1->type == 3 && type2 && type2->kind != 8)
16995 {
16996 if(exp->__anon1.op.exp2->destType)
16997 FreeType(exp->__anon1.op.exp2->destType);
16998 exp->__anon1.op.exp2->destType = type1->__anon1._class->__anon1.registered->dataType;
16999 if(type1->__anon1._class->__anon1.registered->dataType)
17000 type1->__anon1._class->__anon1.registered->dataType->refCount++;
17001 CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp2->destType, 0, 0);
17002 exp->expType = type1;
17003 if(type1)
17004 type1->refCount++;
17005 }
17006 else if(type1)
17007 {
17008 unsigned int valid = 0;
17009
17010 if(!boolResult && useSideUnit && c1 && c1->type == 3 && type2 && type2->kind != 8)
17011 {
17012 if(exp->__anon1.op.exp2->destType)
17013 FreeType(exp->__anon1.op.exp2->destType);
17014 exp->__anon1.op.exp2->destType = c1->dataType;
17015 exp->__anon1.op.exp2->destType->refCount++;
17016 CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp2->destType, 0, 0);
17017 if(type2)
17018 FreeType(type2);
17019 type2 = exp->__anon1.op.exp2->destType;
17020 c2 = type2 && type2->kind == 8 && type2->__anon1._class ? type2->__anon1._class->__anon1.registered : (((void *)0));
17021 if(type2)
17022 type2->refCount++;
17023 exp->expType = type2;
17024 type2->refCount++;
17025 }
17026 if(!boolResult && useSideUnit && c2 && c2->type == 3 && type1 && type1->kind != 8)
17027 {
17028 if(exp->__anon1.op.exp1->destType)
17029 FreeType(exp->__anon1.op.exp1->destType);
17030 exp->__anon1.op.exp1->destType = c2->dataType;
17031 exp->__anon1.op.exp1->destType->refCount++;
17032 CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0);
17033 type1 = exp->__anon1.op.exp1->destType;
17034 c1 = type1 && type1->kind == 8 && type1->__anon1._class ? type1->__anon1._class->__anon1.registered : (((void *)0));
17035 exp->expType = type1;
17036 type1->refCount++;
17037 }
17038 if(!boolResult || exp->__anon1.op.op == '>' || exp->__anon1.op.op == '<' || exp->__anon1.op.op == GE_OP || exp->__anon1.op.op == LE_OP)
17039 {
17040 unsigned int op1IsEnum = c1 && c1->type == 4;
17041 unsigned int op2IsEnum = c2 && c2->type == 4;
17042
17043 if(exp->__anon1.op.op == '*' || exp->__anon1.op.op == '/' || exp->__anon1.op.op == '-' || exp->__anon1.op.op == '|' || exp->__anon1.op.op == '^')
17044 {
17045 if(op1IsEnum && exp->__anon1.op.exp2->expType)
17046 {
17047 if(CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp2->expType, 0, 0))
17048 {
17049 if(exp->expType)
17050 FreeType(exp->expType);
17051 exp->expType = exp->__anon1.op.exp2->expType;
17052 if(exp->__anon1.op.exp2->expType)
17053 exp->__anon1.op.exp2->expType->refCount++;
17054 valid = 1;
17055 }
17056 }
17057 else if(op2IsEnum && exp->__anon1.op.exp1->expType)
17058 {
17059 if(CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp1->expType, 0, 0))
17060 {
17061 if(exp->expType)
17062 FreeType(exp->expType);
17063 exp->expType = exp->__anon1.op.exp1->expType;
17064 if(exp->__anon1.op.exp1->expType)
17065 exp->__anon1.op.exp1->expType->refCount++;
17066 valid = 1;
17067 }
17068 }
17069 }
17070 else
17071 {
17072 if(op1IsEnum && exp->__anon1.op.exp2->expType)
17073 {
17074 if(CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp2->expType, 0, 0))
17075 {
17076 if(exp->expType)
17077 FreeType(exp->expType);
17078 exp->expType = exp->__anon1.op.exp1->expType;
17079 if(exp->__anon1.op.exp1->expType)
17080 exp->__anon1.op.exp1->expType->refCount++;
17081 valid = 1;
17082 }
17083 }
17084 else if(op2IsEnum && exp->__anon1.op.exp1->expType)
17085 {
17086 if(CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp1->expType, 0, 0))
17087 {
17088 if(exp->expType)
17089 FreeType(exp->expType);
17090 exp->expType = exp->__anon1.op.exp2->expType;
17091 if(exp->__anon1.op.exp2->expType)
17092 exp->__anon1.op.exp2->expType->refCount++;
17093 valid = 1;
17094 }
17095 }
17096 }
17097 }
17098 if(!valid)
17099 {
17100 if(c2 && c2->type == 3 && (!c1 || c1->type != 3))
17101 {
17102 if(exp->__anon1.op.exp1->destType)
17103 FreeType(exp->__anon1.op.exp1->destType);
17104 exp->__anon1.op.exp1->destType = type2;
17105 type2->refCount++;
17106 if(CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0))
17107 {
17108 if(exp->expType)
17109 FreeType(exp->expType);
17110 exp->expType = exp->__anon1.op.exp1->destType;
17111 if(exp->__anon1.op.exp1->destType)
17112 exp->__anon1.op.exp1->destType->refCount++;
17113 }
17114 }
17115 else
17116 {
17117 if(exp->__anon1.op.exp2->destType)
17118 FreeType(exp->__anon1.op.exp2->destType);
17119 exp->__anon1.op.exp2->destType = type1;
17120 type1->refCount++;
17121 if(CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp2->destType, 0, 0))
17122 {
17123 if(exp->expType)
17124 FreeType(exp->expType);
17125 exp->expType = exp->__anon1.op.exp2->destType;
17126 if(exp->__anon1.op.exp2->destType)
17127 exp->__anon1.op.exp2->destType->refCount++;
17128 }
17129 else if(type1 && type2)
17130 {
17131 char expString1[10240];
17132 char expString2[10240];
17133 char type1String[1024];
17134 char type2String[1024];
17135
17136 expString1[0] = '\0';
17137 expString2[0] = '\0';
17138 type1String[0] = '\0';
17139 type2String[0] = '\0';
17140 if(inCompiler)
17141 {
17142 PrintExpression(exp->__anon1.op.exp1, expString1);
17143 __ecereNameSpace__ecere__sys__ChangeCh(expString1, '\n', ' ');
17144 PrintExpression(exp->__anon1.op.exp2, expString2);
17145 __ecereNameSpace__ecere__sys__ChangeCh(expString2, '\n', ' ');
17146 PrintType(exp->__anon1.op.exp1->expType, type1String, 0, 1);
17147 PrintType(exp->__anon1.op.exp2->expType, type2String, 0, 1);
17148 }
17149 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expressions %s (%s) and %s (%s)\n", (((void *)0))), expString1, type1String, expString2, type2String);
17150 if(c1 && c1->type == 4)
17151 {
17152 exp->expType = exp->__anon1.op.exp1->expType;
17153 if(exp->__anon1.op.exp1->expType)
17154 exp->__anon1.op.exp1->expType->refCount++;
17155 }
17156 else if(c2 && c2->type == 4)
17157 {
17158 exp->expType = exp->__anon1.op.exp2->expType;
17159 if(exp->__anon1.op.exp2->expType)
17160 exp->__anon1.op.exp2->expType->refCount++;
17161 }
17162 }
17163 }
17164 }
17165 }
17166 else if(type2)
17167 {
17168 if(c2 && c2->type == 4)
17169 {
17170 struct Type * oldType = exp->__anon1.op.exp1->expType;
17171
17172 exp->__anon1.op.exp1->expType = (((void *)0));
17173 if(CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0))
17174 FreeType(oldType);
17175 else
17176 exp->__anon1.op.exp1->expType = oldType;
17177 }
17178 if(exp->__anon1.op.exp1->destType)
17179 FreeType(exp->__anon1.op.exp1->destType);
17180 exp->__anon1.op.exp1->destType = type2;
17181 type2->refCount++;
17182 if(CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0))
17183 {
17184 if(exp->expType)
17185 FreeType(exp->expType);
17186 exp->expType = exp->__anon1.op.exp1->destType;
17187 if(exp->__anon1.op.exp1->destType)
17188 exp->__anon1.op.exp1->destType->refCount++;
17189 }
17190 }
17191 }
17192 else if(type2 && (!type1 || (type2->kind == 8 && type1->kind != 8)))
17193 {
17194 if(type1 && c2 && c2->type == 3)
17195 {
17196 if(exp->__anon1.op.exp1->destType)
17197 FreeType(exp->__anon1.op.exp1->destType);
17198 exp->__anon1.op.exp1->destType = type2->__anon1._class->__anon1.registered->dataType;
17199 if(type2->__anon1._class->__anon1.registered->dataType)
17200 type2->__anon1._class->__anon1.registered->dataType->refCount++;
17201 CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0);
17202 }
17203 if(exp->__anon1.op.op == '!')
17204 {
17205 exp->expType = MkClassType("bool");
17206 exp->expType->truth = 1;
17207 }
17208 else
17209 {
17210 exp->expType = type2;
17211 if(type2)
17212 type2->refCount++;
17213 }
17214 }
17215 else if(type1 && (!type2 || (type1->kind == 8 && type2->kind != 8)))
17216 {
17217 if(c2 && c2->type == 3)
17218 {
17219 if(exp->__anon1.op.exp2->destType)
17220 FreeType(exp->__anon1.op.exp2->destType);
17221 exp->__anon1.op.exp2->destType = type1->__anon1._class->__anon1.registered->dataType;
17222 if(type1->__anon1._class->__anon1.registered->dataType)
17223 type1->__anon1._class->__anon1.registered->dataType->refCount++;
17224 CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp2->destType, 0, 0);
17225 }
17226 exp->expType = type1;
17227 if(type1)
17228 type1->refCount++;
17229 }
17230 }
17231 yylloc = exp->loc;
17232 if(exp->__anon1.op.exp1 && !exp->__anon1.op.exp1->expType)
17233 {
17234 char expString[10000];
17235
17236 expString[0] = '\0';
17237 if(inCompiler)
17238 {
17239 PrintExpression(exp->__anon1.op.exp1, expString);
17240 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
17241 }
17242 if(expString[0])
17243 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s\n", (((void *)0))), expString);
17244 }
17245 if(exp->__anon1.op.exp2 && !exp->__anon1.op.exp2->expType)
17246 {
17247 char expString[10240];
17248
17249 expString[0] = '\0';
17250 if(inCompiler)
17251 {
17252 PrintExpression(exp->__anon1.op.exp2, expString);
17253 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
17254 }
17255 if(expString[0])
17256 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s\n", (((void *)0))), expString);
17257 }
17258 if(boolResult)
17259 {
17260 FreeType(exp->expType);
17261 exp->expType = MkClassType("bool");
17262 exp->expType->truth = 1;
17263 }
17264 if(exp->__anon1.op.op != SIZEOF)
17265 exp->isConstant = (!exp->__anon1.op.exp1 || exp->__anon1.op.exp1->isConstant) && (!exp->__anon1.op.exp2 || exp->__anon1.op.exp2->isConstant);
17266 if(exp->__anon1.op.op == SIZEOF && exp->__anon1.op.exp2->expType)
17267 {
17268 DeclareType(curExternal, exp->__anon1.op.exp2->expType, 1, 0);
17269 }
17270 if(exp->__anon1.op.op == DELETE && exp->__anon1.op.exp2 && exp->__anon1.op.exp2->expType && __ecereProp_Type_Get_specConst(exp->__anon1.op.exp2->expType))
17271 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "deleting const qualified object\n", (((void *)0))));
17272 yylloc = oldyylloc;
17273 FreeType(dummy);
17274 if(type2)
17275 FreeType(type2);
17276 break;
17277 }
17278 case 5:
17279 case 32:
17280 {
17281 struct Expression * e;
17282
17283 exp->isConstant = 1;
17284 for(e = (*exp->__anon1.list).first; e; e = e->next)
17285 {
17286 if(!e->next)
17287 {
17288 FreeType(e->destType);
17289 e->opDestType = exp->opDestType;
17290 e->usedInComparison = exp->usedInComparison;
17291 e->parentOpDestType = exp->parentOpDestType;
17292 e->destType = exp->destType;
17293 if(e->destType)
17294 {
17295 exp->destType->refCount++;
17296 }
17297 }
17298 ProcessExpressionType(e);
17299 if(e->ambiguousUnits)
17300 exp->ambiguousUnits = 1;
17301 if(!exp->expType && !e->next)
17302 {
17303 exp->expType = e->expType;
17304 if(e->expType)
17305 e->expType->refCount++;
17306 exp->needCast = e->needCast;
17307 }
17308 if(!e->isConstant)
17309 exp->isConstant = 0;
17310 }
17311 e = (*exp->__anon1.list).first;
17312 if(!e->next && e->type == 8)
17313 {
17314 struct Expression * next = exp->next, * prev = exp->prev;
17315
17316 FreeType(exp->expType);
17317 FreeType(exp->destType);
17318 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->__anon1.list), exp->__anon1.list = 0);
17319 *exp = *e;
17320 exp->prev = prev;
17321 exp->next = next;
17322 ((e ? __extension__ ({
17323 void * __ecerePtrToDelete = (e);
17324
17325 __ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)__ecerePtrToDelete) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(__ecerePtrToDelete);
17326 }) : 0), e = 0);
17327 ProcessExpressionType(exp);
17328 }
17329 break;
17330 }
17331 case 6:
17332 {
17333 struct Expression * e;
17334
17335 exp->isConstant = 1;
17336 ProcessExpressionType(exp->__anon1.index.exp);
17337 if(!exp->__anon1.index.exp->isConstant)
17338 exp->isConstant = 0;
17339 if(exp->__anon1.index.exp->expType)
17340 {
17341 struct Type * source = exp->__anon1.index.exp->expType;
17342
17343 if(source->kind == 8 && source->__anon1._class && source->__anon1._class->__anon1.registered)
17344 {
17345 struct __ecereNameSpace__ecere__com__Class * _class = source->__anon1._class->__anon1.registered;
17346 struct __ecereNameSpace__ecere__com__Class * c = _class->templateClass ? _class->templateClass : _class;
17347
17348 if(_class != containerClass && __ecereNameSpace__ecere__com__eClass_IsDerived(c, containerClass) && _class->templateArgs)
17349 {
17350 exp->expType = ProcessTypeString(_class->templateArgs[2].__anon1.__anon1.dataTypeString, 0);
17351 if(exp->__anon1.index.index && (*exp->__anon1.index.index).last)
17352 {
17353 struct Type * type = ProcessTypeString(_class->templateArgs[1].__anon1.__anon1.dataTypeString, 0);
17354
17355 if(type->kind == 8)
17356 type->constant = 1;
17357 else if(type->kind == 13)
17358 {
17359 struct Type * t = type;
17360
17361 while(t->kind == 13)
17362 t = t->__anon1.type;
17363 t->constant = 1;
17364 }
17365 ((struct Expression *)(*exp->__anon1.index.index).last)->destType = type;
17366 }
17367 }
17368 }
17369 }
17370 for(e = (*exp->__anon1.index.index).first; e; e = e->next)
17371 {
17372 if(!e->next && exp->__anon1.index.exp->expType && exp->__anon1.index.exp->expType->kind == 12 && exp->__anon1.index.exp->expType->__anon1.__anon4.enumClass)
17373 {
17374 if(e->destType)
17375 FreeType(e->destType);
17376 e->destType = MkClassType(exp->__anon1.index.exp->expType->__anon1.__anon4.enumClass->string);
17377 }
17378 ProcessExpressionType(e);
17379 if(!e->next)
17380 {
17381 }
17382 if(!e->isConstant)
17383 exp->isConstant = 0;
17384 }
17385 if(!exp->expType)
17386 exp->expType = Dereference(exp->__anon1.index.exp->expType);
17387 if(exp->expType)
17388 DeclareType(curExternal, exp->expType, 1, 0);
17389 break;
17390 }
17391 case 7:
17392 {
17393 struct Expression * e;
17394 struct Type * functionType;
17395 struct Type * methodType = (((void *)0));
17396 char name[1024];
17397
17398 name[0] = '\0';
17399 if(inCompiler)
17400 {
17401 PrintExpression(exp->__anon1.call.exp, name);
17402 if(exp->__anon1.call.exp->expType && !exp->__anon1.call.exp->expType->__anon1.__anon2.returnType)
17403 {
17404 PrintExpression(exp->__anon1.call.exp, name);
17405 }
17406 }
17407 if(exp->__anon1.call.exp->type == 0)
17408 {
17409 struct Expression * idExp = exp->__anon1.call.exp;
17410 struct Identifier * id = idExp->__anon1.__anon1.identifier;
17411
17412 if(!strcmp(id->string, "__builtin_frame_address"))
17413 {
17414 exp->expType = ProcessTypeString("void *", 1);
17415 if(exp->__anon1.call.arguments && (*exp->__anon1.call.arguments).first)
17416 ProcessExpressionType((*exp->__anon1.call.arguments).first);
17417 break;
17418 }
17419 else if(!strcmp(id->string, "__ENDIAN_PAD"))
17420 {
17421 exp->expType = ProcessTypeString("int", 1);
17422 if(exp->__anon1.call.arguments && (*exp->__anon1.call.arguments).first)
17423 ProcessExpressionType((*exp->__anon1.call.arguments).first);
17424 break;
17425 }
17426 else if(!strcmp(id->string, "Max") || !strcmp(id->string, "Min") || !strcmp(id->string, "Sgn") || !strcmp(id->string, "Abs"))
17427 {
17428 struct Expression * a = (((void *)0));
17429 struct Expression * b = (((void *)0));
17430 struct Expression * tempExp1 = (((void *)0)), * tempExp2 = (((void *)0));
17431
17432 if((!strcmp(id->string, "Max") || !strcmp(id->string, "Min")) && (*exp->__anon1.call.arguments).count == 2)
17433 {
17434 a = (*exp->__anon1.call.arguments).first;
17435 b = (*exp->__anon1.call.arguments).last;
17436 tempExp1 = a;
17437 tempExp2 = b;
17438 }
17439 else if((*exp->__anon1.call.arguments).count == 1)
17440 {
17441 a = (*exp->__anon1.call.arguments).first;
17442 tempExp1 = a;
17443 }
17444 if(a)
17445 {
17446 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear((&*exp->__anon1.call.arguments));
17447 idExp->__anon1.__anon1.identifier = (((void *)0));
17448 FreeExpContents(exp);
17449 ProcessExpressionType(a);
17450 if(b)
17451 ProcessExpressionType(b);
17452 exp->type = 5;
17453 exp->__anon1.list = MkList();
17454 if(a->expType && (!b || b->expType))
17455 {
17456 if((!a->isConstant && a->type != 0) || (b && !b->isConstant && b->type != 0))
17457 {
17458 if(inCompiler)
17459 {
17460 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
17461 struct __ecereNameSpace__ecere__sys__OldList * decls = MkList();
17462 struct Declaration * decl;
17463 char temp1[1024], temp2[1024];
17464
17465 GetTypeSpecs(a->expType, specs);
17466 if(a && !a->isConstant && a->type != 0)
17467 {
17468 sprintf(temp1, "__simpleStruct%d", curContext->simpleID++);
17469 ListAdd(decls, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(temp1)), (((void *)0))));
17470 tempExp1 = QMkExpId(temp1);
17471 tempExp1->expType = a->expType;
17472 if(a->expType)
17473 a->expType->refCount++;
17474 ListAdd(exp->__anon1.list, MkExpOp(CopyExpression(tempExp1), '=', a));
17475 }
17476 if(b && !b->isConstant && b->type != 0)
17477 {
17478 sprintf(temp2, "__simpleStruct%d", curContext->simpleID++);
17479 ListAdd(decls, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(temp2)), (((void *)0))));
17480 tempExp2 = QMkExpId(temp2);
17481 tempExp2->expType = b->expType;
17482 if(b->expType)
17483 b->expType->refCount++;
17484 ListAdd(exp->__anon1.list, MkExpOp(CopyExpression(tempExp2), '=', b));
17485 }
17486 decl = MkDeclaration(specs, decls);
17487 if(!curCompound->__anon1.compound.declarations)
17488 curCompound->__anon1.compound.declarations = MkList();
17489 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*curCompound->__anon1.compound.declarations), (((void *)0)), decl);
17490 }
17491 }
17492 }
17493 if(!strcmp(id->string, "Max") || !strcmp(id->string, "Min"))
17494 {
17495 int op = (!strcmp(id->string, "Max")) ? '>' : '<';
17496
17497 ListAdd(exp->__anon1.list, MkExpCondition(MkExpBrackets(MkListOne(MkExpOp(CopyExpression(tempExp1), op, CopyExpression(tempExp2)))), MkListOne(CopyExpression(tempExp1)), CopyExpression(tempExp2)));
17498 exp->expType = a->expType;
17499 if(a->expType)
17500 a->expType->refCount++;
17501 }
17502 else if(!strcmp(id->string, "Abs"))
17503 {
17504 ListAdd(exp->__anon1.list, MkExpCondition(MkExpBrackets(MkListOne(MkExpOp(CopyExpression(tempExp1), '<', MkExpConstant("0")))), MkListOne(MkExpOp((((void *)0)), '-', CopyExpression(tempExp1))), CopyExpression(tempExp1)));
17505 exp->expType = a->expType;
17506 if(a->expType)
17507 a->expType->refCount++;
17508 }
17509 else if(!strcmp(id->string, "Sgn"))
17510 {
17511 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"))))));
17512 exp->expType = ProcessTypeString("int", 0);
17513 }
17514 FreeExpression(tempExp1);
17515 if(tempExp2)
17516 FreeExpression(tempExp2);
17517 FreeIdentifier(id);
17518 break;
17519 }
17520 }
17521 }
17522 {
17523 struct Type * dummy = (dummy = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), dummy->count = 1, dummy->refCount = 1, dummy);
17524
17525 if(!exp->__anon1.call.exp->destType)
17526 {
17527 exp->__anon1.call.exp->destType = dummy;
17528 dummy->refCount++;
17529 }
17530 ProcessExpressionType(exp->__anon1.call.exp);
17531 if(exp->__anon1.call.exp->destType == dummy)
17532 {
17533 FreeType(dummy);
17534 exp->__anon1.call.exp->destType = (((void *)0));
17535 }
17536 FreeType(dummy);
17537 }
17538 functionType = exp->__anon1.call.exp->expType;
17539 if(functionType && functionType->kind == 16)
17540 {
17541 methodType = functionType;
17542 functionType = methodType->__anon1.__anon3.method->dataType;
17543 if(exp->__anon1.call.exp->expType->__anon1.__anon3.usedClass)
17544 {
17545 char typeString[1024];
17546
17547 typeString[0] = '\0';
17548 {
17549 struct Symbol * back = functionType->__anon1.__anon2.thisClass;
17550
17551 functionType->__anon1.__anon2.thisClass = (((void *)0));
17552 PrintType(functionType, typeString, 1, 1);
17553 functionType->__anon1.__anon2.thisClass = back;
17554 }
17555 if(strstr(typeString, "thisclass"))
17556 {
17557 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
17558 struct Declarator * decl;
17559
17560 {
17561 struct Context * context = SetupTemplatesContext(exp->__anon1.call.exp->expType->__anon1.__anon3.usedClass);
17562
17563 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
17564 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))
17565 thisClassParams = 0;
17566 ReplaceThisClassSpecifiers(specs, exp->__anon1.call.exp->expType->__anon1.__anon3.usedClass);
17567 {
17568 struct __ecereNameSpace__ecere__com__Class * backupThisClass = thisClass;
17569
17570 thisClass = exp->__anon1.call.exp->expType->__anon1.__anon3.usedClass;
17571 ProcessDeclarator(decl, 1);
17572 thisClass = backupThisClass;
17573 }
17574 thisClassParams = 1;
17575 functionType = ProcessType(specs, decl);
17576 functionType->refCount = 0;
17577 FinishTemplatesContext(context);
17578 {
17579 struct Type * p, * op;
17580
17581 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)
17582 {
17583 if(op->kind == 21)
17584 p->thisClassFrom = methodType->__anon1.__anon3.method->_class;
17585 }
17586 }
17587 if(methodType->__anon1.__anon3.method->dataType->__anon1.__anon2.returnType->kind == 21)
17588 {
17589 functionType->__anon1.__anon2.returnType->thisClassFrom = methodType->__anon1.__anon3.method->_class;
17590 }
17591 }
17592 FreeList(specs, (void *)(FreeSpecifier));
17593 FreeDeclarator(decl);
17594 }
17595 }
17596 }
17597 if(functionType && functionType->kind == 13 && functionType->__anon1.type && functionType->__anon1.type->kind == 11)
17598 {
17599 struct Type * type = functionType->__anon1.type;
17600
17601 if(!functionType->refCount)
17602 {
17603 functionType->__anon1.type = (((void *)0));
17604 FreeType(functionType);
17605 }
17606 functionType = type;
17607 }
17608 if(functionType && functionType->kind != 11)
17609 {
17610 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "called object %s is not a function\n", (((void *)0))), name);
17611 }
17612 else if(functionType)
17613 {
17614 unsigned int emptyParams = 0, noParams = 0;
17615 struct Expression * e = exp->__anon1.call.arguments ? (*exp->__anon1.call.arguments).first : (((void *)0));
17616 struct Type * type = functionType->__anon1.__anon2.params.first;
17617 struct Expression * memberExp = (exp->__anon1.call.exp->type == 8) ? exp->__anon1.call.exp : (((void *)0));
17618 int extra = 0;
17619 struct Location oldyylloc = yylloc;
17620
17621 if(!type)
17622 emptyParams = 1;
17623 if(functionType->extraParam && e && functionType->__anon1.__anon2.thisClass)
17624 {
17625 e->destType = MkClassType(functionType->__anon1.__anon2.thisClass->string);
17626 e = e->next;
17627 }
17628 if(!functionType->__anon1.__anon2.staticMethod && !functionType->extraParam)
17629 {
17630 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)
17631 {
17632 type = MkClassType(memberExp->__anon1.member.exp->expType->__anon1._class->string);
17633 if(e)
17634 {
17635 e->destType = type;
17636 e = e->next;
17637 type = functionType->__anon1.__anon2.params.first;
17638 }
17639 else
17640 type->refCount = 0;
17641 }
17642 else if(!memberExp && (functionType->__anon1.__anon2.thisClass || (methodType && methodType->__anon1.__anon3.methodClass)))
17643 {
17644 type = MkClassType(functionType->__anon1.__anon2.thisClass ? functionType->__anon1.__anon2.thisClass->string : (methodType ? methodType->__anon1.__anon3.methodClass->fullName : (((void *)0))));
17645 type->byReference = functionType->byReference;
17646 type->typedByReference = functionType->typedByReference;
17647 if(e)
17648 {
17649 if(e->next && type->kind == 8 && (functionType && functionType->__anon1.__anon2.thisClass) && functionType->classObjectType == 2)
17650 e = e->next;
17651 e->destType = type;
17652 e = e->next;
17653 type = functionType->__anon1.__anon2.params.first;
17654 }
17655 else
17656 type->refCount = 0;
17657 }
17658 }
17659 if(type && type->kind == 0)
17660 {
17661 noParams = 1;
17662 if(!type->refCount)
17663 FreeType(type);
17664 type = (((void *)0));
17665 }
17666 for(; e; e = e->next)
17667 {
17668 if(!type && !emptyParams)
17669 {
17670 yylloc = e->loc;
17671 if(methodType && methodType->__anon1.__anon3.methodClass)
17672 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);
17673 else
17674 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);
17675 break;
17676 }
17677 if(methodType && type && type->kind == 20 && type->__anon1.templateParameter->type == 0)
17678 {
17679 struct Type * templatedType = (((void *)0));
17680 struct __ecereNameSpace__ecere__com__Class * _class = methodType->__anon1.__anon3.usedClass;
17681 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
17682 int id = 0;
17683
17684 if(_class && _class->templateArgs)
17685 {
17686 struct __ecereNameSpace__ecere__com__Class * sClass;
17687
17688 for(sClass = _class; sClass; sClass = sClass->base)
17689 {
17690 if(sClass->templateClass)
17691 sClass = sClass->templateClass;
17692 id = 0;
17693 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
17694 {
17695 if(curParam->type == 0 && !strcmp(type->__anon1.templateParameter->identifier->string, curParam->name))
17696 {
17697 struct __ecereNameSpace__ecere__com__Class * nextClass;
17698
17699 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
17700 {
17701 if(nextClass->templateClass)
17702 nextClass = nextClass->templateClass;
17703 id += nextClass->templateParams.count;
17704 }
17705 break;
17706 }
17707 id++;
17708 }
17709 if(curParam)
17710 break;
17711 }
17712 }
17713 if(curParam && _class->templateArgs[id].__anon1.__anon1.dataTypeString)
17714 {
17715 unsigned int constant = type->constant;
17716 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = _class->templateArgs[id];
17717
17718 {
17719 struct Context * context = SetupTemplatesContext(_class);
17720
17721 templatedType = ProcessTypeString(arg.__anon1.__anon1.dataTypeString, 0);
17722 FinishTemplatesContext(context);
17723 }
17724 if(templatedType->kind == 8 && constant)
17725 templatedType->constant = 1;
17726 else if(templatedType->kind == 13)
17727 {
17728 struct Type * t = templatedType->__anon1.type;
17729
17730 while(t->kind == 13)
17731 t = t->__anon1.type;
17732 if(constant)
17733 t->constant = constant;
17734 }
17735 e->destType = templatedType;
17736 if(templatedType)
17737 {
17738 templatedType->passAsTemplate = 1;
17739 }
17740 }
17741 else
17742 {
17743 e->destType = type;
17744 if(type)
17745 type->refCount++;
17746 }
17747 }
17748 else
17749 {
17750 if(type && type->kind == 14 && type->prev && type->prev->kind == 8 && type->prev->classObjectType)
17751 {
17752 e->destType = type->prev;
17753 e->destType->refCount++;
17754 }
17755 else
17756 {
17757 e->destType = type;
17758 if(type)
17759 type->refCount++;
17760 }
17761 }
17762 if(type && type->kind != 14)
17763 {
17764 struct Type * next = type->next;
17765
17766 if(!type->refCount)
17767 FreeType(type);
17768 type = next;
17769 }
17770 }
17771 if(type && type->kind != 14)
17772 {
17773 if(methodType && methodType->__anon1.__anon3.methodClass)
17774 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);
17775 else
17776 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);
17777 }
17778 yylloc = oldyylloc;
17779 if(type && !type->refCount)
17780 FreeType(type);
17781 }
17782 else
17783 {
17784 functionType = __extension__ ({
17785 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
17786
17787 __ecereInstance1->refCount = 0, __ecereInstance1->kind = 11, __ecereInstance1;
17788 });
17789 if(exp->__anon1.call.exp->type == 0)
17790 {
17791 char * string = exp->__anon1.call.exp->__anon1.__anon1.identifier->string;
17792
17793 if(inCompiler)
17794 {
17795 struct Symbol * symbol;
17796 struct Location oldyylloc = yylloc;
17797
17798 yylloc = exp->__anon1.call.exp->__anon1.__anon1.identifier->loc;
17799 if(strstr(string, "__builtin_") == string)
17800 {
17801 if(exp->destType)
17802 {
17803 functionType->__anon1.__anon2.returnType = exp->destType;
17804 exp->destType->refCount++;
17805 }
17806 }
17807 else
17808 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "%s undefined; assuming extern returning int\n", (((void *)0))), string);
17809 symbol = __extension__ ({
17810 struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
17811
17812 __ecereInstance1->string = __ecereNameSpace__ecere__sys__CopyString(string), __ecereInstance1->type = ProcessTypeString("int()", 1), __ecereInstance1;
17813 });
17814 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)symbol);
17815 if(strstr(symbol->string, "::"))
17816 globalContext->hasNameSpace = 1;
17817 yylloc = oldyylloc;
17818 }
17819 }
17820 else if(exp->__anon1.call.exp->type == 8)
17821 {
17822 }
17823 else
17824 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "callable object undefined; extern assuming returning int\n", (((void *)0))));
17825 if(!functionType->__anon1.__anon2.returnType)
17826 {
17827 functionType->__anon1.__anon2.returnType = __extension__ ({
17828 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
17829
17830 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 3, __ecereInstance1;
17831 });
17832 }
17833 }
17834 if(functionType && functionType->kind == 11)
17835 {
17836 exp->expType = functionType->__anon1.__anon2.returnType;
17837 if(functionType->__anon1.__anon2.returnType)
17838 functionType->__anon1.__anon2.returnType->refCount++;
17839 if(!functionType->refCount)
17840 FreeType(functionType);
17841 }
17842 if(exp->__anon1.call.arguments)
17843 {
17844 for(e = (*exp->__anon1.call.arguments).first; e; e = e->next)
17845 ProcessExpressionType(e);
17846 }
17847 break;
17848 }
17849 case 8:
17850 {
17851 struct Type * type;
17852 struct Location oldyylloc = yylloc;
17853 unsigned int thisPtr;
17854 struct Expression * checkExp = exp->__anon1.member.exp;
17855
17856 while(checkExp)
17857 {
17858 if(checkExp->type == 11)
17859 checkExp = checkExp->__anon1.cast.exp;
17860 else if(checkExp->type == 5)
17861 checkExp = checkExp->__anon1.list ? (*checkExp->__anon1.list).first : (((void *)0));
17862 else
17863 break;
17864 }
17865 thisPtr = (checkExp && checkExp->type == 0 && !strcmp(checkExp->__anon1.__anon1.identifier->string, "this"));
17866 exp->thisPtr = thisPtr;
17867 if(exp->__anon1.member.member && exp->__anon1.member.member->_class && exp->__anon1.member.member->_class->__anon1.__anon1.name)
17868 {
17869 exp->__anon1.member.member->classSym = exp->__anon1.member.member->_class->__anon1.__anon1.symbol;
17870 }
17871 ProcessExpressionType(exp->__anon1.member.exp);
17872 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)
17873 {
17874 exp->isConstant = 0;
17875 }
17876 else
17877 exp->isConstant = exp->__anon1.member.exp->isConstant;
17878 type = exp->__anon1.member.exp->expType;
17879 yylloc = exp->loc;
17880 if(type && (type->kind == 20))
17881 {
17882 struct __ecereNameSpace__ecere__com__Class * _class = thisClass ? thisClass : currentClass;
17883 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param = (((void *)0));
17884
17885 if(_class)
17886 {
17887 for(param = _class->templateParams.first; param; param = param->next)
17888 {
17889 if(param->type == 1 && exp->__anon1.member.member && exp->__anon1.member.member->string && !strcmp(param->name, exp->__anon1.member.member->string))
17890 break;
17891 }
17892 }
17893 if(param && param->defaultArg.__anon1.__anon2.__anon1.member)
17894 {
17895 struct Expression * argExp = GetTemplateArgExpByName(param->name, thisClass, 1);
17896
17897 if(argExp)
17898 {
17899 struct Expression * expMember = exp->__anon1.member.exp;
17900 struct Declarator * decl;
17901 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
17902 char thisClassTypeString[1024];
17903
17904 FreeIdentifier(exp->__anon1.member.member);
17905 ProcessExpressionType(argExp);
17906 {
17907 char * colon = strstr(param->defaultArg.__anon1.__anon2.memberString, "::");
17908
17909 if(colon)
17910 {
17911 memcpy(thisClassTypeString, param->defaultArg.__anon1.__anon2.memberString, colon - param->defaultArg.__anon1.__anon2.memberString);
17912 thisClassTypeString[colon - param->defaultArg.__anon1.__anon2.memberString] = '\0';
17913 }
17914 else
17915 strcpy(thisClassTypeString, _class->fullName);
17916 }
17917 decl = SpecDeclFromString(param->defaultArg.__anon1.__anon2.__anon1.member->dataTypeString, specs, (((void *)0)));
17918 exp->expType = ProcessType(specs, decl);
17919 if(exp->expType->kind == 8 && exp->expType->__anon1._class && exp->expType->__anon1._class->__anon1.registered && exp->expType->__anon1._class->__anon1.registered->templateClass)
17920 {
17921 struct __ecereNameSpace__ecere__com__Class * expClass = exp->expType->__anon1._class->__anon1.registered;
17922 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
17923 int paramCount = 0;
17924 int lastParam = -1;
17925 char templateString[1024];
17926 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
17927
17928 sprintf(templateString, "%s<", expClass->templateClass->fullName);
17929 for(cClass = expClass; cClass; cClass = cClass->base)
17930 {
17931 int p = 0;
17932
17933 for(param = cClass->templateParams.first; param; param = param->next)
17934 {
17935 int id = p;
17936 struct __ecereNameSpace__ecere__com__Class * sClass;
17937 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
17938
17939 for(sClass = cClass->base; sClass; sClass = sClass->base)
17940 id += sClass->templateParams.count;
17941 arg = expClass->templateArgs[id];
17942 for(sClass = _class; sClass; sClass = sClass->base)
17943 {
17944 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * cParam;
17945 int p = 0;
17946 struct __ecereNameSpace__ecere__com__Class * nextClass;
17947
17948 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
17949 p += nextClass->templateParams.count;
17950 for(cParam = sClass->templateParams.first; cParam; cParam = cParam->next, p++)
17951 {
17952 if(cParam->type == 0 && arg.__anon1.__anon1.dataTypeString && !strcmp(cParam->name, arg.__anon1.__anon1.dataTypeString))
17953 {
17954 if(_class->templateArgs && arg.__anon1.__anon1.dataTypeString && (!param->defaultArg.__anon1.__anon1.dataTypeString || strcmp(arg.__anon1.__anon1.dataTypeString, param->defaultArg.__anon1.__anon1.dataTypeString)))
17955 {
17956 arg.__anon1.__anon1.dataTypeString = _class->templateArgs[p].__anon1.__anon1.dataTypeString;
17957 arg.__anon1.__anon1.dataTypeClass = _class->templateArgs[p].__anon1.__anon1.dataTypeClass;
17958 break;
17959 }
17960 }
17961 }
17962 }
17963 {
17964 char argument[256];
17965
17966 argument[0] = '\0';
17967 switch(param->type)
17968 {
17969 case 2:
17970 {
17971 char expString[1024];
17972 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
17973 struct Declarator * decl = SpecDeclFromString(param->__anon1.dataTypeString, specs, (((void *)0)));
17974 struct Expression * exp;
17975 char * string = PrintHexUInt64(arg.__anon1.expression.__anon1.ui64);
17976
17977 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
17978 (__ecereNameSpace__ecere__com__eSystem_Delete(string), string = 0);
17979 ProcessExpressionType(exp);
17980 ComputeExpression(exp);
17981 expString[0] = '\0';
17982 PrintExpression(exp, expString);
17983 strcat(argument, expString);
17984 FreeExpression(exp);
17985 break;
17986 }
17987 case 1:
17988 {
17989 strcat(argument, arg.__anon1.__anon2.__anon1.member->name);
17990 break;
17991 }
17992 case 0:
17993 {
17994 if(arg.__anon1.__anon1.dataTypeString && (!param->defaultArg.__anon1.__anon1.dataTypeString || strcmp(arg.__anon1.__anon1.dataTypeString, param->defaultArg.__anon1.__anon1.dataTypeString)))
17995 {
17996 if(!strcmp(arg.__anon1.__anon1.dataTypeString, "thisclass"))
17997 strcat(argument, thisClassTypeString);
17998 else
17999 strcat(argument, arg.__anon1.__anon1.dataTypeString);
18000 }
18001 break;
18002 }
18003 }
18004 if(argument[0])
18005 {
18006 if(paramCount)
18007 strcat(templateString, ", ");
18008 if(lastParam != p - 1)
18009 {
18010 strcat(templateString, param->name);
18011 strcat(templateString, " = ");
18012 }
18013 strcat(templateString, argument);
18014 paramCount++;
18015 lastParam = p;
18016 }
18017 p++;
18018 }
18019 }
18020 }
18021 {
18022 int len = strlen(templateString);
18023
18024 if(templateString[len - 1] == '>')
18025 templateString[len++] = ' ';
18026 templateString[len++] = '>';
18027 templateString[len++] = '\0';
18028 }
18029 {
18030 struct Context * context = SetupTemplatesContext(_class);
18031
18032 FreeType(exp->expType);
18033 exp->expType = ProcessTypeString(templateString, 0);
18034 FinishTemplatesContext(context);
18035 }
18036 }
18037 if(!__ecereProp_Type_Get_isPointerType(expMember->expType))
18038 expMember = MkExpCast(MkTypeName(MkListOne(MkSpecifierName("uintptr")), (((void *)0))), expMember);
18039 exp->type = 5;
18040 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")))))))));
18041 }
18042 }
18043 else if(type->__anon1.templateParameter && type->__anon1.templateParameter->type == 0 && (type->__anon1.templateParameter->__anon1.dataType || type->__anon1.templateParameter->dataTypeString))
18044 {
18045 type = ProcessTemplateParameterType(type->__anon1.templateParameter);
18046 }
18047 }
18048 if(type && (type->kind == 20))
18049 ;
18050 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)))
18051 {
18052 struct Identifier * id = exp->__anon1.member.member;
18053 int typeKind = type->kind;
18054 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));
18055
18056 if(typeKind == 19 && exp->__anon1.member.exp->type == 24)
18057 {
18058 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "ecere::com::Class");
18059 typeKind = 8;
18060 }
18061 if(id)
18062 {
18063 if(typeKind == 3 || typeKind == 15)
18064 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "int");
18065 else if(!_class)
18066 {
18067 if(type->kind == 8 && type->__anon1._class && type->__anon1._class->__anon1.registered)
18068 {
18069 _class = type->__anon1._class->__anon1.registered;
18070 }
18071 else if((type->kind == 12 || type->kind == 13) && type->__anon1.type && type->__anon1.type->kind == 1)
18072 {
18073 _class = FindClass("char *")->__anon1.registered;
18074 }
18075 else if(type->kind == 13)
18076 {
18077 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "uintptr");
18078 FreeType(exp->expType);
18079 exp->expType = ProcessTypeString("uintptr", 0);
18080 exp->byReference = 1;
18081 }
18082 else
18083 {
18084 char string[1024] = "";
18085 struct Symbol * classSym;
18086
18087 PrintTypeNoConst(type, string, 0, 1);
18088 classSym = FindClass(string);
18089 if(classSym)
18090 _class = classSym->__anon1.registered;
18091 }
18092 }
18093 }
18094 if(_class && id)
18095 {
18096 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
18097 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
18098 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
18099 struct __ecereNameSpace__ecere__com__Property * revConvert = (((void *)0));
18100 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
18101
18102 if(id && id->_class && id->_class->__anon1.__anon1.name && !strcmp(id->_class->__anon1.__anon1.name, "property"))
18103 exp->__anon1.member.memberType = 1;
18104 if(id && id->_class && type->__anon1._class && !__ecereNameSpace__ecere__com__eClass_IsDerived(type->__anon1._class->__anon1.registered, _class))
18105 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "invalid class specifier %s for object of class %s\n", (((void *)0))), _class->fullName, type->__anon1._class->string);
18106 if(typeKind != 19)
18107 {
18108 if((exp->__anon1.member.memberType == 0 && thisPtr) || exp->__anon1.member.memberType == 3)
18109 {
18110 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
18111 if(member && member->_class != (_class->templateClass ? _class->templateClass : _class) && exp->__anon1.member.memberType != 3)
18112 {
18113 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
18114 if(prop)
18115 member = (((void *)0));
18116 }
18117 if(!member && !prop)
18118 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
18119 if((member && member->_class == (_class->templateClass ? _class->templateClass : _class)) || (prop && prop->_class == (_class->templateClass ? _class->templateClass : _class)))
18120 exp->__anon1.member.thisPtr = 1;
18121 }
18122 else
18123 {
18124 unsigned int useMemberForNonConst = 0;
18125
18126 if(!id->classSym)
18127 {
18128 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, (((void *)0)));
18129 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);
18130 if(useMemberForNonConst || !id->_class || !id->_class->__anon1.__anon1.name || strcmp(id->_class->__anon1.__anon1.name, "property"))
18131 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, (((void *)0)), (((void *)0)), (((void *)0)));
18132 }
18133 if((!prop || useMemberForNonConst) && !member)
18134 {
18135 method = useMemberForNonConst ? (((void *)0)) : __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, (((void *)0)));
18136 if(!method)
18137 {
18138 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
18139 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);
18140 if(useMemberForNonConst || !id->_class || !id->_class->__anon1.__anon1.name || strcmp(id->_class->__anon1.__anon1.name, "property"))
18141 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
18142 }
18143 }
18144 if(member && prop)
18145 {
18146 if(useMemberForNonConst || (member->_class != prop->_class && !id->_class && __ecereNameSpace__ecere__com__eClass_IsDerived(member->_class, prop->_class)))
18147 prop = (((void *)0));
18148 else
18149 member = (((void *)0));
18150 }
18151 }
18152 }
18153 if(!prop && !member && !method)
18154 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule);
18155 if(!prop && !member && !method)
18156 {
18157 if(typeKind == 19)
18158 {
18159 classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(type->__anon1._class->__anon1.registered, exp->__anon1.member.member->string);
18160 if(classProp)
18161 {
18162 exp->__anon1.member.memberType = 5;
18163 exp->expType = ProcessTypeString(classProp->dataTypeString, 0);
18164 }
18165 else
18166 {
18167 char structName[1024];
18168 struct Identifier * id = exp->__anon1.member.member;
18169 struct Expression * classExp = exp->__anon1.member.exp;
18170
18171 type->refCount++;
18172 FreeType(classExp->expType);
18173 classExp->expType = ProcessTypeString("ecere::com::Class", 0);
18174 strcpy(structName, "__ecereClassData_");
18175 FullClassNameCat(structName, type->__anon1._class->string, 0);
18176 exp->type = 9;
18177 exp->__anon1.member.member = id;
18178 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"))))))));
18179 FreeType(type);
18180 ProcessExpressionType(exp);
18181 return ;
18182 }
18183 }
18184 else
18185 {
18186 struct Symbol * classSym = FindClass(id->string);
18187
18188 if(classSym)
18189 {
18190 struct __ecereNameSpace__ecere__com__Class * convertClass = classSym->__anon1.registered;
18191
18192 if(convertClass)
18193 revConvert = __ecereNameSpace__ecere__com__eClass_FindProperty(convertClass, _class->fullName, privateModule);
18194 }
18195 }
18196 }
18197 if(exp->__anon1.member.exp->destType)
18198 FreeType(exp->__anon1.member.exp->destType);
18199 {
18200 if(method && !method->_class->symbol)
18201 method->_class->symbol = FindClass(method->_class->fullName);
18202 if(prop && !prop->_class->symbol)
18203 prop->_class->symbol = FindClass(prop->_class->fullName);
18204 exp->__anon1.member.exp->destType = __extension__ ({
18205 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
18206
18207 __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;
18208 });
18209 }
18210 if(prop)
18211 {
18212 exp->__anon1.member.memberType = 1;
18213 if(!prop->dataType)
18214 ProcessPropertyType(prop);
18215 exp->expType = prop->dataType;
18216 if(!strcmp(_class->base->fullName, "eda::Row") && !exp->expType->constant && !exp->destType)
18217 {
18218 struct Type * type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
18219
18220 CopyTypeInto(type, exp->expType);
18221 type->refCount = 1;
18222 type->constant = 1;
18223 exp->expType = type;
18224 }
18225 else if(prop->dataType)
18226 prop->dataType->refCount++;
18227 }
18228 else if(member)
18229 {
18230 if(exp->__anon1.member.exp->expType->classObjectType == 2 && !strcmp(exp->__anon1.member.member->string, "_class"))
18231 {
18232 FreeExpContents(exp);
18233 exp->type = 0;
18234 exp->__anon1.__anon1.identifier = MkIdentifier("class");
18235 ProcessExpressionType(exp);
18236 return ;
18237 }
18238 exp->__anon1.member.memberType = 3;
18239 DeclareStruct(curExternal, _class->fullName, 0, 1);
18240 if(member->_class != _class)
18241 DeclareStruct(curExternal, member->_class->fullName, 0, 1);
18242 if(!member->dataType)
18243 {
18244 struct Context * context = SetupTemplatesContext(_class);
18245
18246 member->dataType = ProcessTypeString(member->dataTypeString, 0);
18247 FinishTemplatesContext(context);
18248 }
18249 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)
18250 member->dataType->bitMemberSize = ((struct __ecereNameSpace__ecere__com__BitMember *)member)->size;
18251 exp->expType = member->dataType;
18252 if(member->dataType)
18253 member->dataType->refCount++;
18254 }
18255 else if(revConvert)
18256 {
18257 exp->__anon1.member.memberType = 4;
18258 exp->expType = MkClassType(revConvert->_class->fullName);
18259 }
18260 else if(method)
18261 {
18262 {
18263 exp->__anon1.member.memberType = 2;
18264 }
18265 if(!method->dataType)
18266 ProcessMethodType(method);
18267 exp->expType = __extension__ ({
18268 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
18269
18270 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 16, __ecereInstance1->__anon1.__anon3.method = method, __ecereInstance1;
18271 });
18272 exp->expType->__anon1.__anon3.methodClass = (id && id->_class) ? _class : (((void *)0));
18273 exp->expType->__anon1.__anon3.usedClass = _class;
18274 }
18275 else if(!classProp)
18276 {
18277 if(exp->__anon1.member.exp->expType->classObjectType == 2 && !strcmp(exp->__anon1.member.member->string, "_class"))
18278 {
18279 FreeExpContents(exp);
18280 exp->type = 0;
18281 exp->__anon1.__anon1.identifier = MkIdentifier("class");
18282 FreeType(exp->expType);
18283 exp->expType = MkClassType("ecere::com::Class");
18284 return ;
18285 }
18286 yylloc = exp->__anon1.member.member->loc;
18287 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't find member %s in class %s\n", (((void *)0))), id->string, _class->fullName);
18288 if(inCompiler)
18289 __ecereNameSpace__ecere__com__eClass_AddDataMember(_class, id->string, "int", 0, 0, 1);
18290 }
18291 if(_class && exp->expType)
18292 {
18293 struct __ecereNameSpace__ecere__com__Class * tClass;
18294
18295 tClass = type->__anon1._class && type->__anon1._class->__anon1.registered ? type->__anon1._class->__anon1.registered : _class;
18296 while(tClass && !tClass->templateClass)
18297 tClass = tClass->base;
18298 if(tClass && exp->expType->kind == 20 && exp->expType->__anon1.templateParameter->type == 0)
18299 {
18300 int id = 0;
18301 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
18302 struct __ecereNameSpace__ecere__com__Class * sClass;
18303
18304 for(sClass = tClass; sClass; sClass = sClass->base)
18305 {
18306 id = 0;
18307 if(sClass->templateClass)
18308 sClass = sClass->templateClass;
18309 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
18310 {
18311 if(curParam->type == 0 && !strcmp(exp->expType->__anon1.templateParameter->identifier->string, curParam->name))
18312 {
18313 for(sClass = sClass->base; sClass; sClass = sClass->base)
18314 id += sClass->templateParams.count;
18315 break;
18316 }
18317 id++;
18318 }
18319 if(curParam)
18320 break;
18321 }
18322 if(curParam && tClass->templateArgs[id].__anon1.__anon1.dataTypeString)
18323 {
18324 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = tClass->templateArgs[id];
18325 struct Context * context = SetupTemplatesContext(tClass);
18326 unsigned int constant = exp->expType->constant;
18327 unsigned int passAsTemplate = 0;
18328 struct __ecereNameSpace__ecere__com__Class * thisClassFrom = (((void *)0));
18329 struct Type * t = ProcessTypeString(exp->expType->__anon1.templateParameter->dataTypeString, 0);
18330
18331 if(t && t->kind == 8 && t->__anon1._class)
18332 thisClassFrom = t->__anon1._class->__anon1.registered;
18333 else
18334 thisClassFrom = __ecereNameSpace__ecere__com__eSystem_FindClass(GetPrivateModule(), "class");
18335 FreeType(t);
18336 passAsTemplate = tClass->templateClass && (exp->expType->kind != 20 || (!exp->expType->__anon1.templateParameter || (!exp->expType->__anon1.templateParameter->dataTypeString && !exp->expType->__anon1.templateParameter->__anon1.dataType)));
18337 FreeType(exp->expType);
18338 exp->expType = ProcessTypeString(arg.__anon1.__anon1.dataTypeString, 0);
18339 exp->expType->thisClassFrom = thisClassFrom;
18340 if(exp->expType->kind == 8 && constant)
18341 exp->expType->constant = 1;
18342 else if(exp->expType->kind == 13)
18343 {
18344 struct Type * t = exp->expType->__anon1.type;
18345
18346 while(t->kind == 13)
18347 t = t->__anon1.type;
18348 if(constant)
18349 t->constant = constant;
18350 }
18351 if(exp->expType)
18352 {
18353 if(exp->expType->kind == 21)
18354 {
18355 FreeType(exp->expType);
18356 exp->expType = ReplaceThisClassType(_class);
18357 }
18358 if(passAsTemplate)
18359 exp->expType->passAsTemplate = 1;
18360 if(!exp->destType)
18361 {
18362 exp->destType = ProcessTypeString(arg.__anon1.__anon1.dataTypeString, 0);
18363 if(exp->destType->kind == 8 && constant)
18364 exp->destType->constant = 1;
18365 else if(exp->destType->kind == 13)
18366 {
18367 struct Type * t = exp->destType->__anon1.type;
18368
18369 while(t->kind == 13)
18370 t = t->__anon1.type;
18371 if(constant)
18372 t->constant = constant;
18373 }
18374 if(exp->destType->kind == 21)
18375 {
18376 FreeType(exp->destType);
18377 exp->destType = ReplaceThisClassType(_class);
18378 }
18379 }
18380 }
18381 FinishTemplatesContext(context);
18382 }
18383 }
18384 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)
18385 {
18386 int id = 0;
18387 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
18388 struct __ecereNameSpace__ecere__com__Class * sClass;
18389
18390 for(sClass = tClass; sClass; sClass = sClass->base)
18391 {
18392 id = 0;
18393 if(sClass->templateClass)
18394 sClass = sClass->templateClass;
18395 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
18396 {
18397 if(curParam->type == 0 && !strcmp(exp->expType->__anon1.type->__anon1.templateParameter->identifier->string, curParam->name))
18398 {
18399 for(sClass = sClass->base; sClass; sClass = sClass->base)
18400 id += sClass->templateParams.count;
18401 break;
18402 }
18403 id++;
18404 }
18405 if(curParam)
18406 break;
18407 }
18408 if(curParam)
18409 {
18410 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = tClass->templateArgs[id];
18411 struct Context * context = SetupTemplatesContext(tClass);
18412 struct Type * basicType;
18413
18414 basicType = ProcessTypeString(arg.__anon1.__anon1.dataTypeString, 0);
18415 if(basicType)
18416 {
18417 if(basicType->kind == 21)
18418 {
18419 FreeType(basicType);
18420 basicType = ReplaceThisClassType(_class);
18421 }
18422 FreeType(exp->expType);
18423 exp->expType = __extension__ ({
18424 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
18425
18426 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 13, __ecereInstance1->__anon1.type = basicType, __ecereInstance1;
18427 });
18428 if(!exp->destType)
18429 {
18430 exp->destType = exp->expType;
18431 exp->destType->refCount++;
18432 }
18433 {
18434 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
18435 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
18436 struct Declarator * decl;
18437
18438 decl = SpecDeclFromString(arg.__anon1.__anon1.dataTypeString, specs, (((void *)0)));
18439 *newExp = *exp;
18440 if(exp->destType)
18441 exp->destType->refCount++;
18442 if(exp->expType)
18443 exp->expType->refCount++;
18444 exp->type = 11;
18445 exp->__anon1.cast.typeName = MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl));
18446 exp->__anon1.cast.exp = newExp;
18447 }
18448 }
18449 FinishTemplatesContext(context);
18450 }
18451 }
18452 else if(tClass && exp->expType->kind == 8 && exp->expType->__anon1._class && strchr(exp->expType->__anon1._class->string, '<'))
18453 {
18454 struct __ecereNameSpace__ecere__com__Class * expClass = exp->expType->__anon1._class->__anon1.registered;
18455
18456 if(expClass)
18457 {
18458 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
18459 int p = 0;
18460 int paramCount = 0;
18461 int lastParam = -1;
18462 char templateString[1024];
18463 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
18464
18465 sprintf(templateString, "%s<", expClass->templateClass->fullName);
18466 while(cClass != expClass)
18467 {
18468 struct __ecereNameSpace__ecere__com__Class * sClass;
18469
18470 for(sClass = expClass; sClass && sClass->base != cClass; sClass = sClass->base)
18471 ;
18472 cClass = sClass;
18473 for(param = cClass->templateParams.first; param; param = param->next)
18474 {
18475 struct __ecereNameSpace__ecere__com__Class * cClassCur = (((void *)0));
18476 int cp = 0;
18477 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * paramCur = (((void *)0));
18478 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
18479
18480 while(cClassCur != tClass && !paramCur)
18481 {
18482 struct __ecereNameSpace__ecere__com__Class * sClassCur;
18483
18484 for(sClassCur = tClass; sClassCur && sClassCur->base != cClassCur; sClassCur = sClassCur->base)
18485 ;
18486 cClassCur = sClassCur;
18487 for(paramCur = cClassCur->templateParams.first; paramCur; paramCur = paramCur->next)
18488 {
18489 if(!strcmp(paramCur->name, param->name))
18490 {
18491 break;
18492 }
18493 cp++;
18494 }
18495 }
18496 if(paramCur && paramCur->type == 0)
18497 arg = tClass->templateArgs[cp];
18498 else
18499 arg = expClass->templateArgs[p];
18500 {
18501 char argument[256];
18502
18503 argument[0] = '\0';
18504 switch(param->type)
18505 {
18506 case 2:
18507 {
18508 char expString[1024];
18509 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
18510 struct Declarator * decl = SpecDeclFromString(param->__anon1.dataTypeString, specs, (((void *)0)));
18511 struct Expression * exp;
18512 char * string = PrintHexUInt64(arg.__anon1.expression.__anon1.ui64);
18513
18514 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
18515 (__ecereNameSpace__ecere__com__eSystem_Delete(string), string = 0);
18516 ProcessExpressionType(exp);
18517 ComputeExpression(exp);
18518 expString[0] = '\0';
18519 PrintExpression(exp, expString);
18520 strcat(argument, expString);
18521 FreeExpression(exp);
18522 break;
18523 }
18524 case 1:
18525 {
18526 strcat(argument, arg.__anon1.__anon2.__anon1.member->name);
18527 break;
18528 }
18529 case 0:
18530 {
18531 if(arg.__anon1.__anon1.dataTypeString && (!param->defaultArg.__anon1.__anon1.dataTypeString || strcmp(arg.__anon1.__anon1.dataTypeString, param->defaultArg.__anon1.__anon1.dataTypeString)))
18532 strcat(argument, arg.__anon1.__anon1.dataTypeString);
18533 break;
18534 }
18535 }
18536 if(argument[0])
18537 {
18538 if(paramCount)
18539 strcat(templateString, ", ");
18540 if(lastParam != p - 1)
18541 {
18542 strcat(templateString, param->name);
18543 strcat(templateString, " = ");
18544 }
18545 strcat(templateString, argument);
18546 paramCount++;
18547 lastParam = p;
18548 }
18549 }
18550 p++;
18551 }
18552 }
18553 {
18554 int len = strlen(templateString);
18555
18556 if(templateString[len - 1] == '>')
18557 templateString[len++] = ' ';
18558 templateString[len++] = '>';
18559 templateString[len++] = '\0';
18560 }
18561 FreeType(exp->expType);
18562 {
18563 struct Context * context = SetupTemplatesContext(tClass);
18564
18565 exp->expType = ProcessTypeString(templateString, 0);
18566 FinishTemplatesContext(context);
18567 }
18568 }
18569 }
18570 }
18571 }
18572 else
18573 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)");
18574 }
18575 else if(type && (type->kind == 9 || type->kind == 10))
18576 {
18577 struct Type * memberType = exp->__anon1.member.member ? FindMember(type, exp->__anon1.member.member->string) : (((void *)0));
18578
18579 if(memberType)
18580 {
18581 exp->expType = memberType;
18582 if(memberType)
18583 memberType->refCount++;
18584 }
18585 }
18586 else
18587 {
18588 char expString[10240];
18589
18590 expString[0] = '\0';
18591 if(inCompiler)
18592 {
18593 PrintExpression(exp, expString);
18594 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
18595 }
18596 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "member operator on non-structure type expression %s\n", (((void *)0))), expString);
18597 }
18598 if(exp->expType && exp->expType->kind == 21 && (!exp->destType || exp->destType->kind != 21))
18599 {
18600 if(type && (type->kind == 8 || type->kind == 19 || type->kind == 3 || type->kind == 15))
18601 {
18602 struct Identifier * id = exp->__anon1.member.member;
18603 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));
18604
18605 if(_class)
18606 {
18607 FreeType(exp->expType);
18608 exp->expType = ReplaceThisClassType(_class);
18609 }
18610 }
18611 }
18612 yylloc = oldyylloc;
18613 break;
18614 }
18615 case 9:
18616 {
18617 struct Type * destType = exp->destType;
18618
18619 if(exp->__anon1.member.member && exp->__anon1.member.member->_class && exp->__anon1.member.member->_class->__anon1.__anon1.name)
18620 {
18621 exp->__anon1.member.member->classSym = exp->__anon1.member.member->_class->__anon1.__anon1.symbol;
18622 }
18623 exp->__anon1.member.exp = MkExpBrackets(MkListOne(MkExpOp((((void *)0)), '*', exp->__anon1.member.exp)));
18624 exp->type = 8;
18625 if(destType)
18626 destType->count++;
18627 ProcessExpressionType(exp);
18628 if(destType)
18629 destType->count--;
18630 break;
18631 }
18632 case 15:
18633 {
18634 struct Symbol * classSym = exp->__anon1._class->__anon1.__anon1.symbol;
18635
18636 if(classSym && classSym->__anon1.registered)
18637 {
18638 if(classSym->__anon1.registered->type == 5 || (classSym->__anon1.registered->fixed && classSym->__anon1.registered->structSize))
18639 {
18640 char name[1024];
18641 struct __ecereNameSpace__ecere__com__Class * b = classSym->__anon1.registered;
18642
18643 name[0] = '\0';
18644 DeclareStruct(curExternal, classSym->string, 0, 1);
18645 FreeSpecifier(exp->__anon1._class);
18646 FullClassNameCat(name, classSym->string, 0);
18647 if(b->offset == 0)
18648 {
18649 exp->type = 10;
18650 exp->__anon1.typeName = MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(name), (((void *)0)))), (((void *)0)));
18651 }
18652 else
18653 {
18654 struct Expression * e;
18655
18656 exp->type = 4;
18657 if(b->structSize == b->offset)
18658 exp->__anon1.op.exp1 = MkExpConstant("0");
18659 else
18660 exp->__anon1.op.exp1 = MkExpTypeSize(MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(name), (((void *)0)))), (((void *)0))));
18661 exp->__anon1.op.op = '+';
18662 e = exp;
18663 while(b->offset != 0)
18664 {
18665 struct Symbol * sym;
18666 struct Expression * typeSize;
18667
18668 b = b->base;
18669 sym = FindClass(b->fullName);
18670 name[0] = '\0';
18671 DeclareStruct(curExternal, sym->string, 0, 1);
18672 FullClassNameCat(name, sym->string, 0);
18673 if(b->structSize == b->offset)
18674 typeSize = MkExpConstant("0");
18675 else
18676 typeSize = MkExpTypeSize(MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(name), (((void *)0)))), (((void *)0))));
18677 e->__anon1.op.exp2 = b->offset ? MkExpOp(typeSize, '+', (((void *)0))) : typeSize;
18678 e = e->__anon1.op.exp2;
18679 }
18680 }
18681 }
18682 else
18683 {
18684 if(classSym->__anon1.registered->fixed && !classSym->__anon1.registered->structSize)
18685 {
18686 FreeSpecifier(exp->__anon1._class);
18687 exp->__anon1.__anon1.constant = PrintUInt(classSym->__anon1.registered->templateClass ? classSym->__anon1.registered->templateClass->structSize : classSym->__anon1.registered->structSize);
18688 exp->type = 2;
18689 }
18690 else
18691 {
18692 char className[1024];
18693
18694 strcpy(className, "__ecereClass_");
18695 FullClassNameCat(className, classSym->string, 1);
18696 DeclareClass(curExternal, classSym, className);
18697 FreeExpContents(exp);
18698 exp->type = 9;
18699 exp->__anon1.member.exp = MkExpIdentifier(MkIdentifier(className));
18700 exp->__anon1.member.member = MkIdentifier("structSize");
18701 }
18702 }
18703 }
18704 exp->expType = __extension__ ({
18705 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
18706
18707 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 23, __ecereInstance1;
18708 });
18709 break;
18710 }
18711 case 10:
18712 {
18713 struct Type * type = ProcessType(exp->__anon1.typeName->qualifiers, exp->__anon1.typeName->declarator);
18714
18715 exp->expType = __extension__ ({
18716 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
18717
18718 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 23, __ecereInstance1;
18719 });
18720 exp->isConstant = 1;
18721 DeclareType(curExternal, type, 1, 0);
18722 FreeType(type);
18723 break;
18724 }
18725 case 11:
18726 {
18727 struct Type * type = ProcessType(exp->__anon1.cast.typeName->qualifiers, exp->__anon1.cast.typeName->declarator);
18728
18729 type->count = 1;
18730 FreeType(exp->__anon1.cast.exp->destType);
18731 exp->__anon1.cast.exp->destType = type;
18732 type->refCount++;
18733 type->casted = 1;
18734 ProcessExpressionType(exp->__anon1.cast.exp);
18735 type->casted = 0;
18736 type->count = 0;
18737 exp->expType = type;
18738 if(!exp->__anon1.cast.exp->needCast && !NeedCast(exp->__anon1.cast.exp->expType, type))
18739 {
18740 void * prev = exp->prev, * next = exp->next;
18741 struct Type * expType = exp->__anon1.cast.exp->destType;
18742 struct Expression * castExp = exp->__anon1.cast.exp;
18743 struct Type * destType = exp->destType;
18744
18745 if(expType)
18746 expType->refCount++;
18747 FreeType(exp->expType);
18748 FreeTypeName(exp->__anon1.cast.typeName);
18749 *exp = *castExp;
18750 FreeType(exp->expType);
18751 FreeType(exp->destType);
18752 exp->expType = expType;
18753 exp->destType = destType;
18754 ((castExp ? __extension__ ({
18755 void * __ecerePtrToDelete = (castExp);
18756
18757 __ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)__ecerePtrToDelete) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(__ecerePtrToDelete);
18758 }) : 0), castExp = 0);
18759 exp->prev = prev;
18760 exp->next = next;
18761 }
18762 else
18763 {
18764 exp->isConstant = exp->__anon1.cast.exp->isConstant;
18765 }
18766 break;
18767 }
18768 case 33:
18769 {
18770 struct Type * type = ProcessType(exp->__anon1.initializer.typeName->qualifiers, exp->__anon1.initializer.typeName->declarator);
18771
18772 exp->expType = type;
18773 break;
18774 }
18775 case 34:
18776 {
18777 struct Type * type = ProcessType(exp->__anon1.vaArg.typeName->qualifiers, exp->__anon1.vaArg.typeName->declarator);
18778
18779 ProcessExpressionType(exp->__anon1.vaArg.exp);
18780 exp->expType = type;
18781 break;
18782 }
18783 case 12:
18784 {
18785 struct Expression * e;
18786 struct Type * t = exp->destType;
18787
18788 if(t && !exp->destType->casted)
18789 {
18790 t = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
18791 CopyTypeInto(t, exp->destType);
18792 t->count = 0;
18793 }
18794 else if(t)
18795 t->refCount++;
18796 exp->isConstant = 1;
18797 FreeType(exp->__anon1.cond.cond->destType);
18798 exp->__anon1.cond.cond->destType = MkClassType("bool");
18799 exp->__anon1.cond.cond->destType->truth = 1;
18800 ProcessExpressionType(exp->__anon1.cond.cond);
18801 if(!exp->__anon1.cond.cond->isConstant)
18802 exp->isConstant = 0;
18803 for(e = (*exp->__anon1.cond.exp).first; e; e = e->next)
18804 {
18805 if(!e->next)
18806 {
18807 FreeType(e->destType);
18808 e->destType = t;
18809 if(e->destType)
18810 e->destType->refCount++;
18811 }
18812 ProcessExpressionType(e);
18813 if(!e->next)
18814 {
18815 exp->expType = e->expType;
18816 if(e->expType)
18817 e->expType->refCount++;
18818 }
18819 if(!e->isConstant)
18820 exp->isConstant = 0;
18821 }
18822 FreeType(exp->__anon1.cond.elseExp->destType);
18823 exp->__anon1.cond.elseExp->destType = t ? t : exp->expType;
18824 if(exp->__anon1.cond.elseExp->destType)
18825 exp->__anon1.cond.elseExp->destType->refCount++;
18826 ProcessExpressionType(exp->__anon1.cond.elseExp);
18827 if(!exp->__anon1.cond.elseExp->isConstant)
18828 exp->isConstant = 0;
18829 FreeType(t);
18830 break;
18831 }
18832 case 23:
18833 {
18834 if(exp->__anon1.compound && exp->__anon1.compound->__anon1.compound.statements && (*exp->__anon1.compound->__anon1.compound.statements).last)
18835 {
18836 struct Statement * last = (*exp->__anon1.compound->__anon1.compound.statements).last;
18837
18838 if(last->type == 3 && last->__anon1.expressions && (*last->__anon1.expressions).last)
18839 {
18840 ((struct Expression *)(*last->__anon1.expressions).last)->destType = exp->destType;
18841 if(exp->destType)
18842 exp->destType->refCount++;
18843 }
18844 ProcessStatement(exp->__anon1.compound);
18845 exp->expType = (last->__anon1.expressions && (*last->__anon1.expressions).last) ? ((struct Expression *)(*last->__anon1.expressions).last)->expType : (((void *)0));
18846 if(exp->expType)
18847 exp->expType->refCount++;
18848 }
18849 break;
18850 }
18851 case 24:
18852 {
18853 struct Specifier * spec = (*exp->__anon1._classExp.specifiers).first;
18854
18855 if(spec && spec->type == 1)
18856 {
18857 exp->expType = MkClassType(spec->__anon1.__anon1.name);
18858 exp->expType->kind = 19;
18859 exp->byReference = 1;
18860 }
18861 else
18862 {
18863 exp->expType = MkClassType("ecere::com::Class");
18864 exp->byReference = 1;
18865 }
18866 break;
18867 }
18868 case 25:
18869 {
18870 struct __ecereNameSpace__ecere__com__Class * _class = thisClass ? thisClass : currentClass;
18871
18872 if(_class)
18873 {
18874 struct Identifier * id = exp->__anon1.classData.id;
18875 char structName[1024];
18876 struct Expression * classExp;
18877
18878 strcpy(structName, "__ecereClassData_");
18879 FullClassNameCat(structName, _class->fullName, 0);
18880 exp->type = 9;
18881 exp->__anon1.member.member = id;
18882 if(curCompound && FindSymbol("this", curContext, curCompound->__anon1.compound.context, 0, 0))
18883 classExp = MkExpMember(MkExpIdentifier(MkIdentifier("this")), MkIdentifier("_class"));
18884 else
18885 classExp = MkExpIdentifier(MkIdentifier("class"));
18886 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"))))))));
18887 ProcessExpressionType(exp);
18888 return ;
18889 }
18890 break;
18891 }
18892 case 35:
18893 {
18894 struct Type * type = (((void *)0));
18895 const char * typeString = (((void *)0));
18896 char typeStringBuf[1024];
18897
18898 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))
18899 {
18900 struct __ecereNameSpace__ecere__com__Class * templateClass = exp->destType->__anon1._class->__anon1.registered;
18901
18902 typeString = templateClass->templateArgs[2].__anon1.__anon1.dataTypeString;
18903 }
18904 else if(exp->__anon1.list)
18905 {
18906 struct Expression * e;
18907
18908 for(e = (*exp->__anon1.list).first; e; e = e->next)
18909 {
18910 ProcessExpressionType(e);
18911 if(e->expType)
18912 {
18913 if(!type)
18914 {
18915 type = e->expType;
18916 type->refCount++;
18917 }
18918 else
18919 {
18920 if(!MatchTypeExpression(e, type, (((void *)0)), 0, 1))
18921 {
18922 FreeType(type);
18923 type = e->expType;
18924 e->expType = (((void *)0));
18925 e = (*exp->__anon1.list).first;
18926 ProcessExpressionType(e);
18927 if(e->expType)
18928 {
18929 if(!MatchTypeExpression(e, type, (((void *)0)), 0, 1))
18930 {
18931 FreeType(e->expType);
18932 e->expType = (((void *)0));
18933 FreeType(type);
18934 type = (((void *)0));
18935 break;
18936 }
18937 }
18938 }
18939 }
18940 if(e->expType)
18941 {
18942 FreeType(e->expType);
18943 e->expType = (((void *)0));
18944 }
18945 }
18946 }
18947 if(type)
18948 {
18949 typeStringBuf[0] = '\0';
18950 PrintTypeNoConst(type, typeStringBuf, 0, 1);
18951 typeString = typeStringBuf;
18952 FreeType(type);
18953 type = (((void *)0));
18954 }
18955 }
18956 if(typeString)
18957 {
18958 char templateString[1024];
18959 struct __ecereNameSpace__ecere__sys__OldList * initializers = MkList();
18960 struct __ecereNameSpace__ecere__sys__OldList * structInitializers = MkList();
18961 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
18962 struct Expression * expExt;
18963 struct Declarator * decl = SpecDeclFromString(typeString, specs, (((void *)0)));
18964
18965 sprintf(templateString, "Container<%s>", typeString);
18966 if(exp->__anon1.list)
18967 {
18968 struct Expression * e;
18969
18970 type = ProcessTypeString(typeString, 0);
18971 while((e = (*exp->__anon1.list).first))
18972 {
18973 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*exp->__anon1.list), e);
18974 e->destType = type;
18975 type->refCount++;
18976 ProcessExpressionType(e);
18977 ListAdd(initializers, MkInitializerAssignment(e));
18978 }
18979 FreeType(type);
18980 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->__anon1.list), exp->__anon1.list = 0);
18981 }
18982 DeclareStruct(curExternal, "ecere::com::BuiltInContainer", 0, 1);
18983 ListAdd(structInitializers, MkInitializerAssignment(MkExpMember(MkExpClass(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0))), MkIdentifier("_vTbl"))));
18984 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->__anon1.exp);
18985 ListAdd(structInitializers, MkInitializerAssignment(MkExpClass(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0)))));
18986 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->__anon1.exp);
18987 ListAdd(structInitializers, MkInitializerAssignment(MkExpConstant("0")));
18988 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->__anon1.exp);
18989 ListAdd(structInitializers, MkInitializerAssignment(MkExpExtensionInitializer(MkTypeName(specs, MkDeclaratorArray(decl, (((void *)0)))), MkInitializerList(initializers))));
18990 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->__anon1.exp);
18991 ListAdd(structInitializers, MkInitializerAssignment(__extension__ ({
18992 struct Expression * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
18993
18994 __ecereInstance1->type = 2, __ecereInstance1->__anon1.__anon1.constant = __ecereNameSpace__ecere__com__PrintString(__ecereClass_int, (void *)&(*initializers).count, (void *)0), __ecereInstance1;
18995 })));
18996 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->__anon1.exp);
18997 ListAdd(structInitializers, MkInitializerAssignment(MkExpClass(CopyList(specs, (void *)(CopySpecifier)), CopyDeclarator(decl))));
18998 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->__anon1.exp);
18999 exp->expType = ProcessTypeString(templateString, 0);
19000 exp->type = 5;
19001 exp->__anon1.list = MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName(templateString)), (((void *)0))), MkExpOp((((void *)0)), '&', expExt = MkExpExtensionInitializer(MkTypeName(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0))), MkInitializerList(structInitializers)))));
19002 ProcessExpressionType(expExt);
19003 }
19004 else
19005 {
19006 exp->expType = ProcessTypeString("Container", 0);
19007 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Couldn't determine type of array elements\n", (((void *)0))));
19008 }
19009 break;
19010 }
19011 }
19012 if(exp->expType && exp->expType->kind == 21 && thisClass && (!exp->destType || exp->destType->kind != 21))
19013 {
19014 FreeType(exp->expType);
19015 exp->expType = ReplaceThisClassType(thisClass);
19016 }
19017 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)
19018 {
19019 struct Symbol * symbol = FindSymbol(exp->expType->__anon1.__anon1.enumName, curContext, globalContext, 1, 0);
19020
19021 if(symbol)
19022 {
19023 if(exp->expType->kind != 15)
19024 {
19025 struct Type * member;
19026 char * enumName = __ecereNameSpace__ecere__sys__CopyString(exp->expType->__anon1.__anon1.enumName);
19027
19028 FreeType(exp->expType);
19029 exp->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
19030 exp->expType->kind = symbol->type->kind;
19031 exp->expType->refCount++;
19032 exp->expType->__anon1.__anon1.enumName = enumName;
19033 exp->expType->__anon1.__anon1.members = symbol->type->__anon1.__anon1.members;
19034 for(member = symbol->type->__anon1.__anon1.members.first; member; member = member->next)
19035 member->refCount++;
19036 }
19037 else
19038 {
19039 struct __ecereNameSpace__ecere__sys__NamedLink64 * member;
19040
19041 for(member = symbol->type->__anon1.__anon1.members.first; member; member = member->next)
19042 {
19043 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);
19044
19045 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&exp->expType->__anon1.__anon1.members, value);
19046 }
19047 }
19048 }
19049 }
19050 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)))
19051 {
19052 exp->byReference = 1;
19053 }
19054 yylloc = exp->loc;
19055 if(exp->destType && (exp->destType->kind == 18))
19056 ;
19057 else if(exp->destType && !exp->destType->keepCast)
19058 {
19059 if(!exp->needTemplateCast && exp->expType && (exp->expType->kind == 20 || exp->expType->passAsTemplate))
19060 exp->needTemplateCast = 1;
19061 if(exp->destType->kind == 0)
19062 ;
19063 else if(!CheckExpressionType(exp, exp->destType, 0, !exp->destType->casted))
19064 {
19065 unsigned int invalidCast = 0;
19066
19067 if(inCompiler && exp->destType->count && exp->expType)
19068 {
19069 struct __ecereNameSpace__ecere__com__Class * c1 = (exp->expType->kind == 8 && exp->expType->__anon1._class) ? exp->expType->__anon1._class->__anon1.registered : (((void *)0));
19070 struct __ecereNameSpace__ecere__com__Class * c2 = (exp->destType->kind == 8 && exp->destType->__anon1._class) ? exp->destType->__anon1._class->__anon1.registered : (((void *)0));
19071
19072 if(c1 && c1->type != 1)
19073 c1 = (((void *)0));
19074 if(c2 && c2->type != 1)
19075 c2 = (((void *)0));
19076 if((c1 && !exp->expType->byReference && !c2 && !__ecereProp_Type_Get_isPointerType(exp->destType)) || (c2 && !exp->destType->byReference && !c1 && !__ecereProp_Type_Get_isPointerType(exp->expType)))
19077 invalidCast = 1;
19078 }
19079 if(!exp->destType->count || unresolved || invalidCast)
19080 {
19081 if(!exp->expType)
19082 {
19083 yylloc = exp->loc;
19084 if(exp->destType->kind != 14)
19085 {
19086 char type2[1024];
19087
19088 type2[0] = '\0';
19089 if(inCompiler)
19090 {
19091 char expString[10240];
19092
19093 expString[0] = '\0';
19094 PrintType(exp->destType, type2, 0, 1);
19095 if(inCompiler)
19096 {
19097 PrintExpression(exp, expString);
19098 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
19099 }
19100 if(unresolved)
19101 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved identifier %s; expected %s\n", (((void *)0))), expString, type2);
19102 else if(exp->type != 16)
19103 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s; expected %s\n", (((void *)0))), expString, type2);
19104 }
19105 }
19106 else
19107 {
19108 char expString[10240];
19109
19110 expString[0] = '\0';
19111 if(inCompiler)
19112 {
19113 PrintExpression(exp, expString);
19114 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
19115 }
19116 if(unresolved)
19117 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved identifier %s\n", (((void *)0))), expString);
19118 else if(exp->type != 16)
19119 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s\n", (((void *)0))), expString);
19120 }
19121 }
19122 else
19123 {
19124 char type1[1024];
19125 char type2[1024];
19126
19127 type1[0] = '\0';
19128 type2[0] = '\0';
19129 if(inCompiler)
19130 {
19131 PrintType(exp->expType, type1, 0, 1);
19132 PrintType(exp->destType, type2, 0, 1);
19133 }
19134 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)))
19135 ;
19136 else
19137 {
19138 struct Expression * nbExp = GetNonBracketsExp(exp);
19139 unsigned int skipWarning = 0;
19140 int kind = exp->destType->kind;
19141
19142 if(nbExp->type == 12 && nbExp->destType && !nbExp->destType->casted && nbExp->destType->kind == exp->destType->kind)
19143 skipWarning = 1;
19144 if((kind == 1 || kind == 2) && exp->destType->isSigned == exp->expType->signedBeforePromotion && nbExp->type == 4 && nbExp->__anon1.op.exp1 && nbExp->__anon1.op.exp2)
19145 {
19146 int op = nbExp->__anon1.op.op;
19147 struct Expression * nbExp1, * nbExp2;
19148 int from;
19149
19150 switch(op)
19151 {
19152 case '%':
19153 case '/':
19154 nbExp1 = GetNonBracketsExp(nbExp->__anon1.op.exp1);
19155 from = nbExp1->expType->promotedFrom;
19156 if(from == 1 || (kind == 2 && from == 2))
19157 skipWarning = 1;
19158 break;
19159 case LEFT_OP:
19160 case RIGHT_OP:
19161 nbExp1 = GetNonBracketsExp(nbExp->__anon1.op.exp1);
19162 nbExp2 = GetNonBracketsExp(nbExp->__anon1.op.exp2);
19163 from = nbExp1->expType->promotedFrom;
19164 if(op == RIGHT_OP && (from == 1 || (kind == 2 && from == 2)))
19165 skipWarning = 1;
19166 else if(nbExp2->isConstant && nbExp2->type == 2 && (nbExp->__anon1.op.op == RIGHT_OP || nbExp1->expType->bitMemberSize))
19167 {
19168 int n = strtol(nbExp2->__anon1.__anon1.constant, (((void *)0)), 0);
19169 int s = from == 1 ? 8 : 16;
19170
19171 if(nbExp1->expType->bitMemberSize && nbExp1->expType->bitMemberSize < s)
19172 s = nbExp1->expType->bitMemberSize;
19173 if(nbExp->__anon1.op.op == RIGHT_OP)
19174 s -= n;
19175 else
19176 s += n;
19177 if(s <= (kind == 1 ? 8 : 16))
19178 skipWarning = 1;
19179 }
19180 break;
19181 case '-':
19182 if(!exp->destType->isSigned)
19183 {
19184 nbExp1 = GetNonBracketsExp(nbExp->__anon1.op.exp1);
19185 nbExp2 = GetNonBracketsExp(nbExp->__anon1.op.exp2);
19186 from = nbExp2->expType->promotedFrom;
19187 if((from == 1 || from == 2) && nbExp1->isConstant && nbExp1->type == 2)
19188 {
19189 int n = strtol(nbExp1->__anon1.__anon1.constant, (((void *)0)), 0);
19190
19191 if(n == (from == 1 ? 255 : 65535))
19192 skipWarning = 1;
19193 }
19194 }
19195 break;
19196 case '|':
19197 {
19198 int kind1, kind2;
19199
19200 nbExp1 = GetNonBracketsExp(nbExp->__anon1.op.exp1);
19201 nbExp2 = GetNonBracketsExp(nbExp->__anon1.op.exp2);
19202 kind1 = nbExp1->expType->promotedFrom ? nbExp1->expType->promotedFrom : nbExp1->expType->kind;
19203 kind2 = nbExp2->expType->promotedFrom ? nbExp2->expType->promotedFrom : nbExp2->expType->kind;
19204 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)))
19205 skipWarning = 1;
19206 break;
19207 }
19208 case '&':
19209 {
19210 int kind1, kind2;
19211
19212 nbExp1 = GetNonBracketsExp(nbExp->__anon1.op.exp1);
19213 nbExp2 = GetNonBracketsExp(nbExp->__anon1.op.exp2);
19214 kind1 = nbExp1->expType->promotedFrom ? nbExp1->expType->promotedFrom : nbExp1->expType->kind;
19215 kind2 = nbExp2->expType->promotedFrom ? nbExp2->expType->promotedFrom : nbExp2->expType->kind;
19216 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)))
19217 skipWarning = 1;
19218 break;
19219 }
19220 }
19221 }
19222 if(!skipWarning)
19223 {
19224 char expString[10240];
19225
19226 expString[0] = '\0';
19227 if(inCompiler)
19228 {
19229 PrintExpression(exp, expString);
19230 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
19231 }
19232 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")))
19233 {
19234 if(invalidCast)
19235 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expression %s (%s); expected %s\n", (((void *)0))), expString, type1, type2);
19236 else
19237 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expression %s (%s); expected %s\n", (((void *)0))), expString, type1, type2);
19238 }
19239 }
19240 if(!inCompiler)
19241 {
19242 FreeType(exp->expType);
19243 exp->destType->refCount++;
19244 exp->expType = exp->destType;
19245 }
19246 }
19247 }
19248 }
19249 }
19250 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))
19251 {
19252 struct Expression * nbExp = GetNonBracketsExp(exp);
19253
19254 if(nbExp->type != 11 || !IsVoidPtrCast(nbExp->__anon1.cast.typeName))
19255 {
19256 struct Expression * e = MoveExpContents(exp);
19257
19258 exp->__anon1.cast.exp = MkExpBrackets(MkListOne(e));
19259 exp->type = 11;
19260 exp->__anon1.cast.exp->destType = exp->destType;
19261 if(exp->destType)
19262 exp->destType->refCount++;
19263 exp->__anon1.cast.typeName = MkTypeName(MkListOne(MkSpecifier(VOID)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0))));
19264 }
19265 }
19266 }
19267 else if(unresolved)
19268 {
19269 if(exp->__anon1.__anon1.identifier->_class && exp->__anon1.__anon1.identifier->_class->__anon1.__anon1.name)
19270 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);
19271 else if(exp->__anon1.__anon1.identifier->string && exp->__anon1.__anon1.identifier->string[0])
19272 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved identifier %s\n", (((void *)0))), exp->__anon1.__anon1.identifier->string);
19273 }
19274 else if(!exp->expType && exp->type != 16)
19275 {
19276 char expString[10240];
19277
19278 expString[0] = '\0';
19279 if(inCompiler)
19280 {
19281 PrintExpression(exp, expString);
19282 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
19283 }
19284 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s\n", (((void *)0))), expString);
19285 }
19286 if(inCompiler)
19287 ApplyAnyObjectLogic(exp);
19288 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)))
19289 {
19290 exp->byReference = 1;
19291 }
19292 yylloc = oldyylloc;
19293 }
19294
19295 static void ProcessFunction(struct FunctionDefinition * function)
19296 {
19297 struct Identifier * id = GetDeclId(function->declarator);
19298 struct Symbol * symbol = function->declarator ? function->declarator->symbol : (((void *)0));
19299 struct Type * type = symbol ? symbol->type : (((void *)0));
19300 struct __ecereNameSpace__ecere__com__Class * oldThisClass = thisClass;
19301 struct Context * oldTopContext = topContext;
19302
19303 yylloc = function->loc;
19304 if(type && type->__anon1.__anon2.thisClass)
19305 {
19306 struct Symbol * classSym = type->__anon1.__anon2.thisClass;
19307 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1.__anon2.thisClass->__anon1.registered;
19308 char className[1024];
19309 char structName[1024];
19310 struct Declarator * funcDecl;
19311 struct Symbol * thisSymbol;
19312 unsigned int typedObject = 0;
19313
19314 if(_class && !_class->base)
19315 {
19316 _class = currentClass;
19317 if(_class && !_class->symbol)
19318 _class->symbol = FindClass(_class->fullName);
19319 classSym = _class ? _class->symbol : (((void *)0));
19320 typedObject = 1;
19321 }
19322 thisClass = _class;
19323 if(inCompiler && _class)
19324 {
19325 if(type->kind == 11)
19326 {
19327 if(symbol->type->__anon1.__anon2.params.count == 1 && ((struct Type *)symbol->type->__anon1.__anon2.params.first)->kind == 0)
19328 {
19329 struct Type * param = symbol->type->__anon1.__anon2.params.first;
19330
19331 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(&symbol->type->__anon1.__anon2.params, param);
19332 FreeType(param);
19333 }
19334 if(type->classObjectType != 1)
19335 {
19336 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(&symbol->type->__anon1.__anon2.params, (((void *)0)), MkClassType(_class->fullName));
19337 symbol->type->__anon1.__anon2.staticMethod = 1;
19338 symbol->type->__anon1.__anon2.thisClass = (((void *)0));
19339 symbol->type->extraParam = 0;
19340 }
19341 }
19342 strcpy(className, "__ecereClass_");
19343 FullClassNameCat(className, _class->fullName, 1);
19344 structName[0] = 0;
19345 FullClassNameCat(structName, _class->fullName, 0);
19346 funcDecl = GetFuncDecl(function->declarator);
19347 if(funcDecl)
19348 {
19349 if(funcDecl->__anon1.function.parameters && (*funcDecl->__anon1.function.parameters).count == 1)
19350 {
19351 struct TypeName * param = (*funcDecl->__anon1.function.parameters).first;
19352
19353 if(param->qualifiers && (*param->qualifiers).count == 1 && ((struct Specifier *)(*param->qualifiers).first)->__anon1.specifier == VOID && !param->declarator)
19354 {
19355 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->__anon1.function.parameters), param);
19356 FreeTypeName(param);
19357 }
19358 }
19359 if(!function->propertyNoThis)
19360 {
19361 struct TypeName * thisParam = (((void *)0));
19362
19363 if(type->classObjectType != 1)
19364 {
19365 thisParam = QMkClass(_class->fullName, MkDeclaratorIdentifier(MkIdentifier("this")));
19366 if(!funcDecl->__anon1.function.parameters)
19367 funcDecl->__anon1.function.parameters = MkList();
19368 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->__anon1.function.parameters), (((void *)0)), thisParam);
19369 }
19370 if(typedObject)
19371 {
19372 if(type->classObjectType != 1)
19373 {
19374 if(type->byReference || _class->type == 3 || _class->type == 1000 || _class->type == 4 || _class->type == 2)
19375 thisParam->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), thisParam->declarator);
19376 }
19377 thisParam = __extension__ ({
19378 struct TypeName * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TypeName);
19379
19380 __ecereInstance1->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier("class"))), __ecereInstance1->qualifiers = MkListOne(MkStructOrUnion(3, MkIdentifier("__ecereNameSpace__ecere__com__Class"), (((void *)0)))), __ecereInstance1;
19381 });
19382 DeclareStruct(curExternal, "ecere::com::Class", 0, 1);
19383 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->__anon1.function.parameters), (((void *)0)), thisParam);
19384 }
19385 }
19386 }
19387 if(symbol && symbol->__anon2.__anon1.pointerExternal && symbol->__anon2.__anon1.pointerExternal->type == 1)
19388 {
19389 struct InitDeclarator * initDecl = (*symbol->__anon2.__anon1.pointerExternal->__anon1.declaration->__anon1.__anon1.declarators).first;
19390
19391 funcDecl = GetFuncDecl(initDecl->declarator);
19392 if(funcDecl)
19393 {
19394 if(funcDecl->__anon1.function.parameters && (*funcDecl->__anon1.function.parameters).count == 1)
19395 {
19396 struct TypeName * param = (*funcDecl->__anon1.function.parameters).first;
19397
19398 if(param->qualifiers && (*param->qualifiers).count == 1 && ((struct Specifier *)(*param->qualifiers).first)->__anon1.specifier == VOID && !param->declarator)
19399 {
19400 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->__anon1.function.parameters), param);
19401 FreeTypeName(param);
19402 }
19403 }
19404 if(type->classObjectType != 1)
19405 {
19406 if((_class->type != 2 && _class->type != 3 && _class->type != 4) || function != (struct FunctionDefinition *)symbol->__anon2.__anon2.externalSet)
19407 {
19408 struct TypeName * thisParam = QMkClass(_class->fullName, MkDeclaratorIdentifier(MkIdentifier("this")));
19409
19410 if(!funcDecl->__anon1.function.parameters)
19411 funcDecl->__anon1.function.parameters = MkList();
19412 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->__anon1.function.parameters), (((void *)0)), thisParam);
19413 }
19414 }
19415 }
19416 }
19417 }
19418 if(function->body)
19419 {
19420 if(type->classObjectType != 1)
19421 {
19422 thisSymbol = __extension__ ({
19423 struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
19424
19425 __ecereInstance1->string = __ecereNameSpace__ecere__sys__CopyString("this"), __ecereInstance1->type = classSym ? MkClassType(classSym->string) : (((void *)0)), __ecereInstance1;
19426 });
19427 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&function->body->__anon1.compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
19428 if(typedObject && thisSymbol->type)
19429 {
19430 thisSymbol->type->classObjectType = 2;
19431 thisSymbol->type->byReference = type->byReference;
19432 thisSymbol->type->typedByReference = type->byReference;
19433 }
19434 }
19435 }
19436 if(inCompiler && _class && _class->type == 0 && type->classObjectType != 1)
19437 {
19438 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
19439
19440 {
19441 struct __ecereNameSpace__ecere__com__Class * base;
19442
19443 for(base = _class; base && base->type != 1000; base = base->next)
19444 {
19445 for(member = base->membersAndProperties.first; member; member = member->next)
19446 if(!member->isProperty)
19447 break;
19448 if(member)
19449 break;
19450 }
19451 }
19452 for(member = _class->membersAndProperties.first; member; member = member->next)
19453 if(!member->isProperty)
19454 break;
19455 if(member)
19456 {
19457 char pointerName[1024];
19458 struct Declaration * decl;
19459 struct Initializer * initializer;
19460 struct Expression * exp, * bytePtr;
19461
19462 strcpy(pointerName, "__ecerePointer_");
19463 FullClassNameCat(pointerName, _class->fullName, 0);
19464 {
19465 char className[1024];
19466
19467 strcpy(className, "__ecereClass_");
19468 FullClassNameCat(className, classSym->string, 1);
19469 DeclareClass(curExternal, classSym, className);
19470 }
19471 bytePtr = QBrackets(MkExpCast(QMkType("char", QMkPtrDecl((((void *)0)))), QMkExpId("this")));
19472 if(_class->fixed)
19473 {
19474 struct Expression * e;
19475
19476 if(_class->offset && _class->offset == (_class->base->type == 5 ? _class->base->memberOffset : _class->base->structSize))
19477 {
19478 e = MkExpClassSize(MkSpecifierName(_class->base->fullName));
19479 ProcessExpressionType(e);
19480 }
19481 else
19482 {
19483 char string[256];
19484
19485 sprintf(string, "%d", _class->offset);
19486 e = MkExpConstant(string);
19487 }
19488 exp = QBrackets(MkExpOp(bytePtr, '+', e));
19489 }
19490 else
19491 {
19492 exp = QBrackets(MkExpOp(bytePtr, '+', MkExpPointer(QMkExpId(className), MkIdentifier("offset"))));
19493 }
19494 exp = QBrackets(QMkExpCond(QMkExpId("this"), exp, MkExpConstant("0")));
19495 exp->expType = __extension__ ({
19496 struct Type * __ecereInstance2 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
19497
19498 __ecereInstance2->refCount = 1, __ecereInstance2->kind = 13, __ecereInstance2->__anon1.type = __extension__ ({
19499 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
19500
19501 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 0, __ecereInstance1;
19502 }), __ecereInstance2;
19503 });
19504 if(function->body)
19505 {
19506 yylloc = function->body->loc;
19507 initializer = MkInitializerAssignment(MkExpCast(MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(structName), (((void *)0)))), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), exp));
19508 {
19509 struct Context * prevContext = curContext;
19510 struct __ecereNameSpace__ecere__sys__OldList * list;
19511
19512 curContext = function->body->__anon1.compound.context;
19513 decl = MkDeclaration((list = MkListOne(MkStructOrUnion(3, MkIdentifier(structName), (((void *)0))))), MkListOne(MkInitDeclarator(QMkPtrDecl(pointerName), initializer)));
19514 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*list), (((void *)0)), MkSpecifierExtended(MkExtDeclAttrib(MkAttrib(ATTRIB, MkListOne(MkAttribute(__ecereNameSpace__ecere__sys__CopyString("unused"), (((void *)0))))))));
19515 curContext = prevContext;
19516 }
19517 decl->symbol = (((void *)0));
19518 if(!function->body->__anon1.compound.declarations)
19519 function->body->__anon1.compound.declarations = MkList();
19520 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*function->body->__anon1.compound.declarations), (((void *)0)), decl);
19521 }
19522 }
19523 }
19524 }
19525 else
19526 thisClass = (((void *)0));
19527 if(id)
19528 {
19529 FreeSpecifier(id->_class);
19530 id->_class = (((void *)0));
19531 if(symbol && symbol->__anon2.__anon1.pointerExternal && symbol->__anon2.__anon1.pointerExternal->type == 1)
19532 {
19533 struct InitDeclarator * initDecl = (*symbol->__anon2.__anon1.pointerExternal->__anon1.declaration->__anon1.__anon1.declarators).first;
19534
19535 id = GetDeclId(initDecl->declarator);
19536 FreeSpecifier(id->_class);
19537 id->_class = (((void *)0));
19538 }
19539 }
19540 if(function->body)
19541 topContext = function->body->__anon1.compound.context;
19542 {
19543 struct FunctionDefinition * oldFunction = curFunction;
19544
19545 curFunction = function;
19546 if(function->body)
19547 ProcessStatement(function->body);
19548 if(inCompiler && function->propSet && !function->propSet->fireWatchersDone)
19549 {
19550 struct Statement * prevCompound = curCompound;
19551 struct Context * prevContext = curContext;
19552 struct Statement * fireWatchers = MkFireWatchersStmt((((void *)0)), (((void *)0)));
19553
19554 if(!function->body->__anon1.compound.statements)
19555 function->body->__anon1.compound.statements = MkList();
19556 ListAdd(function->body->__anon1.compound.statements, fireWatchers);
19557 curCompound = function->body;
19558 curContext = function->body->__anon1.compound.context;
19559 ProcessStatement(fireWatchers);
19560 curContext = prevContext;
19561 curCompound = prevCompound;
19562 }
19563 curFunction = oldFunction;
19564 }
19565 if(function->declarator)
19566 {
19567 ProcessDeclarator(function->declarator, 1);
19568 }
19569 topContext = oldTopContext;
19570 thisClass = oldThisClass;
19571 }
19572
19573 static void ProcessClass(struct __ecereNameSpace__ecere__sys__OldList * definitions, struct Symbol * symbol)
19574 {
19575 struct ClassDef * def;
19576 struct External * external = curExternal;
19577 struct __ecereNameSpace__ecere__com__Class * regClass = symbol ? symbol->__anon1.registered : (((void *)0));
19578
19579 for(def = definitions->first; def; def = def->next)
19580 {
19581 if(def->type == 0)
19582 {
19583 if(def->__anon1.function->declarator)
19584 curExternal = def->__anon1.function->declarator->symbol->__anon2.__anon1.pointerExternal;
19585 else
19586 curExternal = external;
19587 ProcessFunction((struct FunctionDefinition *)def->__anon1.function);
19588 }
19589 else if(def->type == 2)
19590 {
19591 if(def->__anon1.decl->type == 2)
19592 {
19593 thisClass = regClass;
19594 ProcessInstantiationType(def->__anon1.decl->__anon1.inst);
19595 thisClass = (((void *)0));
19596 }
19597 else
19598 {
19599 struct __ecereNameSpace__ecere__com__Class * backThisClass = thisClass;
19600
19601 if(regClass)
19602 thisClass = regClass;
19603 ProcessDeclaration(def->__anon1.decl, symbol ? 1 : 0);
19604 thisClass = backThisClass;
19605 }
19606 }
19607 else if(def->type == 1 && def->__anon1.defProperties)
19608 {
19609 struct MemberInit * defProperty;
19610 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);
19611
19612 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
19613 for(defProperty = (*def->__anon1.defProperties).first; defProperty; defProperty = defProperty->next)
19614 {
19615 thisClass = regClass;
19616 ProcessMemberInitData(defProperty, regClass, (((void *)0)), (((void *)0)), (((void *)0)), (((void *)0)));
19617 thisClass = (((void *)0));
19618 }
19619 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Remove(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
19620 FreeSymbol(thisSymbol);
19621 }
19622 else if(def->type == 3 && def->__anon1.propertyDef)
19623 {
19624 struct PropertyDef * prop = def->__anon1.propertyDef;
19625
19626 thisClass = regClass;
19627 if(prop->setStmt)
19628 {
19629 if(regClass)
19630 {
19631 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
19632
19633 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->setStmt->__anon1.compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
19634 }
19635 curExternal = prop->symbol ? prop->symbol->__anon2.__anon2.externalSet : (((void *)0));
19636 ProcessStatement(prop->setStmt);
19637 }
19638 if(prop->getStmt)
19639 {
19640 if(regClass)
19641 {
19642 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
19643
19644 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->getStmt->__anon1.compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
19645 }
19646 curExternal = prop->symbol ? prop->symbol->__anon2.__anon2.externalGet : (((void *)0));
19647 ProcessStatement(prop->getStmt);
19648 }
19649 if(prop->issetStmt)
19650 {
19651 if(regClass)
19652 {
19653 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
19654
19655 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->issetStmt->__anon1.compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
19656 }
19657 curExternal = prop->symbol ? prop->symbol->__anon2.__anon2.externalIsSet : (((void *)0));
19658 ProcessStatement(prop->issetStmt);
19659 }
19660 thisClass = (((void *)0));
19661 }
19662 else if(def->type == 4 && def->__anon1.propertyWatch)
19663 {
19664 struct PropertyWatch * propertyWatch = def->__anon1.propertyWatch;
19665
19666 thisClass = regClass;
19667 if(propertyWatch->compound)
19668 {
19669 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);
19670
19671 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&propertyWatch->compound->__anon1.compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
19672 curExternal = (((void *)0));
19673 ProcessStatement(propertyWatch->compound);
19674 }
19675 thisClass = (((void *)0));
19676 }
19677 }
19678 }
19679
19680 void __ecereRegisterModule_pass15(struct __ecereNameSpace__ecere__com__Instance * module)
19681 {
19682 struct __ecereNameSpace__ecere__com__Class __attribute__((unused)) * class;
19683
19684 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetYydebug", "void SetYydebug(bool b)", SetYydebug, module, 1);
19685 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetThisClass", "void SetThisClass(ecere::com::Class c)", SetThisClass, module, 1);
19686 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetThisClass", "ecere::com::Class GetThisClass(void)", GetThisClass, module, 1);
19687 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintExpression", "void PrintExpression(Expression exp, char * string)", PrintExpression, module, 1);
19688 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessTemplateParameterType", "Type ProcessTemplateParameterType(TemplateParameter param)", ProcessTemplateParameterType, module, 2);
19689 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("NeedCast", "bool NeedCast(Type type1, Type type2)", NeedCast, module, 2);
19690 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintInt", "char * PrintInt(int64 result)", PrintInt, module, 1);
19691 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUInt", "char * PrintUInt(uint64 result)", PrintUInt, module, 1);
19692 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintInt64", "char * PrintInt64(int64 result)", PrintInt64, module, 1);
19693 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUInt64", "char * PrintUInt64(uint64 result)", PrintUInt64, module, 1);
19694 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintHexUInt", "char * PrintHexUInt(uint64 result)", PrintHexUInt, module, 1);
19695 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintHexUInt64", "char * PrintHexUInt64(uint64 result)", PrintHexUInt64, module, 1);
19696 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintShort", "char * PrintShort(short result)", PrintShort, module, 1);
19697 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUShort", "char * PrintUShort(uint16 result)", PrintUShort, module, 1);
19698 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintChar", "char * PrintChar(char result)", PrintChar, module, 1);
19699 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUChar", "char * PrintUChar(byte result)", PrintUChar, module, 1);
19700 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintFloat", "char * PrintFloat(float result)", PrintFloat, module, 1);
19701 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintDouble", "char * PrintDouble(double result)", PrintDouble, module, 1);
19702 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpInt", "bool GetOpInt(Operand op2, int * value2)", GetOpInt, module, 1);
19703 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetInt", "bool GetInt(Expression exp, int * value2)", GetInt, module, 1);
19704 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUInt", "bool GetOpUInt(Operand op2, uint * value2)", GetOpUInt, module, 1);
19705 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUInt", "bool GetUInt(Expression exp, uint * value2)", GetUInt, module, 1);
19706 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpInt64", "bool GetOpInt64(Operand op2, int64 * value2)", GetOpInt64, module, 1);
19707 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetInt64", "bool GetInt64(Expression exp, int64 * value2)", GetInt64, module, 1);
19708 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUInt64", "bool GetOpUInt64(Operand op2, uint64 * value2)", GetOpUInt64, module, 1);
19709 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUInt64", "bool GetUInt64(Expression exp, uint64 * value2)", GetUInt64, module, 1);
19710 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpIntPtr", "bool GetOpIntPtr(Operand op2, intptr * value2)", GetOpIntPtr, module, 1);
19711 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetIntPtr", "bool GetIntPtr(Expression exp, intptr * value2)", GetIntPtr, module, 1);
19712 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUIntPtr", "bool GetOpUIntPtr(Operand op2, uintptr * value2)", GetOpUIntPtr, module, 1);
19713 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUIntPtr", "bool GetUIntPtr(Expression exp, uintptr * value2)", GetUIntPtr, module, 1);
19714 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpIntSize", "bool GetOpIntSize(Operand op2, intsize * value2)", GetOpIntSize, module, 1);
19715 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetIntSize", "bool GetIntSize(Expression exp, intsize * value2)", GetIntSize, module, 1);
19716 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUIntSize", "bool GetOpUIntSize(Operand op2, uintsize * value2)", GetOpUIntSize, module, 1);
19717 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUIntSize", "bool GetUIntSize(Expression exp, uintsize * value2)", GetUIntSize, module, 1);
19718 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpShort", "bool GetOpShort(Operand op2, short * value2)", GetOpShort, module, 1);
19719 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetShort", "bool GetShort(Expression exp, short * value2)", GetShort, module, 1);
19720 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUShort", "bool GetOpUShort(Operand op2, uint16 * value2)", GetOpUShort, module, 1);
19721 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUShort", "bool GetUShort(Expression exp, uint16 * value2)", GetUShort, module, 1);
19722 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpChar", "bool GetOpChar(Operand op2, char * value2)", GetOpChar, module, 1);
19723 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetChar", "bool GetChar(Expression exp, char * value2)", GetChar, module, 1);
19724 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUChar", "bool GetOpUChar(Operand op2, byte * value2)", GetOpUChar, module, 1);
19725 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUChar", "bool GetUChar(Expression exp, byte * value2)", GetUChar, module, 1);
19726 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpFloat", "bool GetOpFloat(Operand op2, float * value2)", GetOpFloat, module, 1);
19727 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetFloat", "bool GetFloat(Expression exp, float * value2)", GetFloat, module, 1);
19728 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpDouble", "bool GetOpDouble(Operand op2, double * value2)", GetOpDouble, module, 1);
19729 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetDouble", "bool GetDouble(Expression exp, double * value2)", GetDouble, module, 1);
19730 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeClassMembers", "void ComputeClassMembers(ecere::com::Class _class, bool isMember)", ComputeClassMembers, module, 2);
19731 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeModuleClasses", "void ComputeModuleClasses(ecere::com::Module module)", ComputeModuleClasses, module, 1);
19732 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeTypeSize", "int ComputeTypeSize(Type type)", ComputeTypeSize, module, 1);
19733 __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);
19734 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareStruct", "External DeclareStruct(External neededBy, const char * name, bool skipNoHead, bool needDereference)", DeclareStruct, module, 2);
19735 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("_DeclareStruct", "External _DeclareStruct(External neededBy, const char * name, bool skipNoHead, bool needDereference, bool fwdDecl)", _DeclareStruct, module, 2);
19736 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareProperty", "void DeclareProperty(External neededBy, ecere::com::Property prop, char * setName, char * getName)", DeclareProperty, module, 2);
19737 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("Dereference", "Type Dereference(Type source)", Dereference, module, 1);
19738 __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);
19739 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessInstantiationType", "void ProcessInstantiationType(Instantiation inst)", ProcessInstantiationType, module, 2);
19740 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareType", "void DeclareType(External neededFor, Type type, bool needDereference, bool forFunctionDef)", DeclareType, module, 2);
19741 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareTypeForwardDeclare", "void DeclareTypeForwardDeclare(External neededFor, Type type, bool needDereference, bool forFunctionDef)", DeclareTypeForwardDeclare, module, 2);
19742 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindTemplateArg", "ecere::com::ClassTemplateArgument * FindTemplateArg(ecere::com::Class _class, TemplateParameter param)", FindTemplateArg, module, 2);
19743 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetupTemplatesContext", "Context SetupTemplatesContext(ecere::com::Class _class)", SetupTemplatesContext, module, 1);
19744 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FinishTemplatesContext", "void FinishTemplatesContext(Context context)", FinishTemplatesContext, module, 1);
19745 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessMethodType", "void ProcessMethodType(ecere::com::Method method)", ProcessMethodType, module, 1);
19746 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessPropertyType", "void ProcessPropertyType(ecere::com::Property prop)", ProcessPropertyType, module, 1);
19747 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareMethod", "void DeclareMethod(External neededFor, ecere::com::Method method, const char * name)", DeclareMethod, module, 1);
19748 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClass", "char * ReplaceThisClass(ecere::com::Class _class)", ReplaceThisClass, module, 2);
19749 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClassType", "Type ReplaceThisClassType(ecere::com::Class _class)", ReplaceThisClassType, module, 2);
19750 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClassSpecifiers", "void ReplaceThisClassSpecifiers(ecere::sys::OldList specs, ecere::com::Class _class)", ReplaceThisClassSpecifiers, module, 2);
19751 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareFunction", "bool DeclareFunction(External neededFor, ecere::com::GlobalFunction function, char * name)", DeclareFunction, module, 2);
19752 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareGlobalData", "void DeclareGlobalData(External neededFor, GlobalData data)", DeclareGlobalData, module, 2);
19753 class = __ecereNameSpace__ecere__com__eSystem_RegisterClass(5, "Conversion", 0, sizeof(struct Conversion), 0, (void *)0, (void *)0, module, 2, 1);
19754 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)
19755 __ecereClass_Conversion = class;
19756 __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);
19757 __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);
19758 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ModuleVisibility", "bool ModuleVisibility(ecere::com::Module searchIn, ecere::com::Module searchFor)", ModuleVisibility, module, 1);
19759 __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);
19760 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("MatchTypeExpression", "bool MatchTypeExpression(Expression sourceExp, Type dest, ecere::sys::OldList conversions, bool skipUnitBla, bool warnConst)", MatchTypeExpression, module, 2);
19761 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReadString", "void ReadString(char * output, char * string)", ReadString, module, 1);
19762 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("UnescapeString", "int UnescapeString(char * d, char * s, int len)", UnescapeString, module, 1);
19763 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("OffsetEscapedString", "char * OffsetEscapedString(char * s, int len, int offset)", OffsetEscapedString, module, 1);
19764 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOperand", "Operand GetOperand(Expression exp)", GetOperand, module, 1);
19765 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PopulateInstance", "void PopulateInstance(Instantiation inst)", PopulateInstance, module, 1);
19766 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeInstantiation", "void ComputeInstantiation(Expression exp)", ComputeInstantiation, module, 1);
19767 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CallOperator", "void CallOperator(Expression exp, Expression exp1, Expression exp2, Operand op1, Operand op2)", CallOperator, module, 1);
19768 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeExpression", "void ComputeExpression(Expression exp)", ComputeExpression, module, 1);
19769 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("modifyPassAsTemplate", "void modifyPassAsTemplate(Type * typePtr, bool value)", modifyPassAsTemplate, module, 1);
19770 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CheckTemplateTypes", "void CheckTemplateTypes(Expression exp)", CheckTemplateTypes, module, 1);
19771 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindSymbol", "Symbol FindSymbol(const char * name, Context startContext, Context endContext, bool isStruct, bool globalNameSpace)", FindSymbol, module, 1);
19772 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintType", "void PrintType(Type type, char * string, bool printName, bool fullName)", PrintType, module, 1);
19773 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintTypeNoConst", "void PrintTypeNoConst(Type type, char * string, bool printName, bool fullName)", PrintTypeNoConst, module, 1);
19774 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindMemberAndOffset", "Type FindMemberAndOffset(Type type, char * string, uint * offset)", FindMemberAndOffset, module, 1);
19775 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetParseError", "bool GetParseError(void)", GetParseError, module, 1);
19776 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ParseExpressionString", "Expression ParseExpressionString(char * expression)", ParseExpressionString, module, 1);
19777 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceExpContents", "void ReplaceExpContents(Expression checkedExp, Expression newExp)", ReplaceExpContents, module, 1);
19778 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ApplyAnyObjectLogic", "void ApplyAnyObjectLogic(Expression e)", ApplyAnyObjectLogic, module, 1);
19779 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ApplyLocation", "void ApplyLocation(Expression exp, Location loc)", ApplyLocation, module, 1);
19780 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("RelatedUnits", "bool RelatedUnits(ecere::com::Class c1, ecere::com::Class c2)", RelatedUnits, module, 1);
19781 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessExpressionType", "void ProcessExpressionType(Expression exp)", ProcessExpressionType, module, 1);
19782 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareFunctionUtil", "void DeclareFunctionUtil(External neededBy, const String s)", DeclareFunctionUtil, module, 1);
19783 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeDataTypes", "void ComputeDataTypes(void)", ComputeDataTypes, module, 1);
19784 }
19785