compiler/libec: Only using gcc_struct attribute for MinGW
[sdk] / compiler / bootstrap / libec / bootstrap / pass15.c
1 /* Code generated from eC source file: pass15.ec */
2 #if defined(_WIN32)
3 #define __runtimePlatform 1
4 #elif defined(__APPLE__)
5 #define __runtimePlatform 3
6 #else
7 #define __runtimePlatform 2
8 #endif
9 #if defined(__GNUC__)
10 typedef long long int64;
11 typedef unsigned long long uint64;
12 #ifndef _WIN32
13 #define __declspec(x)
14 #endif
15 #elif defined(__TINYC__)
16 #include <stdarg.h>
17 #define __builtin_va_list va_list
18 #define __builtin_va_start va_start
19 #define __builtin_va_end va_end
20 #ifdef _WIN32
21 #define strcasecmp stricmp
22 #define strncasecmp strnicmp
23 #define __declspec(x) __attribute__((x))
24 #else
25 #define __declspec(x)
26 #endif
27 typedef long long int64;
28 typedef unsigned long long uint64;
29 #else
30 typedef __int64 int64;
31 typedef unsigned __int64 uint64;
32 #endif
33 #ifdef __BIG_ENDIAN__
34 #define __ENDIAN_PAD(x) (8 - (x))
35 #else
36 #define __ENDIAN_PAD(x) 0
37 #endif
38 #if defined(_WIN32)
39 #   if defined(__GNUC__) || defined(__TINYC__)
40 #      define ecere_stdcall __attribute__((__stdcall__))
41 #      define ecere_gcc_struct __attribute__((gcc_struct))
42 #   else
43 #      define ecere_stdcall __stdcall
44 #      define ecere_gcc_struct
45 #   endif
46 #else
47 #   define ecere_stdcall
48 #   define ecere_gcc_struct
49 #endif
50 #include <stdint.h>
51 #include <sys/types.h>
52 enum yytokentype
53 {
54 IDENTIFIER = 258, CONSTANT = 259, STRING_LITERAL = 260, SIZEOF = 261, PTR_OP = 262, INC_OP = 263, DEC_OP = 264, LEFT_OP = 265, RIGHT_OP = 266, LE_OP = 267, GE_OP = 268, EQ_OP = 269, NE_OP = 270, AND_OP = 271, OR_OP = 272, MUL_ASSIGN = 273, DIV_ASSIGN = 274, MOD_ASSIGN = 275, ADD_ASSIGN = 276, SUB_ASSIGN = 277, LEFT_ASSIGN = 278, RIGHT_ASSIGN = 279, AND_ASSIGN = 280, XOR_ASSIGN = 281, OR_ASSIGN = 282, TYPE_NAME = 283, TYPEDEF = 284, EXTERN = 285, STATIC = 286, AUTO = 287, REGISTER = 288, CHAR = 289, SHORT = 290, INT = 291, UINT = 292, INT64 = 293, LONG = 294, SIGNED = 295, UNSIGNED = 296, FLOAT = 297, DOUBLE = 298, CONST = 299, VOLATILE = 300, VOID = 301, VALIST = 302, STRUCT = 303, UNION = 304, ENUM = 305, ELLIPSIS = 306, CASE = 307, DEFAULT = 308, IF = 309, SWITCH = 310, WHILE = 311, DO = 312, FOR = 313, GOTO = 314, CONTINUE = 315, BREAK = 316, RETURN = 317, IFX = 318, ELSE = 319, CLASS = 320, THISCLASS = 321, CLASS_NAME = 322, PROPERTY = 323, SETPROP = 324, GETPROP = 325, NEWOP = 326, RENEW = 327, DELETE = 328, EXT_DECL = 329, EXT_STORAGE = 330, IMPORT = 331, DEFINE = 332, VIRTUAL = 333, ATTRIB = 334, PUBLIC = 335, PRIVATE = 336, TYPED_OBJECT = 337, ANY_OBJECT = 338, _INCREF = 339, EXTENSION = 340, ASM = 341, TYPEOF = 342, WATCH = 343, STOPWATCHING = 344, FIREWATCHERS = 345, WATCHABLE = 346, CLASS_DESIGNER = 347, CLASS_NO_EXPANSION = 348, CLASS_FIXED = 349, ISPROPSET = 350, CLASS_DEFAULT_PROPERTY = 351, PROPERTY_CATEGORY = 352, CLASS_DATA = 353, CLASS_PROPERTY = 354, SUBCLASS = 355, NAMESPACE = 356, NEW0OP = 357, RENEW0 = 358, VAARG = 359, DBTABLE = 360, DBFIELD = 361, DBINDEX = 362, DATABASE_OPEN = 363, ALIGNOF = 364, ATTRIB_DEP = 365, __ATTRIB = 366, BOOL = 367, _BOOL = 368, _COMPLEX = 369, _IMAGINARY = 370, RESTRICT = 371, THREAD = 372, WIDE_STRING_LITERAL = 373
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 extern unsigned int memoryGuard;
186
187 struct __ecereNameSpace__ecere__sys__OldList
188 {
189 void *  first;
190 void *  last;
191 int count;
192 unsigned int offset;
193 unsigned int circ;
194 } ecere_gcc_struct;
195
196 struct __ecereNameSpace__ecere__com__DataValue
197 {
198 union
199 {
200 char c;
201 unsigned char uc;
202 short s;
203 unsigned short us;
204 int i;
205 unsigned int ui;
206 void *  p;
207 float f;
208 double d;
209 long long i64;
210 uint64 ui64;
211 } ecere_gcc_struct __anon1;
212 } ecere_gcc_struct;
213
214 struct __ecereNameSpace__ecere__com__SerialBuffer
215 {
216 unsigned char *  _buffer;
217 unsigned int count;
218 unsigned int _size;
219 unsigned int pos;
220 } ecere_gcc_struct;
221
222 extern void *  __ecereNameSpace__ecere__com__eSystem_New(unsigned int size);
223
224 extern void *  __ecereNameSpace__ecere__com__eSystem_New0(unsigned int size);
225
226 extern void *  __ecereNameSpace__ecere__com__eSystem_Renew(void *  memory, unsigned int size);
227
228 extern void *  __ecereNameSpace__ecere__com__eSystem_Renew0(void *  memory, unsigned int size);
229
230 extern void __ecereNameSpace__ecere__com__eSystem_Delete(void *  memory);
231
232 struct Pointer;
233
234 struct Attrib;
235
236 struct Attribute;
237
238 struct TemplateArgument;
239
240 struct DBTableEntry;
241
242 struct DBIndexItem;
243
244 struct DBTableDef;
245
246 struct CodePosition
247 {
248 int line;
249 int charPos;
250 int pos;
251 int included;
252 } ecere_gcc_struct;
253
254 extern size_t strlen(const char * );
255
256 extern int strcmp(const char * , const char * );
257
258 extern int sprintf(char * , const char * , ...);
259
260 extern char *  strcat(char * , const char * );
261
262 extern char *  __ecereNameSpace__ecere__sys__CopyString(const char *  string);
263
264 extern int isprint(int c);
265
266 extern char *  strcpy(char * , const char * );
267
268 extern void Compiler_Error(const char *  format, ...);
269
270 extern const char *  __ecereNameSpace__ecere__GetTranslatedString(const char * name, const char *  string, const char *  stringAndContext);
271
272 struct __ecereNameSpace__ecere__com__LinkList
273 {
274 void * first;
275 void * last;
276 int count;
277 } ecere_gcc_struct;
278
279 extern char *  strchr(const char * , int);
280
281 extern void FullClassNameCat(char *  output, const char *  className, unsigned int includeTemplateParams);
282
283 extern void *  memcpy(void * , const void * , size_t size);
284
285 extern void __ecereNameSpace__ecere__sys__ChangeCh(char *  string, char ch1, char ch2);
286
287 extern void Compiler_Warning(const char *  format, ...);
288
289 extern unsigned long strtoul(const char *  nptr, char * *  endptr, int base);
290
291 extern long long strtoll(const char *  nptr, char * *  endptr, int base);
292
293 extern uint64 strtoull(const char *  nptr, char * *  endptr, int base);
294
295 extern int strtol(const char * , char * * , int base);
296
297 extern long long __ecereNameSpace__ecere__com___strtoi64(const char *  string, const char * *  endString, int base);
298
299 extern uint64 __ecereNameSpace__ecere__com___strtoui64(const char *  string, const char * *  endString, int base);
300
301 extern double strtod(const char * , char * * );
302
303 extern int strncmp(const char * , const char * , size_t n);
304
305 extern char *  __ecereNameSpace__ecere__sys__RSearchString(const char *  buffer, const char *  subStr, int maxLen, unsigned int matchCase, unsigned int matchWord);
306
307 extern char *  QMkString(const char *  source);
308
309 extern char *  strncpy(char * , const char * , size_t n);
310
311 extern int printf(const char * , ...);
312
313 extern char *  strstr(const char * , const char * );
314
315 extern unsigned int __ecereNameSpace__ecere__sys__UTF8GetChar(const char *  string, int *  numBytes);
316
317 extern unsigned int (* __ecereProp_float_Get_isInf)(float this);
318
319 extern int (* __ecereProp_float_Get_signBit)(float this);
320
321 extern unsigned int (* __ecereProp_float_Get_isNan)(float this);
322
323 extern unsigned int (* __ecereProp_double_Get_isInf)(double this);
324
325 extern int (* __ecereProp_double_Get_signBit)(double this);
326
327 extern unsigned int (* __ecereProp_double_Get_isNan)(double this);
328
329 extern float (* __ecereMethod_float_inf)(void);
330
331 extern float (* __ecereMethod_float_nan)(void);
332
333 extern double (* __ecereMethod_double_inf)(void);
334
335 extern double (* __ecereMethod_double_nan)(void);
336
337 int __ecereVMethodID_class_OnGetString;
338
339 void SetYydebug(unsigned int b)
340 {
341 yydebug = b;
342 }
343
344 unsigned int GetParseError()
345 {
346 return parseError;
347 }
348
349 extern struct __ecereNameSpace__ecere__sys__OldList * ast;
350
351 extern struct __ecereNameSpace__ecere__sys__OldList *  MkList(void);
352
353 extern struct __ecereNameSpace__ecere__sys__OldList *  MkListOne(void *  item);
354
355 extern void ListAdd(struct __ecereNameSpace__ecere__sys__OldList * list, void *  item);
356
357 extern void FreeList(struct __ecereNameSpace__ecere__sys__OldList * list, void (*  FreeFunction)(void * ));
358
359 struct __ecereNameSpace__ecere__com__EnumClassData
360 {
361 struct __ecereNameSpace__ecere__sys__OldList values;
362 long long largest;
363 } ecere_gcc_struct;
364
365 extern struct __ecereNameSpace__ecere__sys__OldList *  CopyList(struct __ecereNameSpace__ecere__sys__OldList *  source, void *  (*  CopyFunction)(void * ));
366
367 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(struct __ecereNameSpace__ecere__sys__OldList * this, void *  item);
368
369 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(struct __ecereNameSpace__ecere__sys__OldList * this, void *  prevItem, void *  item);
370
371 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(struct __ecereNameSpace__ecere__sys__OldList * this, void *  item);
372
373 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(struct __ecereNameSpace__ecere__sys__OldList * this, void (*  freeFn)(void * ));
374
375 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear(struct __ecereNameSpace__ecere__sys__OldList * this);
376
377 extern struct Pointer * MkPointer(struct __ecereNameSpace__ecere__sys__OldList * qualifiers, struct Pointer * pointer);
378
379 extern struct Attrib * MkAttrib(int type, struct __ecereNameSpace__ecere__sys__OldList *  attribs);
380
381 struct Location
382 {
383 struct CodePosition start;
384 struct CodePosition end;
385 } ecere_gcc_struct;
386
387 void ReadString(char * output, char * string)
388 {
389 int len = strlen(string);
390 int c, d = 0;
391 unsigned int quoted = 0, escaped = 0;
392
393 for(c = 0; c < len; c++)
394 {
395 char ch = string[c];
396
397 if(escaped)
398 {
399 switch(ch)
400 {
401 case 'n':
402 output[d] = '\n';
403 break;
404 case 't':
405 output[d] = '\t';
406 break;
407 case 'a':
408 output[d] = '\a';
409 break;
410 case 'b':
411 output[d] = '\b';
412 break;
413 case 'f':
414 output[d] = '\f';
415 break;
416 case 'r':
417 output[d] = '\r';
418 break;
419 case 'v':
420 output[d] = '\v';
421 break;
422 case '\\':
423 output[d] = '\\';
424 break;
425 case '\"':
426 output[d] = '\"';
427 break;
428 case '\'':
429 output[d] = '\'';
430 break;
431 default:
432 output[d] = ch;
433 }
434 d++;
435 escaped = 0;
436 }
437 else
438 {
439 if(ch == '\"')
440 quoted ^= 1;
441 else if(quoted)
442 {
443 if(ch == '\\')
444 escaped = 1;
445 else
446 output[d++] = ch;
447 }
448 }
449 }
450 output[d] = '\0';
451 }
452
453 char * PrintInt(long long result)
454 {
455 char temp[100];
456
457 if(result > (((int)0x7fffffff)))
458 sprintf(temp, ((__runtimePlatform == 1) ? "0x%I64X" : "0x%llX"), result);
459 else
460 sprintf(temp, ((__runtimePlatform == 1) ? "%I64d" : "%lld"), result);
461 if(result > (((int)0x7fffffff)) || result < (((int)0x80000000)))
462 strcat(temp, "LL");
463 return __ecereNameSpace__ecere__sys__CopyString(temp);
464 }
465
466 char * PrintUInt(uint64 result)
467 {
468 char temp[100];
469
470 if(result > (0xffffffff))
471 sprintf(temp, ((__runtimePlatform == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
472 else if(result > (((int)0x7fffffff)))
473 sprintf(temp, ((__runtimePlatform == 1) ? "0x%I64X" : "0x%llX"), result);
474 else
475 sprintf(temp, ((__runtimePlatform == 1) ? "%I64d" : "%lld"), result);
476 return __ecereNameSpace__ecere__sys__CopyString(temp);
477 }
478
479 char * PrintInt64(long long result)
480 {
481 char temp[100];
482
483 if(result > (((int)0x7fffffff)) || result < (((int)0x80000000)))
484 sprintf(temp, ((__runtimePlatform == 1) ? "%I64dLL" : "%lldLL"), result);
485 else
486 sprintf(temp, ((__runtimePlatform == 1) ? "%I64d" : "%lld"), result);
487 return __ecereNameSpace__ecere__sys__CopyString(temp);
488 }
489
490 char * PrintUInt64(uint64 result)
491 {
492 char temp[100];
493
494 if(result > (0xffffffff))
495 sprintf(temp, ((__runtimePlatform == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
496 else if(result > (((int)0x7fffffff)))
497 sprintf(temp, ((__runtimePlatform == 1) ? "0x%I64X" : "0x%llX"), result);
498 else
499 sprintf(temp, ((__runtimePlatform == 1) ? "%I64d" : "%lld"), result);
500 return __ecereNameSpace__ecere__sys__CopyString(temp);
501 }
502
503 char * PrintHexUInt(uint64 result)
504 {
505 char temp[100];
506
507 if(result > (0xffffffff))
508 sprintf(temp, ((__runtimePlatform == 1) ? "0x%I64X" : "0x%llX"), result);
509 else
510 sprintf(temp, ((__runtimePlatform == 1) ? "0x%I64X" : "0x%llX"), result);
511 if(result > (0xffffffff))
512 strcat(temp, "LL");
513 return __ecereNameSpace__ecere__sys__CopyString(temp);
514 }
515
516 char * PrintHexUInt64(uint64 result)
517 {
518 char temp[100];
519
520 if(result > (0xffffffff))
521 sprintf(temp, ((__runtimePlatform == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
522 else
523 sprintf(temp, ((__runtimePlatform == 1) ? "0x%I64X" : "0x%llX"), result);
524 return __ecereNameSpace__ecere__sys__CopyString(temp);
525 }
526
527 char * PrintShort(short result)
528 {
529 char temp[100];
530
531 sprintf(temp, "%d", (unsigned short)result);
532 return __ecereNameSpace__ecere__sys__CopyString(temp);
533 }
534
535 char * PrintUShort(unsigned short result)
536 {
537 char temp[100];
538
539 if(result > (unsigned short)32767)
540 sprintf(temp, "0x%X", (int)result);
541 else
542 sprintf(temp, "%d", (int)result);
543 return __ecereNameSpace__ecere__sys__CopyString(temp);
544 }
545
546 char * PrintUChar(unsigned char result)
547 {
548 char temp[100];
549
550 sprintf(temp, "0x%X", result);
551 return __ecereNameSpace__ecere__sys__CopyString(temp);
552 }
553
554 char * PrintChar(char result)
555 {
556 char temp[100];
557
558 if(result > (char)0 && isprint(result))
559 sprintf(temp, "'%c'", result);
560 else if(result < (char)0)
561 sprintf(temp, "%d", (int)result);
562 else
563 sprintf(temp, "0x%X", (unsigned char)result);
564 return __ecereNameSpace__ecere__sys__CopyString(temp);
565 }
566
567 char * PrintFloat(float result)
568 {
569 char temp[350];
570
571 if(__ecereProp_float_Get_isInf(result))
572 {
573 if(__ecereProp_float_Get_signBit(result))
574 strcpy(temp, "-inf");
575 else
576 strcpy(temp, "inf");
577 }
578 else if(__ecereProp_float_Get_isNan(result))
579 {
580 if(__ecereProp_float_Get_signBit(result))
581 strcpy(temp, "-nan");
582 else
583 strcpy(temp, "nan");
584 }
585 else
586 sprintf(temp, "%.16ff", result);
587 return __ecereNameSpace__ecere__sys__CopyString(temp);
588 }
589
590 char * PrintDouble(double result)
591 {
592 char temp[350];
593
594 if(__ecereProp_double_Get_isInf(result))
595 {
596 if(__ecereProp_double_Get_signBit(result))
597 strcpy(temp, "-inf");
598 else
599 strcpy(temp, "inf");
600 }
601 else if(__ecereProp_double_Get_isNan(result))
602 {
603 if(__ecereProp_double_Get_signBit(result))
604 strcpy(temp, "-nan");
605 else
606 strcpy(temp, "nan");
607 }
608 else
609 sprintf(temp, "%.16f", result);
610 return __ecereNameSpace__ecere__sys__CopyString(temp);
611 }
612
613 extern struct Location yylloc;
614
615 struct ExtDecl
616 {
617 struct Location loc;
618 int type;
619 union
620 {
621 char * s;
622 struct Attrib * attr;
623 } ecere_gcc_struct __anon1;
624 } ecere_gcc_struct;
625
626 extern struct ExtDecl * MkExtDeclAttrib(struct Attrib * attr);
627
628 struct Expression;
629
630 extern struct Expression * parsedExpression;
631
632 extern struct Expression * QMkExpId(const char *  id);
633
634 extern struct Expression * MkExpOp(struct Expression * exp1, int op, struct Expression * exp2);
635
636 void ComputeExpression(struct Expression * exp);
637
638 extern struct Expression * MkExpConstant(const char *  string);
639
640 extern struct Attribute * MkAttribute(char * attr, struct Expression * exp);
641
642 extern void FreeExpression(struct Expression * exp);
643
644 extern void FreeExpContents(struct Expression * exp);
645
646 extern struct Expression * CopyExpression(struct Expression * exp);
647
648 extern struct Expression * MkExpBrackets(struct __ecereNameSpace__ecere__sys__OldList * expressions);
649
650 extern struct Expression * GetNonBracketsExp(struct Expression * exp);
651
652 extern struct Expression * MkExpCall(struct Expression * expression, struct __ecereNameSpace__ecere__sys__OldList * arguments);
653
654 extern struct Expression * MkExpCondition(struct Expression * cond, struct __ecereNameSpace__ecere__sys__OldList * expressions, struct Expression * elseExp);
655
656 extern struct Expression * MoveExpContents(struct Expression * exp);
657
658 extern struct Expression * QBrackets(struct Expression * exp);
659
660 extern struct Expression * QMkExpCond(struct Expression * cond, struct Expression * exp, struct Expression * elseExp);
661
662 struct Statement;
663
664 static struct Statement * curCompound;
665
666 extern struct Statement * MkCompoundStmt(struct __ecereNameSpace__ecere__sys__OldList * declarations, struct __ecereNameSpace__ecere__sys__OldList * statements);
667
668 extern struct Statement * MkExpressionStmt(struct __ecereNameSpace__ecere__sys__OldList * expressions);
669
670 extern struct Statement * MkIfStmt(struct __ecereNameSpace__ecere__sys__OldList * exp, struct Statement * statement, struct Statement * elseStmt);
671
672 extern struct Statement * MkForStmt(struct Statement * init, struct Statement * check, struct __ecereNameSpace__ecere__sys__OldList * inc, struct Statement * statement);
673
674 extern struct Statement * MkWhileStmt(struct __ecereNameSpace__ecere__sys__OldList * exp, struct Statement * statement);
675
676 extern struct Statement * MkFireWatchersStmt(struct Expression * object, struct __ecereNameSpace__ecere__sys__OldList * watches);
677
678 struct External;
679
680 struct External * curExternal, * afterExternal;
681
682 extern void FreeExternal(struct External * external);
683
684 struct Type;
685
686 static struct Type * curSwitchType;
687
688 extern struct Type * ProcessTypeString(const char *  string, unsigned int staticMethod);
689
690 extern void FreeType(struct Type * type);
691
692 extern struct Type * MkClassType(const char *  name);
693
694 extern void CopyTypeInto(struct Type * type, struct Type * src);
695
696 struct __ecereNameSpace__ecere__com__Class;
697
698 struct __ecereNameSpace__ecere__com__Instance
699 {
700 void * *  _vTbl;
701 struct __ecereNameSpace__ecere__com__Class * _class;
702 int _refCount;
703 } ecere_gcc_struct;
704
705 extern long long __ecereNameSpace__ecere__com__eClass_GetProperty(struct __ecereNameSpace__ecere__com__Class * _class, const char *  name);
706
707 extern void __ecereNameSpace__ecere__com__eClass_SetProperty(struct __ecereNameSpace__ecere__com__Class * _class, const char *  name, long long value);
708
709 static struct __ecereNameSpace__ecere__com__Class * currentClass;
710
711 struct __ecereNameSpace__ecere__com__Class * thisClass;
712
713 struct __ecereNameSpace__ecere__com__Class * containerClass;
714
715 extern unsigned int __ecereNameSpace__ecere__com__eClass_IsDerived(struct __ecereNameSpace__ecere__com__Class * _class, struct __ecereNameSpace__ecere__com__Class * from);
716
717 extern struct Expression * GetTemplateArgExpByName(const char *  paramName, struct __ecereNameSpace__ecere__com__Class * curClass, int tplType);
718
719 extern void *  __ecereNameSpace__ecere__com__eInstance_New(struct __ecereNameSpace__ecere__com__Class * _class);
720
721 extern void __ecereNameSpace__ecere__com__eInstance_SetMethod(struct __ecereNameSpace__ecere__com__Instance * instance, const char *  name, void *  function);
722
723 extern void __ecereNameSpace__ecere__com__eInstance_IncRef(struct __ecereNameSpace__ecere__com__Instance * instance);
724
725 extern void OutputExpression(struct Expression * exp, struct __ecereNameSpace__ecere__com__Instance * f);
726
727 extern struct __ecereNameSpace__ecere__com__Instance * fileInput;
728
729 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek;
730
731 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Read;
732
733 extern void __ecereNameSpace__ecere__com__eInstance_DecRef(struct __ecereNameSpace__ecere__com__Instance * instance);
734
735 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Write;
736
737 void SetThisClass(struct __ecereNameSpace__ecere__com__Class * c)
738 {
739 thisClass = c;
740 }
741
742 struct __ecereNameSpace__ecere__com__Class * GetThisClass()
743 {
744 return thisClass;
745 }
746
747 struct Context;
748
749 extern struct Context * curContext;
750
751 extern struct Context * topContext;
752
753 extern struct Context * PushContext(void);
754
755 extern void PopContext(struct Context * ctx);
756
757 extern void FreeContext(struct Context * context);
758
759 extern struct Context * globalContext;
760
761 struct ModuleImport;
762
763 extern struct ModuleImport * mainModule;
764
765 struct ModuleImport
766 {
767 struct ModuleImport * prev;
768 struct ModuleImport * next;
769 char *  name;
770 struct __ecereNameSpace__ecere__sys__OldList classes;
771 struct __ecereNameSpace__ecere__sys__OldList functions;
772 int importType;
773 int importAccess;
774 } ecere_gcc_struct;
775
776 struct __ecereNameSpace__ecere__com__NameSpace;
777
778 extern struct __ecereNameSpace__ecere__com__NameSpace *  globalData;
779
780 struct FunctionDefinition;
781
782 static struct FunctionDefinition * curFunction;
783
784 struct __ecereNameSpace__ecere__sys__BTNode;
785
786 struct __ecereNameSpace__ecere__sys__BTNode
787 {
788 uintptr_t key;
789 struct __ecereNameSpace__ecere__sys__BTNode * parent;
790 struct __ecereNameSpace__ecere__sys__BTNode * left;
791 struct __ecereNameSpace__ecere__sys__BTNode * right;
792 int depth;
793 } ecere_gcc_struct;
794
795 struct __ecereNameSpace__ecere__sys__BTNode * __ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_next(struct __ecereNameSpace__ecere__sys__BTNode * this);
796
797 struct __ecereNameSpace__ecere__com__Property;
798
799 struct __ecereNameSpace__ecere__com__Property
800 {
801 struct __ecereNameSpace__ecere__com__Property * prev;
802 struct __ecereNameSpace__ecere__com__Property * next;
803 const char *  name;
804 unsigned int isProperty;
805 int memberAccess;
806 int id;
807 struct __ecereNameSpace__ecere__com__Class * _class;
808 const char *  dataTypeString;
809 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
810 struct Type * dataType;
811 void (*  Set)(void * , int);
812 int (*  Get)(void * );
813 unsigned int (*  IsSet)(void * );
814 void *  data;
815 void *  symbol;
816 int vid;
817 unsigned int conversion;
818 unsigned int watcherOffset;
819 const char *  category;
820 unsigned int compiled;
821 unsigned int selfWatchable;
822 unsigned int isWatchable;
823 } ecere_gcc_struct;
824
825 extern void __ecereNameSpace__ecere__com__eInstance_FireSelfWatchers(struct __ecereNameSpace__ecere__com__Instance * instance, struct __ecereNameSpace__ecere__com__Property * _property);
826
827 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);
828
829 extern void __ecereNameSpace__ecere__com__eInstance_Watch(void *  instance, struct __ecereNameSpace__ecere__com__Property * _property, void *  object, void (*  callback)(void * , void * ));
830
831 extern void __ecereNameSpace__ecere__com__eInstance_FireWatchers(struct __ecereNameSpace__ecere__com__Instance * instance, struct __ecereNameSpace__ecere__com__Property * _property);
832
833 struct Identifier;
834
835 extern void FreeIdentifier(struct Identifier * id);
836
837 extern struct Identifier * MkIdentifier(const char *  string);
838
839 extern struct Expression * MkExpIdentifier(struct Identifier * id);
840
841 extern struct Expression * MkExpMember(struct Expression * expression, struct Identifier * member);
842
843 extern struct Identifier * CopyIdentifier(struct Identifier * id);
844
845 extern struct Expression * MkExpPointer(struct Expression * expression, struct Identifier * member);
846
847 struct __ecereNameSpace__ecere__sys__OldLink;
848
849 struct __ecereNameSpace__ecere__sys__OldLink
850 {
851 struct __ecereNameSpace__ecere__sys__OldLink * prev;
852 struct __ecereNameSpace__ecere__sys__OldLink * next;
853 void *  data;
854 } ecere_gcc_struct;
855
856 struct Declaration;
857
858 extern struct External * MkExternalDeclaration(struct Declaration * declaration);
859
860 extern struct Declaration * MkDeclaration(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct __ecereNameSpace__ecere__sys__OldList * initDeclarators);
861
862 struct Specifier;
863
864 extern struct Declaration * MkStructDeclaration(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct __ecereNameSpace__ecere__sys__OldList * declarators, struct Specifier * extStorage);
865
866 extern struct Specifier * MkStructOrUnion(int type, struct Identifier * id, struct __ecereNameSpace__ecere__sys__OldList * definitions);
867
868 extern struct Specifier * MkSpecifier(int specifier);
869
870 extern struct Specifier * MkSpecifierName(const char *  name);
871
872 extern struct Specifier * MkSpecifierExtended(struct ExtDecl * extDecl);
873
874 extern void FreeSpecifier(struct Specifier * spec);
875
876 extern struct Specifier * MkEnum(struct Identifier * id, struct __ecereNameSpace__ecere__sys__OldList * list);
877
878 struct Statement
879 {
880 struct Statement * prev;
881 struct Statement * next;
882 struct Location loc;
883 int type;
884 union
885 {
886 struct __ecereNameSpace__ecere__sys__OldList *  expressions;
887 struct
888 {
889 struct Identifier * id;
890 struct Statement * stmt;
891 } ecere_gcc_struct labeled;
892 struct
893 {
894 struct Expression * exp;
895 struct Statement * stmt;
896 } ecere_gcc_struct caseStmt;
897 struct
898 {
899 struct __ecereNameSpace__ecere__sys__OldList * declarations;
900 struct __ecereNameSpace__ecere__sys__OldList * statements;
901 struct Context * context;
902 unsigned int isSwitch;
903 } ecere_gcc_struct compound;
904 struct
905 {
906 struct __ecereNameSpace__ecere__sys__OldList * exp;
907 struct Statement * stmt;
908 struct Statement * elseStmt;
909 } ecere_gcc_struct ifStmt;
910 struct
911 {
912 struct __ecereNameSpace__ecere__sys__OldList * exp;
913 struct Statement * stmt;
914 } ecere_gcc_struct switchStmt;
915 struct
916 {
917 struct __ecereNameSpace__ecere__sys__OldList * exp;
918 struct Statement * stmt;
919 } ecere_gcc_struct whileStmt;
920 struct
921 {
922 struct __ecereNameSpace__ecere__sys__OldList * exp;
923 struct Statement * stmt;
924 } ecere_gcc_struct doWhile;
925 struct
926 {
927 struct Statement * init;
928 struct Statement * check;
929 struct __ecereNameSpace__ecere__sys__OldList * increment;
930 struct Statement * stmt;
931 } ecere_gcc_struct forStmt;
932 struct
933 {
934 struct Identifier * id;
935 } ecere_gcc_struct gotoStmt;
936 struct
937 {
938 struct Specifier * spec;
939 char * statements;
940 struct __ecereNameSpace__ecere__sys__OldList * inputFields;
941 struct __ecereNameSpace__ecere__sys__OldList * outputFields;
942 struct __ecereNameSpace__ecere__sys__OldList * clobberedFields;
943 } ecere_gcc_struct asmStmt;
944 struct
945 {
946 struct Expression * watcher;
947 struct Expression * object;
948 struct __ecereNameSpace__ecere__sys__OldList * watches;
949 } ecere_gcc_struct _watch;
950 struct
951 {
952 struct Identifier * id;
953 struct __ecereNameSpace__ecere__sys__OldList * exp;
954 struct __ecereNameSpace__ecere__sys__OldList * filter;
955 struct Statement * stmt;
956 } ecere_gcc_struct forEachStmt;
957 struct Declaration * decl;
958 } ecere_gcc_struct __anon1;
959 } ecere_gcc_struct;
960
961 extern struct Specifier * CopySpecifier(struct Specifier * spec);
962
963 extern struct Expression * MkExpClassSize(struct Specifier * _class);
964
965 struct Symbol;
966
967 struct Identifier
968 {
969 struct Identifier * prev;
970 struct Identifier * next;
971 struct Location loc;
972 struct Symbol * classSym;
973 struct Specifier * _class;
974 char *  string;
975 struct Identifier * badID;
976 } ecere_gcc_struct;
977
978 extern struct Symbol * FindStruct(struct Context * ctx, const char *  name);
979
980 extern struct Symbol * FindClass(const char *  name);
981
982 extern void DeclareClass(struct External * neededFor, struct Symbol * classSym, const char *  className);
983
984 extern struct Symbol * FindType(struct Context * ctx, const char *  name);
985
986 extern void FreeSymbol(struct Symbol * symbol);
987
988 struct ClassDef;
989
990 extern struct ClassDef * MkClassDefDeclaration(struct Declaration * decl);
991
992 extern void FreeClassDef(struct ClassDef * def);
993
994 struct Declarator;
995
996 extern struct Type * ProcessType(struct __ecereNameSpace__ecere__sys__OldList * specs, struct Declarator * decl);
997
998 struct TemplateDatatype
999 {
1000 struct __ecereNameSpace__ecere__sys__OldList *  specifiers;
1001 struct Declarator * decl;
1002 } ecere_gcc_struct;
1003
1004 extern struct Declarator * SpecDeclFromString(const char *  string, struct __ecereNameSpace__ecere__sys__OldList *  specs, struct Declarator * baseDecl);
1005
1006 extern struct Declarator * MkDeclaratorPointer(struct Pointer * pointer, struct Declarator * declarator);
1007
1008 extern struct Declarator * MkDeclaratorIdentifier(struct Identifier * id);
1009
1010 extern struct Declarator * MkStructDeclarator(struct Declarator * declarator, struct Expression * exp);
1011
1012 extern struct Declarator * MkDeclaratorArray(struct Declarator * declarator, struct Expression * exp);
1013
1014 struct Declarator
1015 {
1016 struct Declarator * prev;
1017 struct Declarator * next;
1018 struct Location loc;
1019 int type;
1020 struct Symbol * symbol;
1021 struct Declarator * declarator;
1022 union
1023 {
1024 struct Identifier * identifier;
1025 struct
1026 {
1027 struct Expression * exp;
1028 struct Expression * posExp;
1029 struct Attrib * attrib;
1030 } ecere_gcc_struct structDecl;
1031 struct
1032 {
1033 struct Expression * exp;
1034 struct Specifier * enumClass;
1035 } ecere_gcc_struct array;
1036 struct
1037 {
1038 struct __ecereNameSpace__ecere__sys__OldList * parameters;
1039 } ecere_gcc_struct function;
1040 struct
1041 {
1042 struct Pointer * pointer;
1043 } ecere_gcc_struct pointer;
1044 struct
1045 {
1046 struct ExtDecl * extended;
1047 } ecere_gcc_struct extended;
1048 } ecere_gcc_struct __anon1;
1049 } ecere_gcc_struct;
1050
1051 extern struct Identifier * GetDeclId(struct Declarator * decl);
1052
1053 extern struct Declarator * MkDeclaratorBrackets(struct Declarator * declarator);
1054
1055 extern struct Declarator * PlugDeclarator(struct Declarator * decl, struct Declarator * baseDecl);
1056
1057 extern struct Declarator * MkDeclaratorFunction(struct Declarator * declarator, struct __ecereNameSpace__ecere__sys__OldList * parameters);
1058
1059 extern void FreeDeclarator(struct Declarator * decl);
1060
1061 extern struct Declarator * GetFuncDecl(struct Declarator * decl);
1062
1063 extern struct Expression * MkExpClass(struct __ecereNameSpace__ecere__sys__OldList *  specifiers, struct Declarator * decl);
1064
1065 extern struct Declarator * CopyDeclarator(struct Declarator * declarator);
1066
1067 struct FunctionDefinition
1068 {
1069 struct FunctionDefinition * prev;
1070 struct FunctionDefinition * next;
1071 struct Location loc;
1072 struct __ecereNameSpace__ecere__sys__OldList *  specifiers;
1073 struct Declarator * declarator;
1074 struct __ecereNameSpace__ecere__sys__OldList *  declarations;
1075 struct Statement * body;
1076 struct __ecereNameSpace__ecere__com__Class * _class;
1077 struct __ecereNameSpace__ecere__sys__OldList attached;
1078 int declMode;
1079 struct Type * type;
1080 struct Symbol * propSet;
1081 int tempCount;
1082 unsigned int propertyNoThis;
1083 } ecere_gcc_struct;
1084
1085 extern struct Declarator * QMkPtrDecl(const char *  id);
1086
1087 struct ClassFunction;
1088
1089 struct ClassFunction
1090 {
1091 struct ClassFunction * prev;
1092 struct ClassFunction * next;
1093 struct Location loc;
1094 struct __ecereNameSpace__ecere__sys__OldList *  specifiers;
1095 struct Declarator * declarator;
1096 struct __ecereNameSpace__ecere__sys__OldList *  declarations;
1097 struct Statement * body;
1098 struct __ecereNameSpace__ecere__com__Class * _class;
1099 struct __ecereNameSpace__ecere__sys__OldList attached;
1100 int declMode;
1101 struct Type * type;
1102 struct Symbol * propSet;
1103 unsigned int isVirtual;
1104 unsigned int isConstructor;
1105 unsigned int isDestructor;
1106 unsigned int dontMangle;
1107 int id;
1108 int idCode;
1109 } ecere_gcc_struct;
1110
1111 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);
1112
1113 extern void FreeClassFunction(struct ClassFunction * func);
1114
1115 extern struct ClassFunction * MkClassFunction(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct Specifier * _class, struct Declarator * decl, struct __ecereNameSpace__ecere__sys__OldList * declList);
1116
1117 extern void ProcessClassFunctionBody(struct ClassFunction * func, struct Statement * body);
1118
1119 struct TypeName;
1120
1121 extern struct Expression * MkExpCast(struct TypeName * typeName, struct Expression * expression);
1122
1123 extern struct TypeName * MkTypeName(struct __ecereNameSpace__ecere__sys__OldList * qualifiers, struct Declarator * declarator);
1124
1125 struct TypeName
1126 {
1127 struct TypeName * prev;
1128 struct TypeName * next;
1129 struct Location loc;
1130 struct __ecereNameSpace__ecere__sys__OldList *  qualifiers;
1131 struct Declarator * declarator;
1132 int classObjectType;
1133 struct Expression * bitCount;
1134 } ecere_gcc_struct;
1135
1136 extern void FreeTypeName(struct TypeName * typeName);
1137
1138 extern struct TypeName * QMkClass(const char *  spec, struct Declarator * decl);
1139
1140 extern struct Expression * MkExpTypeSize(struct TypeName * typeName);
1141
1142 extern unsigned int IsVoidPtrCast(struct TypeName * typeName);
1143
1144 extern struct TypeName * QMkType(const char *  spec, struct Declarator * decl);
1145
1146 struct __ecereNameSpace__ecere__com__BTNamedLink;
1147
1148 struct __ecereNameSpace__ecere__com__BTNamedLink
1149 {
1150 const char *  name;
1151 struct __ecereNameSpace__ecere__com__BTNamedLink * parent;
1152 struct __ecereNameSpace__ecere__com__BTNamedLink * left;
1153 struct __ecereNameSpace__ecere__com__BTNamedLink * right;
1154 int depth;
1155 void *  data;
1156 } ecere_gcc_struct;
1157
1158 struct __ecereNameSpace__ecere__sys__NamedLink64;
1159
1160 struct __ecereNameSpace__ecere__sys__NamedLink64
1161 {
1162 struct __ecereNameSpace__ecere__sys__NamedLink64 * prev;
1163 struct __ecereNameSpace__ecere__sys__NamedLink64 * next;
1164 char *  name;
1165 long long data;
1166 } ecere_gcc_struct;
1167
1168 struct Instantiation;
1169
1170 struct Declaration
1171 {
1172 struct Declaration * prev;
1173 struct Declaration * next;
1174 struct Location loc;
1175 int type;
1176 union
1177 {
1178 struct
1179 {
1180 struct __ecereNameSpace__ecere__sys__OldList *  specifiers;
1181 struct __ecereNameSpace__ecere__sys__OldList *  declarators;
1182 } ecere_gcc_struct __anon1;
1183 struct Instantiation * inst;
1184 struct
1185 {
1186 struct Identifier * id;
1187 struct Expression * exp;
1188 } ecere_gcc_struct __anon2;
1189 } ecere_gcc_struct __anon1;
1190 struct Specifier * extStorage;
1191 struct Symbol * symbol;
1192 int declMode;
1193 } ecere_gcc_struct;
1194
1195 struct Instantiation
1196 {
1197 struct Instantiation * prev;
1198 struct Instantiation * next;
1199 struct Location loc;
1200 struct Specifier * _class;
1201 struct Expression * exp;
1202 struct __ecereNameSpace__ecere__sys__OldList *  members;
1203 struct Symbol * symbol;
1204 unsigned int fullSet;
1205 unsigned int isConstant;
1206 unsigned char *  data;
1207 struct Location nameLoc;
1208 struct Location insideLoc;
1209 unsigned int built;
1210 } ecere_gcc_struct;
1211
1212 extern void FreeInstance(struct Instantiation * inst);
1213
1214 extern struct Declaration * MkDeclarationInst(struct Instantiation * inst);
1215
1216 extern struct Instantiation * MkInstantiationNamed(struct __ecereNameSpace__ecere__sys__OldList * specs, struct Expression * exp, struct __ecereNameSpace__ecere__sys__OldList * members);
1217
1218 struct InitDeclarator;
1219
1220 extern void FreeInitDeclarator(struct InitDeclarator * decl);
1221
1222 struct PropertyWatch;
1223
1224 struct PropertyWatch
1225 {
1226 struct PropertyWatch * prev;
1227 struct PropertyWatch * next;
1228 struct Location loc;
1229 struct Statement * compound;
1230 struct __ecereNameSpace__ecere__sys__OldList *  properties;
1231 unsigned int deleteWatch;
1232 } ecere_gcc_struct;
1233
1234 extern void FreePropertyWatch(struct PropertyWatch * watcher);
1235
1236 struct PropertyImport;
1237
1238 struct PropertyImport
1239 {
1240 struct PropertyImport * prev;
1241 struct PropertyImport * next;
1242 char *  name;
1243 unsigned int isVirtual;
1244 unsigned int hasSet;
1245 unsigned int hasGet;
1246 } ecere_gcc_struct;
1247
1248 struct MethodImport;
1249
1250 struct MethodImport
1251 {
1252 struct MethodImport * prev;
1253 struct MethodImport * next;
1254 char *  name;
1255 unsigned int isVirtual;
1256 } ecere_gcc_struct;
1257
1258 struct FunctionImport;
1259
1260 struct FunctionImport
1261 {
1262 struct FunctionImport * prev;
1263 struct FunctionImport * next;
1264 char *  name;
1265 } ecere_gcc_struct;
1266
1267 struct ClassImport;
1268
1269 struct ClassImport
1270 {
1271 struct ClassImport * prev;
1272 struct ClassImport * next;
1273 char *  name;
1274 struct __ecereNameSpace__ecere__sys__OldList methods;
1275 struct __ecereNameSpace__ecere__sys__OldList properties;
1276 unsigned int itself;
1277 int isRemote;
1278 } ecere_gcc_struct;
1279
1280 struct Initializer;
1281
1282 struct Expression
1283 {
1284 struct Expression * prev;
1285 struct Expression * next;
1286 struct Location loc;
1287 int type;
1288 union
1289 {
1290 struct
1291 {
1292 char *  constant;
1293 struct Identifier * identifier;
1294 } ecere_gcc_struct __anon1;
1295 struct Statement * compound;
1296 struct Instantiation * instance;
1297 struct
1298 {
1299 char *  string;
1300 unsigned int intlString;
1301 unsigned int wideString;
1302 } ecere_gcc_struct __anon2;
1303 struct __ecereNameSpace__ecere__sys__OldList *  list;
1304 struct
1305 {
1306 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
1307 struct Declarator * decl;
1308 } ecere_gcc_struct _classExp;
1309 struct
1310 {
1311 struct Identifier * id;
1312 } ecere_gcc_struct classData;
1313 struct
1314 {
1315 struct Expression * exp;
1316 struct __ecereNameSpace__ecere__sys__OldList * arguments;
1317 struct Location argLoc;
1318 } ecere_gcc_struct call;
1319 struct
1320 {
1321 struct Expression * exp;
1322 struct __ecereNameSpace__ecere__sys__OldList * index;
1323 } ecere_gcc_struct index;
1324 struct
1325 {
1326 struct Expression * exp;
1327 struct Identifier * member;
1328 int memberType;
1329 unsigned int thisPtr;
1330 } ecere_gcc_struct member;
1331 struct
1332 {
1333 int op;
1334 struct Expression * exp1;
1335 struct Expression * exp2;
1336 } ecere_gcc_struct op;
1337 struct TypeName * typeName;
1338 struct Specifier * _class;
1339 struct
1340 {
1341 struct TypeName * typeName;
1342 struct Expression * exp;
1343 } ecere_gcc_struct cast;
1344 struct
1345 {
1346 struct Expression * cond;
1347 struct __ecereNameSpace__ecere__sys__OldList * exp;
1348 struct Expression * elseExp;
1349 } ecere_gcc_struct cond;
1350 struct
1351 {
1352 struct TypeName * typeName;
1353 struct Expression * size;
1354 } ecere_gcc_struct _new;
1355 struct
1356 {
1357 struct TypeName * typeName;
1358 struct Expression * size;
1359 struct Expression * exp;
1360 } ecere_gcc_struct _renew;
1361 struct
1362 {
1363 char * table;
1364 struct Identifier * id;
1365 } ecere_gcc_struct db;
1366 struct
1367 {
1368 struct Expression * ds;
1369 struct Expression * name;
1370 } ecere_gcc_struct dbopen;
1371 struct
1372 {
1373 struct TypeName * typeName;
1374 struct Initializer * initializer;
1375 } ecere_gcc_struct initializer;
1376 struct
1377 {
1378 struct Expression * exp;
1379 struct TypeName * typeName;
1380 } ecere_gcc_struct vaArg;
1381 } ecere_gcc_struct __anon1;
1382 unsigned int debugValue;
1383 struct __ecereNameSpace__ecere__com__DataValue val;
1384 uint64 address;
1385 unsigned int hasAddress;
1386 struct Type * expType;
1387 struct Type * destType;
1388 unsigned int usage;
1389 int tempCount;
1390 unsigned int byReference;
1391 unsigned int isConstant;
1392 unsigned int addedThis;
1393 unsigned int needCast;
1394 unsigned int thisPtr;
1395 unsigned int opDestType;
1396 unsigned int needTemplateCast;
1397 } ecere_gcc_struct;
1398
1399 extern struct InitDeclarator * MkInitDeclarator(struct Declarator * declarator, struct Initializer * initializer);
1400
1401 struct Initializer
1402 {
1403 struct Initializer * prev;
1404 struct Initializer * next;
1405 struct Location loc;
1406 int type;
1407 union
1408 {
1409 struct Expression * exp;
1410 struct __ecereNameSpace__ecere__sys__OldList *  list;
1411 } ecere_gcc_struct __anon1;
1412 unsigned int isConstant;
1413 struct Identifier * id;
1414 } ecere_gcc_struct;
1415
1416 extern struct Initializer * MkInitializerAssignment(struct Expression * exp);
1417
1418 extern struct Expression * MkExpExtensionInitializer(struct TypeName * typeName, struct Initializer * initializer);
1419
1420 extern struct Initializer * MkInitializerList(struct __ecereNameSpace__ecere__sys__OldList * list);
1421
1422 struct InitDeclarator
1423 {
1424 struct InitDeclarator * prev;
1425 struct InitDeclarator * next;
1426 struct Location loc;
1427 struct Declarator * declarator;
1428 struct Initializer * initializer;
1429 } ecere_gcc_struct;
1430
1431 void ApplyLocation(struct Expression * exp, struct Location * loc)
1432 {
1433 exp->loc = *loc;
1434 switch(exp->type)
1435 {
1436 case 4:
1437 if(exp->__anon1.op.exp1)
1438 ApplyLocation(exp->__anon1.op.exp1, loc);
1439 if(exp->__anon1.op.exp2)
1440 ApplyLocation(exp->__anon1.op.exp2, loc);
1441 break;
1442 case 5:
1443 if(exp->__anon1.list)
1444 {
1445 struct Expression * e;
1446
1447 for(e = (*exp->__anon1.list).first; e; e = e->next)
1448 ApplyLocation(e, loc);
1449 }
1450 break;
1451 case 6:
1452 if(exp->__anon1.index.index)
1453 {
1454 struct Expression * e;
1455
1456 for(e = (*exp->__anon1.index.index).first; e; e = e->next)
1457 ApplyLocation(e, loc);
1458 }
1459 if(exp->__anon1.index.exp)
1460 ApplyLocation(exp->__anon1.index.exp, loc);
1461 break;
1462 case 7:
1463 if(exp->__anon1.call.arguments)
1464 {
1465 struct Expression * arg;
1466
1467 for(arg = (*exp->__anon1.call.arguments).first; arg; arg = arg->next)
1468 ApplyLocation(arg, loc);
1469 }
1470 if(exp->__anon1.call.exp)
1471 ApplyLocation(exp->__anon1.call.exp, loc);
1472 break;
1473 case 8:
1474 case 9:
1475 if(exp->__anon1.member.exp)
1476 ApplyLocation(exp->__anon1.member.exp, loc);
1477 break;
1478 case 11:
1479 if(exp->__anon1.cast.exp)
1480 ApplyLocation(exp->__anon1.cast.exp, loc);
1481 break;
1482 case 12:
1483 if(exp->__anon1.cond.exp)
1484 {
1485 struct Expression * e;
1486
1487 for(e = (*exp->__anon1.cond.exp).first; e; e = e->next)
1488 ApplyLocation(e, loc);
1489 }
1490 if(exp->__anon1.cond.cond)
1491 ApplyLocation(exp->__anon1.cond.cond, loc);
1492 if(exp->__anon1.cond.elseExp)
1493 ApplyLocation(exp->__anon1.cond.elseExp, loc);
1494 break;
1495 case 34:
1496 if(exp->__anon1.vaArg.exp)
1497 ApplyLocation(exp->__anon1.vaArg.exp, loc);
1498 break;
1499 default:
1500 break;
1501 }
1502 }
1503
1504 void __ecereMethod_Expression_Clear();
1505
1506 struct MembersInit;
1507
1508 struct MembersInit
1509 {
1510 struct MembersInit * prev;
1511 struct MembersInit * next;
1512 struct Location loc;
1513 int type;
1514 union
1515 {
1516 struct __ecereNameSpace__ecere__sys__OldList *  dataMembers;
1517 struct ClassFunction * function;
1518 } ecere_gcc_struct __anon1;
1519 } ecere_gcc_struct;
1520
1521 extern struct MembersInit * MkMembersInitList(struct __ecereNameSpace__ecere__sys__OldList * dataMembers);
1522
1523 struct Operand;
1524
1525 struct OpTable
1526 {
1527 unsigned int (*  Add)(struct Expression *, struct Operand *, struct Operand *);
1528 unsigned int (*  Sub)(struct Expression *, struct Operand *, struct Operand *);
1529 unsigned int (*  Mul)(struct Expression *, struct Operand *, struct Operand *);
1530 unsigned int (*  Div)(struct Expression *, struct Operand *, struct Operand *);
1531 unsigned int (*  Mod)(struct Expression *, struct Operand *, struct Operand *);
1532 unsigned int (*  Neg)(struct Expression *, struct Operand *);
1533 unsigned int (*  Inc)(struct Expression *, struct Operand *);
1534 unsigned int (*  Dec)(struct Expression *, struct Operand *);
1535 unsigned int (*  Asign)(struct Expression *, struct Operand *, struct Operand *);
1536 unsigned int (*  AddAsign)(struct Expression *, struct Operand *, struct Operand *);
1537 unsigned int (*  SubAsign)(struct Expression *, struct Operand *, struct Operand *);
1538 unsigned int (*  MulAsign)(struct Expression *, struct Operand *, struct Operand *);
1539 unsigned int (*  DivAsign)(struct Expression *, struct Operand *, struct Operand *);
1540 unsigned int (*  ModAsign)(struct Expression *, struct Operand *, struct Operand *);
1541 unsigned int (*  BitAnd)(struct Expression *, struct Operand *, struct Operand *);
1542 unsigned int (*  BitOr)(struct Expression *, struct Operand *, struct Operand *);
1543 unsigned int (*  BitXor)(struct Expression *, struct Operand *, struct Operand *);
1544 unsigned int (*  LShift)(struct Expression *, struct Operand *, struct Operand *);
1545 unsigned int (*  RShift)(struct Expression *, struct Operand *, struct Operand *);
1546 unsigned int (*  BitNot)(struct Expression *, struct Operand *);
1547 unsigned int (*  AndAsign)(struct Expression *, struct Operand *, struct Operand *);
1548 unsigned int (*  OrAsign)(struct Expression *, struct Operand *, struct Operand *);
1549 unsigned int (*  XorAsign)(struct Expression *, struct Operand *, struct Operand *);
1550 unsigned int (*  LShiftAsign)(struct Expression *, struct Operand *, struct Operand *);
1551 unsigned int (*  RShiftAsign)(struct Expression *, struct Operand *, struct Operand *);
1552 unsigned int (*  Not)(struct Expression *, struct Operand *);
1553 unsigned int (*  Equ)(struct Expression *, struct Operand *, struct Operand *);
1554 unsigned int (*  Nqu)(struct Expression *, struct Operand *, struct Operand *);
1555 unsigned int (*  And)(struct Expression *, struct Operand *, struct Operand *);
1556 unsigned int (*  Or)(struct Expression *, struct Operand *, struct Operand *);
1557 unsigned int (*  Grt)(struct Expression *, struct Operand *, struct Operand *);
1558 unsigned int (*  Sma)(struct Expression *, struct Operand *, struct Operand *);
1559 unsigned int (*  GrtEqu)(struct Expression *, struct Operand *, struct Operand *);
1560 unsigned int (*  SmaEqu)(struct Expression *, struct Operand *, struct Operand *);
1561 unsigned int (*  Cond)(struct Expression *, struct Operand *, struct Operand *, struct Operand *);
1562 } ecere_gcc_struct;
1563
1564 struct Operand
1565 {
1566 int kind;
1567 struct Type * type;
1568 unsigned int ptrSize;
1569 union
1570 {
1571 char c;
1572 unsigned char uc;
1573 short s;
1574 unsigned short us;
1575 int i;
1576 unsigned int ui;
1577 float f;
1578 double d;
1579 long long i64;
1580 uint64 ui64;
1581 } ecere_gcc_struct __anon1;
1582 struct OpTable ops;
1583 } ecere_gcc_struct;
1584
1585 struct External *  _DeclareStruct(struct External *  neededBy, const char *  name, unsigned int skipNoHead, unsigned int needDereference, unsigned int fwdDecl);
1586
1587 struct External * DeclareStruct(struct External * neededBy, const char * name, unsigned int skipNoHead, unsigned int needDereference)
1588 {
1589 return _DeclareStruct(neededBy, name, skipNoHead, needDereference, 0);
1590 }
1591
1592 static void _DeclareType(struct External *  neededFor, struct Type *  type, unsigned int needDereference, unsigned int forFunctionDef, unsigned int fwdDecl);
1593
1594 void DeclareType(struct External * neededFor, struct Type * type, unsigned int needDereference, unsigned int forFunctionDef)
1595 {
1596 _DeclareType(neededFor, type, needDereference, forFunctionDef, 0);
1597 }
1598
1599 void DeclareTypeForwardDeclare(struct External * neededFor, struct Type * type, unsigned int needDereference, unsigned int forFunctionDef)
1600 {
1601 _DeclareType(neededFor, type, needDereference, forFunctionDef, 1);
1602 }
1603
1604 static void _PrintType(struct Type *  type, char *  string, unsigned int printName, unsigned int fullName, unsigned int printConst);
1605
1606 void PrintType(struct Type * type, char * string, unsigned int printName, unsigned int fullName)
1607 {
1608 _PrintType(type, string, printName, fullName, 1);
1609 }
1610
1611 void PrintTypeNoConst(struct Type * type, char * string, unsigned int printName, unsigned int fullName)
1612 {
1613 _PrintType(type, string, printName, fullName, 0);
1614 }
1615
1616 struct __ecereNameSpace__ecere__com__Method;
1617
1618 struct __ecereNameSpace__ecere__com__Method
1619 {
1620 const char *  name;
1621 struct __ecereNameSpace__ecere__com__Method * parent;
1622 struct __ecereNameSpace__ecere__com__Method * left;
1623 struct __ecereNameSpace__ecere__com__Method * right;
1624 int depth;
1625 int (*  function)();
1626 int vid;
1627 int type;
1628 struct __ecereNameSpace__ecere__com__Class * _class;
1629 void *  symbol;
1630 const char *  dataTypeString;
1631 struct Type * dataType;
1632 int memberAccess;
1633 } ecere_gcc_struct;
1634
1635 struct Symbol
1636 {
1637 char *  string;
1638 struct Symbol * parent;
1639 struct Symbol * left;
1640 struct Symbol * right;
1641 int depth;
1642 struct Type * type;
1643 union
1644 {
1645 struct __ecereNameSpace__ecere__com__Method * method;
1646 struct __ecereNameSpace__ecere__com__Property * _property;
1647 struct __ecereNameSpace__ecere__com__Class * registered;
1648 } ecere_gcc_struct __anon1;
1649 unsigned int notYetDeclared;
1650 union
1651 {
1652 struct
1653 {
1654 struct External * pointerExternal;
1655 struct External * structExternal;
1656 } ecere_gcc_struct __anon1;
1657 struct
1658 {
1659 struct External * externalGet;
1660 struct External * externalSet;
1661 struct External * externalPtr;
1662 struct External * externalIsSet;
1663 } ecere_gcc_struct __anon2;
1664 struct
1665 {
1666 struct External * methodExternal;
1667 struct External * methodCodeExternal;
1668 } ecere_gcc_struct __anon3;
1669 } ecere_gcc_struct __anon2;
1670 unsigned int imported;
1671 unsigned int declaredStructSym;
1672 struct __ecereNameSpace__ecere__com__Class * _class;
1673 unsigned int declaredStruct;
1674 unsigned int needConstructor;
1675 unsigned int needDestructor;
1676 char *  constructorName;
1677 char *  structName;
1678 char *  className;
1679 char *  destructorName;
1680 struct ModuleImport * module;
1681 struct ClassImport * _import;
1682 struct Location nameLoc;
1683 unsigned int isParam;
1684 unsigned int isRemote;
1685 unsigned int isStruct;
1686 unsigned int fireWatchersDone;
1687 int declaring;
1688 unsigned int classData;
1689 unsigned int isStatic;
1690 char *  shortName;
1691 struct __ecereNameSpace__ecere__sys__OldList *  templateParams;
1692 struct __ecereNameSpace__ecere__sys__OldList templatedClasses;
1693 struct Context * ctx;
1694 int isIterator;
1695 struct Expression * propCategory;
1696 unsigned int mustRegister;
1697 } ecere_gcc_struct;
1698
1699 struct __ecereNameSpace__ecere__com__ClassProperty;
1700
1701 extern struct __ecereNameSpace__ecere__com__ClassProperty * __ecereNameSpace__ecere__com__eClass_FindClassProperty(struct __ecereNameSpace__ecere__com__Class * _class, const char *  name);
1702
1703 struct __ecereNameSpace__ecere__com__ClassProperty
1704 {
1705 const char *  name;
1706 struct __ecereNameSpace__ecere__com__ClassProperty * parent;
1707 struct __ecereNameSpace__ecere__com__ClassProperty * left;
1708 struct __ecereNameSpace__ecere__com__ClassProperty * right;
1709 int depth;
1710 void (*  Set)(struct __ecereNameSpace__ecere__com__Class *, long long);
1711 long long (*  Get)(struct __ecereNameSpace__ecere__com__Class *);
1712 const char *  dataTypeString;
1713 struct Type * dataType;
1714 unsigned int constant;
1715 } ecere_gcc_struct;
1716
1717 struct __ecereNameSpace__ecere__com__BitMember;
1718
1719 struct __ecereNameSpace__ecere__com__BitMember
1720 {
1721 struct __ecereNameSpace__ecere__com__BitMember * prev;
1722 struct __ecereNameSpace__ecere__com__BitMember * next;
1723 const char *  name;
1724 unsigned int isProperty;
1725 int memberAccess;
1726 int id;
1727 struct __ecereNameSpace__ecere__com__Class * _class;
1728 const char *  dataTypeString;
1729 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
1730 struct Type * dataType;
1731 int type;
1732 int size;
1733 int pos;
1734 uint64 mask;
1735 } ecere_gcc_struct;
1736
1737 struct __ecereNameSpace__ecere__com__DataMember;
1738
1739 struct __ecereNameSpace__ecere__com__ClassTemplateArgument
1740 {
1741 union
1742 {
1743 struct
1744 {
1745 const char *  dataTypeString;
1746 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
1747 } ecere_gcc_struct __anon1;
1748 struct __ecereNameSpace__ecere__com__DataValue expression;
1749 struct
1750 {
1751 const char *  memberString;
1752 union
1753 {
1754 struct __ecereNameSpace__ecere__com__DataMember * member;
1755 struct __ecereNameSpace__ecere__com__Property * prop;
1756 struct __ecereNameSpace__ecere__com__Method * method;
1757 } ecere_gcc_struct __anon1;
1758 } ecere_gcc_struct __anon2;
1759 } ecere_gcc_struct __anon1;
1760 } ecere_gcc_struct;
1761
1762 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);
1763
1764 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);
1765
1766 struct TemplateParameter;
1767
1768 struct TemplateParameter
1769 {
1770 struct TemplateParameter * prev;
1771 struct TemplateParameter * next;
1772 struct Location loc;
1773 int type;
1774 struct Identifier * identifier;
1775 union
1776 {
1777 struct TemplateDatatype * dataType;
1778 int memberType;
1779 } ecere_gcc_struct __anon1;
1780 struct TemplateArgument * defaultArgument;
1781 const char *  dataTypeString;
1782 struct Type * baseType;
1783 } ecere_gcc_struct;
1784
1785 struct Type
1786 {
1787 struct Type * prev;
1788 struct Type * next;
1789 int refCount;
1790 union
1791 {
1792 struct Symbol * _class;
1793 struct
1794 {
1795 struct __ecereNameSpace__ecere__sys__OldList members;
1796 char *  enumName;
1797 } ecere_gcc_struct __anon1;
1798 struct
1799 {
1800 struct Type * returnType;
1801 struct __ecereNameSpace__ecere__sys__OldList params;
1802 struct Symbol * thisClass;
1803 unsigned int staticMethod;
1804 struct TemplateParameter * thisClassTemplate;
1805 } ecere_gcc_struct __anon2;
1806 struct
1807 {
1808 struct __ecereNameSpace__ecere__com__Method * method;
1809 struct __ecereNameSpace__ecere__com__Class * methodClass;
1810 struct __ecereNameSpace__ecere__com__Class * usedClass;
1811 } ecere_gcc_struct __anon3;
1812 struct
1813 {
1814 struct Type * arrayType;
1815 int arraySize;
1816 struct Expression * arraySizeExp;
1817 unsigned int freeExp;
1818 struct Symbol * enumClass;
1819 } ecere_gcc_struct __anon4;
1820 struct Type * type;
1821 struct TemplateParameter * templateParameter;
1822 } ecere_gcc_struct __anon1;
1823 int kind;
1824 unsigned int size;
1825 char *  name;
1826 char *  typeName;
1827 struct __ecereNameSpace__ecere__com__Class * thisClassFrom;
1828 int classObjectType;
1829 int alignment;
1830 unsigned int offset;
1831 int bitFieldCount;
1832 int count;
1833 unsigned int isSigned : 1;
1834 unsigned int constant : 1;
1835 unsigned int truth : 1;
1836 unsigned int byReference : 1;
1837 unsigned int extraParam : 1;
1838 unsigned int directClassAccess : 1;
1839 unsigned int computing : 1;
1840 unsigned int keepCast : 1;
1841 unsigned int passAsTemplate : 1;
1842 unsigned int dllExport : 1;
1843 unsigned int attrStdcall : 1;
1844 unsigned int declaredWithStruct : 1;
1845 unsigned int typedByReference : 1;
1846 unsigned int casted : 1;
1847 unsigned int pointerAlignment : 1;
1848 unsigned int isLong : 1;
1849 } ecere_gcc_struct;
1850
1851 struct Specifier
1852 {
1853 struct Specifier * prev;
1854 struct Specifier * next;
1855 struct Location loc;
1856 int type;
1857 union
1858 {
1859 int specifier;
1860 struct
1861 {
1862 struct ExtDecl * extDecl;
1863 char *  name;
1864 struct Symbol * symbol;
1865 struct __ecereNameSpace__ecere__sys__OldList *  templateArgs;
1866 struct Specifier * nsSpec;
1867 } ecere_gcc_struct __anon1;
1868 struct
1869 {
1870 struct Identifier * id;
1871 struct __ecereNameSpace__ecere__sys__OldList *  list;
1872 struct __ecereNameSpace__ecere__sys__OldList *  baseSpecs;
1873 struct __ecereNameSpace__ecere__sys__OldList *  definitions;
1874 unsigned int addNameSpace;
1875 struct Context * ctx;
1876 struct ExtDecl * extDeclStruct;
1877 } ecere_gcc_struct __anon2;
1878 struct Expression * expression;
1879 struct Specifier * _class;
1880 struct TemplateParameter * templateParameter;
1881 } ecere_gcc_struct __anon1;
1882 } ecere_gcc_struct;
1883
1884 extern struct Expression * GetTemplateArgExp(struct TemplateParameter * param, struct __ecereNameSpace__ecere__com__Class * curClass, unsigned int pointer);
1885
1886 struct TemplatedType
1887 {
1888 uintptr_t key;
1889 struct __ecereNameSpace__ecere__sys__BTNode * parent;
1890 struct __ecereNameSpace__ecere__sys__BTNode * left;
1891 struct __ecereNameSpace__ecere__sys__BTNode * right;
1892 int depth;
1893 struct TemplateParameter * param;
1894 } ecere_gcc_struct;
1895
1896 struct Type * ProcessTemplateParameterType(struct TemplateParameter * param)
1897 {
1898 if(param && param->type == 0 && (param->__anon1.dataType || param->dataTypeString))
1899 {
1900 if(!param->baseType)
1901 {
1902 if(param->dataTypeString)
1903 param->baseType = ProcessTypeString(param->dataTypeString, 0);
1904 else
1905 param->baseType = ProcessType(param->__anon1.dataType->specifiers, param->__anon1.dataType->decl);
1906 }
1907 return param->baseType;
1908 }
1909 return (((void *)0));
1910 }
1911
1912 unsigned int NeedCast(struct Type * type1, struct Type * type2)
1913 {
1914 if(!type1 || !type2 || type1->keepCast || type2->keepCast)
1915 return 1;
1916 if(type1->kind == 20 && type2->kind == 4 && type2->passAsTemplate == 0)
1917 {
1918 return 0;
1919 }
1920 if(type1->kind == type2->kind && type1->isLong == type2->isLong)
1921 {
1922 switch(type1->kind)
1923 {
1924 case 24:
1925 case 1:
1926 case 2:
1927 case 3:
1928 case 4:
1929 case 22:
1930 case 23:
1931 if(type1->passAsTemplate && !type2->passAsTemplate)
1932 return 1;
1933 return type1->isSigned != type2->isSigned;
1934 case 8:
1935 return type1->__anon1._class != type2->__anon1._class;
1936 case 13:
1937 return (type1->__anon1.type && type2->__anon1.type && type1->__anon1.type->constant != type2->__anon1.type->constant) || NeedCast(type1->__anon1.type, type2->__anon1.type);
1938 default:
1939 return 1;
1940 }
1941 }
1942 return 1;
1943 }
1944
1945 unsigned int GetOpInt(struct Operand * op2, int * value2)
1946 {
1947 if(op2->kind == 3 && op2->type->isSigned)
1948 *value2 = op2->__anon1.i;
1949 else if(op2->kind == 3)
1950 *value2 = (int)op2->__anon1.ui;
1951 else if(op2->kind == 4 && op2->type->isSigned)
1952 *value2 = (int)op2->__anon1.i64;
1953 else if(op2->kind == 4)
1954 *value2 = (int)op2->__anon1.ui64;
1955 else if(op2->kind == 23 && op2->type->isSigned)
1956 *value2 = (int)op2->__anon1.i64;
1957 else if(op2->kind == 23)
1958 *value2 = (int)op2->__anon1.ui64;
1959 else if(op2->kind == 22 && op2->type->isSigned)
1960 *value2 = (int)op2->__anon1.i64;
1961 else if(op2->kind == 22)
1962 *value2 = (int)op2->__anon1.ui64;
1963 else if(op2->kind == 2 && op2->type->isSigned)
1964 *value2 = (int)op2->__anon1.s;
1965 else if(op2->kind == 2)
1966 *value2 = (int)op2->__anon1.us;
1967 else if(op2->kind == 1 && op2->type->isSigned)
1968 *value2 = (int)op2->__anon1.c;
1969 else if(op2->kind == 24 || op2->kind == 1)
1970 *value2 = (int)op2->__anon1.uc;
1971 else if(op2->kind == 6)
1972 *value2 = (int)op2->__anon1.f;
1973 else if(op2->kind == 7)
1974 *value2 = (int)op2->__anon1.d;
1975 else if(op2->kind == 13)
1976 *value2 = (int)op2->__anon1.ui64;
1977 else
1978 return 0;
1979 return 1;
1980 }
1981
1982 unsigned int GetOpUInt(struct Operand * op2, unsigned int * value2)
1983 {
1984 if(op2->kind == 3 && op2->type->isSigned)
1985 *value2 = (unsigned int)op2->__anon1.i;
1986 else if(op2->kind == 3)
1987 *value2 = op2->__anon1.ui;
1988 else if(op2->kind == 4 && op2->type->isSigned)
1989 *value2 = (unsigned int)op2->__anon1.i64;
1990 else if(op2->kind == 4)
1991 *value2 = (unsigned int)op2->__anon1.ui64;
1992 else if(op2->kind == 23 && op2->type->isSigned)
1993 *value2 = (unsigned int)op2->__anon1.i64;
1994 else if(op2->kind == 23)
1995 *value2 = (unsigned int)op2->__anon1.ui64;
1996 else if(op2->kind == 22 && op2->type->isSigned)
1997 *value2 = (unsigned int)op2->__anon1.i64;
1998 else if(op2->kind == 22)
1999 *value2 = (unsigned int)op2->__anon1.ui64;
2000 else if(op2->kind == 2 && op2->type->isSigned)
2001 *value2 = (unsigned int)op2->__anon1.s;
2002 else if(op2->kind == 2)
2003 *value2 = (unsigned int)op2->__anon1.us;
2004 else if(op2->kind == 1 && op2->type->isSigned)
2005 *value2 = (unsigned int)op2->__anon1.c;
2006 else if(op2->kind == 24 || op2->kind == 1)
2007 *value2 = (unsigned int)op2->__anon1.uc;
2008 else if(op2->kind == 6)
2009 *value2 = (unsigned int)op2->__anon1.f;
2010 else if(op2->kind == 7)
2011 *value2 = (unsigned int)op2->__anon1.d;
2012 else if(op2->kind == 13)
2013 *value2 = (unsigned int)op2->__anon1.ui64;
2014 else
2015 return 0;
2016 return 1;
2017 }
2018
2019 unsigned int GetOpInt64(struct Operand * op2, long long * value2)
2020 {
2021 if(op2->kind == 3 && op2->type->isSigned)
2022 *value2 = (long long)op2->__anon1.i;
2023 else if(op2->kind == 3)
2024 *value2 = (long long)op2->__anon1.ui;
2025 else if(op2->kind == 4 && op2->type->isSigned)
2026 *value2 = op2->__anon1.i64;
2027 else if(op2->kind == 4)
2028 *value2 = (long long)op2->__anon1.ui64;
2029 else if(op2->kind == 23 && op2->type->isSigned)
2030 *value2 = op2->__anon1.i64;
2031 else if(op2->kind == 23)
2032 *value2 = (long long)op2->__anon1.ui64;
2033 else if(op2->kind == 22 && op2->type->isSigned)
2034 *value2 = op2->__anon1.i64;
2035 else if(op2->kind == 22)
2036 *value2 = (long long)op2->__anon1.ui64;
2037 else if(op2->kind == 2 && op2->type->isSigned)
2038 *value2 = (long long)op2->__anon1.s;
2039 else if(op2->kind == 2)
2040 *value2 = (long long)op2->__anon1.us;
2041 else if(op2->kind == 1 && op2->type->isSigned)
2042 *value2 = (long long)op2->__anon1.c;
2043 else if(op2->kind == 24 || op2->kind == 1)
2044 *value2 = (long long)op2->__anon1.uc;
2045 else if(op2->kind == 6)
2046 *value2 = (long long)op2->__anon1.f;
2047 else if(op2->kind == 7)
2048 *value2 = (long long)op2->__anon1.d;
2049 else if(op2->kind == 13)
2050 *value2 = (long long)op2->__anon1.ui64;
2051 else
2052 return 0;
2053 return 1;
2054 }
2055
2056 unsigned int GetOpUInt64(struct Operand * op2, uint64 * value2)
2057 {
2058 if(op2->kind == 3 && op2->type->isSigned)
2059 *value2 = (uint64)op2->__anon1.i;
2060 else if(op2->kind == 3)
2061 *value2 = (uint64)op2->__anon1.ui;
2062 else if(op2->kind == 4 && op2->type->isSigned)
2063 *value2 = (uint64)op2->__anon1.i64;
2064 else if(op2->kind == 4)
2065 *value2 = op2->__anon1.ui64;
2066 else if(op2->kind == 23 && op2->type->isSigned)
2067 *value2 = (uint64)op2->__anon1.i64;
2068 else if(op2->kind == 23)
2069 *value2 = op2->__anon1.ui64;
2070 else if(op2->kind == 22 && op2->type->isSigned)
2071 *value2 = (uint64)op2->__anon1.i64;
2072 else if(op2->kind == 22)
2073 *value2 = op2->__anon1.ui64;
2074 else if(op2->kind == 2 && op2->type->isSigned)
2075 *value2 = (uint64)op2->__anon1.s;
2076 else if(op2->kind == 2)
2077 *value2 = (uint64)op2->__anon1.us;
2078 else if(op2->kind == 1 && op2->type->isSigned)
2079 *value2 = (uint64)op2->__anon1.c;
2080 else if(op2->kind == 24 || op2->kind == 1)
2081 *value2 = (uint64)op2->__anon1.uc;
2082 else if(op2->kind == 6)
2083 *value2 = (uint64)op2->__anon1.f;
2084 else if(op2->kind == 7)
2085 *value2 = (uint64)op2->__anon1.d;
2086 else if(op2->kind == 13)
2087 *value2 = op2->__anon1.ui64;
2088 else
2089 return 0;
2090 return 1;
2091 }
2092
2093 unsigned int GetOpIntPtr(struct Operand * op2, intptr_t * value2)
2094 {
2095 if(op2->kind == 3 && op2->type->isSigned)
2096 *value2 = (intptr_t)op2->__anon1.i;
2097 else if(op2->kind == 3)
2098 *value2 = (intptr_t)op2->__anon1.ui;
2099 else if(op2->kind == 4 && op2->type->isSigned)
2100 *value2 = (intptr_t)op2->__anon1.i64;
2101 else if(op2->kind == 4)
2102 *value2 = (intptr_t)op2->__anon1.ui64;
2103 else if(op2->kind == 23 && op2->type->isSigned)
2104 *value2 = (intptr_t)op2->__anon1.i64;
2105 else if(op2->kind == 23)
2106 *value2 = (intptr_t)op2->__anon1.ui64;
2107 else if(op2->kind == 22 && op2->type->isSigned)
2108 *value2 = (intptr_t)op2->__anon1.i64;
2109 else if(op2->kind == 22)
2110 *value2 = (intptr_t)op2->__anon1.ui64;
2111 else if(op2->kind == 2 && op2->type->isSigned)
2112 *value2 = (intptr_t)op2->__anon1.s;
2113 else if(op2->kind == 2)
2114 *value2 = (intptr_t)op2->__anon1.us;
2115 else if(op2->kind == 1 && op2->type->isSigned)
2116 *value2 = (intptr_t)op2->__anon1.c;
2117 else if(op2->kind == 24 || op2->kind == 1)
2118 *value2 = (intptr_t)op2->__anon1.uc;
2119 else if(op2->kind == 6)
2120 *value2 = (intptr_t)op2->__anon1.f;
2121 else if(op2->kind == 7)
2122 *value2 = (intptr_t)op2->__anon1.d;
2123 else if(op2->kind == 13)
2124 *value2 = (intptr_t)op2->__anon1.ui64;
2125 else
2126 return 0;
2127 return 1;
2128 }
2129
2130 unsigned int GetOpUIntPtr(struct Operand * op2, uintptr_t * value2)
2131 {
2132 if(op2->kind == 3 && op2->type->isSigned)
2133 *value2 = (uintptr_t)op2->__anon1.i;
2134 else if(op2->kind == 3)
2135 *value2 = (uintptr_t)op2->__anon1.ui;
2136 else if(op2->kind == 4 && op2->type->isSigned)
2137 *value2 = (uintptr_t)op2->__anon1.i64;
2138 else if(op2->kind == 4)
2139 *value2 = (uintptr_t)op2->__anon1.ui64;
2140 else if(op2->kind == 23 && op2->type->isSigned)
2141 *value2 = (uintptr_t)op2->__anon1.i64;
2142 else if(op2->kind == 23)
2143 *value2 = (uintptr_t)op2->__anon1.ui64;
2144 else if(op2->kind == 22 && op2->type->isSigned)
2145 *value2 = (uintptr_t)op2->__anon1.i64;
2146 else if(op2->kind == 22)
2147 *value2 = (uintptr_t)op2->__anon1.ui64;
2148 else if(op2->kind == 2 && op2->type->isSigned)
2149 *value2 = (uintptr_t)op2->__anon1.s;
2150 else if(op2->kind == 2)
2151 *value2 = (uintptr_t)op2->__anon1.us;
2152 else if(op2->kind == 1 && op2->type->isSigned)
2153 *value2 = (uintptr_t)op2->__anon1.c;
2154 else if(op2->kind == 24 || op2->kind == 1)
2155 *value2 = (uintptr_t)op2->__anon1.uc;
2156 else if(op2->kind == 6)
2157 *value2 = (uintptr_t)op2->__anon1.f;
2158 else if(op2->kind == 7)
2159 *value2 = (uintptr_t)op2->__anon1.d;
2160 else if(op2->kind == 13)
2161 *value2 = (uintptr_t)op2->__anon1.ui64;
2162 else
2163 return 0;
2164 return 1;
2165 }
2166
2167 unsigned int GetOpIntSize(struct Operand * op2, ssize_t * value2)
2168 {
2169 if(op2->kind == 3 && op2->type->isSigned)
2170 *value2 = (ssize_t)op2->__anon1.i;
2171 else if(op2->kind == 3)
2172 *value2 = (ssize_t)op2->__anon1.ui;
2173 else if(op2->kind == 4 && op2->type->isSigned)
2174 *value2 = (ssize_t)op2->__anon1.i64;
2175 else if(op2->kind == 4)
2176 *value2 = (ssize_t)op2->__anon1.ui64;
2177 else if(op2->kind == 23 && op2->type->isSigned)
2178 *value2 = (ssize_t)op2->__anon1.i64;
2179 else if(op2->kind == 23)
2180 *value2 = (ssize_t)op2->__anon1.ui64;
2181 else if(op2->kind == 22 && op2->type->isSigned)
2182 *value2 = (ssize_t)op2->__anon1.i64;
2183 else if(op2->kind == 22)
2184 *value2 = (ssize_t)op2->__anon1.ui64;
2185 else if(op2->kind == 2 && op2->type->isSigned)
2186 *value2 = (ssize_t)op2->__anon1.s;
2187 else if(op2->kind == 2)
2188 *value2 = (ssize_t)op2->__anon1.us;
2189 else if(op2->kind == 1 && op2->type->isSigned)
2190 *value2 = (ssize_t)op2->__anon1.c;
2191 else if(op2->kind == 24 || op2->kind == 1)
2192 *value2 = (ssize_t)op2->__anon1.uc;
2193 else if(op2->kind == 6)
2194 *value2 = (ssize_t)op2->__anon1.f;
2195 else if(op2->kind == 7)
2196 *value2 = (ssize_t)op2->__anon1.d;
2197 else if(op2->kind == 13)
2198 *value2 = (ssize_t)op2->__anon1.ui64;
2199 else
2200 return 0;
2201 return 1;
2202 }
2203
2204 unsigned int GetOpUIntSize(struct Operand * op2, size_t * value2)
2205 {
2206 if(op2->kind == 3 && op2->type->isSigned)
2207 *value2 = (size_t)op2->__anon1.i;
2208 else if(op2->kind == 3)
2209 *value2 = (size_t)op2->__anon1.ui;
2210 else if(op2->kind == 4 && op2->type->isSigned)
2211 *value2 = (size_t)op2->__anon1.i64;
2212 else if(op2->kind == 4)
2213 *value2 = (size_t)op2->__anon1.ui64;
2214 else if(op2->kind == 23 && op2->type->isSigned)
2215 *value2 = (size_t)op2->__anon1.i64;
2216 else if(op2->kind == 23)
2217 *value2 = (size_t)op2->__anon1.ui64;
2218 else if(op2->kind == 22 && op2->type->isSigned)
2219 *value2 = (size_t)op2->__anon1.i64;
2220 else if(op2->kind == 22)
2221 *value2 = (size_t)op2->__anon1.ui64;
2222 else if(op2->kind == 2 && op2->type->isSigned)
2223 *value2 = (size_t)op2->__anon1.s;
2224 else if(op2->kind == 2)
2225 *value2 = (size_t)op2->__anon1.us;
2226 else if(op2->kind == 1 && op2->type->isSigned)
2227 *value2 = (size_t)op2->__anon1.c;
2228 else if(op2->kind == 24 || op2->kind == 1)
2229 *value2 = (size_t)op2->__anon1.uc;
2230 else if(op2->kind == 6)
2231 *value2 = (size_t)op2->__anon1.f;
2232 else if(op2->kind == 7)
2233 *value2 = (size_t)op2->__anon1.d;
2234 else if(op2->kind == 13)
2235 *value2 = (size_t)op2->__anon1.ui64;
2236 else
2237 return 0;
2238 return 1;
2239 }
2240
2241 unsigned int GetOpShort(struct Operand * op2, short * value2)
2242 {
2243 if(op2->kind == 3 && op2->type->isSigned)
2244 *value2 = (short)op2->__anon1.i;
2245 else if(op2->kind == 3)
2246 *value2 = (short)op2->__anon1.ui;
2247 else if(op2->kind == 4 && op2->type->isSigned)
2248 *value2 = (short)op2->__anon1.i64;
2249 else if(op2->kind == 4)
2250 *value2 = (short)op2->__anon1.ui64;
2251 else if(op2->kind == 23 && op2->type->isSigned)
2252 *value2 = (short)op2->__anon1.i64;
2253 else if(op2->kind == 23)
2254 *value2 = (short)op2->__anon1.ui64;
2255 else if(op2->kind == 22 && op2->type->isSigned)
2256 *value2 = (short)op2->__anon1.i64;
2257 else if(op2->kind == 22)
2258 *value2 = (short)op2->__anon1.ui64;
2259 else if(op2->kind == 2 && op2->type->isSigned)
2260 *value2 = op2->__anon1.s;
2261 else if(op2->kind == 2)
2262 *value2 = (short)op2->__anon1.us;
2263 else if(op2->kind == 1 && op2->type->isSigned)
2264 *value2 = (short)op2->__anon1.c;
2265 else if(op2->kind == 24 || op2->kind == 1)
2266 *value2 = (short)op2->__anon1.uc;
2267 else if(op2->kind == 6)
2268 *value2 = (short)op2->__anon1.f;
2269 else if(op2->kind == 7)
2270 *value2 = (short)op2->__anon1.d;
2271 else if(op2->kind == 13)
2272 *value2 = (short)op2->__anon1.ui64;
2273 else
2274 return 0;
2275 return 1;
2276 }
2277
2278 unsigned int GetOpUShort(struct Operand * op2, unsigned short * value2)
2279 {
2280 if(op2->kind == 3 && op2->type->isSigned)
2281 *value2 = (unsigned short)op2->__anon1.i;
2282 else if(op2->kind == 3)
2283 *value2 = (unsigned short)op2->__anon1.ui;
2284 else if(op2->kind == 4 && op2->type->isSigned)
2285 *value2 = (unsigned short)op2->__anon1.i64;
2286 else if(op2->kind == 4)
2287 *value2 = (unsigned short)op2->__anon1.ui64;
2288 else if(op2->kind == 23 && op2->type->isSigned)
2289 *value2 = (unsigned short)op2->__anon1.i64;
2290 else if(op2->kind == 23)
2291 *value2 = (unsigned short)op2->__anon1.ui64;
2292 else if(op2->kind == 22 && op2->type->isSigned)
2293 *value2 = (unsigned short)op2->__anon1.i64;
2294 else if(op2->kind == 22)
2295 *value2 = (unsigned short)op2->__anon1.ui64;
2296 else if(op2->kind == 2 && op2->type->isSigned)
2297 *value2 = (unsigned short)op2->__anon1.s;
2298 else if(op2->kind == 2)
2299 *value2 = op2->__anon1.us;
2300 else if(op2->kind == 1 && op2->type->isSigned)
2301 *value2 = (unsigned short)op2->__anon1.c;
2302 else if(op2->kind == 24 || op2->kind == 1)
2303 *value2 = (unsigned short)op2->__anon1.uc;
2304 else if(op2->kind == 6)
2305 *value2 = (unsigned short)op2->__anon1.f;
2306 else if(op2->kind == 7)
2307 *value2 = (unsigned short)op2->__anon1.d;
2308 else if(op2->kind == 13)
2309 *value2 = (unsigned short)op2->__anon1.ui64;
2310 else
2311 return 0;
2312 return 1;
2313 }
2314
2315 unsigned int GetOpChar(struct Operand * op2, char * value2)
2316 {
2317 if(op2->kind == 3 && op2->type->isSigned)
2318 *value2 = (char)op2->__anon1.i;
2319 else if(op2->kind == 3)
2320 *value2 = (char)op2->__anon1.ui;
2321 else if(op2->kind == 4 && op2->type->isSigned)
2322 *value2 = (char)op2->__anon1.i64;
2323 else if(op2->kind == 4)
2324 *value2 = (char)op2->__anon1.ui64;
2325 else if(op2->kind == 23 && op2->type->isSigned)
2326 *value2 = (char)op2->__anon1.i64;
2327 else if(op2->kind == 23)
2328 *value2 = (char)op2->__anon1.ui64;
2329 else if(op2->kind == 22 && op2->type->isSigned)
2330 *value2 = (char)op2->__anon1.i64;
2331 else if(op2->kind == 22)
2332 *value2 = (char)op2->__anon1.ui64;
2333 else if(op2->kind == 2 && op2->type->isSigned)
2334 *value2 = (char)op2->__anon1.s;
2335 else if(op2->kind == 2)
2336 *value2 = (char)op2->__anon1.us;
2337 else if(op2->kind == 1 && op2->type->isSigned)
2338 *value2 = op2->__anon1.c;
2339 else if(op2->kind == 24 || op2->kind == 1)
2340 *value2 = (char)op2->__anon1.uc;
2341 else if(op2->kind == 6)
2342 *value2 = (char)op2->__anon1.f;
2343 else if(op2->kind == 7)
2344 *value2 = (char)op2->__anon1.d;
2345 else if(op2->kind == 13)
2346 *value2 = (char)op2->__anon1.ui64;
2347 else
2348 return 0;
2349 return 1;
2350 }
2351
2352 unsigned int GetOpUChar(struct Operand * op2, unsigned char * value2)
2353 {
2354 if(op2->kind == 3 && op2->type->isSigned)
2355 *value2 = (unsigned char)op2->__anon1.i;
2356 else if(op2->kind == 3)
2357 *value2 = (unsigned char)op2->__anon1.ui;
2358 else if(op2->kind == 4 && op2->type->isSigned)
2359 *value2 = (unsigned char)op2->__anon1.i64;
2360 else if(op2->kind == 4)
2361 *value2 = (unsigned char)op2->__anon1.ui64;
2362 else if(op2->kind == 23 && op2->type->isSigned)
2363 *value2 = (unsigned char)op2->__anon1.i64;
2364 else if(op2->kind == 23)
2365 *value2 = (unsigned char)op2->__anon1.ui64;
2366 else if(op2->kind == 22 && op2->type->isSigned)
2367 *value2 = (unsigned char)op2->__anon1.i64;
2368 else if(op2->kind == 22)
2369 *value2 = (unsigned char)op2->__anon1.ui64;
2370 else if(op2->kind == 2 && op2->type->isSigned)
2371 *value2 = (unsigned char)op2->__anon1.s;
2372 else if(op2->kind == 2)
2373 *value2 = (unsigned char)op2->__anon1.us;
2374 else if(op2->kind == 1 && op2->type->isSigned)
2375 *value2 = (unsigned char)op2->__anon1.c;
2376 else if(op2->kind == 24 || op2->kind == 1)
2377 *value2 = op2->__anon1.uc;
2378 else if(op2->kind == 6)
2379 *value2 = (unsigned char)op2->__anon1.f;
2380 else if(op2->kind == 7)
2381 *value2 = (unsigned char)op2->__anon1.d;
2382 else if(op2->kind == 13)
2383 *value2 = (unsigned char)op2->__anon1.ui64;
2384 else
2385 return 0;
2386 return 1;
2387 }
2388
2389 unsigned int GetOpFloat(struct Operand * op2, float * value2)
2390 {
2391 if(op2->kind == 3 && op2->type->isSigned)
2392 *value2 = (float)(float)op2->__anon1.i;
2393 else if(op2->kind == 3)
2394 *value2 = (float)(float)op2->__anon1.ui;
2395 else if(op2->kind == 4 && op2->type->isSigned)
2396 *value2 = (float)(float)op2->__anon1.i64;
2397 else if(op2->kind == 4)
2398 *value2 = (float)(float)op2->__anon1.ui64;
2399 else if(op2->kind == 23 && op2->type->isSigned)
2400 *value2 = (float)(float)op2->__anon1.i64;
2401 else if(op2->kind == 23)
2402 *value2 = (float)(float)op2->__anon1.ui64;
2403 else if(op2->kind == 22 && op2->type->isSigned)
2404 *value2 = (float)(float)op2->__anon1.i64;
2405 else if(op2->kind == 22)
2406 *value2 = (float)(float)op2->__anon1.ui64;
2407 else if(op2->kind == 2 && op2->type->isSigned)
2408 *value2 = (float)(float)op2->__anon1.s;
2409 else if(op2->kind == 2)
2410 *value2 = (float)(float)op2->__anon1.us;
2411 else if(op2->kind == 1 && op2->type->isSigned)
2412 *value2 = (float)(float)op2->__anon1.c;
2413 else if(op2->kind == 24 || op2->kind == 1)
2414 *value2 = (float)(float)op2->__anon1.uc;
2415 else if(op2->kind == 6)
2416 *value2 = (float)op2->__anon1.f;
2417 else if(op2->kind == 7)
2418 *value2 = (float)op2->__anon1.d;
2419 else if(op2->kind == 13)
2420 *value2 = (float)(float)op2->__anon1.ui64;
2421 else
2422 return 0;
2423 return 1;
2424 }
2425
2426 unsigned int GetOpDouble(struct Operand * op2, double * value2)
2427 {
2428 if(op2->kind == 3 && op2->type->isSigned)
2429 *value2 = (double)(double)op2->__anon1.i;
2430 else if(op2->kind == 3)
2431 *value2 = (double)(double)op2->__anon1.ui;
2432 else if(op2->kind == 4 && op2->type->isSigned)
2433 *value2 = (double)(double)op2->__anon1.i64;
2434 else if(op2->kind == 4)
2435 *value2 = (double)(double)op2->__anon1.ui64;
2436 else if(op2->kind == 23 && op2->type->isSigned)
2437 *value2 = (double)(double)op2->__anon1.i64;
2438 else if(op2->kind == 23)
2439 *value2 = (double)(double)op2->__anon1.ui64;
2440 else if(op2->kind == 22 && op2->type->isSigned)
2441 *value2 = (double)(double)op2->__anon1.i64;
2442 else if(op2->kind == 22)
2443 *value2 = (double)(double)op2->__anon1.ui64;
2444 else if(op2->kind == 2 && op2->type->isSigned)
2445 *value2 = (double)(double)op2->__anon1.s;
2446 else if(op2->kind == 2)
2447 *value2 = (double)(double)op2->__anon1.us;
2448 else if(op2->kind == 1 && op2->type->isSigned)
2449 *value2 = (double)(double)op2->__anon1.c;
2450 else if(op2->kind == 24 || op2->kind == 1)
2451 *value2 = (double)(double)op2->__anon1.uc;
2452 else if(op2->kind == 6)
2453 *value2 = (double)op2->__anon1.f;
2454 else if(op2->kind == 7)
2455 *value2 = (double)op2->__anon1.d;
2456 else if(op2->kind == 13)
2457 *value2 = (double)(double)op2->__anon1.ui64;
2458 else
2459 return 0;
2460 return 1;
2461 }
2462
2463 static unsigned int IntAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2464 {
2465 int value2 = op2->__anon1.i;
2466
2467 exp->type = 2;
2468 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i + value2));
2469 if(!exp->expType)
2470 {
2471 exp->expType = op1->type;
2472 if(op1->type)
2473 op1->type->refCount++;
2474 }
2475 return 1;
2476 }
2477
2478 static unsigned int UIntAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2479 {
2480 unsigned int value2 = op2->__anon1.ui;
2481
2482 exp->type = 2;
2483 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui + value2));
2484 if(!exp->expType)
2485 {
2486 exp->expType = op1->type;
2487 if(op1->type)
2488 op1->type->refCount++;
2489 }
2490 return 1;
2491 }
2492
2493 static unsigned int Int64Add(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2494 {
2495 long long value2 = op2->__anon1.i64;
2496
2497 exp->type = 2;
2498 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 + value2));
2499 if(!exp->expType)
2500 {
2501 exp->expType = op1->type;
2502 if(op1->type)
2503 op1->type->refCount++;
2504 }
2505 return 1;
2506 }
2507
2508 static unsigned int UInt64Add(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2509 {
2510 uint64 value2 = op2->__anon1.ui64;
2511
2512 exp->type = 2;
2513 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 + value2));
2514 if(!exp->expType)
2515 {
2516 exp->expType = op1->type;
2517 if(op1->type)
2518 op1->type->refCount++;
2519 }
2520 return 1;
2521 }
2522
2523 static unsigned int ShortAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2524 {
2525 short value2 = op2->__anon1.s;
2526
2527 exp->type = 2;
2528 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s + value2));
2529 if(!exp->expType)
2530 {
2531 exp->expType = op1->type;
2532 if(op1->type)
2533 op1->type->refCount++;
2534 }
2535 return 1;
2536 }
2537
2538 static unsigned int UShortAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2539 {
2540 unsigned short value2 = op2->__anon1.us;
2541
2542 exp->type = 2;
2543 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us + value2));
2544 if(!exp->expType)
2545 {
2546 exp->expType = op1->type;
2547 if(op1->type)
2548 op1->type->refCount++;
2549 }
2550 return 1;
2551 }
2552
2553 static unsigned int CharAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2554 {
2555 char value2 = op2->__anon1.c;
2556
2557 exp->type = 2;
2558 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c + value2));
2559 if(!exp->expType)
2560 {
2561 exp->expType = op1->type;
2562 if(op1->type)
2563 op1->type->refCount++;
2564 }
2565 return 1;
2566 }
2567
2568 static unsigned int UCharAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2569 {
2570 unsigned char value2 = op2->__anon1.uc;
2571
2572 exp->type = 2;
2573 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc + value2));
2574 if(!exp->expType)
2575 {
2576 exp->expType = op1->type;
2577 if(op1->type)
2578 op1->type->refCount++;
2579 }
2580 return 1;
2581 }
2582
2583 static unsigned int FloatAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2584 {
2585 float value2 = op2->__anon1.f;
2586
2587 exp->type = 2;
2588 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f + value2));
2589 if(!exp->expType)
2590 {
2591 exp->expType = op1->type;
2592 if(op1->type)
2593 op1->type->refCount++;
2594 }
2595 return 1;
2596 }
2597
2598 static unsigned int DoubleAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2599 {
2600 double value2 = op2->__anon1.d;
2601
2602 exp->type = 2;
2603 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d + value2));
2604 if(!exp->expType)
2605 {
2606 exp->expType = op1->type;
2607 if(op1->type)
2608 op1->type->refCount++;
2609 }
2610 return 1;
2611 }
2612
2613 static unsigned int IntSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2614 {
2615 int value2 = op2->__anon1.i;
2616
2617 exp->type = 2;
2618 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i - value2));
2619 if(!exp->expType)
2620 {
2621 exp->expType = op1->type;
2622 if(op1->type)
2623 op1->type->refCount++;
2624 }
2625 return 1;
2626 }
2627
2628 static unsigned int UIntSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2629 {
2630 unsigned int value2 = op2->__anon1.ui;
2631
2632 exp->type = 2;
2633 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui - value2));
2634 if(!exp->expType)
2635 {
2636 exp->expType = op1->type;
2637 if(op1->type)
2638 op1->type->refCount++;
2639 }
2640 return 1;
2641 }
2642
2643 static unsigned int Int64Sub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2644 {
2645 long long value2 = op2->__anon1.i64;
2646
2647 exp->type = 2;
2648 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 - value2));
2649 if(!exp->expType)
2650 {
2651 exp->expType = op1->type;
2652 if(op1->type)
2653 op1->type->refCount++;
2654 }
2655 return 1;
2656 }
2657
2658 static unsigned int UInt64Sub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2659 {
2660 uint64 value2 = op2->__anon1.ui64;
2661
2662 exp->type = 2;
2663 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 - value2));
2664 if(!exp->expType)
2665 {
2666 exp->expType = op1->type;
2667 if(op1->type)
2668 op1->type->refCount++;
2669 }
2670 return 1;
2671 }
2672
2673 static unsigned int ShortSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2674 {
2675 short value2 = op2->__anon1.s;
2676
2677 exp->type = 2;
2678 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s - value2));
2679 if(!exp->expType)
2680 {
2681 exp->expType = op1->type;
2682 if(op1->type)
2683 op1->type->refCount++;
2684 }
2685 return 1;
2686 }
2687
2688 static unsigned int UShortSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2689 {
2690 unsigned short value2 = op2->__anon1.us;
2691
2692 exp->type = 2;
2693 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us - value2));
2694 if(!exp->expType)
2695 {
2696 exp->expType = op1->type;
2697 if(op1->type)
2698 op1->type->refCount++;
2699 }
2700 return 1;
2701 }
2702
2703 static unsigned int CharSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2704 {
2705 char value2 = op2->__anon1.c;
2706
2707 exp->type = 2;
2708 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c - value2));
2709 if(!exp->expType)
2710 {
2711 exp->expType = op1->type;
2712 if(op1->type)
2713 op1->type->refCount++;
2714 }
2715 return 1;
2716 }
2717
2718 static unsigned int UCharSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2719 {
2720 unsigned char value2 = op2->__anon1.uc;
2721
2722 exp->type = 2;
2723 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc - value2));
2724 if(!exp->expType)
2725 {
2726 exp->expType = op1->type;
2727 if(op1->type)
2728 op1->type->refCount++;
2729 }
2730 return 1;
2731 }
2732
2733 static unsigned int FloatSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2734 {
2735 float value2 = op2->__anon1.f;
2736
2737 exp->type = 2;
2738 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f - value2));
2739 if(!exp->expType)
2740 {
2741 exp->expType = op1->type;
2742 if(op1->type)
2743 op1->type->refCount++;
2744 }
2745 return 1;
2746 }
2747
2748 static unsigned int DoubleSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2749 {
2750 double value2 = op2->__anon1.d;
2751
2752 exp->type = 2;
2753 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d - value2));
2754 if(!exp->expType)
2755 {
2756 exp->expType = op1->type;
2757 if(op1->type)
2758 op1->type->refCount++;
2759 }
2760 return 1;
2761 }
2762
2763 static unsigned int IntMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2764 {
2765 int value2 = op2->__anon1.i;
2766
2767 exp->type = 2;
2768 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i * value2));
2769 if(!exp->expType)
2770 {
2771 exp->expType = op1->type;
2772 if(op1->type)
2773 op1->type->refCount++;
2774 }
2775 return 1;
2776 }
2777
2778 static unsigned int UIntMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2779 {
2780 unsigned int value2 = op2->__anon1.ui;
2781
2782 exp->type = 2;
2783 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui * value2));
2784 if(!exp->expType)
2785 {
2786 exp->expType = op1->type;
2787 if(op1->type)
2788 op1->type->refCount++;
2789 }
2790 return 1;
2791 }
2792
2793 static unsigned int Int64Mul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2794 {
2795 long long value2 = op2->__anon1.i64;
2796
2797 exp->type = 2;
2798 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 * value2));
2799 if(!exp->expType)
2800 {
2801 exp->expType = op1->type;
2802 if(op1->type)
2803 op1->type->refCount++;
2804 }
2805 return 1;
2806 }
2807
2808 static unsigned int UInt64Mul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2809 {
2810 uint64 value2 = op2->__anon1.ui64;
2811
2812 exp->type = 2;
2813 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 * value2));
2814 if(!exp->expType)
2815 {
2816 exp->expType = op1->type;
2817 if(op1->type)
2818 op1->type->refCount++;
2819 }
2820 return 1;
2821 }
2822
2823 static unsigned int ShortMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2824 {
2825 short value2 = op2->__anon1.s;
2826
2827 exp->type = 2;
2828 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s * value2));
2829 if(!exp->expType)
2830 {
2831 exp->expType = op1->type;
2832 if(op1->type)
2833 op1->type->refCount++;
2834 }
2835 return 1;
2836 }
2837
2838 static unsigned int UShortMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2839 {
2840 unsigned short value2 = op2->__anon1.us;
2841
2842 exp->type = 2;
2843 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us * value2));
2844 if(!exp->expType)
2845 {
2846 exp->expType = op1->type;
2847 if(op1->type)
2848 op1->type->refCount++;
2849 }
2850 return 1;
2851 }
2852
2853 static unsigned int CharMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2854 {
2855 char value2 = op2->__anon1.c;
2856
2857 exp->type = 2;
2858 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c * value2));
2859 if(!exp->expType)
2860 {
2861 exp->expType = op1->type;
2862 if(op1->type)
2863 op1->type->refCount++;
2864 }
2865 return 1;
2866 }
2867
2868 static unsigned int UCharMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2869 {
2870 unsigned char value2 = op2->__anon1.uc;
2871
2872 exp->type = 2;
2873 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc * value2));
2874 if(!exp->expType)
2875 {
2876 exp->expType = op1->type;
2877 if(op1->type)
2878 op1->type->refCount++;
2879 }
2880 return 1;
2881 }
2882
2883 static unsigned int FloatMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2884 {
2885 float value2 = op2->__anon1.f;
2886
2887 exp->type = 2;
2888 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f * value2));
2889 if(!exp->expType)
2890 {
2891 exp->expType = op1->type;
2892 if(op1->type)
2893 op1->type->refCount++;
2894 }
2895 return 1;
2896 }
2897
2898 static unsigned int DoubleMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2899 {
2900 double value2 = op2->__anon1.d;
2901
2902 exp->type = 2;
2903 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d * value2));
2904 if(!exp->expType)
2905 {
2906 exp->expType = op1->type;
2907 if(op1->type)
2908 op1->type->refCount++;
2909 }
2910 return 1;
2911 }
2912
2913 static unsigned int IntDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2914 {
2915 int value2 = op2->__anon1.i;
2916
2917 exp->type = 2;
2918 exp->__anon1.__anon2.string = PrintInt(value2 ? (op1->__anon1.i / value2) : 0);
2919 if(!exp->expType)
2920 {
2921 exp->expType = op1->type;
2922 if(op1->type)
2923 op1->type->refCount++;
2924 }
2925 return 1;
2926 }
2927
2928 static unsigned int UIntDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2929 {
2930 unsigned int value2 = op2->__anon1.ui;
2931
2932 exp->type = 2;
2933 exp->__anon1.__anon2.string = PrintUInt(value2 ? (op1->__anon1.ui / value2) : 0);
2934 if(!exp->expType)
2935 {
2936 exp->expType = op1->type;
2937 if(op1->type)
2938 op1->type->refCount++;
2939 }
2940 return 1;
2941 }
2942
2943 static unsigned int Int64Div(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2944 {
2945 long long value2 = op2->__anon1.i64;
2946
2947 exp->type = 2;
2948 exp->__anon1.__anon2.string = PrintInt64(value2 ? (op1->__anon1.i64 / value2) : 0);
2949 if(!exp->expType)
2950 {
2951 exp->expType = op1->type;
2952 if(op1->type)
2953 op1->type->refCount++;
2954 }
2955 return 1;
2956 }
2957
2958 static unsigned int UInt64Div(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2959 {
2960 uint64 value2 = op2->__anon1.ui64;
2961
2962 exp->type = 2;
2963 exp->__anon1.__anon2.string = PrintUInt64(value2 ? (op1->__anon1.ui64 / value2) : 0);
2964 if(!exp->expType)
2965 {
2966 exp->expType = op1->type;
2967 if(op1->type)
2968 op1->type->refCount++;
2969 }
2970 return 1;
2971 }
2972
2973 static unsigned int ShortDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2974 {
2975 short value2 = op2->__anon1.s;
2976
2977 exp->type = 2;
2978 exp->__anon1.__anon2.string = PrintShort(value2 ? (op1->__anon1.s / value2) : (short)0);
2979 if(!exp->expType)
2980 {
2981 exp->expType = op1->type;
2982 if(op1->type)
2983 op1->type->refCount++;
2984 }
2985 return 1;
2986 }
2987
2988 static unsigned int UShortDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
2989 {
2990 unsigned short value2 = op2->__anon1.us;
2991
2992 exp->type = 2;
2993 exp->__anon1.__anon2.string = PrintUShort(value2 ? (op1->__anon1.us / value2) : (unsigned short)0);
2994 if(!exp->expType)
2995 {
2996 exp->expType = op1->type;
2997 if(op1->type)
2998 op1->type->refCount++;
2999 }
3000 return 1;
3001 }
3002
3003 static unsigned int CharDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3004 {
3005 char value2 = op2->__anon1.c;
3006
3007 exp->type = 2;
3008 exp->__anon1.__anon2.string = PrintChar(value2 ? (op1->__anon1.c / value2) : (char)0);
3009 if(!exp->expType)
3010 {
3011 exp->expType = op1->type;
3012 if(op1->type)
3013 op1->type->refCount++;
3014 }
3015 return 1;
3016 }
3017
3018 static unsigned int UCharDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3019 {
3020 unsigned char value2 = op2->__anon1.uc;
3021
3022 exp->type = 2;
3023 exp->__anon1.__anon2.string = PrintUChar(value2 ? (op1->__anon1.uc / value2) : (unsigned char)0);
3024 if(!exp->expType)
3025 {
3026 exp->expType = op1->type;
3027 if(op1->type)
3028 op1->type->refCount++;
3029 }
3030 return 1;
3031 }
3032
3033 static unsigned int FloatDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3034 {
3035 float value2 = op2->__anon1.f;
3036
3037 exp->type = 2;
3038 exp->__anon1.__anon2.string = PrintFloat(op1->__anon1.f / value2);
3039 if(!exp->expType)
3040 {
3041 exp->expType = op1->type;
3042 if(op1->type)
3043 op1->type->refCount++;
3044 }
3045 return 1;
3046 }
3047
3048 static unsigned int DoubleDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3049 {
3050 double value2 = op2->__anon1.d;
3051
3052 exp->type = 2;
3053 exp->__anon1.__anon2.string = PrintDouble(op1->__anon1.d / value2);
3054 if(!exp->expType)
3055 {
3056 exp->expType = op1->type;
3057 if(op1->type)
3058 op1->type->refCount++;
3059 }
3060 return 1;
3061 }
3062
3063 static unsigned int IntMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3064 {
3065 int value2 = op2->__anon1.i;
3066
3067 exp->type = 2;
3068 exp->__anon1.__anon2.string = PrintInt(value2 ? (op1->__anon1.i % value2) : 0);
3069 if(!exp->expType)
3070 {
3071 exp->expType = op1->type;
3072 if(op1->type)
3073 op1->type->refCount++;
3074 }
3075 return 1;
3076 }
3077
3078 static unsigned int UIntMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3079 {
3080 unsigned int value2 = op2->__anon1.ui;
3081
3082 exp->type = 2;
3083 exp->__anon1.__anon2.string = PrintUInt(value2 ? (op1->__anon1.ui % value2) : 0);
3084 if(!exp->expType)
3085 {
3086 exp->expType = op1->type;
3087 if(op1->type)
3088 op1->type->refCount++;
3089 }
3090 return 1;
3091 }
3092
3093 static unsigned int Int64Mod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3094 {
3095 long long value2 = op2->__anon1.i64;
3096
3097 exp->type = 2;
3098 exp->__anon1.__anon2.string = PrintInt64(value2 ? (op1->__anon1.i64 % value2) : 0);
3099 if(!exp->expType)
3100 {
3101 exp->expType = op1->type;
3102 if(op1->type)
3103 op1->type->refCount++;
3104 }
3105 return 1;
3106 }
3107
3108 static unsigned int UInt64Mod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3109 {
3110 uint64 value2 = op2->__anon1.ui64;
3111
3112 exp->type = 2;
3113 exp->__anon1.__anon2.string = PrintUInt64(value2 ? (op1->__anon1.ui64 % value2) : 0);
3114 if(!exp->expType)
3115 {
3116 exp->expType = op1->type;
3117 if(op1->type)
3118 op1->type->refCount++;
3119 }
3120 return 1;
3121 }
3122
3123 static unsigned int ShortMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3124 {
3125 short value2 = op2->__anon1.s;
3126
3127 exp->type = 2;
3128 exp->__anon1.__anon2.string = PrintShort(value2 ? (op1->__anon1.s % value2) : (short)0);
3129 if(!exp->expType)
3130 {
3131 exp->expType = op1->type;
3132 if(op1->type)
3133 op1->type->refCount++;
3134 }
3135 return 1;
3136 }
3137
3138 static unsigned int UShortMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3139 {
3140 unsigned short value2 = op2->__anon1.us;
3141
3142 exp->type = 2;
3143 exp->__anon1.__anon2.string = PrintUShort(value2 ? (op1->__anon1.us % value2) : (unsigned short)0);
3144 if(!exp->expType)
3145 {
3146 exp->expType = op1->type;
3147 if(op1->type)
3148 op1->type->refCount++;
3149 }
3150 return 1;
3151 }
3152
3153 static unsigned int CharMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3154 {
3155 char value2 = op2->__anon1.c;
3156
3157 exp->type = 2;
3158 exp->__anon1.__anon2.string = PrintChar(value2 ? (op1->__anon1.c % value2) : (char)0);
3159 if(!exp->expType)
3160 {
3161 exp->expType = op1->type;
3162 if(op1->type)
3163 op1->type->refCount++;
3164 }
3165 return 1;
3166 }
3167
3168 static unsigned int UCharMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3169 {
3170 unsigned char value2 = op2->__anon1.uc;
3171
3172 exp->type = 2;
3173 exp->__anon1.__anon2.string = PrintUChar(value2 ? (op1->__anon1.uc % value2) : (unsigned char)0);
3174 if(!exp->expType)
3175 {
3176 exp->expType = op1->type;
3177 if(op1->type)
3178 op1->type->refCount++;
3179 }
3180 return 1;
3181 }
3182
3183 static unsigned int IntNeg(struct Expression * exp, struct Operand * op1)
3184 {
3185 exp->type = 2;
3186 exp->__anon1.__anon2.string = PrintInt((-op1->__anon1.i));
3187 if(!exp->expType)
3188 {
3189 exp->expType = op1->type;
3190 if(op1->type)
3191 op1->type->refCount++;
3192 }
3193 return 1;
3194 }
3195
3196 static unsigned int UIntNeg(struct Expression * exp, struct Operand * op1)
3197 {
3198 exp->type = 2;
3199 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(-op1->__anon1.ui));
3200 if(!exp->expType)
3201 {
3202 exp->expType = op1->type;
3203 if(op1->type)
3204 op1->type->refCount++;
3205 }
3206 return 1;
3207 }
3208
3209 static unsigned int Int64Neg(struct Expression * exp, struct Operand * op1)
3210 {
3211 exp->type = 2;
3212 exp->__anon1.__anon2.string = PrintInt64((-op1->__anon1.i64));
3213 if(!exp->expType)
3214 {
3215 exp->expType = op1->type;
3216 if(op1->type)
3217 op1->type->refCount++;
3218 }
3219 return 1;
3220 }
3221
3222 static unsigned int UInt64Neg(struct Expression * exp, struct Operand * op1)
3223 {
3224 exp->type = 2;
3225 exp->__anon1.__anon2.string = PrintUInt64((uint64)(-op1->__anon1.ui64));
3226 if(!exp->expType)
3227 {
3228 exp->expType = op1->type;
3229 if(op1->type)
3230 op1->type->refCount++;
3231 }
3232 return 1;
3233 }
3234
3235 static unsigned int ShortNeg(struct Expression * exp, struct Operand * op1)
3236 {
3237 exp->type = 2;
3238 exp->__anon1.__anon2.string = PrintShort((-op1->__anon1.s));
3239 if(!exp->expType)
3240 {
3241 exp->expType = op1->type;
3242 if(op1->type)
3243 op1->type->refCount++;
3244 }
3245 return 1;
3246 }
3247
3248 static unsigned int UShortNeg(struct Expression * exp, struct Operand * op1)
3249 {
3250 exp->type = 2;
3251 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(-op1->__anon1.us));
3252 if(!exp->expType)
3253 {
3254 exp->expType = op1->type;
3255 if(op1->type)
3256 op1->type->refCount++;
3257 }
3258 return 1;
3259 }
3260
3261 static unsigned int CharNeg(struct Expression * exp, struct Operand * op1)
3262 {
3263 exp->type = 2;
3264 exp->__anon1.__anon2.string = PrintChar((-op1->__anon1.c));
3265 if(!exp->expType)
3266 {
3267 exp->expType = op1->type;
3268 if(op1->type)
3269 op1->type->refCount++;
3270 }
3271 return 1;
3272 }
3273
3274 static unsigned int UCharNeg(struct Expression * exp, struct Operand * op1)
3275 {
3276 exp->type = 2;
3277 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(-op1->__anon1.uc));
3278 if(!exp->expType)
3279 {
3280 exp->expType = op1->type;
3281 if(op1->type)
3282 op1->type->refCount++;
3283 }
3284 return 1;
3285 }
3286
3287 static unsigned int FloatNeg(struct Expression * exp, struct Operand * op1)
3288 {
3289 exp->type = 2;
3290 exp->__anon1.__anon2.string = PrintFloat((float)(-op1->__anon1.f));
3291 if(!exp->expType)
3292 {
3293 exp->expType = op1->type;
3294 if(op1->type)
3295 op1->type->refCount++;
3296 }
3297 return 1;
3298 }
3299
3300 static unsigned int DoubleNeg(struct Expression * exp, struct Operand * op1)
3301 {
3302 exp->type = 2;
3303 exp->__anon1.__anon2.string = PrintDouble((double)(-op1->__anon1.d));
3304 if(!exp->expType)
3305 {
3306 exp->expType = op1->type;
3307 if(op1->type)
3308 op1->type->refCount++;
3309 }
3310 return 1;
3311 }
3312
3313 static unsigned int IntInc(struct Expression * exp, struct Operand * op1)
3314 {
3315 exp->type = 2;
3316 exp->__anon1.__anon2.string = PrintInt((++op1->__anon1.i));
3317 if(!exp->expType)
3318 {
3319 exp->expType = op1->type;
3320 if(op1->type)
3321 op1->type->refCount++;
3322 }
3323 return 1;
3324 }
3325
3326 static unsigned int UIntInc(struct Expression * exp, struct Operand * op1)
3327 {
3328 exp->type = 2;
3329 exp->__anon1.__anon2.string = PrintUInt((++op1->__anon1.ui));
3330 if(!exp->expType)
3331 {
3332 exp->expType = op1->type;
3333 if(op1->type)
3334 op1->type->refCount++;
3335 }
3336 return 1;
3337 }
3338
3339 static unsigned int Int64Inc(struct Expression * exp, struct Operand * op1)
3340 {
3341 exp->type = 2;
3342 exp->__anon1.__anon2.string = PrintInt64((++op1->__anon1.i64));
3343 if(!exp->expType)
3344 {
3345 exp->expType = op1->type;
3346 if(op1->type)
3347 op1->type->refCount++;
3348 }
3349 return 1;
3350 }
3351
3352 static unsigned int UInt64Inc(struct Expression * exp, struct Operand * op1)
3353 {
3354 exp->type = 2;
3355 exp->__anon1.__anon2.string = PrintUInt64((++op1->__anon1.ui64));
3356 if(!exp->expType)
3357 {
3358 exp->expType = op1->type;
3359 if(op1->type)
3360 op1->type->refCount++;
3361 }
3362 return 1;
3363 }
3364
3365 static unsigned int ShortInc(struct Expression * exp, struct Operand * op1)
3366 {
3367 exp->type = 2;
3368 exp->__anon1.__anon2.string = PrintShort((++op1->__anon1.s));
3369 if(!exp->expType)
3370 {
3371 exp->expType = op1->type;
3372 if(op1->type)
3373 op1->type->refCount++;
3374 }
3375 return 1;
3376 }
3377
3378 static unsigned int UShortInc(struct Expression * exp, struct Operand * op1)
3379 {
3380 exp->type = 2;
3381 exp->__anon1.__anon2.string = PrintUShort((++op1->__anon1.us));
3382 if(!exp->expType)
3383 {
3384 exp->expType = op1->type;
3385 if(op1->type)
3386 op1->type->refCount++;
3387 }
3388 return 1;
3389 }
3390
3391 static unsigned int CharInc(struct Expression * exp, struct Operand * op1)
3392 {
3393 exp->type = 2;
3394 exp->__anon1.__anon2.string = PrintChar((++op1->__anon1.c));
3395 if(!exp->expType)
3396 {
3397 exp->expType = op1->type;
3398 if(op1->type)
3399 op1->type->refCount++;
3400 }
3401 return 1;
3402 }
3403
3404 static unsigned int UCharInc(struct Expression * exp, struct Operand * op1)
3405 {
3406 exp->type = 2;
3407 exp->__anon1.__anon2.string = PrintUChar((++op1->__anon1.uc));
3408 if(!exp->expType)
3409 {
3410 exp->expType = op1->type;
3411 if(op1->type)
3412 op1->type->refCount++;
3413 }
3414 return 1;
3415 }
3416
3417 static unsigned int FloatInc(struct Expression * exp, struct Operand * op1)
3418 {
3419 exp->type = 2;
3420 exp->__anon1.__anon2.string = PrintFloat((float)(++op1->__anon1.f));
3421 if(!exp->expType)
3422 {
3423 exp->expType = op1->type;
3424 if(op1->type)
3425 op1->type->refCount++;
3426 }
3427 return 1;
3428 }
3429
3430 static unsigned int DoubleInc(struct Expression * exp, struct Operand * op1)
3431 {
3432 exp->type = 2;
3433 exp->__anon1.__anon2.string = PrintDouble((double)(++op1->__anon1.d));
3434 if(!exp->expType)
3435 {
3436 exp->expType = op1->type;
3437 if(op1->type)
3438 op1->type->refCount++;
3439 }
3440 return 1;
3441 }
3442
3443 static unsigned int IntDec(struct Expression * exp, struct Operand * op1)
3444 {
3445 exp->type = 2;
3446 exp->__anon1.__anon2.string = PrintInt((--op1->__anon1.i));
3447 if(!exp->expType)
3448 {
3449 exp->expType = op1->type;
3450 if(op1->type)
3451 op1->type->refCount++;
3452 }
3453 return 1;
3454 }
3455
3456 static unsigned int UIntDec(struct Expression * exp, struct Operand * op1)
3457 {
3458 exp->type = 2;
3459 exp->__anon1.__anon2.string = PrintUInt((--op1->__anon1.ui));
3460 if(!exp->expType)
3461 {
3462 exp->expType = op1->type;
3463 if(op1->type)
3464 op1->type->refCount++;
3465 }
3466 return 1;
3467 }
3468
3469 static unsigned int Int64Dec(struct Expression * exp, struct Operand * op1)
3470 {
3471 exp->type = 2;
3472 exp->__anon1.__anon2.string = PrintInt64((--op1->__anon1.i64));
3473 if(!exp->expType)
3474 {
3475 exp->expType = op1->type;
3476 if(op1->type)
3477 op1->type->refCount++;
3478 }
3479 return 1;
3480 }
3481
3482 static unsigned int UInt64Dec(struct Expression * exp, struct Operand * op1)
3483 {
3484 exp->type = 2;
3485 exp->__anon1.__anon2.string = PrintUInt64((--op1->__anon1.ui64));
3486 if(!exp->expType)
3487 {
3488 exp->expType = op1->type;
3489 if(op1->type)
3490 op1->type->refCount++;
3491 }
3492 return 1;
3493 }
3494
3495 static unsigned int ShortDec(struct Expression * exp, struct Operand * op1)
3496 {
3497 exp->type = 2;
3498 exp->__anon1.__anon2.string = PrintShort((--op1->__anon1.s));
3499 if(!exp->expType)
3500 {
3501 exp->expType = op1->type;
3502 if(op1->type)
3503 op1->type->refCount++;
3504 }
3505 return 1;
3506 }
3507
3508 static unsigned int UShortDec(struct Expression * exp, struct Operand * op1)
3509 {
3510 exp->type = 2;
3511 exp->__anon1.__anon2.string = PrintUShort((--op1->__anon1.us));
3512 if(!exp->expType)
3513 {
3514 exp->expType = op1->type;
3515 if(op1->type)
3516 op1->type->refCount++;
3517 }
3518 return 1;
3519 }
3520
3521 static unsigned int CharDec(struct Expression * exp, struct Operand * op1)
3522 {
3523 exp->type = 2;
3524 exp->__anon1.__anon2.string = PrintChar((--op1->__anon1.c));
3525 if(!exp->expType)
3526 {
3527 exp->expType = op1->type;
3528 if(op1->type)
3529 op1->type->refCount++;
3530 }
3531 return 1;
3532 }
3533
3534 static unsigned int UCharDec(struct Expression * exp, struct Operand * op1)
3535 {
3536 exp->type = 2;
3537 exp->__anon1.__anon2.string = PrintUChar((--op1->__anon1.uc));
3538 if(!exp->expType)
3539 {
3540 exp->expType = op1->type;
3541 if(op1->type)
3542 op1->type->refCount++;
3543 }
3544 return 1;
3545 }
3546
3547 static unsigned int FloatDec(struct Expression * exp, struct Operand * op1)
3548 {
3549 exp->type = 2;
3550 exp->__anon1.__anon2.string = PrintFloat((float)(--op1->__anon1.f));
3551 if(!exp->expType)
3552 {
3553 exp->expType = op1->type;
3554 if(op1->type)
3555 op1->type->refCount++;
3556 }
3557 return 1;
3558 }
3559
3560 static unsigned int DoubleDec(struct Expression * exp, struct Operand * op1)
3561 {
3562 exp->type = 2;
3563 exp->__anon1.__anon2.string = PrintDouble((double)(--op1->__anon1.d));
3564 if(!exp->expType)
3565 {
3566 exp->expType = op1->type;
3567 if(op1->type)
3568 op1->type->refCount++;
3569 }
3570 return 1;
3571 }
3572
3573 static unsigned int IntAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3574 {
3575 int value2 = op2->__anon1.i;
3576
3577 exp->type = 2;
3578 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i = value2));
3579 if(!exp->expType)
3580 {
3581 exp->expType = op1->type;
3582 if(op1->type)
3583 op1->type->refCount++;
3584 }
3585 return 1;
3586 }
3587
3588 static unsigned int UIntAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3589 {
3590 unsigned int value2 = op2->__anon1.ui;
3591
3592 exp->type = 2;
3593 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui = value2));
3594 if(!exp->expType)
3595 {
3596 exp->expType = op1->type;
3597 if(op1->type)
3598 op1->type->refCount++;
3599 }
3600 return 1;
3601 }
3602
3603 static unsigned int Int64Asign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3604 {
3605 long long value2 = op2->__anon1.i64;
3606
3607 exp->type = 2;
3608 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 = value2));
3609 if(!exp->expType)
3610 {
3611 exp->expType = op1->type;
3612 if(op1->type)
3613 op1->type->refCount++;
3614 }
3615 return 1;
3616 }
3617
3618 static unsigned int UInt64Asign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3619 {
3620 uint64 value2 = op2->__anon1.ui64;
3621
3622 exp->type = 2;
3623 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 = value2));
3624 if(!exp->expType)
3625 {
3626 exp->expType = op1->type;
3627 if(op1->type)
3628 op1->type->refCount++;
3629 }
3630 return 1;
3631 }
3632
3633 static unsigned int ShortAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3634 {
3635 short value2 = op2->__anon1.s;
3636
3637 exp->type = 2;
3638 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s = value2));
3639 if(!exp->expType)
3640 {
3641 exp->expType = op1->type;
3642 if(op1->type)
3643 op1->type->refCount++;
3644 }
3645 return 1;
3646 }
3647
3648 static unsigned int UShortAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3649 {
3650 unsigned short value2 = op2->__anon1.us;
3651
3652 exp->type = 2;
3653 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us = value2));
3654 if(!exp->expType)
3655 {
3656 exp->expType = op1->type;
3657 if(op1->type)
3658 op1->type->refCount++;
3659 }
3660 return 1;
3661 }
3662
3663 static unsigned int CharAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3664 {
3665 char value2 = op2->__anon1.c;
3666
3667 exp->type = 2;
3668 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c = value2));
3669 if(!exp->expType)
3670 {
3671 exp->expType = op1->type;
3672 if(op1->type)
3673 op1->type->refCount++;
3674 }
3675 return 1;
3676 }
3677
3678 static unsigned int UCharAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3679 {
3680 unsigned char value2 = op2->__anon1.uc;
3681
3682 exp->type = 2;
3683 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc = value2));
3684 if(!exp->expType)
3685 {
3686 exp->expType = op1->type;
3687 if(op1->type)
3688 op1->type->refCount++;
3689 }
3690 return 1;
3691 }
3692
3693 static unsigned int FloatAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3694 {
3695 float value2 = op2->__anon1.f;
3696
3697 exp->type = 2;
3698 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f = value2));
3699 if(!exp->expType)
3700 {
3701 exp->expType = op1->type;
3702 if(op1->type)
3703 op1->type->refCount++;
3704 }
3705 return 1;
3706 }
3707
3708 static unsigned int DoubleAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3709 {
3710 double value2 = op2->__anon1.d;
3711
3712 exp->type = 2;
3713 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d = value2));
3714 if(!exp->expType)
3715 {
3716 exp->expType = op1->type;
3717 if(op1->type)
3718 op1->type->refCount++;
3719 }
3720 return 1;
3721 }
3722
3723 static unsigned int IntAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3724 {
3725 int value2 = op2->__anon1.i;
3726
3727 exp->type = 2;
3728 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i += value2));
3729 if(!exp->expType)
3730 {
3731 exp->expType = op1->type;
3732 if(op1->type)
3733 op1->type->refCount++;
3734 }
3735 return 1;
3736 }
3737
3738 static unsigned int UIntAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3739 {
3740 unsigned int value2 = op2->__anon1.ui;
3741
3742 exp->type = 2;
3743 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui += value2));
3744 if(!exp->expType)
3745 {
3746 exp->expType = op1->type;
3747 if(op1->type)
3748 op1->type->refCount++;
3749 }
3750 return 1;
3751 }
3752
3753 static unsigned int Int64AddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3754 {
3755 long long value2 = op2->__anon1.i64;
3756
3757 exp->type = 2;
3758 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 += value2));
3759 if(!exp->expType)
3760 {
3761 exp->expType = op1->type;
3762 if(op1->type)
3763 op1->type->refCount++;
3764 }
3765 return 1;
3766 }
3767
3768 static unsigned int UInt64AddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3769 {
3770 uint64 value2 = op2->__anon1.ui64;
3771
3772 exp->type = 2;
3773 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 += value2));
3774 if(!exp->expType)
3775 {
3776 exp->expType = op1->type;
3777 if(op1->type)
3778 op1->type->refCount++;
3779 }
3780 return 1;
3781 }
3782
3783 static unsigned int ShortAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3784 {
3785 short value2 = op2->__anon1.s;
3786
3787 exp->type = 2;
3788 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s += value2));
3789 if(!exp->expType)
3790 {
3791 exp->expType = op1->type;
3792 if(op1->type)
3793 op1->type->refCount++;
3794 }
3795 return 1;
3796 }
3797
3798 static unsigned int UShortAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3799 {
3800 unsigned short value2 = op2->__anon1.us;
3801
3802 exp->type = 2;
3803 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us += value2));
3804 if(!exp->expType)
3805 {
3806 exp->expType = op1->type;
3807 if(op1->type)
3808 op1->type->refCount++;
3809 }
3810 return 1;
3811 }
3812
3813 static unsigned int CharAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3814 {
3815 char value2 = op2->__anon1.c;
3816
3817 exp->type = 2;
3818 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c += value2));
3819 if(!exp->expType)
3820 {
3821 exp->expType = op1->type;
3822 if(op1->type)
3823 op1->type->refCount++;
3824 }
3825 return 1;
3826 }
3827
3828 static unsigned int UCharAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3829 {
3830 unsigned char value2 = op2->__anon1.uc;
3831
3832 exp->type = 2;
3833 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc += value2));
3834 if(!exp->expType)
3835 {
3836 exp->expType = op1->type;
3837 if(op1->type)
3838 op1->type->refCount++;
3839 }
3840 return 1;
3841 }
3842
3843 static unsigned int FloatAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3844 {
3845 float value2 = op2->__anon1.f;
3846
3847 exp->type = 2;
3848 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f += value2));
3849 if(!exp->expType)
3850 {
3851 exp->expType = op1->type;
3852 if(op1->type)
3853 op1->type->refCount++;
3854 }
3855 return 1;
3856 }
3857
3858 static unsigned int DoubleAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3859 {
3860 double value2 = op2->__anon1.d;
3861
3862 exp->type = 2;
3863 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d += value2));
3864 if(!exp->expType)
3865 {
3866 exp->expType = op1->type;
3867 if(op1->type)
3868 op1->type->refCount++;
3869 }
3870 return 1;
3871 }
3872
3873 static unsigned int IntSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3874 {
3875 int value2 = op2->__anon1.i;
3876
3877 exp->type = 2;
3878 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i -= value2));
3879 if(!exp->expType)
3880 {
3881 exp->expType = op1->type;
3882 if(op1->type)
3883 op1->type->refCount++;
3884 }
3885 return 1;
3886 }
3887
3888 static unsigned int UIntSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3889 {
3890 unsigned int value2 = op2->__anon1.ui;
3891
3892 exp->type = 2;
3893 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui -= value2));
3894 if(!exp->expType)
3895 {
3896 exp->expType = op1->type;
3897 if(op1->type)
3898 op1->type->refCount++;
3899 }
3900 return 1;
3901 }
3902
3903 static unsigned int Int64SubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3904 {
3905 long long value2 = op2->__anon1.i64;
3906
3907 exp->type = 2;
3908 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 -= value2));
3909 if(!exp->expType)
3910 {
3911 exp->expType = op1->type;
3912 if(op1->type)
3913 op1->type->refCount++;
3914 }
3915 return 1;
3916 }
3917
3918 static unsigned int UInt64SubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3919 {
3920 uint64 value2 = op2->__anon1.ui64;
3921
3922 exp->type = 2;
3923 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 -= value2));
3924 if(!exp->expType)
3925 {
3926 exp->expType = op1->type;
3927 if(op1->type)
3928 op1->type->refCount++;
3929 }
3930 return 1;
3931 }
3932
3933 static unsigned int ShortSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3934 {
3935 short value2 = op2->__anon1.s;
3936
3937 exp->type = 2;
3938 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s -= value2));
3939 if(!exp->expType)
3940 {
3941 exp->expType = op1->type;
3942 if(op1->type)
3943 op1->type->refCount++;
3944 }
3945 return 1;
3946 }
3947
3948 static unsigned int UShortSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3949 {
3950 unsigned short value2 = op2->__anon1.us;
3951
3952 exp->type = 2;
3953 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us -= value2));
3954 if(!exp->expType)
3955 {
3956 exp->expType = op1->type;
3957 if(op1->type)
3958 op1->type->refCount++;
3959 }
3960 return 1;
3961 }
3962
3963 static unsigned int CharSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3964 {
3965 char value2 = op2->__anon1.c;
3966
3967 exp->type = 2;
3968 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c -= value2));
3969 if(!exp->expType)
3970 {
3971 exp->expType = op1->type;
3972 if(op1->type)
3973 op1->type->refCount++;
3974 }
3975 return 1;
3976 }
3977
3978 static unsigned int UCharSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3979 {
3980 unsigned char value2 = op2->__anon1.uc;
3981
3982 exp->type = 2;
3983 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc -= value2));
3984 if(!exp->expType)
3985 {
3986 exp->expType = op1->type;
3987 if(op1->type)
3988 op1->type->refCount++;
3989 }
3990 return 1;
3991 }
3992
3993 static unsigned int FloatSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
3994 {
3995 float value2 = op2->__anon1.f;
3996
3997 exp->type = 2;
3998 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f -= value2));
3999 if(!exp->expType)
4000 {
4001 exp->expType = op1->type;
4002 if(op1->type)
4003 op1->type->refCount++;
4004 }
4005 return 1;
4006 }
4007
4008 static unsigned int DoubleSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4009 {
4010 double value2 = op2->__anon1.d;
4011
4012 exp->type = 2;
4013 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d -= value2));
4014 if(!exp->expType)
4015 {
4016 exp->expType = op1->type;
4017 if(op1->type)
4018 op1->type->refCount++;
4019 }
4020 return 1;
4021 }
4022
4023 static unsigned int IntMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4024 {
4025 int value2 = op2->__anon1.i;
4026
4027 exp->type = 2;
4028 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i *= value2));
4029 if(!exp->expType)
4030 {
4031 exp->expType = op1->type;
4032 if(op1->type)
4033 op1->type->refCount++;
4034 }
4035 return 1;
4036 }
4037
4038 static unsigned int UIntMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4039 {
4040 unsigned int value2 = op2->__anon1.ui;
4041
4042 exp->type = 2;
4043 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui *= value2));
4044 if(!exp->expType)
4045 {
4046 exp->expType = op1->type;
4047 if(op1->type)
4048 op1->type->refCount++;
4049 }
4050 return 1;
4051 }
4052
4053 static unsigned int Int64MulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4054 {
4055 long long value2 = op2->__anon1.i64;
4056
4057 exp->type = 2;
4058 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 *= value2));
4059 if(!exp->expType)
4060 {
4061 exp->expType = op1->type;
4062 if(op1->type)
4063 op1->type->refCount++;
4064 }
4065 return 1;
4066 }
4067
4068 static unsigned int UInt64MulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4069 {
4070 uint64 value2 = op2->__anon1.ui64;
4071
4072 exp->type = 2;
4073 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 *= value2));
4074 if(!exp->expType)
4075 {
4076 exp->expType = op1->type;
4077 if(op1->type)
4078 op1->type->refCount++;
4079 }
4080 return 1;
4081 }
4082
4083 static unsigned int ShortMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4084 {
4085 short value2 = op2->__anon1.s;
4086
4087 exp->type = 2;
4088 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s *= value2));
4089 if(!exp->expType)
4090 {
4091 exp->expType = op1->type;
4092 if(op1->type)
4093 op1->type->refCount++;
4094 }
4095 return 1;
4096 }
4097
4098 static unsigned int UShortMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4099 {
4100 unsigned short value2 = op2->__anon1.us;
4101
4102 exp->type = 2;
4103 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us *= value2));
4104 if(!exp->expType)
4105 {
4106 exp->expType = op1->type;
4107 if(op1->type)
4108 op1->type->refCount++;
4109 }
4110 return 1;
4111 }
4112
4113 static unsigned int CharMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4114 {
4115 char value2 = op2->__anon1.c;
4116
4117 exp->type = 2;
4118 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c *= value2));
4119 if(!exp->expType)
4120 {
4121 exp->expType = op1->type;
4122 if(op1->type)
4123 op1->type->refCount++;
4124 }
4125 return 1;
4126 }
4127
4128 static unsigned int UCharMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4129 {
4130 unsigned char value2 = op2->__anon1.uc;
4131
4132 exp->type = 2;
4133 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc *= value2));
4134 if(!exp->expType)
4135 {
4136 exp->expType = op1->type;
4137 if(op1->type)
4138 op1->type->refCount++;
4139 }
4140 return 1;
4141 }
4142
4143 static unsigned int FloatMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4144 {
4145 float value2 = op2->__anon1.f;
4146
4147 exp->type = 2;
4148 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f *= value2));
4149 if(!exp->expType)
4150 {
4151 exp->expType = op1->type;
4152 if(op1->type)
4153 op1->type->refCount++;
4154 }
4155 return 1;
4156 }
4157
4158 static unsigned int DoubleMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4159 {
4160 double value2 = op2->__anon1.d;
4161
4162 exp->type = 2;
4163 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d *= value2));
4164 if(!exp->expType)
4165 {
4166 exp->expType = op1->type;
4167 if(op1->type)
4168 op1->type->refCount++;
4169 }
4170 return 1;
4171 }
4172
4173 static unsigned int IntDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4174 {
4175 int value2 = op2->__anon1.i;
4176
4177 exp->type = 2;
4178 exp->__anon1.__anon2.string = PrintInt(value2 ? (op1->__anon1.i /= value2) : 0);
4179 if(!exp->expType)
4180 {
4181 exp->expType = op1->type;
4182 if(op1->type)
4183 op1->type->refCount++;
4184 }
4185 return 1;
4186 }
4187
4188 static unsigned int UIntDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4189 {
4190 unsigned int value2 = op2->__anon1.ui;
4191
4192 exp->type = 2;
4193 exp->__anon1.__anon2.string = PrintUInt(value2 ? (op1->__anon1.ui /= value2) : 0);
4194 if(!exp->expType)
4195 {
4196 exp->expType = op1->type;
4197 if(op1->type)
4198 op1->type->refCount++;
4199 }
4200 return 1;
4201 }
4202
4203 static unsigned int Int64DivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4204 {
4205 long long value2 = op2->__anon1.i64;
4206
4207 exp->type = 2;
4208 exp->__anon1.__anon2.string = PrintInt64(value2 ? (op1->__anon1.i64 /= value2) : 0);
4209 if(!exp->expType)
4210 {
4211 exp->expType = op1->type;
4212 if(op1->type)
4213 op1->type->refCount++;
4214 }
4215 return 1;
4216 }
4217
4218 static unsigned int UInt64DivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4219 {
4220 uint64 value2 = op2->__anon1.ui64;
4221
4222 exp->type = 2;
4223 exp->__anon1.__anon2.string = PrintUInt64(value2 ? (op1->__anon1.ui64 /= value2) : 0);
4224 if(!exp->expType)
4225 {
4226 exp->expType = op1->type;
4227 if(op1->type)
4228 op1->type->refCount++;
4229 }
4230 return 1;
4231 }
4232
4233 static unsigned int ShortDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4234 {
4235 short value2 = op2->__anon1.s;
4236
4237 exp->type = 2;
4238 exp->__anon1.__anon2.string = PrintShort(value2 ? (op1->__anon1.s /= value2) : (short)0);
4239 if(!exp->expType)
4240 {
4241 exp->expType = op1->type;
4242 if(op1->type)
4243 op1->type->refCount++;
4244 }
4245 return 1;
4246 }
4247
4248 static unsigned int UShortDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4249 {
4250 unsigned short value2 = op2->__anon1.us;
4251
4252 exp->type = 2;
4253 exp->__anon1.__anon2.string = PrintUShort(value2 ? (op1->__anon1.us /= value2) : (unsigned short)0);
4254 if(!exp->expType)
4255 {
4256 exp->expType = op1->type;
4257 if(op1->type)
4258 op1->type->refCount++;
4259 }
4260 return 1;
4261 }
4262
4263 static unsigned int CharDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4264 {
4265 char value2 = op2->__anon1.c;
4266
4267 exp->type = 2;
4268 exp->__anon1.__anon2.string = PrintChar(value2 ? (op1->__anon1.c /= value2) : (char)0);
4269 if(!exp->expType)
4270 {
4271 exp->expType = op1->type;
4272 if(op1->type)
4273 op1->type->refCount++;
4274 }
4275 return 1;
4276 }
4277
4278 static unsigned int UCharDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4279 {
4280 unsigned char value2 = op2->__anon1.uc;
4281
4282 exp->type = 2;
4283 exp->__anon1.__anon2.string = PrintUChar(value2 ? (op1->__anon1.uc /= value2) : (unsigned char)0);
4284 if(!exp->expType)
4285 {
4286 exp->expType = op1->type;
4287 if(op1->type)
4288 op1->type->refCount++;
4289 }
4290 return 1;
4291 }
4292
4293 static unsigned int FloatDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4294 {
4295 float value2 = op2->__anon1.f;
4296
4297 exp->type = 2;
4298 exp->__anon1.__anon2.string = PrintFloat(op1->__anon1.f /= value2);
4299 if(!exp->expType)
4300 {
4301 exp->expType = op1->type;
4302 if(op1->type)
4303 op1->type->refCount++;
4304 }
4305 return 1;
4306 }
4307
4308 static unsigned int DoubleDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4309 {
4310 double value2 = op2->__anon1.d;
4311
4312 exp->type = 2;
4313 exp->__anon1.__anon2.string = PrintDouble(op1->__anon1.d /= value2);
4314 if(!exp->expType)
4315 {
4316 exp->expType = op1->type;
4317 if(op1->type)
4318 op1->type->refCount++;
4319 }
4320 return 1;
4321 }
4322
4323 static unsigned int IntModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4324 {
4325 int value2 = op2->__anon1.i;
4326
4327 exp->type = 2;
4328 exp->__anon1.__anon2.string = PrintInt(value2 ? (op1->__anon1.i %= value2) : 0);
4329 if(!exp->expType)
4330 {
4331 exp->expType = op1->type;
4332 if(op1->type)
4333 op1->type->refCount++;
4334 }
4335 return 1;
4336 }
4337
4338 static unsigned int UIntModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4339 {
4340 unsigned int value2 = op2->__anon1.ui;
4341
4342 exp->type = 2;
4343 exp->__anon1.__anon2.string = PrintUInt(value2 ? (op1->__anon1.ui %= value2) : 0);
4344 if(!exp->expType)
4345 {
4346 exp->expType = op1->type;
4347 if(op1->type)
4348 op1->type->refCount++;
4349 }
4350 return 1;
4351 }
4352
4353 static unsigned int Int64ModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4354 {
4355 long long value2 = op2->__anon1.i64;
4356
4357 exp->type = 2;
4358 exp->__anon1.__anon2.string = PrintInt64(value2 ? (op1->__anon1.i64 %= value2) : 0);
4359 if(!exp->expType)
4360 {
4361 exp->expType = op1->type;
4362 if(op1->type)
4363 op1->type->refCount++;
4364 }
4365 return 1;
4366 }
4367
4368 static unsigned int UInt64ModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4369 {
4370 uint64 value2 = op2->__anon1.ui64;
4371
4372 exp->type = 2;
4373 exp->__anon1.__anon2.string = PrintUInt64(value2 ? (op1->__anon1.ui64 %= value2) : 0);
4374 if(!exp->expType)
4375 {
4376 exp->expType = op1->type;
4377 if(op1->type)
4378 op1->type->refCount++;
4379 }
4380 return 1;
4381 }
4382
4383 static unsigned int ShortModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4384 {
4385 short value2 = op2->__anon1.s;
4386
4387 exp->type = 2;
4388 exp->__anon1.__anon2.string = PrintShort(value2 ? (op1->__anon1.s %= value2) : (short)0);
4389 if(!exp->expType)
4390 {
4391 exp->expType = op1->type;
4392 if(op1->type)
4393 op1->type->refCount++;
4394 }
4395 return 1;
4396 }
4397
4398 static unsigned int UShortModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4399 {
4400 unsigned short value2 = op2->__anon1.us;
4401
4402 exp->type = 2;
4403 exp->__anon1.__anon2.string = PrintUShort(value2 ? (op1->__anon1.us %= value2) : (unsigned short)0);
4404 if(!exp->expType)
4405 {
4406 exp->expType = op1->type;
4407 if(op1->type)
4408 op1->type->refCount++;
4409 }
4410 return 1;
4411 }
4412
4413 static unsigned int CharModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4414 {
4415 char value2 = op2->__anon1.c;
4416
4417 exp->type = 2;
4418 exp->__anon1.__anon2.string = PrintChar(value2 ? (op1->__anon1.c %= value2) : (char)0);
4419 if(!exp->expType)
4420 {
4421 exp->expType = op1->type;
4422 if(op1->type)
4423 op1->type->refCount++;
4424 }
4425 return 1;
4426 }
4427
4428 static unsigned int UCharModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4429 {
4430 unsigned char value2 = op2->__anon1.uc;
4431
4432 exp->type = 2;
4433 exp->__anon1.__anon2.string = PrintUChar(value2 ? (op1->__anon1.uc %= value2) : (unsigned char)0);
4434 if(!exp->expType)
4435 {
4436 exp->expType = op1->type;
4437 if(op1->type)
4438 op1->type->refCount++;
4439 }
4440 return 1;
4441 }
4442
4443 static unsigned int IntBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4444 {
4445 int value2 = op2->__anon1.i;
4446
4447 exp->type = 2;
4448 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i & value2));
4449 if(!exp->expType)
4450 {
4451 exp->expType = op1->type;
4452 if(op1->type)
4453 op1->type->refCount++;
4454 }
4455 return 1;
4456 }
4457
4458 static unsigned int UIntBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4459 {
4460 unsigned int value2 = op2->__anon1.ui;
4461
4462 exp->type = 2;
4463 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui & value2));
4464 if(!exp->expType)
4465 {
4466 exp->expType = op1->type;
4467 if(op1->type)
4468 op1->type->refCount++;
4469 }
4470 return 1;
4471 }
4472
4473 static unsigned int Int64BitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4474 {
4475 long long value2 = op2->__anon1.i64;
4476
4477 exp->type = 2;
4478 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 & value2));
4479 if(!exp->expType)
4480 {
4481 exp->expType = op1->type;
4482 if(op1->type)
4483 op1->type->refCount++;
4484 }
4485 return 1;
4486 }
4487
4488 static unsigned int UInt64BitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4489 {
4490 uint64 value2 = op2->__anon1.ui64;
4491
4492 exp->type = 2;
4493 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 & value2));
4494 if(!exp->expType)
4495 {
4496 exp->expType = op1->type;
4497 if(op1->type)
4498 op1->type->refCount++;
4499 }
4500 return 1;
4501 }
4502
4503 static unsigned int ShortBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4504 {
4505 short value2 = op2->__anon1.s;
4506
4507 exp->type = 2;
4508 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s & value2));
4509 if(!exp->expType)
4510 {
4511 exp->expType = op1->type;
4512 if(op1->type)
4513 op1->type->refCount++;
4514 }
4515 return 1;
4516 }
4517
4518 static unsigned int UShortBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4519 {
4520 unsigned short value2 = op2->__anon1.us;
4521
4522 exp->type = 2;
4523 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us & value2));
4524 if(!exp->expType)
4525 {
4526 exp->expType = op1->type;
4527 if(op1->type)
4528 op1->type->refCount++;
4529 }
4530 return 1;
4531 }
4532
4533 static unsigned int CharBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4534 {
4535 char value2 = op2->__anon1.c;
4536
4537 exp->type = 2;
4538 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c & value2));
4539 if(!exp->expType)
4540 {
4541 exp->expType = op1->type;
4542 if(op1->type)
4543 op1->type->refCount++;
4544 }
4545 return 1;
4546 }
4547
4548 static unsigned int UCharBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4549 {
4550 unsigned char value2 = op2->__anon1.uc;
4551
4552 exp->type = 2;
4553 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc & value2));
4554 if(!exp->expType)
4555 {
4556 exp->expType = op1->type;
4557 if(op1->type)
4558 op1->type->refCount++;
4559 }
4560 return 1;
4561 }
4562
4563 static unsigned int IntBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4564 {
4565 int value2 = op2->__anon1.i;
4566
4567 exp->type = 2;
4568 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i | value2));
4569 if(!exp->expType)
4570 {
4571 exp->expType = op1->type;
4572 if(op1->type)
4573 op1->type->refCount++;
4574 }
4575 return 1;
4576 }
4577
4578 static unsigned int UIntBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4579 {
4580 unsigned int value2 = op2->__anon1.ui;
4581
4582 exp->type = 2;
4583 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui | value2));
4584 if(!exp->expType)
4585 {
4586 exp->expType = op1->type;
4587 if(op1->type)
4588 op1->type->refCount++;
4589 }
4590 return 1;
4591 }
4592
4593 static unsigned int Int64BitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4594 {
4595 long long value2 = op2->__anon1.i64;
4596
4597 exp->type = 2;
4598 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 | value2));
4599 if(!exp->expType)
4600 {
4601 exp->expType = op1->type;
4602 if(op1->type)
4603 op1->type->refCount++;
4604 }
4605 return 1;
4606 }
4607
4608 static unsigned int UInt64BitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4609 {
4610 uint64 value2 = op2->__anon1.ui64;
4611
4612 exp->type = 2;
4613 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 | value2));
4614 if(!exp->expType)
4615 {
4616 exp->expType = op1->type;
4617 if(op1->type)
4618 op1->type->refCount++;
4619 }
4620 return 1;
4621 }
4622
4623 static unsigned int ShortBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4624 {
4625 short value2 = op2->__anon1.s;
4626
4627 exp->type = 2;
4628 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s | value2));
4629 if(!exp->expType)
4630 {
4631 exp->expType = op1->type;
4632 if(op1->type)
4633 op1->type->refCount++;
4634 }
4635 return 1;
4636 }
4637
4638 static unsigned int UShortBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4639 {
4640 unsigned short value2 = op2->__anon1.us;
4641
4642 exp->type = 2;
4643 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us | value2));
4644 if(!exp->expType)
4645 {
4646 exp->expType = op1->type;
4647 if(op1->type)
4648 op1->type->refCount++;
4649 }
4650 return 1;
4651 }
4652
4653 static unsigned int CharBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4654 {
4655 char value2 = op2->__anon1.c;
4656
4657 exp->type = 2;
4658 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c | value2));
4659 if(!exp->expType)
4660 {
4661 exp->expType = op1->type;
4662 if(op1->type)
4663 op1->type->refCount++;
4664 }
4665 return 1;
4666 }
4667
4668 static unsigned int UCharBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4669 {
4670 unsigned char value2 = op2->__anon1.uc;
4671
4672 exp->type = 2;
4673 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc | value2));
4674 if(!exp->expType)
4675 {
4676 exp->expType = op1->type;
4677 if(op1->type)
4678 op1->type->refCount++;
4679 }
4680 return 1;
4681 }
4682
4683 static unsigned int IntBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4684 {
4685 int value2 = op2->__anon1.i;
4686
4687 exp->type = 2;
4688 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i ^ value2));
4689 if(!exp->expType)
4690 {
4691 exp->expType = op1->type;
4692 if(op1->type)
4693 op1->type->refCount++;
4694 }
4695 return 1;
4696 }
4697
4698 static unsigned int UIntBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4699 {
4700 unsigned int value2 = op2->__anon1.ui;
4701
4702 exp->type = 2;
4703 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui ^ value2));
4704 if(!exp->expType)
4705 {
4706 exp->expType = op1->type;
4707 if(op1->type)
4708 op1->type->refCount++;
4709 }
4710 return 1;
4711 }
4712
4713 static unsigned int Int64BitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4714 {
4715 long long value2 = op2->__anon1.i64;
4716
4717 exp->type = 2;
4718 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 ^ value2));
4719 if(!exp->expType)
4720 {
4721 exp->expType = op1->type;
4722 if(op1->type)
4723 op1->type->refCount++;
4724 }
4725 return 1;
4726 }
4727
4728 static unsigned int UInt64BitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4729 {
4730 uint64 value2 = op2->__anon1.ui64;
4731
4732 exp->type = 2;
4733 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 ^ value2));
4734 if(!exp->expType)
4735 {
4736 exp->expType = op1->type;
4737 if(op1->type)
4738 op1->type->refCount++;
4739 }
4740 return 1;
4741 }
4742
4743 static unsigned int ShortBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4744 {
4745 short value2 = op2->__anon1.s;
4746
4747 exp->type = 2;
4748 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s ^ value2));
4749 if(!exp->expType)
4750 {
4751 exp->expType = op1->type;
4752 if(op1->type)
4753 op1->type->refCount++;
4754 }
4755 return 1;
4756 }
4757
4758 static unsigned int UShortBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4759 {
4760 unsigned short value2 = op2->__anon1.us;
4761
4762 exp->type = 2;
4763 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us ^ value2));
4764 if(!exp->expType)
4765 {
4766 exp->expType = op1->type;
4767 if(op1->type)
4768 op1->type->refCount++;
4769 }
4770 return 1;
4771 }
4772
4773 static unsigned int CharBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4774 {
4775 char value2 = op2->__anon1.c;
4776
4777 exp->type = 2;
4778 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c ^ value2));
4779 if(!exp->expType)
4780 {
4781 exp->expType = op1->type;
4782 if(op1->type)
4783 op1->type->refCount++;
4784 }
4785 return 1;
4786 }
4787
4788 static unsigned int UCharBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4789 {
4790 unsigned char value2 = op2->__anon1.uc;
4791
4792 exp->type = 2;
4793 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc ^ value2));
4794 if(!exp->expType)
4795 {
4796 exp->expType = op1->type;
4797 if(op1->type)
4798 op1->type->refCount++;
4799 }
4800 return 1;
4801 }
4802
4803 static unsigned int IntLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4804 {
4805 int value2 = op2->__anon1.i;
4806
4807 exp->type = 2;
4808 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i << value2));
4809 if(!exp->expType)
4810 {
4811 exp->expType = op1->type;
4812 if(op1->type)
4813 op1->type->refCount++;
4814 }
4815 return 1;
4816 }
4817
4818 static unsigned int UIntLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4819 {
4820 unsigned int value2 = op2->__anon1.ui;
4821
4822 exp->type = 2;
4823 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui << value2));
4824 if(!exp->expType)
4825 {
4826 exp->expType = op1->type;
4827 if(op1->type)
4828 op1->type->refCount++;
4829 }
4830 return 1;
4831 }
4832
4833 static unsigned int Int64LShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4834 {
4835 long long value2 = op2->__anon1.i64;
4836
4837 exp->type = 2;
4838 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 << value2));
4839 if(!exp->expType)
4840 {
4841 exp->expType = op1->type;
4842 if(op1->type)
4843 op1->type->refCount++;
4844 }
4845 return 1;
4846 }
4847
4848 static unsigned int UInt64LShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4849 {
4850 uint64 value2 = op2->__anon1.ui64;
4851
4852 exp->type = 2;
4853 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 << value2));
4854 if(!exp->expType)
4855 {
4856 exp->expType = op1->type;
4857 if(op1->type)
4858 op1->type->refCount++;
4859 }
4860 return 1;
4861 }
4862
4863 static unsigned int ShortLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4864 {
4865 short value2 = op2->__anon1.s;
4866
4867 exp->type = 2;
4868 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s << value2));
4869 if(!exp->expType)
4870 {
4871 exp->expType = op1->type;
4872 if(op1->type)
4873 op1->type->refCount++;
4874 }
4875 return 1;
4876 }
4877
4878 static unsigned int UShortLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4879 {
4880 unsigned short value2 = op2->__anon1.us;
4881
4882 exp->type = 2;
4883 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us << value2));
4884 if(!exp->expType)
4885 {
4886 exp->expType = op1->type;
4887 if(op1->type)
4888 op1->type->refCount++;
4889 }
4890 return 1;
4891 }
4892
4893 static unsigned int CharLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4894 {
4895 char value2 = op2->__anon1.c;
4896
4897 exp->type = 2;
4898 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c << value2));
4899 if(!exp->expType)
4900 {
4901 exp->expType = op1->type;
4902 if(op1->type)
4903 op1->type->refCount++;
4904 }
4905 return 1;
4906 }
4907
4908 static unsigned int UCharLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4909 {
4910 unsigned char value2 = op2->__anon1.uc;
4911
4912 exp->type = 2;
4913 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc << value2));
4914 if(!exp->expType)
4915 {
4916 exp->expType = op1->type;
4917 if(op1->type)
4918 op1->type->refCount++;
4919 }
4920 return 1;
4921 }
4922
4923 static unsigned int IntRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4924 {
4925 int value2 = op2->__anon1.i;
4926
4927 exp->type = 2;
4928 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i >> value2));
4929 if(!exp->expType)
4930 {
4931 exp->expType = op1->type;
4932 if(op1->type)
4933 op1->type->refCount++;
4934 }
4935 return 1;
4936 }
4937
4938 static unsigned int UIntRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4939 {
4940 unsigned int value2 = op2->__anon1.ui;
4941
4942 exp->type = 2;
4943 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui >> value2));
4944 if(!exp->expType)
4945 {
4946 exp->expType = op1->type;
4947 if(op1->type)
4948 op1->type->refCount++;
4949 }
4950 return 1;
4951 }
4952
4953 static unsigned int Int64RShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4954 {
4955 long long value2 = op2->__anon1.i64;
4956
4957 exp->type = 2;
4958 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 >> value2));
4959 if(!exp->expType)
4960 {
4961 exp->expType = op1->type;
4962 if(op1->type)
4963 op1->type->refCount++;
4964 }
4965 return 1;
4966 }
4967
4968 static unsigned int UInt64RShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4969 {
4970 uint64 value2 = op2->__anon1.ui64;
4971
4972 exp->type = 2;
4973 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 >> value2));
4974 if(!exp->expType)
4975 {
4976 exp->expType = op1->type;
4977 if(op1->type)
4978 op1->type->refCount++;
4979 }
4980 return 1;
4981 }
4982
4983 static unsigned int ShortRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4984 {
4985 short value2 = op2->__anon1.s;
4986
4987 exp->type = 2;
4988 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s >> value2));
4989 if(!exp->expType)
4990 {
4991 exp->expType = op1->type;
4992 if(op1->type)
4993 op1->type->refCount++;
4994 }
4995 return 1;
4996 }
4997
4998 static unsigned int UShortRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
4999 {
5000 unsigned short value2 = op2->__anon1.us;
5001
5002 exp->type = 2;
5003 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us >> value2));
5004 if(!exp->expType)
5005 {
5006 exp->expType = op1->type;
5007 if(op1->type)
5008 op1->type->refCount++;
5009 }
5010 return 1;
5011 }
5012
5013 static unsigned int CharRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5014 {
5015 char value2 = op2->__anon1.c;
5016
5017 exp->type = 2;
5018 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c >> value2));
5019 if(!exp->expType)
5020 {
5021 exp->expType = op1->type;
5022 if(op1->type)
5023 op1->type->refCount++;
5024 }
5025 return 1;
5026 }
5027
5028 static unsigned int UCharRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5029 {
5030 unsigned char value2 = op2->__anon1.uc;
5031
5032 exp->type = 2;
5033 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc >> value2));
5034 if(!exp->expType)
5035 {
5036 exp->expType = op1->type;
5037 if(op1->type)
5038 op1->type->refCount++;
5039 }
5040 return 1;
5041 }
5042
5043 static unsigned int IntBitNot(struct Expression * exp, struct Operand * op1)
5044 {
5045 exp->type = 2;
5046 exp->__anon1.__anon2.string = PrintInt((~op1->__anon1.i));
5047 if(!exp->expType)
5048 {
5049 exp->expType = op1->type;
5050 if(op1->type)
5051 op1->type->refCount++;
5052 }
5053 return 1;
5054 }
5055
5056 static unsigned int UIntBitNot(struct Expression * exp, struct Operand * op1)
5057 {
5058 exp->type = 2;
5059 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(~op1->__anon1.ui));
5060 if(!exp->expType)
5061 {
5062 exp->expType = op1->type;
5063 if(op1->type)
5064 op1->type->refCount++;
5065 }
5066 return 1;
5067 }
5068
5069 static unsigned int Int64BitNot(struct Expression * exp, struct Operand * op1)
5070 {
5071 exp->type = 2;
5072 exp->__anon1.__anon2.string = PrintInt64((long long)(~op1->__anon1.i64));
5073 if(!exp->expType)
5074 {
5075 exp->expType = op1->type;
5076 if(op1->type)
5077 op1->type->refCount++;
5078 }
5079 return 1;
5080 }
5081
5082 static unsigned int UInt64BitNot(struct Expression * exp, struct Operand * op1)
5083 {
5084 exp->type = 2;
5085 exp->__anon1.__anon2.string = PrintUInt64((uint64)(~op1->__anon1.ui64));
5086 if(!exp->expType)
5087 {
5088 exp->expType = op1->type;
5089 if(op1->type)
5090 op1->type->refCount++;
5091 }
5092 return 1;
5093 }
5094
5095 static unsigned int ShortBitNot(struct Expression * exp, struct Operand * op1)
5096 {
5097 exp->type = 2;
5098 exp->__anon1.__anon2.string = PrintShort((short)(~op1->__anon1.s));
5099 if(!exp->expType)
5100 {
5101 exp->expType = op1->type;
5102 if(op1->type)
5103 op1->type->refCount++;
5104 }
5105 return 1;
5106 }
5107
5108 static unsigned int UShortBitNot(struct Expression * exp, struct Operand * op1)
5109 {
5110 exp->type = 2;
5111 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(~op1->__anon1.us));
5112 if(!exp->expType)
5113 {
5114 exp->expType = op1->type;
5115 if(op1->type)
5116 op1->type->refCount++;
5117 }
5118 return 1;
5119 }
5120
5121 static unsigned int CharBitNot(struct Expression * exp, struct Operand * op1)
5122 {
5123 exp->type = 2;
5124 exp->__anon1.__anon2.string = PrintChar((char)(~op1->__anon1.c));
5125 if(!exp->expType)
5126 {
5127 exp->expType = op1->type;
5128 if(op1->type)
5129 op1->type->refCount++;
5130 }
5131 return 1;
5132 }
5133
5134 static unsigned int UCharBitNot(struct Expression * exp, struct Operand * op1)
5135 {
5136 exp->type = 2;
5137 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(~op1->__anon1.uc));
5138 if(!exp->expType)
5139 {
5140 exp->expType = op1->type;
5141 if(op1->type)
5142 op1->type->refCount++;
5143 }
5144 return 1;
5145 }
5146
5147 static unsigned int IntAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5148 {
5149 int value2 = op2->__anon1.i;
5150
5151 exp->type = 2;
5152 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i &= value2));
5153 if(!exp->expType)
5154 {
5155 exp->expType = op1->type;
5156 if(op1->type)
5157 op1->type->refCount++;
5158 }
5159 return 1;
5160 }
5161
5162 static unsigned int UIntAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5163 {
5164 unsigned int value2 = op2->__anon1.ui;
5165
5166 exp->type = 2;
5167 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui &= value2));
5168 if(!exp->expType)
5169 {
5170 exp->expType = op1->type;
5171 if(op1->type)
5172 op1->type->refCount++;
5173 }
5174 return 1;
5175 }
5176
5177 static unsigned int Int64AndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5178 {
5179 long long value2 = op2->__anon1.i64;
5180
5181 exp->type = 2;
5182 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 &= value2));
5183 if(!exp->expType)
5184 {
5185 exp->expType = op1->type;
5186 if(op1->type)
5187 op1->type->refCount++;
5188 }
5189 return 1;
5190 }
5191
5192 static unsigned int UInt64AndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5193 {
5194 uint64 value2 = op2->__anon1.ui64;
5195
5196 exp->type = 2;
5197 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 &= value2));
5198 if(!exp->expType)
5199 {
5200 exp->expType = op1->type;
5201 if(op1->type)
5202 op1->type->refCount++;
5203 }
5204 return 1;
5205 }
5206
5207 static unsigned int ShortAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5208 {
5209 short value2 = op2->__anon1.s;
5210
5211 exp->type = 2;
5212 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s &= value2));
5213 if(!exp->expType)
5214 {
5215 exp->expType = op1->type;
5216 if(op1->type)
5217 op1->type->refCount++;
5218 }
5219 return 1;
5220 }
5221
5222 static unsigned int UShortAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5223 {
5224 unsigned short value2 = op2->__anon1.us;
5225
5226 exp->type = 2;
5227 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us &= value2));
5228 if(!exp->expType)
5229 {
5230 exp->expType = op1->type;
5231 if(op1->type)
5232 op1->type->refCount++;
5233 }
5234 return 1;
5235 }
5236
5237 static unsigned int CharAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5238 {
5239 char value2 = op2->__anon1.c;
5240
5241 exp->type = 2;
5242 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c &= value2));
5243 if(!exp->expType)
5244 {
5245 exp->expType = op1->type;
5246 if(op1->type)
5247 op1->type->refCount++;
5248 }
5249 return 1;
5250 }
5251
5252 static unsigned int UCharAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5253 {
5254 unsigned char value2 = op2->__anon1.uc;
5255
5256 exp->type = 2;
5257 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc &= value2));
5258 if(!exp->expType)
5259 {
5260 exp->expType = op1->type;
5261 if(op1->type)
5262 op1->type->refCount++;
5263 }
5264 return 1;
5265 }
5266
5267 static unsigned int IntOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5268 {
5269 int value2 = op2->__anon1.i;
5270
5271 exp->type = 2;
5272 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i |= value2));
5273 if(!exp->expType)
5274 {
5275 exp->expType = op1->type;
5276 if(op1->type)
5277 op1->type->refCount++;
5278 }
5279 return 1;
5280 }
5281
5282 static unsigned int UIntOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5283 {
5284 unsigned int value2 = op2->__anon1.ui;
5285
5286 exp->type = 2;
5287 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui |= value2));
5288 if(!exp->expType)
5289 {
5290 exp->expType = op1->type;
5291 if(op1->type)
5292 op1->type->refCount++;
5293 }
5294 return 1;
5295 }
5296
5297 static unsigned int Int64OrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5298 {
5299 long long value2 = op2->__anon1.i64;
5300
5301 exp->type = 2;
5302 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 |= value2));
5303 if(!exp->expType)
5304 {
5305 exp->expType = op1->type;
5306 if(op1->type)
5307 op1->type->refCount++;
5308 }
5309 return 1;
5310 }
5311
5312 static unsigned int UInt64OrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5313 {
5314 uint64 value2 = op2->__anon1.ui64;
5315
5316 exp->type = 2;
5317 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 |= value2));
5318 if(!exp->expType)
5319 {
5320 exp->expType = op1->type;
5321 if(op1->type)
5322 op1->type->refCount++;
5323 }
5324 return 1;
5325 }
5326
5327 static unsigned int ShortOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5328 {
5329 short value2 = op2->__anon1.s;
5330
5331 exp->type = 2;
5332 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s |= value2));
5333 if(!exp->expType)
5334 {
5335 exp->expType = op1->type;
5336 if(op1->type)
5337 op1->type->refCount++;
5338 }
5339 return 1;
5340 }
5341
5342 static unsigned int UShortOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5343 {
5344 unsigned short value2 = op2->__anon1.us;
5345
5346 exp->type = 2;
5347 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us |= value2));
5348 if(!exp->expType)
5349 {
5350 exp->expType = op1->type;
5351 if(op1->type)
5352 op1->type->refCount++;
5353 }
5354 return 1;
5355 }
5356
5357 static unsigned int CharOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5358 {
5359 char value2 = op2->__anon1.c;
5360
5361 exp->type = 2;
5362 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c |= value2));
5363 if(!exp->expType)
5364 {
5365 exp->expType = op1->type;
5366 if(op1->type)
5367 op1->type->refCount++;
5368 }
5369 return 1;
5370 }
5371
5372 static unsigned int UCharOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5373 {
5374 unsigned char value2 = op2->__anon1.uc;
5375
5376 exp->type = 2;
5377 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc |= value2));
5378 if(!exp->expType)
5379 {
5380 exp->expType = op1->type;
5381 if(op1->type)
5382 op1->type->refCount++;
5383 }
5384 return 1;
5385 }
5386
5387 static unsigned int IntXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5388 {
5389 int value2 = op2->__anon1.i;
5390
5391 exp->type = 2;
5392 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i ^= value2));
5393 if(!exp->expType)
5394 {
5395 exp->expType = op1->type;
5396 if(op1->type)
5397 op1->type->refCount++;
5398 }
5399 return 1;
5400 }
5401
5402 static unsigned int UIntXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5403 {
5404 unsigned int value2 = op2->__anon1.ui;
5405
5406 exp->type = 2;
5407 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui ^= value2));
5408 if(!exp->expType)
5409 {
5410 exp->expType = op1->type;
5411 if(op1->type)
5412 op1->type->refCount++;
5413 }
5414 return 1;
5415 }
5416
5417 static unsigned int Int64XorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5418 {
5419 long long value2 = op2->__anon1.i64;
5420
5421 exp->type = 2;
5422 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 ^= value2));
5423 if(!exp->expType)
5424 {
5425 exp->expType = op1->type;
5426 if(op1->type)
5427 op1->type->refCount++;
5428 }
5429 return 1;
5430 }
5431
5432 static unsigned int UInt64XorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5433 {
5434 uint64 value2 = op2->__anon1.ui64;
5435
5436 exp->type = 2;
5437 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 ^= value2));
5438 if(!exp->expType)
5439 {
5440 exp->expType = op1->type;
5441 if(op1->type)
5442 op1->type->refCount++;
5443 }
5444 return 1;
5445 }
5446
5447 static unsigned int ShortXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5448 {
5449 short value2 = op2->__anon1.s;
5450
5451 exp->type = 2;
5452 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s ^= value2));
5453 if(!exp->expType)
5454 {
5455 exp->expType = op1->type;
5456 if(op1->type)
5457 op1->type->refCount++;
5458 }
5459 return 1;
5460 }
5461
5462 static unsigned int UShortXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5463 {
5464 unsigned short value2 = op2->__anon1.us;
5465
5466 exp->type = 2;
5467 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us ^= value2));
5468 if(!exp->expType)
5469 {
5470 exp->expType = op1->type;
5471 if(op1->type)
5472 op1->type->refCount++;
5473 }
5474 return 1;
5475 }
5476
5477 static unsigned int CharXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5478 {
5479 char value2 = op2->__anon1.c;
5480
5481 exp->type = 2;
5482 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c ^= value2));
5483 if(!exp->expType)
5484 {
5485 exp->expType = op1->type;
5486 if(op1->type)
5487 op1->type->refCount++;
5488 }
5489 return 1;
5490 }
5491
5492 static unsigned int UCharXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5493 {
5494 unsigned char value2 = op2->__anon1.uc;
5495
5496 exp->type = 2;
5497 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc ^= value2));
5498 if(!exp->expType)
5499 {
5500 exp->expType = op1->type;
5501 if(op1->type)
5502 op1->type->refCount++;
5503 }
5504 return 1;
5505 }
5506
5507 static unsigned int IntLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5508 {
5509 int value2 = op2->__anon1.i;
5510
5511 exp->type = 2;
5512 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i <<= value2));
5513 if(!exp->expType)
5514 {
5515 exp->expType = op1->type;
5516 if(op1->type)
5517 op1->type->refCount++;
5518 }
5519 return 1;
5520 }
5521
5522 static unsigned int UIntLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5523 {
5524 unsigned int value2 = op2->__anon1.ui;
5525
5526 exp->type = 2;
5527 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui <<= value2));
5528 if(!exp->expType)
5529 {
5530 exp->expType = op1->type;
5531 if(op1->type)
5532 op1->type->refCount++;
5533 }
5534 return 1;
5535 }
5536
5537 static unsigned int Int64LShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5538 {
5539 long long value2 = op2->__anon1.i64;
5540
5541 exp->type = 2;
5542 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 <<= value2));
5543 if(!exp->expType)
5544 {
5545 exp->expType = op1->type;
5546 if(op1->type)
5547 op1->type->refCount++;
5548 }
5549 return 1;
5550 }
5551
5552 static unsigned int UInt64LShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5553 {
5554 uint64 value2 = op2->__anon1.ui64;
5555
5556 exp->type = 2;
5557 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 <<= value2));
5558 if(!exp->expType)
5559 {
5560 exp->expType = op1->type;
5561 if(op1->type)
5562 op1->type->refCount++;
5563 }
5564 return 1;
5565 }
5566
5567 static unsigned int ShortLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5568 {
5569 short value2 = op2->__anon1.s;
5570
5571 exp->type = 2;
5572 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s <<= value2));
5573 if(!exp->expType)
5574 {
5575 exp->expType = op1->type;
5576 if(op1->type)
5577 op1->type->refCount++;
5578 }
5579 return 1;
5580 }
5581
5582 static unsigned int UShortLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5583 {
5584 unsigned short value2 = op2->__anon1.us;
5585
5586 exp->type = 2;
5587 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us <<= value2));
5588 if(!exp->expType)
5589 {
5590 exp->expType = op1->type;
5591 if(op1->type)
5592 op1->type->refCount++;
5593 }
5594 return 1;
5595 }
5596
5597 static unsigned int CharLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5598 {
5599 char value2 = op2->__anon1.c;
5600
5601 exp->type = 2;
5602 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c <<= value2));
5603 if(!exp->expType)
5604 {
5605 exp->expType = op1->type;
5606 if(op1->type)
5607 op1->type->refCount++;
5608 }
5609 return 1;
5610 }
5611
5612 static unsigned int UCharLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5613 {
5614 unsigned char value2 = op2->__anon1.uc;
5615
5616 exp->type = 2;
5617 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc <<= value2));
5618 if(!exp->expType)
5619 {
5620 exp->expType = op1->type;
5621 if(op1->type)
5622 op1->type->refCount++;
5623 }
5624 return 1;
5625 }
5626
5627 static unsigned int IntRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5628 {
5629 int value2 = op2->__anon1.i;
5630
5631 exp->type = 2;
5632 exp->__anon1.__anon2.string = PrintInt((op1->__anon1.i >>= value2));
5633 if(!exp->expType)
5634 {
5635 exp->expType = op1->type;
5636 if(op1->type)
5637 op1->type->refCount++;
5638 }
5639 return 1;
5640 }
5641
5642 static unsigned int UIntRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5643 {
5644 unsigned int value2 = op2->__anon1.ui;
5645
5646 exp->type = 2;
5647 exp->__anon1.__anon2.string = PrintUInt((op1->__anon1.ui >>= value2));
5648 if(!exp->expType)
5649 {
5650 exp->expType = op1->type;
5651 if(op1->type)
5652 op1->type->refCount++;
5653 }
5654 return 1;
5655 }
5656
5657 static unsigned int Int64RShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5658 {
5659 long long value2 = op2->__anon1.i64;
5660
5661 exp->type = 2;
5662 exp->__anon1.__anon2.string = PrintInt64((op1->__anon1.i64 >>= value2));
5663 if(!exp->expType)
5664 {
5665 exp->expType = op1->type;
5666 if(op1->type)
5667 op1->type->refCount++;
5668 }
5669 return 1;
5670 }
5671
5672 static unsigned int UInt64RShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5673 {
5674 uint64 value2 = op2->__anon1.ui64;
5675
5676 exp->type = 2;
5677 exp->__anon1.__anon2.string = PrintUInt64((op1->__anon1.ui64 >>= value2));
5678 if(!exp->expType)
5679 {
5680 exp->expType = op1->type;
5681 if(op1->type)
5682 op1->type->refCount++;
5683 }
5684 return 1;
5685 }
5686
5687 static unsigned int ShortRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5688 {
5689 short value2 = op2->__anon1.s;
5690
5691 exp->type = 2;
5692 exp->__anon1.__anon2.string = PrintShort((op1->__anon1.s >>= value2));
5693 if(!exp->expType)
5694 {
5695 exp->expType = op1->type;
5696 if(op1->type)
5697 op1->type->refCount++;
5698 }
5699 return 1;
5700 }
5701
5702 static unsigned int UShortRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5703 {
5704 unsigned short value2 = op2->__anon1.us;
5705
5706 exp->type = 2;
5707 exp->__anon1.__anon2.string = PrintUShort((op1->__anon1.us >>= value2));
5708 if(!exp->expType)
5709 {
5710 exp->expType = op1->type;
5711 if(op1->type)
5712 op1->type->refCount++;
5713 }
5714 return 1;
5715 }
5716
5717 static unsigned int CharRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5718 {
5719 char value2 = op2->__anon1.c;
5720
5721 exp->type = 2;
5722 exp->__anon1.__anon2.string = PrintChar((op1->__anon1.c >>= value2));
5723 if(!exp->expType)
5724 {
5725 exp->expType = op1->type;
5726 if(op1->type)
5727 op1->type->refCount++;
5728 }
5729 return 1;
5730 }
5731
5732 static unsigned int UCharRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5733 {
5734 unsigned char value2 = op2->__anon1.uc;
5735
5736 exp->type = 2;
5737 exp->__anon1.__anon2.string = PrintUChar((op1->__anon1.uc >>= value2));
5738 if(!exp->expType)
5739 {
5740 exp->expType = op1->type;
5741 if(op1->type)
5742 op1->type->refCount++;
5743 }
5744 return 1;
5745 }
5746
5747 static unsigned int IntNot(struct Expression * exp, struct Operand * op1)
5748 {
5749 exp->type = 2;
5750 exp->__anon1.__anon2.string = PrintInt((int)(!op1->__anon1.i));
5751 if(!exp->expType)
5752 {
5753 exp->expType = op1->type;
5754 if(op1->type)
5755 op1->type->refCount++;
5756 }
5757 return 1;
5758 }
5759
5760 static unsigned int UIntNot(struct Expression * exp, struct Operand * op1)
5761 {
5762 exp->type = 2;
5763 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(!op1->__anon1.ui));
5764 if(!exp->expType)
5765 {
5766 exp->expType = op1->type;
5767 if(op1->type)
5768 op1->type->refCount++;
5769 }
5770 return 1;
5771 }
5772
5773 static unsigned int Int64Not(struct Expression * exp, struct Operand * op1)
5774 {
5775 exp->type = 2;
5776 exp->__anon1.__anon2.string = PrintInt64((long long)(!op1->__anon1.i64));
5777 if(!exp->expType)
5778 {
5779 exp->expType = op1->type;
5780 if(op1->type)
5781 op1->type->refCount++;
5782 }
5783 return 1;
5784 }
5785
5786 static unsigned int UInt64Not(struct Expression * exp, struct Operand * op1)
5787 {
5788 exp->type = 2;
5789 exp->__anon1.__anon2.string = PrintUInt64((uint64)(!op1->__anon1.ui64));
5790 if(!exp->expType)
5791 {
5792 exp->expType = op1->type;
5793 if(op1->type)
5794 op1->type->refCount++;
5795 }
5796 return 1;
5797 }
5798
5799 static unsigned int ShortNot(struct Expression * exp, struct Operand * op1)
5800 {
5801 exp->type = 2;
5802 exp->__anon1.__anon2.string = PrintShort((short)(!op1->__anon1.s));
5803 if(!exp->expType)
5804 {
5805 exp->expType = op1->type;
5806 if(op1->type)
5807 op1->type->refCount++;
5808 }
5809 return 1;
5810 }
5811
5812 static unsigned int UShortNot(struct Expression * exp, struct Operand * op1)
5813 {
5814 exp->type = 2;
5815 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(!op1->__anon1.us));
5816 if(!exp->expType)
5817 {
5818 exp->expType = op1->type;
5819 if(op1->type)
5820 op1->type->refCount++;
5821 }
5822 return 1;
5823 }
5824
5825 static unsigned int CharNot(struct Expression * exp, struct Operand * op1)
5826 {
5827 exp->type = 2;
5828 exp->__anon1.__anon2.string = PrintChar((char)(!op1->__anon1.c));
5829 if(!exp->expType)
5830 {
5831 exp->expType = op1->type;
5832 if(op1->type)
5833 op1->type->refCount++;
5834 }
5835 return 1;
5836 }
5837
5838 static unsigned int UCharNot(struct Expression * exp, struct Operand * op1)
5839 {
5840 exp->type = 2;
5841 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(!op1->__anon1.uc));
5842 if(!exp->expType)
5843 {
5844 exp->expType = op1->type;
5845 if(op1->type)
5846 op1->type->refCount++;
5847 }
5848 return 1;
5849 }
5850
5851 static unsigned int IntEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5852 {
5853 int value2 = op2->__anon1.i;
5854
5855 exp->type = 2;
5856 exp->__anon1.__anon2.string = PrintInt((int)(op1->__anon1.i == value2));
5857 if(!exp->expType)
5858 {
5859 exp->expType = op1->type;
5860 if(op1->type)
5861 op1->type->refCount++;
5862 }
5863 return 1;
5864 }
5865
5866 static unsigned int UIntEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5867 {
5868 unsigned int value2 = op2->__anon1.ui;
5869
5870 exp->type = 2;
5871 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(op1->__anon1.ui == value2));
5872 if(!exp->expType)
5873 {
5874 exp->expType = op1->type;
5875 if(op1->type)
5876 op1->type->refCount++;
5877 }
5878 return 1;
5879 }
5880
5881 static unsigned int Int64Equ(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5882 {
5883 long long value2 = op2->__anon1.i64;
5884
5885 exp->type = 2;
5886 exp->__anon1.__anon2.string = PrintInt64((long long)(op1->__anon1.i64 == value2));
5887 if(!exp->expType)
5888 {
5889 exp->expType = op1->type;
5890 if(op1->type)
5891 op1->type->refCount++;
5892 }
5893 return 1;
5894 }
5895
5896 static unsigned int UInt64Equ(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5897 {
5898 uint64 value2 = op2->__anon1.ui64;
5899
5900 exp->type = 2;
5901 exp->__anon1.__anon2.string = PrintUInt64((uint64)(op1->__anon1.ui64 == value2));
5902 if(!exp->expType)
5903 {
5904 exp->expType = op1->type;
5905 if(op1->type)
5906 op1->type->refCount++;
5907 }
5908 return 1;
5909 }
5910
5911 static unsigned int ShortEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5912 {
5913 short value2 = op2->__anon1.s;
5914
5915 exp->type = 2;
5916 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s == value2));
5917 if(!exp->expType)
5918 {
5919 exp->expType = op1->type;
5920 if(op1->type)
5921 op1->type->refCount++;
5922 }
5923 return 1;
5924 }
5925
5926 static unsigned int UShortEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5927 {
5928 unsigned short value2 = op2->__anon1.us;
5929
5930 exp->type = 2;
5931 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us == value2));
5932 if(!exp->expType)
5933 {
5934 exp->expType = op1->type;
5935 if(op1->type)
5936 op1->type->refCount++;
5937 }
5938 return 1;
5939 }
5940
5941 static unsigned int CharEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5942 {
5943 char value2 = op2->__anon1.c;
5944
5945 exp->type = 2;
5946 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c == value2));
5947 if(!exp->expType)
5948 {
5949 exp->expType = op1->type;
5950 if(op1->type)
5951 op1->type->refCount++;
5952 }
5953 return 1;
5954 }
5955
5956 static unsigned int UCharEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5957 {
5958 unsigned char value2 = op2->__anon1.uc;
5959
5960 exp->type = 2;
5961 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc == value2));
5962 if(!exp->expType)
5963 {
5964 exp->expType = op1->type;
5965 if(op1->type)
5966 op1->type->refCount++;
5967 }
5968 return 1;
5969 }
5970
5971 static unsigned int FloatEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5972 {
5973 float value2 = op2->__anon1.f;
5974
5975 exp->type = 2;
5976 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f == value2));
5977 if(!exp->expType)
5978 {
5979 exp->expType = op1->type;
5980 if(op1->type)
5981 op1->type->refCount++;
5982 }
5983 return 1;
5984 }
5985
5986 static unsigned int DoubleEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5987 {
5988 double value2 = op2->__anon1.d;
5989
5990 exp->type = 2;
5991 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d == value2));
5992 if(!exp->expType)
5993 {
5994 exp->expType = op1->type;
5995 if(op1->type)
5996 op1->type->refCount++;
5997 }
5998 return 1;
5999 }
6000
6001 static unsigned int IntNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6002 {
6003 int value2 = op2->__anon1.i;
6004
6005 exp->type = 2;
6006 exp->__anon1.__anon2.string = PrintInt((int)(op1->__anon1.i != value2));
6007 if(!exp->expType)
6008 {
6009 exp->expType = op1->type;
6010 if(op1->type)
6011 op1->type->refCount++;
6012 }
6013 return 1;
6014 }
6015
6016 static unsigned int UIntNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6017 {
6018 unsigned int value2 = op2->__anon1.ui;
6019
6020 exp->type = 2;
6021 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(op1->__anon1.ui != value2));
6022 if(!exp->expType)
6023 {
6024 exp->expType = op1->type;
6025 if(op1->type)
6026 op1->type->refCount++;
6027 }
6028 return 1;
6029 }
6030
6031 static unsigned int Int64Nqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6032 {
6033 long long value2 = op2->__anon1.i64;
6034
6035 exp->type = 2;
6036 exp->__anon1.__anon2.string = PrintInt64((long long)(op1->__anon1.i64 != value2));
6037 if(!exp->expType)
6038 {
6039 exp->expType = op1->type;
6040 if(op1->type)
6041 op1->type->refCount++;
6042 }
6043 return 1;
6044 }
6045
6046 static unsigned int UInt64Nqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6047 {
6048 uint64 value2 = op2->__anon1.ui64;
6049
6050 exp->type = 2;
6051 exp->__anon1.__anon2.string = PrintUInt64((uint64)(op1->__anon1.ui64 != value2));
6052 if(!exp->expType)
6053 {
6054 exp->expType = op1->type;
6055 if(op1->type)
6056 op1->type->refCount++;
6057 }
6058 return 1;
6059 }
6060
6061 static unsigned int ShortNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6062 {
6063 short value2 = op2->__anon1.s;
6064
6065 exp->type = 2;
6066 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s != value2));
6067 if(!exp->expType)
6068 {
6069 exp->expType = op1->type;
6070 if(op1->type)
6071 op1->type->refCount++;
6072 }
6073 return 1;
6074 }
6075
6076 static unsigned int UShortNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6077 {
6078 unsigned short value2 = op2->__anon1.us;
6079
6080 exp->type = 2;
6081 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us != value2));
6082 if(!exp->expType)
6083 {
6084 exp->expType = op1->type;
6085 if(op1->type)
6086 op1->type->refCount++;
6087 }
6088 return 1;
6089 }
6090
6091 static unsigned int CharNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6092 {
6093 char value2 = op2->__anon1.c;
6094
6095 exp->type = 2;
6096 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c != value2));
6097 if(!exp->expType)
6098 {
6099 exp->expType = op1->type;
6100 if(op1->type)
6101 op1->type->refCount++;
6102 }
6103 return 1;
6104 }
6105
6106 static unsigned int UCharNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6107 {
6108 unsigned char value2 = op2->__anon1.uc;
6109
6110 exp->type = 2;
6111 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc != value2));
6112 if(!exp->expType)
6113 {
6114 exp->expType = op1->type;
6115 if(op1->type)
6116 op1->type->refCount++;
6117 }
6118 return 1;
6119 }
6120
6121 static unsigned int FloatNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6122 {
6123 float value2 = op2->__anon1.f;
6124
6125 exp->type = 2;
6126 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f != value2));
6127 if(!exp->expType)
6128 {
6129 exp->expType = op1->type;
6130 if(op1->type)
6131 op1->type->refCount++;
6132 }
6133 return 1;
6134 }
6135
6136 static unsigned int DoubleNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6137 {
6138 double value2 = op2->__anon1.d;
6139
6140 exp->type = 2;
6141 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d != value2));
6142 if(!exp->expType)
6143 {
6144 exp->expType = op1->type;
6145 if(op1->type)
6146 op1->type->refCount++;
6147 }
6148 return 1;
6149 }
6150
6151 static unsigned int IntAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6152 {
6153 int value2 = op2->__anon1.i;
6154
6155 exp->type = 2;
6156 exp->__anon1.__anon2.string = PrintInt((int)(op1->__anon1.i && value2));
6157 if(!exp->expType)
6158 {
6159 exp->expType = op1->type;
6160 if(op1->type)
6161 op1->type->refCount++;
6162 }
6163 return 1;
6164 }
6165
6166 static unsigned int UIntAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6167 {
6168 unsigned int value2 = op2->__anon1.ui;
6169
6170 exp->type = 2;
6171 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(op1->__anon1.ui && value2));
6172 if(!exp->expType)
6173 {
6174 exp->expType = op1->type;
6175 if(op1->type)
6176 op1->type->refCount++;
6177 }
6178 return 1;
6179 }
6180
6181 static unsigned int Int64And(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6182 {
6183 long long value2 = op2->__anon1.i64;
6184
6185 exp->type = 2;
6186 exp->__anon1.__anon2.string = PrintInt64((long long)(op1->__anon1.i64 && value2));
6187 if(!exp->expType)
6188 {
6189 exp->expType = op1->type;
6190 if(op1->type)
6191 op1->type->refCount++;
6192 }
6193 return 1;
6194 }
6195
6196 static unsigned int UInt64And(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6197 {
6198 uint64 value2 = op2->__anon1.ui64;
6199
6200 exp->type = 2;
6201 exp->__anon1.__anon2.string = PrintUInt64((uint64)(op1->__anon1.ui64 && value2));
6202 if(!exp->expType)
6203 {
6204 exp->expType = op1->type;
6205 if(op1->type)
6206 op1->type->refCount++;
6207 }
6208 return 1;
6209 }
6210
6211 static unsigned int ShortAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6212 {
6213 short value2 = op2->__anon1.s;
6214
6215 exp->type = 2;
6216 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s && value2));
6217 if(!exp->expType)
6218 {
6219 exp->expType = op1->type;
6220 if(op1->type)
6221 op1->type->refCount++;
6222 }
6223 return 1;
6224 }
6225
6226 static unsigned int UShortAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6227 {
6228 unsigned short value2 = op2->__anon1.us;
6229
6230 exp->type = 2;
6231 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us && value2));
6232 if(!exp->expType)
6233 {
6234 exp->expType = op1->type;
6235 if(op1->type)
6236 op1->type->refCount++;
6237 }
6238 return 1;
6239 }
6240
6241 static unsigned int CharAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6242 {
6243 char value2 = op2->__anon1.c;
6244
6245 exp->type = 2;
6246 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c && value2));
6247 if(!exp->expType)
6248 {
6249 exp->expType = op1->type;
6250 if(op1->type)
6251 op1->type->refCount++;
6252 }
6253 return 1;
6254 }
6255
6256 static unsigned int UCharAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6257 {
6258 unsigned char value2 = op2->__anon1.uc;
6259
6260 exp->type = 2;
6261 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc && value2));
6262 if(!exp->expType)
6263 {
6264 exp->expType = op1->type;
6265 if(op1->type)
6266 op1->type->refCount++;
6267 }
6268 return 1;
6269 }
6270
6271 static unsigned int FloatAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6272 {
6273 float value2 = op2->__anon1.f;
6274
6275 exp->type = 2;
6276 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f && value2));
6277 if(!exp->expType)
6278 {
6279 exp->expType = op1->type;
6280 if(op1->type)
6281 op1->type->refCount++;
6282 }
6283 return 1;
6284 }
6285
6286 static unsigned int DoubleAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6287 {
6288 double value2 = op2->__anon1.d;
6289
6290 exp->type = 2;
6291 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d && value2));
6292 if(!exp->expType)
6293 {
6294 exp->expType = op1->type;
6295 if(op1->type)
6296 op1->type->refCount++;
6297 }
6298 return 1;
6299 }
6300
6301 static unsigned int IntOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6302 {
6303 int value2 = op2->__anon1.i;
6304
6305 exp->type = 2;
6306 exp->__anon1.__anon2.string = PrintInt((int)(op1->__anon1.i || value2));
6307 if(!exp->expType)
6308 {
6309 exp->expType = op1->type;
6310 if(op1->type)
6311 op1->type->refCount++;
6312 }
6313 return 1;
6314 }
6315
6316 static unsigned int UIntOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6317 {
6318 unsigned int value2 = op2->__anon1.ui;
6319
6320 exp->type = 2;
6321 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(op1->__anon1.ui || value2));
6322 if(!exp->expType)
6323 {
6324 exp->expType = op1->type;
6325 if(op1->type)
6326 op1->type->refCount++;
6327 }
6328 return 1;
6329 }
6330
6331 static unsigned int Int64Or(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6332 {
6333 long long value2 = op2->__anon1.i64;
6334
6335 exp->type = 2;
6336 exp->__anon1.__anon2.string = PrintInt64((long long)(op1->__anon1.i64 || value2));
6337 if(!exp->expType)
6338 {
6339 exp->expType = op1->type;
6340 if(op1->type)
6341 op1->type->refCount++;
6342 }
6343 return 1;
6344 }
6345
6346 static unsigned int UInt64Or(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6347 {
6348 uint64 value2 = op2->__anon1.ui64;
6349
6350 exp->type = 2;
6351 exp->__anon1.__anon2.string = PrintUInt64((uint64)(op1->__anon1.ui64 || value2));
6352 if(!exp->expType)
6353 {
6354 exp->expType = op1->type;
6355 if(op1->type)
6356 op1->type->refCount++;
6357 }
6358 return 1;
6359 }
6360
6361 static unsigned int ShortOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6362 {
6363 short value2 = op2->__anon1.s;
6364
6365 exp->type = 2;
6366 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s || value2));
6367 if(!exp->expType)
6368 {
6369 exp->expType = op1->type;
6370 if(op1->type)
6371 op1->type->refCount++;
6372 }
6373 return 1;
6374 }
6375
6376 static unsigned int UShortOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6377 {
6378 unsigned short value2 = op2->__anon1.us;
6379
6380 exp->type = 2;
6381 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us || value2));
6382 if(!exp->expType)
6383 {
6384 exp->expType = op1->type;
6385 if(op1->type)
6386 op1->type->refCount++;
6387 }
6388 return 1;
6389 }
6390
6391 static unsigned int CharOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6392 {
6393 char value2 = op2->__anon1.c;
6394
6395 exp->type = 2;
6396 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c || value2));
6397 if(!exp->expType)
6398 {
6399 exp->expType = op1->type;
6400 if(op1->type)
6401 op1->type->refCount++;
6402 }
6403 return 1;
6404 }
6405
6406 static unsigned int UCharOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6407 {
6408 unsigned char value2 = op2->__anon1.uc;
6409
6410 exp->type = 2;
6411 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc || value2));
6412 if(!exp->expType)
6413 {
6414 exp->expType = op1->type;
6415 if(op1->type)
6416 op1->type->refCount++;
6417 }
6418 return 1;
6419 }
6420
6421 static unsigned int FloatOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6422 {
6423 float value2 = op2->__anon1.f;
6424
6425 exp->type = 2;
6426 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f || value2));
6427 if(!exp->expType)
6428 {
6429 exp->expType = op1->type;
6430 if(op1->type)
6431 op1->type->refCount++;
6432 }
6433 return 1;
6434 }
6435
6436 static unsigned int DoubleOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6437 {
6438 double value2 = op2->__anon1.d;
6439
6440 exp->type = 2;
6441 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d || value2));
6442 if(!exp->expType)
6443 {
6444 exp->expType = op1->type;
6445 if(op1->type)
6446 op1->type->refCount++;
6447 }
6448 return 1;
6449 }
6450
6451 static unsigned int IntGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6452 {
6453 int value2 = op2->__anon1.i;
6454
6455 exp->type = 2;
6456 exp->__anon1.__anon2.string = PrintInt((int)(op1->__anon1.i > value2));
6457 if(!exp->expType)
6458 {
6459 exp->expType = op1->type;
6460 if(op1->type)
6461 op1->type->refCount++;
6462 }
6463 return 1;
6464 }
6465
6466 static unsigned int UIntGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6467 {
6468 unsigned int value2 = op2->__anon1.ui;
6469
6470 exp->type = 2;
6471 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(op1->__anon1.ui > value2));
6472 if(!exp->expType)
6473 {
6474 exp->expType = op1->type;
6475 if(op1->type)
6476 op1->type->refCount++;
6477 }
6478 return 1;
6479 }
6480
6481 static unsigned int Int64Grt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6482 {
6483 long long value2 = op2->__anon1.i64;
6484
6485 exp->type = 2;
6486 exp->__anon1.__anon2.string = PrintInt64((long long)(op1->__anon1.i64 > value2));
6487 if(!exp->expType)
6488 {
6489 exp->expType = op1->type;
6490 if(op1->type)
6491 op1->type->refCount++;
6492 }
6493 return 1;
6494 }
6495
6496 static unsigned int UInt64Grt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6497 {
6498 uint64 value2 = op2->__anon1.ui64;
6499
6500 exp->type = 2;
6501 exp->__anon1.__anon2.string = PrintUInt64((uint64)(op1->__anon1.ui64 > value2));
6502 if(!exp->expType)
6503 {
6504 exp->expType = op1->type;
6505 if(op1->type)
6506 op1->type->refCount++;
6507 }
6508 return 1;
6509 }
6510
6511 static unsigned int ShortGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6512 {
6513 short value2 = op2->__anon1.s;
6514
6515 exp->type = 2;
6516 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s > value2));
6517 if(!exp->expType)
6518 {
6519 exp->expType = op1->type;
6520 if(op1->type)
6521 op1->type->refCount++;
6522 }
6523 return 1;
6524 }
6525
6526 static unsigned int UShortGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6527 {
6528 unsigned short value2 = op2->__anon1.us;
6529
6530 exp->type = 2;
6531 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us > value2));
6532 if(!exp->expType)
6533 {
6534 exp->expType = op1->type;
6535 if(op1->type)
6536 op1->type->refCount++;
6537 }
6538 return 1;
6539 }
6540
6541 static unsigned int CharGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6542 {
6543 char value2 = op2->__anon1.c;
6544
6545 exp->type = 2;
6546 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c > value2));
6547 if(!exp->expType)
6548 {
6549 exp->expType = op1->type;
6550 if(op1->type)
6551 op1->type->refCount++;
6552 }
6553 return 1;
6554 }
6555
6556 static unsigned int UCharGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6557 {
6558 unsigned char value2 = op2->__anon1.uc;
6559
6560 exp->type = 2;
6561 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc > value2));
6562 if(!exp->expType)
6563 {
6564 exp->expType = op1->type;
6565 if(op1->type)
6566 op1->type->refCount++;
6567 }
6568 return 1;
6569 }
6570
6571 static unsigned int FloatGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6572 {
6573 float value2 = op2->__anon1.f;
6574
6575 exp->type = 2;
6576 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f > value2));
6577 if(!exp->expType)
6578 {
6579 exp->expType = op1->type;
6580 if(op1->type)
6581 op1->type->refCount++;
6582 }
6583 return 1;
6584 }
6585
6586 static unsigned int DoubleGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6587 {
6588 double value2 = op2->__anon1.d;
6589
6590 exp->type = 2;
6591 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d > value2));
6592 if(!exp->expType)
6593 {
6594 exp->expType = op1->type;
6595 if(op1->type)
6596 op1->type->refCount++;
6597 }
6598 return 1;
6599 }
6600
6601 static unsigned int IntSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6602 {
6603 int value2 = op2->__anon1.i;
6604
6605 exp->type = 2;
6606 exp->__anon1.__anon2.string = PrintInt((int)(op1->__anon1.i < value2));
6607 if(!exp->expType)
6608 {
6609 exp->expType = op1->type;
6610 if(op1->type)
6611 op1->type->refCount++;
6612 }
6613 return 1;
6614 }
6615
6616 static unsigned int UIntSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6617 {
6618 unsigned int value2 = op2->__anon1.ui;
6619
6620 exp->type = 2;
6621 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(op1->__anon1.ui < value2));
6622 if(!exp->expType)
6623 {
6624 exp->expType = op1->type;
6625 if(op1->type)
6626 op1->type->refCount++;
6627 }
6628 return 1;
6629 }
6630
6631 static unsigned int Int64Sma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6632 {
6633 long long value2 = op2->__anon1.i64;
6634
6635 exp->type = 2;
6636 exp->__anon1.__anon2.string = PrintInt64((long long)(op1->__anon1.i64 < value2));
6637 if(!exp->expType)
6638 {
6639 exp->expType = op1->type;
6640 if(op1->type)
6641 op1->type->refCount++;
6642 }
6643 return 1;
6644 }
6645
6646 static unsigned int UInt64Sma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6647 {
6648 uint64 value2 = op2->__anon1.ui64;
6649
6650 exp->type = 2;
6651 exp->__anon1.__anon2.string = PrintUInt64((uint64)(op1->__anon1.ui64 < value2));
6652 if(!exp->expType)
6653 {
6654 exp->expType = op1->type;
6655 if(op1->type)
6656 op1->type->refCount++;
6657 }
6658 return 1;
6659 }
6660
6661 static unsigned int ShortSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6662 {
6663 short value2 = op2->__anon1.s;
6664
6665 exp->type = 2;
6666 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s < value2));
6667 if(!exp->expType)
6668 {
6669 exp->expType = op1->type;
6670 if(op1->type)
6671 op1->type->refCount++;
6672 }
6673 return 1;
6674 }
6675
6676 static unsigned int UShortSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6677 {
6678 unsigned short value2 = op2->__anon1.us;
6679
6680 exp->type = 2;
6681 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us < value2));
6682 if(!exp->expType)
6683 {
6684 exp->expType = op1->type;
6685 if(op1->type)
6686 op1->type->refCount++;
6687 }
6688 return 1;
6689 }
6690
6691 static unsigned int CharSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6692 {
6693 char value2 = op2->__anon1.c;
6694
6695 exp->type = 2;
6696 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c < value2));
6697 if(!exp->expType)
6698 {
6699 exp->expType = op1->type;
6700 if(op1->type)
6701 op1->type->refCount++;
6702 }
6703 return 1;
6704 }
6705
6706 static unsigned int UCharSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6707 {
6708 unsigned char value2 = op2->__anon1.uc;
6709
6710 exp->type = 2;
6711 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc < value2));
6712 if(!exp->expType)
6713 {
6714 exp->expType = op1->type;
6715 if(op1->type)
6716 op1->type->refCount++;
6717 }
6718 return 1;
6719 }
6720
6721 static unsigned int FloatSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6722 {
6723 float value2 = op2->__anon1.f;
6724
6725 exp->type = 2;
6726 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f < value2));
6727 if(!exp->expType)
6728 {
6729 exp->expType = op1->type;
6730 if(op1->type)
6731 op1->type->refCount++;
6732 }
6733 return 1;
6734 }
6735
6736 static unsigned int DoubleSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6737 {
6738 double value2 = op2->__anon1.d;
6739
6740 exp->type = 2;
6741 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d < value2));
6742 if(!exp->expType)
6743 {
6744 exp->expType = op1->type;
6745 if(op1->type)
6746 op1->type->refCount++;
6747 }
6748 return 1;
6749 }
6750
6751 static unsigned int IntGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6752 {
6753 int value2 = op2->__anon1.i;
6754
6755 exp->type = 2;
6756 exp->__anon1.__anon2.string = PrintInt((int)(op1->__anon1.i >= value2));
6757 if(!exp->expType)
6758 {
6759 exp->expType = op1->type;
6760 if(op1->type)
6761 op1->type->refCount++;
6762 }
6763 return 1;
6764 }
6765
6766 static unsigned int UIntGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6767 {
6768 unsigned int value2 = op2->__anon1.ui;
6769
6770 exp->type = 2;
6771 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(op1->__anon1.ui >= value2));
6772 if(!exp->expType)
6773 {
6774 exp->expType = op1->type;
6775 if(op1->type)
6776 op1->type->refCount++;
6777 }
6778 return 1;
6779 }
6780
6781 static unsigned int Int64GrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6782 {
6783 long long value2 = op2->__anon1.i64;
6784
6785 exp->type = 2;
6786 exp->__anon1.__anon2.string = PrintInt64((long long)(op1->__anon1.i64 >= value2));
6787 if(!exp->expType)
6788 {
6789 exp->expType = op1->type;
6790 if(op1->type)
6791 op1->type->refCount++;
6792 }
6793 return 1;
6794 }
6795
6796 static unsigned int UInt64GrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6797 {
6798 uint64 value2 = op2->__anon1.ui64;
6799
6800 exp->type = 2;
6801 exp->__anon1.__anon2.string = PrintUInt64((uint64)(op1->__anon1.ui64 >= value2));
6802 if(!exp->expType)
6803 {
6804 exp->expType = op1->type;
6805 if(op1->type)
6806 op1->type->refCount++;
6807 }
6808 return 1;
6809 }
6810
6811 static unsigned int ShortGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6812 {
6813 short value2 = op2->__anon1.s;
6814
6815 exp->type = 2;
6816 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s >= value2));
6817 if(!exp->expType)
6818 {
6819 exp->expType = op1->type;
6820 if(op1->type)
6821 op1->type->refCount++;
6822 }
6823 return 1;
6824 }
6825
6826 static unsigned int UShortGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6827 {
6828 unsigned short value2 = op2->__anon1.us;
6829
6830 exp->type = 2;
6831 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us >= value2));
6832 if(!exp->expType)
6833 {
6834 exp->expType = op1->type;
6835 if(op1->type)
6836 op1->type->refCount++;
6837 }
6838 return 1;
6839 }
6840
6841 static unsigned int CharGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6842 {
6843 char value2 = op2->__anon1.c;
6844
6845 exp->type = 2;
6846 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c >= value2));
6847 if(!exp->expType)
6848 {
6849 exp->expType = op1->type;
6850 if(op1->type)
6851 op1->type->refCount++;
6852 }
6853 return 1;
6854 }
6855
6856 static unsigned int UCharGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6857 {
6858 unsigned char value2 = op2->__anon1.uc;
6859
6860 exp->type = 2;
6861 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc >= value2));
6862 if(!exp->expType)
6863 {
6864 exp->expType = op1->type;
6865 if(op1->type)
6866 op1->type->refCount++;
6867 }
6868 return 1;
6869 }
6870
6871 static unsigned int FloatGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6872 {
6873 float value2 = op2->__anon1.f;
6874
6875 exp->type = 2;
6876 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f >= value2));
6877 if(!exp->expType)
6878 {
6879 exp->expType = op1->type;
6880 if(op1->type)
6881 op1->type->refCount++;
6882 }
6883 return 1;
6884 }
6885
6886 static unsigned int DoubleGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6887 {
6888 double value2 = op2->__anon1.d;
6889
6890 exp->type = 2;
6891 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d >= value2));
6892 if(!exp->expType)
6893 {
6894 exp->expType = op1->type;
6895 if(op1->type)
6896 op1->type->refCount++;
6897 }
6898 return 1;
6899 }
6900
6901 static unsigned int IntSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6902 {
6903 int value2 = op2->__anon1.i;
6904
6905 exp->type = 2;
6906 exp->__anon1.__anon2.string = PrintInt((int)(op1->__anon1.i <= value2));
6907 if(!exp->expType)
6908 {
6909 exp->expType = op1->type;
6910 if(op1->type)
6911 op1->type->refCount++;
6912 }
6913 return 1;
6914 }
6915
6916 static unsigned int UIntSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6917 {
6918 unsigned int value2 = op2->__anon1.ui;
6919
6920 exp->type = 2;
6921 exp->__anon1.__anon2.string = PrintUInt((unsigned int)(op1->__anon1.ui <= value2));
6922 if(!exp->expType)
6923 {
6924 exp->expType = op1->type;
6925 if(op1->type)
6926 op1->type->refCount++;
6927 }
6928 return 1;
6929 }
6930
6931 static unsigned int Int64SmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6932 {
6933 long long value2 = op2->__anon1.i64;
6934
6935 exp->type = 2;
6936 exp->__anon1.__anon2.string = PrintInt64((long long)(op1->__anon1.i64 <= value2));
6937 if(!exp->expType)
6938 {
6939 exp->expType = op1->type;
6940 if(op1->type)
6941 op1->type->refCount++;
6942 }
6943 return 1;
6944 }
6945
6946 static unsigned int UInt64SmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6947 {
6948 uint64 value2 = op2->__anon1.ui64;
6949
6950 exp->type = 2;
6951 exp->__anon1.__anon2.string = PrintUInt64((uint64)(op1->__anon1.ui64 <= value2));
6952 if(!exp->expType)
6953 {
6954 exp->expType = op1->type;
6955 if(op1->type)
6956 op1->type->refCount++;
6957 }
6958 return 1;
6959 }
6960
6961 static unsigned int ShortSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6962 {
6963 short value2 = op2->__anon1.s;
6964
6965 exp->type = 2;
6966 exp->__anon1.__anon2.string = PrintShort((short)(op1->__anon1.s <= value2));
6967 if(!exp->expType)
6968 {
6969 exp->expType = op1->type;
6970 if(op1->type)
6971 op1->type->refCount++;
6972 }
6973 return 1;
6974 }
6975
6976 static unsigned int UShortSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6977 {
6978 unsigned short value2 = op2->__anon1.us;
6979
6980 exp->type = 2;
6981 exp->__anon1.__anon2.string = PrintUShort((unsigned short)(op1->__anon1.us <= value2));
6982 if(!exp->expType)
6983 {
6984 exp->expType = op1->type;
6985 if(op1->type)
6986 op1->type->refCount++;
6987 }
6988 return 1;
6989 }
6990
6991 static unsigned int CharSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6992 {
6993 char value2 = op2->__anon1.c;
6994
6995 exp->type = 2;
6996 exp->__anon1.__anon2.string = PrintChar((char)(op1->__anon1.c <= value2));
6997 if(!exp->expType)
6998 {
6999 exp->expType = op1->type;
7000 if(op1->type)
7001 op1->type->refCount++;
7002 }
7003 return 1;
7004 }
7005
7006 static unsigned int UCharSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7007 {
7008 unsigned char value2 = op2->__anon1.uc;
7009
7010 exp->type = 2;
7011 exp->__anon1.__anon2.string = PrintUChar((unsigned char)(op1->__anon1.uc <= value2));
7012 if(!exp->expType)
7013 {
7014 exp->expType = op1->type;
7015 if(op1->type)
7016 op1->type->refCount++;
7017 }
7018 return 1;
7019 }
7020
7021 static unsigned int FloatSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7022 {
7023 float value2 = op2->__anon1.f;
7024
7025 exp->type = 2;
7026 exp->__anon1.__anon2.string = PrintFloat((float)(op1->__anon1.f <= value2));
7027 if(!exp->expType)
7028 {
7029 exp->expType = op1->type;
7030 if(op1->type)
7031 op1->type->refCount++;
7032 }
7033 return 1;
7034 }
7035
7036 static unsigned int DoubleSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7037 {
7038 double value2 = op2->__anon1.d;
7039
7040 exp->type = 2;
7041 exp->__anon1.__anon2.string = PrintDouble((double)(op1->__anon1.d <= value2));
7042 if(!exp->expType)
7043 {
7044 exp->expType = op1->type;
7045 if(op1->type)
7046 op1->type->refCount++;
7047 }
7048 return 1;
7049 }
7050
7051 static unsigned int IntCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
7052 {
7053 exp->type = 2;
7054 exp->__anon1.__anon2.string = PrintInt(op1->__anon1.i ? op2->__anon1.i : op3->__anon1.i);
7055 if(!exp->expType)
7056 {
7057 exp->expType = op1->type;
7058 if(op1->type)
7059 op1->type->refCount++;
7060 }
7061 return 1;
7062 }
7063
7064 static unsigned int UIntCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
7065 {
7066 exp->type = 2;
7067 exp->__anon1.__anon2.string = PrintUInt(op1->__anon1.ui ? op2->__anon1.ui : op3->__anon1.ui);
7068 if(!exp->expType)
7069 {
7070 exp->expType = op1->type;
7071 if(op1->type)
7072 op1->type->refCount++;
7073 }
7074 return 1;
7075 }
7076
7077 static unsigned int Int64Cond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
7078 {
7079 exp->type = 2;
7080 exp->__anon1.__anon2.string = PrintInt64(op1->__anon1.i64 ? op2->__anon1.i64 : op3->__anon1.i64);
7081 if(!exp->expType)
7082 {
7083 exp->expType = op1->type;
7084 if(op1->type)
7085 op1->type->refCount++;
7086 }
7087 return 1;
7088 }
7089
7090 static unsigned int UInt64Cond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
7091 {
7092 exp->type = 2;
7093 exp->__anon1.__anon2.string = PrintUInt64(op1->__anon1.ui64 ? op2->__anon1.ui64 : op3->__anon1.ui64);
7094 if(!exp->expType)
7095 {
7096 exp->expType = op1->type;
7097 if(op1->type)
7098 op1->type->refCount++;
7099 }
7100 return 1;
7101 }
7102
7103 static unsigned int ShortCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
7104 {
7105 exp->type = 2;
7106 exp->__anon1.__anon2.string = PrintShort(op1->__anon1.s ? op2->__anon1.s : op3->__anon1.s);
7107 if(!exp->expType)
7108 {
7109 exp->expType = op1->type;
7110 if(op1->type)
7111 op1->type->refCount++;
7112 }
7113 return 1;
7114 }
7115
7116 static unsigned int UShortCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
7117 {
7118 exp->type = 2;
7119 exp->__anon1.__anon2.string = PrintUShort(op1->__anon1.us ? op2->__anon1.us : op3->__anon1.us);
7120 if(!exp->expType)
7121 {
7122 exp->expType = op1->type;
7123 if(op1->type)
7124 op1->type->refCount++;
7125 }
7126 return 1;
7127 }
7128
7129 static unsigned int CharCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
7130 {
7131 exp->type = 2;
7132 exp->__anon1.__anon2.string = PrintChar(op1->__anon1.c ? op2->__anon1.c : op3->__anon1.c);
7133 if(!exp->expType)
7134 {
7135 exp->expType = op1->type;
7136 if(op1->type)
7137 op1->type->refCount++;
7138 }
7139 return 1;
7140 }
7141
7142 static unsigned int UCharCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
7143 {
7144 exp->type = 2;
7145 exp->__anon1.__anon2.string = PrintUChar(op1->__anon1.uc ? op2->__anon1.uc : op3->__anon1.uc);
7146 if(!exp->expType)
7147 {
7148 exp->expType = op1->type;
7149 if(op1->type)
7150 op1->type->refCount++;
7151 }
7152 return 1;
7153 }
7154
7155 static void PrintName(struct Type * type, char * string, unsigned int fullName)
7156 {
7157 if(type->name && type->name[0])
7158 {
7159 if(fullName)
7160 strcat(string, type->name);
7161 else
7162 {
7163 char * name = __ecereNameSpace__ecere__sys__RSearchString(type->name, "::", strlen(type->name), 1, 0);
7164
7165 if(name)
7166 name += 2;
7167 else
7168 name = type->name;
7169 strcat(string, name);
7170 }
7171 }
7172 }
7173
7174 static void PrintAttribs(struct Type * type, char * string)
7175 {
7176 if(type)
7177 {
7178 if(type->dllExport)
7179 strcat(string, "dllexport ");
7180 if(type->attrStdcall)
7181 strcat(string, "stdcall ");
7182 }
7183 }
7184
7185 static struct Type * FindMember(struct Type * type, char * string)
7186 {
7187 struct Type * memberType;
7188
7189 for(memberType = type->__anon1.__anon1.members.first; memberType; memberType = memberType->next)
7190 {
7191 if(!memberType->name)
7192 {
7193 struct Type * subType = FindMember(memberType, string);
7194
7195 if(subType)
7196 return subType;
7197 }
7198 else if(!strcmp(memberType->name, string))
7199 return memberType;
7200 }
7201 return (((void *)0));
7202 }
7203
7204 unsigned int __ecereProp_Type_Get_isPointerType(struct Type * this);
7205
7206 unsigned int __ecereProp_Type_Get_specConst(struct Type * this);
7207
7208 static unsigned int Promote(struct Operand * op, int kind, unsigned int isSigned)
7209 {
7210 unsigned int result = 0;
7211
7212 switch(kind)
7213 {
7214 case 2:
7215 if(op->kind == 1 || op->kind == 15 || op->kind == 24)
7216 result = isSigned ? GetOpShort(op, &op->__anon1.s) : GetOpUShort(op, &op->__anon1.us);
7217 break;
7218 case 3:
7219 case 5:
7220 if(op->kind == 1 || op->kind == 2 || op->kind == 15 || op->kind == 24)
7221 result = isSigned ? GetOpInt(op, &op->__anon1.i) : GetOpUInt(op, &op->__anon1.ui);
7222 break;
7223 case 4:
7224 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)
7225 result = isSigned ? GetOpInt64(op, &op->__anon1.i64) : GetOpUInt64(op, &op->__anon1.ui64);
7226 break;
7227 case 6:
7228 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)
7229 result = GetOpFloat(op, &op->__anon1.f);
7230 break;
7231 case 7:
7232 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)
7233 result = GetOpDouble(op, &op->__anon1.d);
7234 break;
7235 case 13:
7236 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)
7237 result = GetOpUInt64(op, &op->__anon1.ui64);
7238 break;
7239 case 15:
7240 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)
7241 result = isSigned ? GetOpInt(op, &op->__anon1.i) : GetOpUInt(op, &op->__anon1.ui);
7242 break;
7243 case 22:
7244 if(op->kind == 1 || op->kind == 2 || op->kind == 3 || op->kind == 5 || op->kind == 15 || op->kind == 24)
7245 result = isSigned ? GetOpInt64(op, &op->__anon1.i64) : GetOpUInt64(op, &op->__anon1.ui64);
7246 break;
7247 case 23:
7248 if(op->kind == 1 || op->kind == 2 || op->kind == 3 || op->kind == 5 || op->kind == 15 || op->kind == 24)
7249 result = isSigned ? GetOpInt64(op, &op->__anon1.i64) : GetOpUInt64(op, &op->__anon1.ui64);
7250 break;
7251 }
7252 return result;
7253 }
7254
7255 struct OpTable floatOps =
7256 {
7257 (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)
7258 };
7259
7260 struct OpTable doubleOps =
7261 {
7262 (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)
7263 };
7264
7265 struct OpTable intOps =
7266 {
7267 (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)
7268 };
7269
7270 struct OpTable uintOps =
7271 {
7272 (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)
7273 };
7274
7275 struct OpTable int64Ops =
7276 {
7277 (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)
7278 };
7279
7280 struct OpTable uint64Ops =
7281 {
7282 (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)
7283 };
7284
7285 struct OpTable shortOps =
7286 {
7287 (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)
7288 };
7289
7290 struct OpTable ushortOps =
7291 {
7292 (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)
7293 };
7294
7295 struct OpTable charOps =
7296 {
7297 (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)
7298 };
7299
7300 struct OpTable ucharOps =
7301 {
7302 (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)
7303 };
7304
7305 struct Type * FindMemberAndOffset(struct Type * type, char * string, unsigned int * offset)
7306 {
7307 struct Type * memberType;
7308
7309 for(memberType = type->__anon1.__anon1.members.first; memberType; memberType = memberType->next)
7310 {
7311 if(!memberType->name)
7312 {
7313 struct Type * subType = FindMember(memberType, string);
7314
7315 if(subType)
7316 {
7317 *offset += memberType->offset;
7318 return subType;
7319 }
7320 }
7321 else if(!strcmp(memberType->name, string))
7322 {
7323 *offset += memberType->offset;
7324 return memberType;
7325 }
7326 }
7327 return (((void *)0));
7328 }
7329
7330 struct __ecereNameSpace__ecere__com__Module;
7331
7332 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);
7333
7334 extern struct __ecereNameSpace__ecere__com__Instance * privateModule;
7335
7336 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);
7337
7338 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);
7339
7340 extern struct ModuleImport * FindModule(struct __ecereNameSpace__ecere__com__Instance * moduleToFind);
7341
7342 extern struct __ecereNameSpace__ecere__com__Class * __ecereNameSpace__ecere__com__eSystem_FindClass(struct __ecereNameSpace__ecere__com__Instance * module, const char *  name);
7343
7344 struct GlobalData
7345 {
7346 uintptr_t key;
7347 struct __ecereNameSpace__ecere__sys__BTNode * parent;
7348 struct __ecereNameSpace__ecere__sys__BTNode * left;
7349 struct __ecereNameSpace__ecere__sys__BTNode * right;
7350 int depth;
7351 struct __ecereNameSpace__ecere__com__Instance * module;
7352 char *  dataTypeString;
7353 struct Type * dataType;
7354 void *  symbol;
7355 char *  fullName;
7356 } ecere_gcc_struct;
7357
7358 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);
7359
7360 extern struct __ecereNameSpace__ecere__com__Instance * GetPrivateModule(void);
7361
7362 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);
7363
7364 extern struct __ecereNameSpace__ecere__com__Instance * __thisModule;
7365
7366 struct __ecereNameSpace__ecere__com__DefinedExpression;
7367
7368 extern struct __ecereNameSpace__ecere__com__DefinedExpression * __ecereNameSpace__ecere__com__eSystem_FindDefine(struct __ecereNameSpace__ecere__com__Instance * module, const char *  name);
7369
7370 struct __ecereNameSpace__ecere__com__DefinedExpression
7371 {
7372 struct __ecereNameSpace__ecere__com__DefinedExpression * prev;
7373 struct __ecereNameSpace__ecere__com__DefinedExpression * next;
7374 const char *  name;
7375 const char *  value;
7376 struct __ecereNameSpace__ecere__com__NameSpace *  nameSpace;
7377 } ecere_gcc_struct;
7378
7379 struct __ecereNameSpace__ecere__sys__BinaryTree;
7380
7381 struct __ecereNameSpace__ecere__sys__BinaryTree
7382 {
7383 struct __ecereNameSpace__ecere__sys__BTNode * root;
7384 int count;
7385 int (*  CompareKey)(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, uintptr_t a, uintptr_t b);
7386 void (*  FreeKey)(void *  key);
7387 } ecere_gcc_struct;
7388
7389 struct __ecereNameSpace__ecere__com__Class
7390 {
7391 struct __ecereNameSpace__ecere__com__Class * prev;
7392 struct __ecereNameSpace__ecere__com__Class * next;
7393 const char *  name;
7394 int offset;
7395 int structSize;
7396 void * *  _vTbl;
7397 int vTblSize;
7398 unsigned int (*  Constructor)(void * );
7399 void (*  Destructor)(void * );
7400 int offsetClass;
7401 int sizeClass;
7402 struct __ecereNameSpace__ecere__com__Class * base;
7403 struct __ecereNameSpace__ecere__sys__BinaryTree methods;
7404 struct __ecereNameSpace__ecere__sys__BinaryTree members;
7405 struct __ecereNameSpace__ecere__sys__BinaryTree prop;
7406 struct __ecereNameSpace__ecere__sys__OldList membersAndProperties;
7407 struct __ecereNameSpace__ecere__sys__BinaryTree classProperties;
7408 struct __ecereNameSpace__ecere__sys__OldList derivatives;
7409 int memberID;
7410 int startMemberID;
7411 int type;
7412 struct __ecereNameSpace__ecere__com__Instance * module;
7413 struct __ecereNameSpace__ecere__com__NameSpace *  nameSpace;
7414 const char *  dataTypeString;
7415 struct Type * dataType;
7416 int typeSize;
7417 int defaultAlignment;
7418 void (*  Initialize)();
7419 int memberOffset;
7420 struct __ecereNameSpace__ecere__sys__OldList selfWatchers;
7421 const char *  designerClass;
7422 unsigned int noExpansion;
7423 const char *  defaultProperty;
7424 unsigned int comRedefinition;
7425 int count;
7426 int isRemote;
7427 unsigned int internalDecl;
7428 void *  data;
7429 unsigned int computeSize;
7430 short structAlignment;
7431 short pointerAlignment;
7432 int destructionWatchOffset;
7433 unsigned int fixed;
7434 struct __ecereNameSpace__ecere__sys__OldList delayedCPValues;
7435 int inheritanceAccess;
7436 const char *  fullName;
7437 void *  symbol;
7438 struct __ecereNameSpace__ecere__sys__OldList conversions;
7439 struct __ecereNameSpace__ecere__sys__OldList templateParams;
7440 struct __ecereNameSpace__ecere__com__ClassTemplateArgument *  templateArgs;
7441 struct __ecereNameSpace__ecere__com__Class * templateClass;
7442 struct __ecereNameSpace__ecere__sys__OldList templatized;
7443 int numParams;
7444 unsigned int isInstanceClass;
7445 unsigned int byValueSystemClass;
7446 } ecere_gcc_struct;
7447
7448 struct __ecereNameSpace__ecere__com__NameSpace
7449 {
7450 const char *  name;
7451 struct __ecereNameSpace__ecere__com__NameSpace *  btParent;
7452 struct __ecereNameSpace__ecere__com__NameSpace *  left;
7453 struct __ecereNameSpace__ecere__com__NameSpace *  right;
7454 int depth;
7455 struct __ecereNameSpace__ecere__com__NameSpace *  parent;
7456 struct __ecereNameSpace__ecere__sys__BinaryTree nameSpaces;
7457 struct __ecereNameSpace__ecere__sys__BinaryTree classes;
7458 struct __ecereNameSpace__ecere__sys__BinaryTree defines;
7459 struct __ecereNameSpace__ecere__sys__BinaryTree functions;
7460 } ecere_gcc_struct;
7461
7462 struct __ecereNameSpace__ecere__com__DataMember
7463 {
7464 struct __ecereNameSpace__ecere__com__DataMember * prev;
7465 struct __ecereNameSpace__ecere__com__DataMember * next;
7466 const char *  name;
7467 unsigned int isProperty;
7468 int memberAccess;
7469 int id;
7470 struct __ecereNameSpace__ecere__com__Class * _class;
7471 const char *  dataTypeString;
7472 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
7473 struct Type * dataType;
7474 int type;
7475 int offset;
7476 int memberID;
7477 struct __ecereNameSpace__ecere__sys__OldList members;
7478 struct __ecereNameSpace__ecere__sys__BinaryTree membersAlpha;
7479 int memberOffset;
7480 short structAlignment;
7481 short pointerAlignment;
7482 } ecere_gcc_struct;
7483
7484 struct __ecereNameSpace__ecere__sys__BTNode * __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(struct __ecereNameSpace__ecere__sys__BinaryTree * this, const char *  key);
7485
7486 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(struct __ecereNameSpace__ecere__sys__BinaryTree * this, struct __ecereNameSpace__ecere__sys__BTNode * node);
7487
7488 struct __ecereNameSpace__ecere__sys__BTNode * __ecereProp___ecereNameSpace__ecere__sys__BinaryTree_Get_first(struct __ecereNameSpace__ecere__sys__BinaryTree * this);
7489
7490 struct __ecereNameSpace__ecere__sys__BTNode * __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindPrefix(struct __ecereNameSpace__ecere__sys__BinaryTree * this, const char *  key);
7491
7492 void __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Remove(struct __ecereNameSpace__ecere__sys__BinaryTree * this, struct __ecereNameSpace__ecere__sys__BTNode * node);
7493
7494 static struct __ecereNameSpace__ecere__com__Class * __ecereClass_Conversion;
7495
7496 static void _DeclareType(struct External * neededFor, struct Type * type, unsigned int needDereference, unsigned int forFunctionDef, unsigned int fwdDecl)
7497 {
7498 if(inCompiler)
7499 {
7500 if(type->kind == 11)
7501 {
7502 struct Type * param;
7503
7504 for(param = type->__anon1.__anon2.params.first; param; param = param->next)
7505 _DeclareType(neededFor, param, forFunctionDef, 0, fwdDecl);
7506 _DeclareType(neededFor, type->__anon1.__anon2.returnType, forFunctionDef, 0, fwdDecl);
7507 }
7508 else if(type->kind == 13)
7509 _DeclareType(neededFor, type->__anon1.type, 0, 0, fwdDecl);
7510 else if(type->kind == 8)
7511 {
7512 struct __ecereNameSpace__ecere__com__Class * c = type->__anon1._class->__anon1.registered;
7513
7514 _DeclareStruct(neededFor, c ? c->fullName : "ecere::com::Instance", c ? c->type == 5 : 0, needDereference && c && c->type == 1, fwdDecl);
7515 }
7516 else if(type->kind == 9 || type->kind == 10)
7517 {
7518 struct Type * member;
7519
7520 for(member = type->__anon1.__anon1.members.first; member; member = member->next)
7521 _DeclareType(neededFor, member, needDereference, forFunctionDef, fwdDecl);
7522 }
7523 else if(type->kind == 12)
7524 _DeclareType(neededFor, type->__anon1.__anon4.arrayType, 1, 0, fwdDecl);
7525 }
7526 }
7527
7528 static unsigned int CheckConstCompatibility(struct Type * source, struct Type * dest, unsigned int warn)
7529 {
7530 unsigned int status = 1;
7531
7532 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))
7533 {
7534 struct __ecereNameSpace__ecere__com__Class * sourceClass = source->kind == 8 ? source->__anon1._class->__anon1.registered : (((void *)0));
7535 struct __ecereNameSpace__ecere__com__Class * destClass = dest->kind == 8 ? dest->__anon1._class->__anon1.registered : (((void *)0));
7536
7537 if((!sourceClass || (sourceClass && sourceClass->type == 0 && !sourceClass->structSize)) && (!destClass || (destClass && destClass->type == 0 && !destClass->structSize)))
7538 {
7539 struct Type * sourceType = source, * destType = dest;
7540
7541 while((sourceType->kind == 13 || sourceType->kind == 12) && sourceType->__anon1.type)
7542 sourceType = sourceType->__anon1.type;
7543 while((destType->kind == 13 || destType->kind == 12) && destType->__anon1.type)
7544 destType = destType->__anon1.type;
7545 if(!destType->constant && sourceType->constant)
7546 {
7547 status = 0;
7548 if(warn)
7549 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "discarding const qualifier\n", (((void *)0))));
7550 }
7551 }
7552 }
7553 return status;
7554 }
7555
7556 struct Operand GetOperand(struct Expression * exp)
7557 {
7558 struct Operand op =
7559 {
7560 0, 0, 0,
7561 .__anon1 = {
7562 .c = 0
7563 },
7564 {
7565 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
7566 }
7567 };
7568 struct Type * type = exp->expType;
7569
7570 if(type)
7571 {
7572 while(type->kind == 8 && 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))
7573 {
7574 if(!type->__anon1._class->__anon1.registered->dataType)
7575 type->__anon1._class->__anon1.registered->dataType = ProcessTypeString(type->__anon1._class->__anon1.registered->dataTypeString, 0);
7576 type = type->__anon1._class->__anon1.registered->dataType;
7577 }
7578 if(exp->type == 3 && op.kind == 13)
7579 {
7580 op.__anon1.ui64 = (uint64)(uintptr_t)exp->__anon1.__anon2.string;
7581 op.kind = 13;
7582 op.ops = uint64Ops;
7583 }
7584 else if(exp->isConstant && exp->type == 2)
7585 {
7586 op.kind = type->kind;
7587 op.type = type;
7588 switch(op.kind)
7589 {
7590 case 24:
7591 case 1:
7592 {
7593 if(exp->__anon1.__anon1.constant[0] == '\'')
7594 {
7595 op.__anon1.c = exp->__anon1.__anon1.constant[1];
7596 op.ops = charOps;
7597 }
7598 else if(type->isSigned)
7599 {
7600 op.__anon1.c = (char)strtol(exp->__anon1.__anon1.constant, (((void *)0)), 0);
7601 op.ops = charOps;
7602 }
7603 else
7604 {
7605 op.__anon1.uc = (unsigned char)strtoul(exp->__anon1.__anon1.constant, (((void *)0)), 0);
7606 op.ops = ucharOps;
7607 }
7608 break;
7609 }
7610 case 2:
7611 if(type->isSigned)
7612 {
7613 op.__anon1.s = (short)strtol(exp->__anon1.__anon1.constant, (((void *)0)), 0);
7614 op.ops = shortOps;
7615 }
7616 else
7617 {
7618 op.__anon1.us = (unsigned short)strtoul(exp->__anon1.__anon1.constant, (((void *)0)), 0);
7619 op.ops = ushortOps;
7620 }
7621 break;
7622 case 3:
7623 case 5:
7624 if(type->isSigned)
7625 {
7626 op.__anon1.i = strtol(exp->__anon1.__anon1.constant, (((void *)0)), 0);
7627 op.ops = intOps;
7628 }
7629 else
7630 {
7631 op.__anon1.ui = (unsigned int)strtoul(exp->__anon1.__anon1.constant, (((void *)0)), 0);
7632 op.ops = uintOps;
7633 }
7634 op.kind = 3;
7635 break;
7636 case 4:
7637 if(type->isSigned)
7638 {
7639 op.__anon1.i64 = __ecereNameSpace__ecere__com___strtoi64(exp->__anon1.__anon1.constant, (((void *)0)), 0);
7640 op.ops = int64Ops;
7641 }
7642 else
7643 {
7644 op.__anon1.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->__anon1.__anon1.constant, (((void *)0)), 0);
7645 op.ops = uint64Ops;
7646 }
7647 op.kind = 4;
7648 break;
7649 case 22:
7650 if(type->isSigned)
7651 {
7652 op.__anon1.i64 = __ecereNameSpace__ecere__com___strtoi64(exp->__anon1.__anon1.constant, (((void *)0)), 0);
7653 op.ops = int64Ops;
7654 }
7655 else
7656 {
7657 op.__anon1.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->__anon1.__anon1.constant, (((void *)0)), 0);
7658 op.ops = uint64Ops;
7659 }
7660 op.kind = 4;
7661 break;
7662 case 23:
7663 if(type->isSigned)
7664 {
7665 op.__anon1.i64 = __ecereNameSpace__ecere__com___strtoi64(exp->__anon1.__anon1.constant, (((void *)0)), 0);
7666 op.ops = int64Ops;
7667 }
7668 else
7669 {
7670 op.__anon1.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->__anon1.__anon1.constant, (((void *)0)), 0);
7671 op.ops = uint64Ops;
7672 }
7673 op.kind = 4;
7674 break;
7675 case 6:
7676 if(!strcmp(exp->__anon1.__anon1.constant, "inf"))
7677 op.__anon1.f = __ecereMethod_float_inf();
7678 else if(!strcmp(exp->__anon1.__anon1.constant, "-inf"))
7679 op.__anon1.f = -__ecereMethod_float_inf();
7680 else if(!strcmp(exp->__anon1.__anon1.constant, "nan"))
7681 op.__anon1.f = __ecereMethod_float_nan();
7682 else if(!strcmp(exp->__anon1.__anon1.constant, "-nan"))
7683 op.__anon1.f = -__ecereMethod_float_nan();
7684 else
7685 op.__anon1.f = (float)strtod(exp->__anon1.__anon1.constant, (((void *)0)));
7686 op.ops = floatOps;
7687 break;
7688 case 7:
7689 if(!strcmp(exp->__anon1.__anon1.constant, "inf"))
7690 op.__anon1.d = __ecereMethod_double_inf();
7691 else if(!strcmp(exp->__anon1.__anon1.constant, "-inf"))
7692 op.__anon1.d = -__ecereMethod_double_inf();
7693 else if(!strcmp(exp->__anon1.__anon1.constant, "nan"))
7694 op.__anon1.d = __ecereMethod_double_nan();
7695 else if(!strcmp(exp->__anon1.__anon1.constant, "-nan"))
7696 op.__anon1.d = -__ecereMethod_double_nan();
7697 else
7698 op.__anon1.d = (double)strtod(exp->__anon1.__anon1.constant, (((void *)0)));
7699 op.ops = doubleOps;
7700 break;
7701 case 12:
7702 case 13:
7703 case 8:
7704 op.__anon1.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->__anon1.__anon1.constant, (((void *)0)), 0);
7705 op.kind = 13;
7706 op.ops = uint64Ops;
7707 break;
7708 }
7709 }
7710 }
7711 return op;
7712 }
7713
7714 static long long GetEnumValue(struct __ecereNameSpace__ecere__com__Class * _class, void * ptr)
7715 {
7716 long long v = 0;
7717
7718 switch(_class->typeSize)
7719 {
7720 case 8:
7721 if(!strcmp(_class->dataTypeString, "uint64"))
7722 v = (long long)*(uint64 *)ptr;
7723 else
7724 v = *(long long *)ptr;
7725 break;
7726 case 4:
7727 if(!strcmp(_class->dataTypeString, "uint"))
7728 v = (long long)*(unsigned int *)ptr;
7729 else
7730 v = (long long)*(int *)ptr;
7731 break;
7732 case 2:
7733 if(!strcmp(_class->dataTypeString, "uint16"))
7734 v = (long long)*(unsigned short *)ptr;
7735 else
7736 v = (long long)*(short *)ptr;
7737 break;
7738 case 1:
7739 if(!strcmp(_class->dataTypeString, "byte"))
7740 v = (long long)*(unsigned char *)ptr;
7741 else
7742 v = (long long)*(char *)ptr;
7743 break;
7744 }
7745 return v;
7746 }
7747
7748 static void GetTypeSpecs(struct Type * type, struct __ecereNameSpace__ecere__sys__OldList * specs)
7749 {
7750 if(!type->isSigned && type->kind != 22 && type->kind != 23)
7751 ListAdd(specs, MkSpecifier(UNSIGNED));
7752 switch(type->kind)
7753 {
7754 case 8:
7755 {
7756 if(type->__anon1._class->__anon1.registered)
7757 {
7758 if(!type->__anon1._class->__anon1.registered->dataType)
7759 type->__anon1._class->__anon1.registered->dataType = ProcessTypeString(type->__anon1._class->__anon1.registered->dataTypeString, 0);
7760 GetTypeSpecs(type->__anon1._class->__anon1.registered->dataType, specs);
7761 }
7762 break;
7763 }
7764 case 7:
7765 ListAdd(specs, MkSpecifier(DOUBLE));
7766 break;
7767 case 6:
7768 ListAdd(specs, MkSpecifier(FLOAT));
7769 break;
7770 case 1:
7771 ListAdd(specs, MkSpecifier(CHAR));
7772 break;
7773 case 24:
7774 ListAdd(specs, MkSpecifier(_BOOL));
7775 break;
7776 case 2:
7777 ListAdd(specs, MkSpecifier(SHORT));
7778 break;
7779 case 4:
7780 ListAdd(specs, MkSpecifier(INT64));
7781 break;
7782 case 22:
7783 ListAdd(specs, MkSpecifierName(type->isSigned ? "intptr" : "uintptr"));
7784 break;
7785 case 23:
7786 ListAdd(specs, MkSpecifierName(type->isSigned ? "intsize" : "uintsize"));
7787 break;
7788 case 3:
7789 default:
7790 ListAdd(specs, MkSpecifier(INT));
7791 break;
7792 }
7793 }
7794
7795 static void PrintTypeSpecs(struct Type * type, char * string, unsigned int fullName, unsigned int printConst)
7796 {
7797 if(type)
7798 {
7799 if(printConst && type->constant)
7800 strcat(string, "const ");
7801 switch(type->kind)
7802 {
7803 case 8:
7804 {
7805 struct Symbol * c = type->__anon1._class;
7806 unsigned int isObjectBaseClass = !c || !c->string || !strcmp(c->string, "class");
7807
7808 if(type->classObjectType == 2 && isObjectBaseClass)
7809 strcat(string, "typed_object");
7810 else if(type->classObjectType == 3 && isObjectBaseClass)
7811 strcat(string, "any_object");
7812 else
7813 {
7814 if(c && c->string)
7815 strcat(string, (fullName || !c->__anon1.registered) ? c->string : c->__anon1.registered->name);
7816 }
7817 if(type->byReference)
7818 strcat(string, " &");
7819 break;
7820 }
7821 case 0:
7822 strcat(string, "void");
7823 break;
7824 case 3:
7825 strcat(string, type->isSigned ? "int" : "uint");
7826 break;
7827 case 4:
7828 strcat(string, type->isSigned ? "int64" : "uint64");
7829 break;
7830 case 22:
7831 strcat(string, type->isSigned ? "intptr" : "uintptr");
7832 break;
7833 case 23:
7834 strcat(string, type->isSigned ? "intsize" : "uintsize");
7835 break;
7836 case 1:
7837 strcat(string, type->isSigned ? "char" : "byte");
7838 break;
7839 case 24:
7840 strcat(string, "_Bool");
7841 break;
7842 case 2:
7843 strcat(string, type->isSigned ? "short" : "uint16");
7844 break;
7845 case 6:
7846 strcat(string, "float");
7847 break;
7848 case 7:
7849 strcat(string, "double");
7850 break;
7851 case 9:
7852 if(type->__anon1.__anon1.enumName)
7853 {
7854 strcat(string, "struct ");
7855 strcat(string, type->__anon1.__anon1.enumName);
7856 }
7857 else if(type->typeName)
7858 strcat(string, type->typeName);
7859 else
7860 {
7861 struct Type * member;
7862
7863 strcat(string, "struct { ");
7864 for(member = type->__anon1.__anon1.members.first; member; member = member->next)
7865 {
7866 PrintType(member, string, 1, fullName);
7867 strcat(string, "; ");
7868 }
7869 strcat(string, "}");
7870 }
7871 break;
7872 case 10:
7873 if(type->__anon1.__anon1.enumName)
7874 {
7875 strcat(string, "union ");
7876 strcat(string, type->__anon1.__anon1.enumName);
7877 }
7878 else if(type->typeName)
7879 strcat(string, type->typeName);
7880 else
7881 {
7882 strcat(string, "union ");
7883 strcat(string, "(unnamed)");
7884 }
7885 break;
7886 case 15:
7887 if(type->__anon1.__anon1.enumName)
7888 {
7889 strcat(string, "enum ");
7890 strcat(string, type->__anon1.__anon1.enumName);
7891 }
7892 else if(type->typeName)
7893 strcat(string, type->typeName);
7894 else
7895 strcat(string, "int");
7896 break;
7897 case 14:
7898 strcat(string, "...");
7899 break;
7900 case 19:
7901 strcat(string, "subclass(");
7902 strcat(string, type->__anon1._class ? type->__anon1._class->string : "int");
7903 strcat(string, ")");
7904 break;
7905 case 20:
7906 strcat(string, type->__anon1.templateParameter->identifier->string);
7907 break;
7908 case 21:
7909 strcat(string, "thisclass");
7910 break;
7911 case 17:
7912 strcat(string, "__builtin_va_list");
7913 break;
7914 }
7915 }
7916 }
7917
7918 extern char *  __ecereNameSpace__ecere__com__PrintString(struct __ecereNameSpace__ecere__com__Class * class, const void * object, ...);
7919
7920 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__TempFile;
7921
7922 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassImport;
7923
7924 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Symbol;
7925
7926 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_PropertyImport;
7927
7928 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Type;
7929
7930 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplatedType;
7931
7932 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplateParameter;
7933
7934 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_MethodImport;
7935
7936 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_FunctionImport;
7937
7938 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Expression;
7939
7940 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Instantiation;
7941
7942 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__NamedLink64;
7943
7944 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TypeName;
7945
7946 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Context;
7947
7948 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Module;
7949
7950 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__LinkList;
7951
7952 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Application;
7953
7954 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_int;
7955
7956 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Instance;
7957
7958 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__File;
7959
7960 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_External;
7961
7962 struct __ecereNameSpace__ecere__com__Application
7963 {
7964 int argc;
7965 const char * *  argv;
7966 int exitCode;
7967 unsigned int isGUIApp;
7968 struct __ecereNameSpace__ecere__sys__OldList allModules;
7969 char *  parsedCommand;
7970 struct __ecereNameSpace__ecere__com__NameSpace systemNameSpace;
7971 } ecere_gcc_struct;
7972
7973 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)
7974 {
7975 if(*curMember)
7976 {
7977 *curMember = (*curMember)->next;
7978 if(subMemberStackPos && *subMemberStackPos > 0 && subMemberStack[*subMemberStackPos - 1]->type == 1)
7979 {
7980 *curMember = subMemberStack[--(*subMemberStackPos)];
7981 *curMember = (*curMember)->next;
7982 }
7983 while((*curMember) && (*curMember)->isProperty)
7984 *curMember = (*curMember)->next;
7985 if(subMemberStackPos)
7986 {
7987 while((*curMember) && !(*curMember)->isProperty && !(*curMember)->name && ((*curMember)->type == 2 || (*curMember)->type == 1))
7988 {
7989 subMemberStack[(*subMemberStackPos)++] = *curMember;
7990 *curMember = (*curMember)->members.first;
7991 while(*curMember && (*curMember)->isProperty)
7992 *curMember = (*curMember)->next;
7993 }
7994 }
7995 }
7996 while(!*curMember)
7997 {
7998 if(!*curMember)
7999 {
8000 if(subMemberStackPos && *subMemberStackPos)
8001 {
8002 *curMember = subMemberStack[--(*subMemberStackPos)];
8003 *curMember = (*curMember)->next;
8004 }
8005 else
8006 {
8007 struct __ecereNameSpace__ecere__com__Class * lastCurClass = *curClass;
8008
8009 if(*curClass == _class)
8010 break;
8011 for(*curClass = _class; (*curClass)->base != lastCurClass && (*curClass)->base->type != 1000; *curClass = (*curClass)->base)
8012 ;
8013 *curMember = (*curClass)->membersAndProperties.first;
8014 }
8015 while((*curMember) && (*curMember)->isProperty)
8016 *curMember = (*curMember)->next;
8017 if(subMemberStackPos)
8018 {
8019 while((*curMember) && !(*curMember)->isProperty && !(*curMember)->name && ((*curMember)->type == 2 || (*curMember)->type == 1))
8020 {
8021 subMemberStack[(*subMemberStackPos)++] = *curMember;
8022 *curMember = (*curMember)->members.first;
8023 while(*curMember && (*curMember)->isProperty)
8024 *curMember = (*curMember)->next;
8025 }
8026 }
8027 }
8028 }
8029 }
8030
8031 static struct GlobalData * ScanGlobalData(struct __ecereNameSpace__ecere__com__NameSpace * nameSpace, char * name)
8032 {
8033 struct __ecereNameSpace__ecere__sys__BinaryTree * tree = &nameSpace->functions;
8034 struct GlobalData * data = (struct GlobalData *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString((&*tree), name);
8035 struct __ecereNameSpace__ecere__com__NameSpace * child;
8036
8037 if(!data)
8038 {
8039 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)))
8040 {
8041 data = ScanGlobalData(child, name);
8042 if(data)
8043 break;
8044 }
8045 }
8046 return data;
8047 }
8048
8049 static struct Symbol * ScanWithNameSpace(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, const char * nameSpace, const char * name)
8050 {
8051 int nsLen = strlen(nameSpace);
8052 struct Symbol * symbol;
8053
8054 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)))
8055 {
8056 char * s = symbol->string;
8057
8058 if(!strncmp(s, nameSpace, nsLen))
8059 {
8060 int c;
8061 char * namePart;
8062
8063 for(c = strlen(s) - 1; c >= 0; c--)
8064 if(s[c] == ':')
8065 break;
8066 namePart = s + c + 1;
8067 if(!strcmp(namePart, name))
8068 {
8069 return symbol;
8070 }
8071 }
8072 else
8073 break;
8074 }
8075 return (((void *)0));
8076 }
8077
8078 unsigned int GetInt(struct Expression * exp, int * value2)
8079 {
8080 struct Operand op2 = GetOperand(exp);
8081
8082 return GetOpInt(&op2, value2);
8083 }
8084
8085 unsigned int GetUInt(struct Expression * exp, unsigned int * value2)
8086 {
8087 struct Operand op2 = GetOperand(exp);
8088
8089 return GetOpUInt(&op2, value2);
8090 }
8091
8092 unsigned int GetInt64(struct Expression * exp, long long * value2)
8093 {
8094 struct Operand op2 = GetOperand(exp);
8095
8096 return GetOpInt64(&op2, value2);
8097 }
8098
8099 unsigned int GetUInt64(struct Expression * exp, uint64 * value2)
8100 {
8101 struct Operand op2 = GetOperand(exp);
8102
8103 return GetOpUInt64(&op2, value2);
8104 }
8105
8106 unsigned int GetIntPtr(struct Expression * exp, intptr_t * value2)
8107 {
8108 struct Operand op2 = GetOperand(exp);
8109
8110 return GetOpIntPtr(&op2, value2);
8111 }
8112
8113 unsigned int GetUIntPtr(struct Expression * exp, uintptr_t * value2)
8114 {
8115 struct Operand op2 = GetOperand(exp);
8116
8117 return GetOpUIntPtr(&op2, value2);
8118 }
8119
8120 unsigned int GetIntSize(struct Expression * exp, ssize_t * value2)
8121 {
8122 struct Operand op2 = GetOperand(exp);
8123
8124 return GetOpIntSize(&op2, value2);
8125 }
8126
8127 unsigned int GetUIntSize(struct Expression * exp, size_t * value2)
8128 {
8129 struct Operand op2 = GetOperand(exp);
8130
8131 return GetOpUIntSize(&op2, value2);
8132 }
8133
8134 unsigned int GetShort(struct Expression * exp, short * value2)
8135 {
8136 struct Operand op2 = GetOperand(exp);
8137
8138 return GetOpShort(&op2, value2);
8139 }
8140
8141 unsigned int GetUShort(struct Expression * exp, unsigned short * value2)
8142 {
8143 struct Operand op2 = GetOperand(exp);
8144
8145 return GetOpUShort(&op2, value2);
8146 }
8147
8148 unsigned int GetChar(struct Expression * exp, char * value2)
8149 {
8150 struct Operand op2 = GetOperand(exp);
8151
8152 return GetOpChar(&op2, value2);
8153 }
8154
8155 unsigned int GetUChar(struct Expression * exp, unsigned char * value2)
8156 {
8157 struct Operand op2 = GetOperand(exp);
8158
8159 return GetOpUChar(&op2, value2);
8160 }
8161
8162 unsigned int GetFloat(struct Expression * exp, float * value2)
8163 {
8164 struct Operand op2 = GetOperand(exp);
8165
8166 return GetOpFloat(&op2, value2);
8167 }
8168
8169 unsigned int GetDouble(struct Expression * exp, double * value2)
8170 {
8171 struct Operand op2 = GetOperand(exp);
8172
8173 return GetOpDouble(&op2, value2);
8174 }
8175
8176 static void PrePrintType(struct Type * type, char * string, unsigned int fullName, struct Type * parentType, unsigned int printConst)
8177 {
8178 if(type->kind == 12 || type->kind == 13 || type->kind == 11 || type->kind == 16)
8179 {
8180 if((type->kind == 11 || type->kind == 16) && (!parentType || parentType->kind != 13))
8181 PrintAttribs(type, string);
8182 if(printConst && type->constant && (type->kind == 11 || type->kind == 16))
8183 strcat(string, " const");
8184 PrePrintType(type->kind == 16 ? type->__anon1.__anon3.method->dataType : type->__anon1.type, string, fullName, type, printConst);
8185 if(type->kind == 13 && (type->__anon1.type->kind == 12 || type->__anon1.type->kind == 11 || type->__anon1.type->kind == 16))
8186 strcat(string, " (");
8187 if(type->kind == 13)
8188 {
8189 if(type->__anon1.type->kind == 11 || type->__anon1.type->kind == 16)
8190 PrintAttribs(type->__anon1.type, string);
8191 }
8192 if(type->kind == 13)
8193 {
8194 if(type->__anon1.type->kind == 11 || type->__anon1.type->kind == 16 || type->__anon1.type->kind == 12)
8195 strcat(string, "*");
8196 else
8197 strcat(string, " *");
8198 }
8199 if(printConst && type->constant && type->kind == 13)
8200 strcat(string, " const");
8201 }
8202 else
8203 PrintTypeSpecs(type, string, fullName, printConst);
8204 }
8205
8206 void PrintExpression(struct Expression * exp, char * string)
8207 {
8208 {
8209 struct __ecereNameSpace__ecere__com__Instance * f = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
8210 int count;
8211 unsigned int backOutputLineNumbers = outputLineNumbers;
8212
8213 outputLineNumbers = 0;
8214 if(exp)
8215 OutputExpression(exp, f);
8216 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))__extension__ ({
8217 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = f;
8218
8219 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__TempFile->_vTbl;
8220 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(f, 0, 0);
8221 count = strlen(string);
8222 count += ((int (*)(struct __ecereNameSpace__ecere__com__Instance *, void *  buffer, unsigned int size, unsigned int count))__extension__ ({
8223 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = f;
8224
8225 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__TempFile->_vTbl;
8226 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Read])(f, string + count, 1, 1023);
8227 string[count] = '\0';
8228 (__ecereNameSpace__ecere__com__eInstance_DecRef(f), f = 0);
8229 outputLineNumbers = backOutputLineNumbers;
8230 }
8231 }
8232
8233 struct Type * Dereference(struct Type * source)
8234 {
8235 struct Type * type = (((void *)0));
8236
8237 if(source)
8238 {
8239 if(source->kind == 13 || source->kind == 12)
8240 {
8241 type = source->__anon1.type;
8242 source->__anon1.type->refCount++;
8243 }
8244 else if(source->kind == 8 && !strcmp(source->__anon1._class->string, "String"))
8245 {
8246 type = __extension__ ({
8247 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
8248
8249 __ecereInstance1->kind = 1, __ecereInstance1->refCount = 1, __ecereInstance1;
8250 });
8251 }
8252 else if(source->kind == 8 && source->__anon1._class && source->__anon1._class->__anon1.registered && source->__anon1._class->__anon1.registered->type == 5)
8253 {
8254 type = source;
8255 source->refCount++;
8256 }
8257 else
8258 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "cannot dereference type\n", (((void *)0))));
8259 }
8260 return type;
8261 }
8262
8263 static struct Type * Reference(struct Type * source)
8264 {
8265 struct Type * type = (((void *)0));
8266
8267 if(source)
8268 {
8269 type = __extension__ ({
8270 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
8271
8272 __ecereInstance1->kind = 13, __ecereInstance1->__anon1.type = source, __ecereInstance1->refCount = 1, __ecereInstance1;
8273 });
8274 source->refCount++;
8275 }
8276 return type;
8277 }
8278
8279 void ReplaceExpContents(struct Expression * checkedExp, struct Expression * newExp)
8280 {
8281 struct Expression * prev = checkedExp->prev, * next = checkedExp->next;
8282
8283 FreeExpContents(checkedExp);
8284 FreeType(checkedExp->expType);
8285 FreeType(checkedExp->destType);
8286 *checkedExp = *newExp;
8287 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
8288 checkedExp->prev = prev;
8289 checkedExp->next = next;
8290 }
8291
8292 void FinishTemplatesContext(struct Context * context)
8293 {
8294 PopContext(context);
8295 FreeContext(context);
8296 ((context ? (__ecereClass_Context->Destructor ? __ecereClass_Context->Destructor((void *)context) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(context)) : 0), context = 0);
8297 }
8298
8299 static __attribute__((unused)) void UnusedFunction()
8300 {
8301 int a;
8302
8303 ((const char *  (*)(struct __ecereNameSpace__ecere__com__Class *, const void *, char *  tempString, void *  fieldData, unsigned int *  needClass))__ecereClass_int->_vTbl[__ecereVMethodID_class_OnGetString])(__ecereClass_int, (void *)&a, 0, 0, 0);
8304 }
8305
8306 struct Expression * ParseExpressionString(char * expression)
8307 {
8308 parseError = 0;
8309 fileInput = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
8310 ((int (*)(struct __ecereNameSpace__ecere__com__Instance *, const void *  buffer, unsigned int size, unsigned int count))__extension__ ({
8311 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
8312
8313 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
8314 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Write])(fileInput, expression, 1, strlen(expression));
8315 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))__extension__ ({
8316 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
8317
8318 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
8319 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(fileInput, 0, 0);
8320 echoOn = 0;
8321 parsedExpression = (((void *)0));
8322 resetScanner();
8323 expression_yyparse();
8324 (__ecereNameSpace__ecere__com__eInstance_DecRef(fileInput), fileInput = 0);
8325 return parsedExpression;
8326 }
8327
8328 struct __ecereNameSpace__ecere__com__Module
8329 {
8330 struct __ecereNameSpace__ecere__com__Instance * application;
8331 struct __ecereNameSpace__ecere__sys__OldList classes;
8332 struct __ecereNameSpace__ecere__sys__OldList defines;
8333 struct __ecereNameSpace__ecere__sys__OldList functions;
8334 struct __ecereNameSpace__ecere__sys__OldList modules;
8335 struct __ecereNameSpace__ecere__com__Instance * prev;
8336 struct __ecereNameSpace__ecere__com__Instance * next;
8337 const char *  name;
8338 void *  library;
8339 void *  Unload;
8340 int importType;
8341 int origImportType;
8342 struct __ecereNameSpace__ecere__com__NameSpace privateNameSpace;
8343 struct __ecereNameSpace__ecere__com__NameSpace publicNameSpace;
8344 } ecere_gcc_struct;
8345
8346 static struct GlobalData * FindGlobalData(char * name)
8347 {
8348 int start = 0, c;
8349 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
8350
8351 nameSpace = globalData;
8352 for(c = 0; name[c]; c++)
8353 {
8354 if(name[c] == '.' || (name[c] == ':' && name[c + 1] == ':'))
8355 {
8356 struct __ecereNameSpace__ecere__com__NameSpace * newSpace;
8357 char * spaceName = __ecereNameSpace__ecere__com__eSystem_New(sizeof(char) * (c - start + 1));
8358
8359 strncpy(spaceName, name + start, c - start);
8360 spaceName[c - start] = '\0';
8361 newSpace = (struct __ecereNameSpace__ecere__com__NameSpace *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(&(*nameSpace).nameSpaces, spaceName);
8362 (__ecereNameSpace__ecere__com__eSystem_Delete(spaceName), spaceName = 0);
8363 if(!newSpace)
8364 return (((void *)0));
8365 nameSpace = newSpace;
8366 if(name[c] == ':')
8367 c++;
8368 start = c + 1;
8369 }
8370 }
8371 if(c - start)
8372 {
8373 return ScanGlobalData(nameSpace, name + start);
8374 }
8375 return (((void *)0));
8376 }
8377
8378 static struct Symbol * FindWithNameSpace(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, const char * name)
8379 {
8380 int c;
8381 char nameSpace[1024];
8382 const char * namePart;
8383 unsigned int gotColon = 0;
8384
8385 nameSpace[0] = '\0';
8386 for(c = strlen(name) - 1; c >= 0; c--)
8387 if(name[c] == ':')
8388 {
8389 gotColon = 1;
8390 break;
8391 }
8392 namePart = name + c + 1;
8393 while(c >= 0 && name[c] == ':')
8394 c--;
8395 if(c >= 0)
8396 {
8397 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, name);
8398
8399 if(symbol)
8400 return symbol;
8401 memcpy(nameSpace, name, c + 1);
8402 nameSpace[c + 1] = (char)0;
8403 return ScanWithNameSpace(tree, nameSpace, namePart);
8404 }
8405 else if(gotColon)
8406 {
8407 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, namePart);
8408
8409 return symbol;
8410 }
8411 else
8412 {
8413 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, namePart);
8414
8415 if(symbol)
8416 return symbol;
8417 return ScanWithNameSpace(tree, "", namePart);
8418 }
8419 return (((void *)0));
8420 }
8421
8422 static void PrintArraySize(struct Type * arrayType, char * string)
8423 {
8424 char size[256];
8425
8426 size[0] = '\0';
8427 strcat(size, "[");
8428 if(arrayType->__anon1.__anon4.enumClass)
8429 strcat(size, arrayType->__anon1.__anon4.enumClass->string);
8430 else if(arrayType->__anon1.__anon4.arraySizeExp)
8431 PrintExpression(arrayType->__anon1.__anon4.arraySizeExp, size);
8432 strcat(size, "]");
8433 strcat(string, size);
8434 }
8435
8436 void __ecereUnregisterModule_pass15(struct __ecereNameSpace__ecere__com__Instance * module)
8437 {
8438
8439 }
8440
8441 static void PostPrintType(struct Type * type, char * string, unsigned int fullName)
8442 {
8443 if(type->kind == 13 && (type->__anon1.type->kind == 12 || type->__anon1.type->kind == 11 || type->__anon1.type->kind == 16))
8444 strcat(string, ")");
8445 if(type->kind == 12)
8446 PrintArraySize(type, string);
8447 else if(type->kind == 11)
8448 {
8449 struct Type * param;
8450
8451 strcat(string, "(");
8452 for(param = type->__anon1.__anon2.params.first; param; param = param->next)
8453 {
8454 PrintType(param, string, 1, fullName);
8455 if(param->next)
8456 strcat(string, ", ");
8457 }
8458 strcat(string, ")");
8459 }
8460 if(type->kind == 12 || type->kind == 13 || type->kind == 11 || type->kind == 16)
8461 PostPrintType(type->kind == 16 ? type->__anon1.__anon3.method->dataType : type->__anon1.type, string, fullName);
8462 }
8463
8464 static void _PrintType(struct Type * type, char * string, unsigned int printName, unsigned int fullName, unsigned int printConst)
8465 {
8466 PrePrintType(type, string, fullName, (((void *)0)), printConst);
8467 if(type->__anon1.__anon2.thisClass || (printName && type->name && type->name[0]))
8468 strcat(string, " ");
8469 if((type->__anon1.__anon2.thisClass || type->__anon1.__anon2.staticMethod))
8470 {
8471 struct Symbol * _class = type->__anon1.__anon2.thisClass;
8472
8473 if((type->classObjectType == 2 || type->classObjectType == 1) || (_class && !strcmp(_class->string, "class")))
8474 {
8475 if(type->classObjectType == 1)
8476 strcat(string, "class");
8477 else
8478 strcat(string, type->byReference ? "typed_object&" : "typed_object");
8479 }
8480 else if(_class && _class->string)
8481 {
8482 char * s = _class->string;
8483
8484 if(fullName)
8485 strcat(string, s);
8486 else
8487 {
8488 char * name = __ecereNameSpace__ecere__sys__RSearchString(s, "::", strlen(s), 1, 0);
8489
8490 if(name)
8491 name += 2;
8492 else
8493 name = s;
8494 strcat(string, name);
8495 }
8496 }
8497 strcat(string, "::");
8498 }
8499 if(printName && type->name)
8500 PrintName(type, string, fullName);
8501 PostPrintType(type, string, fullName);
8502 if(type->bitFieldCount)
8503 {
8504 char count[100];
8505
8506 sprintf(count, ":%d", type->bitFieldCount);
8507 strcat(string, count);
8508 }
8509 }
8510
8511 struct Conversion;
8512
8513 struct Conversion
8514 {
8515 struct Conversion * prev, * next;
8516 struct __ecereNameSpace__ecere__com__Property * convert;
8517 unsigned int isGet;
8518 struct Type * resultType;
8519 } ecere_gcc_struct;
8520
8521 static void FreeConvert(struct Conversion * convert)
8522 {
8523 if(convert->resultType)
8524 FreeType(convert->resultType);
8525 }
8526
8527 struct Enumerator;
8528
8529 struct Enumerator
8530 {
8531 struct Enumerator * prev;
8532 struct Enumerator * next;
8533 struct Location loc;
8534 struct Identifier * id;
8535 struct Expression * exp;
8536 } ecere_gcc_struct;
8537
8538 struct AsmField;
8539
8540 struct AsmField
8541 {
8542 struct AsmField * prev;
8543 struct AsmField * next;
8544 struct Location loc;
8545 char *  command;
8546 struct Expression * expression;
8547 struct Identifier * symbolic;
8548 } ecere_gcc_struct;
8549
8550 struct ClassDefinition;
8551
8552 struct Context
8553 {
8554 struct Context * parent;
8555 struct __ecereNameSpace__ecere__sys__BinaryTree types;
8556 struct __ecereNameSpace__ecere__sys__BinaryTree classes;
8557 struct __ecereNameSpace__ecere__sys__BinaryTree symbols;
8558 struct __ecereNameSpace__ecere__sys__BinaryTree structSymbols;
8559 int nextID;
8560 int simpleID;
8561 struct __ecereNameSpace__ecere__sys__BinaryTree templateTypes;
8562 struct ClassDefinition * classDef;
8563 unsigned int templateTypesOnly;
8564 unsigned int hasNameSpace;
8565 } ecere_gcc_struct;
8566
8567 struct External
8568 {
8569 struct External * prev;
8570 struct External * next;
8571 struct Location loc;
8572 int type;
8573 struct Symbol * symbol;
8574 union
8575 {
8576 struct FunctionDefinition * function;
8577 struct ClassDefinition * _class;
8578 struct Declaration * declaration;
8579 char *  importString;
8580 struct Identifier * id;
8581 struct DBTableDef * table;
8582 } ecere_gcc_struct __anon1;
8583 int importType;
8584 struct External * fwdDecl;
8585 struct __ecereNameSpace__ecere__com__Instance * outgoing;
8586 struct __ecereNameSpace__ecere__com__Instance * incoming;
8587 int nonBreakableIncoming;
8588 } ecere_gcc_struct;
8589
8590 struct ClassDefinition
8591 {
8592 struct ClassDefinition * prev;
8593 struct ClassDefinition * next;
8594 struct Location loc;
8595 struct Specifier * _class;
8596 struct __ecereNameSpace__ecere__sys__OldList *  baseSpecs;
8597 struct __ecereNameSpace__ecere__sys__OldList *  definitions;
8598 struct Symbol * symbol;
8599 struct Location blockStart;
8600 struct Location nameLoc;
8601 int declMode;
8602 unsigned int deleteWatchable;
8603 } ecere_gcc_struct;
8604
8605 void __ecereMethod_External_CreateUniqueEdge(struct External * this, struct External * from, unsigned int soft);
8606
8607 void __ecereMethod_External_CreateEdge(struct External * this, struct External * from, unsigned int soft);
8608
8609 void DeclareGlobalData(struct External * neededFor, struct GlobalData * data)
8610 {
8611 struct Symbol * symbol = data->symbol;
8612
8613 if(!symbol || !symbol->__anon2.__anon1.pointerExternal)
8614 {
8615 if(inCompiler)
8616 {
8617 if(!symbol)
8618 symbol = data->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
8619 }
8620 if(!data->dataType)
8621 data->dataType = ProcessTypeString(data->dataTypeString, 0);
8622 if(inCompiler)
8623 {
8624 struct Declaration * decl;
8625 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
8626 struct Declarator * d;
8627 struct External * external;
8628
8629 specifiers = MkList();
8630 declarators = MkList();
8631 ListAdd(specifiers, MkSpecifier(EXTERN));
8632 d = MkDeclaratorIdentifier(MkIdentifier(data->fullName));
8633 d = SpecDeclFromString(data->dataTypeString, specifiers, d);
8634 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
8635 decl = MkDeclaration(specifiers, declarators);
8636 external = MkExternalDeclaration(decl);
8637 if(curExternal)
8638 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
8639 external->symbol = symbol;
8640 symbol->__anon2.__anon1.pointerExternal = external;
8641 DeclareType(external, data->dataType, 1, 1);
8642 }
8643 }
8644 if(inCompiler && neededFor && symbol && symbol->__anon2.__anon1.pointerExternal)
8645 __ecereMethod_External_CreateUniqueEdge(neededFor, symbol->__anon2.__anon1.pointerExternal, 0);
8646 }
8647
8648 struct Symbol * FindSymbol(const char * name, struct Context * startContext, struct Context * endContext, unsigned int isStruct, unsigned int globalNameSpace)
8649 {
8650 struct Context * ctx;
8651 struct Symbol * symbol = (((void *)0));
8652
8653 for(ctx = startContext; ctx && !symbol; ctx = ctx->parent)
8654 {
8655 if(ctx == globalContext && !globalNameSpace && ctx->hasNameSpace)
8656 {
8657 symbol = (((void *)0));
8658 if(thisNameSpace)
8659 {
8660 char curName[1024];
8661
8662 strcpy(curName, thisNameSpace);
8663 strcat(curName, "::");
8664 strcat(curName, name);
8665 symbol = FindWithNameSpace(isStruct ? &ctx->structSymbols : &ctx->symbols, curName);
8666 }
8667 if(!symbol)
8668 symbol = FindWithNameSpace(isStruct ? &ctx->structSymbols : &ctx->symbols, name);
8669 }
8670 else
8671 symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString((isStruct ? &ctx->structSymbols : &ctx->symbols), name);
8672 if(symbol || ctx == endContext)
8673 break;
8674 }
8675 if(inCompiler && symbol && ctx == globalContext && symbol->__anon2.__anon1.pointerExternal && curExternal && symbol->__anon2.__anon1.pointerExternal != curExternal)
8676 __ecereMethod_External_CreateUniqueEdge(curExternal, symbol->__anon2.__anon1.pointerExternal, symbol->__anon2.__anon1.pointerExternal->type == 0);
8677 return symbol;
8678 }
8679
8680 struct PropertyDef;
8681
8682 struct ClassDef
8683 {
8684 struct ClassDef * prev;
8685 struct ClassDef * next;
8686 struct Location loc;
8687 int type;
8688 union
8689 {
8690 struct Declaration * decl;
8691 struct ClassFunction * function;
8692 struct __ecereNameSpace__ecere__sys__OldList *  defProperties;
8693 struct PropertyDef * propertyDef;
8694 struct PropertyWatch * propertyWatch;
8695 char *  designer;
8696 struct Identifier * defaultProperty;
8697 struct
8698 {
8699 struct Identifier * id;
8700 struct Initializer * initializer;
8701 } ecere_gcc_struct __anon1;
8702 } ecere_gcc_struct __anon1;
8703 int memberAccess;
8704 void *  object;
8705 } ecere_gcc_struct;
8706
8707 struct PropertyDef
8708 {
8709 struct PropertyDef * prev;
8710 struct PropertyDef * next;
8711 struct Location loc;
8712 struct __ecereNameSpace__ecere__sys__OldList *  specifiers;
8713 struct Declarator * declarator;
8714 struct Identifier * id;
8715 struct Statement * getStmt;
8716 struct Statement * setStmt;
8717 struct Statement * issetStmt;
8718 struct Symbol * symbol;
8719 struct Expression * category;
8720 struct
8721 {
8722 unsigned int conversion : 1;
8723 unsigned int isWatchable : 1;
8724 unsigned int isDBProp : 1;
8725 } ecere_gcc_struct __anon1;
8726 } ecere_gcc_struct;
8727
8728 static void IdentifyAnonStructs(struct __ecereNameSpace__ecere__sys__OldList * definitions)
8729 {
8730 struct ClassDef * def;
8731 int anonID = 1;
8732
8733 for(def = (*definitions).first; def; def = def->next)
8734 {
8735 if(def->type == 2)
8736 {
8737 struct Declaration * decl = def->__anon1.decl;
8738
8739 if(decl && decl->__anon1.__anon1.specifiers)
8740 {
8741 struct Specifier * spec;
8742 unsigned int isStruct = 0;
8743
8744 for(spec = (*decl->__anon1.__anon1.specifiers).first; spec; spec = spec->next)
8745 {
8746 if(spec->type == 3 || spec->type == 4)
8747 {
8748 if(spec->__anon1.__anon2.definitions)
8749 IdentifyAnonStructs(spec->__anon1.__anon2.definitions);
8750 isStruct = 1;
8751 }
8752 }
8753 if(isStruct)
8754 {
8755 struct Declarator * d = (((void *)0));
8756
8757 if(decl->__anon1.__anon1.declarators)
8758 {
8759 for(d = (*decl->__anon1.__anon1.declarators).first; d; d = d->next)
8760 {
8761 struct Identifier * idDecl = GetDeclId(d);
8762
8763 if(idDecl)
8764 break;
8765 }
8766 }
8767 if(!d)
8768 {
8769 char id[100];
8770
8771 sprintf(id, "__anon%d", anonID++);
8772 if(!decl->__anon1.__anon1.declarators)
8773 decl->__anon1.__anon1.declarators = MkList();
8774 ListAdd(decl->__anon1.__anon1.declarators, MkDeclaratorIdentifier(MkIdentifier(id)));
8775 }
8776 }
8777 }
8778 }
8779 }
8780 }
8781
8782 struct MemberInit;
8783
8784 typedef union YYSTYPE
8785 {
8786 int specifierType;
8787 int i;
8788 int declMode;
8789 struct Identifier * id;
8790 struct Expression * exp;
8791 struct Specifier * specifier;
8792 struct __ecereNameSpace__ecere__sys__OldList * list;
8793 struct Enumerator * enumerator;
8794 struct Declarator * declarator;
8795 struct Pointer * pointer;
8796 struct Initializer * initializer;
8797 struct InitDeclarator * initDeclarator;
8798 struct TypeName * typeName;
8799 struct Declaration * declaration;
8800 struct Statement * stmt;
8801 struct FunctionDefinition * function;
8802 struct External * external;
8803 struct Context * context;
8804 struct AsmField * asmField;
8805 struct Attrib * attrib;
8806 struct ExtDecl * extDecl;
8807 struct Attribute * attribute;
8808 struct Instantiation * instance;
8809 struct MembersInit * membersInit;
8810 struct MemberInit * memberInit;
8811 struct ClassFunction * classFunction;
8812 struct ClassDefinition * _class;
8813 struct ClassDef * classDef;
8814 struct PropertyDef * prop;
8815 char * string;
8816 struct Symbol * symbol;
8817 struct PropertyWatch * propertyWatch;
8818 struct TemplateParameter * templateParameter;
8819 struct TemplateArgument * templateArgument;
8820 struct TemplateDatatype * templateDatatype;
8821 struct DBTableEntry * dbtableEntry;
8822 struct DBIndexItem * dbindexItem;
8823 struct DBTableDef * dbtableDef;
8824 } ecere_gcc_struct YYSTYPE;
8825
8826 extern YYSTYPE yylval;
8827
8828 struct MemberInit
8829 {
8830 struct MemberInit * prev;
8831 struct MemberInit * next;
8832 struct Location loc;
8833 struct Location realLoc;
8834 struct __ecereNameSpace__ecere__sys__OldList *  identifiers;
8835 struct Initializer * initializer;
8836 unsigned int used;
8837 unsigned int variable;
8838 unsigned int takeOutExp;
8839 } ecere_gcc_struct;
8840
8841 extern struct MemberInit * MkMemberInit(struct __ecereNameSpace__ecere__sys__OldList * ids, struct Initializer * initializer);
8842
8843 struct __ecereNameSpace__ecere__com__ClassTemplateParameter;
8844
8845 struct __ecereNameSpace__ecere__com__ClassTemplateParameter
8846 {
8847 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * prev;
8848 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * next;
8849 const char *  name;
8850 int type;
8851 union
8852 {
8853 const char *  dataTypeString;
8854 int memberType;
8855 } ecere_gcc_struct __anon1;
8856 struct __ecereNameSpace__ecere__com__ClassTemplateArgument defaultArg;
8857 void *  param;
8858 } ecere_gcc_struct;
8859
8860 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * FindTemplateArg(struct __ecereNameSpace__ecere__com__Class * _class, struct TemplateParameter * param)
8861 {
8862 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * arg = (((void *)0));
8863 int id = 0;
8864 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
8865 struct __ecereNameSpace__ecere__com__Class * sClass;
8866
8867 for(sClass = _class; sClass; sClass = sClass->base)
8868 {
8869 id = 0;
8870 if(sClass->templateClass)
8871 sClass = sClass->templateClass;
8872 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
8873 {
8874 if(curParam->type == 0 && !strcmp(param->identifier->string, curParam->name))
8875 {
8876 for(sClass = sClass->base; sClass; sClass = sClass->base)
8877 {
8878 if(sClass->templateClass)
8879 sClass = sClass->templateClass;
8880 id += sClass->templateParams.count;
8881 }
8882 break;
8883 }
8884 id++;
8885 }
8886 if(curParam)
8887 break;
8888 }
8889 if(curParam)
8890 {
8891 arg = &_class->templateArgs[id];
8892 if(arg && param->type == 0)
8893 (*arg).__anon1.__anon1.dataTypeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, (*arg).__anon1.__anon1.dataTypeString);
8894 }
8895 return arg;
8896 }
8897
8898 struct Context * SetupTemplatesContext(struct __ecereNameSpace__ecere__com__Class * _class)
8899 {
8900 struct Context * context = PushContext();
8901
8902 context->templateTypesOnly = 1;
8903 if(_class->symbol && ((struct Symbol *)_class->symbol)->templateParams)
8904 {
8905 struct TemplateParameter * param = (*((struct Symbol *)_class->symbol)->templateParams).first;
8906
8907 for(; param; param = param->next)
8908 {
8909 if(param->type == 0 && param->identifier)
8910 {
8911 struct TemplatedType * type = (type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TemplatedType), type->key = (uintptr_t)param->identifier->string, type->param = param, type);
8912
8913 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&curContext->templateTypes, (struct __ecereNameSpace__ecere__sys__BTNode *)type);
8914 }
8915 }
8916 }
8917 else if(_class)
8918 {
8919 struct __ecereNameSpace__ecere__com__Class * sClass;
8920
8921 for(sClass = _class; sClass; sClass = sClass->base)
8922 {
8923 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * p;
8924
8925 for(p = sClass->templateParams.first; p; p = p->next)
8926 {
8927 if(p->type == 0)
8928 {
8929 struct TemplateParameter * param = p->param;
8930 struct TemplatedType * type;
8931
8932 if(!param)
8933 {
8934 p->param = param = __extension__ ({
8935 struct TemplateParameter * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TemplateParameter);
8936
8937 __ecereInstance1->identifier = MkIdentifier(p->name), __ecereInstance1->type = p->type, __ecereInstance1->dataTypeString = p->__anon1.dataTypeString, __ecereInstance1;
8938 });
8939 }
8940 type = __extension__ ({
8941 struct TemplatedType * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TemplatedType);
8942
8943 __ecereInstance1->key = (uintptr_t)p->name, __ecereInstance1->param = param, __ecereInstance1;
8944 });
8945 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&curContext->templateTypes, (struct __ecereNameSpace__ecere__sys__BTNode *)type);
8946 }
8947 }
8948 }
8949 }
8950 return context;
8951 }
8952
8953 char * ReplaceThisClass(struct __ecereNameSpace__ecere__com__Class * _class)
8954 {
8955 if(thisClassParams && _class->templateParams.count && !_class->templateClass)
8956 {
8957 unsigned int first = 1;
8958 int p = 0;
8959 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
8960 int lastParam = -1;
8961 char className[1024];
8962
8963 strcpy(className, _class->fullName);
8964 for(param = _class->templateParams.first; param; param = param->next)
8965 {
8966 {
8967 if(first)
8968 strcat(className, "<");
8969 if(!first)
8970 strcat(className, ", ");
8971 if(lastParam + 1 != p)
8972 {
8973 strcat(className, param->name);
8974 strcat(className, " = ");
8975 }
8976 strcat(className, param->name);
8977 first = 0;
8978 lastParam = p;
8979 }
8980 p++;
8981 }
8982 if(!first)
8983 {
8984 int len = strlen(className);
8985
8986 if(className[len - 1] == '>')
8987 className[len++] = ' ';
8988 className[len++] = '>';
8989 className[len++] = '\0';
8990 }
8991 return __ecereNameSpace__ecere__sys__CopyString(className);
8992 }
8993 else
8994 return __ecereNameSpace__ecere__sys__CopyString(_class->fullName);
8995 }
8996
8997 struct Type * ReplaceThisClassType(struct __ecereNameSpace__ecere__com__Class * _class)
8998 {
8999 struct Type * type;
9000
9001 if(thisClassParams && _class->templateParams.count && !_class->templateClass)
9002 {
9003 unsigned int first = 1;
9004 int p = 0;
9005 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
9006 int lastParam = -1;
9007 char className[1024];
9008
9009 strcpy(className, _class->fullName);
9010 for(param = _class->templateParams.first; param; param = param->next)
9011 {
9012 {
9013 if(first)
9014 strcat(className, "<");
9015 if(!first)
9016 strcat(className, ", ");
9017 if(lastParam + 1 != p)
9018 {
9019 strcat(className, param->name);
9020 strcat(className, " = ");
9021 }
9022 strcat(className, param->name);
9023 first = 0;
9024 lastParam = p;
9025 }
9026 p++;
9027 }
9028 if(!first)
9029 {
9030 int len = strlen(className);
9031
9032 if(className[len - 1] == '>')
9033 className[len++] = ' ';
9034 className[len++] = '>';
9035 className[len++] = '\0';
9036 }
9037 type = MkClassType(className);
9038 }
9039 else
9040 {
9041 type = MkClassType(_class->fullName);
9042 }
9043 return type;
9044 }
9045
9046 static int DeclareMembers(struct External * neededBy, struct __ecereNameSpace__ecere__com__Class * _class, unsigned int isMember)
9047 {
9048 struct __ecereNameSpace__ecere__com__DataMember * topMember = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
9049 struct __ecereNameSpace__ecere__com__DataMember * member;
9050 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
9051
9052 if(!isMember && (_class->type == 1 || _class->type == 5) && _class->base->type != 1000)
9053 DeclareMembers(neededBy, _class->base, 0);
9054 for(member = isMember ? topMember->members.first : _class->membersAndProperties.first; member; member = member->next)
9055 {
9056 if(!member->isProperty)
9057 {
9058 switch(member->type)
9059 {
9060 case 0:
9061 {
9062 if(!member->dataType && member->dataTypeString)
9063 member->dataType = ProcessTypeString(member->dataTypeString, 0);
9064 if(member->dataType)
9065 DeclareType(neededBy, member->dataType, 1, 0);
9066 break;
9067 }
9068 case 1:
9069 case 2:
9070 {
9071 DeclareMembers(neededBy, (struct __ecereNameSpace__ecere__com__Class *)member, 1);
9072 break;
9073 }
9074 }
9075 }
9076 }
9077 if(context)
9078 FinishTemplatesContext(context);
9079 return topMember ? topMember->memberID : _class->memberID;
9080 }
9081
9082 void ProcessMethodType(struct __ecereNameSpace__ecere__com__Method * method)
9083 {
9084 if(!method->dataType)
9085 {
9086 struct Context * context = SetupTemplatesContext(method->_class);
9087
9088 method->dataType = ProcessTypeString(method->dataTypeString, 0);
9089 FinishTemplatesContext(context);
9090 if(method->type != 1 && method->dataType)
9091 {
9092 if(!method->dataType->__anon1.__anon2.thisClass && !method->dataType->__anon1.__anon2.staticMethod)
9093 {
9094 if(!method->_class->symbol)
9095 method->_class->symbol = FindClass(method->_class->fullName);
9096 method->dataType->__anon1.__anon2.thisClass = method->_class->symbol;
9097 }
9098 }
9099 }
9100 }
9101
9102 void ProcessPropertyType(struct __ecereNameSpace__ecere__com__Property * prop)
9103 {
9104 if(!prop->dataType)
9105 {
9106 struct Context * context = SetupTemplatesContext(prop->_class);
9107
9108 prop->dataType = ProcessTypeString(prop->dataTypeString, 0);
9109 FinishTemplatesContext(context);
9110 }
9111 }
9112
9113 void ReplaceThisClassSpecifiers(struct __ecereNameSpace__ecere__sys__OldList * specs, struct __ecereNameSpace__ecere__com__Class * _class)
9114 {
9115 if(specs != (((void *)0)) && _class)
9116 {
9117 struct Specifier * spec;
9118
9119 for(spec = specs->first; spec; spec = spec->next)
9120 {
9121 if(spec->type == 0 && spec->__anon1.specifier == THISCLASS)
9122 {
9123 spec->type = 1;
9124 spec->__anon1.__anon1.name = ReplaceThisClass(_class);
9125 spec->__anon1.__anon1.symbol = FindClass(spec->__anon1.__anon1.name);
9126 }
9127 }
9128 }
9129 }
9130
9131 static unsigned int ResolveIdWithClass(struct Expression * exp, struct __ecereNameSpace__ecere__com__Class * _class, unsigned int skipIDClassCheck)
9132 {
9133 struct Identifier * id = exp->__anon1.__anon1.identifier;
9134 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
9135 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
9136 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
9137 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
9138
9139 if(_class && _class->type == 4)
9140 {
9141 struct __ecereNameSpace__ecere__sys__NamedLink64 * value = (((void *)0));
9142 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
9143
9144 if(enumClass)
9145 {
9146 struct __ecereNameSpace__ecere__com__Class * baseClass;
9147
9148 for(baseClass = _class; baseClass && baseClass->type == 4; baseClass = baseClass->base)
9149 {
9150 struct __ecereNameSpace__ecere__com__EnumClassData * e = (baseClass ? ((void *)(((char *)baseClass->data) + enumClass->offsetClass)) : (((void *)0)));
9151
9152 for(value = e->values.first; value; value = value->next)
9153 {
9154 if(!strcmp(value->name, id->string))
9155 break;
9156 }
9157 if(value)
9158 {
9159 exp->isConstant = 1;
9160 if(inCompiler || inPreCompiler || inDebugger)
9161 {
9162 char constant[256];
9163
9164 FreeExpContents(exp);
9165 exp->type = 2;
9166 if(!strcmp(baseClass->dataTypeString, "int") || !strcmp(baseClass->dataTypeString, "int64") || !strcmp(baseClass->dataTypeString, "char") || !strcmp(baseClass->dataTypeString, "short"))
9167 sprintf(constant, ((__runtimePlatform == 1) ? "%I64d" : "%lld"), value->data);
9168 else
9169 sprintf(constant, ((__runtimePlatform == 1) ? "0x%I64X" : "0x%llX"), value->data);
9170 exp->__anon1.__anon1.constant = __ecereNameSpace__ecere__sys__CopyString(constant);
9171 }
9172 exp->expType = MkClassType(baseClass->fullName);
9173 break;
9174 }
9175 }
9176 }
9177 if(value)
9178 return 1;
9179 }
9180 if((method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule)))
9181 {
9182 ProcessMethodType(method);
9183 exp->expType = __extension__ ({
9184 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
9185
9186 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 16, __ecereInstance1->__anon1.__anon3.method = method, __ecereInstance1->__anon1.__anon3.methodClass = (skipIDClassCheck || (id && id->_class)) ? _class : (((void *)0)), __ecereInstance1;
9187 });
9188 return 1;
9189 }
9190 else if((prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule)))
9191 {
9192 if(!prop->dataType)
9193 ProcessPropertyType(prop);
9194 exp->expType = prop->dataType;
9195 if(prop->dataType)
9196 prop->dataType->refCount++;
9197 return 1;
9198 }
9199 else if((member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)))))
9200 {
9201 if(!member->dataType)
9202 member->dataType = ProcessTypeString(member->dataTypeString, 0);
9203 exp->expType = member->dataType;
9204 if(member->dataType)
9205 member->dataType->refCount++;
9206 return 1;
9207 }
9208 else if((classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(_class, id->string)))
9209 {
9210 if(!classProp->dataType)
9211 classProp->dataType = ProcessTypeString(classProp->dataTypeString, 0);
9212 if(classProp->constant)
9213 {
9214 FreeExpContents(exp);
9215 exp->isConstant = 1;
9216 if(classProp->dataType->kind == 13 && classProp->dataType->__anon1.type->kind == 1)
9217 {
9218 exp->type = 3;
9219 exp->__anon1.__anon1.constant = QMkString((char *)(uintptr_t)classProp->Get(_class));
9220 }
9221 else
9222 {
9223 char constant[256];
9224
9225 exp->type = 2;
9226 sprintf(constant, "%d", (int)classProp->Get(_class));
9227 exp->__anon1.__anon1.constant = __ecereNameSpace__ecere__sys__CopyString(constant);
9228 }
9229 }
9230 else
9231 {
9232 }
9233 exp->expType = classProp->dataType;
9234 if(classProp->dataType)
9235 classProp->dataType->refCount++;
9236 return 1;
9237 }
9238 return 0;
9239 }
9240
9241 void DeclareProperty(struct External * neededBy, struct __ecereNameSpace__ecere__com__Property * prop, char * setName, char * getName)
9242 {
9243 struct Symbol * symbol = prop->symbol;
9244 unsigned int imported = 0;
9245 unsigned int dllImport = 0;
9246 struct External * structExternal = (((void *)0));
9247 struct External * instExternal = (((void *)0));
9248
9249 strcpy(setName, "__ecereProp_");
9250 FullClassNameCat(setName, prop->_class->fullName, 0);
9251 strcat(setName, "_Set_");
9252 FullClassNameCat(setName, prop->name, 1);
9253 strcpy(getName, "__ecereProp_");
9254 FullClassNameCat(getName, prop->_class->fullName, 0);
9255 strcat(getName, "_Get_");
9256 FullClassNameCat(getName, prop->name, 1);
9257 if(!symbol || symbol->_import)
9258 {
9259 if(!symbol)
9260 {
9261 struct Symbol * classSym;
9262
9263 if(!prop->_class->symbol)
9264 prop->_class->symbol = FindClass(prop->_class->fullName);
9265 classSym = prop->_class->symbol;
9266 if(classSym && !classSym->_import)
9267 {
9268 struct ModuleImport * module;
9269
9270 if(prop->_class->module)
9271 module = FindModule(prop->_class->module);
9272 else
9273 module = mainModule;
9274 classSym->_import = __extension__ ({
9275 struct ClassImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_ClassImport);
9276
9277 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(prop->_class->fullName), __ecereInstance1->isRemote = prop->_class->isRemote, __ecereInstance1;
9278 });
9279 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->classes, classSym->_import);
9280 }
9281 symbol = prop->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
9282 symbol->_import = (struct ClassImport *)__extension__ ({
9283 struct PropertyImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_PropertyImport);
9284
9285 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(prop->name), __ecereInstance1->isVirtual = 0, __ecereInstance1->hasSet = prop->Set ? 1 : 0, __ecereInstance1->hasGet = prop->Get ? 1 : 0, __ecereInstance1;
9286 });
9287 if(classSym)
9288 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&classSym->_import->properties, symbol->_import);
9289 }
9290 imported = 1;
9291 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)
9292 dllImport = 1;
9293 }
9294 if(!symbol->type)
9295 {
9296 struct Context * context = SetupTemplatesContext(prop->_class);
9297
9298 symbol->type = ProcessTypeString(prop->dataTypeString, 0);
9299 FinishTemplatesContext(context);
9300 }
9301 if((prop->Get && !symbol->__anon2.__anon2.externalGet) || (prop->Set && !symbol->__anon2.__anon2.externalSet))
9302 {
9303 if(prop->_class->type == 0 && prop->_class->structSize)
9304 instExternal = DeclareStruct((((void *)0)), "ecere::com::Instance", 0, 1);
9305 structExternal = DeclareStruct((((void *)0)), prop->_class->fullName, prop->_class->type != 1, 0);
9306 }
9307 if(prop->Get && !symbol->__anon2.__anon2.externalGet)
9308 {
9309 struct Declaration * decl;
9310 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
9311 struct Declarator * d;
9312 struct __ecereNameSpace__ecere__sys__OldList * params;
9313 struct Specifier * spec = (((void *)0));
9314 struct External * external;
9315 struct Declarator * typeDecl;
9316 unsigned int simple = 0;
9317 unsigned int needReference;
9318
9319 specifiers = MkList();
9320 declarators = MkList();
9321 params = MkList();
9322 ListAdd(params, MkTypeName(MkListOne(MkSpecifierName(prop->_class->fullName)), MkDeclaratorIdentifier(MkIdentifier("this"))));
9323 d = MkDeclaratorIdentifier(MkIdentifier(getName));
9324 if(dllImport)
9325 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
9326 {
9327 struct Context * context = SetupTemplatesContext(prop->_class);
9328
9329 typeDecl = SpecDeclFromString(prop->dataTypeString, specifiers, (((void *)0)));
9330 FinishTemplatesContext(context);
9331 }
9332 needReference = !typeDecl || typeDecl->type == 1;
9333 for(spec = (*specifiers).first; spec; spec = spec->next)
9334 {
9335 if(spec->type == 1)
9336 {
9337 struct Symbol * classSym = spec->__anon1.__anon1.symbol;
9338
9339 if(needReference)
9340 {
9341 symbol->_class = classSym->__anon1.registered;
9342 if(classSym->__anon1.registered && classSym->__anon1.registered->type == 1)
9343 simple = 1;
9344 }
9345 break;
9346 }
9347 }
9348 if(!simple)
9349 d = PlugDeclarator(typeDecl, d);
9350 else
9351 {
9352 ListAdd(params, MkTypeName(specifiers, PlugDeclarator(typeDecl, MkDeclaratorIdentifier(MkIdentifier("value")))));
9353 specifiers = MkList();
9354 }
9355 d = MkDeclaratorFunction(d, params);
9356 if(dllImport)
9357 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
9358 else if(prop->_class->symbol && ((struct Symbol *)prop->_class->symbol)->isStatic)
9359 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
9360 if(simple)
9361 ListAdd(specifiers, MkSpecifier(VOID));
9362 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
9363 decl = MkDeclaration(specifiers, declarators);
9364 external = MkExternalDeclaration(decl);
9365 if(structExternal)
9366 __ecereMethod_External_CreateEdge(external, structExternal, 0);
9367 if(instExternal)
9368 __ecereMethod_External_CreateEdge(external, instExternal, 0);
9369 if(spec)
9370 DeclareStruct(external, spec->__anon1.__anon1.name, 0, needReference);
9371 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*ast), external);
9372 external->symbol = symbol;
9373 symbol->__anon2.__anon2.externalGet = external;
9374 ReplaceThisClassSpecifiers(specifiers, prop->_class);
9375 if(typeDecl)
9376 FreeDeclarator(typeDecl);
9377 }
9378 if(prop->Set && !symbol->__anon2.__anon2.externalSet)
9379 {
9380 struct Declaration * decl;
9381 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
9382 struct Declarator * d;
9383 struct __ecereNameSpace__ecere__sys__OldList * params;
9384 struct Specifier * spec = (((void *)0));
9385 struct External * external;
9386 struct Declarator * typeDecl;
9387 unsigned int needReference;
9388
9389 declarators = MkList();
9390 params = MkList();
9391 if(!prop->conversion || prop->_class->type == 1)
9392 {
9393 ListAdd(params, MkTypeName(MkListOne(MkSpecifierName(prop->_class->fullName)), MkDeclaratorIdentifier(MkIdentifier("this"))));
9394 }
9395 specifiers = MkList();
9396 {
9397 struct Context * context = SetupTemplatesContext(prop->_class);
9398
9399 typeDecl = d = SpecDeclFromString(prop->dataTypeString, specifiers, MkDeclaratorIdentifier(MkIdentifier("value")));
9400 FinishTemplatesContext(context);
9401 }
9402 if(!strcmp(prop->_class->base->fullName, "eda::Row") || !strcmp(prop->_class->base->fullName, "eda::Id"))
9403 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(CONST));
9404 ListAdd(params, MkTypeName(specifiers, d));
9405 d = MkDeclaratorIdentifier(MkIdentifier(setName));
9406 if(dllImport)
9407 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
9408 d = MkDeclaratorFunction(d, params);
9409 needReference = !typeDecl || typeDecl->type == 1;
9410 for(spec = (*specifiers).first; spec; spec = spec->next)
9411 {
9412 if(spec->type == 1)
9413 {
9414 struct Symbol * classSym = spec->__anon1.__anon1.symbol;
9415
9416 if(needReference)
9417 symbol->_class = classSym->__anon1.registered;
9418 break;
9419 }
9420 }
9421 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
9422 specifiers = MkList();
9423 if(dllImport)
9424 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
9425 else if(prop->_class->symbol && ((struct Symbol *)prop->_class->symbol)->isStatic)
9426 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
9427 if(!prop->conversion || prop->_class->type == 1)
9428 ListAdd(specifiers, MkSpecifier(VOID));
9429 else
9430 ListAdd(specifiers, MkSpecifierName(prop->_class->fullName));
9431 decl = MkDeclaration(specifiers, declarators);
9432 external = MkExternalDeclaration(decl);
9433 if(structExternal)
9434 __ecereMethod_External_CreateEdge(external, structExternal, 0);
9435 if(instExternal)
9436 __ecereMethod_External_CreateEdge(external, instExternal, 0);
9437 if(spec)
9438 DeclareStruct(external, spec->__anon1.__anon1.name, 0, needReference);
9439 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*ast), external);
9440 external->symbol = symbol;
9441 symbol->__anon2.__anon2.externalSet = external;
9442 ReplaceThisClassSpecifiers(specifiers, prop->_class);
9443 }
9444 if(!symbol->__anon2.__anon2.externalPtr)
9445 {
9446 struct Declaration * decl;
9447 struct External * external;
9448 struct __ecereNameSpace__ecere__sys__OldList * specifiers = MkList();
9449 char propName[1024];
9450
9451 if(imported)
9452 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
9453 else
9454 {
9455 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
9456 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*specifiers), MkSpecifierExtended(MkExtDeclAttrib(MkAttrib(ATTRIB, MkListOne(MkAttribute(__ecereNameSpace__ecere__sys__CopyString("unused"), (((void *)0))))))));
9457 }
9458 ListAdd(specifiers, MkSpecifierName("Property"));
9459 strcpy(propName, "__ecereProp_");
9460 FullClassNameCat(propName, prop->_class->fullName, 0);
9461 strcat(propName, "_");
9462 FullClassNameCat(propName, prop->name, 1);
9463 {
9464 struct __ecereNameSpace__ecere__sys__OldList * list = MkList();
9465
9466 ListAdd(list, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(propName)), (((void *)0))));
9467 if(!imported)
9468 {
9469 strcpy(propName, "__ecerePropM_");
9470 FullClassNameCat(propName, prop->_class->fullName, 0);
9471 strcat(propName, "_");
9472 FullClassNameCat(propName, prop->name, 1);
9473 ListAdd(list, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(propName)), (((void *)0))));
9474 }
9475 decl = MkDeclaration(specifiers, list);
9476 }
9477 external = MkExternalDeclaration(decl);
9478 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
9479 external->symbol = symbol;
9480 symbol->__anon2.__anon2.externalPtr = external;
9481 }
9482 if(inCompiler && neededBy)
9483 {
9484 if(symbol->__anon2.__anon2.externalPtr)
9485 __ecereMethod_External_CreateUniqueEdge(neededBy, symbol->__anon2.__anon2.externalPtr, 0);
9486 if(symbol->__anon2.__anon2.externalGet)
9487 __ecereMethod_External_CreateUniqueEdge(neededBy, symbol->__anon2.__anon2.externalGet, symbol->__anon2.__anon2.externalGet->type == 0);
9488 if(symbol->__anon2.__anon2.externalSet)
9489 __ecereMethod_External_CreateUniqueEdge(neededBy, symbol->__anon2.__anon2.externalSet, symbol->__anon2.__anon2.externalSet->type == 0);
9490 }
9491 }
9492
9493 static void ProcessDeclarator(struct Declarator *  decl, unsigned int isFunction);
9494
9495 void DeclareMethod(struct External * neededFor, struct __ecereNameSpace__ecere__com__Method * method, const char * name)
9496 {
9497 struct Symbol * symbol = method->symbol;
9498
9499 if(!symbol || (!symbol->__anon2.__anon1.pointerExternal && (!symbol->__anon2.__anon3.methodCodeExternal || method->type == 1)))
9500 {
9501 unsigned int dllImport = 0;
9502
9503 if(!method->dataType)
9504 method->dataType = ProcessTypeString(method->dataTypeString, 0);
9505 {
9506 if(!symbol || method->type == 1)
9507 {
9508 struct Symbol * classSym;
9509
9510 if(!method->_class->symbol)
9511 method->_class->symbol = FindClass(method->_class->fullName);
9512 classSym = method->_class->symbol;
9513 if(!classSym->_import)
9514 {
9515 struct ModuleImport * module;
9516
9517 if(method->_class->module && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)method->_class->module + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->name)
9518 module = FindModule(method->_class->module);
9519 else
9520 module = mainModule;
9521 classSym->_import = __extension__ ({
9522 struct ClassImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_ClassImport);
9523
9524 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(method->_class->fullName), __ecereInstance1->isRemote = method->_class->isRemote, __ecereInstance1;
9525 });
9526 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->classes, classSym->_import);
9527 }
9528 if(!symbol)
9529 {
9530 symbol = method->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
9531 }
9532 if(!symbol->_import)
9533 {
9534 symbol->_import = (struct ClassImport *)__extension__ ({
9535 struct MethodImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_MethodImport);
9536
9537 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(method->name), __ecereInstance1->isVirtual = method->type == 1, __ecereInstance1;
9538 });
9539 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&classSym->_import->methods, symbol->_import);
9540 }
9541 if(!symbol)
9542 {
9543 symbol->type = method->dataType;
9544 if(symbol->type)
9545 symbol->type->refCount++;
9546 }
9547 }
9548 if(!method->dataType->dllExport)
9549 {
9550 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)
9551 dllImport = 1;
9552 }
9553 }
9554 if(inCompiler)
9555 {
9556 struct Declaration * decl;
9557 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
9558 struct Declarator * d;
9559 struct Declarator * funcDecl;
9560 struct External * external;
9561
9562 specifiers = MkList();
9563 declarators = MkList();
9564 if(dllImport)
9565 ListAdd(specifiers, MkSpecifier(EXTERN));
9566 else if(method->_class->symbol && ((struct Symbol *)method->_class->symbol)->isStatic)
9567 ListAdd(specifiers, MkSpecifier(STATIC));
9568 if(method->type == 1)
9569 {
9570 ListAdd(specifiers, MkSpecifier(INT));
9571 d = MkDeclaratorIdentifier(MkIdentifier(name));
9572 }
9573 else
9574 {
9575 d = MkDeclaratorIdentifier(MkIdentifier(name));
9576 if(dllImport)
9577 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
9578 {
9579 struct Context * context = SetupTemplatesContext(method->_class);
9580
9581 d = SpecDeclFromString(method->dataTypeString, specifiers, d);
9582 FinishTemplatesContext(context);
9583 }
9584 funcDecl = GetFuncDecl(d);
9585 if(dllImport)
9586 {
9587 struct Specifier * spec, * next;
9588
9589 for(spec = (*specifiers).first; spec; spec = next)
9590 {
9591 next = spec->next;
9592 if(spec->type == 5)
9593 {
9594 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*specifiers), spec);
9595 FreeSpecifier(spec);
9596 }
9597 }
9598 }
9599 if(method->dataType && !method->dataType->__anon1.__anon2.staticMethod)
9600 {
9601 if(funcDecl && funcDecl->__anon1.function.parameters && (*funcDecl->__anon1.function.parameters).count)
9602 {
9603 struct __ecereNameSpace__ecere__com__Class * _class = method->dataType->__anon1.__anon2.thisClass ? method->dataType->__anon1.__anon2.thisClass->__anon1.registered : method->_class;
9604 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")));
9605 struct TypeName * firstParam = ((struct TypeName *)(*funcDecl->__anon1.function.parameters).first);
9606 struct Specifier * firstSpec = firstParam->qualifiers ? (*firstParam->qualifiers).first : (((void *)0));
9607
9608 if(firstSpec && firstSpec->type == 0 && firstSpec->__anon1.specifier == VOID && !firstParam->declarator)
9609 {
9610 struct TypeName * param = (*funcDecl->__anon1.function.parameters).first;
9611
9612 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->__anon1.function.parameters), param);
9613 FreeTypeName(param);
9614 }
9615 if(!funcDecl->__anon1.function.parameters)
9616 funcDecl->__anon1.function.parameters = MkList();
9617 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->__anon1.function.parameters), (((void *)0)), thisParam);
9618 }
9619 }
9620 }
9621 ProcessDeclarator(d, 1);
9622 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
9623 decl = MkDeclaration(specifiers, declarators);
9624 ReplaceThisClassSpecifiers(specifiers, method->_class);
9625 external = MkExternalDeclaration(decl);
9626 external->symbol = symbol;
9627 symbol->__anon2.__anon1.pointerExternal = external;
9628 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*ast), external);
9629 DeclareStruct(external, method->_class->fullName, 1, 1);
9630 if(method->dataType)
9631 DeclareType(external, method->dataType, 1, 1);
9632 }
9633 }
9634 if(inCompiler && neededFor)
9635 {
9636 struct External * external = symbol->__anon2.__anon1.pointerExternal ? symbol->__anon2.__anon1.pointerExternal : symbol->__anon2.__anon3.methodCodeExternal;
9637
9638 __ecereMethod_External_CreateUniqueEdge(neededFor, external, external->type == 0);
9639 }
9640 }
9641
9642 struct __ecereNameSpace__ecere__com__GlobalFunction;
9643
9644 struct __ecereNameSpace__ecere__com__GlobalFunction
9645 {
9646 struct __ecereNameSpace__ecere__com__GlobalFunction * prev;
9647 struct __ecereNameSpace__ecere__com__GlobalFunction * next;
9648 const char *  name;
9649 int (*  function)();
9650 struct __ecereNameSpace__ecere__com__Instance * module;
9651 struct __ecereNameSpace__ecere__com__NameSpace *  nameSpace;
9652 const char *  dataTypeString;
9653 struct Type * dataType;
9654 void *  symbol;
9655 } ecere_gcc_struct;
9656
9657 extern struct __ecereNameSpace__ecere__com__GlobalFunction * __ecereNameSpace__ecere__com__eSystem_FindFunction(struct __ecereNameSpace__ecere__com__Instance * module, const char *  name);
9658
9659 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);
9660
9661 unsigned int DeclareFunction(struct External * neededFor, struct __ecereNameSpace__ecere__com__GlobalFunction * function, char * name)
9662 {
9663 struct Symbol * symbol = function->symbol;
9664
9665 if(!symbol || !symbol->__anon2.__anon1.pointerExternal)
9666 {
9667 unsigned int imported = 0;
9668 unsigned int dllImport = 0;
9669
9670 if(!function->dataType)
9671 {
9672 function->dataType = ProcessTypeString(function->dataTypeString, 0);
9673 if(!function->dataType->__anon1.__anon2.thisClass)
9674 function->dataType->__anon1.__anon2.staticMethod = 1;
9675 }
9676 if(inCompiler)
9677 {
9678 if(!symbol)
9679 {
9680 struct ModuleImport * module = FindModule(function->module);
9681
9682 symbol = function->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
9683 if(module->name)
9684 {
9685 if(!function->dataType->dllExport)
9686 {
9687 symbol->_import = (struct ClassImport *)__extension__ ({
9688 struct FunctionImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_FunctionImport);
9689
9690 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(function->name), __ecereInstance1;
9691 });
9692 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->functions, symbol->_import);
9693 }
9694 }
9695 {
9696 symbol->type = ProcessTypeString(function->dataTypeString, 0);
9697 if(!symbol->type->__anon1.__anon2.thisClass)
9698 symbol->type->__anon1.__anon2.staticMethod = 1;
9699 }
9700 }
9701 imported = symbol->_import ? 1 : 0;
9702 if(imported && function->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->importType != 1)
9703 dllImport = 1;
9704 }
9705 if(inCompiler)
9706 {
9707 {
9708 struct Declaration * decl;
9709 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
9710 struct Declarator * d;
9711 struct Declarator * funcDecl;
9712 struct External * external;
9713
9714 specifiers = MkList();
9715 declarators = MkList();
9716 ListAdd(specifiers, MkSpecifier(EXTERN));
9717 d = MkDeclaratorIdentifier(MkIdentifier(imported ? name : function->name));
9718 if(dllImport)
9719 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
9720 d = SpecDeclFromString(function->dataTypeString, specifiers, d);
9721 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->importType == 1)
9722 {
9723 struct Specifier * spec;
9724
9725 for(spec = (*specifiers).first; spec; spec = spec->next)
9726 if(spec->type == 5 && spec->__anon1.__anon1.extDecl && spec->__anon1.__anon1.extDecl->type == 0 && !strcmp(spec->__anon1.__anon1.extDecl->__anon1.s, "dllexport"))
9727 {
9728 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*specifiers), spec);
9729 FreeSpecifier(spec);
9730 break;
9731 }
9732 }
9733 funcDecl = GetFuncDecl(d);
9734 if(funcDecl && !funcDecl->__anon1.function.parameters)
9735 {
9736 funcDecl->__anon1.function.parameters = MkList();
9737 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->__anon1.function.parameters), (((void *)0)), MkTypeName(MkListOne(MkSpecifier(VOID)), (((void *)0))));
9738 }
9739 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
9740 {
9741 struct Context * oldCtx = curContext;
9742
9743 curContext = globalContext;
9744 decl = MkDeclaration(specifiers, declarators);
9745 curContext = oldCtx;
9746 }
9747 external = MkExternalDeclaration(decl);
9748 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*ast), external);
9749 external->symbol = symbol;
9750 symbol->__anon2.__anon1.pointerExternal = external;
9751 DeclareType(external, function->dataType, 1, 1);
9752 }
9753 }
9754 }
9755 if(inCompiler && neededFor && symbol && symbol->__anon2.__anon1.pointerExternal)
9756 __ecereMethod_External_CreateUniqueEdge(neededFor, symbol->__anon2.__anon1.pointerExternal, symbol->__anon2.__anon1.pointerExternal->type == 0);
9757 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;
9758 }
9759
9760 void DeclareFunctionUtil(struct External * neededBy, const char * s)
9761 {
9762 struct __ecereNameSpace__ecere__com__GlobalFunction * function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, s);
9763
9764 if(function)
9765 {
9766 char name[1024];
9767
9768 name[0] = (char)0;
9769 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->importType != 1 && (!function->dataType || !function->dataType->dllExport))
9770 strcpy(name, "__ecereFunction_");
9771 FullClassNameCat(name, s, 0);
9772 DeclareFunction(neededBy, function, name);
9773 }
9774 else if(neededBy)
9775 FindSymbol(s, globalContext, globalContext, 0, 0);
9776 }
9777
9778 static void CreateFireWatcher(struct __ecereNameSpace__ecere__com__Property * prop, struct Expression * object, struct Statement * stmt)
9779 {
9780 char propName[1024], propNameM[1024];
9781 char getName[1024], setName[1024];
9782 struct __ecereNameSpace__ecere__sys__OldList * args;
9783
9784 DeclareProperty(curExternal, prop, setName, getName);
9785 strcpy(propName, "__ecereProp_");
9786 FullClassNameCat(propName, prop->_class->fullName, 0);
9787 strcat(propName, "_");
9788 FullClassNameCat(propName, prop->name, 1);
9789 strcpy(propNameM, "__ecerePropM_");
9790 FullClassNameCat(propNameM, prop->_class->fullName, 0);
9791 strcat(propNameM, "_");
9792 FullClassNameCat(propNameM, prop->name, 1);
9793 if(prop->isWatchable)
9794 {
9795 args = MkList();
9796 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
9797 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
9798 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireWatchers")), args));
9799 args = MkList();
9800 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
9801 ListAdd(args, MkExpIdentifier(MkIdentifier(propNameM)));
9802 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireWatchers")), args));
9803 DeclareFunctionUtil(curExternal, "eInstance_FireWatchers");
9804 }
9805 {
9806 args = MkList();
9807 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
9808 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
9809 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireSelfWatchers")), args));
9810 args = MkList();
9811 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
9812 ListAdd(args, MkExpIdentifier(MkIdentifier(propNameM)));
9813 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireSelfWatchers")), args));
9814 DeclareFunctionUtil(curExternal, "eInstance_FireSelfWatchers");
9815 }
9816 if(curFunction->propSet && !strcmp(curFunction->propSet->string, prop->name) && (!object || (object->type == 0 && !strcmp(object->__anon1.__anon1.identifier->string, "this"))))
9817 curFunction->propSet->fireWatchersDone = 1;
9818 }
9819
9820 struct __ecereNameSpace__ecere__com__SubModule;
9821
9822 struct __ecereNameSpace__ecere__com__SubModule
9823 {
9824 struct __ecereNameSpace__ecere__com__SubModule * prev;
9825 struct __ecereNameSpace__ecere__com__SubModule * next;
9826 struct __ecereNameSpace__ecere__com__Instance * module;
9827 int importMode;
9828 } ecere_gcc_struct;
9829
9830 unsigned int ModuleVisibility(struct __ecereNameSpace__ecere__com__Instance * searchIn, struct __ecereNameSpace__ecere__com__Instance * searchFor)
9831 {
9832 struct __ecereNameSpace__ecere__com__SubModule * subModule;
9833
9834 if(searchFor == searchIn)
9835 return 1;
9836 for(subModule = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)searchIn + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->modules.first; subModule; subModule = subModule->next)
9837 {
9838 if(subModule->importMode == 1 || searchIn == ((struct __ecereNameSpace__ecere__com__Module *)(((char *)searchIn + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->application)
9839 {
9840 if(ModuleVisibility(subModule->module, searchFor))
9841 return 1;
9842 }
9843 }
9844 return 0;
9845 }
9846
9847 void ProcessExpressionType(struct Expression *  exp);
9848
9849 static void ReplaceClassMembers(struct Expression * exp, struct __ecereNameSpace__ecere__com__Class * _class)
9850 {
9851 if(exp->type == 0 && exp->__anon1.__anon1.identifier)
9852 {
9853 struct Identifier * id = exp->__anon1.__anon1.identifier;
9854 struct Context * ctx;
9855 struct Symbol * symbol = (((void *)0));
9856
9857 if(!id->_class || !id->_class->__anon1.__anon1.name || strcmp(id->_class->__anon1.__anon1.name, "property"))
9858 {
9859 for(ctx = curContext; ctx != topContext->parent && !symbol; ctx = ctx->parent)
9860 {
9861 symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(&ctx->symbols, id->string);
9862 if(symbol)
9863 break;
9864 }
9865 }
9866 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))))
9867 {
9868 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
9869 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
9870 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
9871 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
9872
9873 if(!prop)
9874 {
9875 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule);
9876 }
9877 if(!prop && !method)
9878 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
9879 if(!prop && !method && !member)
9880 {
9881 classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(_class, id->string);
9882 }
9883 if(prop || method || member || classProp)
9884 {
9885 exp->type = 8;
9886 exp->__anon1.member.member = id;
9887 exp->__anon1.member.memberType = 0;
9888 exp->__anon1.member.exp = QMkExpId("this");
9889 exp->addedThis = 1;
9890 }
9891 else if(_class && _class->templateParams.first)
9892 {
9893 struct __ecereNameSpace__ecere__com__Class * sClass;
9894
9895 for(sClass = _class; sClass; sClass = sClass->base)
9896 {
9897 if(sClass->templateParams.first)
9898 {
9899 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
9900
9901 for(param = sClass->templateParams.first; param; param = param->next)
9902 {
9903 if(param->type == 2 && !strcmp(param->name, id->string))
9904 {
9905 struct Expression * argExp = GetTemplateArgExpByName(param->name, _class, 2);
9906
9907 if(argExp)
9908 {
9909 struct Declarator * decl;
9910 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
9911
9912 FreeIdentifier(exp->__anon1.member.member);
9913 ProcessExpressionType(argExp);
9914 decl = SpecDeclFromString(param->__anon1.dataTypeString, specs, (((void *)0)));
9915 exp->expType = ProcessType(specs, decl);
9916 exp->type = 5;
9917 exp->__anon1.list = MkListOne(MkExpOp((((void *)0)), '*', MkExpCast(MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl)), MkExpOp((((void *)0)), '&', argExp))));
9918 }
9919 }
9920 }
9921 }
9922 }
9923 }
9924 }
9925 }
9926 }
9927
9928 static void PopulateInstanceProcessMember(struct Instantiation * inst, struct __ecereNameSpace__ecere__sys__OldList * memberList, struct __ecereNameSpace__ecere__com__DataMember * parentDataMember, unsigned int offset)
9929 {
9930 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
9931
9932 for(dataMember = parentDataMember->members.first; dataMember; dataMember = dataMember->next)
9933 {
9934 if(!dataMember->name && (dataMember->type == 2 || dataMember->type == 1))
9935 PopulateInstanceProcessMember(inst, memberList, dataMember, offset + dataMember->offset);
9936 else
9937 {
9938 struct Expression * exp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
9939 struct MemberInit * member = MkMemberInit(MkListOne(MkIdentifier(dataMember->name)), MkInitializerAssignment(exp));
9940 struct Type * type;
9941 void * ptr = inst->data + dataMember->offset + offset;
9942 char * result = (((void *)0));
9943
9944 exp->loc = member->loc = inst->loc;
9945 ((struct Identifier *)(*member->identifiers).first)->loc = inst->loc;
9946 if(!dataMember->dataType)
9947 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0);
9948 type = dataMember->dataType;
9949 if(type->kind == 8)
9950 {
9951 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
9952
9953 if(_class->type == 4)
9954 {
9955 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
9956
9957 if(enumClass)
9958 {
9959 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
9960 struct __ecereNameSpace__ecere__sys__NamedLink64 * item;
9961
9962 for(item = e->values.first; item; item = item->next)
9963 {
9964 if(item->data == GetEnumValue(_class, ptr))
9965 {
9966 result = item->name;
9967 break;
9968 }
9969 }
9970 if(result)
9971 {
9972 exp->__anon1.__anon1.identifier = MkIdentifier(result);
9973 exp->type = 0;
9974 exp->destType = MkClassType(_class->fullName);
9975 ProcessExpressionType(exp);
9976 }
9977 }
9978 }
9979 if(_class->type == 4 || _class->type == 3 || _class->type == 2)
9980 {
9981 if(!_class->dataType)
9982 _class->dataType = ProcessTypeString(_class->dataTypeString, 0);
9983 type = _class->dataType;
9984 }
9985 }
9986 if(!result)
9987 {
9988 switch(type->kind)
9989 {
9990 case 6:
9991 {
9992 FreeExpContents(exp);
9993 exp->__anon1.__anon1.constant = PrintFloat(*(float *)ptr);
9994 exp->type = 2;
9995 break;
9996 }
9997 case 7:
9998 {
9999 FreeExpContents(exp);
10000 exp->__anon1.__anon1.constant = PrintDouble(*(double *)ptr);
10001 exp->type = 2;
10002 break;
10003 }
10004 case 3:
10005 {
10006 FreeExpContents(exp);
10007 exp->__anon1.__anon1.constant = PrintInt(*(int *)ptr);
10008 exp->type = 2;
10009 break;
10010 }
10011 case 4:
10012 {
10013 FreeExpContents(exp);
10014 exp->__anon1.__anon1.constant = PrintInt64(*(long long *)ptr);
10015 exp->type = 2;
10016 break;
10017 }
10018 case 22:
10019 {
10020 FreeExpContents(exp);
10021 exp->__anon1.__anon1.constant = PrintInt64((long long)*(intptr_t *)ptr);
10022 exp->type = 2;
10023 break;
10024 }
10025 case 23:
10026 {
10027 FreeExpContents(exp);
10028 exp->__anon1.__anon1.constant = PrintInt64((long long)*(ssize_t *)ptr);
10029 exp->type = 2;
10030 break;
10031 }
10032 default:
10033 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Unhandled type populating instance\n", (((void *)0))));
10034 }
10035 }
10036 ListAdd(memberList, member);
10037 }
10038 if(parentDataMember->type == 1)
10039 break;
10040 }
10041 }
10042
10043 void CheckTemplateTypes(struct Expression * exp)
10044 {
10045 struct Expression * nbExp = GetNonBracketsExp(exp);
10046
10047 if(exp->destType && exp->destType->passAsTemplate && exp->expType && exp->expType->kind != 20 && !exp->expType->passAsTemplate && (nbExp == exp || nbExp->type != 11))
10048 {
10049 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
10050 struct Context * context;
10051 int kind = exp->expType->kind;
10052
10053 *newExp = *exp;
10054 if(exp->destType)
10055 exp->destType->refCount++;
10056 if(exp->expType)
10057 exp->expType->refCount++;
10058 newExp->prev = (((void *)0));
10059 newExp->next = (((void *)0));
10060 if(exp->expType->kind == 8 && exp->expType->__anon1._class && exp->expType->__anon1._class->__anon1.registered)
10061 {
10062 struct __ecereNameSpace__ecere__com__Class * c = exp->expType->__anon1._class->__anon1.registered;
10063
10064 if(c->type == 2 || c->type == 4 || c->type == 3)
10065 {
10066 if(!c->dataType)
10067 c->dataType = ProcessTypeString(c->dataTypeString, 0);
10068 kind = c->dataType->kind;
10069 }
10070 }
10071 switch(kind)
10072 {
10073 case 7:
10074 if(exp->destType->classObjectType)
10075 {
10076 if(exp->destType)
10077 exp->destType->refCount--;
10078 if(exp->expType)
10079 exp->expType->refCount--;
10080 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
10081 }
10082 else
10083 {
10084 struct __ecereNameSpace__ecere__sys__OldList * specs;
10085 struct __ecereNameSpace__ecere__sys__OldList * unionDefs = MkList();
10086 struct __ecereNameSpace__ecere__sys__OldList * statements = MkList();
10087
10088 context = PushContext();
10089 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(DOUBLE)), MkListOne(MkDeclaratorIdentifier(MkIdentifier("d"))), (((void *)0)))));
10090 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifierName("uint64")), MkListOne(MkDeclaratorIdentifier(MkIdentifier("i"))), (((void *)0)))));
10091 specs = MkListOne(MkStructOrUnion(4, (((void *)0)), unionDefs));
10092 exp->type = 23;
10093 exp->__anon1.compound = MkCompoundStmt(MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internal_union")), (((void *)0)))))), statements);
10094 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("d")), '=', newExp))));
10095 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("i")))));
10096 exp->__anon1.compound->__anon1.compound.context = context;
10097 PopContext(context);
10098 }
10099 break;
10100 default:
10101 exp->type = 11;
10102 exp->__anon1.cast.typeName = MkTypeName(MkListOne(MkSpecifierName("uint64")), (((void *)0)));
10103 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))
10104 exp->__anon1.cast.exp = MkExpCast(MkTypeName(MkListOne(MkSpecifierName("uintptr")), (((void *)0))), MkExpBrackets(MkListOne(newExp)));
10105 else
10106 exp->__anon1.cast.exp = MkExpBrackets(MkListOne(newExp));
10107 exp->needCast = 1;
10108 break;
10109 }
10110 }
10111 else if(exp->expType && exp->expType->passAsTemplate && exp->destType && ((unsigned int)((exp->usage & 0x1) >> 0)) && exp->destType->kind != 20 && !exp->destType->passAsTemplate)
10112 {
10113 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
10114 struct Context * context;
10115 int kind = exp->expType->kind;
10116
10117 *newExp = *exp;
10118 if(exp->destType)
10119 exp->destType->refCount++;
10120 if(exp->expType)
10121 exp->expType->refCount++;
10122 newExp->prev = (((void *)0));
10123 newExp->next = (((void *)0));
10124 if(exp->expType->kind == 8 && exp->expType->__anon1._class && exp->expType->__anon1._class->__anon1.registered)
10125 {
10126 struct __ecereNameSpace__ecere__com__Class * c = exp->expType->__anon1._class->__anon1.registered;
10127
10128 if(c->type == 2 || c->type == 4 || c->type == 3)
10129 {
10130 if(!c->dataType)
10131 c->dataType = ProcessTypeString(c->dataTypeString, 0);
10132 kind = c->dataType->kind;
10133 }
10134 }
10135 switch(kind)
10136 {
10137 case 7:
10138 if(exp->destType->classObjectType)
10139 {
10140 if(exp->destType)
10141 exp->destType->refCount--;
10142 if(exp->expType)
10143 exp->expType->refCount--;
10144 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
10145 }
10146 else
10147 {
10148 struct __ecereNameSpace__ecere__sys__OldList * specs;
10149 struct __ecereNameSpace__ecere__sys__OldList * unionDefs = MkList();
10150 struct __ecereNameSpace__ecere__sys__OldList * statements = MkList();
10151
10152 context = PushContext();
10153 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(DOUBLE)), MkListOne(MkDeclaratorIdentifier(MkIdentifier("d"))), (((void *)0)))));
10154 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifierName("uint64")), MkListOne(MkDeclaratorIdentifier(MkIdentifier("i"))), (((void *)0)))));
10155 specs = MkListOne(MkStructOrUnion(4, (((void *)0)), unionDefs));
10156 exp->type = 23;
10157 exp->__anon1.compound = MkCompoundStmt(MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internal_union")), (((void *)0)))))), statements);
10158 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("i")), '=', newExp))));
10159 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("d")))));
10160 exp->__anon1.compound->__anon1.compound.context = context;
10161 PopContext(context);
10162 }
10163 break;
10164 case 8:
10165 {
10166 if(exp->expType->__anon1._class && exp->expType->__anon1._class->__anon1.registered && exp->expType->__anon1._class->__anon1.registered->type == 1)
10167 {
10168 exp->type = 5;
10169 newExp = MkExpCast(MkTypeName(MkListOne(MkSpecifierName("uintptr")), (((void *)0))), newExp);
10170 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)));
10171 ProcessExpressionType((*exp->__anon1.list).first);
10172 break;
10173 }
10174 else
10175 {
10176 exp->type = 5;
10177 if(__ecereProp_Type_Get_isPointerType(exp->expType))
10178 {
10179 exp->needTemplateCast = 2;
10180 newExp->needCast = 1;
10181 newExp->needTemplateCast = 2;
10182 newExp = MkExpCast(MkTypeName(MkListOne(MkSpecifierName("uintptr")), (((void *)0))), newExp);
10183 }
10184 exp->__anon1.list = MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName(exp->expType->__anon1._class->string)), (((void *)0))), newExp));
10185 exp->needTemplateCast = 2;
10186 newExp->needCast = 1;
10187 newExp->needTemplateCast = 2;
10188 ProcessExpressionType((*exp->__anon1.list).first);
10189 break;
10190 }
10191 }
10192 default:
10193 {
10194 if(exp->expType->kind == 20)
10195 {
10196 struct Type * type = ProcessTemplateParameterType(exp->expType->__anon1.templateParameter);
10197
10198 if(type)
10199 {
10200 FreeType(exp->destType);
10201 FreeType(exp->expType);
10202 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
10203 break;
10204 }
10205 }
10206 {
10207 char typeString[1024];
10208 struct Declarator * decl;
10209 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
10210
10211 typeString[0] = '\0';
10212 PrintType(exp->expType, typeString, 0, 0);
10213 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
10214 exp->type = 11;
10215 exp->__anon1.cast.typeName = MkTypeName(specs, decl);
10216 exp->__anon1.cast.exp = MkExpBrackets(MkListOne(newExp));
10217 exp->__anon1.cast.exp->needCast = 1;
10218 exp->needTemplateCast = 2;
10219 newExp->needTemplateCast = 2;
10220 }
10221 break;
10222 }
10223 }
10224 }
10225 }
10226
10227 static void ProcessInitializer(struct Initializer * init, struct Type * type)
10228 {
10229 switch(init->type)
10230 {
10231 case 0:
10232 if(!init->__anon1.exp || init->__anon1.exp->type != 1 || !init->__anon1.exp->__anon1.instance || init->__anon1.exp->__anon1.instance->_class || !type || type->kind == 8)
10233 {
10234 if(init->__anon1.exp && !init->__anon1.exp->destType)
10235 {
10236 FreeType(init->__anon1.exp->destType);
10237 init->__anon1.exp->destType = type;
10238 if(type)
10239 type->refCount++;
10240 }
10241 if(init->__anon1.exp)
10242 {
10243 ProcessExpressionType(init->__anon1.exp);
10244 init->isConstant = init->__anon1.exp->isConstant;
10245 }
10246 break;
10247 }
10248 else
10249 {
10250 struct Expression * exp = init->__anon1.exp;
10251 struct Instantiation * inst = exp->__anon1.instance;
10252 struct MembersInit * members;
10253
10254 init->type = 1;
10255 init->__anon1.list = MkList();
10256 if(inst->members)
10257 {
10258 for(members = (*inst->members).first; members; members = members->next)
10259 {
10260 if(members->type == 0)
10261 {
10262 struct MemberInit * member;
10263
10264 for(member = (*members->__anon1.dataMembers).first; member; member = member->next)
10265 {
10266 ListAdd(init->__anon1.list, member->initializer);
10267 member->initializer = (((void *)0));
10268 }
10269 }
10270 }
10271 }
10272 FreeExpression(exp);
10273 }
10274 case 1:
10275 {
10276 struct Initializer * i;
10277 struct Type * initializerType = (((void *)0));
10278 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
10279 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
10280 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
10281 int subMemberStackPos = 0;
10282
10283 if(type && type->kind == 12)
10284 initializerType = Dereference(type);
10285 else if(type && (type->kind == 9 || type->kind == 10))
10286 initializerType = type->__anon1.__anon1.members.first;
10287 for(i = (*init->__anon1.list).first; i; i = i->next)
10288 {
10289 if(type && type->kind == 8 && type->__anon1._class && type->__anon1._class->__anon1.registered)
10290 {
10291 FindNextDataMember(type->__anon1._class->__anon1.registered, &curClass, &curMember, subMemberStack, &subMemberStackPos);
10292 if(curMember)
10293 {
10294 if(!curMember->dataType)
10295 curMember->dataType = ProcessTypeString(curMember->dataTypeString, 0);
10296 initializerType = curMember->dataType;
10297 }
10298 }
10299 ProcessInitializer(i, initializerType);
10300 if(initializerType && type && (type->kind == 9 || type->kind == 10))
10301 initializerType = initializerType->next;
10302 if(!i->isConstant)
10303 init->isConstant = 0;
10304 }
10305 if(type && type->kind == 12)
10306 FreeType(initializerType);
10307 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))
10308 {
10309 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Assigning list initializer to non list\n", (((void *)0))));
10310 }
10311 break;
10312 }
10313 }
10314 }
10315
10316 void PopulateInstance(struct Instantiation * inst)
10317 {
10318 struct Symbol * classSym = inst->_class->__anon1.__anon1.symbol;
10319 struct __ecereNameSpace__ecere__com__Class * _class = classSym->__anon1.registered;
10320 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
10321 struct __ecereNameSpace__ecere__sys__OldList * memberList = MkList();
10322
10323 if(!inst->members)
10324 inst->members = MkListOne(MkMembersInitList(memberList));
10325 else
10326 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*inst->members), MkMembersInitList(memberList));
10327 for(dataMember = _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
10328 {
10329 if(!dataMember->isProperty)
10330 {
10331 if(!dataMember->name && (dataMember->type == 2 || dataMember->type == 1))
10332 PopulateInstanceProcessMember(inst, memberList, dataMember, dataMember->offset);
10333 else
10334 {
10335 struct Expression * exp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
10336 struct MemberInit * member = MkMemberInit(MkListOne(MkIdentifier(dataMember->name)), MkInitializerAssignment(exp));
10337 struct Type * type;
10338 void * ptr = inst->data + dataMember->offset;
10339 char * result = (((void *)0));
10340
10341 exp->loc = member->loc = inst->loc;
10342 ((struct Identifier *)(*member->identifiers).first)->loc = inst->loc;
10343 if(!dataMember->dataType)
10344 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0);
10345 type = dataMember->dataType;
10346 if(type->kind == 8)
10347 {
10348 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
10349
10350 if(_class->type == 4)
10351 {
10352 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
10353
10354 if(enumClass)
10355 {
10356 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
10357 struct __ecereNameSpace__ecere__sys__NamedLink64 * item;
10358
10359 for(item = e->values.first; item; item = item->next)
10360 {
10361 if(item->data == GetEnumValue(_class, ptr))
10362 {
10363 result = item->name;
10364 break;
10365 }
10366 }
10367 }
10368 if(result)
10369 {
10370 exp->__anon1.__anon1.identifier = MkIdentifier(result);
10371 exp->type = 0;
10372 exp->destType = MkClassType(_class->fullName);
10373 ProcessExpressionType(exp);
10374 }
10375 }
10376 if(_class->type == 4 || _class->type == 3 || _class->type == 2)
10377 {
10378 if(!_class->dataType)
10379 _class->dataType = ProcessTypeString(_class->dataTypeString, 0);
10380 type = _class->dataType;
10381 }
10382 }
10383 if(!result)
10384 {
10385 switch(type->kind)
10386 {
10387 case 6:
10388 {
10389 exp->__anon1.__anon1.constant = PrintFloat(*(float *)ptr);
10390 exp->type = 2;
10391 break;
10392 }
10393 case 7:
10394 {
10395 exp->__anon1.__anon1.constant = PrintDouble(*(double *)ptr);
10396 exp->type = 2;
10397 break;
10398 }
10399 case 3:
10400 {
10401 exp->__anon1.__anon1.constant = PrintInt(*(int *)ptr);
10402 exp->type = 2;
10403 break;
10404 }
10405 case 4:
10406 {
10407 exp->__anon1.__anon1.constant = PrintInt64(*(long long *)ptr);
10408 exp->type = 2;
10409 break;
10410 }
10411 case 22:
10412 {
10413 exp->__anon1.__anon1.constant = PrintInt64((long long)*(intptr_t *)ptr);
10414 exp->type = 2;
10415 break;
10416 }
10417 default:
10418 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Unhandled type populating instance\n", (((void *)0))));
10419 }
10420 }
10421 ListAdd(memberList, member);
10422 }
10423 }
10424 }
10425 }
10426
10427 int ComputeTypeSize(struct Type *  type);
10428
10429 void ComputeClassMembers(struct __ecereNameSpace__ecere__com__Class * _class, unsigned int isMember)
10430 {
10431 struct __ecereNameSpace__ecere__com__DataMember * member = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
10432 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
10433
10434 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))
10435 {
10436 int unionMemberOffset = 0;
10437 int bitFields = 0;
10438
10439 if(member)
10440 {
10441 member->memberOffset = 0;
10442 if(targetBits < sizeof(void *) * 8)
10443 member->structAlignment = (short)0;
10444 }
10445 else if(targetBits < sizeof(void *) * 8)
10446 _class->structAlignment = (short)0;
10447 if(!member && ((_class->type == 0 || _class->type == 5) || (_class->type == 1 && _class->memberOffset && _class->memberOffset > _class->base->structSize)))
10448 _class->memberOffset = (_class->base && _class->type == 1) ? _class->base->structSize : 0;
10449 if(!member && _class->destructionWatchOffset)
10450 _class->memberOffset += sizeof(struct __ecereNameSpace__ecere__sys__OldList);
10451 {
10452 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
10453
10454 for(dataMember = member ? member->members.first : _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
10455 {
10456 if(!dataMember->isProperty)
10457 {
10458 if(dataMember->type == 0 && dataMember->dataTypeString && !dataMember->dataType)
10459 {
10460 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0);
10461 }
10462 }
10463 }
10464 }
10465 {
10466 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
10467
10468 for(dataMember = member ? member->members.first : _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
10469 {
10470 if(!dataMember->isProperty && (dataMember->type != 0 || dataMember->dataTypeString))
10471 {
10472 if(!isMember && _class->type == 2 && dataMember->dataType)
10473 {
10474 struct __ecereNameSpace__ecere__com__BitMember * bitMember = (struct __ecereNameSpace__ecere__com__BitMember *)dataMember;
10475 uint64 mask = 0;
10476 int d;
10477
10478 ComputeTypeSize(dataMember->dataType);
10479 if(bitMember->pos == -1)
10480 bitMember->pos = _class->memberOffset;
10481 if(!bitMember->size)
10482 bitMember->size = dataMember->dataType->size * 8;
10483 _class->memberOffset = bitMember->pos + bitMember->size;
10484 for(d = 0; d < bitMember->size; d++)
10485 {
10486 if(d)
10487 mask <<= 1;
10488 mask |= 1;
10489 }
10490 bitMember->mask = mask << bitMember->pos;
10491 }
10492 else if(dataMember->type == 0 && dataMember->dataType)
10493 {
10494 int size;
10495 int alignment = 0;
10496
10497 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)))
10498 ComputeTypeSize(dataMember->dataType);
10499 if(dataMember->dataType->bitFieldCount)
10500 {
10501 bitFields += dataMember->dataType->bitFieldCount;
10502 size = 0;
10503 }
10504 else
10505 {
10506 if(bitFields)
10507 {
10508 int size = (bitFields + 7) / 8;
10509
10510 if(isMember)
10511 {
10512 int __simpleStruct0;
10513
10514 if(alignment)
10515 {
10516 short __simpleStruct0;
10517
10518 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
10519 if(member->memberOffset % alignment)
10520 member->memberOffset += alignment - (member->memberOffset % alignment);
10521 }
10522 dataMember->offset = member->memberOffset;
10523 if(member->type == 1)
10524 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
10525 else
10526 {
10527 member->memberOffset += size;
10528 }
10529 }
10530 else
10531 {
10532 if(alignment)
10533 {
10534 short __simpleStruct0;
10535
10536 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
10537 if(_class->memberOffset % alignment)
10538 _class->memberOffset += alignment - (_class->memberOffset % alignment);
10539 }
10540 dataMember->offset = _class->memberOffset;
10541 _class->memberOffset += size;
10542 }
10543 bitFields = 0;
10544 }
10545 size = dataMember->dataType->size;
10546 alignment = dataMember->dataType->alignment;
10547 }
10548 if(isMember)
10549 {
10550 int __simpleStruct0;
10551
10552 if(alignment)
10553 {
10554 short __simpleStruct0;
10555
10556 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
10557 if(member->memberOffset % alignment)
10558 member->memberOffset += alignment - (member->memberOffset % alignment);
10559 }
10560 dataMember->offset = member->memberOffset;
10561 if(member->type == 1)
10562 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
10563 else
10564 {
10565 member->memberOffset += size;
10566 }
10567 }
10568 else
10569 {
10570 if(alignment)
10571 {
10572 short __simpleStruct0;
10573
10574 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
10575 if(_class->memberOffset % alignment)
10576 _class->memberOffset += alignment - (_class->memberOffset % alignment);
10577 }
10578 dataMember->offset = _class->memberOffset;
10579 _class->memberOffset += size;
10580 }
10581 }
10582 else
10583 {
10584 int alignment;
10585
10586 ComputeClassMembers((struct __ecereNameSpace__ecere__com__Class *)dataMember, 1);
10587 alignment = dataMember->structAlignment;
10588 if(isMember)
10589 {
10590 int __simpleStruct0;
10591
10592 if(alignment)
10593 {
10594 short __simpleStruct0;
10595
10596 if(member->memberOffset % alignment)
10597 member->memberOffset += alignment - (member->memberOffset % alignment);
10598 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
10599 }
10600 dataMember->offset = member->memberOffset;
10601 if(member->type == 1)
10602 unionMemberOffset = (__simpleStruct0 = dataMember->memberOffset, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
10603 else
10604 member->memberOffset += dataMember->memberOffset;
10605 }
10606 else
10607 {
10608 if(alignment)
10609 {
10610 short __simpleStruct0;
10611
10612 if(_class->memberOffset % alignment)
10613 _class->memberOffset += alignment - (_class->memberOffset % alignment);
10614 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
10615 }
10616 dataMember->offset = _class->memberOffset;
10617 _class->memberOffset += dataMember->memberOffset;
10618 }
10619 }
10620 }
10621 }
10622 if(bitFields)
10623 {
10624 int alignment = 0;
10625 int size = (bitFields + 7) / 8;
10626
10627 if(isMember)
10628 {
10629 int __simpleStruct0;
10630
10631 if(alignment)
10632 {
10633 short __simpleStruct0;
10634
10635 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
10636 if(member->memberOffset % alignment)
10637 member->memberOffset += alignment - (member->memberOffset % alignment);
10638 }
10639 if(member->type == 1)
10640 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
10641 else
10642 {
10643 member->memberOffset += size;
10644 }
10645 }
10646 else
10647 {
10648 if(alignment)
10649 {
10650 short __simpleStruct0;
10651
10652 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
10653 if(_class->memberOffset % alignment)
10654 _class->memberOffset += alignment - (_class->memberOffset % alignment);
10655 }
10656 _class->memberOffset += size;
10657 }
10658 bitFields = 0;
10659 }
10660 }
10661 if(member && member->type == 1)
10662 {
10663 member->memberOffset = unionMemberOffset;
10664 }
10665 if(!isMember)
10666 {
10667 if(_class->type != 2)
10668 {
10669 int extra = 0;
10670
10671 if(_class->structAlignment)
10672 {
10673 if(_class->memberOffset % _class->structAlignment)
10674 extra += _class->structAlignment - (_class->memberOffset % _class->structAlignment);
10675 }
10676 _class->structSize = (_class->base ? (_class->base->templateClass ? _class->base->templateClass->structSize : _class->base->structSize) : 0) + _class->memberOffset + extra;
10677 if(!member)
10678 {
10679 struct __ecereNameSpace__ecere__com__Property * prop;
10680
10681 for(prop = _class->membersAndProperties.first; prop; prop = prop->next)
10682 {
10683 if(prop->isProperty && prop->isWatchable)
10684 {
10685 prop->watcherOffset = _class->structSize;
10686 _class->structSize += sizeof(struct __ecereNameSpace__ecere__sys__OldList);
10687 }
10688 }
10689 }
10690 {
10691 struct __ecereNameSpace__ecere__sys__OldLink * derivative;
10692
10693 for(derivative = _class->derivatives.first; derivative; derivative = derivative->next)
10694 {
10695 struct __ecereNameSpace__ecere__com__Class * deriv = derivative->data;
10696
10697 if(deriv->computeSize)
10698 {
10699 deriv->offset = _class->structSize;
10700 deriv->memberOffset = 0;
10701 deriv->structSize = deriv->offset;
10702 ComputeClassMembers(deriv, 0);
10703 }
10704 }
10705 }
10706 }
10707 }
10708 }
10709 if(context)
10710 FinishTemplatesContext(context);
10711 }
10712
10713 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)
10714 {
10715 struct __ecereNameSpace__ecere__com__DataMember * topMember = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
10716 unsigned int totalSize = 0;
10717 unsigned int maxSize = 0;
10718 int alignment;
10719 unsigned int size;
10720 struct __ecereNameSpace__ecere__com__DataMember * member;
10721 int anonID = 1;
10722 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
10723
10724 if(addedPadding)
10725 *addedPadding = 0;
10726 if(!isMember && _class->base)
10727 {
10728 maxSize = _class->structSize;
10729 {
10730 if(_class->type == 1 || _class->type == 5)
10731 AddMembers(neededBy, declarations, _class->base, 0, &totalSize, topClass, (((void *)0)));
10732 else
10733 {
10734 unsigned int baseSize = _class->base->templateClass ? _class->base->templateClass->structSize : _class->base->structSize;
10735
10736 if(maxSize > baseSize)
10737 maxSize -= baseSize;
10738 else
10739 maxSize = 0;
10740 }
10741 }
10742 }
10743 for(member = isMember ? topMember->members.first : _class->membersAndProperties.first; member; member = member->next)
10744 {
10745 if(!member->isProperty)
10746 {
10747 switch(member->type)
10748 {
10749 case 0:
10750 {
10751 if(member->dataTypeString)
10752 {
10753 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList(), * decls = MkList();
10754 struct Declarator * decl;
10755
10756 decl = SpecDeclFromString(member->dataTypeString, specs, MkDeclaratorIdentifier(MkIdentifier(member->name)));
10757 ListAdd(decls, MkStructDeclarator(decl, (((void *)0))));
10758 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(specs, decls, (((void *)0)))));
10759 if(!member->dataType)
10760 member->dataType = ProcessType(specs, decl);
10761 ReplaceThisClassSpecifiers(specs, topClass);
10762 {
10763 struct Type * type = ProcessType(specs, decl);
10764
10765 DeclareType(neededBy, member->dataType, 1, 0);
10766 FreeType(type);
10767 }
10768 ComputeTypeSize(member->dataType);
10769 size = member->dataType->size;
10770 alignment = member->dataType->alignment;
10771 if(alignment)
10772 {
10773 if(totalSize % alignment)
10774 totalSize += alignment - (totalSize % alignment);
10775 }
10776 totalSize += size;
10777 }
10778 break;
10779 }
10780 case 1:
10781 case 2:
10782 {
10783 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList(), * list = MkList();
10784 char id[100];
10785
10786 sprintf(id, "__anon%d", anonID++);
10787 size = 0;
10788 AddMembers(neededBy, list, (struct __ecereNameSpace__ecere__com__Class *)member, 1, &size, topClass, (((void *)0)));
10789 ListAdd(specs, MkStructOrUnion((member->type == 1) ? 4 : 3, (((void *)0)), list));
10790 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(specs, MkListOne(MkDeclaratorIdentifier(MkIdentifier(id))), (((void *)0)))));
10791 alignment = member->structAlignment;
10792 if(alignment)
10793 {
10794 if(totalSize % alignment)
10795 totalSize += alignment - (totalSize % alignment);
10796 }
10797 totalSize += size;
10798 break;
10799 }
10800 }
10801 }
10802 }
10803 if(retSize)
10804 {
10805 unsigned int __simpleStruct0;
10806
10807 if(topMember && topMember->type == 1)
10808 *retSize = (__simpleStruct0 = *retSize, (__simpleStruct0 > totalSize) ? __simpleStruct0 : totalSize);
10809 else
10810 *retSize += totalSize;
10811 }
10812 else if(totalSize < maxSize && _class->type != 1000)
10813 {
10814 int autoPadding = 0;
10815
10816 if(!isMember && _class->structAlignment && totalSize % _class->structAlignment)
10817 autoPadding = _class->structAlignment - (totalSize % _class->structAlignment);
10818 if(totalSize + autoPadding < maxSize)
10819 {
10820 char sizeString[50];
10821
10822 sprintf(sizeString, "%d", maxSize - totalSize);
10823 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(CHAR)), MkListOne(MkDeclaratorArray(MkDeclaratorIdentifier(MkIdentifier("__ecere_padding")), MkExpConstant(sizeString))), (((void *)0)))));
10824 if(addedPadding)
10825 *addedPadding = 1;
10826 }
10827 }
10828 if(context)
10829 FinishTemplatesContext(context);
10830 return topMember ? topMember->memberID : _class->memberID;
10831 }
10832
10833 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)
10834 {
10835 if(source && dest)
10836 {
10837 if(warnConst)
10838 CheckConstCompatibility(source, dest, 1);
10839 if(source->kind == 20 && dest->kind != 20)
10840 {
10841 struct Type * type = ProcessTemplateParameterType(source->__anon1.templateParameter);
10842
10843 if(type)
10844 source = type;
10845 }
10846 if(dest->kind == 20 && source->kind != 20)
10847 {
10848 struct Type * type = ProcessTemplateParameterType(dest->__anon1.templateParameter);
10849
10850 if(type)
10851 dest = type;
10852 }
10853 if(dest->classObjectType == 2 && dest->kind != 11)
10854 {
10855 if(source->classObjectType != 3)
10856 return 1;
10857 else
10858 {
10859 if((dest->__anon1._class && strcmp(dest->__anon1._class->string, "class")) || (source->__anon1._class && strcmp(source->__anon1._class->string, "class")))
10860 {
10861 return 1;
10862 }
10863 }
10864 }
10865 else
10866 {
10867 if(source->kind != 11 && source->classObjectType == 3)
10868 return 1;
10869 if(dest->kind != 11 && dest->classObjectType == 3 && source->classObjectType != 2)
10870 return 1;
10871 }
10872 if((dest->kind == 9 && source->kind == 9) || (dest->kind == 10 && source->kind == 10))
10873 {
10874 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))
10875 return 1;
10876 }
10877 if(dest->kind == 14 && source->kind != 0)
10878 return 1;
10879 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))
10880 return 1;
10881 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))
10882 return 1;
10883 if(((source->kind == 8 && dest->kind == 8) || (source->kind == 19 && dest->kind == 19)) && source->__anon1._class)
10884 {
10885 if(source->__anon1._class->__anon1.registered && source->__anon1._class->__anon1.registered->type == 3)
10886 {
10887 if(conversions != (((void *)0)))
10888 {
10889 if(source->__anon1._class->__anon1.registered == dest->__anon1._class->__anon1.registered)
10890 return 1;
10891 }
10892 else
10893 {
10894 struct __ecereNameSpace__ecere__com__Class * sourceBase, * destBase;
10895
10896 for(sourceBase = source->__anon1._class->__anon1.registered; sourceBase && sourceBase->base->type != 1000; sourceBase = sourceBase->base)
10897 ;
10898 for(destBase = dest->__anon1._class->__anon1.registered; destBase && destBase->base->type != 1000; destBase = destBase->base)
10899 ;
10900 if(sourceBase == destBase)
10901 return 1;
10902 }
10903 }
10904 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))
10905 return 1;
10906 else
10907 {
10908 if(enumBaseType && dest->__anon1._class && dest->__anon1._class->__anon1.registered && dest->__anon1._class->__anon1.registered->type == 4 && ((source->__anon1._class && source->__anon1._class->__anon1.registered && source->__anon1._class->__anon1.registered->type != 4) || source->kind == 8))
10909 {
10910 if(__ecereNameSpace__ecere__com__eClass_IsDerived(dest->__anon1._class->__anon1.registered, source->__anon1._class->__anon1.registered))
10911 {
10912 return 1;
10913 }
10914 }
10915 }
10916 }
10917 if(source->kind == 19 && dest->kind == 8 && dest->__anon1._class && !strcmp(dest->__anon1._class->string, "ecere::com::Class"))
10918 return 1;
10919 if(doConversion)
10920 {
10921 if(source->kind == 8)
10922 {
10923 struct __ecereNameSpace__ecere__com__Class * _class;
10924
10925 for(_class = source->__anon1._class ? source->__anon1._class->__anon1.registered : (((void *)0)); _class; _class = _class->base)
10926 {
10927 struct __ecereNameSpace__ecere__com__Property * convert;
10928
10929 for(convert = _class->conversions.first; convert; convert = convert->next)
10930 {
10931 if(convert->memberAccess == 1 || _class->module == privateModule)
10932 {
10933 struct Conversion * after = (conversions != (((void *)0))) ? conversions->last : (((void *)0));
10934
10935 if(!convert->dataType)
10936 convert->dataType = ProcessTypeString(convert->dataTypeString, 0);
10937 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))
10938 {
10939 if(!conversions && !convert->Get)
10940 return 1;
10941 else if(conversions != (((void *)0)))
10942 {
10943 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))
10944 return 1;
10945 else
10946 {
10947 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv->isGet = 1, conv);
10948
10949 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(conversions, after, conv);
10950 return 1;
10951 }
10952 }
10953 }
10954 }
10955 }
10956 }
10957 }
10958 if(dest->kind == 8)
10959 {
10960 struct __ecereNameSpace__ecere__com__Class * _class;
10961
10962 for(_class = dest->__anon1._class ? dest->__anon1._class->__anon1.registered : (((void *)0)); _class; _class = _class->base)
10963 {
10964 struct __ecereNameSpace__ecere__com__Property * convert;
10965
10966 for(convert = _class->conversions.first; convert; convert = convert->next)
10967 {
10968 if(convert->memberAccess == 1 || _class->module == privateModule)
10969 {
10970 struct Type * constType = (((void *)0));
10971 unsigned int success = 0;
10972
10973 if(!convert->dataType)
10974 convert->dataType = ProcessTypeString(convert->dataTypeString, 0);
10975 if(warnConst && convert->dataType->kind == 13 && convert->dataType->__anon1.type && dest->constant)
10976 {
10977 struct Type * ptrType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
10978
10979 constType = __extension__ ({
10980 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
10981
10982 __ecereInstance1->kind = 13, __ecereInstance1->refCount = 1, __ecereInstance1->__anon1.type = ptrType, __ecereInstance1;
10983 });
10984 CopyTypeInto(ptrType, convert->dataType->__anon1.type);
10985 ptrType->constant = 1;
10986 }
10987 if((constType || convert->dataType != dest) && MatchTypes(source, constType ? constType : convert->dataType, conversions, (((void *)0)), (((void *)0)), 1, 0, 0, 1, warnConst))
10988 {
10989 if(!conversions && !convert->Set)
10990 success = 1;
10991 else if(conversions != (((void *)0)))
10992 {
10993 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))
10994 success = 1;
10995 else
10996 {
10997 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv);
10998
10999 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(conversions, conv);
11000 success = 1;
11001 }
11002 }
11003 }
11004 if(constType)
11005 FreeType(constType);
11006 if(success)
11007 return 1;
11008 }
11009 }
11010 }
11011 if(enumBaseType && dest->__anon1._class && dest->__anon1._class->__anon1.registered && dest->__anon1._class->__anon1.registered->type == 4)
11012 {
11013 if(!dest->__anon1._class->__anon1.registered->dataType)
11014 dest->__anon1._class->__anon1.registered->dataType = ProcessTypeString(dest->__anon1._class->__anon1.registered->dataTypeString, 0);
11015 if(dest->__anon1._class->__anon1.registered->dataType->kind == 8 || source->truth || dest->truth)
11016 {
11017 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))
11018 {
11019 return 1;
11020 }
11021 }
11022 }
11023 }
11024 if(source->kind == 8)
11025 {
11026 struct __ecereNameSpace__ecere__com__Class * _class;
11027
11028 for(_class = source->__anon1._class ? source->__anon1._class->__anon1.registered : (((void *)0)); _class; _class = _class->base)
11029 {
11030 struct __ecereNameSpace__ecere__com__Property * convert;
11031
11032 for(convert = _class->conversions.first; convert; convert = convert->next)
11033 {
11034 if(convert->memberAccess == 1 || _class->module == privateModule)
11035 {
11036 struct Conversion * after = (conversions != (((void *)0))) ? conversions->last : (((void *)0));
11037
11038 if(!convert->dataType)
11039 convert->dataType = ProcessTypeString(convert->dataTypeString, 0);
11040 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))
11041 {
11042 if(!conversions && !convert->Get)
11043 return 1;
11044 else if(conversions != (((void *)0)))
11045 {
11046 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))
11047 return 1;
11048 else
11049 {
11050 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv->isGet = 1, conv);
11051
11052 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(conversions, after, conv);
11053 return 1;
11054 }
11055 }
11056 }
11057 }
11058 }
11059 }
11060 if(enumBaseType && source->__anon1._class && source->__anon1._class->__anon1.registered && source->__anon1._class->__anon1.registered->type == 4)
11061 {
11062 if(!source->__anon1._class->__anon1.registered->dataType)
11063 source->__anon1._class->__anon1.registered->dataType = ProcessTypeString(source->__anon1._class->__anon1.registered->dataTypeString, 0);
11064 if(!isConversionExploration || source->__anon1._class->__anon1.registered->dataType->kind == 8 || !strcmp(source->__anon1._class->__anon1.registered->name, "String"))
11065 {
11066 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))
11067 return 1;
11068 else if(MatchTypes(dest, source->__anon1._class->__anon1.registered->dataType, (((void *)0)), (((void *)0)), (((void *)0)), 0, 0, 0, 0, warnConst))
11069 return 1;
11070 }
11071 }
11072 }
11073 }
11074 if(source->kind == 8 || source->kind == 19)
11075 ;
11076 else if(dest->kind == source->kind && (dest->kind != 9 && dest->kind != 10 && dest->kind != 11 && dest->kind != 12 && dest->kind != 13 && dest->kind != 16))
11077 return 1;
11078 else if(dest->kind == 7 && source->kind == 6)
11079 return 1;
11080 else if(dest->kind == 2 && (source->kind == 1 || source->kind == 24))
11081 return 1;
11082 else if(dest->kind == 3 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 23))
11083 return 1;
11084 else if(dest->kind == 4 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 3 || source->kind == 22 || source->kind == 23))
11085 return 1;
11086 else if(dest->kind == 22 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 3 || source->kind == 23 || source->kind == 4))
11087 return 1;
11088 else if(dest->kind == 23 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 3 || source->kind == 4 || source->kind == 22))
11089 return 1;
11090 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))
11091 return 1;
11092 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))
11093 return 1;
11094 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)))
11095 {
11096 struct Type * paramSource, * paramDest;
11097
11098 if(dest->kind == 16)
11099 owningClassDest = dest->__anon1.__anon3.methodClass ? dest->__anon1.__anon3.methodClass : dest->__anon1.__anon3.method->_class;
11100 if(source->kind == 16)
11101 owningClassSource = source->__anon1.__anon3.methodClass ? source->__anon1.__anon3.methodClass : source->__anon1.__anon3.method->_class;
11102 if(dest->kind == 13 && dest->__anon1.type->kind == 11)
11103 dest = dest->__anon1.type;
11104 if(source->kind == 13 && source->__anon1.type->kind == 11)
11105 source = source->__anon1.type;
11106 if(dest->kind == 16)
11107 dest = dest->__anon1.__anon3.method->dataType;
11108 if(source->kind == 16)
11109 source = source->__anon1.__anon3.method->dataType;
11110 paramSource = source->__anon1.__anon2.params.first;
11111 if(paramSource && paramSource->kind == 0)
11112 paramSource = (((void *)0));
11113 paramDest = dest->__anon1.__anon2.params.first;
11114 if(paramDest && paramDest->kind == 0)
11115 paramDest = (((void *)0));
11116 if((dest->__anon1.__anon2.staticMethod || (!dest->__anon1.__anon2.thisClass && !owningClassDest)) && !(source->__anon1.__anon2.staticMethod || (!source->__anon1.__anon2.thisClass && !owningClassSource)))
11117 {
11118 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))))
11119 {
11120 if(paramDest && paramDest->kind == 8)
11121 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "method class must be derived from %s\n", (((void *)0))), paramDest->__anon1._class->string);
11122 else
11123 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "method class should not take an object\n", (((void *)0))));
11124 return 0;
11125 }
11126 paramDest = paramDest->next;
11127 }
11128 else if(!dest->__anon1.__anon2.staticMethod && (dest->__anon1.__anon2.thisClass || owningClassDest))
11129 {
11130 if((source->__anon1.__anon2.staticMethod || (!source->__anon1.__anon2.thisClass && !owningClassSource)))
11131 {
11132 if(dest->__anon1.__anon2.thisClass)
11133 {
11134 if(!paramSource || paramSource->kind != 8 || !__ecereNameSpace__ecere__com__eClass_IsDerived(paramSource->__anon1._class->__anon1.registered, dest->__anon1.__anon2.thisClass->__anon1.registered))
11135 {
11136 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "method class must be derived from %s\n", (((void *)0))), dest->__anon1.__anon2.thisClass->string);
11137 return 0;
11138 }
11139 }
11140 else
11141 {
11142 if(!paramSource || paramSource->kind != 8 || (owningClassDest && !__ecereNameSpace__ecere__com__eClass_IsDerived(paramSource->__anon1._class->__anon1.registered, owningClassDest)))
11143 {
11144 if(owningClassDest)
11145 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "%s expected to be derived from method class\n", (((void *)0))), owningClassDest->fullName);
11146 else
11147 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "overriding class expected to be derived from method class\n", (((void *)0))));
11148 return 0;
11149 }
11150 }
11151 paramSource = paramSource->next;
11152 }
11153 else
11154 {
11155 if(dest->__anon1.__anon2.thisClass)
11156 {
11157 if(!__ecereNameSpace__ecere__com__eClass_IsDerived(source->__anon1.__anon2.thisClass ? source->__anon1.__anon2.thisClass->__anon1.registered : owningClassSource, dest->__anon1.__anon2.thisClass->__anon1.registered))
11158 {
11159 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "method class must be derived from %s\n", (((void *)0))), dest->__anon1.__anon2.thisClass->string);
11160 return 0;
11161 }
11162 }
11163 else
11164 {
11165 if(source->__anon1.__anon2.thisClass && source->__anon1.__anon2.thisClass->__anon1.registered && owningClassDest && !__ecereNameSpace__ecere__com__eClass_IsDerived(source->__anon1.__anon2.thisClass->__anon1.registered, owningClassDest))
11166 {
11167 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "%s expected to be derived from method class\n", (((void *)0))), source->__anon1.__anon2.thisClass->__anon1.registered->fullName);
11168 return 0;
11169 }
11170 }
11171 }
11172 }
11173 if(!MatchTypes(source->__anon1.__anon2.returnType, dest->__anon1.__anon2.returnType, (((void *)0)), (((void *)0)), (((void *)0)), 1, 1, 0, 0, warnConst))
11174 {
11175 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible return type for function\n", (((void *)0))));
11176 return 0;
11177 }
11178 else
11179 CheckConstCompatibility(dest->__anon1.__anon2.returnType, source->__anon1.__anon2.returnType, 1);
11180 for(; paramDest; paramDest = paramDest->next)
11181 {
11182 if(!paramSource)
11183 {
11184 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "not enough parameters\n", (((void *)0))));
11185 return 0;
11186 }
11187 {
11188 struct Type * paramDestType = paramDest;
11189 struct Type * paramSourceType = paramSource;
11190 struct Type * type = paramDestType;
11191
11192 if(paramDest->kind == 20 && paramDest->__anon1.templateParameter->type == 0 && owningClassSource && paramSource->kind != 20)
11193 {
11194 int id = 0;
11195 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
11196 struct __ecereNameSpace__ecere__com__Class * sClass;
11197
11198 for(sClass = owningClassSource; sClass; sClass = sClass->base)
11199 {
11200 id = 0;
11201 if(sClass->templateClass)
11202 sClass = sClass->templateClass;
11203 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
11204 {
11205 if(curParam->type == 0 && !strcmp(type->__anon1.templateParameter->identifier->string, curParam->name))
11206 {
11207 for(sClass = sClass->base; sClass; sClass = sClass->base)
11208 {
11209 if(sClass->templateClass)
11210 sClass = sClass->templateClass;
11211 id += sClass->templateParams.count;
11212 }
11213 break;
11214 }
11215 id++;
11216 }
11217 if(curParam)
11218 break;
11219 }
11220 if(curParam)
11221 {
11222 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = owningClassSource->templateArgs[id];
11223
11224 paramDestType = type = ProcessTypeString(arg.__anon1.__anon1.dataTypeString, 0);
11225 }
11226 }
11227 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)))
11228 {
11229 char type[1024];
11230
11231 type[0] = (char)0;
11232 PrintType(paramDest, type, 0, 1);
11233 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible parameter %s (expected %s)\n", (((void *)0))), paramSource->name, type);
11234 if(paramDestType != paramDest)
11235 FreeType(paramDestType);
11236 return 0;
11237 }
11238 if(paramDestType != paramDest)
11239 FreeType(paramDestType);
11240 }
11241 paramSource = paramSource->next;
11242 }
11243 if(paramSource)
11244 {
11245 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "too many parameters\n", (((void *)0))));
11246 return 0;
11247 }
11248 return 1;
11249 }
11250 else if((dest->kind == 11 || (dest->kind == 13 && dest->__anon1.type->kind == 11) || dest->kind == 16) && (source->kind == 13 && source->__anon1.type->kind == 0))
11251 {
11252 return 1;
11253 }
11254 else if((dest->kind == 13 || dest->kind == 12) && (source->kind == 12 || source->kind == 13))
11255 {
11256 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))
11257 {
11258 ComputeTypeSize(source->__anon1.type);
11259 ComputeTypeSize(dest->__anon1.type);
11260 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))
11261 return 1;
11262 }
11263 }
11264 }
11265 return 0;
11266 }
11267
11268 void ComputeInstantiation(struct Expression * exp)
11269 {
11270 struct Instantiation * inst = exp->__anon1.instance;
11271 struct MembersInit * members;
11272 struct Symbol * classSym = inst->_class ? inst->_class->__anon1.__anon1.symbol : (((void *)0));
11273 struct __ecereNameSpace__ecere__com__Class * _class = classSym ? classSym->__anon1.registered : (((void *)0));
11274 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
11275 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
11276 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
11277 int subMemberStackPos = 0;
11278 uint64 bits = 0;
11279
11280 if(_class && (_class->type == 1 || _class->type == 0 || _class->type == 5))
11281 {
11282 if(inst->data)
11283 return ;
11284 if(_class->type == 0 || _class->type == 5)
11285 {
11286 inst->data = (unsigned char *)__ecereNameSpace__ecere__com__eInstance_New(_class);
11287 if(_class->type == 0)
11288 ((struct __ecereNameSpace__ecere__com__Instance *)(char *)((struct __ecereNameSpace__ecere__com__Instance *)inst->data))->_refCount++;
11289 }
11290 else
11291 inst->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
11292 }
11293 if(inst->members)
11294 {
11295 for(members = (*inst->members).first; members; members = members->next)
11296 {
11297 switch(members->type)
11298 {
11299 case 0:
11300 {
11301 if(members->__anon1.dataMembers)
11302 {
11303 struct MemberInit * member;
11304
11305 for(member = (*members->__anon1.dataMembers).first; member; member = member->next)
11306 {
11307 struct Identifier * ident = member->identifiers ? (*member->identifiers).first : (((void *)0));
11308 unsigned int found = 0;
11309 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
11310 struct __ecereNameSpace__ecere__com__DataMember * dataMember = (((void *)0));
11311 unsigned int dataMemberOffset;
11312
11313 if(!ident)
11314 {
11315 __ecereNameSpace__ecere__com__eClass_FindNextMember(_class, &curClass, &curMember, subMemberStack, &subMemberStackPos);
11316 if(curMember)
11317 {
11318 if(curMember->isProperty)
11319 prop = (struct __ecereNameSpace__ecere__com__Property *)curMember;
11320 else
11321 {
11322 dataMember = curMember;
11323 __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(_class, dataMember->name, &dataMemberOffset, privateModule, (((void *)0)), (((void *)0)));
11324 if(_class->type == 0)
11325 dataMemberOffset += _class->base->structSize;
11326 }
11327 found = 1;
11328 }
11329 }
11330 else
11331 {
11332 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, ident->string, privateModule);
11333 if(prop)
11334 {
11335 found = 1;
11336 if(prop->memberAccess == 1)
11337 {
11338 curMember = (struct __ecereNameSpace__ecere__com__DataMember *)prop;
11339 curClass = prop->_class;
11340 }
11341 }
11342 else
11343 {
11344 struct __ecereNameSpace__ecere__com__DataMember * _subMemberStack[256];
11345 int _subMemberStackPos = 0;
11346
11347 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(_class, ident->string, &dataMemberOffset, privateModule, _subMemberStack, &_subMemberStackPos);
11348 if(dataMember)
11349 {
11350 found = 1;
11351 if(dataMember->memberAccess == 1)
11352 {
11353 curMember = dataMember;
11354 curClass = dataMember->_class;
11355 memcpy(subMemberStack, _subMemberStack, sizeof(struct __ecereNameSpace__ecere__com__DataMember *) * _subMemberStackPos);
11356 subMemberStackPos = _subMemberStackPos;
11357 }
11358 }
11359 }
11360 }
11361 if(found && member->initializer && member->initializer->type == 0)
11362 {
11363 struct Expression * value = member->initializer->__anon1.exp;
11364 struct Type * type = (((void *)0));
11365 unsigned int deepMember = 0;
11366
11367 if(prop)
11368 {
11369 type = prop->dataType;
11370 }
11371 else if(dataMember)
11372 {
11373 if(!dataMember->dataType)
11374 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0);
11375 type = dataMember->dataType;
11376 }
11377 if(ident && ident->next)
11378 {
11379 deepMember = 1;
11380 for(ident = ident->next; ident && type; ident = ident->next)
11381 {
11382 if(type->kind == 8)
11383 {
11384 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(type->__anon1._class->__anon1.registered, ident->string, privateModule);
11385 if(prop)
11386 type = prop->dataType;
11387 else
11388 {
11389 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(type->__anon1._class->__anon1.registered, ident->string, &dataMemberOffset, privateModule, (((void *)0)), (((void *)0)));
11390 if(dataMember)
11391 type = dataMember->dataType;
11392 }
11393 }
11394 else if(type->kind == 9 || type->kind == 10)
11395 {
11396 struct Type * memberType;
11397
11398 for(memberType = type->__anon1.__anon1.members.first; memberType; memberType = memberType->next)
11399 {
11400 if(!strcmp(memberType->name, ident->string))
11401 {
11402 type = memberType;
11403 break;
11404 }
11405 }
11406 }
11407 }
11408 }
11409 if(value)
11410 {
11411 FreeType(value->destType);
11412 value->destType = type;
11413 if(type)
11414 type->refCount++;
11415 ComputeExpression(value);
11416 }
11417 if(!deepMember && type && value && (_class->type == 1 || _class->type == 0 || _class->type == 5))
11418 {
11419 if(type->kind == 8)
11420 {
11421 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
11422
11423 if(_class && (_class->type == 2 || _class->type == 3 || _class->type == 4))
11424 {
11425 if(!_class->dataType)
11426 _class->dataType = ProcessTypeString(_class->dataTypeString, 0);
11427 type = _class->dataType;
11428 }
11429 }
11430 if(dataMember)
11431 {
11432 void * ptr = inst->data + dataMemberOffset;
11433
11434 if(value->type == 2)
11435 {
11436 switch(type->kind)
11437 {
11438 case 3:
11439 {
11440 GetInt(value, (int *)ptr);
11441 break;
11442 }
11443 case 4:
11444 {
11445 GetInt64(value, (long long *)ptr);
11446 break;
11447 }
11448 case 22:
11449 {
11450 GetIntPtr(value, (intptr_t *)ptr);
11451 break;
11452 }
11453 case 23:
11454 {
11455 GetIntSize(value, (ssize_t *)ptr);
11456 break;
11457 }
11458 case 6:
11459 {
11460 GetFloat(value, (float *)ptr);
11461 break;
11462 }
11463 case 7:
11464 {
11465 GetDouble(value, (double *)ptr);
11466 break;
11467 }
11468 }
11469 }
11470 else if(value->type == 1)
11471 {
11472 if(type->kind == 8)
11473 {
11474 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
11475
11476 if(_class->type == 1)
11477 {
11478 ComputeTypeSize(type);
11479 if(value->__anon1.instance->data)
11480 memcpy(ptr, value->__anon1.instance->data, type->size);
11481 }
11482 }
11483 }
11484 }
11485 else if(prop && prop->Set != (void *)(intptr_t)1)
11486 {
11487 if(value->type == 1 && value->__anon1.instance->data)
11488 {
11489 if(type->kind == 8)
11490 {
11491 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
11492
11493 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)))
11494 {
11495 void (* Set)(void *, void *) = (void *)prop->Set;
11496
11497 Set(inst->data, value->__anon1.instance->data);
11498 PopulateInstance(inst);
11499 }
11500 }
11501 }
11502 else if(value->type == 2)
11503 {
11504 switch(type->kind)
11505 {
11506 case 7:
11507 {
11508 void (* Set)(void *, double) = (void *)prop->Set;
11509
11510 Set(inst->data, strtod(value->__anon1.__anon1.constant, (((void *)0))));
11511 break;
11512 }
11513 case 6:
11514 {
11515 void (* Set)(void *, float) = (void *)prop->Set;
11516
11517 Set(inst->data, (float)(strtod(value->__anon1.__anon1.constant, (((void *)0)))));
11518 break;
11519 }
11520 case 3:
11521 {
11522 void (* Set)(void *, int) = (void *)prop->Set;
11523
11524 Set(inst->data, strtol(value->__anon1.__anon1.constant, (((void *)0)), 0));
11525 break;
11526 }
11527 case 4:
11528 {
11529 void (* Set)(void *, long long) = (void *)prop->Set;
11530
11531 Set(inst->data, __ecereNameSpace__ecere__com___strtoi64(value->__anon1.__anon1.constant, (((void *)0)), 0));
11532 break;
11533 }
11534 case 22:
11535 {
11536 void (* Set)(void *, intptr_t) = (void *)prop->Set;
11537
11538 Set(inst->data, (intptr_t)__ecereNameSpace__ecere__com___strtoi64(value->__anon1.__anon1.constant, (((void *)0)), 0));
11539 break;
11540 }
11541 case 23:
11542 {
11543 void (* Set)(void *, ssize_t) = (void *)prop->Set;
11544
11545 Set(inst->data, (ssize_t)__ecereNameSpace__ecere__com___strtoi64(value->__anon1.__anon1.constant, (((void *)0)), 0));
11546 break;
11547 }
11548 }
11549 }
11550 else if(value->type == 3)
11551 {
11552 char temp[1024];
11553
11554 ReadString(temp, value->__anon1.__anon2.string);
11555 ((void (*)(void *, void *))(void *)prop->Set)(inst->data, temp);
11556 }
11557 }
11558 }
11559 else if(!deepMember && type && _class->type == 3)
11560 {
11561 if(prop)
11562 {
11563 if(value->type == 2)
11564 {
11565 if(type->kind == 8)
11566 {
11567 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
11568
11569 if(_class->type == 3)
11570 {
11571 if(!_class->dataType)
11572 _class->dataType = ProcessTypeString(_class->dataTypeString, 0);
11573 type = _class->dataType;
11574 }
11575 }
11576 switch(type->kind)
11577 {
11578 case 6:
11579 {
11580 float fValue;
11581 float (* Set)(float) = (void *)prop->Set;
11582
11583 GetFloat(member->initializer->__anon1.exp, &fValue);
11584 exp->__anon1.__anon1.constant = PrintFloat(Set(fValue));
11585 exp->type = 2;
11586 break;
11587 }
11588 case 7:
11589 {
11590 double dValue;
11591 double (* Set)(double) = (void *)prop->Set;
11592
11593 GetDouble(member->initializer->__anon1.exp, &dValue);
11594 exp->__anon1.__anon1.constant = PrintDouble(Set(dValue));
11595 exp->type = 2;
11596 break;
11597 }
11598 }
11599 }
11600 }
11601 }
11602 else if(!deepMember && type && _class->type == 2)
11603 {
11604 if(prop)
11605 {
11606 if(value->type == 1 && value->__anon1.instance->data)
11607 {
11608 unsigned int (* Set)(void *) = (void *)prop->Set;
11609
11610 bits = Set(value->__anon1.instance->data);
11611 }
11612 else if(value->type == 2)
11613 {
11614 }
11615 }
11616 else if(dataMember)
11617 {
11618 struct __ecereNameSpace__ecere__com__BitMember * bitMember = (struct __ecereNameSpace__ecere__com__BitMember *)dataMember;
11619 struct Type * type;
11620 uint64 part = 0;
11621
11622 bits = (bits & ~bitMember->mask);
11623 if(!bitMember->dataType)
11624 bitMember->dataType = ProcessTypeString(bitMember->dataTypeString, 0);
11625 type = bitMember->dataType;
11626 if(type->kind == 8 && type->__anon1._class && type->__anon1._class->__anon1.registered)
11627 {
11628 if(!type->__anon1._class->__anon1.registered->dataType)
11629 type->__anon1._class->__anon1.registered->dataType = ProcessTypeString(type->__anon1._class->__anon1.registered->dataTypeString, 0);
11630 type = type->__anon1._class->__anon1.registered->dataType;
11631 }
11632 switch(type->kind)
11633 {
11634 case 24:
11635 case 1:
11636 {
11637 unsigned char v;
11638
11639 type->isSigned ? GetChar(value, (char *)&v) : GetUChar(value, &v);
11640 part = (uint64)v;
11641 break;
11642 }
11643 case 2:
11644 {
11645 unsigned short v;
11646
11647 type->isSigned ? GetShort(value, (short *)&v) : GetUShort(value, &v);
11648 part = (uint64)v;
11649 break;
11650 }
11651 case 3:
11652 case 5:
11653 {
11654 unsigned int v;
11655
11656 type->isSigned ? GetInt(value, (int *)&v) : GetUInt(value, &v);
11657 part = (uint64)v;
11658 break;
11659 }
11660 case 4:
11661 {
11662 uint64 v;
11663
11664 type->isSigned ? GetInt64(value, (long long *)&v) : GetUInt64(value, &v);
11665 part = v;
11666 break;
11667 }
11668 case 22:
11669 {
11670 uintptr_t v;
11671
11672 type->isSigned ? GetIntPtr(value, (intptr_t *)&v) : GetUIntPtr(value, &v);
11673 part = (uint64)v;
11674 break;
11675 }
11676 case 23:
11677 {
11678 size_t v;
11679
11680 type->isSigned ? GetIntSize(value, (ssize_t *)&v) : GetUIntSize(value, &v);
11681 part = (uint64)v;
11682 break;
11683 }
11684 }
11685 bits |= part << bitMember->pos;
11686 }
11687 }
11688 }
11689 else
11690 {
11691 if(_class && _class->type == 3)
11692 {
11693 ComputeExpression(member->initializer->__anon1.exp);
11694 exp->__anon1.__anon1.constant = member->initializer->__anon1.exp->__anon1.__anon1.constant;
11695 exp->type = 2;
11696 member->initializer->__anon1.exp->__anon1.__anon1.constant = (((void *)0));
11697 }
11698 }
11699 }
11700 }
11701 break;
11702 }
11703 }
11704 }
11705 }
11706 if(_class && _class->type == 2)
11707 {
11708 exp->__anon1.__anon1.constant = PrintHexUInt(bits);
11709 exp->type = 2;
11710 }
11711 if(exp->type != 1)
11712 {
11713 FreeInstance(inst);
11714 }
11715 }
11716
11717 void CallOperator(struct Expression * exp, struct Expression * exp1, struct Expression * exp2, struct Operand * op1, struct Operand * op2)
11718 {
11719 if(exp->__anon1.op.op == SIZEOF)
11720 {
11721 FreeExpContents(exp);
11722 exp->type = 2;
11723 exp->__anon1.__anon1.constant = PrintUInt(ComputeTypeSize(op1->type));
11724 }
11725 else
11726 {
11727 if(!exp->__anon1.op.exp1)
11728 {
11729 switch(exp->__anon1.op.op)
11730 {
11731 case '+':
11732 {
11733 struct Expression * exp2 = exp->__anon1.op.exp2;
11734
11735 exp->__anon1.op.exp2 = (((void *)0));
11736 FreeExpContents(exp);
11737 FreeType(exp->expType);
11738 FreeType(exp->destType);
11739 *exp = *exp2;
11740 ((exp2 ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)exp2) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(exp2)) : 0), exp2 = 0);
11741 break;
11742 }
11743 case '-':
11744 if(op1->ops.Neg)
11745 {
11746 FreeExpContents(exp);
11747 op1->ops.Neg(exp, op1);
11748 }
11749 break;
11750 case '~':
11751 if(op1->ops.BitNot)
11752 {
11753 FreeExpContents(exp);
11754 op1->ops.BitNot(exp, op1);
11755 }
11756 break;
11757 case '!':
11758 if(op1->ops.Not)
11759 {
11760 FreeExpContents(exp);
11761 op1->ops.Not(exp, op1);
11762 }
11763 break;
11764 }
11765 }
11766 else
11767 {
11768 if(op1 && op2 && op1->type && op2->type && op1->kind != op2->kind)
11769 {
11770 if(Promote(op2, op1->kind, op1->type->isSigned))
11771 op2->kind = op1->kind, op2->ops = op1->ops;
11772 else if(Promote(op1, op2->kind, op2->type->isSigned))
11773 op1->kind = op2->kind, op1->ops = op2->ops;
11774 }
11775 switch(exp->__anon1.op.op)
11776 {
11777 case '+':
11778 if(op1->ops.Add)
11779 {
11780 FreeExpContents(exp);
11781 op1->ops.Add(exp, op1, op2);
11782 }
11783 break;
11784 case '-':
11785 if(op1->ops.Sub)
11786 {
11787 FreeExpContents(exp);
11788 op1->ops.Sub(exp, op1, op2);
11789 }
11790 break;
11791 case '*':
11792 if(op1->ops.Mul)
11793 {
11794 FreeExpContents(exp);
11795 op1->ops.Mul(exp, op1, op2);
11796 }
11797 break;
11798 case '/':
11799 if(op1->ops.Div)
11800 {
11801 FreeExpContents(exp);
11802 op1->ops.Div(exp, op1, op2);
11803 }
11804 break;
11805 case '%':
11806 if(op1->ops.Mod)
11807 {
11808 FreeExpContents(exp);
11809 op1->ops.Mod(exp, op1, op2);
11810 }
11811 break;
11812 case '&':
11813 if(exp->__anon1.op.exp2)
11814 {
11815 if(op1->ops.BitAnd)
11816 {
11817 FreeExpContents(exp);
11818 op1->ops.BitAnd(exp, op1, op2);
11819 }
11820 }
11821 break;
11822 case '|':
11823 if(op1->ops.BitOr)
11824 {
11825 FreeExpContents(exp);
11826 op1->ops.BitOr(exp, op1, op2);
11827 }
11828 break;
11829 case '^':
11830 if(op1->ops.BitXor)
11831 {
11832 FreeExpContents(exp);
11833 op1->ops.BitXor(exp, op1, op2);
11834 }
11835 break;
11836 case LEFT_OP:
11837 if(op1->ops.LShift)
11838 {
11839 FreeExpContents(exp);
11840 op1->ops.LShift(exp, op1, op2);
11841 }
11842 break;
11843 case RIGHT_OP:
11844 if(op1->ops.RShift)
11845 {
11846 FreeExpContents(exp);
11847 op1->ops.RShift(exp, op1, op2);
11848 }
11849 break;
11850 case EQ_OP:
11851 if(op1->ops.Equ)
11852 {
11853 FreeExpContents(exp);
11854 op1->ops.Equ(exp, op1, op2);
11855 }
11856 break;
11857 case NE_OP:
11858 if(op1->ops.Nqu)
11859 {
11860 FreeExpContents(exp);
11861 op1->ops.Nqu(exp, op1, op2);
11862 }
11863 break;
11864 case AND_OP:
11865 if(op1->ops.And)
11866 {
11867 FreeExpContents(exp);
11868 op1->ops.And(exp, op1, op2);
11869 }
11870 break;
11871 case OR_OP:
11872 if(op1->ops.Or)
11873 {
11874 FreeExpContents(exp);
11875 op1->ops.Or(exp, op1, op2);
11876 }
11877 break;
11878 case '>':
11879 if(op1->ops.Grt)
11880 {
11881 FreeExpContents(exp);
11882 op1->ops.Grt(exp, op1, op2);
11883 }
11884 break;
11885 case '<':
11886 if(op1->ops.Sma)
11887 {
11888 FreeExpContents(exp);
11889 op1->ops.Sma(exp, op1, op2);
11890 }
11891 break;
11892 case GE_OP:
11893 if(op1->ops.GrtEqu)
11894 {
11895 FreeExpContents(exp);
11896 op1->ops.GrtEqu(exp, op1, op2);
11897 }
11898 break;
11899 case LE_OP:
11900 if(op1->ops.SmaEqu)
11901 {
11902 FreeExpContents(exp);
11903 op1->ops.SmaEqu(exp, op1, op2);
11904 }
11905 break;
11906 }
11907 }
11908 }
11909 }
11910
11911 void ApplyAnyObjectLogic(struct Expression * e)
11912 {
11913 struct Type * destType = e->destType;
11914
11915 if(destType && (destType->classObjectType == 3))
11916 {
11917 if(e && e->expType)
11918 {
11919 struct Type * type = e->expType;
11920 struct __ecereNameSpace__ecere__com__Class * _class = (((void *)0));
11921
11922 if(type->kind == 8 && type->__anon1._class && type->__anon1._class->__anon1.registered)
11923 {
11924 _class = type->__anon1._class->__anon1.registered;
11925 }
11926 else if(type->kind == 19)
11927 {
11928 _class = FindClass("ecere::com::Class")->__anon1.registered;
11929 }
11930 else
11931 {
11932 char string[1024] = "";
11933 struct Symbol * classSym;
11934
11935 PrintTypeNoConst(type, string, 0, 1);
11936 classSym = FindClass(string);
11937 if(classSym)
11938 _class = classSym->__anon1.registered;
11939 }
11940 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)))
11941 {
11942 if(!_class || strcmp(_class->fullName, "char *"))
11943 {
11944 struct Expression * checkedExp = e, * newExp;
11945
11946 while(((checkedExp->type == 5 || checkedExp->type == 32 || checkedExp->type == 23) && checkedExp->__anon1.list) || checkedExp->type == 11)
11947 {
11948 if(checkedExp->type == 5 || checkedExp->type == 32 || checkedExp->type == 23)
11949 {
11950 if(checkedExp->type == 23)
11951 {
11952 checkedExp = (*((struct Statement *)(*checkedExp->__anon1.compound->__anon1.compound.statements).last)->__anon1.expressions).last;
11953 }
11954 else
11955 checkedExp = (*checkedExp->__anon1.list).last;
11956 }
11957 else if(checkedExp->type == 11)
11958 checkedExp = checkedExp->__anon1.cast.exp;
11959 }
11960 if(checkedExp && checkedExp->type == 4 && checkedExp->__anon1.op.op == '*' && !checkedExp->__anon1.op.exp1)
11961 {
11962 newExp = checkedExp->__anon1.op.exp2;
11963 checkedExp->__anon1.op.exp2 = (((void *)0));
11964 FreeExpContents(checkedExp);
11965 if(e->expType && e->expType->passAsTemplate)
11966 {
11967 char size[100];
11968
11969 ComputeTypeSize(e->expType);
11970 sprintf(size, "%d", e->expType->size);
11971 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))))));
11972 }
11973 ReplaceExpContents(checkedExp, newExp);
11974 e->byReference = 1;
11975 }
11976 else if(!e->byReference || (_class && _class->type == 5))
11977 {
11978 struct Expression * checkedExp;
11979
11980 {
11981 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;
11982
11983 if(_class && _class->type != 5 && _class->type != 0 && _class->type != 1 && !hasAddress)
11984 {
11985 struct Context * context = PushContext();
11986 struct Declarator * decl;
11987 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
11988 char typeString[1024];
11989 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
11990
11991 typeString[0] = '\0';
11992 *newExp = *e;
11993 newExp->prev = (((void *)0));
11994 newExp->next = (((void *)0));
11995 newExp->expType = (((void *)0));
11996 PrintTypeNoConst(e->expType, typeString, 0, 1);
11997 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
11998 newExp->destType = ProcessType(specs, decl);
11999 curContext = context;
12000 if(curCompound)
12001 {
12002 char name[100];
12003 struct __ecereNameSpace__ecere__sys__OldList * stmts = MkList();
12004
12005 e->type = 23;
12006 sprintf(name, "__internalValue%03X", internalValueCounter++);
12007 if(!curCompound->__anon1.compound.declarations)
12008 curCompound->__anon1.compound.declarations = MkList();
12009 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*curCompound->__anon1.compound.declarations), (((void *)0)), MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(name)), (((void *)0))))));
12010 ListAdd(stmts, MkExpressionStmt(MkListOne(MkExpOp(MkExpIdentifier(MkIdentifier(name)), '=', newExp))));
12011 ListAdd(stmts, MkExpressionStmt(MkListOne(MkExpIdentifier(MkIdentifier(name)))));
12012 e->__anon1.compound = MkCompoundStmt((((void *)0)), stmts);
12013 }
12014 else
12015 printf("libec: compiler error, curCompound is null in ApplyAnyObjectLogic\n");
12016 {
12017 struct Type * type = e->destType;
12018
12019 e->destType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
12020 CopyTypeInto(e->destType, type);
12021 e->destType->refCount = 1;
12022 e->destType->classObjectType = 0;
12023 FreeType(type);
12024 }
12025 e->__anon1.compound->__anon1.compound.context = context;
12026 PopContext(context);
12027 curContext = context->parent;
12028 }
12029 }
12030 checkedExp = e;
12031 while(((checkedExp->type == 5 || checkedExp->type == 32 || checkedExp->type == 23) && checkedExp->__anon1.list) || checkedExp->type == 11)
12032 {
12033 if(checkedExp->type == 5 || checkedExp->type == 32 || checkedExp->type == 23)
12034 {
12035 if(checkedExp->type == 23)
12036 {
12037 checkedExp = (*((struct Statement *)(*checkedExp->__anon1.compound->__anon1.compound.statements).last)->__anon1.expressions).last;
12038 }
12039 else
12040 checkedExp = (*checkedExp->__anon1.list).last;
12041 }
12042 else if(checkedExp->type == 11)
12043 checkedExp = checkedExp->__anon1.cast.exp;
12044 }
12045 {
12046 struct Expression * operand = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12047
12048 *operand = *checkedExp;
12049 __ecereMethod_Expression_Clear(checkedExp);
12050 checkedExp->destType = ProcessTypeString("void *", 0);
12051 checkedExp->expType = checkedExp->destType;
12052 checkedExp->destType->refCount++;
12053 checkedExp->type = 4;
12054 checkedExp->__anon1.op.op = '&';
12055 checkedExp->__anon1.op.exp1 = (((void *)0));
12056 checkedExp->__anon1.op.exp2 = operand;
12057 }
12058 }
12059 }
12060 }
12061 }
12062 }
12063 {
12064 }
12065 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))))
12066 {
12067 if(e->expType->classObjectType && destType && destType->classObjectType)
12068 {
12069 return ;
12070 }
12071 else
12072 {
12073 struct Expression * thisExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12074
12075 *thisExp = *e;
12076 thisExp->prev = (((void *)0));
12077 thisExp->next = (((void *)0));
12078 __ecereMethod_Expression_Clear(e);
12079 e->type = 5;
12080 e->__anon1.list = MkListOne(MkExpOp((((void *)0)), '*', thisExp->type == 0 ? thisExp : MkExpBrackets(MkListOne(thisExp))));
12081 if(thisExp->expType->kind == 8 && thisExp->expType->__anon1._class && thisExp->expType->__anon1._class->__anon1.registered && thisExp->expType->__anon1._class->__anon1.registered->type == 5)
12082 ((struct Expression *)(*e->__anon1.list).first)->byReference = 1;
12083 {
12084 e->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
12085 CopyTypeInto(e->expType, thisExp->expType);
12086 e->expType->byReference = 0;
12087 e->expType->refCount = 1;
12088 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))
12089 {
12090 e->expType->classObjectType = 0;
12091 }
12092 }
12093 }
12094 }
12095 else if(destType && e->expType && (e->expType->classObjectType == 3 || e->expType->classObjectType == 2) && !destType->classObjectType && destType->kind != 0)
12096 {
12097 if(destType->kind == 14)
12098 {
12099 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Unspecified type\n", (((void *)0))));
12100 }
12101 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))
12102 {
12103 unsigned int byReference = e->expType->byReference;
12104 struct Expression * thisExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12105 struct Declarator * decl;
12106 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
12107 char typeString[1024];
12108 struct Type * type;
12109 int backupClassObjectType;
12110 unsigned int backupByReference;
12111
12112 if(e->expType->kind == 8 && e->expType->__anon1._class && e->expType->__anon1._class->__anon1.registered && strcmp(e->expType->__anon1._class->__anon1.registered->name, "class"))
12113 type = e->expType;
12114 else
12115 type = destType;
12116 backupClassObjectType = type->classObjectType;
12117 backupByReference = type->byReference;
12118 type->classObjectType = 0;
12119 type->byReference = 0;
12120 typeString[0] = '\0';
12121 PrintType(type, typeString, 0, 1);
12122 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
12123 type->classObjectType = backupClassObjectType;
12124 type->byReference = backupByReference;
12125 *thisExp = *e;
12126 thisExp->prev = (((void *)0));
12127 thisExp->next = (((void *)0));
12128 __ecereMethod_Expression_Clear(e);
12129 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)))
12130 {
12131 unsigned int passAsTemplate = thisExp->destType->passAsTemplate;
12132 struct Type * t;
12133
12134 destType->refCount++;
12135 e->type = 4;
12136 e->__anon1.op.op = '*';
12137 e->__anon1.op.exp1 = (((void *)0));
12138 e->__anon1.op.exp2 = MkExpCast(MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl)), thisExp);
12139 t = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
12140 CopyTypeInto(t, thisExp->destType);
12141 t->passAsTemplate = 0;
12142 FreeType(thisExp->destType);
12143 thisExp->destType = t;
12144 t = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
12145 CopyTypeInto(t, destType);
12146 t->passAsTemplate = passAsTemplate;
12147 FreeType(destType);
12148 destType = t;
12149 destType->refCount = 0;
12150 e->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
12151 CopyTypeInto(e->expType, type);
12152 if(type->passAsTemplate)
12153 {
12154 e->expType->classObjectType = 0;
12155 e->expType->passAsTemplate = 0;
12156 }
12157 e->expType->byReference = 0;
12158 e->expType->refCount = 1;
12159 }
12160 else
12161 {
12162 e->type = 11;
12163 e->__anon1.cast.typeName = MkTypeName(specs, decl);
12164 e->__anon1.cast.exp = thisExp;
12165 e->byReference = 1;
12166 e->expType = type;
12167 type->refCount++;
12168 }
12169 if(e->destType)
12170 FreeType(e->destType);
12171 e->destType = destType;
12172 destType->refCount++;
12173 }
12174 }
12175 }
12176
12177 void ComputeModuleClasses(struct __ecereNameSpace__ecere__com__Instance * module)
12178 {
12179 struct __ecereNameSpace__ecere__com__Class * _class;
12180 struct __ecereNameSpace__ecere__sys__OldLink * subModule;
12181
12182 for(subModule = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->modules.first; subModule; subModule = subModule->next)
12183 ComputeModuleClasses(subModule->data);
12184 for(_class = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->classes.first; _class; _class = _class->next)
12185 ComputeClassMembers(_class, 0);
12186 }
12187
12188 int ComputeTypeSize(struct Type * type)
12189 {
12190 unsigned int size = type ? type->size : 0;
12191
12192 if(!size && type && !type->computing)
12193 {
12194 type->computing = 1;
12195 switch(type->kind)
12196 {
12197 case 24:
12198 type->alignment = size = sizeof(char);
12199 break;
12200 case 1:
12201 type->alignment = size = sizeof(char);
12202 break;
12203 case 3:
12204 type->alignment = size = sizeof(int);
12205 break;
12206 case 4:
12207 type->alignment = size = sizeof(long long);
12208 break;
12209 case 22:
12210 type->alignment = size = targetBits / 8;
12211 type->pointerAlignment = 1;
12212 break;
12213 case 23:
12214 type->alignment = size = targetBits / 8;
12215 type->pointerAlignment = 1;
12216 break;
12217 case 5:
12218 type->alignment = size = sizeof(long);
12219 break;
12220 case 2:
12221 type->alignment = size = sizeof(short);
12222 break;
12223 case 6:
12224 type->alignment = size = sizeof(float);
12225 break;
12226 case 7:
12227 type->alignment = size = sizeof(double);
12228 break;
12229 case 8:
12230 {
12231 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class ? type->__anon1._class->__anon1.registered : (((void *)0));
12232
12233 if(_class && _class->type == 1)
12234 {
12235 ComputeClassMembers(_class, 0);
12236 type->alignment = _class->structAlignment;
12237 type->pointerAlignment = (unsigned int)_class->pointerAlignment;
12238 size = _class->structSize;
12239 if(type->alignment && size % type->alignment)
12240 size += type->alignment - (size % type->alignment);
12241 }
12242 else if(_class && (_class->type == 3 || _class->type == 4 || _class->type == 2))
12243 {
12244 if(!_class->dataType)
12245 _class->dataType = ProcessTypeString(_class->dataTypeString, 0);
12246 size = type->alignment = ComputeTypeSize(_class->dataType);
12247 }
12248 else
12249 {
12250 size = type->alignment = targetBits / 8;
12251 type->pointerAlignment = 1;
12252 }
12253 break;
12254 }
12255 case 13:
12256 case 19:
12257 size = type->alignment = targetBits / 8;
12258 type->pointerAlignment = 1;
12259 break;
12260 case 12:
12261 if(type->__anon1.__anon4.arraySizeExp)
12262 {
12263 ProcessExpressionType(type->__anon1.__anon4.arraySizeExp);
12264 ComputeExpression(type->__anon1.__anon4.arraySizeExp);
12265 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)))
12266 {
12267 struct Location oldLoc = yylloc;
12268 char expression[10240];
12269
12270 expression[0] = '\0';
12271 type->__anon1.__anon4.arraySizeExp->expType = (((void *)0));
12272 yylloc = type->__anon1.__anon4.arraySizeExp->loc;
12273 if(inCompiler)
12274 PrintExpression(type->__anon1.__anon4.arraySizeExp, expression);
12275 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Array size not constant int (%s)\n", (((void *)0))), expression);
12276 yylloc = oldLoc;
12277 }
12278 GetInt(type->__anon1.__anon4.arraySizeExp, &type->__anon1.__anon4.arraySize);
12279 }
12280 else if(type->__anon1.__anon4.enumClass)
12281 {
12282 if(type->__anon1.__anon4.enumClass && type->__anon1.__anon4.enumClass->__anon1.registered && type->__anon1.__anon4.enumClass->__anon1.registered->type == 4)
12283 {
12284 type->__anon1.__anon4.arraySize = (int)__ecereNameSpace__ecere__com__eClass_GetProperty(type->__anon1.__anon4.enumClass->__anon1.registered, "enumSize");
12285 }
12286 else
12287 type->__anon1.__anon4.arraySize = 0;
12288 }
12289 else
12290 {
12291 type->__anon1.__anon4.arraySize = 0;
12292 }
12293 size = ComputeTypeSize(type->__anon1.type) * type->__anon1.__anon4.arraySize;
12294 if(type->__anon1.type)
12295 {
12296 type->alignment = type->__anon1.type->alignment;
12297 type->pointerAlignment = type->__anon1.type->pointerAlignment;
12298 }
12299 break;
12300 case 9:
12301 {
12302 if(!type->__anon1.__anon1.members.first && type->__anon1.__anon1.enumName)
12303 {
12304 struct Symbol * symbol = FindStruct(curContext, type->__anon1.__anon1.enumName);
12305
12306 if(symbol && symbol->type)
12307 {
12308 ComputeTypeSize(symbol->type);
12309 size = symbol->type->size;
12310 }
12311 }
12312 else
12313 {
12314 struct Type * member;
12315
12316 for(member = type->__anon1.__anon1.members.first; member; member = member->next)
12317 {
12318 int __simpleStruct0, __simpleStruct1;
12319 unsigned int addSize = ComputeTypeSize(member);
12320
12321 member->offset = size;
12322 if(member->alignment && size % member->alignment)
12323 member->offset += member->alignment - (size % member->alignment);
12324 size = member->offset;
12325 if(member->pointerAlignment && type->size <= 4)
12326 type->pointerAlignment = 1;
12327 else if(!member->pointerAlignment && member->alignment >= 8)
12328 type->pointerAlignment = 0;
12329 type->alignment = (__simpleStruct0 = type->alignment, __simpleStruct1 = member->alignment, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
12330 size += addSize;
12331 }
12332 if(type->alignment && size % type->alignment)
12333 size += type->alignment - (size % type->alignment);
12334 }
12335 break;
12336 }
12337 case 10:
12338 {
12339 if(!type->__anon1.__anon1.members.first && type->__anon1.__anon1.enumName)
12340 {
12341 struct Symbol * symbol = FindStruct(curContext, type->__anon1.__anon1.enumName);
12342
12343 if(symbol && symbol->type)
12344 {
12345 ComputeTypeSize(symbol->type);
12346 size = symbol->type->size;
12347 type->alignment = symbol->type->alignment;
12348 }
12349 }
12350 else
12351 {
12352 struct Type * member;
12353
12354 for(member = type->__anon1.__anon1.members.first; member; member = member->next)
12355 {
12356 int __simpleStruct0, __simpleStruct1;
12357 unsigned int addSize = ComputeTypeSize(member);
12358
12359 member->offset = size;
12360 if(member->alignment && size % member->alignment)
12361 member->offset += member->alignment - (size % member->alignment);
12362 size = member->offset;
12363 if(member->pointerAlignment && type->size <= 4)
12364 type->pointerAlignment = 1;
12365 else if(!member->pointerAlignment && member->alignment >= 8)
12366 type->pointerAlignment = 0;
12367 type->alignment = (__simpleStruct0 = type->alignment, __simpleStruct1 = member->alignment, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
12368 size = ((size > addSize) ? size : addSize);
12369 }
12370 if(type->alignment && size % type->alignment)
12371 size += type->alignment - (size % type->alignment);
12372 }
12373 break;
12374 }
12375 case 20:
12376 {
12377 struct TemplateParameter * param = type->__anon1.templateParameter;
12378 struct Type * baseType = ProcessTemplateParameterType(param);
12379
12380 if(baseType)
12381 {
12382 size = ComputeTypeSize(baseType);
12383 type->alignment = baseType->alignment;
12384 type->pointerAlignment = baseType->pointerAlignment;
12385 }
12386 else
12387 type->alignment = size = sizeof(uint64);
12388 break;
12389 }
12390 case 15:
12391 {
12392 type->alignment = size = sizeof(enum
12393 {
12394 test
12395 });
12396 break;
12397 }
12398 case 21:
12399 {
12400 type->alignment = size = targetBits / 8;
12401 type->pointerAlignment = 1;
12402 break;
12403 }
12404 }
12405 type->size = size;
12406 type->computing = 0;
12407 }
12408 return size;
12409 }
12410
12411 struct External * _DeclareStruct(struct External * neededBy, const char * name, unsigned int skipNoHead, unsigned int needDereference, unsigned int fwdDecl)
12412 {
12413 struct External * external = (((void *)0));
12414 struct Symbol * classSym = FindClass(name);
12415 struct __ecereNameSpace__ecere__sys__OldList * curDeclarations = (((void *)0));
12416 struct Specifier * curSpec = (((void *)0));
12417
12418 if(!inCompiler || !classSym)
12419 return (((void *)0));
12420 if(classSym->__anon1.registered && (classSym->__anon1.registered->type == 2 || classSym->__anon1.registered->type == 3 || classSym->__anon1.registered->type == 4))
12421 return (((void *)0));
12422 if(!classSym->__anon1.registered || (classSym->__anon1.registered->type == 0 && classSym->__anon1.registered->structSize && classSym->__anon1.registered->base && classSym->__anon1.registered->base->base))
12423 _DeclareStruct(neededBy, "ecere::com::Instance", 0, 1, fwdDecl);
12424 external = classSym->__anon2.__anon1.structExternal;
12425 if(external && external->__anon1.declaration)
12426 {
12427 struct Specifier * spec;
12428
12429 for(spec = external->__anon1.declaration->__anon1.__anon1.specifiers ? (*external->__anon1.declaration->__anon1.__anon1.specifiers).first : (((void *)0)); spec; spec = spec->next)
12430 if(spec->type == 3 || spec->type == 4)
12431 {
12432 curSpec = spec;
12433 curDeclarations = spec->__anon1.__anon2.definitions;
12434 break;
12435 }
12436 }
12437 if(classSym->__anon1.registered && !classSym->declaring && classSym->imported && (!classSym->declaredStructSym || (classSym->__anon1.registered->type == 5 && !skipNoHead && external && !curDeclarations)))
12438 {
12439 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
12440 struct __ecereNameSpace__ecere__sys__OldList * declarations = (((void *)0));
12441 char structName[1024];
12442 unsigned int addedPadding = 0;
12443
12444 classSym->declaring++;
12445 if(strchr(classSym->string, '<'))
12446 {
12447 if(classSym->__anon1.registered->templateClass)
12448 {
12449 external = _DeclareStruct(neededBy, classSym->__anon1.registered->templateClass->fullName, skipNoHead, needDereference, fwdDecl);
12450 classSym->declaring--;
12451 }
12452 return external;
12453 }
12454 structName[0] = (char)0;
12455 FullClassNameCat(structName, name, 0);
12456 classSym->declaredStructSym = 1;
12457 if(!external || (classSym->__anon1.registered->type == 5 && !skipNoHead && !curDeclarations))
12458 {
12459 unsigned int add = 0;
12460
12461 if(!external)
12462 {
12463 external = MkExternalDeclaration((((void *)0)));
12464 classSym->__anon2.__anon1.structExternal = external;
12465 external->symbol = classSym;
12466 add = 1;
12467 }
12468 if(!skipNoHead)
12469 {
12470 declarations = MkList();
12471 AddMembers(external, declarations, classSym->__anon1.registered, 0, (((void *)0)), classSym->__anon1.registered, &addedPadding);
12472 }
12473 if(declarations && (!(*declarations).count || ((*declarations).count == 1 && addedPadding)))
12474 {
12475 FreeList(declarations, (void *)(FreeClassDef));
12476 declarations = (((void *)0));
12477 }
12478 if(classSym->__anon1.registered->type != 5 && !declarations)
12479 {
12480 FreeExternal(external);
12481 external = (((void *)0));
12482 classSym->__anon2.__anon1.structExternal = (((void *)0));
12483 }
12484 else
12485 {
12486 if(curSpec)
12487 curSpec->__anon1.__anon2.definitions = declarations;
12488 else
12489 {
12490 char className[1024];
12491
12492 strcpy(className, "__ecereClass_");
12493 FullClassNameCat(className, classSym->string, 1);
12494 specifiers = MkList();
12495 declarators = MkList();
12496 ListAdd(specifiers, MkStructOrUnion(3, MkIdentifier(structName), declarations));
12497 external->__anon1.declaration = MkDeclaration(specifiers, declarators);
12498 }
12499 if(add)
12500 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*ast), external);
12501 }
12502 }
12503 classSym->declaring--;
12504 }
12505 else if(!classSym->declaredStructSym && classSym->__anon2.__anon1.structExternal)
12506 {
12507 classSym->declaredStructSym = 1;
12508 if(classSym->__anon1.registered)
12509 DeclareMembers(classSym->__anon2.__anon1.structExternal, classSym->__anon1.registered, 0);
12510 if(classSym->__anon2.__anon1.structExternal->__anon1.declaration && classSym->__anon2.__anon1.structExternal->__anon1.declaration->__anon1.__anon1.specifiers)
12511 {
12512 struct Specifier * spec;
12513
12514 for(spec = (*classSym->__anon2.__anon1.structExternal->__anon1.declaration->__anon1.__anon1.specifiers).first; spec; spec = spec->next)
12515 {
12516 if(spec->__anon1.__anon2.definitions)
12517 IdentifyAnonStructs(spec->__anon1.__anon2.definitions);
12518 }
12519 }
12520 }
12521 if(inCompiler && neededBy && (external || !classSym->imported))
12522 {
12523 if(!external)
12524 {
12525 classSym->__anon2.__anon1.structExternal = external = MkExternalDeclaration((((void *)0)));
12526 external->symbol = classSym;
12527 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*ast), external);
12528 }
12529 if(fwdDecl)
12530 {
12531 struct External * e = external->fwdDecl ? external->fwdDecl : external;
12532
12533 if(((struct __ecereNameSpace__ecere__com__LinkList *)(((char *)e->incoming + 0 + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->count)
12534 __ecereMethod_External_CreateUniqueEdge(neededBy, e, !needDereference && !external->fwdDecl);
12535 }
12536 else
12537 __ecereMethod_External_CreateUniqueEdge(neededBy, external, !needDereference);
12538 }
12539 return external;
12540 }
12541
12542 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)
12543 {
12544 struct Identifier * ident = member->identifiers ? (*member->identifiers).first : (((void *)0));
12545 unsigned int found = 0;
12546 struct __ecereNameSpace__ecere__com__DataMember * dataMember = (((void *)0));
12547 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
12548 unsigned int freeType = 0;
12549
12550 yylloc = member->loc;
12551 if(!ident)
12552 {
12553 if(curMember)
12554 {
12555 __ecereNameSpace__ecere__com__eClass_FindNextMember(_class, curClass, curMember, subMemberStack, subMemberStackPos);
12556 if(*curMember)
12557 {
12558 found = 1;
12559 dataMember = *curMember;
12560 }
12561 }
12562 }
12563 else
12564 {
12565 struct __ecereNameSpace__ecere__com__DataMember * thisMember = (struct __ecereNameSpace__ecere__com__DataMember *)__ecereNameSpace__ecere__com__eClass_FindProperty(_class, ident->string, privateModule);
12566 struct __ecereNameSpace__ecere__com__DataMember * _subMemberStack[256];
12567 int _subMemberStackPos = 0;
12568
12569 if(!thisMember)
12570 thisMember = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, ident->string, privateModule, _subMemberStack, &_subMemberStackPos);
12571 if(thisMember)
12572 {
12573 dataMember = thisMember;
12574 if(curMember && thisMember->memberAccess == 1)
12575 {
12576 *curMember = thisMember;
12577 *curClass = thisMember->_class;
12578 memcpy(subMemberStack, _subMemberStack, sizeof(struct __ecereNameSpace__ecere__com__DataMember *) * _subMemberStackPos);
12579 *subMemberStackPos = _subMemberStackPos;
12580 }
12581 found = 1;
12582 }
12583 else
12584 {
12585 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, ident->string, privateModule);
12586 if(method && method->type == 1)
12587 found = 1;
12588 else
12589 method = (((void *)0));
12590 }
12591 }
12592 if(found)
12593 {
12594 struct Type * type = (((void *)0));
12595
12596 if(dataMember)
12597 {
12598 if(!dataMember->dataType && dataMember->dataTypeString)
12599 {
12600 struct Context * context = SetupTemplatesContext(_class);
12601
12602 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0);
12603 FinishTemplatesContext(context);
12604 }
12605 type = dataMember->dataType;
12606 }
12607 else if(method)
12608 {
12609 if(!method->dataType)
12610 ProcessMethodType(method);
12611 type = method->dataType;
12612 }
12613 if(ident && ident->next)
12614 {
12615 for(ident = ident->next; ident && type; ident = ident->next)
12616 {
12617 if(type->kind == 8)
12618 {
12619 dataMember = (struct __ecereNameSpace__ecere__com__DataMember *)__ecereNameSpace__ecere__com__eClass_FindProperty(type->__anon1._class->__anon1.registered, ident->string, privateModule);
12620 if(!dataMember)
12621 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMember(type->__anon1._class->__anon1.registered, ident->string, privateModule, (((void *)0)), (((void *)0)));
12622 if(dataMember)
12623 type = dataMember->dataType;
12624 }
12625 else if(type->kind == 9 || type->kind == 10)
12626 {
12627 struct Type * memberType;
12628
12629 for(memberType = type->__anon1.__anon1.members.first; memberType; memberType = memberType->next)
12630 {
12631 if(!strcmp(memberType->name, ident->string))
12632 {
12633 type = memberType;
12634 break;
12635 }
12636 }
12637 }
12638 }
12639 }
12640 if(type && type->kind == 20 && type->__anon1.templateParameter->type == 0 && _class->templateArgs)
12641 {
12642 int id = 0;
12643 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
12644 struct __ecereNameSpace__ecere__com__Class * sClass;
12645
12646 for(sClass = _class; sClass; sClass = sClass->base)
12647 {
12648 id = 0;
12649 if(sClass->templateClass)
12650 sClass = sClass->templateClass;
12651 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
12652 {
12653 if(curParam->type == 0 && !strcmp(type->__anon1.templateParameter->identifier->string, curParam->name))
12654 {
12655 for(sClass = sClass->base; sClass; sClass = sClass->base)
12656 {
12657 if(sClass->templateClass)
12658 sClass = sClass->templateClass;
12659 id += sClass->templateParams.count;
12660 }
12661 break;
12662 }
12663 id++;
12664 }
12665 if(curParam)
12666 break;
12667 }
12668 if(curParam)
12669 {
12670 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = _class->templateArgs[id];
12671
12672 if(arg.__anon1.__anon1.dataTypeString)
12673 {
12674 unsigned int constant = type->constant;
12675
12676 type = ProcessTypeString(arg.__anon1.__anon1.dataTypeString, 0);
12677 if(type->kind == 8 && constant)
12678 type->constant = 1;
12679 else if(type->kind == 13)
12680 {
12681 struct Type * t = type->__anon1.type;
12682
12683 while(t->kind == 13)
12684 t = t->__anon1.type;
12685 if(constant)
12686 t->constant = constant;
12687 }
12688 freeType = 1;
12689 if(type && _class->templateClass)
12690 type->passAsTemplate = 1;
12691 if(type)
12692 {
12693 }
12694 }
12695 }
12696 }
12697 if(type && type->kind == 8 && type->__anon1._class && type->__anon1._class->__anon1.registered && strchr(type->__anon1._class->__anon1.registered->fullName, '<'))
12698 {
12699 struct __ecereNameSpace__ecere__com__Class * expClass = type->__anon1._class->__anon1.registered;
12700 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
12701 int paramCount = 0;
12702 int lastParam = -1;
12703 char templateString[1024];
12704 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
12705
12706 sprintf(templateString, "%s<", expClass->templateClass->fullName);
12707 for(cClass = expClass; cClass; cClass = cClass->base)
12708 {
12709 int p = 0;
12710
12711 if(cClass->templateClass)
12712 cClass = cClass->templateClass;
12713 for(param = cClass->templateParams.first; param; param = param->next)
12714 {
12715 int id = p;
12716 struct __ecereNameSpace__ecere__com__Class * sClass;
12717 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
12718
12719 for(sClass = cClass->base; sClass; sClass = sClass->base)
12720 {
12721 if(sClass->templateClass)
12722 sClass = sClass->templateClass;
12723 id += sClass->templateParams.count;
12724 }
12725 arg = expClass->templateArgs[id];
12726 for(sClass = _class; sClass; sClass = sClass->base)
12727 {
12728 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * cParam;
12729 int p = 0;
12730 struct __ecereNameSpace__ecere__com__Class * nextClass;
12731
12732 if(sClass->templateClass)
12733 sClass = sClass->templateClass;
12734 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
12735 {
12736 if(nextClass->templateClass)
12737 nextClass = nextClass->templateClass;
12738 p += nextClass->templateParams.count;
12739 }
12740 for(cParam = sClass->templateParams.first; cParam; cParam = cParam->next, p++)
12741 {
12742 if(cParam->type == 0 && arg.__anon1.__anon1.dataTypeString && !strcmp(cParam->name, arg.__anon1.__anon1.dataTypeString))
12743 {
12744 if(_class->templateArgs && arg.__anon1.__anon1.dataTypeString && (!param->defaultArg.__anon1.__anon1.dataTypeString || strcmp(arg.__anon1.__anon1.dataTypeString, param->defaultArg.__anon1.__anon1.dataTypeString)))
12745 {
12746 arg.__anon1.__anon1.dataTypeString = _class->templateArgs[p].__anon1.__anon1.dataTypeString;
12747 arg.__anon1.__anon1.dataTypeClass = _class->templateArgs[p].__anon1.__anon1.dataTypeClass;
12748 break;
12749 }
12750 }
12751 }
12752 }
12753 {
12754 char argument[256];
12755
12756 argument[0] = '\0';
12757 switch(param->type)
12758 {
12759 case 2:
12760 {
12761 char expString[1024];
12762 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
12763 struct Declarator * decl = SpecDeclFromString(param->__anon1.dataTypeString, specs, (((void *)0)));
12764 struct Expression * exp;
12765 char * string = PrintHexUInt64(arg.__anon1.expression.__anon1.ui64);
12766
12767 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
12768 (__ecereNameSpace__ecere__com__eSystem_Delete(string), string = 0);
12769 ProcessExpressionType(exp);
12770 ComputeExpression(exp);
12771 expString[0] = '\0';
12772 PrintExpression(exp, expString);
12773 strcat(argument, expString);
12774 FreeExpression(exp);
12775 break;
12776 }
12777 case 1:
12778 {
12779 strcat(argument, arg.__anon1.__anon2.__anon1.member->name);
12780 break;
12781 }
12782 case 0:
12783 {
12784 if(arg.__anon1.__anon1.dataTypeString && (!param->defaultArg.__anon1.__anon1.dataTypeString || strcmp(arg.__anon1.__anon1.dataTypeString, param->defaultArg.__anon1.__anon1.dataTypeString)))
12785 strcat(argument, arg.__anon1.__anon1.dataTypeString);
12786 break;
12787 }
12788 }
12789 if(argument[0])
12790 {
12791 if(paramCount)
12792 strcat(templateString, ", ");
12793 if(lastParam != p - 1)
12794 {
12795 strcat(templateString, param->name);
12796 strcat(templateString, " = ");
12797 }
12798 strcat(templateString, argument);
12799 paramCount++;
12800 lastParam = p;
12801 }
12802 p++;
12803 }
12804 }
12805 }
12806 {
12807 int len = strlen(templateString);
12808
12809 if(templateString[len - 1] == '<')
12810 len--;
12811 else
12812 {
12813 if(templateString[len - 1] == '>')
12814 templateString[len++] = ' ';
12815 templateString[len++] = '>';
12816 }
12817 templateString[len++] = '\0';
12818 }
12819 {
12820 struct Context * context = SetupTemplatesContext(_class);
12821
12822 if(freeType)
12823 FreeType(type);
12824 type = ProcessTypeString(templateString, 0);
12825 freeType = 1;
12826 FinishTemplatesContext(context);
12827 }
12828 }
12829 if(method && member->initializer && member->initializer->type == 0 && member->initializer->__anon1.exp)
12830 {
12831 ProcessExpressionType(member->initializer->__anon1.exp);
12832 if(!member->initializer->__anon1.exp->expType)
12833 {
12834 if(inCompiler)
12835 {
12836 char expString[10240];
12837
12838 expString[0] = '\0';
12839 PrintExpression(member->initializer->__anon1.exp, expString);
12840 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
12841 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved symbol used as an instance method %s\n", (((void *)0))), expString);
12842 }
12843 }
12844 else if(!MatchTypes(member->initializer->__anon1.exp->expType, type, (((void *)0)), (((void *)0)), _class, 1, 1, 0, 0, 1))
12845 {
12846 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible instance method %s\n", (((void *)0))), ident->string);
12847 }
12848 }
12849 else if(member->initializer)
12850 {
12851 ProcessInitializer(member->initializer, type);
12852 }
12853 if(freeType)
12854 FreeType(type);
12855 }
12856 else
12857 {
12858 if(_class && _class->type == 3)
12859 {
12860 if(member->initializer)
12861 {
12862 struct Type * type = MkClassType(_class->fullName);
12863
12864 ProcessInitializer(member->initializer, type);
12865 FreeType(type);
12866 }
12867 }
12868 else
12869 {
12870 if(member->initializer)
12871 {
12872 ProcessInitializer(member->initializer, (((void *)0)));
12873 }
12874 if(ident)
12875 {
12876 if(method)
12877 {
12878 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't find virtual method %s in class %s\n", (((void *)0))), ident->string, _class->fullName);
12879 }
12880 else if(_class)
12881 {
12882 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't find member %s in class %s\n", (((void *)0))), ident->string, _class->fullName);
12883 if(inCompiler)
12884 __ecereNameSpace__ecere__com__eClass_AddDataMember(_class, ident->string, "int", 0, 0, 1);
12885 }
12886 }
12887 else if(_class)
12888 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "too many initializers for instantiation of class %s\n", (((void *)0))), _class->fullName);
12889 }
12890 }
12891 }
12892
12893 unsigned int MatchWithEnums_NameSpace(struct __ecereNameSpace__ecere__com__NameSpace * nameSpace, struct Expression * sourceExp, struct Type * dest, char * string, struct __ecereNameSpace__ecere__sys__OldList * conversions)
12894 {
12895 struct __ecereNameSpace__ecere__com__BTNamedLink * link;
12896
12897 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)))
12898 {
12899 struct __ecereNameSpace__ecere__com__Class * _class = link->data;
12900
12901 if(_class->type == 4)
12902 {
12903 struct __ecereNameSpace__ecere__sys__OldList converts =
12904 {
12905 0, 0, 0, 0, 0
12906 };
12907 struct Type * type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
12908
12909 type->kind = 8;
12910 if(!_class->symbol)
12911 _class->symbol = FindClass(_class->fullName);
12912 type->__anon1._class = _class->symbol;
12913 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))
12914 {
12915 struct __ecereNameSpace__ecere__sys__NamedLink64 * value;
12916 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
12917
12918 if(enumClass)
12919 {
12920 struct __ecereNameSpace__ecere__com__Class * baseClass;
12921
12922 for(baseClass = _class; baseClass && baseClass->type == 4; baseClass = baseClass->base)
12923 {
12924 struct __ecereNameSpace__ecere__com__EnumClassData * e = (baseClass ? ((void *)(((char *)baseClass->data) + enumClass->offsetClass)) : (((void *)0)));
12925
12926 for(value = e->values.first; value; value = value->next)
12927 {
12928 if(!strcmp(value->name, string))
12929 break;
12930 }
12931 if(value)
12932 {
12933 FreeType(sourceExp->expType);
12934 sourceExp->isConstant = 1;
12935 sourceExp->expType = MkClassType(baseClass->fullName);
12936 if(inCompiler || inPreCompiler || inDebugger)
12937 {
12938 char constant[256];
12939
12940 FreeExpContents(sourceExp);
12941 sourceExp->type = 2;
12942 if(!strcmp(baseClass->dataTypeString, "int") || !strcmp(baseClass->dataTypeString, "int64") || !strcmp(baseClass->dataTypeString, "short") || !strcmp(baseClass->dataTypeString, "char"))
12943 sprintf(constant, ((__runtimePlatform == 1) ? "%I64d" : "%lld"), value->data);
12944 else
12945 sprintf(constant, ((__runtimePlatform == 1) ? "0x%I64XLL" : "0x%llXLL"), value->data);
12946 sourceExp->__anon1.__anon1.constant = __ecereNameSpace__ecere__sys__CopyString(constant);
12947 }
12948 while(converts.first)
12949 {
12950 struct Conversion * convert = converts.first;
12951
12952 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(&converts, convert);
12953 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(conversions, convert);
12954 }
12955 ((type ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor((void *)type) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(type)) : 0), type = 0);
12956 return 1;
12957 }
12958 }
12959 }
12960 }
12961 if(converts.first)
12962 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(&converts, (void *)(FreeConvert));
12963 ((type ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor((void *)type) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(type)) : 0), type = 0);
12964 }
12965 }
12966 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)))
12967 if(MatchWithEnums_NameSpace(nameSpace, sourceExp, dest, string, conversions))
12968 return 1;
12969 return 0;
12970 }
12971
12972 void ComputeExpression(struct Expression * exp)
12973 {
12974 switch(exp->type)
12975 {
12976 case 0:
12977 {
12978 struct Identifier * id = exp->__anon1.__anon1.identifier;
12979
12980 if(id && exp->isConstant && !inCompiler && !inPreCompiler && !inDebugger)
12981 {
12982 struct __ecereNameSpace__ecere__com__Class * c = (exp->expType && exp->expType->kind == 8 && exp->expType->__anon1._class) ? exp->expType->__anon1._class->__anon1.registered : (((void *)0));
12983
12984 if(c && c->type == 4)
12985 {
12986 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
12987
12988 if(enumClass)
12989 {
12990 struct __ecereNameSpace__ecere__sys__NamedLink64 * value;
12991 struct __ecereNameSpace__ecere__com__EnumClassData * e = (c ? ((void *)(((char *)c->data) + enumClass->offsetClass)) : (((void *)0)));
12992
12993 for(value = e->values.first; value; value = value->next)
12994 {
12995 if(!strcmp(value->name, id->string))
12996 break;
12997 }
12998 if(value)
12999 {
13000 const char * dts = c->dataTypeString;
13001
13002 FreeExpContents(exp);
13003 exp->type = 2;
13004 exp->__anon1.__anon1.constant = (dts && (!strcmp(dts, "int") || !strcmp(dts, "int64") || !strcmp(dts, "short") || !strcmp(dts, "char"))) ? PrintInt64(value->data) : PrintUInt64(value->data);
13005 }
13006 }
13007 }
13008 }
13009 break;
13010 }
13011 case 1:
13012 {
13013 ComputeInstantiation(exp);
13014 break;
13015 }
13016 case 4:
13017 {
13018 struct Expression * exp1, * exp2 = (((void *)0));
13019 struct Operand op1 =
13020 {
13021 0, 0, 0,
13022 .__anon1 = {
13023 .c = 0
13024 },
13025 {
13026 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
13027 }
13028 };
13029 struct Operand op2 =
13030 {
13031 0, 0, 0,
13032 .__anon1 = {
13033 .c = 0
13034 },
13035 {
13036 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
13037 }
13038 };
13039
13040 if(exp->__anon1.op.exp2)
13041 {
13042 struct Expression * e = exp->__anon1.op.exp2;
13043
13044 while((e->type == 5 || e->type == 32 || e->type == 23) && e->__anon1.list)
13045 {
13046 if(e->type == 5 || e->type == 32 || e->type == 23)
13047 {
13048 if(e->type == 23)
13049 e = (*((struct Statement *)(*e->__anon1.compound->__anon1.compound.statements).last)->__anon1.expressions).last;
13050 else
13051 e = (*e->__anon1.list).last;
13052 }
13053 }
13054 if(exp->__anon1.op.op == 261 && e && e->expType)
13055 {
13056 if(e->type == 3 && e->__anon1.__anon2.string)
13057 {
13058 char * string = e->__anon1.__anon2.string;
13059 int len = strlen(string);
13060 char * tmp = __ecereNameSpace__ecere__com__eSystem_New(sizeof(char) * (len - 2 + 1));
13061
13062 len = UnescapeString(tmp, string + 1, len - 2);
13063 (__ecereNameSpace__ecere__com__eSystem_Delete(tmp), tmp = 0);
13064 FreeExpContents(exp);
13065 exp->type = 2;
13066 exp->__anon1.__anon1.constant = PrintUInt(len + 1);
13067 }
13068 else
13069 {
13070 struct Type * type = e->expType;
13071
13072 type->refCount++;
13073 FreeExpContents(exp);
13074 exp->type = 2;
13075 exp->__anon1.__anon1.constant = PrintUInt(ComputeTypeSize(type));
13076 FreeType(type);
13077 }
13078 break;
13079 }
13080 else
13081 ComputeExpression(exp->__anon1.op.exp2);
13082 }
13083 if(exp->__anon1.op.exp1)
13084 {
13085 ComputeExpression(exp->__anon1.op.exp1);
13086 exp1 = exp->__anon1.op.exp1;
13087 exp2 = exp->__anon1.op.exp2;
13088 op1 = GetOperand(exp1);
13089 if(op1.type)
13090 op1.type->refCount++;
13091 if(exp2)
13092 {
13093 op2 = GetOperand(exp2);
13094 if(op2.type)
13095 op2.type->refCount++;
13096 }
13097 }
13098 else
13099 {
13100 exp1 = exp->__anon1.op.exp2;
13101 op1 = GetOperand(exp1);
13102 if(op1.type)
13103 op1.type->refCount++;
13104 }
13105 CallOperator(exp, exp1, exp2, &op1, &op2);
13106 if(op1.type)
13107 FreeType(op1.type);
13108 if(op2.type)
13109 FreeType(op2.type);
13110 break;
13111 }
13112 case 5:
13113 case 32:
13114 {
13115 struct Expression * e, * n;
13116
13117 for(e = (*exp->__anon1.list).first; e; e = n)
13118 {
13119 n = e->next;
13120 if(!n)
13121 {
13122 struct __ecereNameSpace__ecere__sys__OldList * list = exp->__anon1.list;
13123 struct Expression * prev = exp->prev;
13124 struct Expression * next = exp->next;
13125
13126 ComputeExpression(e);
13127 FreeType(exp->expType);
13128 FreeType(exp->destType);
13129 *exp = *e;
13130 exp->prev = prev;
13131 exp->next = next;
13132 ((e ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)e) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(e)) : 0), e = 0);
13133 (__ecereNameSpace__ecere__com__eSystem_Delete(list), list = 0);
13134 }
13135 else
13136 {
13137 FreeExpression(e);
13138 }
13139 }
13140 break;
13141 }
13142 case 8:
13143 {
13144 struct Expression * memberExp = exp->__anon1.member.exp;
13145 struct Identifier * memberID = exp->__anon1.member.member;
13146 struct Type * type;
13147
13148 ComputeExpression(exp->__anon1.member.exp);
13149 type = exp->__anon1.member.exp->expType;
13150 if(type)
13151 {
13152 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)));
13153 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
13154 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
13155 struct __ecereNameSpace__ecere__com__Class * convertTo = (((void *)0));
13156
13157 if(type->kind == 19 && exp->__anon1.member.exp->type == 24)
13158 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "ecere::com::Class");
13159 if(!_class)
13160 {
13161 char string[256];
13162 struct Symbol * classSym;
13163
13164 string[0] = '\0';
13165 PrintTypeNoConst(type, string, 0, 1);
13166 classSym = FindClass(string);
13167 _class = classSym ? classSym->__anon1.registered : (((void *)0));
13168 }
13169 if(exp->__anon1.member.member)
13170 {
13171 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, exp->__anon1.member.member->string, privateModule);
13172 if(!prop)
13173 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, exp->__anon1.member.member->string, privateModule, (((void *)0)), (((void *)0)));
13174 }
13175 if(!prop && !member && _class && exp->__anon1.member.member)
13176 {
13177 struct Symbol * classSym = FindClass(exp->__anon1.member.member->string);
13178
13179 convertTo = _class;
13180 _class = classSym ? classSym->__anon1.registered : (((void *)0));
13181 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, convertTo->fullName, privateModule);
13182 }
13183 if(prop)
13184 {
13185 if(prop->compiled)
13186 {
13187 struct Type * type = prop->dataType;
13188
13189 if(_class->type == 3)
13190 {
13191 if(type->kind == 8)
13192 {
13193 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
13194
13195 if(_class->type == 3)
13196 {
13197 if(!_class->dataType)
13198 _class->dataType = ProcessTypeString(_class->dataTypeString, 0);
13199 type = _class->dataType;
13200 }
13201 }
13202 switch(type->kind)
13203 {
13204 case 6:
13205 {
13206 float value;
13207 float (* Get)(float) = (void *)prop->Get;
13208
13209 GetFloat(exp->__anon1.member.exp, &value);
13210 exp->__anon1.__anon1.constant = PrintFloat(Get ? Get(value) : value);
13211 exp->type = 2;
13212 break;
13213 }
13214 case 7:
13215 {
13216 double value;
13217 double (* Get)(double);
13218
13219 GetDouble(exp->__anon1.member.exp, &value);
13220 if(convertTo)
13221 Get = (void *)prop->Set;
13222 else
13223 Get = (void *)prop->Get;
13224 exp->__anon1.__anon1.constant = PrintDouble(Get ? Get(value) : value);
13225 exp->type = 2;
13226 break;
13227 }
13228 }
13229 }
13230 else
13231 {
13232 if(convertTo)
13233 {
13234 struct Expression * value = exp->__anon1.member.exp;
13235 struct Type * type;
13236
13237 if(!prop->dataType)
13238 ProcessPropertyType(prop);
13239 type = prop->dataType;
13240 if(!type)
13241 {
13242 }
13243 else if(_class->type == 1)
13244 {
13245 switch(type->kind)
13246 {
13247 case 8:
13248 {
13249 struct __ecereNameSpace__ecere__com__Class * propertyClass = type->__anon1._class->__anon1.registered;
13250
13251 if(propertyClass->type == 1 && value->type == 1)
13252 {
13253 void (* Set)(void *, void *) = (void *)prop->Set;
13254
13255 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
13256 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
13257 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
13258 exp->__anon1.instance->loc = exp->loc;
13259 exp->type = 1;
13260 Set(exp->__anon1.instance->data, value->__anon1.instance->data);
13261 PopulateInstance(exp->__anon1.instance);
13262 }
13263 break;
13264 }
13265 case 3:
13266 {
13267 int intValue;
13268 void (* Set)(void *, int) = (void *)prop->Set;
13269
13270 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
13271 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
13272 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
13273 exp->__anon1.instance->loc = exp->loc;
13274 exp->type = 1;
13275 GetInt(value, &intValue);
13276 Set(exp->__anon1.instance->data, intValue);
13277 PopulateInstance(exp->__anon1.instance);
13278 break;
13279 }
13280 case 4:
13281 {
13282 long long intValue;
13283 void (* Set)(void *, long long) = (void *)prop->Set;
13284
13285 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
13286 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
13287 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
13288 exp->__anon1.instance->loc = exp->loc;
13289 exp->type = 1;
13290 GetInt64(value, &intValue);
13291 Set(exp->__anon1.instance->data, intValue);
13292 PopulateInstance(exp->__anon1.instance);
13293 break;
13294 }
13295 case 22:
13296 {
13297 intptr_t intValue;
13298 void (* Set)(void *, intptr_t) = (void *)prop->Set;
13299
13300 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
13301 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
13302 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
13303 exp->__anon1.instance->loc = exp->loc;
13304 exp->type = 1;
13305 GetIntPtr(value, &intValue);
13306 Set(exp->__anon1.instance->data, intValue);
13307 PopulateInstance(exp->__anon1.instance);
13308 break;
13309 }
13310 case 23:
13311 {
13312 ssize_t intValue;
13313 void (* Set)(void *, ssize_t) = (void *)prop->Set;
13314
13315 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
13316 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
13317 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
13318 exp->__anon1.instance->loc = exp->loc;
13319 exp->type = 1;
13320 GetIntSize(value, &intValue);
13321 Set(exp->__anon1.instance->data, intValue);
13322 PopulateInstance(exp->__anon1.instance);
13323 break;
13324 }
13325 case 6:
13326 {
13327 float floatValue;
13328 void (* Set)(void *, float) = (void *)prop->Set;
13329
13330 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
13331 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
13332 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
13333 exp->__anon1.instance->loc = exp->loc;
13334 exp->type = 1;
13335 GetFloat(value, &floatValue);
13336 Set(exp->__anon1.instance->data, floatValue);
13337 PopulateInstance(exp->__anon1.instance);
13338 break;
13339 }
13340 case 7:
13341 {
13342 double doubleValue;
13343 void (* Set)(void *, double) = (void *)prop->Set;
13344
13345 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
13346 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
13347 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
13348 exp->__anon1.instance->loc = exp->loc;
13349 exp->type = 1;
13350 GetDouble(value, &doubleValue);
13351 Set(exp->__anon1.instance->data, doubleValue);
13352 PopulateInstance(exp->__anon1.instance);
13353 break;
13354 }
13355 }
13356 }
13357 else if(_class->type == 2)
13358 {
13359 switch(type->kind)
13360 {
13361 case 8:
13362 {
13363 struct __ecereNameSpace__ecere__com__Class * propertyClass = type->__anon1._class->__anon1.registered;
13364
13365 if(propertyClass->type == 1 && value->__anon1.instance->data)
13366 {
13367 unsigned int (* Set)(void *) = (void *)prop->Set;
13368 unsigned int bits = Set(value->__anon1.instance->data);
13369
13370 exp->__anon1.__anon1.constant = PrintHexUInt(bits);
13371 exp->type = 2;
13372 break;
13373 }
13374 else if(_class->type == 2)
13375 {
13376 unsigned int value;
13377 unsigned int (* Set)(unsigned int) = (void *)prop->Set;
13378 unsigned int bits;
13379
13380 GetUInt(exp->__anon1.member.exp, &value);
13381 bits = Set(value);
13382 exp->__anon1.__anon1.constant = PrintHexUInt(bits);
13383 exp->type = 2;
13384 }
13385 }
13386 }
13387 }
13388 }
13389 else
13390 {
13391 if(_class->type == 2)
13392 {
13393 unsigned int value;
13394
13395 GetUInt(exp->__anon1.member.exp, &value);
13396 switch(type->kind)
13397 {
13398 case 8:
13399 {
13400 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
13401
13402 if(_class->type == 1)
13403 {
13404 void (* Get)(unsigned int, void *) = (void *)prop->Get;
13405
13406 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
13407 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
13408 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
13409 exp->__anon1.instance->loc = exp->loc;
13410 exp->type = 1;
13411 Get(value, exp->__anon1.instance->data);
13412 PopulateInstance(exp->__anon1.instance);
13413 }
13414 else if(_class->type == 2)
13415 {
13416 unsigned int (* Get)(unsigned int) = (void *)prop->Get;
13417 uint64 bits = Get(value);
13418
13419 exp->__anon1.__anon1.constant = PrintHexUInt64(bits);
13420 exp->type = 2;
13421 }
13422 break;
13423 }
13424 }
13425 }
13426 else if(_class->type == 1)
13427 {
13428 unsigned char * value = (exp->__anon1.member.exp->type == 1) ? exp->__anon1.member.exp->__anon1.instance->data : (((void *)0));
13429
13430 switch(type->kind)
13431 {
13432 case 8:
13433 {
13434 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
13435
13436 if(_class->type == 1 && value)
13437 {
13438 void (* Get)(void *, void *) = (void *)prop->Get;
13439
13440 exp->__anon1.instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
13441 exp->__anon1.instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
13442 exp->__anon1.instance->_class = MkSpecifierName(_class->fullName);
13443 exp->__anon1.instance->loc = exp->loc;
13444 exp->type = 1;
13445 Get(value, exp->__anon1.instance->data);
13446 PopulateInstance(exp->__anon1.instance);
13447 }
13448 break;
13449 }
13450 }
13451 }
13452 }
13453 }
13454 }
13455 else
13456 {
13457 exp->isConstant = 0;
13458 }
13459 }
13460 else if(member)
13461 {
13462 }
13463 }
13464 if(exp->type != 8)
13465 {
13466 FreeExpression(memberExp);
13467 FreeIdentifier(memberID);
13468 }
13469 break;
13470 }
13471 case 10:
13472 {
13473 struct Type * type = ProcessType(exp->__anon1.typeName->qualifiers, exp->__anon1.typeName->declarator);
13474
13475 FreeExpContents(exp);
13476 exp->__anon1.__anon1.constant = PrintUInt(ComputeTypeSize(type));
13477 exp->type = 2;
13478 FreeType(type);
13479 break;
13480 }
13481 case 15:
13482 {
13483 struct Symbol * classSym = exp->__anon1._class->__anon1.__anon1.symbol;
13484
13485 if(classSym && classSym->__anon1.registered)
13486 {
13487 if(classSym->__anon1.registered->fixed)
13488 {
13489 FreeSpecifier(exp->__anon1._class);
13490 exp->__anon1.__anon1.constant = PrintUInt(classSym->__anon1.registered->templateClass ? classSym->__anon1.registered->templateClass->structSize : classSym->__anon1.registered->structSize);
13491 exp->type = 2;
13492 }
13493 else
13494 {
13495 char className[1024];
13496
13497 strcpy(className, "__ecereClass_");
13498 FullClassNameCat(className, classSym->string, 1);
13499 DeclareClass(curExternal, classSym, className);
13500 FreeExpContents(exp);
13501 exp->type = 9;
13502 exp->__anon1.member.exp = MkExpIdentifier(MkIdentifier(className));
13503 exp->__anon1.member.member = MkIdentifier("structSize");
13504 }
13505 }
13506 break;
13507 }
13508 case 11:
13509 {
13510 struct Type * type;
13511 struct Expression * e = exp;
13512
13513 if(exp->type == 11)
13514 {
13515 if(exp->__anon1.cast.exp)
13516 ComputeExpression(exp->__anon1.cast.exp);
13517 e = exp->__anon1.cast.exp;
13518 }
13519 if(e && exp->expType)
13520 {
13521 type = exp->expType;
13522 if(type->kind == 8)
13523 {
13524 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1._class->__anon1.registered;
13525
13526 if(_class && (_class->type == 3 || _class->type == 2))
13527 {
13528 if(!_class->dataType)
13529 _class->dataType = ProcessTypeString(_class->dataTypeString, 0);
13530 type = _class->dataType;
13531 }
13532 }
13533 switch(type->kind)
13534 {
13535 case 24:
13536 case 1:
13537 if(type->isSigned)
13538 {
13539 char value = (char)0;
13540
13541 if(GetChar(e, &value))
13542 {
13543 FreeExpContents(exp);
13544 exp->__anon1.__anon1.constant = PrintChar(value);
13545 exp->type = 2;
13546 }
13547 }
13548 else
13549 {
13550 unsigned char value = (unsigned char)0;
13551
13552 if(GetUChar(e, &value))
13553 {
13554 FreeExpContents(exp);
13555 exp->__anon1.__anon1.constant = PrintUChar(value);
13556 exp->type = 2;
13557 }
13558 }
13559 break;
13560 case 2:
13561 if(type->isSigned)
13562 {
13563 short value = (short)0;
13564
13565 if(GetShort(e, &value))
13566 {
13567 FreeExpContents(exp);
13568 exp->__anon1.__anon1.constant = PrintShort(value);
13569 exp->type = 2;
13570 }
13571 }
13572 else
13573 {
13574 unsigned short value = (unsigned short)0;
13575
13576 if(GetUShort(e, &value))
13577 {
13578 FreeExpContents(exp);
13579 exp->__anon1.__anon1.constant = PrintUShort(value);
13580 exp->type = 2;
13581 }
13582 }
13583 break;
13584 case 3:
13585 if(type->isSigned)
13586 {
13587 int value = 0;
13588
13589 if(GetInt(e, &value))
13590 {
13591 FreeExpContents(exp);
13592 exp->__anon1.__anon1.constant = PrintInt(value);
13593 exp->type = 2;
13594 }
13595 }
13596 else
13597 {
13598 unsigned int value = 0;
13599
13600 if(GetUInt(e, &value))
13601 {
13602 FreeExpContents(exp);
13603 exp->__anon1.__anon1.constant = PrintUInt(value);
13604 exp->type = 2;
13605 }
13606 }
13607 break;
13608 case 4:
13609 if(type->isSigned)
13610 {
13611 long long value = 0;
13612
13613 if(GetInt64(e, &value))
13614 {
13615 FreeExpContents(exp);
13616 exp->__anon1.__anon1.constant = PrintInt64(value);
13617 exp->type = 2;
13618 }
13619 }
13620 else
13621 {
13622 uint64 value = 0;
13623
13624 if(GetUInt64(e, &value))
13625 {
13626 FreeExpContents(exp);
13627 exp->__anon1.__anon1.constant = PrintUInt64(value);
13628 exp->type = 2;
13629 }
13630 }
13631 break;
13632 case 22:
13633 if(type->isSigned)
13634 {
13635 intptr_t value = 0;
13636
13637 if(GetIntPtr(e, &value))
13638 {
13639 FreeExpContents(exp);
13640 exp->__anon1.__anon1.constant = PrintInt64((long long)value);
13641 exp->type = 2;
13642 }
13643 }
13644 else
13645 {
13646 uintptr_t value = 0;
13647
13648 if(GetUIntPtr(e, &value))
13649 {
13650 FreeExpContents(exp);
13651 exp->__anon1.__anon1.constant = PrintUInt64((uint64)value);
13652 exp->type = 2;
13653 }
13654 }
13655 break;
13656 case 23:
13657 if(type->isSigned)
13658 {
13659 ssize_t value = 0;
13660
13661 if(GetIntSize(e, &value))
13662 {
13663 FreeExpContents(exp);
13664 exp->__anon1.__anon1.constant = PrintInt64((long long)value);
13665 exp->type = 2;
13666 }
13667 }
13668 else
13669 {
13670 size_t value = 0;
13671
13672 if(GetUIntSize(e, &value))
13673 {
13674 FreeExpContents(exp);
13675 exp->__anon1.__anon1.constant = PrintUInt64((uint64)value);
13676 exp->type = 2;
13677 }
13678 }
13679 break;
13680 case 6:
13681 {
13682 float value = 0;
13683
13684 if(GetFloat(e, &value))
13685 {
13686 FreeExpContents(exp);
13687 exp->__anon1.__anon1.constant = PrintFloat(value);
13688 exp->type = 2;
13689 }
13690 break;
13691 }
13692 case 7:
13693 {
13694 double value = 0;
13695
13696 if(GetDouble(e, &value))
13697 {
13698 FreeExpContents(exp);
13699 exp->__anon1.__anon1.constant = PrintDouble(value);
13700 exp->type = 2;
13701 }
13702 break;
13703 }
13704 }
13705 }
13706 break;
13707 }
13708 case 12:
13709 {
13710 struct Operand op1 =
13711 {
13712 0, 0, 0,
13713 .__anon1 = {
13714 .c = 0
13715 },
13716 {
13717 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
13718 }
13719 };
13720 struct Operand op2 =
13721 {
13722 0, 0, 0,
13723 .__anon1 = {
13724 .c = 0
13725 },
13726 {
13727 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
13728 }
13729 };
13730 struct Operand op3 =
13731 {
13732 0, 0, 0,
13733 .__anon1 = {
13734 .c = 0
13735 },
13736 {
13737 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
13738 }
13739 };
13740
13741 if(exp->__anon1.cond.exp)
13742 ComputeExpression((*exp->__anon1.cond.exp).last);
13743 if(exp->__anon1.cond.elseExp)
13744 ComputeExpression(exp->__anon1.cond.elseExp);
13745 if(exp->__anon1.cond.cond)
13746 ComputeExpression(exp->__anon1.cond.cond);
13747 op1 = GetOperand(exp->__anon1.cond.cond);
13748 if(op1.type)
13749 op1.type->refCount++;
13750 op2 = GetOperand((*exp->__anon1.cond.exp).last);
13751 if(op2.type)
13752 op2.type->refCount++;
13753 op3 = GetOperand(exp->__anon1.cond.elseExp);
13754 if(op3.type)
13755 op3.type->refCount++;
13756 if(op1.ops.Cond)
13757 {
13758 FreeExpContents(exp);
13759 op1.ops.Cond(exp, &op1, &op2, &op3);
13760 }
13761 if(op1.type)
13762 FreeType(op1.type);
13763 if(op2.type)
13764 FreeType(op2.type);
13765 if(op3.type)
13766 FreeType(op3.type);
13767 break;
13768 }
13769 }
13770 }
13771
13772 unsigned int MatchWithEnums_Module(struct __ecereNameSpace__ecere__com__Instance * mainModule, struct Expression * sourceExp, struct Type * dest, char * string, struct __ecereNameSpace__ecere__sys__OldList * conversions)
13773 {
13774 struct __ecereNameSpace__ecere__com__Instance * module;
13775
13776 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))
13777 return 1;
13778 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))
13779 return 1;
13780 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))
13781 return 1;
13782 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)
13783 {
13784 if(ModuleVisibility(mainModule, module) && MatchWithEnums_NameSpace(&((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->publicNameSpace, sourceExp, dest, string, conversions))
13785 return 1;
13786 }
13787 return 0;
13788 }
13789
13790 unsigned int MatchTypeExpression(struct Expression * sourceExp, struct Type * dest, struct __ecereNameSpace__ecere__sys__OldList * conversions, unsigned int skipUnitBla, unsigned int warnConst)
13791 {
13792 struct Type * source;
13793 struct Type * realDest = dest;
13794 struct Type * backupSourceExpType = (((void *)0));
13795 struct Expression * computedExp = sourceExp;
13796
13797 dest->refCount++;
13798 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)
13799 {
13800 computedExp = CopyExpression(sourceExp);
13801 ComputeExpression(computedExp);
13802 }
13803 source = sourceExp->expType;
13804 if(dest->kind == 13 && sourceExp->type == 2 && !strtoul(sourceExp->__anon1.__anon1.constant, (((void *)0)), 0))
13805 {
13806 if(computedExp != sourceExp)
13807 {
13808 FreeExpression(computedExp);
13809 computedExp = sourceExp;
13810 }
13811 FreeType(dest);
13812 return 1;
13813 }
13814 if(!skipUnitBla && source && dest && source->kind == 8 && dest->kind == 8)
13815 {
13816 if(source->__anon1._class && source->__anon1._class->__anon1.registered && source->__anon1._class->__anon1.registered->type == 3)
13817 {
13818 struct __ecereNameSpace__ecere__com__Class * sourceBase, * destBase;
13819
13820 for(sourceBase = source->__anon1._class->__anon1.registered; sourceBase && sourceBase->base && sourceBase->base->type != 1000; sourceBase = sourceBase->base)
13821 ;
13822 for(destBase = dest->__anon1._class->__anon1.registered; destBase && destBase->base && destBase->base->type != 1000; destBase = destBase->base)
13823 ;
13824 if(sourceBase == destBase)
13825 {
13826 if(computedExp != sourceExp)
13827 {
13828 FreeExpression(computedExp);
13829 computedExp = sourceExp;
13830 }
13831 FreeType(dest);
13832 return 1;
13833 }
13834 }
13835 }
13836 if(source)
13837 {
13838 struct __ecereNameSpace__ecere__sys__OldList * specs;
13839 unsigned int flag = 0;
13840 long long value = (((int)0x7fffffff));
13841
13842 source->refCount++;
13843 if(computedExp->type == 2)
13844 {
13845 if(source->isSigned)
13846 value = strtoll(computedExp->__anon1.__anon1.constant, (((void *)0)), 0);
13847 else
13848 value = strtoull(computedExp->__anon1.__anon1.constant, (((void *)0)), 0);
13849 }
13850 else if(computedExp->type == 4 && sourceExp->__anon1.op.op == '-' && !computedExp->__anon1.op.exp1 && computedExp->__anon1.op.exp2 && computedExp->__anon1.op.exp2->type == 2)
13851 {
13852 if(source->isSigned)
13853 value = -strtoll(computedExp->__anon1.op.exp2->__anon1.__anon1.constant, (((void *)0)), 0);
13854 else
13855 value = -strtoull(computedExp->__anon1.op.exp2->__anon1.__anon1.constant, (((void *)0)), 0);
13856 }
13857 if(computedExp != sourceExp)
13858 {
13859 FreeExpression(computedExp);
13860 computedExp = sourceExp;
13861 }
13862 if(dest->kind != 8 && source->kind == 8 && source->__anon1._class && source->__anon1._class->__anon1.registered && !strcmp(source->__anon1._class->__anon1.registered->fullName, "unichar"))
13863 {
13864 FreeType(source);
13865 source = __extension__ ({
13866 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13867
13868 __ecereInstance1->kind = 3, __ecereInstance1->isSigned = 0, __ecereInstance1->refCount = 1, __ecereInstance1;
13869 });
13870 }
13871 if(dest->kind == 8)
13872 {
13873 struct __ecereNameSpace__ecere__com__Class * _class = dest->__anon1._class ? dest->__anon1._class->__anon1.registered : (((void *)0));
13874
13875 if(_class && _class->type == 3)
13876 {
13877 if(source->kind != 8)
13878 {
13879 struct Type * tempType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13880 struct Type * tempDest, * tempSource;
13881
13882 for(; _class->base->type != 1000; _class = _class->base)
13883 ;
13884 tempSource = dest;
13885 tempDest = tempType;
13886 tempType->kind = 8;
13887 if(!_class->symbol)
13888 _class->symbol = FindClass(_class->fullName);
13889 tempType->__anon1._class = _class->symbol;
13890 tempType->truth = dest->truth;
13891 if(tempType->__anon1._class)
13892 MatchTypes(tempSource, tempDest, conversions, (((void *)0)), (((void *)0)), 1, 1, 0, 0, warnConst);
13893 backupSourceExpType = sourceExp->expType;
13894 if(dest->passAsTemplate)
13895 {
13896 sourceExp->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13897 CopyTypeInto(sourceExp->expType, dest);
13898 sourceExp->expType->passAsTemplate = 0;
13899 }
13900 else
13901 {
13902 sourceExp->expType = dest;
13903 dest->refCount++;
13904 }
13905 flag = 1;
13906 ((tempType ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor((void *)tempType) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(tempType)) : 0), tempType = 0);
13907 }
13908 }
13909 if(_class && _class->type == 2 && source->kind != 8)
13910 {
13911 if(!dest->__anon1._class->__anon1.registered->dataType)
13912 dest->__anon1._class->__anon1.registered->dataType = ProcessTypeString(dest->__anon1._class->__anon1.registered->dataTypeString, 0);
13913 if(MatchTypes(source, dest->__anon1._class->__anon1.registered->dataType, conversions, (((void *)0)), (((void *)0)), 1, 1, 0, 0, warnConst))
13914 {
13915 FreeType(source);
13916 FreeType(sourceExp->expType);
13917 source = sourceExp->expType = MkClassType(dest->__anon1._class->string);
13918 source->refCount++;
13919 }
13920 }
13921 if(_class && !strcmp(_class->fullName, "ecere::com::Class") && source->kind == 13 && source->__anon1.type && source->__anon1.type->kind == 1 && sourceExp->type == 3)
13922 {
13923 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13924 struct Declarator * decl;
13925 char string[1024];
13926
13927 ReadString(string, sourceExp->__anon1.__anon2.string);
13928 decl = SpecDeclFromString(string, specs, (((void *)0)));
13929 FreeExpContents(sourceExp);
13930 FreeType(sourceExp->expType);
13931 sourceExp->type = 24;
13932 sourceExp->__anon1._classExp.specifiers = specs;
13933 sourceExp->__anon1._classExp.decl = decl;
13934 sourceExp->expType = dest;
13935 dest->refCount++;
13936 FreeType(source);
13937 FreeType(dest);
13938 if(backupSourceExpType)
13939 FreeType(backupSourceExpType);
13940 return 1;
13941 }
13942 }
13943 else if(source->kind == 8)
13944 {
13945 struct __ecereNameSpace__ecere__com__Class * _class = source->__anon1._class ? source->__anon1._class->__anon1.registered : (((void *)0));
13946
13947 if(_class && (_class->type == 3 || _class->type == 2))
13948 {
13949 if(dest->kind != 8)
13950 {
13951 struct Type * tempType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13952 struct Type * tempDest, * tempSource;
13953
13954 if(!source->__anon1._class->__anon1.registered->dataType)
13955 source->__anon1._class->__anon1.registered->dataType = ProcessTypeString(source->__anon1._class->__anon1.registered->dataTypeString, 0);
13956 for(; _class->base->type != 1000; _class = _class->base)
13957 ;
13958 tempDest = source;
13959 tempSource = tempType;
13960 tempType->kind = 8;
13961 tempType->__anon1._class = FindClass(_class->fullName);
13962 tempType->truth = source->truth;
13963 tempType->classObjectType = source->classObjectType;
13964 if(tempType->__anon1._class)
13965 MatchTypes(tempSource, tempDest, conversions, (((void *)0)), (((void *)0)), 1, 1, 0, 0, warnConst);
13966 if(conversions && conversions->last)
13967 {
13968 ((struct Conversion *)conversions->last)->resultType = dest;
13969 dest->refCount++;
13970 }
13971 FreeType(sourceExp->expType);
13972 sourceExp->expType = MkClassType(_class->fullName);
13973 sourceExp->expType->truth = source->truth;
13974 sourceExp->expType->classObjectType = source->classObjectType;
13975 if(!sourceExp->destType)
13976 {
13977 FreeType(sourceExp->destType);
13978 sourceExp->destType = sourceExp->expType;
13979 if(sourceExp->expType)
13980 sourceExp->expType->refCount++;
13981 }
13982 if(!_class->dataType)
13983 _class->dataType = ProcessTypeString(_class->dataTypeString, 0);
13984 FreeType(dest);
13985 dest = MkClassType(source->__anon1._class->string);
13986 dest->truth = source->truth;
13987 dest->classObjectType = source->classObjectType;
13988 FreeType(source);
13989 source = _class->dataType;
13990 source->refCount++;
13991 ((tempType ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor((void *)tempType) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(tempType)) : 0), tempType = 0);
13992 }
13993 }
13994 }
13995 if(!flag)
13996 {
13997 if(MatchTypes(source, dest, conversions, (((void *)0)), (((void *)0)), 1, 1, 0, 0, warnConst))
13998 {
13999 FreeType(source);
14000 FreeType(dest);
14001 return 1;
14002 }
14003 }
14004 if(dest->kind == 8)
14005 {
14006 struct __ecereNameSpace__ecere__com__Class * _class = dest->__anon1._class ? dest->__anon1._class->__anon1.registered : (((void *)0));
14007 unsigned int fittingValue = 0;
14008
14009 if(_class && _class->type == 4)
14010 {
14011 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
14012 struct __ecereNameSpace__ecere__com__EnumClassData * c = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
14013
14014 if(c && value >= 0 && value <= c->largest)
14015 fittingValue = 1;
14016 }
14017 if(_class && !dest->truth && (_class->type == 3 || fittingValue || (_class->type != 1 && !value && source->kind == 3) || _class->type == 2))
14018 {
14019 if(_class->type == 0 || _class->type == 5)
14020 {
14021 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
14022
14023 *newExp = *sourceExp;
14024 if(sourceExp->destType)
14025 sourceExp->destType->refCount++;
14026 if(sourceExp->expType)
14027 sourceExp->expType->refCount++;
14028 sourceExp->type = 11;
14029 sourceExp->__anon1.cast.typeName = MkTypeName(MkListOne(MkSpecifier(VOID)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0))));
14030 sourceExp->__anon1.cast.exp = newExp;
14031 FreeType(sourceExp->expType);
14032 sourceExp->expType = (((void *)0));
14033 ProcessExpressionType(sourceExp);
14034 if(!inCompiler)
14035 {
14036 FreeType(sourceExp->expType);
14037 sourceExp->expType = dest;
14038 }
14039 FreeType(source);
14040 if(inCompiler)
14041 FreeType(dest);
14042 if(backupSourceExpType)
14043 FreeType(backupSourceExpType);
14044 return 1;
14045 }
14046 if(!_class->dataType)
14047 _class->dataType = ProcessTypeString(_class->dataTypeString, 0);
14048 FreeType(dest);
14049 dest = _class->dataType;
14050 dest->refCount++;
14051 }
14052 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))
14053 {
14054 specs = MkListOne(MkSpecifier(DOUBLE));
14055 }
14056 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))
14057 {
14058 specs = MkListOne(MkSpecifier(FLOAT));
14059 }
14060 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))
14061 {
14062 specs = MkList();
14063 if(!dest->isSigned)
14064 ListAdd(specs, MkSpecifier(UNSIGNED));
14065 ListAdd(specs, MkSpecifier(INT64));
14066 }
14067 else if(dest->kind == 3 && (source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 6 || source->kind == 7))
14068 {
14069 specs = MkList();
14070 if(!dest->isSigned)
14071 ListAdd(specs, MkSpecifier(UNSIGNED));
14072 ListAdd(specs, MkSpecifier(INT));
14073 }
14074 else if(dest->kind == 2 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 3 || source->kind == 6 || source->kind == 7))
14075 {
14076 specs = MkList();
14077 if(!dest->isSigned)
14078 ListAdd(specs, MkSpecifier(UNSIGNED));
14079 ListAdd(specs, MkSpecifier(SHORT));
14080 }
14081 else if(dest->kind == 1 && (source->kind == 1 || source->kind == 24 || source->kind == 2 || source->kind == 3 || source->kind == 6 || source->kind == 7))
14082 {
14083 specs = MkList();
14084 if(!dest->isSigned)
14085 ListAdd(specs, MkSpecifier(UNSIGNED));
14086 ListAdd(specs, MkSpecifier(CHAR));
14087 }
14088 else
14089 {
14090 FreeType(source);
14091 FreeType(dest);
14092 if(backupSourceExpType)
14093 {
14094 if(sourceExp->expType)
14095 FreeType(sourceExp->expType);
14096 sourceExp->expType = backupSourceExpType;
14097 }
14098 return 0;
14099 }
14100 }
14101 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))
14102 {
14103 specs = MkListOne(MkSpecifier(DOUBLE));
14104 }
14105 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))
14106 {
14107 specs = MkListOne(MkSpecifier(FLOAT));
14108 }
14109 else if(dest->kind == 24 && (source->kind == 24 || source->kind == 1 || source->kind == 15 || source->kind == 2 || source->kind == 3) && (value == 1 || value == 0))
14110 {
14111 specs = MkList();
14112 ListAdd(specs, MkSpecifier(BOOL));
14113 }
14114 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)))
14115 {
14116 specs = MkList();
14117 if(!dest->isSigned)
14118 ListAdd(specs, MkSpecifier(UNSIGNED));
14119 ListAdd(specs, MkSpecifier(CHAR));
14120 }
14121 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)))))
14122 {
14123 specs = MkList();
14124 if(!dest->isSigned)
14125 ListAdd(specs, MkSpecifier(UNSIGNED));
14126 ListAdd(specs, MkSpecifier(SHORT));
14127 }
14128 else if(dest->kind == 3 && (source->kind == 15 || source->kind == 2 || source->kind == 24 || source->kind == 1 || source->kind == 3))
14129 {
14130 specs = MkList();
14131 if(!dest->isSigned)
14132 ListAdd(specs, MkSpecifier(UNSIGNED));
14133 ListAdd(specs, MkSpecifier(INT));
14134 }
14135 else if(dest->kind == 4 && (source->kind == 15 || source->kind == 2 || source->kind == 24 || source->kind == 1 || source->kind == 3 || source->kind == 4))
14136 {
14137 specs = MkList();
14138 if(!dest->isSigned)
14139 ListAdd(specs, MkSpecifier(UNSIGNED));
14140 ListAdd(specs, MkSpecifier(INT64));
14141 }
14142 else if(dest->kind == 15 && (source->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 24 || source->kind == 1))
14143 {
14144 specs = MkListOne(MkEnum(MkIdentifier(dest->__anon1.__anon1.enumName), (((void *)0))));
14145 }
14146 else
14147 {
14148 FreeType(source);
14149 FreeType(dest);
14150 if(backupSourceExpType)
14151 {
14152 if(sourceExp->expType)
14153 FreeType(sourceExp->expType);
14154 sourceExp->expType = backupSourceExpType;
14155 }
14156 return 0;
14157 }
14158 if(!flag && !sourceExp->opDestType)
14159 {
14160 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
14161
14162 *newExp = *sourceExp;
14163 newExp->prev = (((void *)0));
14164 newExp->next = (((void *)0));
14165 if(sourceExp->destType)
14166 sourceExp->destType->refCount++;
14167 if(sourceExp->expType)
14168 sourceExp->expType->refCount++;
14169 sourceExp->type = 11;
14170 if(realDest->kind == 8)
14171 {
14172 sourceExp->__anon1.cast.typeName = QMkClass(realDest->__anon1._class->string, (((void *)0)));
14173 FreeList(specs, (void *)(FreeSpecifier));
14174 }
14175 else
14176 sourceExp->__anon1.cast.typeName = MkTypeName(specs, (((void *)0)));
14177 if(newExp->type == 4)
14178 {
14179 sourceExp->__anon1.cast.exp = MkExpBrackets(MkListOne(newExp));
14180 }
14181 else
14182 sourceExp->__anon1.cast.exp = newExp;
14183 FreeType(sourceExp->expType);
14184 sourceExp->expType = (((void *)0));
14185 ProcessExpressionType(sourceExp);
14186 }
14187 else
14188 FreeList(specs, (void *)(FreeSpecifier));
14189 FreeType(dest);
14190 FreeType(source);
14191 if(backupSourceExpType)
14192 FreeType(backupSourceExpType);
14193 return 1;
14194 }
14195 else
14196 {
14197 if(computedExp != sourceExp)
14198 {
14199 FreeExpression(computedExp);
14200 computedExp = sourceExp;
14201 }
14202 while((sourceExp->type == 5 || sourceExp->type == 32) && sourceExp->__anon1.list)
14203 sourceExp = (*sourceExp->__anon1.list).last;
14204 if(sourceExp->type == 0)
14205 {
14206 struct Identifier * id = sourceExp->__anon1.__anon1.identifier;
14207
14208 if(dest->kind == 8)
14209 {
14210 if(dest->__anon1._class && dest->__anon1._class->__anon1.registered && dest->__anon1._class->__anon1.registered->type == 4)
14211 {
14212 struct __ecereNameSpace__ecere__com__Class * _class = dest->__anon1._class->__anon1.registered;
14213 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
14214
14215 if(enumClass)
14216 {
14217 for(; _class && _class->type == 4; _class = _class->base)
14218 {
14219 struct __ecereNameSpace__ecere__sys__NamedLink64 * value;
14220 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
14221
14222 for(value = e->values.first; value; value = value->next)
14223 {
14224 if(!strcmp(value->name, id->string))
14225 break;
14226 }
14227 if(value)
14228 {
14229 FreeType(sourceExp->expType);
14230 sourceExp->isConstant = 1;
14231 sourceExp->expType = MkClassType(_class->fullName);
14232 if(inCompiler || inPreCompiler || inDebugger)
14233 {
14234 FreeExpContents(sourceExp);
14235 sourceExp->type = 2;
14236 if(_class->dataTypeString && (!strcmp(_class->dataTypeString, "int") || !strcmp(_class->dataTypeString, "int64") || !strcmp(_class->dataTypeString, "short") || !strcmp(_class->dataTypeString, "char")))
14237 sourceExp->__anon1.__anon1.constant = PrintInt64(value->data);
14238 else
14239 sourceExp->__anon1.__anon1.constant = PrintUInt64(value->data);
14240 }
14241 FreeType(dest);
14242 return 1;
14243 }
14244 }
14245 }
14246 }
14247 }
14248 if(dest->classObjectType != 2 && dest->kind == 8 && MatchWithEnums_Module(privateModule, sourceExp, dest, id->string, conversions))
14249 {
14250 FreeType(dest);
14251 return 1;
14252 }
14253 }
14254 FreeType(dest);
14255 }
14256 return 0;
14257 }
14258
14259 static unsigned int CheckExpressionType(struct Expression * exp, struct Type * destType, unsigned int skipUnitBla, unsigned int warnConst)
14260 {
14261 unsigned int result = 1;
14262
14263 if(destType)
14264 {
14265 struct __ecereNameSpace__ecere__sys__OldList converts =
14266 {
14267 0, 0, 0, 0, 0
14268 };
14269 struct Conversion * convert;
14270
14271 if(destType->kind == 0)
14272 return 0;
14273 if(!MatchTypeExpression(exp, destType, &converts, skipUnitBla, warnConst))
14274 result = 0;
14275 if(converts.count)
14276 {
14277 for(convert = converts.first; convert; convert = convert->next)
14278 {
14279 unsigned int empty = !(convert->isGet ? (void *)convert->convert->Get : (void *)convert->convert->Set);
14280
14281 if(!empty)
14282 {
14283 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
14284 int objectType = exp->expType ? exp->expType->classObjectType : 0;
14285
14286 *newExp = *exp;
14287 newExp->prev = (((void *)0));
14288 newExp->next = (((void *)0));
14289 newExp->destType = (((void *)0));
14290 if(convert->isGet)
14291 {
14292 exp->type = 8;
14293 exp->addedThis = 1;
14294 exp->__anon1.member.exp = newExp;
14295 FreeType(exp->__anon1.member.exp->expType);
14296 exp->__anon1.member.exp->expType = MkClassType(convert->convert->_class->fullName);
14297 exp->__anon1.member.exp->expType->classObjectType = objectType;
14298 exp->__anon1.member.member = MkIdentifier(convert->convert->dataTypeString);
14299 exp->__anon1.member.memberType = 1;
14300 exp->expType = convert->resultType ? convert->resultType : convert->convert->dataType;
14301 exp->needCast = 1;
14302 if(exp->expType)
14303 exp->expType->refCount++;
14304 ApplyAnyObjectLogic(exp->__anon1.member.exp);
14305 }
14306 else
14307 {
14308 {
14309 exp->type = 8;
14310 exp->addedThis = 1;
14311 exp->__anon1.member.exp = newExp;
14312 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)
14313 {
14314 newExp->byReference = 1;
14315 }
14316 FreeType(exp->__anon1.member.exp->expType);
14317 exp->__anon1.member.exp->expType = (((void *)0));
14318 if(convert->convert->dataType)
14319 {
14320 exp->__anon1.member.exp->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14321 CopyTypeInto(exp->__anon1.member.exp->expType, convert->convert->dataType);
14322 exp->__anon1.member.exp->expType->refCount = 1;
14323 exp->__anon1.member.exp->expType->classObjectType = objectType;
14324 ApplyAnyObjectLogic(exp->__anon1.member.exp);
14325 }
14326 exp->__anon1.member.member = MkIdentifier(convert->convert->_class->fullName);
14327 exp->__anon1.member.memberType = 4;
14328 exp->expType = convert->resultType ? convert->resultType : MkClassType(convert->convert->_class->fullName);
14329 exp->needCast = 1;
14330 if(convert->resultType)
14331 convert->resultType->refCount++;
14332 }
14333 }
14334 }
14335 else
14336 {
14337 FreeType(exp->expType);
14338 if(convert->isGet)
14339 {
14340 exp->expType = convert->resultType ? convert->resultType : convert->convert->dataType;
14341 if(exp->destType->casted)
14342 exp->needCast = 1;
14343 if(exp->expType)
14344 exp->expType->refCount++;
14345 }
14346 else
14347 {
14348 exp->expType = convert->resultType ? convert->resultType : MkClassType(convert->convert->_class->fullName);
14349 if(exp->destType->casted)
14350 exp->needCast = 1;
14351 if(convert->resultType)
14352 convert->resultType->refCount++;
14353 }
14354 }
14355 }
14356 if(exp->isConstant && inCompiler)
14357 ComputeExpression(exp);
14358 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(&converts, (void *)(FreeConvert));
14359 }
14360 if(!result && exp->expType && converts.count)
14361 {
14362 result = MatchTypes(exp->expType, exp->destType, (((void *)0)), (((void *)0)), (((void *)0)), 1, 1, 0, 0, warnConst);
14363 }
14364 if(!result && exp->expType && exp->destType)
14365 {
14366 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))
14367 result = 1;
14368 }
14369 }
14370 return result;
14371 }
14372
14373 static void ProcessFunction(struct FunctionDefinition *  function);
14374
14375 void ProcessInstantiationType(struct Instantiation * inst)
14376 {
14377 yylloc = inst->loc;
14378 if(inst->_class)
14379 {
14380 struct MembersInit * members;
14381 struct Symbol * classSym;
14382 struct __ecereNameSpace__ecere__com__Class * _class;
14383
14384 classSym = inst->_class->__anon1.__anon1.symbol;
14385 _class = classSym ? classSym->__anon1.registered : (((void *)0));
14386 if(!_class || _class->type != 5)
14387 DeclareStruct(curExternal, inst->_class->__anon1.__anon1.name, 0, 1);
14388 afterExternal = afterExternal ? afterExternal : curExternal;
14389 if(inst->exp)
14390 ProcessExpressionType(inst->exp);
14391 inst->isConstant = 1;
14392 if(inst->members)
14393 {
14394 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
14395 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
14396 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
14397 int subMemberStackPos = 0;
14398
14399 for(members = (*inst->members).first; members; members = members->next)
14400 {
14401 switch(members->type)
14402 {
14403 case 1:
14404 {
14405 char name[1024];
14406 static unsigned int instMethodID = 0;
14407 struct External * external = curExternal;
14408 struct Context * context = curContext;
14409 struct Declarator * declarator = members->__anon1.function->declarator;
14410 struct Identifier * nameID = GetDeclId(declarator);
14411 char * unmangled = nameID ? nameID->string : (((void *)0));
14412 struct Expression * exp;
14413 struct External * createdExternal = (((void *)0));
14414
14415 if(inCompiler)
14416 {
14417 char number[16];
14418
14419 strcpy(name, "__ecereInstMeth_");
14420 FullClassNameCat(name, _class ? _class->fullName : "_UNKNOWNCLASS", 0);
14421 strcat(name, "_");
14422 strcat(name, nameID->string);
14423 strcat(name, "_");
14424 sprintf(number, "_%08d", instMethodID++);
14425 strcat(name, number);
14426 nameID->string = __ecereNameSpace__ecere__sys__CopyString(name);
14427 }
14428 if(declarator)
14429 {
14430 struct Symbol * symbol = declarator->symbol;
14431 struct __ecereNameSpace__ecere__com__Method * method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, unmangled, privateModule);
14432
14433 if(method && method->type == 1)
14434 {
14435 symbol->__anon1.method = method;
14436 ProcessMethodType(method);
14437 if(!symbol->type->__anon1.__anon2.thisClass)
14438 {
14439 if(method->dataType->__anon1.__anon2.thisClass && currentClass && __ecereNameSpace__ecere__com__eClass_IsDerived(currentClass, method->dataType->__anon1.__anon2.thisClass->__anon1.registered))
14440 {
14441 if(!currentClass->symbol)
14442 currentClass->symbol = FindClass(currentClass->fullName);
14443 symbol->type->__anon1.__anon2.thisClass = currentClass->symbol;
14444 }
14445 else
14446 {
14447 if(!_class->symbol)
14448 _class->symbol = FindClass(_class->fullName);
14449 symbol->type->__anon1.__anon2.thisClass = _class->symbol;
14450 }
14451 }
14452 DeclareType(curExternal, symbol->type, 1, 1);
14453 }
14454 else if(classSym)
14455 {
14456 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't find virtual method %s in class %s\n", (((void *)0))), unmangled, classSym->string);
14457 }
14458 }
14459 createdExternal = ProcessClassFunction(classSym ? classSym->__anon1.registered : (((void *)0)), members->__anon1.function, ast, afterExternal, 1);
14460 if(nameID)
14461 {
14462 FreeSpecifier(nameID->_class);
14463 nameID->_class = (((void *)0));
14464 }
14465 curExternal = createdExternal;
14466 if(inCompiler)
14467 {
14468 if(createdExternal->__anon1.function)
14469 ProcessFunction(createdExternal->__anon1.function);
14470 }
14471 else if(declarator)
14472 {
14473 curExternal = declarator->symbol->__anon2.__anon1.pointerExternal;
14474 ProcessFunction((struct FunctionDefinition *)members->__anon1.function);
14475 }
14476 curExternal = external;
14477 curContext = context;
14478 if(inCompiler)
14479 {
14480 FreeClassFunction(members->__anon1.function);
14481 exp = QMkExpId(name);
14482 members->type = 0;
14483 members->__anon1.dataMembers = MkListOne(MkMemberInit(MkListOne(MkIdentifier(unmangled)), MkInitializerAssignment(exp)));
14484 (__ecereNameSpace__ecere__com__eSystem_Delete(unmangled), unmangled = 0);
14485 }
14486 break;
14487 }
14488 case 0:
14489 {
14490 if(members->__anon1.dataMembers && classSym)
14491 {
14492 struct MemberInit * member;
14493 struct Location oldyyloc = yylloc;
14494
14495 for(member = (*members->__anon1.dataMembers).first; member; member = member->next)
14496 {
14497 ProcessMemberInitData(member, classSym->__anon1.registered, &curClass, &curMember, subMemberStack, &subMemberStackPos);
14498 if(member->initializer && !member->initializer->isConstant)
14499 inst->isConstant = 0;
14500 }
14501 yylloc = oldyyloc;
14502 }
14503 break;
14504 }
14505 }
14506 }
14507 }
14508 }
14509 }
14510
14511 static void ProcessClass(struct __ecereNameSpace__ecere__sys__OldList *  definitions, struct Symbol *  symbol);
14512
14513 static void ProcessSpecifier(struct Specifier * spec, unsigned int declareStruct, unsigned int warnClasses)
14514 {
14515 switch(spec->type)
14516 {
14517 case 0:
14518 {
14519 if(spec->__anon1.specifier == THISCLASS)
14520 {
14521 if(thisClass)
14522 {
14523 spec->type = 1;
14524 spec->__anon1.__anon1.name = ReplaceThisClass(thisClass);
14525 spec->__anon1.__anon1.symbol = FindClass(spec->__anon1.__anon1.name);
14526 ProcessSpecifier(spec, declareStruct, 0);
14527 }
14528 }
14529 break;
14530 }
14531 case 1:
14532 {
14533 struct Symbol * symbol = FindType(curContext, spec->__anon1.__anon1.name);
14534
14535 if(symbol)
14536 DeclareType(curExternal, symbol->type, 1, 1);
14537 else if(spec->__anon1.__anon1.symbol)
14538 {
14539 struct __ecereNameSpace__ecere__com__Class * c = spec->__anon1.__anon1.symbol->__anon1.registered;
14540
14541 if(warnClasses && !c)
14542 Compiler_Warning("Undeclared class %s\n", spec->__anon1.__anon1.name);
14543 DeclareStruct(curExternal, spec->__anon1.__anon1.name, c && c->type == 5, declareStruct && c && c->type == 1);
14544 }
14545 break;
14546 }
14547 case 2:
14548 {
14549 struct Enumerator * e;
14550
14551 if(spec->__anon1.__anon2.list)
14552 {
14553 for(e = (*spec->__anon1.__anon2.list).first; e; e = e->next)
14554 {
14555 if(e->exp)
14556 ProcessExpressionType(e->exp);
14557 }
14558 }
14559 if(inCompiler)
14560 break;
14561 }
14562 case 3:
14563 case 4:
14564 {
14565 if(spec->__anon1.__anon2.definitions)
14566 {
14567 struct Symbol * symbol = spec->__anon1.__anon2.id ? FindClass(spec->__anon1.__anon2.id->string) : (((void *)0));
14568
14569 ProcessClass(spec->__anon1.__anon2.definitions, symbol);
14570 }
14571 break;
14572 }
14573 }
14574 }
14575
14576 static void ProcessDeclarator(struct Declarator * decl, unsigned int isFunction)
14577 {
14578 switch(decl->type)
14579 {
14580 case 1:
14581 if(decl->__anon1.identifier->classSym)
14582 {
14583 FreeSpecifier(decl->__anon1.identifier->_class);
14584 decl->__anon1.identifier->_class = (((void *)0));
14585 }
14586 break;
14587 case 3:
14588 if(decl->__anon1.array.exp)
14589 ProcessExpressionType(decl->__anon1.array.exp);
14590 case 0:
14591 case 2:
14592 case 4:
14593 case 5:
14594 case 6:
14595 case 7:
14596 {
14597 struct Identifier * id = (((void *)0));
14598 struct Specifier * classSpec = (((void *)0));
14599
14600 if(decl->type == 4)
14601 {
14602 id = GetDeclId(decl);
14603 if(id && id->_class)
14604 {
14605 classSpec = id->_class;
14606 id->_class = (((void *)0));
14607 }
14608 }
14609 if(decl->declarator)
14610 ProcessDeclarator(decl->declarator, isFunction);
14611 if(decl->type == 4)
14612 {
14613 if(classSpec)
14614 {
14615 struct TypeName * param = (param = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TypeName), param->qualifiers = MkListOne(classSpec), param->declarator = (((void *)0)), param);
14616
14617 if(!decl->__anon1.function.parameters)
14618 decl->__anon1.function.parameters = MkList();
14619 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*decl->__anon1.function.parameters), (((void *)0)), param);
14620 }
14621 if(decl->__anon1.function.parameters)
14622 {
14623 struct TypeName * param;
14624
14625 for(param = (*decl->__anon1.function.parameters).first; param; param = param->next)
14626 {
14627 if(param->qualifiers)
14628 {
14629 struct Specifier * spec;
14630
14631 for(spec = (*param->qualifiers).first; spec; spec = spec->next)
14632 {
14633 if(spec->type == 0)
14634 {
14635 if(spec->__anon1.specifier == TYPED_OBJECT)
14636 {
14637 struct Declarator * d = param->declarator;
14638 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);
14639
14640 if(d->type != 5)
14641 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*newParam->qualifiers), (((void *)0)), MkSpecifier(CONST));
14642 FreeList(param->qualifiers, (void *)(FreeSpecifier));
14643 param->qualifiers = MkListOne(MkStructOrUnion(3, MkIdentifier("__ecereNameSpace__ecere__com__Class"), (((void *)0))));
14644 param->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier("class")));
14645 DeclareStruct(curExternal, "ecere::com::Class", 0, 1);
14646 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*decl->__anon1.function.parameters), param, newParam);
14647 param = newParam;
14648 break;
14649 }
14650 else if(spec->__anon1.specifier == ANY_OBJECT)
14651 {
14652 struct Declarator * d = param->declarator;
14653
14654 FreeList(param->qualifiers, (void *)(FreeSpecifier));
14655 param->qualifiers = MkListOne(MkSpecifier(VOID));
14656 if(d->type != 5)
14657 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*param->qualifiers), (((void *)0)), MkSpecifier(CONST));
14658 param->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d);
14659 break;
14660 }
14661 else if(spec->__anon1.specifier == THISCLASS)
14662 {
14663 if(thisClass)
14664 {
14665 spec->type = 1;
14666 spec->__anon1.__anon1.name = ReplaceThisClass(thisClass);
14667 spec->__anon1.__anon1.symbol = FindClass(spec->__anon1.__anon1.name);
14668 ProcessSpecifier(spec, 0, 0);
14669 }
14670 break;
14671 }
14672 }
14673 else if(spec->type == 1)
14674 {
14675 ProcessSpecifier(spec, isFunction, 1);
14676 }
14677 }
14678 }
14679 if(param->declarator)
14680 ProcessDeclarator(param->declarator, 0);
14681 }
14682 }
14683 }
14684 break;
14685 }
14686 }
14687 }
14688
14689 static void ProcessDeclaration(struct Declaration * decl, unsigned int warnClasses)
14690 {
14691 yylloc = decl->loc;
14692 switch(decl->type)
14693 {
14694 case 1:
14695 {
14696 unsigned int declareStruct = 0;
14697
14698 if(decl->__anon1.__anon1.declarators)
14699 {
14700 struct InitDeclarator * d;
14701
14702 for(d = (*decl->__anon1.__anon1.declarators).first; d; d = d->next)
14703 {
14704 struct Type * type, * subType;
14705
14706 ProcessDeclarator(d->declarator, 0);
14707 type = ProcessType(decl->__anon1.__anon1.specifiers, d->declarator);
14708 if(d->initializer)
14709 {
14710 ProcessInitializer(d->initializer, type);
14711 if((*decl->__anon1.__anon1.declarators).count == 1 && d->initializer->type == 0 && d->initializer->__anon1.exp->type == 1)
14712 {
14713 if(type->kind == 8 && type->__anon1._class == d->initializer->__anon1.exp->expType->__anon1._class)
14714 {
14715 struct Instantiation * inst = d->initializer->__anon1.exp->__anon1.instance;
14716
14717 inst->exp = MkExpIdentifier(CopyIdentifier(GetDeclId(d->declarator)));
14718 d->initializer->__anon1.exp->__anon1.instance = (((void *)0));
14719 if(decl->__anon1.__anon1.specifiers)
14720 FreeList(decl->__anon1.__anon1.specifiers, (void *)(FreeSpecifier));
14721 FreeList(decl->__anon1.__anon1.declarators, (void *)(FreeInitDeclarator));
14722 d = (((void *)0));
14723 decl->type = 2;
14724 decl->__anon1.inst = inst;
14725 }
14726 }
14727 }
14728 for(subType = type; subType; )
14729 {
14730 if(subType->kind == 8)
14731 {
14732 declareStruct = 1;
14733 break;
14734 }
14735 else if(subType->kind == 13)
14736 break;
14737 else if(subType->kind == 12)
14738 subType = subType->__anon1.__anon4.arrayType;
14739 else
14740 break;
14741 }
14742 FreeType(type);
14743 if(!d)
14744 break;
14745 }
14746 }
14747 if(decl->__anon1.__anon1.specifiers)
14748 {
14749 struct Specifier * s;
14750
14751 for(s = (*decl->__anon1.__anon1.specifiers).first; s; s = s->next)
14752 {
14753 ProcessSpecifier(s, declareStruct, 1);
14754 }
14755 }
14756 break;
14757 }
14758 case 2:
14759 {
14760 ProcessInstantiationType(decl->__anon1.inst);
14761 break;
14762 }
14763 case 0:
14764 {
14765 struct Specifier * spec;
14766 struct Declarator * d;
14767 unsigned int declareStruct = 0;
14768
14769 if(decl->__anon1.__anon1.declarators)
14770 {
14771 for(d = (*decl->__anon1.__anon1.declarators).first; d; d = d->next)
14772 {
14773 struct Type * type = ProcessType(decl->__anon1.__anon1.specifiers, d->declarator);
14774 struct Type * subType;
14775
14776 ProcessDeclarator(d, 0);
14777 for(subType = type; subType; )
14778 {
14779 if(subType->kind == 8)
14780 {
14781 declareStruct = 1;
14782 break;
14783 }
14784 else if(subType->kind == 13)
14785 break;
14786 else if(subType->kind == 12)
14787 subType = subType->__anon1.__anon4.arrayType;
14788 else
14789 break;
14790 }
14791 FreeType(type);
14792 }
14793 }
14794 if(decl->__anon1.__anon1.specifiers)
14795 {
14796 for(spec = (*decl->__anon1.__anon1.specifiers).first; spec; spec = spec->next)
14797 ProcessSpecifier(spec, declareStruct, warnClasses);
14798 }
14799 break;
14800 }
14801 }
14802 }
14803
14804 static void ProcessStatement(struct Statement * stmt)
14805 {
14806 yylloc = stmt->loc;
14807 switch(stmt->type)
14808 {
14809 case 0:
14810 ProcessStatement(stmt->__anon1.labeled.stmt);
14811 break;
14812 case 1:
14813 if(stmt->__anon1.caseStmt.exp)
14814 {
14815 FreeType(stmt->__anon1.caseStmt.exp->destType);
14816 stmt->__anon1.caseStmt.exp->destType = curSwitchType;
14817 if(curSwitchType)
14818 curSwitchType->refCount++;
14819 ProcessExpressionType(stmt->__anon1.caseStmt.exp);
14820 ComputeExpression(stmt->__anon1.caseStmt.exp);
14821 }
14822 if(stmt->__anon1.caseStmt.stmt)
14823 ProcessStatement(stmt->__anon1.caseStmt.stmt);
14824 break;
14825 case 2:
14826 {
14827 if(stmt->__anon1.compound.context)
14828 {
14829 struct Declaration * decl;
14830 struct Statement * s;
14831 struct Statement * prevCompound = curCompound;
14832 struct Context * prevContext = curContext;
14833
14834 if(!stmt->__anon1.compound.isSwitch)
14835 curCompound = stmt;
14836 curContext = stmt->__anon1.compound.context;
14837 if(stmt->__anon1.compound.declarations)
14838 {
14839 for(decl = (*stmt->__anon1.compound.declarations).first; decl; decl = decl->next)
14840 ProcessDeclaration(decl, 1);
14841 }
14842 if(stmt->__anon1.compound.statements)
14843 {
14844 for(s = (*stmt->__anon1.compound.statements).first; s; s = s->next)
14845 ProcessStatement(s);
14846 }
14847 curContext = prevContext;
14848 curCompound = prevCompound;
14849 }
14850 break;
14851 }
14852 case 3:
14853 {
14854 struct Expression * exp;
14855
14856 if(stmt->__anon1.expressions)
14857 {
14858 for(exp = (*stmt->__anon1.expressions).first; exp; exp = exp->next)
14859 ProcessExpressionType(exp);
14860 }
14861 break;
14862 }
14863 case 4:
14864 {
14865 struct Expression * exp;
14866
14867 FreeType(((struct Expression *)(*stmt->__anon1.ifStmt.exp).last)->destType);
14868 ((struct Expression *)(*stmt->__anon1.ifStmt.exp).last)->destType = MkClassType("bool");
14869 ((struct Expression *)(*stmt->__anon1.ifStmt.exp).last)->destType->truth = 1;
14870 for(exp = (*stmt->__anon1.ifStmt.exp).first; exp; exp = exp->next)
14871 {
14872 ProcessExpressionType(exp);
14873 }
14874 if(stmt->__anon1.ifStmt.stmt)
14875 ProcessStatement(stmt->__anon1.ifStmt.stmt);
14876 if(stmt->__anon1.ifStmt.elseStmt)
14877 ProcessStatement(stmt->__anon1.ifStmt.elseStmt);
14878 break;
14879 }
14880 case 5:
14881 {
14882 struct Type * oldSwitchType = curSwitchType;
14883
14884 if(stmt->__anon1.switchStmt.exp)
14885 {
14886 struct Expression * exp;
14887
14888 for(exp = (*stmt->__anon1.switchStmt.exp).first; exp; exp = exp->next)
14889 {
14890 if(!exp->next)
14891 {
14892 ProcessExpressionType(exp);
14893 }
14894 if(!exp->next)
14895 curSwitchType = exp->expType;
14896 }
14897 }
14898 ProcessStatement(stmt->__anon1.switchStmt.stmt);
14899 curSwitchType = oldSwitchType;
14900 break;
14901 }
14902 case 6:
14903 {
14904 if(stmt->__anon1.whileStmt.exp)
14905 {
14906 struct Expression * exp;
14907
14908 FreeType(((struct Expression *)(*stmt->__anon1.whileStmt.exp).last)->destType);
14909 ((struct Expression *)(*stmt->__anon1.whileStmt.exp).last)->destType = MkClassType("bool");
14910 ((struct Expression *)(*stmt->__anon1.whileStmt.exp).last)->destType->truth = 1;
14911 for(exp = (*stmt->__anon1.whileStmt.exp).first; exp; exp = exp->next)
14912 {
14913 ProcessExpressionType(exp);
14914 }
14915 }
14916 if(stmt->__anon1.whileStmt.stmt)
14917 ProcessStatement(stmt->__anon1.whileStmt.stmt);
14918 break;
14919 }
14920 case 7:
14921 {
14922 if(stmt->__anon1.doWhile.exp)
14923 {
14924 struct Expression * exp;
14925
14926 if((*stmt->__anon1.doWhile.exp).last)
14927 {
14928 FreeType(((struct Expression *)(*stmt->__anon1.doWhile.exp).last)->destType);
14929 ((struct Expression *)(*stmt->__anon1.doWhile.exp).last)->destType = MkClassType("bool");
14930 ((struct Expression *)(*stmt->__anon1.doWhile.exp).last)->destType->truth = 1;
14931 }
14932 for(exp = (*stmt->__anon1.doWhile.exp).first; exp; exp = exp->next)
14933 {
14934 ProcessExpressionType(exp);
14935 }
14936 }
14937 if(stmt->__anon1.doWhile.stmt)
14938 ProcessStatement(stmt->__anon1.doWhile.stmt);
14939 break;
14940 }
14941 case 8:
14942 {
14943 struct Expression * exp;
14944
14945 if(stmt->__anon1.forStmt.init)
14946 ProcessStatement(stmt->__anon1.forStmt.init);
14947 if(stmt->__anon1.forStmt.check && stmt->__anon1.forStmt.check->__anon1.expressions)
14948 {
14949 FreeType(((struct Expression *)(*stmt->__anon1.forStmt.check->__anon1.expressions).last)->destType);
14950 ((struct Expression *)(*stmt->__anon1.forStmt.check->__anon1.expressions).last)->destType = MkClassType("bool");
14951 ((struct Expression *)(*stmt->__anon1.forStmt.check->__anon1.expressions).last)->destType->truth = 1;
14952 }
14953 if(stmt->__anon1.forStmt.check)
14954 ProcessStatement(stmt->__anon1.forStmt.check);
14955 if(stmt->__anon1.forStmt.increment)
14956 {
14957 for(exp = (*stmt->__anon1.forStmt.increment).first; exp; exp = exp->next)
14958 ProcessExpressionType(exp);
14959 }
14960 if(stmt->__anon1.forStmt.stmt)
14961 ProcessStatement(stmt->__anon1.forStmt.stmt);
14962 break;
14963 }
14964 case 18:
14965 {
14966 struct Identifier * id = stmt->__anon1.forEachStmt.id;
14967 struct __ecereNameSpace__ecere__sys__OldList * exp = stmt->__anon1.forEachStmt.exp;
14968 struct __ecereNameSpace__ecere__sys__OldList * filter = stmt->__anon1.forEachStmt.filter;
14969 struct Statement * block = stmt->__anon1.forEachStmt.stmt;
14970 char iteratorType[1024];
14971 struct Type * source;
14972 struct Expression * e;
14973 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));
14974 struct Expression * arrayExp;
14975 const char * typeString = (((void *)0));
14976 int builtinCount = 0;
14977
14978 for(e = exp ? (*exp).first : (((void *)0)); e; e = e->next)
14979 {
14980 if(!e->next)
14981 {
14982 FreeType(e->destType);
14983 e->destType = ProcessTypeString("Container", 0);
14984 }
14985 if(!isBuiltin || e->next)
14986 ProcessExpressionType(e);
14987 }
14988 source = (exp && (*exp).last) ? ((struct Expression *)(*exp).last)->expType : (((void *)0));
14989 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)))
14990 {
14991 struct __ecereNameSpace__ecere__com__Class * _class = source ? source->__anon1._class->__anon1.registered : (((void *)0));
14992 struct Symbol * symbol;
14993 struct Expression * expIt = (((void *)0));
14994 unsigned int isMap = 0, isArray = 0, isLinkList = 0, isList = 0, isCustomAVLTree = 0;
14995 struct __ecereNameSpace__ecere__com__Class * arrayClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "Array");
14996 struct __ecereNameSpace__ecere__com__Class * linkListClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "LinkList");
14997 struct __ecereNameSpace__ecere__com__Class * customAVLTreeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "CustomAVLTree");
14998
14999 if(inCompiler)
15000 {
15001 stmt->type = 2;
15002 stmt->__anon1.compound.context = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Context);
15003 stmt->__anon1.compound.context->parent = curContext;
15004 curContext = stmt->__anon1.compound.context;
15005 }
15006 if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->__anon1._class->__anon1.registered, customAVLTreeClass))
15007 {
15008 struct __ecereNameSpace__ecere__com__Class * mapClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "Map");
15009
15010 isCustomAVLTree = 1;
15011 if(__ecereNameSpace__ecere__com__eClass_IsDerived(source->__anon1._class->__anon1.registered, mapClass))
15012 isMap = 1;
15013 }
15014 else if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->__anon1._class->__anon1.registered, arrayClass))
15015 isArray = 1;
15016 else if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->__anon1._class->__anon1.registered, linkListClass))
15017 {
15018 struct __ecereNameSpace__ecere__com__Class * listClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "List");
15019
15020 isLinkList = 1;
15021 isList = __ecereNameSpace__ecere__com__eClass_IsDerived(source->__anon1._class->__anon1.registered, listClass);
15022 }
15023 if(inCompiler && isArray)
15024 {
15025 struct Declarator * decl;
15026 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15027
15028 decl = SpecDeclFromString(_class->templateArgs[2].__anon1.__anon1.dataTypeString, specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(id)));
15029 stmt->__anon1.compound.declarations = MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(decl, (((void *)0))))));
15030 ListAdd(stmt->__anon1.compound.declarations, MkDeclaration(MkListOne(MkSpecifierName(source->__anon1._class->__anon1.registered->fullName)), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internalArray")), MkInitializerAssignment(MkExpBrackets(exp))))));
15031 }
15032 else if(isBuiltin)
15033 {
15034 struct Type * type = (((void *)0));
15035 char typeStringBuf[1024];
15036
15037 arrayExp = (((struct Expression *)(*exp).last)->type == 35) ? (struct Expression *)(*exp).last : ((struct Expression *)(*exp).last)->__anon1.cast.exp;
15038 if(((struct Expression *)(*exp).last)->type == 11)
15039 {
15040 struct TypeName * typeName = ((struct Expression *)(*exp).last)->__anon1.cast.typeName;
15041
15042 if(typeName)
15043 arrayExp->destType = ProcessType(typeName->qualifiers, typeName->declarator);
15044 }
15045 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)
15046 {
15047 struct __ecereNameSpace__ecere__com__Class * templateClass = arrayExp->destType->__anon1._class->__anon1.registered;
15048
15049 typeString = templateClass->templateArgs[2].__anon1.__anon1.dataTypeString;
15050 }
15051 else if(arrayExp->__anon1.list)
15052 {
15053 struct Expression * e;
15054
15055 for(e = (*arrayExp->__anon1.list).first; e; e = e->next)
15056 {
15057 ProcessExpressionType(e);
15058 if(e->expType)
15059 {
15060 if(!type)
15061 {
15062 type = e->expType;
15063 type->refCount++;
15064 }
15065 else
15066 {
15067 if(!MatchTypeExpression(e, type, (((void *)0)), 0, 1))
15068 {
15069 FreeType(type);
15070 type = e->expType;
15071 e->expType = (((void *)0));
15072 e = (*arrayExp->__anon1.list).first;
15073 ProcessExpressionType(e);
15074 if(e->expType)
15075 {
15076 if(!MatchTypeExpression(e, type, (((void *)0)), 0, 1))
15077 {
15078 FreeType(e->expType);
15079 e->expType = (((void *)0));
15080 FreeType(type);
15081 type = (((void *)0));
15082 break;
15083 }
15084 }
15085 }
15086 }
15087 if(e->expType)
15088 {
15089 FreeType(e->expType);
15090 e->expType = (((void *)0));
15091 }
15092 }
15093 }
15094 if(type)
15095 {
15096 typeStringBuf[0] = '\0';
15097 PrintType(type, typeStringBuf, 0, 1);
15098 typeString = typeStringBuf;
15099 FreeType(type);
15100 }
15101 }
15102 if(typeString)
15103 {
15104 if(inCompiler)
15105 {
15106 struct __ecereNameSpace__ecere__sys__OldList * initializers = MkList();
15107 struct Declarator * decl;
15108 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15109
15110 if(arrayExp->__anon1.list)
15111 {
15112 struct Expression * e;
15113
15114 builtinCount = (*arrayExp->__anon1.list).count;
15115 type = ProcessTypeString(typeString, 0);
15116 while((e = (*arrayExp->__anon1.list).first))
15117 {
15118 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*arrayExp->__anon1.list), e);
15119 e->destType = type;
15120 type->refCount++;
15121 ProcessExpressionType(e);
15122 if(inCompiler)
15123 ListAdd(initializers, MkInitializerAssignment(e));
15124 }
15125 FreeType(type);
15126 (__ecereNameSpace__ecere__com__eSystem_Delete(arrayExp->__anon1.list), arrayExp->__anon1.list = 0);
15127 }
15128 decl = SpecDeclFromString(typeString, specs, MkDeclaratorIdentifier(id));
15129 stmt->__anon1.compound.declarations = MkListOne(MkDeclaration(CopyList(specs, (void *)(CopySpecifier)), MkListOne(MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl), (((void *)0))))));
15130 ListAdd(stmt->__anon1.compound.declarations, MkDeclaration(specs, MkListOne(MkInitDeclarator(PlugDeclarator(decl, MkDeclaratorArray(MkDeclaratorIdentifier(MkIdentifier("__internalArray")), (((void *)0)))), MkInitializerList(initializers)))));
15131 FreeList(exp, (void *)(FreeExpression));
15132 }
15133 else if(arrayExp->__anon1.list)
15134 {
15135 struct Expression * e;
15136
15137 type = ProcessTypeString(typeString, 0);
15138 for(e = (*arrayExp->__anon1.list).first; e; e = e->next)
15139 {
15140 e->destType = type;
15141 type->refCount++;
15142 ProcessExpressionType(e);
15143 }
15144 FreeType(type);
15145 }
15146 }
15147 else
15148 {
15149 arrayExp->expType = ProcessTypeString("Container", 0);
15150 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Couldn't determine type of array elements\n", (((void *)0))));
15151 }
15152 }
15153 else if(inCompiler && isLinkList && !isList)
15154 {
15155 struct Declarator * decl;
15156 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15157
15158 decl = SpecDeclFromString(_class->templateArgs[3].__anon1.__anon1.dataTypeString, specs, MkDeclaratorIdentifier(id));
15159 stmt->__anon1.compound.declarations = MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(decl, (((void *)0))))));
15160 ListAdd(stmt->__anon1.compound.declarations, MkDeclaration(MkListOne(MkSpecifierName(source->__anon1._class->__anon1.registered->fullName)), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internalLinkList")), MkInitializerAssignment(MkExpBrackets(exp))))));
15161 }
15162 else if(inCompiler && _class->templateArgs)
15163 {
15164 if(isMap)
15165 sprintf(iteratorType, "MapIterator<%s, %s >", _class->templateArgs[5].__anon1.__anon1.dataTypeString, _class->templateArgs[6].__anon1.__anon1.dataTypeString);
15166 else
15167 sprintf(iteratorType, "Iterator<%s, %s >", _class->templateArgs[2].__anon1.__anon1.dataTypeString, _class->templateArgs[1].__anon1.__anon1.dataTypeString);
15168 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)))))))));
15169 }
15170 if(inCompiler)
15171 {
15172 symbol = FindSymbol(id->string, curContext, curContext, 0, 0);
15173 if(block)
15174 {
15175 switch(block->type)
15176 {
15177 case 2:
15178 if(block->__anon1.compound.context)
15179 block->__anon1.compound.context->parent = stmt->__anon1.compound.context;
15180 break;
15181 case 4:
15182 if(block->__anon1.ifStmt.stmt && block->__anon1.ifStmt.stmt->type == 2 && block->__anon1.ifStmt.stmt->__anon1.compound.context)
15183 block->__anon1.ifStmt.stmt->__anon1.compound.context->parent = stmt->__anon1.compound.context;
15184 if(block->__anon1.ifStmt.elseStmt && block->__anon1.ifStmt.elseStmt->type == 2 && block->__anon1.ifStmt.elseStmt->__anon1.compound.context)
15185 block->__anon1.ifStmt.elseStmt->__anon1.compound.context->parent = stmt->__anon1.compound.context;
15186 break;
15187 case 5:
15188 if(block->__anon1.switchStmt.stmt && block->__anon1.switchStmt.stmt->type == 2 && block->__anon1.switchStmt.stmt->__anon1.compound.context)
15189 block->__anon1.switchStmt.stmt->__anon1.compound.context->parent = stmt->__anon1.compound.context;
15190 break;
15191 case 6:
15192 if(block->__anon1.whileStmt.stmt && block->__anon1.whileStmt.stmt->type == 2 && block->__anon1.whileStmt.stmt->__anon1.compound.context)
15193 block->__anon1.whileStmt.stmt->__anon1.compound.context->parent = stmt->__anon1.compound.context;
15194 break;
15195 case 7:
15196 if(block->__anon1.doWhile.stmt && block->__anon1.doWhile.stmt->type == 2 && block->__anon1.doWhile.stmt->__anon1.compound.context)
15197 block->__anon1.doWhile.stmt->__anon1.compound.context->parent = stmt->__anon1.compound.context;
15198 break;
15199 case 8:
15200 if(block->__anon1.forStmt.stmt && block->__anon1.forStmt.stmt->type == 2 && block->__anon1.forStmt.stmt->__anon1.compound.context)
15201 block->__anon1.forStmt.stmt->__anon1.compound.context->parent = stmt->__anon1.compound.context;
15202 break;
15203 case 18:
15204 if(block->__anon1.forEachStmt.stmt && block->__anon1.forEachStmt.stmt->type == 2 && block->__anon1.forEachStmt.stmt->__anon1.compound.context)
15205 block->__anon1.forEachStmt.stmt->__anon1.compound.context->parent = stmt->__anon1.compound.context;
15206 break;
15207 }
15208 }
15209 if(filter)
15210 {
15211 block = MkIfStmt(filter, block, (((void *)0)));
15212 }
15213 if(isArray)
15214 {
15215 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));
15216 ProcessStatement(((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.init);
15217 ProcessStatement(((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.check);
15218 ProcessExpressionType((*((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.increment).first);
15219 }
15220 else if(isBuiltin)
15221 {
15222 char count[128];
15223
15224 sprintf(count, "%d", builtinCount);
15225 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));
15226 ProcessStatement(((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.init);
15227 ProcessStatement(((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.check);
15228 ProcessExpressionType((*((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.increment).first);
15229 }
15230 else if(isLinkList && !isList)
15231 {
15232 struct __ecereNameSpace__ecere__com__Class * typeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, _class->templateArgs[3].__anon1.__anon1.dataTypeString);
15233 struct __ecereNameSpace__ecere__com__Class * listItemClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, "ListItem");
15234
15235 if(typeClass && __ecereNameSpace__ecere__com__eClass_IsDerived(typeClass, listItemClass) && _class->templateArgs[5].__anon1.__anon1.dataTypeString && !strcmp(_class->templateArgs[5].__anon1.__anon1.dataTypeString, "LT::link"))
15236 {
15237 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));
15238 }
15239 else
15240 {
15241 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15242 struct Declarator * decl = SpecDeclFromString(_class->templateArgs[3].__anon1.__anon1.dataTypeString, specs, (((void *)0)));
15243
15244 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));
15245 }
15246 ProcessStatement(((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.init);
15247 ProcessStatement(((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.check);
15248 ProcessExpressionType((*((struct Statement *)(*stmt->__anon1.compound.statements).first)->__anon1.forStmt.increment).first);
15249 }
15250 else
15251 {
15252 stmt->__anon1.compound.statements = MkListOne(MkWhileStmt(MkListOne(MkExpCall(MkExpMember(expIt = MkExpIdentifier(CopyIdentifier(id)), MkIdentifier("Next")), (((void *)0)))), block));
15253 }
15254 ProcessExpressionType(expIt);
15255 if((*stmt->__anon1.compound.declarations).first)
15256 ProcessDeclaration((*stmt->__anon1.compound.declarations).first, 1);
15257 if(symbol)
15258 symbol->isIterator = isMap ? 2 : ((isArray || isBuiltin) ? 3 : (isLinkList ? (isList ? 5 : 4) : (isCustomAVLTree ? 6 : 1)));
15259 ProcessStatement(stmt);
15260 }
15261 else
15262 ProcessStatement(stmt->__anon1.forEachStmt.stmt);
15263 if(inCompiler)
15264 curContext = stmt->__anon1.compound.context->parent;
15265 break;
15266 }
15267 else
15268 {
15269 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Expression is not a container\n", (((void *)0))));
15270 }
15271 break;
15272 }
15273 case 9:
15274 break;
15275 case 10:
15276 break;
15277 case 11:
15278 break;
15279 case 12:
15280 {
15281 struct Expression * exp;
15282
15283 if(stmt->__anon1.expressions)
15284 {
15285 for(exp = (*stmt->__anon1.expressions).first; exp; exp = exp->next)
15286 {
15287 if(!exp->next)
15288 {
15289 if(curFunction && !curFunction->type)
15290 curFunction->type = ProcessType(curFunction->specifiers, curFunction->declarator);
15291 FreeType(exp->destType);
15292 exp->destType = (curFunction && curFunction->type && curFunction->type->kind == 11) ? curFunction->type->__anon1.__anon2.returnType : (((void *)0));
15293 if(exp->destType)
15294 exp->destType->refCount++;
15295 }
15296 ProcessExpressionType(exp);
15297 }
15298 }
15299 break;
15300 }
15301 case 14:
15302 {
15303 ProcessDeclaration(stmt->__anon1.decl, 1);
15304 break;
15305 }
15306 case 13:
15307 {
15308 struct AsmField * field;
15309
15310 if(stmt->__anon1.asmStmt.inputFields)
15311 {
15312 for(field = (*stmt->__anon1.asmStmt.inputFields).first; field; field = field->next)
15313 if(field->expression)
15314 ProcessExpressionType(field->expression);
15315 }
15316 if(stmt->__anon1.asmStmt.outputFields)
15317 {
15318 for(field = (*stmt->__anon1.asmStmt.outputFields).first; field; field = field->next)
15319 if(field->expression)
15320 ProcessExpressionType(field->expression);
15321 }
15322 if(stmt->__anon1.asmStmt.clobberedFields)
15323 {
15324 for(field = (*stmt->__anon1.asmStmt.clobberedFields).first; field; field = field->next)
15325 {
15326 if(field->expression)
15327 ProcessExpressionType(field->expression);
15328 }
15329 }
15330 break;
15331 }
15332 case 17:
15333 {
15334 struct PropertyWatch * propWatch;
15335 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->__anon1._watch.watches;
15336 struct Expression * object = stmt->__anon1._watch.object;
15337 struct Expression * watcher = stmt->__anon1._watch.watcher;
15338
15339 if(watcher)
15340 ProcessExpressionType(watcher);
15341 if(object)
15342 ProcessExpressionType(object);
15343 if(inCompiler)
15344 {
15345 if(watcher || thisClass)
15346 {
15347 struct External * external = curExternal;
15348 struct Context * context = curContext;
15349
15350 stmt->type = 3;
15351 stmt->__anon1.expressions = MkList();
15352 for(propWatch = (*watches).first; propWatch; propWatch = propWatch->next)
15353 {
15354 struct ClassFunction * func;
15355 char watcherName[1024];
15356 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;
15357 struct External * createdExternal;
15358
15359 sprintf(watcherName, "__ecerePropertyWatcher_%d", propWatcherID++);
15360 if(propWatch->deleteWatch)
15361 strcat(watcherName, "_delete");
15362 else
15363 {
15364 struct Identifier * propID;
15365
15366 for(propID = (*propWatch->properties).first; propID; propID = propID->next)
15367 {
15368 strcat(watcherName, "_");
15369 strcat(watcherName, propID->string);
15370 }
15371 }
15372 if(object && object->expType && object->expType->kind == 8 && object->expType->__anon1._class && object->expType->__anon1._class->__anon1.registered)
15373 {
15374 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)));
15375 ProcessClassFunctionBody(func, propWatch->compound);
15376 propWatch->compound = (((void *)0));
15377 createdExternal = ProcessClassFunction(watcherClass, func, ast, curExternal, 1);
15378 FreeClassFunction(func);
15379 curExternal = createdExternal;
15380 ProcessFunction(createdExternal->__anon1.function);
15381 if(propWatch->deleteWatch)
15382 {
15383 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
15384
15385 ListAdd(args, CopyExpression(object));
15386 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
15387 ListAdd(args, MkExpIdentifier(MkIdentifier(watcherName)));
15388 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_WatchDestruction")), args));
15389 }
15390 else
15391 {
15392 struct __ecereNameSpace__ecere__com__Class * _class = object->expType->__anon1._class->__anon1.registered;
15393 struct Identifier * propID;
15394
15395 for(propID = (*propWatch->properties).first; propID; propID = propID->next)
15396 {
15397 char propName[1024];
15398 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
15399
15400 if(prop)
15401 {
15402 char getName[1024], setName[1024];
15403 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
15404
15405 DeclareProperty(createdExternal, prop, setName, getName);
15406 strcpy(propName, "__ecereProp_");
15407 FullClassNameCat(propName, prop->_class->fullName, 0);
15408 strcat(propName, "_");
15409 FullClassNameCat(propName, prop->name, 1);
15410 ListAdd(args, CopyExpression(object));
15411 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
15412 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
15413 ListAdd(args, MkExpCast(MkTypeName(MkListOne(MkSpecifier(VOID)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), MkExpIdentifier(MkIdentifier(watcherName))));
15414 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_Watch")), args));
15415 __ecereMethod_External_CreateUniqueEdge(external, createdExternal, 1);
15416 }
15417 else
15418 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Property %s not found in class %s\n", (((void *)0))), propID->string, _class->fullName);
15419 }
15420 }
15421 }
15422 else
15423 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Invalid watched object\n", (((void *)0))));
15424 }
15425 curExternal = external;
15426 curContext = context;
15427 if(watcher)
15428 FreeExpression(watcher);
15429 if(object)
15430 FreeExpression(object);
15431 FreeList(watches, (void *)(FreePropertyWatch));
15432 }
15433 else
15434 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "No observer specified and not inside a class\n", (((void *)0))));
15435 }
15436 else
15437 {
15438 for(propWatch = (*watches).first; propWatch; propWatch = propWatch->next)
15439 {
15440 ProcessStatement(propWatch->compound);
15441 }
15442 }
15443 break;
15444 }
15445 case 15:
15446 {
15447 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->__anon1._watch.watches;
15448 struct Expression * object = stmt->__anon1._watch.object;
15449 struct __ecereNameSpace__ecere__com__Class * _class;
15450
15451 if(object)
15452 ProcessExpressionType(object);
15453 if(inCompiler)
15454 {
15455 _class = object ? ((object->expType && object->expType->kind == 8 && object->expType->__anon1._class) ? object->expType->__anon1._class->__anon1.registered : (((void *)0))) : thisClass;
15456 if(_class)
15457 {
15458 struct Identifier * propID;
15459
15460 stmt->type = 3;
15461 stmt->__anon1.expressions = MkList();
15462 if(!watches && curFunction->propSet && (!object || (object->type == 0 && !strcmp(object->__anon1.__anon1.identifier->string, "this"))))
15463 {
15464 watches = MkListOne(MkIdentifier(curFunction->propSet->string));
15465 }
15466 else if(!watches)
15467 {
15468 }
15469 if(watches)
15470 {
15471 for(propID = (*watches).first; propID; propID = propID->next)
15472 {
15473 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
15474
15475 if(prop)
15476 {
15477 CreateFireWatcher(prop, object, stmt);
15478 }
15479 else
15480 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Property %s not found in class %s\n", (((void *)0))), propID->string, _class->fullName);
15481 }
15482 }
15483 else
15484 {
15485 struct __ecereNameSpace__ecere__com__Property * prop;
15486 struct __ecereNameSpace__ecere__com__Class * base;
15487
15488 for(base = _class; base; base = base->base)
15489 {
15490 for(prop = base->membersAndProperties.first; prop; prop = prop->next)
15491 {
15492 if(prop->isProperty && prop->isWatchable)
15493 {
15494 CreateFireWatcher(prop, object, stmt);
15495 }
15496 }
15497 }
15498 }
15499 if(object)
15500 FreeExpression(object);
15501 FreeList(watches, (void *)(FreeIdentifier));
15502 }
15503 else
15504 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Invalid object specified and not inside a class\n", (((void *)0))));
15505 }
15506 break;
15507 }
15508 case 16:
15509 {
15510 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->__anon1._watch.watches;
15511 struct Expression * object = stmt->__anon1._watch.object;
15512 struct Expression * watcher = stmt->__anon1._watch.watcher;
15513 struct __ecereNameSpace__ecere__com__Class * _class;
15514
15515 if(object)
15516 ProcessExpressionType(object);
15517 if(watcher)
15518 ProcessExpressionType(watcher);
15519 if(inCompiler)
15520 {
15521 _class = (object && object->expType && object->expType->kind == 8 && object->expType->__anon1._class) ? object->expType->__anon1._class->__anon1.registered : (((void *)0));
15522 if(watcher || thisClass)
15523 {
15524 if(_class)
15525 {
15526 struct Identifier * propID;
15527
15528 stmt->type = 3;
15529 stmt->__anon1.expressions = MkList();
15530 if(!watches)
15531 {
15532 struct __ecereNameSpace__ecere__sys__OldList * args;
15533
15534 args = MkList();
15535 ListAdd(args, CopyExpression(object));
15536 ListAdd(args, MkExpConstant("0"));
15537 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
15538 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_StopWatching")), args));
15539 }
15540 else
15541 {
15542 for(propID = (*watches).first; propID; propID = propID->next)
15543 {
15544 char propName[1024];
15545 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
15546
15547 if(prop)
15548 {
15549 char getName[1024], setName[1024];
15550 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
15551
15552 DeclareProperty(curExternal, prop, setName, getName);
15553 strcpy(propName, "__ecereProp_");
15554 FullClassNameCat(propName, prop->_class->fullName, 0);
15555 strcat(propName, "_");
15556 FullClassNameCat(propName, prop->name, 1);
15557 ListAdd(args, CopyExpression(object));
15558 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
15559 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
15560 ListAdd(stmt->__anon1.expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_StopWatching")), args));
15561 }
15562 else
15563 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Property %s not found in class %s\n", (((void *)0))), propID->string, _class->fullName);
15564 }
15565 }
15566 if(object)
15567 FreeExpression(object);
15568 if(watcher)
15569 FreeExpression(watcher);
15570 FreeList(watches, (void *)(FreeIdentifier));
15571 }
15572 else
15573 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Invalid object specified and not inside a class\n", (((void *)0))));
15574 }
15575 else
15576 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "No observer specified and not inside a class\n", (((void *)0))));
15577 }
15578 break;
15579 }
15580 }
15581 }
15582
15583 void ComputeDataTypes()
15584 {
15585 struct External * external;
15586
15587 currentClass = (((void *)0));
15588 containerClass = __ecereNameSpace__ecere__com__eSystem_FindClass(GetPrivateModule(), "Container");
15589 DeclareStruct((((void *)0)), "ecere::com::Class", 0, 1);
15590 DeclareStruct((((void *)0)), "ecere::com::Instance", 0, 1);
15591 DeclareStruct((((void *)0)), "ecere::com::Property", 0, 1);
15592 DeclareStruct((((void *)0)), "ecere::com::DataMember", 0, 1);
15593 DeclareStruct((((void *)0)), "ecere::com::Method", 0, 1);
15594 DeclareStruct((((void *)0)), "ecere::com::SerialBuffer", 0, 1);
15595 DeclareStruct((((void *)0)), "ecere::com::ClassTemplateArgument", 0, 1);
15596 DeclareFunctionUtil((((void *)0)), "eSystem_New");
15597 DeclareFunctionUtil((((void *)0)), "eSystem_New0");
15598 DeclareFunctionUtil((((void *)0)), "eSystem_Renew");
15599 DeclareFunctionUtil((((void *)0)), "eSystem_Renew0");
15600 DeclareFunctionUtil((((void *)0)), "eSystem_Delete");
15601 DeclareFunctionUtil((((void *)0)), "eClass_GetProperty");
15602 DeclareFunctionUtil((((void *)0)), "eClass_SetProperty");
15603 DeclareFunctionUtil((((void *)0)), "eInstance_FireSelfWatchers");
15604 DeclareFunctionUtil((((void *)0)), "eInstance_SetMethod");
15605 DeclareFunctionUtil((((void *)0)), "eInstance_IncRef");
15606 DeclareFunctionUtil((((void *)0)), "eInstance_StopWatching");
15607 DeclareFunctionUtil((((void *)0)), "eInstance_Watch");
15608 DeclareFunctionUtil((((void *)0)), "eInstance_FireWatchers");
15609 for(external = (*ast).first; external; external = external->next)
15610 {
15611 afterExternal = curExternal = external;
15612 if(external->type == 0)
15613 {
15614 if(memoryGuard)
15615 {
15616 DeclareFunctionUtil(external, "MemoryGuard_PushLoc");
15617 DeclareFunctionUtil(external, "MemoryGuard_PopLoc");
15618 }
15619 currentClass = external->__anon1.function->_class;
15620 ProcessFunction(external->__anon1.function);
15621 }
15622 else if(external->type == 1)
15623 {
15624 if(memoryGuard && external->__anon1.declaration && external->__anon1.declaration->type == 2)
15625 {
15626 DeclareFunctionUtil(external, "MemoryGuard_PushLoc");
15627 DeclareFunctionUtil(external, "MemoryGuard_PopLoc");
15628 }
15629 currentClass = (((void *)0));
15630 if(external->__anon1.declaration)
15631 ProcessDeclaration(external->__anon1.declaration, 1);
15632 }
15633 else if(external->type == 2)
15634 {
15635 struct ClassDefinition * _class = external->__anon1._class;
15636
15637 currentClass = external->symbol->__anon1.registered;
15638 if(memoryGuard)
15639 {
15640 DeclareFunctionUtil(external, "MemoryGuard_PushLoc");
15641 DeclareFunctionUtil(external, "MemoryGuard_PopLoc");
15642 }
15643 if(_class->definitions)
15644 {
15645 ProcessClass(_class->definitions, _class->symbol);
15646 }
15647 if(inCompiler)
15648 {
15649 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*ast), external);
15650 ((external ? (__ecereClass_External->Destructor ? __ecereClass_External->Destructor((void *)external) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(external)) : 0), external = 0);
15651 }
15652 }
15653 else if(external->type == 4)
15654 {
15655 thisNameSpace = external->__anon1.id->string;
15656 }
15657 }
15658 currentClass = (((void *)0));
15659 thisNameSpace = (((void *)0));
15660 curExternal = (((void *)0));
15661 }
15662
15663 void ProcessExpressionType(struct Expression * exp)
15664 {
15665 unsigned int unresolved = 0;
15666 struct Location oldyylloc = yylloc;
15667 unsigned int notByReference = 0;
15668
15669 if(!exp || exp->expType)
15670 return ;
15671 yylloc = exp->loc;
15672 switch(exp->type)
15673 {
15674 case 0:
15675 {
15676 struct Identifier * id = exp->__anon1.__anon1.identifier;
15677
15678 if(!id || !topContext)
15679 return ;
15680 if(id->_class && id->_class->__anon1.__anon1.name)
15681 {
15682 id->classSym = id->_class->__anon1.__anon1.symbol;
15683 }
15684 if(!strcmp(id->string, "__runtimePlatform"))
15685 {
15686 exp->expType = ProcessTypeString("ecere::com::Platform", 1);
15687 break;
15688 }
15689 else if(strstr(id->string, "__ecereClass") == id->string)
15690 {
15691 exp->expType = ProcessTypeString("ecere::com::Class", 1);
15692 break;
15693 }
15694 else if(id->_class && (id->classSym || (id->_class->__anon1.__anon1.name && !strcmp(id->_class->__anon1.__anon1.name, "property"))))
15695 {
15696 ReplaceClassMembers(exp, thisClass);
15697 if(exp->type != 0)
15698 {
15699 ProcessExpressionType(exp);
15700 break;
15701 }
15702 if(id->classSym && ResolveIdWithClass(exp, id->classSym->__anon1.registered, 0))
15703 break;
15704 }
15705 else
15706 {
15707 struct Symbol * symbol = FindSymbol(id->string, curContext, topContext, 0, id->_class && id->_class->__anon1.__anon1.name == (((void *)0)));
15708
15709 if(!symbol)
15710 {
15711 if(exp->destType && CheckExpressionType(exp, exp->destType, 0, 0))
15712 break;
15713 else
15714 {
15715 if(thisClass)
15716 {
15717 ReplaceClassMembers(exp, thisClass ? thisClass : currentClass);
15718 if(exp->type != 0)
15719 {
15720 ProcessExpressionType(exp);
15721 break;
15722 }
15723 }
15724 else if(currentClass && !id->_class)
15725 {
15726 if(ResolveIdWithClass(exp, currentClass, 1))
15727 break;
15728 }
15729 symbol = FindSymbol(id->string, topContext->parent, globalContext, 0, id->_class && id->_class->__anon1.__anon1.name == (((void *)0)));
15730 }
15731 }
15732 if(symbol)
15733 {
15734 struct Type * type = symbol->type;
15735 struct __ecereNameSpace__ecere__com__Class * _class = (type && type->kind == 8 && type->__anon1._class) ? type->__anon1._class->__anon1.registered : (((void *)0));
15736
15737 if(_class && !strcmp(id->string, "this") && !type->classObjectType)
15738 {
15739 struct Context * context = SetupTemplatesContext(_class);
15740
15741 type = ReplaceThisClassType(_class);
15742 FinishTemplatesContext(context);
15743 if(type)
15744 type->refCount = 0;
15745 }
15746 FreeSpecifier(id->_class);
15747 id->_class = (((void *)0));
15748 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
15749 id->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
15750 id->classSym = (((void *)0));
15751 exp->expType = type;
15752 if(type)
15753 type->refCount++;
15754 if(type && (type->kind == 15))
15755 exp->isConstant = 1;
15756 if(symbol->isParam || !strcmp(id->string, "this"))
15757 {
15758 if(_class && _class->type == 1 && !type->declaredWithStruct)
15759 exp->byReference = 1;
15760 }
15761 if(symbol->isIterator)
15762 {
15763 if(symbol->isIterator == 3)
15764 {
15765 exp->type = 5;
15766 exp->__anon1.list = MkListOne(MkExpOp((((void *)0)), '*', MkExpIdentifier(exp->__anon1.__anon1.identifier)));
15767 ((struct Expression *)(*exp->__anon1.list).first)->__anon1.op.exp2->expType = exp->expType;
15768 exp->expType = (((void *)0));
15769 ProcessExpressionType(exp);
15770 }
15771 else if(symbol->isIterator != 4)
15772 {
15773 exp->type = 8;
15774 exp->__anon1.member.exp = MkExpIdentifier(exp->__anon1.__anon1.identifier);
15775 exp->__anon1.member.exp->expType = exp->expType;
15776 exp->__anon1.member.member = MkIdentifier("data");
15777 exp->expType = (((void *)0));
15778 ProcessExpressionType(exp);
15779 }
15780 }
15781 break;
15782 }
15783 else
15784 {
15785 struct __ecereNameSpace__ecere__com__DefinedExpression * definedExp = (((void *)0));
15786
15787 if(thisNameSpace && !(id->_class && !id->_class->__anon1.__anon1.name))
15788 {
15789 char name[1024];
15790
15791 strcpy(name, thisNameSpace);
15792 strcat(name, "::");
15793 strcat(name, id->string);
15794 definedExp = __ecereNameSpace__ecere__com__eSystem_FindDefine(privateModule, name);
15795 }
15796 if(!definedExp)
15797 definedExp = __ecereNameSpace__ecere__com__eSystem_FindDefine(privateModule, id->string);
15798 if(definedExp)
15799 {
15800 int c;
15801
15802 for(c = 0; c < definedExpStackPos; c++)
15803 if(definedExpStack[c] == definedExp)
15804 break;
15805 if(c == definedExpStackPos && c < sizeof (definedExpStack) / sizeof(void *))
15806 {
15807 struct Location backupYylloc = yylloc;
15808 struct __ecereNameSpace__ecere__com__Instance * backInput = fileInput;
15809
15810 definedExpStack[definedExpStackPos++] = definedExp;
15811 fileInput = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
15812 ((int (*)(struct __ecereNameSpace__ecere__com__Instance *, const void *  buffer, unsigned int size, unsigned int count))__extension__ ({
15813 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
15814
15815 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
15816 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Write])(fileInput, definedExp->value, 1, strlen(definedExp->value));
15817 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))__extension__ ({
15818 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
15819
15820 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
15821 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(fileInput, 0, 0);
15822 echoOn = 0;
15823 parsedExpression = (((void *)0));
15824 resetScanner();
15825 expression_yyparse();
15826 (__ecereNameSpace__ecere__com__eInstance_DecRef(fileInput), fileInput = 0);
15827 if(backInput)
15828 fileInput = backInput;
15829 yylloc = backupYylloc;
15830 if(parsedExpression)
15831 {
15832 FreeIdentifier(id);
15833 exp->type = 5;
15834 exp->__anon1.list = MkListOne(parsedExpression);
15835 ApplyLocation(parsedExpression, &yylloc);
15836 ProcessExpressionType(exp);
15837 definedExpStackPos--;
15838 return ;
15839 }
15840 definedExpStackPos--;
15841 }
15842 else
15843 {
15844 if(inCompiler)
15845 {
15846 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Recursion in defined expression %s\n", (((void *)0))), id->string);
15847 }
15848 }
15849 }
15850 else
15851 {
15852 struct GlobalData * data = (((void *)0));
15853
15854 if(thisNameSpace && !(id->_class && !id->_class->__anon1.__anon1.name))
15855 {
15856 char name[1024];
15857
15858 strcpy(name, thisNameSpace);
15859 strcat(name, "::");
15860 strcat(name, id->string);
15861 data = FindGlobalData(name);
15862 }
15863 if(!data)
15864 data = FindGlobalData(id->string);
15865 if(data)
15866 {
15867 DeclareGlobalData(curExternal, data);
15868 exp->expType = data->dataType;
15869 if(data->dataType)
15870 data->dataType->refCount++;
15871 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
15872 id->string = __ecereNameSpace__ecere__sys__CopyString(data->fullName);
15873 FreeSpecifier(id->_class);
15874 id->_class = (((void *)0));
15875 break;
15876 }
15877 else
15878 {
15879 struct __ecereNameSpace__ecere__com__GlobalFunction * function = (((void *)0));
15880
15881 if(thisNameSpace && !(id->_class && !id->_class->__anon1.__anon1.name))
15882 {
15883 char name[1024];
15884
15885 strcpy(name, thisNameSpace);
15886 strcat(name, "::");
15887 strcat(name, id->string);
15888 function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, name);
15889 }
15890 if(!function)
15891 function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, id->string);
15892 if(function)
15893 {
15894 char name[1024];
15895
15896 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
15897 id->string = __ecereNameSpace__ecere__sys__CopyString(function->name);
15898 name[0] = (char)0;
15899 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->importType != 1 && (!function->dataType || !function->dataType->dllExport))
15900 strcpy(name, "__ecereFunction_");
15901 FullClassNameCat(name, id->string, 0);
15902 if(DeclareFunction(curExternal, function, name))
15903 {
15904 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
15905 id->string = __ecereNameSpace__ecere__sys__CopyString(name);
15906 }
15907 exp->expType = function->dataType;
15908 if(function->dataType)
15909 function->dataType->refCount++;
15910 FreeSpecifier(id->_class);
15911 id->_class = (((void *)0));
15912 break;
15913 }
15914 }
15915 }
15916 }
15917 }
15918 unresolved = 1;
15919 break;
15920 }
15921 case 1:
15922 {
15923 if(!exp->__anon1.instance->_class)
15924 {
15925 if(exp->destType && exp->destType->kind == 8 && exp->destType->__anon1._class)
15926 {
15927 exp->__anon1.instance->_class = MkSpecifierName(exp->destType->__anon1._class->string);
15928 }
15929 }
15930 ProcessInstantiationType(exp->__anon1.instance);
15931 exp->isConstant = exp->__anon1.instance->isConstant;
15932 if(exp->__anon1.instance->_class)
15933 {
15934 exp->expType = MkClassType(exp->__anon1.instance->_class->__anon1.__anon1.name);
15935 }
15936 break;
15937 }
15938 case 2:
15939 {
15940 if(!exp->expType)
15941 {
15942 char * constant = exp->__anon1.__anon1.constant;
15943 struct Type * type = (type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), type->refCount = 1, type->constant = 1, type);
15944
15945 exp->expType = type;
15946 if(constant[0] == '\'')
15947 {
15948 if((int)((unsigned char *)constant)[1] > 127)
15949 {
15950 int nb;
15951 unsigned int ch = __ecereNameSpace__ecere__sys__UTF8GetChar(constant + 1, &nb);
15952
15953 if(nb < 2)
15954 ch = constant[1];
15955 (__ecereNameSpace__ecere__com__eSystem_Delete(constant), constant = 0);
15956 exp->__anon1.__anon1.constant = PrintUInt(ch);
15957 type->kind = 8;
15958 type->__anon1._class = FindClass("unichar");
15959 type->isSigned = 0;
15960 }
15961 else
15962 {
15963 type->kind = 1;
15964 type->isSigned = 1;
15965 }
15966 }
15967 else
15968 {
15969 char * dot = strchr(constant, '.');
15970 unsigned int isHex = (constant[0] == '0' && (constant[1] == 'x' || constant[1] == 'X'));
15971 char * exponent;
15972
15973 if(isHex)
15974 {
15975 exponent = strchr(constant, 'p');
15976 if(!exponent)
15977 exponent = strchr(constant, 'P');
15978 }
15979 else
15980 {
15981 exponent = strchr(constant, 'e');
15982 if(!exponent)
15983 exponent = strchr(constant, 'E');
15984 }
15985 if(dot || exponent)
15986 {
15987 if(strchr(constant, 'f') || strchr(constant, 'F'))
15988 type->kind = 6;
15989 else
15990 type->kind = 7;
15991 type->isSigned = 1;
15992 }
15993 else
15994 {
15995 unsigned int isSigned = constant[0] == '-';
15996 char * endP = (((void *)0));
15997 long long i64 = strtoll(constant, &endP, 0);
15998 uint64 ui64 = strtoull(constant, &endP, 0);
15999 unsigned int is64Bit = endP && (!strcmp(endP, "LL") || !strcmp(endP, "ll") || !strcmp(endP, "LLU") || !strcmp(endP, "llu") || !strcmp(endP, "ull") || !strcmp(endP, "ULL"));
16000 unsigned int forceUnsigned = endP && (!strcmp(endP, "U") || !strcmp(endP, "u") || !strcmp(endP, "LLU") || !strcmp(endP, "llu") || !strcmp(endP, "ull") || !strcmp(endP, "ULL"));
16001
16002 if(isSigned)
16003 {
16004 if(i64 < (((int)0x80000000)))
16005 is64Bit = 1;
16006 }
16007 else
16008 {
16009 if(ui64 > (((int)0x7fffffff)))
16010 {
16011 if(ui64 > (0xffffffff))
16012 {
16013 is64Bit = 1;
16014 if(ui64 <= (((long long)0x7fffffffffffffffLL)) && (constant[0] != '0' || !constant[1]))
16015 isSigned = 1;
16016 }
16017 }
16018 else if(constant[0] != '0' || !constant[1])
16019 isSigned = 1;
16020 }
16021 if(forceUnsigned)
16022 isSigned = 0;
16023 type->kind = is64Bit ? 4 : 3;
16024 type->isSigned = isSigned;
16025 }
16026 }
16027 exp->isConstant = 1;
16028 if(exp->destType && exp->destType->kind == 7)
16029 type->kind = 7;
16030 else if(exp->destType && exp->destType->kind == 6)
16031 type->kind = 6;
16032 else if(exp->destType && exp->destType->kind == 4)
16033 type->kind = 4;
16034 }
16035 break;
16036 }
16037 case 3:
16038 {
16039 exp->isConstant = 1;
16040 exp->expType = __extension__ ({
16041 struct Type * __ecereInstance2 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16042
16043 __ecereInstance2->refCount = 1, __ecereInstance2->kind = 13, __ecereInstance2->__anon1.type = __extension__ ({
16044 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16045
16046 __ecereInstance1->refCount = 1, __ecereInstance1->kind = exp->__anon1.__anon2.wideString ? 2 : 1, __ecereInstance1->constant = 1, __ecereInstance1->isSigned = exp->__anon1.__anon2.wideString ? 0 : 1, __ecereInstance1;
16047 }), __ecereInstance2;
16048 });
16049 break;
16050 }
16051 case 13:
16052 case 26:
16053 ProcessExpressionType(exp->__anon1._new.size);
16054 exp->expType = __extension__ ({
16055 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16056
16057 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 13, __ecereInstance1->__anon1.type = ProcessType(exp->__anon1._new.typeName->qualifiers, exp->__anon1._new.typeName->declarator), __ecereInstance1;
16058 });
16059 DeclareType(curExternal, exp->expType->__anon1.type, 1, 0);
16060 break;
16061 case 14:
16062 case 27:
16063 ProcessExpressionType(exp->__anon1._renew.size);
16064 ProcessExpressionType(exp->__anon1._renew.exp);
16065 exp->expType = __extension__ ({
16066 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16067
16068 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 13, __ecereInstance1->__anon1.type = ProcessType(exp->__anon1._renew.typeName->qualifiers, exp->__anon1._renew.typeName->declarator), __ecereInstance1;
16069 });
16070 DeclareType(curExternal, exp->expType->__anon1.type, 1, 0);
16071 break;
16072 case 4:
16073 {
16074 unsigned int assign = 0, boolResult = 0, boolOps = 0;
16075 struct Type * type1 = (((void *)0)), * type2 = (((void *)0));
16076 unsigned int useDestType = 0, useSideType = 0;
16077 struct Location oldyylloc = yylloc;
16078 unsigned int useSideUnit = 0;
16079 struct __ecereNameSpace__ecere__com__Class * destClass = (exp->destType && exp->destType->kind == 8 && exp->destType->__anon1._class) ? exp->destType->__anon1._class->__anon1.registered : (((void *)0));
16080 struct Type * dummy = (dummy = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), dummy->count = 1, dummy->refCount = 1, dummy);
16081
16082 switch(exp->__anon1.op.op)
16083 {
16084 case '=':
16085 case MUL_ASSIGN:
16086 case DIV_ASSIGN:
16087 case MOD_ASSIGN:
16088 case ADD_ASSIGN:
16089 case SUB_ASSIGN:
16090 case LEFT_ASSIGN:
16091 case RIGHT_ASSIGN:
16092 case AND_ASSIGN:
16093 case XOR_ASSIGN:
16094 case OR_ASSIGN:
16095 assign = 1;
16096 break;
16097 case '!':
16098 break;
16099 case AND_OP:
16100 case OR_OP:
16101 boolOps = 1;
16102 boolResult = 1;
16103 break;
16104 case EQ_OP:
16105 case '<':
16106 case '>':
16107 case LE_OP:
16108 case GE_OP:
16109 case NE_OP:
16110 boolResult = 1;
16111 useSideType = 1;
16112 break;
16113 case '+':
16114 case '-':
16115 useSideUnit = 1;
16116 useSideType = 1;
16117 useDestType = 1;
16118 break;
16119 case LEFT_OP:
16120 case RIGHT_OP:
16121 useSideType = 1;
16122 useDestType = 1;
16123 break;
16124 case '|':
16125 case '^':
16126 useSideType = 1;
16127 useDestType = 1;
16128 break;
16129 case '/':
16130 case '%':
16131 useSideType = 1;
16132 useDestType = 1;
16133 break;
16134 case '&':
16135 case '*':
16136 if(exp->__anon1.op.exp1)
16137 {
16138 useSideType = 1;
16139 useDestType = 1;
16140 }
16141 break;
16142 }
16143 if(exp->__anon1.op.op == '&')
16144 {
16145 if(!exp->__anon1.op.exp1 && exp->__anon1.op.exp2 && exp->__anon1.op.exp2->type == 0 && exp->__anon1.op.exp2->__anon1.__anon1.identifier)
16146 {
16147 struct Identifier * id = exp->__anon1.op.exp2->__anon1.__anon1.identifier;
16148 struct Symbol * symbol = FindSymbol(id->string, curContext, topContext, 0, id->_class && id->_class->__anon1.__anon1.name == (((void *)0)));
16149
16150 if(symbol && symbol->isIterator == 2)
16151 {
16152 exp->type = 8;
16153 exp->__anon1.member.exp = exp->__anon1.op.exp2;
16154 exp->__anon1.member.member = MkIdentifier("key");
16155 exp->expType = (((void *)0));
16156 exp->__anon1.op.exp2->expType = symbol->type;
16157 symbol->type->refCount++;
16158 ProcessExpressionType(exp);
16159 FreeType(dummy);
16160 break;
16161 }
16162 }
16163 }
16164 if(exp->__anon1.op.exp1)
16165 {
16166 if(exp->__anon1.op.exp2 && useSideUnit && useDestType && destClass && destClass->type == 3 && destClass->base->type != 3)
16167 useDestType = 0;
16168 if(destClass && useDestType && ((destClass->type == 3 && useSideUnit) || destClass->type == 4 || destClass->type == 2))
16169 {
16170 if(exp->__anon1.op.exp1->destType)
16171 FreeType(exp->__anon1.op.exp1->destType);
16172 exp->__anon1.op.exp1->destType = exp->destType;
16173 exp->__anon1.op.exp1->opDestType = 1;
16174 if(exp->destType)
16175 exp->destType->refCount++;
16176 }
16177 else if(!assign)
16178 {
16179 if(exp->__anon1.op.exp1->destType)
16180 FreeType(exp->__anon1.op.exp1->destType);
16181 exp->__anon1.op.exp1->destType = dummy;
16182 dummy->refCount++;
16183 }
16184 if(exp->__anon1.op.exp1->destType && exp->__anon1.op.op != '=')
16185 exp->__anon1.op.exp1->destType->count++;
16186 ProcessExpressionType(exp->__anon1.op.exp1);
16187 if(exp->__anon1.op.exp1->destType && exp->__anon1.op.op != '=')
16188 exp->__anon1.op.exp1->destType->count--;
16189 exp->__anon1.op.exp1->opDestType = 0;
16190 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)
16191 {
16192 exp->__anon1.op.exp2 = MkExpConstant("1");
16193 exp->__anon1.op.op = exp->__anon1.op.op == INC_OP ? ADD_ASSIGN : SUB_ASSIGN;
16194 assign = 1;
16195 }
16196 if(exp->__anon1.op.exp1->destType == dummy)
16197 {
16198 FreeType(dummy);
16199 exp->__anon1.op.exp1->destType = (((void *)0));
16200 }
16201 type1 = exp->__anon1.op.exp1->expType;
16202 }
16203 if(exp->__anon1.op.exp2)
16204 {
16205 char expString[10240];
16206
16207 expString[0] = '\0';
16208 if(exp->__anon1.op.exp2->type == 1 && !exp->__anon1.op.exp2->__anon1.instance->_class)
16209 {
16210 if(exp->__anon1.op.exp1)
16211 {
16212 exp->__anon1.op.exp2->destType = exp->__anon1.op.exp1->expType;
16213 if(exp->__anon1.op.exp1->expType)
16214 exp->__anon1.op.exp1->expType->refCount++;
16215 }
16216 else
16217 {
16218 exp->__anon1.op.exp2->destType = exp->destType;
16219 if(!exp->__anon1.op.exp1 || (exp->__anon1.op.op != '&' && exp->__anon1.op.op != '^'))
16220 exp->__anon1.op.exp2->opDestType = 1;
16221 if(exp->destType)
16222 exp->destType->refCount++;
16223 }
16224 if(type1)
16225 type1->refCount++;
16226 exp->expType = type1;
16227 }
16228 else if(assign)
16229 {
16230 if(inCompiler)
16231 PrintExpression(exp->__anon1.op.exp2, expString);
16232 if(type1 && type1->kind == 13)
16233 {
16234 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)
16235 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "operator %s illegal on pointer\n", (((void *)0))), exp->__anon1.op.op);
16236 else if(exp->__anon1.op.op == '=')
16237 {
16238 if(exp->__anon1.op.exp2->destType)
16239 FreeType(exp->__anon1.op.exp2->destType);
16240 exp->__anon1.op.exp2->destType = type1;
16241 if(type1)
16242 type1->refCount++;
16243 }
16244 }
16245 else
16246 {
16247 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)
16248 ;
16249 else
16250 {
16251 if(exp->__anon1.op.exp2->destType)
16252 FreeType(exp->__anon1.op.exp2->destType);
16253 exp->__anon1.op.exp2->destType = type1;
16254 if(type1)
16255 type1->refCount++;
16256 }
16257 }
16258 if(type1)
16259 type1->refCount++;
16260 exp->expType = type1;
16261 }
16262 else if(destClass && ((destClass->type == 3 && useDestType && useSideUnit) || (destClass->type == 4 && useDestType)))
16263 {
16264 if(exp->__anon1.op.exp2->destType)
16265 FreeType(exp->__anon1.op.exp2->destType);
16266 exp->__anon1.op.exp2->destType = exp->destType;
16267 if(exp->__anon1.op.op != '&' && exp->__anon1.op.op != '^')
16268 exp->__anon1.op.exp2->opDestType = 1;
16269 if(exp->destType)
16270 exp->destType->refCount++;
16271 }
16272 else
16273 {
16274 if(exp->__anon1.op.exp2->destType)
16275 FreeType(exp->__anon1.op.exp2->destType);
16276 exp->__anon1.op.exp2->destType = dummy;
16277 dummy->refCount++;
16278 }
16279 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))
16280 {
16281 FreeType(exp->__anon1.op.exp2->destType);
16282 exp->__anon1.op.exp2->destType = type1;
16283 type1->refCount++;
16284 }
16285 if(exp->__anon1.op.exp2->destType && exp->__anon1.op.op != '=')
16286 exp->__anon1.op.exp2->destType->count++;
16287 if(exp->__anon1.op.op == SIZEOF)
16288 {
16289 struct Expression * e = exp->__anon1.op.exp2;
16290
16291 while((e->type == 5 || e->type == 32 || e->type == 23) && e->__anon1.list)
16292 {
16293 if(e->type == 5 || e->type == 32 || e->type == 23)
16294 {
16295 if(e->type == 23)
16296 e = (*((struct Statement *)(*e->__anon1.compound->__anon1.compound.statements).last)->__anon1.expressions).last;
16297 else
16298 e = (*e->__anon1.list).last;
16299 }
16300 }
16301 if(e->type == 11 && e->__anon1.cast.exp)
16302 e->__anon1.cast.exp->needCast = 1;
16303 }
16304 ProcessExpressionType(exp->__anon1.op.exp2);
16305 exp->__anon1.op.exp2->opDestType = 0;
16306 if(exp->__anon1.op.exp2->destType && exp->__anon1.op.op != '=')
16307 exp->__anon1.op.exp2->destType->count--;
16308 if(assign && type1 && type1->kind == 13 && exp->__anon1.op.exp2->expType)
16309 {
16310 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)
16311 {
16312 if(exp->__anon1.op.op != '=' && type1->__anon1.type->kind == 0)
16313 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "void *: unknown size\n", (((void *)0))));
16314 }
16315 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)))
16316 {
16317 if(exp->__anon1.op.op == ADD_ASSIGN)
16318 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "cannot add two pointers\n", (((void *)0))));
16319 }
16320 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))
16321 {
16322 if(exp->__anon1.op.op == ADD_ASSIGN)
16323 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "cannot add two pointers\n", (((void *)0))));
16324 }
16325 else if(inCompiler)
16326 {
16327 char type1String[1024];
16328 char type2String[1024];
16329
16330 type1String[0] = '\0';
16331 type2String[0] = '\0';
16332 PrintType(exp->__anon1.op.exp2->expType, type1String, 0, 1);
16333 PrintType(type1, type2String, 0, 1);
16334 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
16335 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expression %s (%s); expected %s\n", (((void *)0))), expString, type1String, type2String);
16336 }
16337 }
16338 if(exp->__anon1.op.exp2->destType == dummy)
16339 {
16340 FreeType(dummy);
16341 exp->__anon1.op.exp2->destType = (((void *)0));
16342 }
16343 if(exp->__anon1.op.op == '-' && !exp->__anon1.op.exp1 && exp->__anon1.op.exp2->expType && !exp->__anon1.op.exp2->expType->isSigned)
16344 {
16345 type2 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16346 type2->refCount = 1;
16347 CopyTypeInto(type2, exp->__anon1.op.exp2->expType);
16348 type2->isSigned = 1;
16349 }
16350 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))
16351 {
16352 type2 = __extension__ ({
16353 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16354
16355 __ecereInstance1->kind = 3, __ecereInstance1;
16356 });
16357 type2->refCount = 1;
16358 type2->isSigned = 1;
16359 }
16360 else
16361 {
16362 type2 = exp->__anon1.op.exp2->expType;
16363 if(type2)
16364 type2->refCount++;
16365 }
16366 }
16367 dummy->kind = 0;
16368 if(exp->__anon1.op.op == SIZEOF)
16369 {
16370 exp->expType = __extension__ ({
16371 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16372
16373 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 23, __ecereInstance1;
16374 });
16375 exp->isConstant = 1;
16376 }
16377 else if(exp->__anon1.op.op == '*' && !exp->__anon1.op.exp1)
16378 {
16379 exp->expType = Dereference(type2);
16380 if(type2 && type2->kind == 8)
16381 notByReference = 1;
16382 }
16383 else if(exp->__anon1.op.op == '&' && !exp->__anon1.op.exp1)
16384 exp->expType = Reference(type2);
16385 else if(!assign)
16386 {
16387 if(boolOps)
16388 {
16389 if(exp->__anon1.op.exp1)
16390 {
16391 if(exp->__anon1.op.exp1->destType)
16392 FreeType(exp->__anon1.op.exp1->destType);
16393 exp->__anon1.op.exp1->destType = MkClassType("bool");
16394 exp->__anon1.op.exp1->destType->truth = 1;
16395 if(!exp->__anon1.op.exp1->expType)
16396 ProcessExpressionType(exp->__anon1.op.exp1);
16397 else
16398 CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0);
16399 FreeType(exp->__anon1.op.exp1->expType);
16400 exp->__anon1.op.exp1->expType = MkClassType("bool");
16401 exp->__anon1.op.exp1->expType->truth = 1;
16402 }
16403 if(exp->__anon1.op.exp2)
16404 {
16405 if(exp->__anon1.op.exp2->destType)
16406 FreeType(exp->__anon1.op.exp2->destType);
16407 exp->__anon1.op.exp2->destType = MkClassType("bool");
16408 exp->__anon1.op.exp2->destType->truth = 1;
16409 if(!exp->__anon1.op.exp2->expType)
16410 ProcessExpressionType(exp->__anon1.op.exp2);
16411 else
16412 CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp2->destType, 0, 0);
16413 FreeType(exp->__anon1.op.exp2->expType);
16414 exp->__anon1.op.exp2->expType = MkClassType("bool");
16415 exp->__anon1.op.exp2->expType->truth = 1;
16416 }
16417 }
16418 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")))))
16419 {
16420 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"))))
16421 {
16422 if(exp->__anon1.op.op == '-' && ((type1->kind == 8 && type1->__anon1._class->__anon1.registered && type1->__anon1._class->__anon1.registered->type == 4) || (type2->kind == 8 && type2->__anon1._class->__anon1.registered && type2->__anon1._class->__anon1.registered->type == 4)))
16423 {
16424 struct Type * intType;
16425
16426 if(!type1->__anon1._class->__anon1.registered->dataType)
16427 type1->__anon1._class->__anon1.registered->dataType = ProcessTypeString(type1->__anon1._class->__anon1.registered->dataTypeString, 0);
16428 if(!type2->__anon1._class->__anon1.registered->dataType)
16429 type2->__anon1._class->__anon1.registered->dataType = ProcessTypeString(type2->__anon1._class->__anon1.registered->dataTypeString, 0);
16430 intType = ProcessTypeString((type1->__anon1._class->__anon1.registered->dataType->kind == 4 || type2->__anon1._class->__anon1.registered->dataType->kind == 4) ? "int64" : "int", 0);
16431 if(exp->__anon1.op.exp1->destType)
16432 FreeType(exp->__anon1.op.exp1->destType);
16433 if(exp->__anon1.op.exp2->destType)
16434 FreeType(exp->__anon1.op.exp2->destType);
16435 exp->__anon1.op.exp1->destType = intType;
16436 exp->__anon1.op.exp2->destType = intType;
16437 intType->refCount++;
16438 }
16439 else
16440 {
16441 if(exp->__anon1.op.exp2->destType)
16442 FreeType(exp->__anon1.op.exp2->destType);
16443 exp->__anon1.op.exp2->destType = type1;
16444 type1->refCount++;
16445 if(exp->__anon1.op.exp1->destType)
16446 FreeType(exp->__anon1.op.exp1->destType);
16447 exp->__anon1.op.exp1->destType = type2;
16448 type2->refCount++;
16449 }
16450 if(!boolResult && type1->kind == 8 && (!exp->destType || exp->destType->kind != 8) && type1->__anon1._class->__anon1.registered && type1->__anon1._class->__anon1.registered->type == 3 && type2->__anon1._class->__anon1.registered && type2->__anon1._class->__anon1.registered->type == 3 && type1->__anon1._class->__anon1.registered != type2->__anon1._class->__anon1.registered)
16451 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);
16452 if(type1->kind == 13 && type1->__anon1.type->kind == 20 && type2->kind != 13)
16453 {
16454 struct Expression * argExp = GetTemplateArgExp(type1->__anon1.type->__anon1.templateParameter, thisClass, 1);
16455
16456 if(argExp)
16457 {
16458 struct Expression * classExp = MkExpMember(argExp, MkIdentifier("dataTypeClass"));
16459
16460 exp->__anon1.op.exp1 = MkExpBrackets(MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName("byte")), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), exp->__anon1.op.exp1)));
16461 ProcessExpressionType(exp->__anon1.op.exp1);
16462 if(type2->kind != 13)
16463 {
16464 ProcessExpressionType(classExp);
16465 exp->__anon1.op.exp2 = MkExpBrackets(MkListOne(MkExpOp(exp->__anon1.op.exp2, '*', MkExpMember(classExp, MkIdentifier("typeSize")))));
16466 if(!exp->__anon1.op.exp2->expType)
16467 {
16468 if(type2)
16469 FreeType(type2);
16470 type2 = exp->__anon1.op.exp2->expType = ProcessTypeString("int", 0);
16471 type2->refCount++;
16472 }
16473 ProcessExpressionType(exp->__anon1.op.exp2);
16474 }
16475 }
16476 }
16477 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)))
16478 {
16479 if(type1->kind != 8 && type1->__anon1.type->kind == 0)
16480 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "void *: unknown size\n", (((void *)0))));
16481 exp->expType = type1;
16482 if(type1)
16483 type1->refCount++;
16484 }
16485 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)))
16486 {
16487 if(type2->kind != 8 && type2->__anon1.type->kind == 0)
16488 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "void *: unknown size\n", (((void *)0))));
16489 exp->expType = type2;
16490 if(type2)
16491 type2->refCount++;
16492 }
16493 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))
16494 {
16495 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "different levels of indirection\n", (((void *)0))));
16496 }
16497 else
16498 {
16499 unsigned int success = 0;
16500
16501 if(type1->kind == 13 && type2->kind == 13)
16502 {
16503 if(exp->__anon1.op.op == '+')
16504 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "cannot add two pointers\n", (((void *)0))));
16505 else if(exp->__anon1.op.op == '-')
16506 {
16507 if(MatchTypes(type1->__anon1.type, type2->__anon1.type, (((void *)0)), (((void *)0)), (((void *)0)), 0, 0, 0, 0, 0))
16508 {
16509 exp->expType = __extension__ ({
16510 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16511
16512 __ecereInstance1->kind = 3, __ecereInstance1->refCount = 1, __ecereInstance1;
16513 });
16514 success = 1;
16515 if(type1->__anon1.type->kind == 20)
16516 {
16517 struct Expression * argExp = GetTemplateArgExp(type1->__anon1.type->__anon1.templateParameter, thisClass, 1);
16518
16519 if(argExp)
16520 {
16521 struct Expression * classExp = MkExpMember(argExp, MkIdentifier("dataTypeClass"));
16522
16523 ProcessExpressionType(classExp);
16524 exp->type = 5;
16525 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"))));
16526 ProcessExpressionType(((struct Expression *)(*exp->__anon1.list).first)->__anon1.op.exp2);
16527 FreeType(dummy);
16528 return ;
16529 }
16530 }
16531 }
16532 }
16533 }
16534 if(!success && exp->__anon1.op.exp1->type == 2)
16535 {
16536 if(CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0))
16537 {
16538 if(exp->expType)
16539 FreeType(exp->expType);
16540 exp->expType = exp->__anon1.op.exp1->destType;
16541 if(exp->__anon1.op.exp1->destType)
16542 exp->__anon1.op.exp1->destType->refCount++;
16543 success = 1;
16544 }
16545 else if(CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp2->destType, 0, 0))
16546 {
16547 if(exp->expType)
16548 FreeType(exp->expType);
16549 exp->expType = exp->__anon1.op.exp2->destType;
16550 if(exp->__anon1.op.exp2->destType)
16551 exp->__anon1.op.exp2->destType->refCount++;
16552 success = 1;
16553 }
16554 }
16555 else if(!success)
16556 {
16557 if(CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp2->destType, 0, 0))
16558 {
16559 if(exp->expType)
16560 FreeType(exp->expType);
16561 exp->expType = exp->__anon1.op.exp2->destType;
16562 if(exp->__anon1.op.exp2->destType)
16563 exp->__anon1.op.exp2->destType->refCount++;
16564 success = 1;
16565 }
16566 else if(CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0))
16567 {
16568 if(exp->expType)
16569 FreeType(exp->expType);
16570 exp->expType = exp->__anon1.op.exp1->destType;
16571 if(exp->__anon1.op.exp1->destType)
16572 exp->__anon1.op.exp1->destType->refCount++;
16573 success = 1;
16574 }
16575 }
16576 if(!success)
16577 {
16578 char expString1[10240];
16579 char expString2[10240];
16580 char type1[1024];
16581 char type2[1024];
16582
16583 expString1[0] = '\0';
16584 expString2[0] = '\0';
16585 type1[0] = '\0';
16586 type2[0] = '\0';
16587 if(inCompiler)
16588 {
16589 PrintExpression(exp->__anon1.op.exp1, expString1);
16590 __ecereNameSpace__ecere__sys__ChangeCh(expString1, '\n', ' ');
16591 PrintExpression(exp->__anon1.op.exp2, expString2);
16592 __ecereNameSpace__ecere__sys__ChangeCh(expString2, '\n', ' ');
16593 PrintType(exp->__anon1.op.exp1->expType, type1, 0, 1);
16594 PrintType(exp->__anon1.op.exp2->expType, type2, 0, 1);
16595 }
16596 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expressions %s (%s) and %s (%s)\n", (((void *)0))), expString1, type1, expString2, type2);
16597 }
16598 }
16599 }
16600 else if(!boolResult && (!useSideUnit) && type2 && type1 && type2->kind == 8 && type1->kind != 8 && type2->__anon1._class && type2->__anon1._class->__anon1.registered && type2->__anon1._class->__anon1.registered->type == 3)
16601 {
16602 if(exp->__anon1.op.exp1->destType)
16603 FreeType(exp->__anon1.op.exp1->destType);
16604 exp->__anon1.op.exp1->destType = type2->__anon1._class->__anon1.registered->dataType;
16605 if(type2->__anon1._class->__anon1.registered->dataType)
16606 type2->__anon1._class->__anon1.registered->dataType->refCount++;
16607 CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0);
16608 exp->expType = type2;
16609 if(type2)
16610 type2->refCount++;
16611 }
16612 else if(!boolResult && (!useSideUnit) && type1 && type2 && type1->kind == 8 && type2->kind != 8 && type1->__anon1._class && type1->__anon1._class->__anon1.registered && type1->__anon1._class->__anon1.registered->type == 3)
16613 {
16614 if(exp->__anon1.op.exp2->destType)
16615 FreeType(exp->__anon1.op.exp2->destType);
16616 exp->__anon1.op.exp2->destType = type1->__anon1._class->__anon1.registered->dataType;
16617 if(type1->__anon1._class->__anon1.registered->dataType)
16618 type1->__anon1._class->__anon1.registered->dataType->refCount++;
16619 CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp2->destType, 0, 0);
16620 exp->expType = type1;
16621 if(type1)
16622 type1->refCount++;
16623 }
16624 else if(type1)
16625 {
16626 unsigned int valid = 0;
16627
16628 if(!boolResult && useSideUnit && type1 && type1->kind == 8 && type1->__anon1._class->__anon1.registered && type1->__anon1._class->__anon1.registered->type == 3 && type2 && type2->kind != 8)
16629 {
16630 if(exp->__anon1.op.exp2->destType)
16631 FreeType(exp->__anon1.op.exp2->destType);
16632 if(!type1->__anon1._class->__anon1.registered->dataType)
16633 type1->__anon1._class->__anon1.registered->dataType = ProcessTypeString(type1->__anon1._class->__anon1.registered->dataTypeString, 0);
16634 exp->__anon1.op.exp2->destType = type1->__anon1._class->__anon1.registered->dataType;
16635 exp->__anon1.op.exp2->destType->refCount++;
16636 CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp2->destType, 0, 0);
16637 if(type2)
16638 FreeType(type2);
16639 type2 = exp->__anon1.op.exp2->destType;
16640 if(type2)
16641 type2->refCount++;
16642 exp->expType = type2;
16643 type2->refCount++;
16644 }
16645 if(!boolResult && useSideUnit && type2 && type2->kind == 8 && type2->__anon1._class->__anon1.registered && type2->__anon1._class->__anon1.registered->type == 3 && type1 && type1->kind != 8)
16646 {
16647 if(exp->__anon1.op.exp1->destType)
16648 FreeType(exp->__anon1.op.exp1->destType);
16649 if(!type2->__anon1._class->__anon1.registered->dataType)
16650 type2->__anon1._class->__anon1.registered->dataType = ProcessTypeString(type2->__anon1._class->__anon1.registered->dataTypeString, 0);
16651 exp->__anon1.op.exp1->destType = type2->__anon1._class->__anon1.registered->dataType;
16652 exp->__anon1.op.exp1->destType->refCount++;
16653 CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0);
16654 type1 = exp->__anon1.op.exp1->destType;
16655 exp->expType = type1;
16656 type1->refCount++;
16657 }
16658 if(!boolResult || exp->__anon1.op.op == '>' || exp->__anon1.op.op == '<' || exp->__anon1.op.op == GE_OP || exp->__anon1.op.op == LE_OP)
16659 {
16660 unsigned int op1IsEnum = type1 && type1->kind == 8 && type1->__anon1._class && type1->__anon1._class->__anon1.registered && type1->__anon1._class->__anon1.registered->type == 4;
16661 unsigned int op2IsEnum = type2 && type2->kind == 8 && type2->__anon1._class && type2->__anon1._class->__anon1.registered && type2->__anon1._class->__anon1.registered->type == 4;
16662
16663 if(exp->__anon1.op.op == '*' || exp->__anon1.op.op == '/' || exp->__anon1.op.op == '-' || exp->__anon1.op.op == '|' || exp->__anon1.op.op == '^')
16664 {
16665 if(op1IsEnum && exp->__anon1.op.exp2->expType)
16666 {
16667 if(CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp2->expType, 0, 0))
16668 {
16669 if(exp->expType)
16670 FreeType(exp->expType);
16671 exp->expType = exp->__anon1.op.exp2->expType;
16672 if(exp->__anon1.op.exp2->expType)
16673 exp->__anon1.op.exp2->expType->refCount++;
16674 valid = 1;
16675 }
16676 }
16677 else if(op2IsEnum && exp->__anon1.op.exp1->expType)
16678 {
16679 if(CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp1->expType, 0, 0))
16680 {
16681 if(exp->expType)
16682 FreeType(exp->expType);
16683 exp->expType = exp->__anon1.op.exp1->expType;
16684 if(exp->__anon1.op.exp1->expType)
16685 exp->__anon1.op.exp1->expType->refCount++;
16686 valid = 1;
16687 }
16688 }
16689 }
16690 else
16691 {
16692 if(op1IsEnum && exp->__anon1.op.exp2->expType)
16693 {
16694 if(CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp2->expType, 0, 0))
16695 {
16696 if(exp->expType)
16697 FreeType(exp->expType);
16698 exp->expType = exp->__anon1.op.exp1->expType;
16699 if(exp->__anon1.op.exp1->expType)
16700 exp->__anon1.op.exp1->expType->refCount++;
16701 valid = 1;
16702 }
16703 }
16704 else if(op2IsEnum && exp->__anon1.op.exp1->expType)
16705 {
16706 if(CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp1->expType, 0, 0))
16707 {
16708 if(exp->expType)
16709 FreeType(exp->expType);
16710 exp->expType = exp->__anon1.op.exp2->expType;
16711 if(exp->__anon1.op.exp2->expType)
16712 exp->__anon1.op.exp2->expType->refCount++;
16713 valid = 1;
16714 }
16715 }
16716 }
16717 }
16718 if(!valid)
16719 {
16720 if(type2 && type2->kind == 8 && type2->__anon1._class && type2->__anon1._class->__anon1.registered && type2->__anon1._class->__anon1.registered->type == 3 && (type1->kind != 8 || !type1->__anon1._class || !type1->__anon1._class->__anon1.registered || type1->__anon1._class->__anon1.registered->type != 3))
16721 {
16722 if(exp->__anon1.op.exp1->destType)
16723 FreeType(exp->__anon1.op.exp1->destType);
16724 exp->__anon1.op.exp1->destType = type2;
16725 type2->refCount++;
16726 if(CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0))
16727 {
16728 if(exp->expType)
16729 FreeType(exp->expType);
16730 exp->expType = exp->__anon1.op.exp1->destType;
16731 if(exp->__anon1.op.exp1->destType)
16732 exp->__anon1.op.exp1->destType->refCount++;
16733 }
16734 }
16735 else
16736 {
16737 if(exp->__anon1.op.exp2->destType)
16738 FreeType(exp->__anon1.op.exp2->destType);
16739 exp->__anon1.op.exp2->destType = type1;
16740 type1->refCount++;
16741 if(CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp2->destType, 0, 0))
16742 {
16743 if(exp->expType)
16744 FreeType(exp->expType);
16745 exp->expType = exp->__anon1.op.exp2->destType;
16746 if(exp->__anon1.op.exp2->destType)
16747 exp->__anon1.op.exp2->destType->refCount++;
16748 }
16749 else if(type1 && type2)
16750 {
16751 char expString1[10240];
16752 char expString2[10240];
16753 char type1String[1024];
16754 char type2String[1024];
16755
16756 expString1[0] = '\0';
16757 expString2[0] = '\0';
16758 type1String[0] = '\0';
16759 type2String[0] = '\0';
16760 if(inCompiler)
16761 {
16762 PrintExpression(exp->__anon1.op.exp1, expString1);
16763 __ecereNameSpace__ecere__sys__ChangeCh(expString1, '\n', ' ');
16764 PrintExpression(exp->__anon1.op.exp2, expString2);
16765 __ecereNameSpace__ecere__sys__ChangeCh(expString2, '\n', ' ');
16766 PrintType(exp->__anon1.op.exp1->expType, type1String, 0, 1);
16767 PrintType(exp->__anon1.op.exp2->expType, type2String, 0, 1);
16768 }
16769 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expressions %s (%s) and %s (%s)\n", (((void *)0))), expString1, type1String, expString2, type2String);
16770 if(type1->kind == 8 && type1->__anon1._class && type1->__anon1._class->__anon1.registered && type1->__anon1._class->__anon1.registered->type == 4)
16771 {
16772 exp->expType = exp->__anon1.op.exp1->expType;
16773 if(exp->__anon1.op.exp1->expType)
16774 exp->__anon1.op.exp1->expType->refCount++;
16775 }
16776 else if(type2->kind == 8 && type2->__anon1._class && type2->__anon1._class->__anon1.registered && type2->__anon1._class->__anon1.registered->type == 4)
16777 {
16778 exp->expType = exp->__anon1.op.exp2->expType;
16779 if(exp->__anon1.op.exp2->expType)
16780 exp->__anon1.op.exp2->expType->refCount++;
16781 }
16782 }
16783 }
16784 }
16785 }
16786 else if(type2)
16787 {
16788 if(type2->kind == 8 && type2->__anon1._class && type2->__anon1._class->__anon1.registered && type2->__anon1._class->__anon1.registered->type == 4)
16789 {
16790 struct Type * oldType = exp->__anon1.op.exp1->expType;
16791
16792 exp->__anon1.op.exp1->expType = (((void *)0));
16793 if(CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0))
16794 FreeType(oldType);
16795 else
16796 exp->__anon1.op.exp1->expType = oldType;
16797 }
16798 if(exp->__anon1.op.exp1->destType)
16799 FreeType(exp->__anon1.op.exp1->destType);
16800 exp->__anon1.op.exp1->destType = type2;
16801 type2->refCount++;
16802 if(CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0))
16803 {
16804 if(exp->expType)
16805 FreeType(exp->expType);
16806 exp->expType = exp->__anon1.op.exp1->destType;
16807 if(exp->__anon1.op.exp1->destType)
16808 exp->__anon1.op.exp1->destType->refCount++;
16809 }
16810 }
16811 }
16812 else if(type2 && (!type1 || (type2->kind == 8 && type1->kind != 8)))
16813 {
16814 if(type1 && type2->__anon1._class && type2->__anon1._class->__anon1.registered && type2->__anon1._class->__anon1.registered->type == 3)
16815 {
16816 if(exp->__anon1.op.exp1->destType)
16817 FreeType(exp->__anon1.op.exp1->destType);
16818 exp->__anon1.op.exp1->destType = type2->__anon1._class->__anon1.registered->dataType;
16819 if(type2->__anon1._class->__anon1.registered->dataType)
16820 type2->__anon1._class->__anon1.registered->dataType->refCount++;
16821 CheckExpressionType(exp->__anon1.op.exp1, exp->__anon1.op.exp1->destType, 0, 0);
16822 }
16823 if(exp->__anon1.op.op == '!')
16824 {
16825 exp->expType = MkClassType("bool");
16826 exp->expType->truth = 1;
16827 }
16828 else
16829 {
16830 exp->expType = type2;
16831 if(type2)
16832 type2->refCount++;
16833 }
16834 }
16835 else if(type1 && (!type2 || (type1->kind == 8 && type2->kind != 8)))
16836 {
16837 if(type2 && type1->__anon1._class && type1->__anon1._class->__anon1.registered && type1->__anon1._class->__anon1.registered->type == 3)
16838 {
16839 if(exp->__anon1.op.exp2->destType)
16840 FreeType(exp->__anon1.op.exp2->destType);
16841 exp->__anon1.op.exp2->destType = type1->__anon1._class->__anon1.registered->dataType;
16842 if(type1->__anon1._class->__anon1.registered->dataType)
16843 type1->__anon1._class->__anon1.registered->dataType->refCount++;
16844 CheckExpressionType(exp->__anon1.op.exp2, exp->__anon1.op.exp2->destType, 0, 0);
16845 }
16846 exp->expType = type1;
16847 if(type1)
16848 type1->refCount++;
16849 }
16850 }
16851 yylloc = exp->loc;
16852 if(exp->__anon1.op.exp1 && !exp->__anon1.op.exp1->expType)
16853 {
16854 char expString[10000];
16855
16856 expString[0] = '\0';
16857 if(inCompiler)
16858 {
16859 PrintExpression(exp->__anon1.op.exp1, expString);
16860 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
16861 }
16862 if(expString[0])
16863 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s\n", (((void *)0))), expString);
16864 }
16865 if(exp->__anon1.op.exp2 && !exp->__anon1.op.exp2->expType)
16866 {
16867 char expString[10240];
16868
16869 expString[0] = '\0';
16870 if(inCompiler)
16871 {
16872 PrintExpression(exp->__anon1.op.exp2, expString);
16873 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
16874 }
16875 if(expString[0])
16876 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s\n", (((void *)0))), expString);
16877 }
16878 if(boolResult)
16879 {
16880 FreeType(exp->expType);
16881 exp->expType = MkClassType("bool");
16882 exp->expType->truth = 1;
16883 }
16884 if(exp->__anon1.op.op != SIZEOF)
16885 exp->isConstant = (!exp->__anon1.op.exp1 || exp->__anon1.op.exp1->isConstant) && (!exp->__anon1.op.exp2 || exp->__anon1.op.exp2->isConstant);
16886 if(exp->__anon1.op.op == SIZEOF && exp->__anon1.op.exp2->expType)
16887 {
16888 DeclareType(curExternal, exp->__anon1.op.exp2->expType, 1, 0);
16889 }
16890 if(exp->__anon1.op.op == DELETE && exp->__anon1.op.exp2 && exp->__anon1.op.exp2->expType && __ecereProp_Type_Get_specConst(exp->__anon1.op.exp2->expType))
16891 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "deleting const qualified object\n", (((void *)0))));
16892 yylloc = oldyylloc;
16893 FreeType(dummy);
16894 if(type2)
16895 FreeType(type2);
16896 break;
16897 }
16898 case 5:
16899 case 32:
16900 {
16901 struct Expression * e;
16902
16903 exp->isConstant = 1;
16904 for(e = (*exp->__anon1.list).first; e; e = e->next)
16905 {
16906 if(!e->next)
16907 {
16908 FreeType(e->destType);
16909 e->opDestType = exp->opDestType;
16910 e->destType = exp->destType;
16911 if(e->destType)
16912 {
16913 exp->destType->refCount++;
16914 }
16915 }
16916 ProcessExpressionType(e);
16917 if(!exp->expType && !e->next)
16918 {
16919 exp->expType = e->expType;
16920 if(e->expType)
16921 e->expType->refCount++;
16922 }
16923 if(!e->isConstant)
16924 exp->isConstant = 0;
16925 }
16926 e = (*exp->__anon1.list).first;
16927 if(!e->next && e->type == 8)
16928 {
16929 struct Expression * next = exp->next, * prev = exp->prev;
16930
16931 FreeType(exp->expType);
16932 FreeType(exp->destType);
16933 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->__anon1.list), exp->__anon1.list = 0);
16934 *exp = *e;
16935 exp->prev = prev;
16936 exp->next = next;
16937 ((e ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)e) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(e)) : 0), e = 0);
16938 ProcessExpressionType(exp);
16939 }
16940 break;
16941 }
16942 case 6:
16943 {
16944 struct Expression * e;
16945
16946 exp->isConstant = 1;
16947 ProcessExpressionType(exp->__anon1.index.exp);
16948 if(!exp->__anon1.index.exp->isConstant)
16949 exp->isConstant = 0;
16950 if(exp->__anon1.index.exp->expType)
16951 {
16952 struct Type * source = exp->__anon1.index.exp->expType;
16953
16954 if(source->kind == 8 && source->__anon1._class && source->__anon1._class->__anon1.registered)
16955 {
16956 struct __ecereNameSpace__ecere__com__Class * _class = source->__anon1._class->__anon1.registered;
16957 struct __ecereNameSpace__ecere__com__Class * c = _class->templateClass ? _class->templateClass : _class;
16958
16959 if(_class != containerClass && __ecereNameSpace__ecere__com__eClass_IsDerived(c, containerClass) && _class->templateArgs)
16960 {
16961 exp->expType = ProcessTypeString(_class->templateArgs[2].__anon1.__anon1.dataTypeString, 0);
16962 if(exp->__anon1.index.index && (*exp->__anon1.index.index).last)
16963 {
16964 struct Type * type = ProcessTypeString(_class->templateArgs[1].__anon1.__anon1.dataTypeString, 0);
16965
16966 if(type->kind == 8)
16967 type->constant = 1;
16968 else if(type->kind == 13)
16969 {
16970 struct Type * t = type;
16971
16972 while(t->kind == 13)
16973 t = t->__anon1.type;
16974 t->constant = 1;
16975 }
16976 ((struct Expression *)(*exp->__anon1.index.index).last)->destType = type;
16977 }
16978 }
16979 }
16980 }
16981 for(e = (*exp->__anon1.index.index).first; e; e = e->next)
16982 {
16983 if(!e->next && exp->__anon1.index.exp->expType && exp->__anon1.index.exp->expType->kind == 12 && exp->__anon1.index.exp->expType->__anon1.__anon4.enumClass)
16984 {
16985 if(e->destType)
16986 FreeType(e->destType);
16987 e->destType = MkClassType(exp->__anon1.index.exp->expType->__anon1.__anon4.enumClass->string);
16988 }
16989 ProcessExpressionType(e);
16990 if(!e->next)
16991 {
16992 }
16993 if(!e->isConstant)
16994 exp->isConstant = 0;
16995 }
16996 if(!exp->expType)
16997 exp->expType = Dereference(exp->__anon1.index.exp->expType);
16998 if(exp->expType)
16999 DeclareType(curExternal, exp->expType, 1, 0);
17000 break;
17001 }
17002 case 7:
17003 {
17004 struct Expression * e;
17005 struct Type * functionType;
17006 struct Type * methodType = (((void *)0));
17007 char name[1024];
17008
17009 name[0] = '\0';
17010 if(inCompiler)
17011 {
17012 PrintExpression(exp->__anon1.call.exp, name);
17013 if(exp->__anon1.call.exp->expType && !exp->__anon1.call.exp->expType->__anon1.__anon2.returnType)
17014 {
17015 PrintExpression(exp->__anon1.call.exp, name);
17016 }
17017 }
17018 if(exp->__anon1.call.exp->type == 0)
17019 {
17020 struct Expression * idExp = exp->__anon1.call.exp;
17021 struct Identifier * id = idExp->__anon1.__anon1.identifier;
17022
17023 if(!strcmp(id->string, "__builtin_frame_address"))
17024 {
17025 exp->expType = ProcessTypeString("void *", 1);
17026 if(exp->__anon1.call.arguments && (*exp->__anon1.call.arguments).first)
17027 ProcessExpressionType((*exp->__anon1.call.arguments).first);
17028 break;
17029 }
17030 else if(!strcmp(id->string, "__ENDIAN_PAD"))
17031 {
17032 exp->expType = ProcessTypeString("int", 1);
17033 if(exp->__anon1.call.arguments && (*exp->__anon1.call.arguments).first)
17034 ProcessExpressionType((*exp->__anon1.call.arguments).first);
17035 break;
17036 }
17037 else if(!strcmp(id->string, "Max") || !strcmp(id->string, "Min") || !strcmp(id->string, "Sgn") || !strcmp(id->string, "Abs"))
17038 {
17039 struct Expression * a = (((void *)0));
17040 struct Expression * b = (((void *)0));
17041 struct Expression * tempExp1 = (((void *)0)), * tempExp2 = (((void *)0));
17042
17043 if((!strcmp(id->string, "Max") || !strcmp(id->string, "Min")) && (*exp->__anon1.call.arguments).count == 2)
17044 {
17045 a = (*exp->__anon1.call.arguments).first;
17046 b = (*exp->__anon1.call.arguments).last;
17047 tempExp1 = a;
17048 tempExp2 = b;
17049 }
17050 else if((*exp->__anon1.call.arguments).count == 1)
17051 {
17052 a = (*exp->__anon1.call.arguments).first;
17053 tempExp1 = a;
17054 }
17055 if(a)
17056 {
17057 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear((&*exp->__anon1.call.arguments));
17058 idExp->__anon1.__anon1.identifier = (((void *)0));
17059 FreeExpContents(exp);
17060 ProcessExpressionType(a);
17061 if(b)
17062 ProcessExpressionType(b);
17063 exp->type = 5;
17064 exp->__anon1.list = MkList();
17065 if(a->expType && (!b || b->expType))
17066 {
17067 if((!a->isConstant && a->type != 0) || (b && !b->isConstant && b->type != 0))
17068 {
17069 if(inCompiler)
17070 {
17071 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
17072 struct __ecereNameSpace__ecere__sys__OldList * decls = MkList();
17073 struct Declaration * decl;
17074 char temp1[1024], temp2[1024];
17075
17076 GetTypeSpecs(a->expType, specs);
17077 if(a && !a->isConstant && a->type != 0)
17078 {
17079 sprintf(temp1, "__simpleStruct%d", curContext->simpleID++);
17080 ListAdd(decls, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(temp1)), (((void *)0))));
17081 tempExp1 = QMkExpId(temp1);
17082 tempExp1->expType = a->expType;
17083 if(a->expType)
17084 a->expType->refCount++;
17085 ListAdd(exp->__anon1.list, MkExpOp(CopyExpression(tempExp1), '=', a));
17086 }
17087 if(b && !b->isConstant && b->type != 0)
17088 {
17089 sprintf(temp2, "__simpleStruct%d", curContext->simpleID++);
17090 ListAdd(decls, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(temp2)), (((void *)0))));
17091 tempExp2 = QMkExpId(temp2);
17092 tempExp2->expType = b->expType;
17093 if(b->expType)
17094 b->expType->refCount++;
17095 ListAdd(exp->__anon1.list, MkExpOp(CopyExpression(tempExp2), '=', b));
17096 }
17097 decl = MkDeclaration(specs, decls);
17098 if(!curCompound->__anon1.compound.declarations)
17099 curCompound->__anon1.compound.declarations = MkList();
17100 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*curCompound->__anon1.compound.declarations), (((void *)0)), decl);
17101 }
17102 }
17103 }
17104 if(!strcmp(id->string, "Max") || !strcmp(id->string, "Min"))
17105 {
17106 int op = (!strcmp(id->string, "Max")) ? '>' : '<';
17107
17108 ListAdd(exp->__anon1.list, MkExpCondition(MkExpBrackets(MkListOne(MkExpOp(CopyExpression(tempExp1), op, CopyExpression(tempExp2)))), MkListOne(CopyExpression(tempExp1)), CopyExpression(tempExp2)));
17109 exp->expType = a->expType;
17110 if(a->expType)
17111 a->expType->refCount++;
17112 }
17113 else if(!strcmp(id->string, "Abs"))
17114 {
17115 ListAdd(exp->__anon1.list, MkExpCondition(MkExpBrackets(MkListOne(MkExpOp(CopyExpression(tempExp1), '<', MkExpConstant("0")))), MkListOne(MkExpOp((((void *)0)), '-', CopyExpression(tempExp1))), CopyExpression(tempExp1)));
17116 exp->expType = a->expType;
17117 if(a->expType)
17118 a->expType->refCount++;
17119 }
17120 else if(!strcmp(id->string, "Sgn"))
17121 {
17122 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"))))));
17123 exp->expType = ProcessTypeString("int", 0);
17124 }
17125 FreeExpression(tempExp1);
17126 if(tempExp2)
17127 FreeExpression(tempExp2);
17128 FreeIdentifier(id);
17129 break;
17130 }
17131 }
17132 }
17133 {
17134 struct Type * dummy = (dummy = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), dummy->count = 1, dummy->refCount = 1, dummy);
17135
17136 if(!exp->__anon1.call.exp->destType)
17137 {
17138 exp->__anon1.call.exp->destType = dummy;
17139 dummy->refCount++;
17140 }
17141 ProcessExpressionType(exp->__anon1.call.exp);
17142 if(exp->__anon1.call.exp->destType == dummy)
17143 {
17144 FreeType(dummy);
17145 exp->__anon1.call.exp->destType = (((void *)0));
17146 }
17147 FreeType(dummy);
17148 }
17149 functionType = exp->__anon1.call.exp->expType;
17150 if(functionType && functionType->kind == 16)
17151 {
17152 methodType = functionType;
17153 functionType = methodType->__anon1.__anon3.method->dataType;
17154 if(exp->__anon1.call.exp->expType->__anon1.__anon3.usedClass)
17155 {
17156 char typeString[1024];
17157
17158 typeString[0] = '\0';
17159 {
17160 struct Symbol * back = functionType->__anon1.__anon2.thisClass;
17161
17162 functionType->__anon1.__anon2.thisClass = (((void *)0));
17163 PrintType(functionType, typeString, 1, 1);
17164 functionType->__anon1.__anon2.thisClass = back;
17165 }
17166 if(strstr(typeString, "thisclass"))
17167 {
17168 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
17169 struct Declarator * decl;
17170
17171 {
17172 struct Context * context = SetupTemplatesContext(exp->__anon1.call.exp->expType->__anon1.__anon3.usedClass);
17173
17174 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
17175 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))
17176 thisClassParams = 0;
17177 ReplaceThisClassSpecifiers(specs, exp->__anon1.call.exp->expType->__anon1.__anon3.usedClass);
17178 {
17179 struct __ecereNameSpace__ecere__com__Class * backupThisClass = thisClass;
17180
17181 thisClass = exp->__anon1.call.exp->expType->__anon1.__anon3.usedClass;
17182 ProcessDeclarator(decl, 1);
17183 thisClass = backupThisClass;
17184 }
17185 thisClassParams = 1;
17186 functionType = ProcessType(specs, decl);
17187 functionType->refCount = 0;
17188 FinishTemplatesContext(context);
17189 {
17190 struct Type * p, * op;
17191
17192 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)
17193 {
17194 if(op->kind == 21)
17195 p->thisClassFrom = methodType->__anon1.__anon3.method->_class;
17196 }
17197 }
17198 if(methodType->__anon1.__anon3.method->dataType->__anon1.__anon2.returnType->kind == 21)
17199 {
17200 functionType->__anon1.__anon2.returnType->thisClassFrom = methodType->__anon1.__anon3.method->_class;
17201 }
17202 }
17203 FreeList(specs, (void *)(FreeSpecifier));
17204 FreeDeclarator(decl);
17205 }
17206 }
17207 }
17208 if(functionType && functionType->kind == 13 && functionType->__anon1.type && functionType->__anon1.type->kind == 11)
17209 {
17210 struct Type * type = functionType->__anon1.type;
17211
17212 if(!functionType->refCount)
17213 {
17214 functionType->__anon1.type = (((void *)0));
17215 FreeType(functionType);
17216 }
17217 functionType = type;
17218 }
17219 if(functionType && functionType->kind != 11)
17220 {
17221 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "called object %s is not a function\n", (((void *)0))), name);
17222 }
17223 else if(functionType)
17224 {
17225 unsigned int emptyParams = 0, noParams = 0;
17226 struct Expression * e = exp->__anon1.call.arguments ? (*exp->__anon1.call.arguments).first : (((void *)0));
17227 struct Type * type = functionType->__anon1.__anon2.params.first;
17228 struct Expression * memberExp = (exp->__anon1.call.exp->type == 8) ? exp->__anon1.call.exp : (((void *)0));
17229 int extra = 0;
17230 struct Location oldyylloc = yylloc;
17231
17232 if(!type)
17233 emptyParams = 1;
17234 if(functionType->extraParam && e && functionType->__anon1.__anon2.thisClass)
17235 {
17236 e->destType = MkClassType(functionType->__anon1.__anon2.thisClass->string);
17237 e = e->next;
17238 }
17239 if(!functionType->__anon1.__anon2.staticMethod && !functionType->extraParam)
17240 {
17241 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)
17242 {
17243 type = MkClassType(memberExp->__anon1.member.exp->expType->__anon1._class->string);
17244 if(e)
17245 {
17246 e->destType = type;
17247 e = e->next;
17248 type = functionType->__anon1.__anon2.params.first;
17249 }
17250 else
17251 type->refCount = 0;
17252 }
17253 else if(!memberExp && (functionType->__anon1.__anon2.thisClass || (methodType && methodType->__anon1.__anon3.methodClass)))
17254 {
17255 type = MkClassType(functionType->__anon1.__anon2.thisClass ? functionType->__anon1.__anon2.thisClass->string : (methodType ? methodType->__anon1.__anon3.methodClass->fullName : (((void *)0))));
17256 type->byReference = functionType->byReference;
17257 type->typedByReference = functionType->typedByReference;
17258 if(e)
17259 {
17260 if(e->next && type->kind == 8 && (functionType && functionType->__anon1.__anon2.thisClass) && functionType->classObjectType == 2)
17261 e = e->next;
17262 e->destType = type;
17263 e = e->next;
17264 type = functionType->__anon1.__anon2.params.first;
17265 }
17266 else
17267 type->refCount = 0;
17268 }
17269 }
17270 if(type && type->kind == 0)
17271 {
17272 noParams = 1;
17273 if(!type->refCount)
17274 FreeType(type);
17275 type = (((void *)0));
17276 }
17277 for(; e; e = e->next)
17278 {
17279 if(!type && !emptyParams)
17280 {
17281 yylloc = e->loc;
17282 if(methodType && methodType->__anon1.__anon3.methodClass)
17283 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);
17284 else
17285 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);
17286 break;
17287 }
17288 if(methodType && type && type->kind == 20 && type->__anon1.templateParameter->type == 0)
17289 {
17290 struct Type * templatedType = (((void *)0));
17291 struct __ecereNameSpace__ecere__com__Class * _class = methodType->__anon1.__anon3.usedClass;
17292 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
17293 int id = 0;
17294
17295 if(_class && _class->templateArgs)
17296 {
17297 struct __ecereNameSpace__ecere__com__Class * sClass;
17298
17299 for(sClass = _class; sClass; sClass = sClass->base)
17300 {
17301 if(sClass->templateClass)
17302 sClass = sClass->templateClass;
17303 id = 0;
17304 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
17305 {
17306 if(curParam->type == 0 && !strcmp(type->__anon1.templateParameter->identifier->string, curParam->name))
17307 {
17308 struct __ecereNameSpace__ecere__com__Class * nextClass;
17309
17310 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
17311 {
17312 if(nextClass->templateClass)
17313 nextClass = nextClass->templateClass;
17314 id += nextClass->templateParams.count;
17315 }
17316 break;
17317 }
17318 id++;
17319 }
17320 if(curParam)
17321 break;
17322 }
17323 }
17324 if(curParam && _class->templateArgs[id].__anon1.__anon1.dataTypeString)
17325 {
17326 unsigned int constant = type->constant;
17327 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = _class->templateArgs[id];
17328
17329 {
17330 struct Context * context = SetupTemplatesContext(_class);
17331
17332 templatedType = ProcessTypeString(arg.__anon1.__anon1.dataTypeString, 0);
17333 FinishTemplatesContext(context);
17334 }
17335 if(templatedType->kind == 8 && constant)
17336 templatedType->constant = 1;
17337 else if(templatedType->kind == 13)
17338 {
17339 struct Type * t = templatedType->__anon1.type;
17340
17341 while(t->kind == 13)
17342 t = t->__anon1.type;
17343 if(constant)
17344 t->constant = constant;
17345 }
17346 e->destType = templatedType;
17347 if(templatedType)
17348 {
17349 templatedType->passAsTemplate = 1;
17350 }
17351 }
17352 else
17353 {
17354 e->destType = type;
17355 if(type)
17356 type->refCount++;
17357 }
17358 }
17359 else
17360 {
17361 if(type && type->kind == 14 && type->prev && type->prev->kind == 8 && type->prev->classObjectType)
17362 {
17363 e->destType = type->prev;
17364 e->destType->refCount++;
17365 }
17366 else
17367 {
17368 e->destType = type;
17369 if(type)
17370 type->refCount++;
17371 }
17372 }
17373 if(type && type->kind != 14)
17374 {
17375 struct Type * next = type->next;
17376
17377 if(!type->refCount)
17378 FreeType(type);
17379 type = next;
17380 }
17381 }
17382 if(type && type->kind != 14)
17383 {
17384 if(methodType && methodType->__anon1.__anon3.methodClass)
17385 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);
17386 else
17387 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);
17388 }
17389 yylloc = oldyylloc;
17390 if(type && !type->refCount)
17391 FreeType(type);
17392 }
17393 else
17394 {
17395 functionType = __extension__ ({
17396 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
17397
17398 __ecereInstance1->refCount = 0, __ecereInstance1->kind = 11, __ecereInstance1;
17399 });
17400 if(exp->__anon1.call.exp->type == 0)
17401 {
17402 char * string = exp->__anon1.call.exp->__anon1.__anon1.identifier->string;
17403
17404 if(inCompiler)
17405 {
17406 struct Symbol * symbol;
17407 struct Location oldyylloc = yylloc;
17408
17409 yylloc = exp->__anon1.call.exp->__anon1.__anon1.identifier->loc;
17410 if(strstr(string, "__builtin_") == string)
17411 {
17412 if(exp->destType)
17413 {
17414 functionType->__anon1.__anon2.returnType = exp->destType;
17415 exp->destType->refCount++;
17416 }
17417 }
17418 else
17419 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "%s undefined; assuming extern returning int\n", (((void *)0))), string);
17420 symbol = __extension__ ({
17421 struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
17422
17423 __ecereInstance1->string = __ecereNameSpace__ecere__sys__CopyString(string), __ecereInstance1->type = ProcessTypeString("int()", 1), __ecereInstance1;
17424 });
17425 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)symbol);
17426 if(strstr(symbol->string, "::"))
17427 globalContext->hasNameSpace = 1;
17428 yylloc = oldyylloc;
17429 }
17430 }
17431 else if(exp->__anon1.call.exp->type == 8)
17432 {
17433 }
17434 else
17435 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "callable object undefined; extern assuming returning int\n", (((void *)0))));
17436 if(!functionType->__anon1.__anon2.returnType)
17437 {
17438 functionType->__anon1.__anon2.returnType = __extension__ ({
17439 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
17440
17441 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 3, __ecereInstance1;
17442 });
17443 }
17444 }
17445 if(functionType && functionType->kind == 11)
17446 {
17447 exp->expType = functionType->__anon1.__anon2.returnType;
17448 if(functionType->__anon1.__anon2.returnType)
17449 functionType->__anon1.__anon2.returnType->refCount++;
17450 if(!functionType->refCount)
17451 FreeType(functionType);
17452 }
17453 if(exp->__anon1.call.arguments)
17454 {
17455 for(e = (*exp->__anon1.call.arguments).first; e; e = e->next)
17456 ProcessExpressionType(e);
17457 }
17458 break;
17459 }
17460 case 8:
17461 {
17462 struct Type * type;
17463 struct Location oldyylloc = yylloc;
17464 unsigned int thisPtr;
17465 struct Expression * checkExp = exp->__anon1.member.exp;
17466
17467 while(checkExp)
17468 {
17469 if(checkExp->type == 11)
17470 checkExp = checkExp->__anon1.cast.exp;
17471 else if(checkExp->type == 5)
17472 checkExp = checkExp->__anon1.list ? (*checkExp->__anon1.list).first : (((void *)0));
17473 else
17474 break;
17475 }
17476 thisPtr = (checkExp && checkExp->type == 0 && !strcmp(checkExp->__anon1.__anon1.identifier->string, "this"));
17477 exp->thisPtr = thisPtr;
17478 if(exp->__anon1.member.member && exp->__anon1.member.member->_class && exp->__anon1.member.member->_class->__anon1.__anon1.name)
17479 {
17480 exp->__anon1.member.member->classSym = exp->__anon1.member.member->_class->__anon1.__anon1.symbol;
17481 }
17482 ProcessExpressionType(exp->__anon1.member.exp);
17483 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)
17484 {
17485 exp->isConstant = 0;
17486 }
17487 else
17488 exp->isConstant = exp->__anon1.member.exp->isConstant;
17489 type = exp->__anon1.member.exp->expType;
17490 yylloc = exp->loc;
17491 if(type && (type->kind == 20))
17492 {
17493 struct __ecereNameSpace__ecere__com__Class * _class = thisClass ? thisClass : currentClass;
17494 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param = (((void *)0));
17495
17496 if(_class)
17497 {
17498 for(param = _class->templateParams.first; param; param = param->next)
17499 {
17500 if(param->type == 1 && exp->__anon1.member.member && exp->__anon1.member.member->string && !strcmp(param->name, exp->__anon1.member.member->string))
17501 break;
17502 }
17503 }
17504 if(param && param->defaultArg.__anon1.__anon2.__anon1.member)
17505 {
17506 struct Expression * argExp = GetTemplateArgExpByName(param->name, thisClass, 1);
17507
17508 if(argExp)
17509 {
17510 struct Expression * expMember = exp->__anon1.member.exp;
17511 struct Declarator * decl;
17512 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
17513 char thisClassTypeString[1024];
17514
17515 FreeIdentifier(exp->__anon1.member.member);
17516 ProcessExpressionType(argExp);
17517 {
17518 char * colon = strstr(param->defaultArg.__anon1.__anon2.memberString, "::");
17519
17520 if(colon)
17521 {
17522 memcpy(thisClassTypeString, param->defaultArg.__anon1.__anon2.memberString, colon - param->defaultArg.__anon1.__anon2.memberString);
17523 thisClassTypeString[colon - param->defaultArg.__anon1.__anon2.memberString] = '\0';
17524 }
17525 else
17526 strcpy(thisClassTypeString, _class->fullName);
17527 }
17528 decl = SpecDeclFromString(param->defaultArg.__anon1.__anon2.__anon1.member->dataTypeString, specs, (((void *)0)));
17529 exp->expType = ProcessType(specs, decl);
17530 if(exp->expType->kind == 8 && exp->expType->__anon1._class && exp->expType->__anon1._class->__anon1.registered && exp->expType->__anon1._class->__anon1.registered->templateClass)
17531 {
17532 struct __ecereNameSpace__ecere__com__Class * expClass = exp->expType->__anon1._class->__anon1.registered;
17533 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
17534 int paramCount = 0;
17535 int lastParam = -1;
17536 char templateString[1024];
17537 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
17538
17539 sprintf(templateString, "%s<", expClass->templateClass->fullName);
17540 for(cClass = expClass; cClass; cClass = cClass->base)
17541 {
17542 int p = 0;
17543
17544 for(param = cClass->templateParams.first; param; param = param->next)
17545 {
17546 int id = p;
17547 struct __ecereNameSpace__ecere__com__Class * sClass;
17548 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
17549
17550 for(sClass = cClass->base; sClass; sClass = sClass->base)
17551 id += sClass->templateParams.count;
17552 arg = expClass->templateArgs[id];
17553 for(sClass = _class; sClass; sClass = sClass->base)
17554 {
17555 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * cParam;
17556 int p = 0;
17557 struct __ecereNameSpace__ecere__com__Class * nextClass;
17558
17559 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
17560 p += nextClass->templateParams.count;
17561 for(cParam = sClass->templateParams.first; cParam; cParam = cParam->next, p++)
17562 {
17563 if(cParam->type == 0 && arg.__anon1.__anon1.dataTypeString && !strcmp(cParam->name, arg.__anon1.__anon1.dataTypeString))
17564 {
17565 if(_class->templateArgs && arg.__anon1.__anon1.dataTypeString && (!param->defaultArg.__anon1.__anon1.dataTypeString || strcmp(arg.__anon1.__anon1.dataTypeString, param->defaultArg.__anon1.__anon1.dataTypeString)))
17566 {
17567 arg.__anon1.__anon1.dataTypeString = _class->templateArgs[p].__anon1.__anon1.dataTypeString;
17568 arg.__anon1.__anon1.dataTypeClass = _class->templateArgs[p].__anon1.__anon1.dataTypeClass;
17569 break;
17570 }
17571 }
17572 }
17573 }
17574 {
17575 char argument[256];
17576
17577 argument[0] = '\0';
17578 switch(param->type)
17579 {
17580 case 2:
17581 {
17582 char expString[1024];
17583 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
17584 struct Declarator * decl = SpecDeclFromString(param->__anon1.dataTypeString, specs, (((void *)0)));
17585 struct Expression * exp;
17586 char * string = PrintHexUInt64(arg.__anon1.expression.__anon1.ui64);
17587
17588 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
17589 (__ecereNameSpace__ecere__com__eSystem_Delete(string), string = 0);
17590 ProcessExpressionType(exp);
17591 ComputeExpression(exp);
17592 expString[0] = '\0';
17593 PrintExpression(exp, expString);
17594 strcat(argument, expString);
17595 FreeExpression(exp);
17596 break;
17597 }
17598 case 1:
17599 {
17600 strcat(argument, arg.__anon1.__anon2.__anon1.member->name);
17601 break;
17602 }
17603 case 0:
17604 {
17605 if(arg.__anon1.__anon1.dataTypeString && (!param->defaultArg.__anon1.__anon1.dataTypeString || strcmp(arg.__anon1.__anon1.dataTypeString, param->defaultArg.__anon1.__anon1.dataTypeString)))
17606 {
17607 if(!strcmp(arg.__anon1.__anon1.dataTypeString, "thisclass"))
17608 strcat(argument, thisClassTypeString);
17609 else
17610 strcat(argument, arg.__anon1.__anon1.dataTypeString);
17611 }
17612 break;
17613 }
17614 }
17615 if(argument[0])
17616 {
17617 if(paramCount)
17618 strcat(templateString, ", ");
17619 if(lastParam != p - 1)
17620 {
17621 strcat(templateString, param->name);
17622 strcat(templateString, " = ");
17623 }
17624 strcat(templateString, argument);
17625 paramCount++;
17626 lastParam = p;
17627 }
17628 p++;
17629 }
17630 }
17631 }
17632 {
17633 int len = strlen(templateString);
17634
17635 if(templateString[len - 1] == '>')
17636 templateString[len++] = ' ';
17637 templateString[len++] = '>';
17638 templateString[len++] = '\0';
17639 }
17640 {
17641 struct Context * context = SetupTemplatesContext(_class);
17642
17643 FreeType(exp->expType);
17644 exp->expType = ProcessTypeString(templateString, 0);
17645 FinishTemplatesContext(context);
17646 }
17647 }
17648 if(!__ecereProp_Type_Get_isPointerType(expMember->expType))
17649 expMember = MkExpCast(MkTypeName(MkListOne(MkSpecifierName("uintptr")), (((void *)0))), expMember);
17650 exp->type = 5;
17651 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")))))))));
17652 }
17653 }
17654 else if(type->__anon1.templateParameter && type->__anon1.templateParameter->type == 0 && (type->__anon1.templateParameter->__anon1.dataType || type->__anon1.templateParameter->dataTypeString))
17655 {
17656 type = ProcessTemplateParameterType(type->__anon1.templateParameter);
17657 }
17658 }
17659 if(type && (type->kind == 20))
17660 ;
17661 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)))
17662 {
17663 struct Identifier * id = exp->__anon1.member.member;
17664 int typeKind = type->kind;
17665 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));
17666
17667 if(typeKind == 19 && exp->__anon1.member.exp->type == 24)
17668 {
17669 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "ecere::com::Class");
17670 typeKind = 8;
17671 }
17672 if(id)
17673 {
17674 if(typeKind == 3 || typeKind == 15)
17675 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "int");
17676 else if(!_class)
17677 {
17678 if(type->kind == 8 && type->__anon1._class && type->__anon1._class->__anon1.registered)
17679 {
17680 _class = type->__anon1._class->__anon1.registered;
17681 }
17682 else if((type->kind == 12 || type->kind == 13) && type->__anon1.type && type->__anon1.type->kind == 1)
17683 {
17684 _class = FindClass("char *")->__anon1.registered;
17685 }
17686 else if(type->kind == 13)
17687 {
17688 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "uintptr");
17689 FreeType(exp->expType);
17690 exp->expType = ProcessTypeString("uintptr", 0);
17691 exp->byReference = 1;
17692 }
17693 else
17694 {
17695 char string[1024] = "";
17696 struct Symbol * classSym;
17697
17698 PrintTypeNoConst(type, string, 0, 1);
17699 classSym = FindClass(string);
17700 if(classSym)
17701 _class = classSym->__anon1.registered;
17702 }
17703 }
17704 }
17705 if(_class && id)
17706 {
17707 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
17708 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
17709 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
17710 struct __ecereNameSpace__ecere__com__Property * revConvert = (((void *)0));
17711 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
17712
17713 if(id && id->_class && id->_class->__anon1.__anon1.name && !strcmp(id->_class->__anon1.__anon1.name, "property"))
17714 exp->__anon1.member.memberType = 1;
17715 if(id && id->_class && type->__anon1._class && !__ecereNameSpace__ecere__com__eClass_IsDerived(type->__anon1._class->__anon1.registered, _class))
17716 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "invalid class specifier %s for object of class %s\n", (((void *)0))), _class->fullName, type->__anon1._class->string);
17717 if(typeKind != 19)
17718 {
17719 if((exp->__anon1.member.memberType == 0 && thisPtr) || exp->__anon1.member.memberType == 3)
17720 {
17721 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
17722 if(member && member->_class != (_class->templateClass ? _class->templateClass : _class) && exp->__anon1.member.memberType != 3)
17723 {
17724 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
17725 if(prop)
17726 member = (((void *)0));
17727 }
17728 if(!member && !prop)
17729 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
17730 if((member && member->_class == (_class->templateClass ? _class->templateClass : _class)) || (prop && prop->_class == (_class->templateClass ? _class->templateClass : _class)))
17731 exp->__anon1.member.thisPtr = 1;
17732 }
17733 else
17734 {
17735 unsigned int useMemberForNonConst = 0;
17736
17737 if(!id->classSym)
17738 {
17739 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, (((void *)0)));
17740 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);
17741 if(useMemberForNonConst || !id->_class || !id->_class->__anon1.__anon1.name || strcmp(id->_class->__anon1.__anon1.name, "property"))
17742 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, (((void *)0)), (((void *)0)), (((void *)0)));
17743 }
17744 if((!prop || useMemberForNonConst) && !member)
17745 {
17746 method = useMemberForNonConst ? (((void *)0)) : __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, (((void *)0)));
17747 if(!method)
17748 {
17749 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
17750 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);
17751 if(useMemberForNonConst || !id->_class || !id->_class->__anon1.__anon1.name || strcmp(id->_class->__anon1.__anon1.name, "property"))
17752 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
17753 }
17754 }
17755 if(member && prop)
17756 {
17757 if(useMemberForNonConst || (member->_class != prop->_class && !id->_class && __ecereNameSpace__ecere__com__eClass_IsDerived(member->_class, prop->_class)))
17758 prop = (((void *)0));
17759 else
17760 member = (((void *)0));
17761 }
17762 }
17763 }
17764 if(!prop && !member && !method)
17765 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule);
17766 if(!prop && !member && !method)
17767 {
17768 if(typeKind == 19)
17769 {
17770 classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(type->__anon1._class->__anon1.registered, exp->__anon1.member.member->string);
17771 if(classProp)
17772 {
17773 exp->__anon1.member.memberType = 5;
17774 exp->expType = ProcessTypeString(classProp->dataTypeString, 0);
17775 }
17776 else
17777 {
17778 char structName[1024];
17779 struct Identifier * id = exp->__anon1.member.member;
17780 struct Expression * classExp = exp->__anon1.member.exp;
17781
17782 type->refCount++;
17783 FreeType(classExp->expType);
17784 classExp->expType = ProcessTypeString("ecere::com::Class", 0);
17785 strcpy(structName, "__ecereClassData_");
17786 FullClassNameCat(structName, type->__anon1._class->string, 0);
17787 exp->type = 9;
17788 exp->__anon1.member.member = id;
17789 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"))))))));
17790 FreeType(type);
17791 ProcessExpressionType(exp);
17792 return ;
17793 }
17794 }
17795 else
17796 {
17797 struct Symbol * classSym = FindClass(id->string);
17798
17799 if(classSym)
17800 {
17801 struct __ecereNameSpace__ecere__com__Class * convertClass = classSym->__anon1.registered;
17802
17803 if(convertClass)
17804 revConvert = __ecereNameSpace__ecere__com__eClass_FindProperty(convertClass, _class->fullName, privateModule);
17805 }
17806 }
17807 }
17808 if(exp->__anon1.member.exp->destType)
17809 FreeType(exp->__anon1.member.exp->destType);
17810 {
17811 if(method && !method->_class->symbol)
17812 method->_class->symbol = FindClass(method->_class->fullName);
17813 if(prop && !prop->_class->symbol)
17814 prop->_class->symbol = FindClass(prop->_class->fullName);
17815 exp->__anon1.member.exp->destType = __extension__ ({
17816 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
17817
17818 __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;
17819 });
17820 }
17821 if(prop)
17822 {
17823 exp->__anon1.member.memberType = 1;
17824 if(!prop->dataType)
17825 ProcessPropertyType(prop);
17826 exp->expType = prop->dataType;
17827 if(!strcmp(_class->base->fullName, "eda::Row") && !exp->expType->constant && !exp->destType)
17828 {
17829 struct Type * type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
17830
17831 CopyTypeInto(type, exp->expType);
17832 type->refCount = 1;
17833 type->constant = 1;
17834 exp->expType = type;
17835 }
17836 else if(prop->dataType)
17837 prop->dataType->refCount++;
17838 }
17839 else if(member)
17840 {
17841 if(exp->__anon1.member.exp->expType->classObjectType == 2 && !strcmp(exp->__anon1.member.member->string, "_class"))
17842 {
17843 FreeExpContents(exp);
17844 exp->type = 0;
17845 exp->__anon1.__anon1.identifier = MkIdentifier("class");
17846 ProcessExpressionType(exp);
17847 return ;
17848 }
17849 exp->__anon1.member.memberType = 3;
17850 DeclareStruct(curExternal, _class->fullName, 0, 1);
17851 if(member->_class != _class)
17852 DeclareStruct(curExternal, member->_class->fullName, 0, 1);
17853 if(!member->dataType)
17854 {
17855 struct Context * context = SetupTemplatesContext(_class);
17856
17857 member->dataType = ProcessTypeString(member->dataTypeString, 0);
17858 FinishTemplatesContext(context);
17859 }
17860 exp->expType = member->dataType;
17861 if(member->dataType)
17862 member->dataType->refCount++;
17863 }
17864 else if(revConvert)
17865 {
17866 exp->__anon1.member.memberType = 4;
17867 exp->expType = MkClassType(revConvert->_class->fullName);
17868 }
17869 else if(method)
17870 {
17871 {
17872 exp->__anon1.member.memberType = 2;
17873 }
17874 if(!method->dataType)
17875 ProcessMethodType(method);
17876 exp->expType = __extension__ ({
17877 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
17878
17879 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 16, __ecereInstance1->__anon1.__anon3.method = method, __ecereInstance1;
17880 });
17881 exp->expType->__anon1.__anon3.methodClass = (id && id->_class) ? _class : (((void *)0));
17882 exp->expType->__anon1.__anon3.usedClass = _class;
17883 }
17884 else if(!classProp)
17885 {
17886 if(exp->__anon1.member.exp->expType->classObjectType == 2 && !strcmp(exp->__anon1.member.member->string, "_class"))
17887 {
17888 FreeExpContents(exp);
17889 exp->type = 0;
17890 exp->__anon1.__anon1.identifier = MkIdentifier("class");
17891 FreeType(exp->expType);
17892 exp->expType = MkClassType("ecere::com::Class");
17893 return ;
17894 }
17895 yylloc = exp->__anon1.member.member->loc;
17896 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't find member %s in class %s\n", (((void *)0))), id->string, _class->fullName);
17897 if(inCompiler)
17898 __ecereNameSpace__ecere__com__eClass_AddDataMember(_class, id->string, "int", 0, 0, 1);
17899 }
17900 if(_class && exp->expType)
17901 {
17902 struct __ecereNameSpace__ecere__com__Class * tClass;
17903
17904 tClass = type->__anon1._class && type->__anon1._class->__anon1.registered ? type->__anon1._class->__anon1.registered : _class;
17905 while(tClass && !tClass->templateClass)
17906 tClass = tClass->base;
17907 if(tClass && exp->expType->kind == 20 && exp->expType->__anon1.templateParameter->type == 0)
17908 {
17909 int id = 0;
17910 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
17911 struct __ecereNameSpace__ecere__com__Class * sClass;
17912
17913 for(sClass = tClass; sClass; sClass = sClass->base)
17914 {
17915 id = 0;
17916 if(sClass->templateClass)
17917 sClass = sClass->templateClass;
17918 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
17919 {
17920 if(curParam->type == 0 && !strcmp(exp->expType->__anon1.templateParameter->identifier->string, curParam->name))
17921 {
17922 for(sClass = sClass->base; sClass; sClass = sClass->base)
17923 id += sClass->templateParams.count;
17924 break;
17925 }
17926 id++;
17927 }
17928 if(curParam)
17929 break;
17930 }
17931 if(curParam && tClass->templateArgs[id].__anon1.__anon1.dataTypeString)
17932 {
17933 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = tClass->templateArgs[id];
17934 struct Context * context = SetupTemplatesContext(tClass);
17935 unsigned int constant = exp->expType->constant;
17936 unsigned int passAsTemplate = 0;
17937 struct __ecereNameSpace__ecere__com__Class * thisClassFrom = (((void *)0));
17938 struct Type * t = ProcessTypeString(exp->expType->__anon1.templateParameter->dataTypeString, 0);
17939
17940 if(t && t->kind == 8 && t->__anon1._class)
17941 thisClassFrom = t->__anon1._class->__anon1.registered;
17942 else
17943 thisClassFrom = __ecereNameSpace__ecere__com__eSystem_FindClass(GetPrivateModule(), "class");
17944 FreeType(t);
17945 passAsTemplate = tClass->templateClass && (exp->expType->kind != 20 || (!exp->expType->__anon1.templateParameter || (!exp->expType->__anon1.templateParameter->dataTypeString && !exp->expType->__anon1.templateParameter->__anon1.dataType)));
17946 FreeType(exp->expType);
17947 exp->expType = ProcessTypeString(arg.__anon1.__anon1.dataTypeString, 0);
17948 exp->expType->thisClassFrom = thisClassFrom;
17949 if(exp->expType->kind == 8 && constant)
17950 exp->expType->constant = 1;
17951 else if(exp->expType->kind == 13)
17952 {
17953 struct Type * t = exp->expType->__anon1.type;
17954
17955 while(t->kind == 13)
17956 t = t->__anon1.type;
17957 if(constant)
17958 t->constant = constant;
17959 }
17960 if(exp->expType)
17961 {
17962 if(exp->expType->kind == 21)
17963 {
17964 FreeType(exp->expType);
17965 exp->expType = ReplaceThisClassType(_class);
17966 }
17967 if(passAsTemplate)
17968 exp->expType->passAsTemplate = 1;
17969 if(!exp->destType)
17970 {
17971 exp->destType = ProcessTypeString(arg.__anon1.__anon1.dataTypeString, 0);
17972 if(exp->destType->kind == 8 && constant)
17973 exp->destType->constant = 1;
17974 else if(exp->destType->kind == 13)
17975 {
17976 struct Type * t = exp->destType->__anon1.type;
17977
17978 while(t->kind == 13)
17979 t = t->__anon1.type;
17980 if(constant)
17981 t->constant = constant;
17982 }
17983 if(exp->destType->kind == 21)
17984 {
17985 FreeType(exp->destType);
17986 exp->destType = ReplaceThisClassType(_class);
17987 }
17988 }
17989 }
17990 FinishTemplatesContext(context);
17991 }
17992 }
17993 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)
17994 {
17995 int id = 0;
17996 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
17997 struct __ecereNameSpace__ecere__com__Class * sClass;
17998
17999 for(sClass = tClass; sClass; sClass = sClass->base)
18000 {
18001 id = 0;
18002 if(sClass->templateClass)
18003 sClass = sClass->templateClass;
18004 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
18005 {
18006 if(curParam->type == 0 && !strcmp(exp->expType->__anon1.type->__anon1.templateParameter->identifier->string, curParam->name))
18007 {
18008 for(sClass = sClass->base; sClass; sClass = sClass->base)
18009 id += sClass->templateParams.count;
18010 break;
18011 }
18012 id++;
18013 }
18014 if(curParam)
18015 break;
18016 }
18017 if(curParam)
18018 {
18019 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = tClass->templateArgs[id];
18020 struct Context * context = SetupTemplatesContext(tClass);
18021 struct Type * basicType;
18022
18023 basicType = ProcessTypeString(arg.__anon1.__anon1.dataTypeString, 0);
18024 if(basicType)
18025 {
18026 if(basicType->kind == 21)
18027 {
18028 FreeType(basicType);
18029 basicType = ReplaceThisClassType(_class);
18030 }
18031 FreeType(exp->expType);
18032 exp->expType = __extension__ ({
18033 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
18034
18035 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 13, __ecereInstance1->__anon1.type = basicType, __ecereInstance1;
18036 });
18037 if(!exp->destType)
18038 {
18039 exp->destType = exp->expType;
18040 exp->destType->refCount++;
18041 }
18042 {
18043 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
18044 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
18045 struct Declarator * decl;
18046
18047 decl = SpecDeclFromString(arg.__anon1.__anon1.dataTypeString, specs, (((void *)0)));
18048 *newExp = *exp;
18049 if(exp->destType)
18050 exp->destType->refCount++;
18051 if(exp->expType)
18052 exp->expType->refCount++;
18053 exp->type = 11;
18054 exp->__anon1.cast.typeName = MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl));
18055 exp->__anon1.cast.exp = newExp;
18056 }
18057 }
18058 FinishTemplatesContext(context);
18059 }
18060 }
18061 else if(tClass && exp->expType->kind == 8 && exp->expType->__anon1._class && strchr(exp->expType->__anon1._class->string, '<'))
18062 {
18063 struct __ecereNameSpace__ecere__com__Class * expClass = exp->expType->__anon1._class->__anon1.registered;
18064
18065 if(expClass)
18066 {
18067 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
18068 int p = 0;
18069 int paramCount = 0;
18070 int lastParam = -1;
18071 char templateString[1024];
18072 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
18073
18074 sprintf(templateString, "%s<", expClass->templateClass->fullName);
18075 while(cClass != expClass)
18076 {
18077 struct __ecereNameSpace__ecere__com__Class * sClass;
18078
18079 for(sClass = expClass; sClass && sClass->base != cClass; sClass = sClass->base)
18080 ;
18081 cClass = sClass;
18082 for(param = cClass->templateParams.first; param; param = param->next)
18083 {
18084 struct __ecereNameSpace__ecere__com__Class * cClassCur = (((void *)0));
18085 int cp = 0;
18086 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * paramCur = (((void *)0));
18087 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
18088
18089 while(cClassCur != tClass && !paramCur)
18090 {
18091 struct __ecereNameSpace__ecere__com__Class * sClassCur;
18092
18093 for(sClassCur = tClass; sClassCur && sClassCur->base != cClassCur; sClassCur = sClassCur->base)
18094 ;
18095 cClassCur = sClassCur;
18096 for(paramCur = cClassCur->templateParams.first; paramCur; paramCur = paramCur->next)
18097 {
18098 if(!strcmp(paramCur->name, param->name))
18099 {
18100 break;
18101 }
18102 cp++;
18103 }
18104 }
18105 if(paramCur && paramCur->type == 0)
18106 arg = tClass->templateArgs[cp];
18107 else
18108 arg = expClass->templateArgs[p];
18109 {
18110 char argument[256];
18111
18112 argument[0] = '\0';
18113 switch(param->type)
18114 {
18115 case 2:
18116 {
18117 char expString[1024];
18118 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
18119 struct Declarator * decl = SpecDeclFromString(param->__anon1.dataTypeString, specs, (((void *)0)));
18120 struct Expression * exp;
18121 char * string = PrintHexUInt64(arg.__anon1.expression.__anon1.ui64);
18122
18123 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
18124 (__ecereNameSpace__ecere__com__eSystem_Delete(string), string = 0);
18125 ProcessExpressionType(exp);
18126 ComputeExpression(exp);
18127 expString[0] = '\0';
18128 PrintExpression(exp, expString);
18129 strcat(argument, expString);
18130 FreeExpression(exp);
18131 break;
18132 }
18133 case 1:
18134 {
18135 strcat(argument, arg.__anon1.__anon2.__anon1.member->name);
18136 break;
18137 }
18138 case 0:
18139 {
18140 if(arg.__anon1.__anon1.dataTypeString && (!param->defaultArg.__anon1.__anon1.dataTypeString || strcmp(arg.__anon1.__anon1.dataTypeString, param->defaultArg.__anon1.__anon1.dataTypeString)))
18141 strcat(argument, arg.__anon1.__anon1.dataTypeString);
18142 break;
18143 }
18144 }
18145 if(argument[0])
18146 {
18147 if(paramCount)
18148 strcat(templateString, ", ");
18149 if(lastParam != p - 1)
18150 {
18151 strcat(templateString, param->name);
18152 strcat(templateString, " = ");
18153 }
18154 strcat(templateString, argument);
18155 paramCount++;
18156 lastParam = p;
18157 }
18158 }
18159 p++;
18160 }
18161 }
18162 {
18163 int len = strlen(templateString);
18164
18165 if(templateString[len - 1] == '>')
18166 templateString[len++] = ' ';
18167 templateString[len++] = '>';
18168 templateString[len++] = '\0';
18169 }
18170 FreeType(exp->expType);
18171 {
18172 struct Context * context = SetupTemplatesContext(tClass);
18173
18174 exp->expType = ProcessTypeString(templateString, 0);
18175 FinishTemplatesContext(context);
18176 }
18177 }
18178 }
18179 }
18180 }
18181 else
18182 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)");
18183 }
18184 else if(type && (type->kind == 9 || type->kind == 10))
18185 {
18186 struct Type * memberType = exp->__anon1.member.member ? FindMember(type, exp->__anon1.member.member->string) : (((void *)0));
18187
18188 if(memberType)
18189 {
18190 exp->expType = memberType;
18191 if(memberType)
18192 memberType->refCount++;
18193 }
18194 }
18195 else
18196 {
18197 char expString[10240];
18198
18199 expString[0] = '\0';
18200 if(inCompiler)
18201 {
18202 PrintExpression(exp, expString);
18203 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
18204 }
18205 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "member operator on non-structure type expression %s\n", (((void *)0))), expString);
18206 }
18207 if(exp->expType && exp->expType->kind == 21 && (!exp->destType || exp->destType->kind != 21))
18208 {
18209 if(type && (type->kind == 8 || type->kind == 19 || type->kind == 3 || type->kind == 15))
18210 {
18211 struct Identifier * id = exp->__anon1.member.member;
18212 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));
18213
18214 if(_class)
18215 {
18216 FreeType(exp->expType);
18217 exp->expType = ReplaceThisClassType(_class);
18218 }
18219 }
18220 }
18221 yylloc = oldyylloc;
18222 break;
18223 }
18224 case 9:
18225 {
18226 struct Type * destType = exp->destType;
18227
18228 if(exp->__anon1.member.member && exp->__anon1.member.member->_class && exp->__anon1.member.member->_class->__anon1.__anon1.name)
18229 {
18230 exp->__anon1.member.member->classSym = exp->__anon1.member.member->_class->__anon1.__anon1.symbol;
18231 }
18232 exp->__anon1.member.exp = MkExpBrackets(MkListOne(MkExpOp((((void *)0)), '*', exp->__anon1.member.exp)));
18233 exp->type = 8;
18234 if(destType)
18235 destType->count++;
18236 ProcessExpressionType(exp);
18237 if(destType)
18238 destType->count--;
18239 break;
18240 }
18241 case 15:
18242 {
18243 struct Symbol * classSym = exp->__anon1._class->__anon1.__anon1.symbol;
18244
18245 if(classSym && classSym->__anon1.registered)
18246 {
18247 if(classSym->__anon1.registered->type == 5 || (classSym->__anon1.registered->fixed && classSym->__anon1.registered->structSize))
18248 {
18249 char name[1024];
18250 struct __ecereNameSpace__ecere__com__Class * b = classSym->__anon1.registered;
18251
18252 name[0] = '\0';
18253 DeclareStruct(curExternal, classSym->string, 0, 1);
18254 FreeSpecifier(exp->__anon1._class);
18255 FullClassNameCat(name, classSym->string, 0);
18256 if(b->offset == 0)
18257 {
18258 exp->type = 10;
18259 exp->__anon1.typeName = MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(name), (((void *)0)))), (((void *)0)));
18260 }
18261 else
18262 {
18263 struct Expression * e;
18264
18265 exp->type = 4;
18266 if(b->structSize == b->offset)
18267 exp->__anon1.op.exp1 = MkExpConstant("0");
18268 else
18269 exp->__anon1.op.exp1 = MkExpTypeSize(MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(name), (((void *)0)))), (((void *)0))));
18270 exp->__anon1.op.op = '+';
18271 e = exp;
18272 while(b->offset != 0)
18273 {
18274 struct Symbol * sym;
18275 struct Expression * typeSize;
18276
18277 b = b->base;
18278 sym = FindClass(b->fullName);
18279 name[0] = '\0';
18280 DeclareStruct(curExternal, sym->string, 0, 1);
18281 FullClassNameCat(name, sym->string, 0);
18282 if(b->structSize == b->offset)
18283 typeSize = MkExpConstant("0");
18284 else
18285 typeSize = MkExpTypeSize(MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(name), (((void *)0)))), (((void *)0))));
18286 e->__anon1.op.exp2 = b->offset ? MkExpOp(typeSize, '+', (((void *)0))) : typeSize;
18287 e = e->__anon1.op.exp2;
18288 }
18289 }
18290 }
18291 else
18292 {
18293 if(classSym->__anon1.registered->fixed && !classSym->__anon1.registered->structSize)
18294 {
18295 FreeSpecifier(exp->__anon1._class);
18296 exp->__anon1.__anon1.constant = PrintUInt(classSym->__anon1.registered->templateClass ? classSym->__anon1.registered->templateClass->structSize : classSym->__anon1.registered->structSize);
18297 exp->type = 2;
18298 }
18299 else
18300 {
18301 char className[1024];
18302
18303 strcpy(className, "__ecereClass_");
18304 FullClassNameCat(className, classSym->string, 1);
18305 DeclareClass(curExternal, classSym, className);
18306 FreeExpContents(exp);
18307 exp->type = 9;
18308 exp->__anon1.member.exp = MkExpIdentifier(MkIdentifier(className));
18309 exp->__anon1.member.member = MkIdentifier("structSize");
18310 }
18311 }
18312 }
18313 exp->expType = __extension__ ({
18314 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
18315
18316 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 23, __ecereInstance1;
18317 });
18318 break;
18319 }
18320 case 10:
18321 {
18322 struct Type * type = ProcessType(exp->__anon1.typeName->qualifiers, exp->__anon1.typeName->declarator);
18323
18324 exp->expType = __extension__ ({
18325 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
18326
18327 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 23, __ecereInstance1;
18328 });
18329 exp->isConstant = 1;
18330 DeclareType(curExternal, type, 1, 0);
18331 FreeType(type);
18332 break;
18333 }
18334 case 11:
18335 {
18336 struct Type * type = ProcessType(exp->__anon1.cast.typeName->qualifiers, exp->__anon1.cast.typeName->declarator);
18337
18338 type->count = 1;
18339 FreeType(exp->__anon1.cast.exp->destType);
18340 exp->__anon1.cast.exp->destType = type;
18341 type->refCount++;
18342 type->casted = 1;
18343 ProcessExpressionType(exp->__anon1.cast.exp);
18344 type->casted = 0;
18345 type->count = 0;
18346 exp->expType = type;
18347 if(!exp->__anon1.cast.exp->needCast && !NeedCast(exp->__anon1.cast.exp->expType, type))
18348 {
18349 void * prev = exp->prev, * next = exp->next;
18350 struct Type * expType = exp->__anon1.cast.exp->destType;
18351 struct Expression * castExp = exp->__anon1.cast.exp;
18352 struct Type * destType = exp->destType;
18353
18354 if(expType)
18355 expType->refCount++;
18356 FreeType(exp->expType);
18357 FreeTypeName(exp->__anon1.cast.typeName);
18358 *exp = *castExp;
18359 FreeType(exp->expType);
18360 FreeType(exp->destType);
18361 exp->expType = expType;
18362 exp->destType = destType;
18363 ((castExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)castExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(castExp)) : 0), castExp = 0);
18364 exp->prev = prev;
18365 exp->next = next;
18366 }
18367 else
18368 {
18369 exp->isConstant = exp->__anon1.cast.exp->isConstant;
18370 }
18371 break;
18372 }
18373 case 33:
18374 {
18375 struct Type * type = ProcessType(exp->__anon1.initializer.typeName->qualifiers, exp->__anon1.initializer.typeName->declarator);
18376
18377 exp->expType = type;
18378 break;
18379 }
18380 case 34:
18381 {
18382 struct Type * type = ProcessType(exp->__anon1.vaArg.typeName->qualifiers, exp->__anon1.vaArg.typeName->declarator);
18383
18384 ProcessExpressionType(exp->__anon1.vaArg.exp);
18385 exp->expType = type;
18386 break;
18387 }
18388 case 12:
18389 {
18390 struct Expression * e;
18391 struct Type * t = exp->destType;
18392
18393 if(t && !exp->destType->casted)
18394 {
18395 t = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
18396 CopyTypeInto(t, exp->destType);
18397 t->count = 0;
18398 }
18399 else if(t)
18400 t->refCount++;
18401 exp->isConstant = 1;
18402 FreeType(exp->__anon1.cond.cond->destType);
18403 exp->__anon1.cond.cond->destType = MkClassType("bool");
18404 exp->__anon1.cond.cond->destType->truth = 1;
18405 ProcessExpressionType(exp->__anon1.cond.cond);
18406 if(!exp->__anon1.cond.cond->isConstant)
18407 exp->isConstant = 0;
18408 for(e = (*exp->__anon1.cond.exp).first; e; e = e->next)
18409 {
18410 if(!e->next)
18411 {
18412 FreeType(e->destType);
18413 e->destType = t;
18414 if(e->destType)
18415 e->destType->refCount++;
18416 }
18417 ProcessExpressionType(e);
18418 if(!e->next)
18419 {
18420 exp->expType = e->expType;
18421 if(e->expType)
18422 e->expType->refCount++;
18423 }
18424 if(!e->isConstant)
18425 exp->isConstant = 0;
18426 }
18427 FreeType(exp->__anon1.cond.elseExp->destType);
18428 exp->__anon1.cond.elseExp->destType = t ? t : exp->expType;
18429 if(exp->__anon1.cond.elseExp->destType)
18430 exp->__anon1.cond.elseExp->destType->refCount++;
18431 ProcessExpressionType(exp->__anon1.cond.elseExp);
18432 if(!exp->__anon1.cond.elseExp->isConstant)
18433 exp->isConstant = 0;
18434 FreeType(t);
18435 break;
18436 }
18437 case 23:
18438 {
18439 if(exp->__anon1.compound && exp->__anon1.compound->__anon1.compound.statements && (*exp->__anon1.compound->__anon1.compound.statements).last)
18440 {
18441 struct Statement * last = (*exp->__anon1.compound->__anon1.compound.statements).last;
18442
18443 if(last->type == 3 && last->__anon1.expressions && (*last->__anon1.expressions).last)
18444 {
18445 ((struct Expression *)(*last->__anon1.expressions).last)->destType = exp->destType;
18446 if(exp->destType)
18447 exp->destType->refCount++;
18448 }
18449 ProcessStatement(exp->__anon1.compound);
18450 exp->expType = (last->__anon1.expressions && (*last->__anon1.expressions).last) ? ((struct Expression *)(*last->__anon1.expressions).last)->expType : (((void *)0));
18451 if(exp->expType)
18452 exp->expType->refCount++;
18453 }
18454 break;
18455 }
18456 case 24:
18457 {
18458 struct Specifier * spec = (*exp->__anon1._classExp.specifiers).first;
18459
18460 if(spec && spec->type == 1)
18461 {
18462 exp->expType = MkClassType(spec->__anon1.__anon1.name);
18463 exp->expType->kind = 19;
18464 exp->byReference = 1;
18465 }
18466 else
18467 {
18468 exp->expType = MkClassType("ecere::com::Class");
18469 exp->byReference = 1;
18470 }
18471 break;
18472 }
18473 case 25:
18474 {
18475 struct __ecereNameSpace__ecere__com__Class * _class = thisClass ? thisClass : currentClass;
18476
18477 if(_class)
18478 {
18479 struct Identifier * id = exp->__anon1.classData.id;
18480 char structName[1024];
18481 struct Expression * classExp;
18482
18483 strcpy(structName, "__ecereClassData_");
18484 FullClassNameCat(structName, _class->fullName, 0);
18485 exp->type = 9;
18486 exp->__anon1.member.member = id;
18487 if(curCompound && FindSymbol("this", curContext, curCompound->__anon1.compound.context, 0, 0))
18488 classExp = MkExpMember(MkExpIdentifier(MkIdentifier("this")), MkIdentifier("_class"));
18489 else
18490 classExp = MkExpIdentifier(MkIdentifier("class"));
18491 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"))))))));
18492 ProcessExpressionType(exp);
18493 return ;
18494 }
18495 break;
18496 }
18497 case 35:
18498 {
18499 struct Type * type = (((void *)0));
18500 const char * typeString = (((void *)0));
18501 char typeStringBuf[1024];
18502
18503 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))
18504 {
18505 struct __ecereNameSpace__ecere__com__Class * templateClass = exp->destType->__anon1._class->__anon1.registered;
18506
18507 typeString = templateClass->templateArgs[2].__anon1.__anon1.dataTypeString;
18508 }
18509 else if(exp->__anon1.list)
18510 {
18511 struct Expression * e;
18512
18513 for(e = (*exp->__anon1.list).first; e; e = e->next)
18514 {
18515 ProcessExpressionType(e);
18516 if(e->expType)
18517 {
18518 if(!type)
18519 {
18520 type = e->expType;
18521 type->refCount++;
18522 }
18523 else
18524 {
18525 if(!MatchTypeExpression(e, type, (((void *)0)), 0, 1))
18526 {
18527 FreeType(type);
18528 type = e->expType;
18529 e->expType = (((void *)0));
18530 e = (*exp->__anon1.list).first;
18531 ProcessExpressionType(e);
18532 if(e->expType)
18533 {
18534 if(!MatchTypeExpression(e, type, (((void *)0)), 0, 1))
18535 {
18536 FreeType(e->expType);
18537 e->expType = (((void *)0));
18538 FreeType(type);
18539 type = (((void *)0));
18540 break;
18541 }
18542 }
18543 }
18544 }
18545 if(e->expType)
18546 {
18547 FreeType(e->expType);
18548 e->expType = (((void *)0));
18549 }
18550 }
18551 }
18552 if(type)
18553 {
18554 typeStringBuf[0] = '\0';
18555 PrintTypeNoConst(type, typeStringBuf, 0, 1);
18556 typeString = typeStringBuf;
18557 FreeType(type);
18558 type = (((void *)0));
18559 }
18560 }
18561 if(typeString)
18562 {
18563 char templateString[1024];
18564 struct __ecereNameSpace__ecere__sys__OldList * initializers = MkList();
18565 struct __ecereNameSpace__ecere__sys__OldList * structInitializers = MkList();
18566 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
18567 struct Expression * expExt;
18568 struct Declarator * decl = SpecDeclFromString(typeString, specs, (((void *)0)));
18569
18570 sprintf(templateString, "Container<%s>", typeString);
18571 if(exp->__anon1.list)
18572 {
18573 struct Expression * e;
18574
18575 type = ProcessTypeString(typeString, 0);
18576 while((e = (*exp->__anon1.list).first))
18577 {
18578 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*exp->__anon1.list), e);
18579 e->destType = type;
18580 type->refCount++;
18581 ProcessExpressionType(e);
18582 ListAdd(initializers, MkInitializerAssignment(e));
18583 }
18584 FreeType(type);
18585 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->__anon1.list), exp->__anon1.list = 0);
18586 }
18587 DeclareStruct(curExternal, "ecere::com::BuiltInContainer", 0, 1);
18588 ListAdd(structInitializers, MkInitializerAssignment(MkExpMember(MkExpClass(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0))), MkIdentifier("_vTbl"))));
18589 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->__anon1.exp);
18590 ListAdd(structInitializers, MkInitializerAssignment(MkExpClass(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0)))));
18591 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->__anon1.exp);
18592 ListAdd(structInitializers, MkInitializerAssignment(MkExpConstant("0")));
18593 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->__anon1.exp);
18594 ListAdd(structInitializers, MkInitializerAssignment(MkExpExtensionInitializer(MkTypeName(specs, MkDeclaratorArray(decl, (((void *)0)))), MkInitializerList(initializers))));
18595 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->__anon1.exp);
18596 ListAdd(structInitializers, MkInitializerAssignment(__extension__ ({
18597 struct Expression * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
18598
18599 __ecereInstance1->type = 2, __ecereInstance1->__anon1.__anon1.constant = __ecereNameSpace__ecere__com__PrintString(__ecereClass_int, (void *)&(*initializers).count, (void *)0), __ecereInstance1;
18600 })));
18601 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->__anon1.exp);
18602 ListAdd(structInitializers, MkInitializerAssignment(MkExpClass(CopyList(specs, (void *)(CopySpecifier)), CopyDeclarator(decl))));
18603 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->__anon1.exp);
18604 exp->expType = ProcessTypeString(templateString, 0);
18605 exp->type = 5;
18606 exp->__anon1.list = MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName(templateString)), (((void *)0))), MkExpOp((((void *)0)), '&', expExt = MkExpExtensionInitializer(MkTypeName(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0))), MkInitializerList(structInitializers)))));
18607 ProcessExpressionType(expExt);
18608 }
18609 else
18610 {
18611 exp->expType = ProcessTypeString("Container", 0);
18612 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Couldn't determine type of array elements\n", (((void *)0))));
18613 }
18614 break;
18615 }
18616 }
18617 if(exp->expType && exp->expType->kind == 21 && thisClass && (!exp->destType || exp->destType->kind != 21))
18618 {
18619 FreeType(exp->expType);
18620 exp->expType = ReplaceThisClassType(thisClass);
18621 }
18622 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)
18623 {
18624 struct Symbol * symbol = FindSymbol(exp->expType->__anon1.__anon1.enumName, curContext, globalContext, 1, 0);
18625
18626 if(symbol)
18627 {
18628 if(exp->expType->kind != 15)
18629 {
18630 struct Type * member;
18631 char * enumName = __ecereNameSpace__ecere__sys__CopyString(exp->expType->__anon1.__anon1.enumName);
18632
18633 FreeType(exp->expType);
18634 exp->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
18635 exp->expType->kind = symbol->type->kind;
18636 exp->expType->refCount++;
18637 exp->expType->__anon1.__anon1.enumName = enumName;
18638 exp->expType->__anon1.__anon1.members = symbol->type->__anon1.__anon1.members;
18639 for(member = symbol->type->__anon1.__anon1.members.first; member; member = member->next)
18640 member->refCount++;
18641 }
18642 else
18643 {
18644 struct __ecereNameSpace__ecere__sys__NamedLink64 * member;
18645
18646 for(member = symbol->type->__anon1.__anon1.members.first; member; member = member->next)
18647 {
18648 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);
18649
18650 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&exp->expType->__anon1.__anon1.members, value);
18651 }
18652 }
18653 }
18654 }
18655 yylloc = exp->loc;
18656 if(exp->destType && (exp->destType->kind == 18))
18657 ;
18658 else if(exp->destType && !exp->destType->keepCast)
18659 {
18660 if(!exp->needTemplateCast && exp->expType && (exp->expType->kind == 20 || exp->expType->passAsTemplate))
18661 exp->needTemplateCast = 1;
18662 if(exp->destType->kind == 0)
18663 ;
18664 else if(!CheckExpressionType(exp, exp->destType, 0, !exp->destType->casted))
18665 {
18666 unsigned int invalidCast = 0;
18667
18668 if(inCompiler && exp->destType->count && exp->expType)
18669 {
18670 struct __ecereNameSpace__ecere__com__Class * c1 = (exp->expType->kind == 8 && exp->expType->__anon1._class) ? exp->expType->__anon1._class->__anon1.registered : (((void *)0));
18671 struct __ecereNameSpace__ecere__com__Class * c2 = (exp->destType->kind == 8 && exp->destType->__anon1._class) ? exp->destType->__anon1._class->__anon1.registered : (((void *)0));
18672
18673 if(c1 && c1->type != 1)
18674 c1 = (((void *)0));
18675 if(c2 && c2->type != 1)
18676 c2 = (((void *)0));
18677 if((c1 && !exp->expType->byReference && !c2 && !__ecereProp_Type_Get_isPointerType(exp->destType)) || (c2 && !exp->destType->byReference && !c1 && !__ecereProp_Type_Get_isPointerType(exp->expType)))
18678 invalidCast = 1;
18679 }
18680 if(!exp->destType->count || unresolved || invalidCast)
18681 {
18682 if(!exp->expType)
18683 {
18684 yylloc = exp->loc;
18685 if(exp->destType->kind != 14)
18686 {
18687 char type2[1024];
18688
18689 type2[0] = '\0';
18690 if(inCompiler)
18691 {
18692 char expString[10240];
18693
18694 expString[0] = '\0';
18695 PrintType(exp->destType, type2, 0, 1);
18696 if(inCompiler)
18697 {
18698 PrintExpression(exp, expString);
18699 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
18700 }
18701 if(unresolved)
18702 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved identifier %s; expected %s\n", (((void *)0))), expString, type2);
18703 else if(exp->type != 16)
18704 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s; expected %s\n", (((void *)0))), expString, type2);
18705 }
18706 }
18707 else
18708 {
18709 char expString[10240];
18710
18711 expString[0] = '\0';
18712 if(inCompiler)
18713 {
18714 PrintExpression(exp, expString);
18715 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
18716 }
18717 if(unresolved)
18718 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved identifier %s\n", (((void *)0))), expString);
18719 else if(exp->type != 16)
18720 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s\n", (((void *)0))), expString);
18721 }
18722 }
18723 else
18724 {
18725 char type1[1024];
18726 char type2[1024];
18727
18728 type1[0] = '\0';
18729 type2[0] = '\0';
18730 if(inCompiler)
18731 {
18732 PrintType(exp->expType, type1, 0, 1);
18733 PrintType(exp->destType, type2, 0, 1);
18734 }
18735 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)))
18736 ;
18737 else
18738 {
18739 char expString[10240];
18740
18741 expString[0] = '\0';
18742 if(inCompiler)
18743 {
18744 PrintExpression(exp, expString);
18745 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
18746 }
18747 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")))
18748 {
18749 if(invalidCast)
18750 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expression %s (%s); expected %s\n", (((void *)0))), expString, type1, type2);
18751 else
18752 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expression %s (%s); expected %s\n", (((void *)0))), expString, type1, type2);
18753 }
18754 if(!inCompiler)
18755 {
18756 FreeType(exp->expType);
18757 exp->destType->refCount++;
18758 exp->expType = exp->destType;
18759 }
18760 }
18761 }
18762 }
18763 }
18764 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))
18765 {
18766 struct Expression * nbExp = GetNonBracketsExp(exp);
18767
18768 if(nbExp->type != 11 || !IsVoidPtrCast(nbExp->__anon1.cast.typeName))
18769 {
18770 struct Expression * e = MoveExpContents(exp);
18771
18772 exp->__anon1.cast.exp = MkExpBrackets(MkListOne(e));
18773 exp->type = 11;
18774 exp->__anon1.cast.exp->destType = exp->destType;
18775 if(exp->destType)
18776 exp->destType->refCount++;
18777 exp->__anon1.cast.typeName = MkTypeName(MkListOne(MkSpecifier(VOID)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0))));
18778 }
18779 }
18780 }
18781 else if(unresolved)
18782 {
18783 if(exp->__anon1.__anon1.identifier->_class && exp->__anon1.__anon1.identifier->_class->__anon1.__anon1.name)
18784 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);
18785 else if(exp->__anon1.__anon1.identifier->string && exp->__anon1.__anon1.identifier->string[0])
18786 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved identifier %s\n", (((void *)0))), exp->__anon1.__anon1.identifier->string);
18787 }
18788 else if(!exp->expType && exp->type != 16)
18789 {
18790 char expString[10240];
18791
18792 expString[0] = '\0';
18793 if(inCompiler)
18794 {
18795 PrintExpression(exp, expString);
18796 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
18797 }
18798 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s\n", (((void *)0))), expString);
18799 }
18800 if(inCompiler)
18801 ApplyAnyObjectLogic(exp);
18802 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)))
18803 {
18804 exp->byReference = 1;
18805 }
18806 yylloc = oldyylloc;
18807 }
18808
18809 static void ProcessFunction(struct FunctionDefinition * function)
18810 {
18811 struct Identifier * id = GetDeclId(function->declarator);
18812 struct Symbol * symbol = function->declarator ? function->declarator->symbol : (((void *)0));
18813 struct Type * type = symbol ? symbol->type : (((void *)0));
18814 struct __ecereNameSpace__ecere__com__Class * oldThisClass = thisClass;
18815 struct Context * oldTopContext = topContext;
18816
18817 yylloc = function->loc;
18818 if(type && type->__anon1.__anon2.thisClass)
18819 {
18820 struct Symbol * classSym = type->__anon1.__anon2.thisClass;
18821 struct __ecereNameSpace__ecere__com__Class * _class = type->__anon1.__anon2.thisClass->__anon1.registered;
18822 char className[1024];
18823 char structName[1024];
18824 struct Declarator * funcDecl;
18825 struct Symbol * thisSymbol;
18826 unsigned int typedObject = 0;
18827
18828 if(_class && !_class->base)
18829 {
18830 _class = currentClass;
18831 if(_class && !_class->symbol)
18832 _class->symbol = FindClass(_class->fullName);
18833 classSym = _class ? _class->symbol : (((void *)0));
18834 typedObject = 1;
18835 }
18836 thisClass = _class;
18837 if(inCompiler && _class)
18838 {
18839 if(type->kind == 11)
18840 {
18841 if(symbol->type->__anon1.__anon2.params.count == 1 && ((struct Type *)symbol->type->__anon1.__anon2.params.first)->kind == 0)
18842 {
18843 struct Type * param = symbol->type->__anon1.__anon2.params.first;
18844
18845 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(&symbol->type->__anon1.__anon2.params, param);
18846 FreeType(param);
18847 }
18848 if(type->classObjectType != 1)
18849 {
18850 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(&symbol->type->__anon1.__anon2.params, (((void *)0)), MkClassType(_class->fullName));
18851 symbol->type->__anon1.__anon2.staticMethod = 1;
18852 symbol->type->__anon1.__anon2.thisClass = (((void *)0));
18853 symbol->type->extraParam = 0;
18854 }
18855 }
18856 strcpy(className, "__ecereClass_");
18857 FullClassNameCat(className, _class->fullName, 1);
18858 structName[0] = (char)0;
18859 FullClassNameCat(structName, _class->fullName, 0);
18860 funcDecl = GetFuncDecl(function->declarator);
18861 if(funcDecl)
18862 {
18863 if(funcDecl->__anon1.function.parameters && (*funcDecl->__anon1.function.parameters).count == 1)
18864 {
18865 struct TypeName * param = (*funcDecl->__anon1.function.parameters).first;
18866
18867 if(param->qualifiers && (*param->qualifiers).count == 1 && ((struct Specifier *)(*param->qualifiers).first)->__anon1.specifier == VOID && !param->declarator)
18868 {
18869 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->__anon1.function.parameters), param);
18870 FreeTypeName(param);
18871 }
18872 }
18873 if(!function->propertyNoThis)
18874 {
18875 struct TypeName * thisParam = (((void *)0));
18876
18877 if(type->classObjectType != 1)
18878 {
18879 thisParam = QMkClass(_class->fullName, MkDeclaratorIdentifier(MkIdentifier("this")));
18880 if(!funcDecl->__anon1.function.parameters)
18881 funcDecl->__anon1.function.parameters = MkList();
18882 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->__anon1.function.parameters), (((void *)0)), thisParam);
18883 }
18884 if(typedObject)
18885 {
18886 if(type->classObjectType != 1)
18887 {
18888 if(type->byReference || _class->type == 3 || _class->type == 1000 || _class->type == 4 || _class->type == 2)
18889 thisParam->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), thisParam->declarator);
18890 }
18891 thisParam = __extension__ ({
18892 struct TypeName * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TypeName);
18893
18894 __ecereInstance1->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier("class"))), __ecereInstance1->qualifiers = MkListOne(MkStructOrUnion(3, MkIdentifier("__ecereNameSpace__ecere__com__Class"), (((void *)0)))), __ecereInstance1;
18895 });
18896 DeclareStruct(curExternal, "ecere::com::Class", 0, 1);
18897 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->__anon1.function.parameters), (((void *)0)), thisParam);
18898 }
18899 }
18900 }
18901 if(symbol && symbol->__anon2.__anon1.pointerExternal && symbol->__anon2.__anon1.pointerExternal->type == 1)
18902 {
18903 struct InitDeclarator * initDecl = (*symbol->__anon2.__anon1.pointerExternal->__anon1.declaration->__anon1.__anon1.declarators).first;
18904
18905 funcDecl = GetFuncDecl(initDecl->declarator);
18906 if(funcDecl)
18907 {
18908 if(funcDecl->__anon1.function.parameters && (*funcDecl->__anon1.function.parameters).count == 1)
18909 {
18910 struct TypeName * param = (*funcDecl->__anon1.function.parameters).first;
18911
18912 if(param->qualifiers && (*param->qualifiers).count == 1 && ((struct Specifier *)(*param->qualifiers).first)->__anon1.specifier == VOID && !param->declarator)
18913 {
18914 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->__anon1.function.parameters), param);
18915 FreeTypeName(param);
18916 }
18917 }
18918 if(type->classObjectType != 1)
18919 {
18920 if((_class->type != 2 && _class->type != 3 && _class->type != 4) || function != (struct FunctionDefinition *)symbol->__anon2.__anon2.externalSet)
18921 {
18922 struct TypeName * thisParam = QMkClass(_class->fullName, MkDeclaratorIdentifier(MkIdentifier("this")));
18923
18924 if(!funcDecl->__anon1.function.parameters)
18925 funcDecl->__anon1.function.parameters = MkList();
18926 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->__anon1.function.parameters), (((void *)0)), thisParam);
18927 }
18928 }
18929 }
18930 }
18931 }
18932 if(function->body)
18933 {
18934 if(type->classObjectType != 1)
18935 {
18936 thisSymbol = __extension__ ({
18937 struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
18938
18939 __ecereInstance1->string = __ecereNameSpace__ecere__sys__CopyString("this"), __ecereInstance1->type = classSym ? MkClassType(classSym->string) : (((void *)0)), __ecereInstance1;
18940 });
18941 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&function->body->__anon1.compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18942 if(typedObject && thisSymbol->type)
18943 {
18944 thisSymbol->type->classObjectType = 2;
18945 thisSymbol->type->byReference = type->byReference;
18946 thisSymbol->type->typedByReference = type->byReference;
18947 }
18948 }
18949 }
18950 if(inCompiler && _class && _class->type == 0 && type->classObjectType != 1)
18951 {
18952 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
18953
18954 {
18955 struct __ecereNameSpace__ecere__com__Class * base;
18956
18957 for(base = _class; base && base->type != 1000; base = base->next)
18958 {
18959 for(member = base->membersAndProperties.first; member; member = member->next)
18960 if(!member->isProperty)
18961 break;
18962 if(member)
18963 break;
18964 }
18965 }
18966 for(member = _class->membersAndProperties.first; member; member = member->next)
18967 if(!member->isProperty)
18968 break;
18969 if(member)
18970 {
18971 char pointerName[1024];
18972 struct Declaration * decl;
18973 struct Initializer * initializer;
18974 struct Expression * exp, * bytePtr;
18975
18976 strcpy(pointerName, "__ecerePointer_");
18977 FullClassNameCat(pointerName, _class->fullName, 0);
18978 {
18979 char className[1024];
18980
18981 strcpy(className, "__ecereClass_");
18982 FullClassNameCat(className, classSym->string, 1);
18983 DeclareClass(curExternal, classSym, className);
18984 }
18985 bytePtr = QBrackets(MkExpCast(QMkType("char", QMkPtrDecl((((void *)0)))), QMkExpId("this")));
18986 if(_class->fixed)
18987 {
18988 struct Expression * e;
18989
18990 if(_class->offset && _class->offset == _class->base->structSize)
18991 {
18992 e = MkExpClassSize(MkSpecifierName(_class->base->fullName));
18993 ProcessExpressionType(e);
18994 }
18995 else
18996 {
18997 char string[256];
18998
18999 sprintf(string, "%d", _class->offset);
19000 e = MkExpConstant(string);
19001 }
19002 exp = QBrackets(MkExpOp(bytePtr, '+', e));
19003 }
19004 else
19005 {
19006 exp = QBrackets(MkExpOp(bytePtr, '+', MkExpPointer(QMkExpId(className), MkIdentifier("offset"))));
19007 }
19008 exp = QBrackets(QMkExpCond(QMkExpId("this"), exp, MkExpConstant("0")));
19009 exp->expType = __extension__ ({
19010 struct Type * __ecereInstance2 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
19011
19012 __ecereInstance2->refCount = 1, __ecereInstance2->kind = 13, __ecereInstance2->__anon1.type = __extension__ ({
19013 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
19014
19015 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 0, __ecereInstance1;
19016 }), __ecereInstance2;
19017 });
19018 if(function->body)
19019 {
19020 yylloc = function->body->loc;
19021 initializer = MkInitializerAssignment(MkExpCast(MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(structName), (((void *)0)))), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), exp));
19022 {
19023 struct Context * prevContext = curContext;
19024 struct __ecereNameSpace__ecere__sys__OldList * list;
19025
19026 curContext = function->body->__anon1.compound.context;
19027 decl = MkDeclaration((list = MkListOne(MkStructOrUnion(3, MkIdentifier(structName), (((void *)0))))), MkListOne(MkInitDeclarator(QMkPtrDecl(pointerName), initializer)));
19028 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*list), (((void *)0)), MkSpecifierExtended(MkExtDeclAttrib(MkAttrib(ATTRIB, MkListOne(MkAttribute(__ecereNameSpace__ecere__sys__CopyString("unused"), (((void *)0))))))));
19029 curContext = prevContext;
19030 }
19031 decl->symbol = (((void *)0));
19032 if(!function->body->__anon1.compound.declarations)
19033 function->body->__anon1.compound.declarations = MkList();
19034 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*function->body->__anon1.compound.declarations), (((void *)0)), decl);
19035 }
19036 }
19037 }
19038 }
19039 else
19040 thisClass = (((void *)0));
19041 if(id)
19042 {
19043 FreeSpecifier(id->_class);
19044 id->_class = (((void *)0));
19045 if(symbol && symbol->__anon2.__anon1.pointerExternal && symbol->__anon2.__anon1.pointerExternal->type == 1)
19046 {
19047 struct InitDeclarator * initDecl = (*symbol->__anon2.__anon1.pointerExternal->__anon1.declaration->__anon1.__anon1.declarators).first;
19048
19049 id = GetDeclId(initDecl->declarator);
19050 FreeSpecifier(id->_class);
19051 id->_class = (((void *)0));
19052 }
19053 }
19054 if(function->body)
19055 topContext = function->body->__anon1.compound.context;
19056 {
19057 struct FunctionDefinition * oldFunction = curFunction;
19058
19059 curFunction = function;
19060 if(function->body)
19061 ProcessStatement(function->body);
19062 if(inCompiler && function->propSet && !function->propSet->fireWatchersDone)
19063 {
19064 struct Statement * prevCompound = curCompound;
19065 struct Context * prevContext = curContext;
19066 struct Statement * fireWatchers = MkFireWatchersStmt((((void *)0)), (((void *)0)));
19067
19068 if(!function->body->__anon1.compound.statements)
19069 function->body->__anon1.compound.statements = MkList();
19070 ListAdd(function->body->__anon1.compound.statements, fireWatchers);
19071 curCompound = function->body;
19072 curContext = function->body->__anon1.compound.context;
19073 ProcessStatement(fireWatchers);
19074 curContext = prevContext;
19075 curCompound = prevCompound;
19076 }
19077 curFunction = oldFunction;
19078 }
19079 if(function->declarator)
19080 {
19081 ProcessDeclarator(function->declarator, 1);
19082 }
19083 topContext = oldTopContext;
19084 thisClass = oldThisClass;
19085 }
19086
19087 static void ProcessClass(struct __ecereNameSpace__ecere__sys__OldList * definitions, struct Symbol * symbol)
19088 {
19089 struct ClassDef * def;
19090 struct External * external = curExternal;
19091 struct __ecereNameSpace__ecere__com__Class * regClass = symbol ? symbol->__anon1.registered : (((void *)0));
19092
19093 for(def = definitions->first; def; def = def->next)
19094 {
19095 if(def->type == 0)
19096 {
19097 if(def->__anon1.function->declarator)
19098 curExternal = def->__anon1.function->declarator->symbol->__anon2.__anon1.pointerExternal;
19099 else
19100 curExternal = external;
19101 ProcessFunction((struct FunctionDefinition *)def->__anon1.function);
19102 }
19103 else if(def->type == 2)
19104 {
19105 if(def->__anon1.decl->type == 2)
19106 {
19107 thisClass = regClass;
19108 ProcessInstantiationType(def->__anon1.decl->__anon1.inst);
19109 thisClass = (((void *)0));
19110 }
19111 else
19112 {
19113 struct __ecereNameSpace__ecere__com__Class * backThisClass = thisClass;
19114
19115 if(regClass)
19116 thisClass = regClass;
19117 ProcessDeclaration(def->__anon1.decl, symbol ? 1 : 0);
19118 thisClass = backThisClass;
19119 }
19120 }
19121 else if(def->type == 1 && def->__anon1.defProperties)
19122 {
19123 struct MemberInit * defProperty;
19124 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);
19125
19126 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
19127 for(defProperty = (*def->__anon1.defProperties).first; defProperty; defProperty = defProperty->next)
19128 {
19129 thisClass = regClass;
19130 ProcessMemberInitData(defProperty, regClass, (((void *)0)), (((void *)0)), (((void *)0)), (((void *)0)));
19131 thisClass = (((void *)0));
19132 }
19133 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Remove(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
19134 FreeSymbol(thisSymbol);
19135 }
19136 else if(def->type == 3 && def->__anon1.propertyDef)
19137 {
19138 struct PropertyDef * prop = def->__anon1.propertyDef;
19139
19140 thisClass = regClass;
19141 if(prop->setStmt)
19142 {
19143 if(regClass)
19144 {
19145 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
19146
19147 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->setStmt->__anon1.compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
19148 }
19149 curExternal = prop->symbol ? prop->symbol->__anon2.__anon2.externalSet : (((void *)0));
19150 ProcessStatement(prop->setStmt);
19151 }
19152 if(prop->getStmt)
19153 {
19154 if(regClass)
19155 {
19156 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
19157
19158 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->getStmt->__anon1.compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
19159 }
19160 curExternal = prop->symbol ? prop->symbol->__anon2.__anon2.externalGet : (((void *)0));
19161 ProcessStatement(prop->getStmt);
19162 }
19163 if(prop->issetStmt)
19164 {
19165 if(regClass)
19166 {
19167 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
19168
19169 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->issetStmt->__anon1.compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
19170 }
19171 curExternal = prop->symbol ? prop->symbol->__anon2.__anon2.externalIsSet : (((void *)0));
19172 ProcessStatement(prop->issetStmt);
19173 }
19174 thisClass = (((void *)0));
19175 }
19176 else if(def->type == 4 && def->__anon1.propertyWatch)
19177 {
19178 struct PropertyWatch * propertyWatch = def->__anon1.propertyWatch;
19179
19180 thisClass = regClass;
19181 if(propertyWatch->compound)
19182 {
19183 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);
19184
19185 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&propertyWatch->compound->__anon1.compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
19186 curExternal = (((void *)0));
19187 ProcessStatement(propertyWatch->compound);
19188 }
19189 thisClass = (((void *)0));
19190 }
19191 }
19192 }
19193
19194 void __ecereRegisterModule_pass15(struct __ecereNameSpace__ecere__com__Instance * module)
19195 {
19196 struct __ecereNameSpace__ecere__com__Class __attribute__((unused)) * class;
19197
19198 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetYydebug", "void SetYydebug(bool b)", SetYydebug, module, 1);
19199 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetThisClass", "void SetThisClass(ecere::com::Class c)", SetThisClass, module, 1);
19200 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetThisClass", "ecere::com::Class GetThisClass(void)", GetThisClass, module, 1);
19201 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintExpression", "void PrintExpression(Expression exp, char * string)", PrintExpression, module, 1);
19202 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessTemplateParameterType", "Type ProcessTemplateParameterType(TemplateParameter param)", ProcessTemplateParameterType, module, 2);
19203 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("NeedCast", "bool NeedCast(Type type1, Type type2)", NeedCast, module, 2);
19204 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintInt", "char * PrintInt(int64 result)", PrintInt, module, 1);
19205 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUInt", "char * PrintUInt(uint64 result)", PrintUInt, module, 1);
19206 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintInt64", "char * PrintInt64(int64 result)", PrintInt64, module, 1);
19207 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUInt64", "char * PrintUInt64(uint64 result)", PrintUInt64, module, 1);
19208 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintHexUInt", "char * PrintHexUInt(uint64 result)", PrintHexUInt, module, 1);
19209 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintHexUInt64", "char * PrintHexUInt64(uint64 result)", PrintHexUInt64, module, 1);
19210 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintShort", "char * PrintShort(short result)", PrintShort, module, 1);
19211 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUShort", "char * PrintUShort(uint16 result)", PrintUShort, module, 1);
19212 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintChar", "char * PrintChar(char result)", PrintChar, module, 1);
19213 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUChar", "char * PrintUChar(byte result)", PrintUChar, module, 1);
19214 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintFloat", "char * PrintFloat(float result)", PrintFloat, module, 1);
19215 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintDouble", "char * PrintDouble(double result)", PrintDouble, module, 1);
19216 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpInt", "bool GetOpInt(Operand op2, int * value2)", GetOpInt, module, 1);
19217 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetInt", "bool GetInt(Expression exp, int * value2)", GetInt, module, 1);
19218 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUInt", "bool GetOpUInt(Operand op2, uint * value2)", GetOpUInt, module, 1);
19219 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUInt", "bool GetUInt(Expression exp, uint * value2)", GetUInt, module, 1);
19220 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpInt64", "bool GetOpInt64(Operand op2, int64 * value2)", GetOpInt64, module, 1);
19221 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetInt64", "bool GetInt64(Expression exp, int64 * value2)", GetInt64, module, 1);
19222 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUInt64", "bool GetOpUInt64(Operand op2, uint64 * value2)", GetOpUInt64, module, 1);
19223 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUInt64", "bool GetUInt64(Expression exp, uint64 * value2)", GetUInt64, module, 1);
19224 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpIntPtr", "bool GetOpIntPtr(Operand op2, intptr * value2)", GetOpIntPtr, module, 1);
19225 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetIntPtr", "bool GetIntPtr(Expression exp, intptr * value2)", GetIntPtr, module, 1);
19226 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUIntPtr", "bool GetOpUIntPtr(Operand op2, uintptr * value2)", GetOpUIntPtr, module, 1);
19227 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUIntPtr", "bool GetUIntPtr(Expression exp, uintptr * value2)", GetUIntPtr, module, 1);
19228 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpIntSize", "bool GetOpIntSize(Operand op2, intsize * value2)", GetOpIntSize, module, 1);
19229 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetIntSize", "bool GetIntSize(Expression exp, intsize * value2)", GetIntSize, module, 1);
19230 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUIntSize", "bool GetOpUIntSize(Operand op2, uintsize * value2)", GetOpUIntSize, module, 1);
19231 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUIntSize", "bool GetUIntSize(Expression exp, uintsize * value2)", GetUIntSize, module, 1);
19232 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpShort", "bool GetOpShort(Operand op2, short * value2)", GetOpShort, module, 1);
19233 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetShort", "bool GetShort(Expression exp, short * value2)", GetShort, module, 1);
19234 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUShort", "bool GetOpUShort(Operand op2, uint16 * value2)", GetOpUShort, module, 1);
19235 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUShort", "bool GetUShort(Expression exp, uint16 * value2)", GetUShort, module, 1);
19236 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpChar", "bool GetOpChar(Operand op2, char * value2)", GetOpChar, module, 1);
19237 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetChar", "bool GetChar(Expression exp, char * value2)", GetChar, module, 1);
19238 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUChar", "bool GetOpUChar(Operand op2, byte * value2)", GetOpUChar, module, 1);
19239 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUChar", "bool GetUChar(Expression exp, byte * value2)", GetUChar, module, 1);
19240 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpFloat", "bool GetOpFloat(Operand op2, float * value2)", GetOpFloat, module, 1);
19241 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetFloat", "bool GetFloat(Expression exp, float * value2)", GetFloat, module, 1);
19242 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpDouble", "bool GetOpDouble(Operand op2, double * value2)", GetOpDouble, module, 1);
19243 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetDouble", "bool GetDouble(Expression exp, double * value2)", GetDouble, module, 1);
19244 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeClassMembers", "void ComputeClassMembers(ecere::com::Class _class, bool isMember)", ComputeClassMembers, module, 2);
19245 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeModuleClasses", "void ComputeModuleClasses(ecere::com::Module module)", ComputeModuleClasses, module, 1);
19246 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeTypeSize", "int ComputeTypeSize(Type type)", ComputeTypeSize, module, 1);
19247 __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);
19248 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareStruct", "External DeclareStruct(External neededBy, const char * name, bool skipNoHead, bool needDereference)", DeclareStruct, module, 2);
19249 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("_DeclareStruct", "External _DeclareStruct(External neededBy, const char * name, bool skipNoHead, bool needDereference, bool fwdDecl)", _DeclareStruct, module, 2);
19250 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareProperty", "void DeclareProperty(External neededBy, ecere::com::Property prop, char * setName, char * getName)", DeclareProperty, module, 2);
19251 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("Dereference", "Type Dereference(Type source)", Dereference, module, 1);
19252 __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);
19253 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessInstantiationType", "void ProcessInstantiationType(Instantiation inst)", ProcessInstantiationType, module, 2);
19254 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareType", "void DeclareType(External neededFor, Type type, bool needDereference, bool forFunctionDef)", DeclareType, module, 2);
19255 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareTypeForwardDeclare", "void DeclareTypeForwardDeclare(External neededFor, Type type, bool needDereference, bool forFunctionDef)", DeclareTypeForwardDeclare, module, 2);
19256 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindTemplateArg", "ecere::com::ClassTemplateArgument * FindTemplateArg(ecere::com::Class _class, TemplateParameter param)", FindTemplateArg, module, 2);
19257 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetupTemplatesContext", "Context SetupTemplatesContext(ecere::com::Class _class)", SetupTemplatesContext, module, 1);
19258 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FinishTemplatesContext", "void FinishTemplatesContext(Context context)", FinishTemplatesContext, module, 1);
19259 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessMethodType", "void ProcessMethodType(ecere::com::Method method)", ProcessMethodType, module, 1);
19260 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessPropertyType", "void ProcessPropertyType(ecere::com::Property prop)", ProcessPropertyType, module, 1);
19261 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareMethod", "void DeclareMethod(External neededFor, ecere::com::Method method, const char * name)", DeclareMethod, module, 1);
19262 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClass", "char * ReplaceThisClass(ecere::com::Class _class)", ReplaceThisClass, module, 2);
19263 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClassType", "Type ReplaceThisClassType(ecere::com::Class _class)", ReplaceThisClassType, module, 2);
19264 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClassSpecifiers", "void ReplaceThisClassSpecifiers(ecere::sys::OldList specs, ecere::com::Class _class)", ReplaceThisClassSpecifiers, module, 2);
19265 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareFunction", "bool DeclareFunction(External neededFor, ecere::com::GlobalFunction function, char * name)", DeclareFunction, module, 2);
19266 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareGlobalData", "void DeclareGlobalData(External neededFor, GlobalData data)", DeclareGlobalData, module, 2);
19267 class = __ecereNameSpace__ecere__com__eSystem_RegisterClass(5, "Conversion", 0, sizeof(struct Conversion), 0, (void *)0, (void *)0, module, 2, 1);
19268 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)
19269 __ecereClass_Conversion = class;
19270 __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);
19271 __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);
19272 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ModuleVisibility", "bool ModuleVisibility(ecere::com::Module searchIn, ecere::com::Module searchFor)", ModuleVisibility, module, 1);
19273 __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);
19274 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("MatchTypeExpression", "bool MatchTypeExpression(Expression sourceExp, Type dest, ecere::sys::OldList conversions, bool skipUnitBla, bool warnConst)", MatchTypeExpression, module, 2);
19275 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReadString", "void ReadString(char * output, char * string)", ReadString, module, 1);
19276 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("UnescapeString", "int UnescapeString(char * d, char * s, int len)", UnescapeString, module, 1);
19277 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("OffsetEscapedString", "char * OffsetEscapedString(char * s, int len, int offset)", OffsetEscapedString, module, 1);
19278 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOperand", "Operand GetOperand(Expression exp)", GetOperand, module, 1);
19279 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PopulateInstance", "void PopulateInstance(Instantiation inst)", PopulateInstance, module, 1);
19280 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeInstantiation", "void ComputeInstantiation(Expression exp)", ComputeInstantiation, module, 1);
19281 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CallOperator", "void CallOperator(Expression exp, Expression exp1, Expression exp2, Operand op1, Operand op2)", CallOperator, module, 1);
19282 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeExpression", "void ComputeExpression(Expression exp)", ComputeExpression, module, 1);
19283 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CheckTemplateTypes", "void CheckTemplateTypes(Expression exp)", CheckTemplateTypes, module, 1);
19284 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindSymbol", "Symbol FindSymbol(const char * name, Context startContext, Context endContext, bool isStruct, bool globalNameSpace)", FindSymbol, module, 1);
19285 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintType", "void PrintType(Type type, char * string, bool printName, bool fullName)", PrintType, module, 1);
19286 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintTypeNoConst", "void PrintTypeNoConst(Type type, char * string, bool printName, bool fullName)", PrintTypeNoConst, module, 1);
19287 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindMemberAndOffset", "Type FindMemberAndOffset(Type type, char * string, uint * offset)", FindMemberAndOffset, module, 1);
19288 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetParseError", "bool GetParseError(void)", GetParseError, module, 1);
19289 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ParseExpressionString", "Expression ParseExpressionString(char * expression)", ParseExpressionString, module, 1);
19290 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceExpContents", "void ReplaceExpContents(Expression checkedExp, Expression newExp)", ReplaceExpContents, module, 1);
19291 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ApplyAnyObjectLogic", "void ApplyAnyObjectLogic(Expression e)", ApplyAnyObjectLogic, module, 1);
19292 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ApplyLocation", "void ApplyLocation(Expression exp, Location loc)", ApplyLocation, module, 1);
19293 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessExpressionType", "void ProcessExpressionType(Expression exp)", ProcessExpressionType, module, 1);
19294 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareFunctionUtil", "void DeclareFunctionUtil(External neededBy, const String s)", DeclareFunctionUtil, module, 1);
19295 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeDataTypes", "void ComputeDataTypes(void)", ComputeDataTypes, module, 1);
19296 }
19297